Skip to content
Development
Skill

/golang-documentation

Comprehensive documentation guide for Golang projects, covering godoc comments, README, CONTRIBUTING, CHANGELOG, Go Playground, Example tests, API docs, and llms.txt. Use when writing or reviewing doc comments, documentation, adding code examples, setting up doc sites, or

From plugin
cc-skills-golang
3.8k46 skills

Claude Code

$ npx -y skills add samber/cc-skills-golang --skill golang-documentation --agent claude-code

SKILL.md

golang-documentation.SKILL.md
name: golang-documentation
description: "Comprehensive documentation guide for Golang projects, covering godoc comments, README, CONTRIBUTING, CHANGELOG, Go Playground, Example tests, API docs, and llms.txt. Use when writing or reviewing doc comments, documentation, adding code examples, setting up doc sites, or discussing documentation best practices. Triggers for both libraries and applications/CLIs."
user-invocable: true
license: MIT
compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang.
metadata:
  author: samber
  version: "1.3.2"
  openclaw:
    emoji: "๐Ÿ“"
    homepage: https://github.com/samber/cc-skills-golang
    requires:
      bins:
        - go
    install: []
allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch
paths:
  - "**/*.go"

**Persona:** You are a Go technical writer and API designer. You treat documentation as a first-class deliverable โ€” accurate, example-driven, and written for the reader who has never seen this codebase before.

**Orchestration mode:** Fan out the sub-agents described in the "Parallelizing Documentation Work" section (one per package, or one per doc layer/file) for documenting or auditing documentation across a large codebase, and merge their output into the final docs. On Claude Code, use `ultracode` to opt into multi-agent orchestration explicitly.

**Modes:**

  • **Write mode** โ€” generating or filling in missing documentation (doc comments, README, CONTRIBUTING, CHANGELOG, llms.txt). Work sequentially through the checklist in Step 2, or parallelize across packages/files using sub-agents.
  • **Review mode** โ€” auditing existing documentation for completeness, accuracy, and style. Use up to 5 parallel sub-agents: one per documentation layer (doc comments, README, CONTRIBUTING, CHANGELOG, library-specific extras).

> **Community default.** A company skill that explicitly supersedes `samber/cc-skills-golang@golang-documentation` skill takes precedence.

Go Documentation

Write documentation that serves both humans and AI agents. Good documentation makes code discoverable, understandable, and maintainable.

Cross-References

  • See `samber/cc-skills-golang@golang-naming` skill for naming conventions in doc comments.
  • See `samber/cc-skills-golang@golang-testing` skill for Example test functions.
  • See `samber/cc-skills-golang@golang-project-layout` skill for where documentation files belong.
  • See `samber/cc-skills@humanizer-en-asd-ste100` skill for strict, controlled English prose (ASD-STE100) when documentation demands maximal clarity and unambiguity.

Writing Principles

Apply to every piece of documentation you write or review:

**Concision** โ€” write the shortest version that carries the idea. Remove ornament and hollow transitions. Never drop facts, warnings, or user-requested depth.

**Intent over paraphrase** โ€” code shows _what_ happens; docs explain _why_ it exists, _when_ to use it, _what constraints_ apply. A comment that only restates the signature wastes the reader's time.

**No invented context** โ€” omit unsupported rationale, marketing claims (`seamlessly`, `robust`, `enterprise-grade`), or future promises. Leave gaps visible rather than filling with speculation.

**Preserve meaning when editing** โ€” keep modality intact (`must`/`should`/`may` are different obligations). Preserve conditions, warnings, required actions. A cleaner sentence that changes obligations is wrong.

**Anti-patterns to remove on sight:** pure-paraphrase comments that start with the name but add nothing (godoc requires the name as prefix โ€” what it forbids is stopping there), signature restatement, marketing vocabulary, groundless future claims (`future extensibility`, `easy to scale`), hollow transitions (`it's worth noting that`, `in conclusion`), template padding that adds no information.

For regulated or safety-critical documentation that requires strict controlled-English prose, โ†’ See `samber/cc-skills@humanizer-en-asd-ste100` skill.

Step 1: Detect Project Type

Before documenting, determine the project type โ€” it changes what documentation is needed:

**Library** โ€” no `main` package, meant to be imported by other projects:

  • Focus on godoc comments, `ExampleXxx` functions, playground demos, pkg.go.dev rendering
  • See [Library Documentation](./references/library.md)

**Application/CLI** โ€” has `main` package, `cmd/` directory, produces a binary or Docker image:

  • Focus on installation instructions, CLI help text, configuration docs
  • See [Application Documentation](./references/application.md)

**Both apply**: function comments, README, CONTRIBUTING, CHANGELOG.

**Architecture docs**: for complex projects, use the `docs/` directory and design description docs.

Step 2: Documentation Checklist

Every Go project needs these (ordered by priority):

| Item | Required | Library | Application | | --- | --- | --- | --- | | Doc comments on exported functions | Yes | Yes | Yes | | Package comment (`// Package foo...`) โ€” MUST exist | Yes | Yes | Yes | | README.md | Yes | Yes | Yes | | LICENSE | Yes | Yes | Yes | | Getting started / installation | Yes | Yes | Yes | | Working code examples | Yes | Yes | Yes | | CONTRIBUTING.md | Recommended | Yes | Yes | | CHANGELOG.md or GitHub Releases | Recommended | Yes | Yes | | Example test functions (`ExampleXxx`) | Recommended | Yes | No | | Go Playground demos | Recommended | Yes | No | | API docs (e.g., OpenAPI) | If applicable | Maybe | Maybe | | Documentation website | Large projects | Maybe | Maybe | | llms.txt | Recommended | Yes | Yes |

A private project might not need a documentation website, llms.txt, Go Playground demos...

Parallelizing Documentation Work

When documenting a large codebase with many packages, use up to 5 parallel sub-agents for independent tasks:

  • Assign each sub-agent to verify and fix doc comments in a different set of packages
  • Generate `ExampleXxx` test functions for multiple packages
Read more
@samber
Ships withcc-skills-golang

AI agent skills are reusable instruction sets that extend your coding assistant with domain-specific expertise, loaded on demand so they don't bloat your context. This repository covers Go-specific skills only (language, testing, security, observability, etc.)

Stars on GitHub

Momentum

stars in total
3.8k
Star history of samber/cc-skills-golang on GitHub, a chart by star-history.com

Other skills on cc-skills-golang.

golang-benchmark

golang-benchmark

Golang benchmarking, profiling, and performance measurement. Use when writing, running, or comparing Go benchmarks, profiling hotโ€ฆ

golang-cli

golang-cli

Golang CLI application development. Use when building, modifying, or reviewing a Go CLI tool โ€” especially for command structure,โ€ฆ

golang-code-style

golang-code-style

Golang code style conventions โ€” line length and breaking, variable declarations, control flow clarity, when comments help vsโ€ฆ

golang-concurrency

golang-concurrency

Golang concurrency design โ€” goroutine lifecycle and leak prevention, channels and `select`, channel ownership and direction,โ€ฆ

golang-context

golang-context

Idiomatic context.Context usage in Golang โ€” propagation through API boundaries, cancellation, timeouts and deadlines,โ€ฆ

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, orโ€ฆ

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills12d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android โ€” semantic ARIA roles and labels,โ€ฆ

ecc13d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commitsโ€ฆ

react2d252k
@facebook@facebookInstall Skill

Questions about golang-documentation.

Which coding agents can use golang-documentation?
golang-documentation installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.