golang-documentation
Skill3.4k starsChanged 2 months agoMITView on GitHub
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.
- Installs packages
3 other projects use a version of this, 2 of them edited.
Trending
Quiet since October.about the whole repository
Most recently taken up by
- rzisso/golang-skillsword for word, first seen Sep 16, 2026
- alexastrum/skledited, first seen Jun 12, 2026
- guynhsichngeodiec/cc-skills-golangedited, first seen Apr 7, 2026
Who's talking about samber/cc-skills-golang
- @golangch.bsky.social“A collection of Golang agentic skills that works #golang github.com/samber/cc-s...”Bluesky · Jul 16, 2026 · 10 likes
- @samber.bsky.social“My Go skill set: github.com/samber/cc-skills-golang npx skills add samber/cc-skills-golang Open to …”Bluesky · Mar 23, 2026 · 6 likes
- LobsterTrap/lola“[FEATURE] - Cherry Pick Skills”GitHub · May 6, 2026 · 3 reactions
- @golangch.bsky.social“Claude Code Skills for production-ready Golang projects #golang github.com/samber/cc-s...”Bluesky · Mar 29, 2026 · 3 likes
- A Hacker News story“A collection of 35 Golang Agent Skills”Hacker News · Mar 23, 2026 · 3 points
The biggest 5 of 45 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 45
Talked about on GitHub, Bluesky and Hacker News (45 times).
On GitHub · 41
- May 6, 2026[FEATURE] - Cherry Pick Skills — LobsterTrap/lola3 reactions · 1 comment
- Jul 16, 2026Skills with nested metadata maps are silently dropped during discovery — charmbracelet/crush1 reaction
- Mar 30, 2026[SUBMISSION] cc-skills-golang — ProSkillsMD/proskills1 reaction · 1 comment
- Oct 4, 2026claude-code-plugins.github.samber.cc-skills-golang: init at 2.0.0 — sudosubin/agents.nix0 reactions
- Oct 1, 2026agent-skills.github.samber.cc-skills-golang: init at 2.0.0 — sudosubin/agents.nix0 reactions
36 more on GitHub
- Sep 23, 2026Update skill: /samber-golang-structs-interfaces (safe risk) — aiskillstore/marketplace0 reactions
- Sep 23, 2026Update skill: /samber-golang-spf13-viper (safe risk) — aiskillstore/marketplace0 reactions
- Sep 23, 2026Update skill: /samber-golang-benchmark (medium risk) — aiskillstore/marketplacesays it tested it0 reactions
- Sep 23, 2026Update skill: /samber-golang-pkg-go-dev (high risk) — aiskillstore/marketplace0 reactions
- Sep 23, 2026Update skill: /samber-golang-samber-ro (safe risk) — aiskillstore/marketplace0 reactions
- Sep 23, 2026Update skill: /samber-golang-uber-fx (safe risk) — aiskillstore/marketplace0 reactions
- Sep 23, 2026Update skill: /samber-golang-stretchr-testify (safe risk) — aiskillstore/marketplace0 reactions
- Sep 23, 2026Update skill: /samber-golang-swagger (safe risk) — aiskillstore/marketplace0 reactions
- Sep 23, 2026Update skill: /samber-golang-stay-updated (safe risk) — aiskillstore/marketplace0 reactions
- Sep 6, 2026Update skill: /samber-golang-spf13-cobra (safe risk) — aiskillstore/marketplace0 reactions
- Sep 6, 2026Update skill: /samber-golang-cli (safe risk) — aiskillstore/marketplace0 reactions
- Sep 6, 2026Update skill: /samber-golang-lint (medium risk) — aiskillstore/marketplace0 reactions
- Sep 6, 2026Update skill: /samber-golang-samber-slog (medium risk) — aiskillstore/marketplace0 reactions
- Sep 6, 2026Update skill: /samber-golang-modernize (safe risk) — aiskillstore/marketplace0 reactions
- Sep 6, 2026Update skill: /samber-golang-samber-lo (safe risk) — aiskillstore/marketplace0 reactions
- Sep 6, 2026Update skill: /samber-golang-documentation (safe risk) — aiskillstore/marketplace0 reactions
- Sep 5, 2026corpus tier3 cites an id with no path: the largest source's provenance handle cannot be followed — jonhill90/agent-estate0 reactions · 1 comment
- Sep 3, 2026chore: sync upstream skills (auto) — marcioaltoe/skills0 reactions
- Sep 2, 2026chore: sync upstream skills (auto) — marcioaltoe/skills0 reactions
- Aug 19, 2026add `samber` golang skills — greenbone/opensight-golang-libraries0 reactions · 4 comments
- Jul 17, 2026fix: import skills with nested metadata and surface parse errors — gridctl/gridctl0 reactions
- Jul 17, 2026fix: skill import fails on nested metadata frontmatter with misleading 'no SKILL.md files found' error — gridctl/gridctl0 reactions
- Jul 16, 2026chore: sync upstream skills — marcioaltoe/skills0 reactions
- Jul 3, 2026New skill: /samber-golang-performance (safe risk) — aiskillstore/marketplace0 reactions
- Jul 1, 2026New skill: /samber-golang-error-handling (low risk) — aiskillstore/marketplace0 reactions
- Jul 1, 2026New skill: /samber-golang-code-style (low risk) — aiskillstore/marketplace0 reactions
- Jun 26, 2026Integrate samber/cc-skills-golang: install full general-purpose set + full-list reminder at plan & each scenario — ArcadeAI/safeword0 reactions · 3 comments
- Jun 26, 2026[FEATURE] Add Golang skills selectively — inference-gateway/cli0 reactions
- Jun 24, 2026chore(skills): sync upstream skills — marcioaltoe/skills0 reactions
- Jun 7, 2026feature/naming-linting-testing-skills — joekhosbayar/go-mightysays it tested it0 reactions
- May 22, 2026🔐 ci: pin + sandbox the skills install in claude-review.yml — martinciu/ccpulse0 reactions
- May 21, 2026🔐 ci: pin or sandbox the unpinned npx skills install in claude-review.yml — martinciu/ccpulse0 reactions · 1 comment
- Apr 25, 2026Audit candidate: samber/cc-skills-golang — xiaolai/nlpm0 reactions · 3 comments
- Mar 30, 2026[Resource]: cc-skills-golang — hesreallyhim/awesome-claude-code0 reactions · 1 comment
- Mar 29, 2026golang skills — sushichan044/dotfiles0 reactions
- Mar 22, 2026Add a claude code skills for Golang — jqueryscript/awesome-claude-code0 reactions
On Bluesky · 3
- Jul 16, 2026A collection of Golang agentic skills that works #golang github.com/samber/cc-s... — @golangch.bsky.social10 likes and reposts
- Mar 23, 2026My Go skill set: github.com/samber/cc-skills-golang npx skills add samber/cc-skills-golang Open to contributions. If you're building skills… — @samber.bsky.social6 likes and reposts
- Mar 29, 2026Claude Code Skills for production-ready Golang projects #golang github.com/samber/cc-s... — @golangch.bsky.social3 likes and reposts · 1 reply
On Hacker News · 1
- Mar 23, 2026A collection of 35 Golang Agent Skills3 points · 2 comments
Other versions3 projects use a version of this.
Word for word · 1
- rzisso/golang-skills★ 0100% same
Edited · 2
- alexastrum/skl★ 1094% same
- guynhsichngeodiec/cc-skills-golang★ 094% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository46 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- golang-benchmarkSkill
- golang-cliSkill
- golang-code-styleSkill
- golang-concurrencySkill
- golang-contextSkill
- golang-continuous-integrationSkill
- golang-databaseSkill
- golang-data-structuresSkill
- golang-dependency-injectionSkill
- golang-dependency-managementSkill
- golang-design-patternsSkill
- golang-error-handlingSkill
- golang-google-wireSkill
- golang-goplsSkill
- golang-graphqlSkill
- golang-grpcSkill
- golang-how-toSkill
- golang-lintSkill
- golang-modernizeSkill
- golang-namingSkill
- golang-observabilitySkill
- golang-performanceSkill
- golang-pkg-go-devSkill
- golang-popular-librariesSkill
- golang-project-layoutSkill
- golang-refactoringSkill
- golang-safetySkill
- golang-samber-doSkill
- golang-samber-hotSkill
- golang-samber-loSkill
- golang-samber-moSkill
- golang-samber-oopsSkill
- golang-samber-roSkill
- golang-samber-slogSkill
- golang-securitySkill
- golang-spf13-cobraSkill
- golang-spf13-viperSkill
- golang-stay-updatedSkill
- golang-stretchr-testifySkill
- golang-structs-interfacesSkill
- golang-swaggerSkill
- golang-testingSkill
- golang-troubleshootingSkill
- golang-uber-digSkill
- golang-uber-fxSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 8 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 35
Write documentation that serves both humans and AI agents.
- Distinctive: line 62
Before documenting, determine the project type — it changes what documentation is needed:
- Distinctive: line 80
Every Go project needs these (ordered by priority):
- Distinctive: line 102
When documenting a large codebase with many packages, use up to 5 parallel sub-agents for independent tasks:
- Distinctive: line 110
Every exported function and method MUST have a doc comment.
- Distinctive: line 203
If your project exposes an API:
- Distinctive: line 211
Prefer auto-generation from code annotations when possible.
- Distinctive: line 224
Document how users get your project:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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-documentationskill 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-namingskill for naming conventions in doc comments. - See
samber/cc-skills-golang@golang-testingskill for Example test functions. - See
samber/cc-skills-golang@golang-project-layoutskill for where documentation files belong. - See
samber/cc-skills@humanizer-en-asd-ste100skill 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,
ExampleXxxfunctions, playground demos, pkg.go.dev rendering - See Library Documentation
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
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
ExampleXxxtest functions for multiple packages simultaneously - Generate project docs in parallel: one sub-agent per file (README, CONTRIBUTING, CHANGELOG, llms.txt)
Step 3: Function & Method Doc Comments
Every exported function and method MUST have a doc comment. Document complex internal functions too. Skip test functions.
The comment starts with the function name and a verb phrase. Focus on why and when, not restating what the code already shows. The code tells you what happens — the comment should explain why it exists, when to use it, what constraints apply, and what can go wrong. Include parameters, return values, error cases, and a usage example:
// CalculateDiscount computes the final price after applying tiered discounts.
// Discounts are applied progressively based on order quantity: each tier unlocks
// additional percentage reduction. Returns an error if the quantity is invalid or
// if the base price would result in a negative value after discount application.
//
// Parameters:
// - basePrice: The original price before any discounts (must be non-negative)
// - quantity: The number of units ordered (must be positive)
// - tiers: A slice of discount tiers sorted by minimum quantity threshold
//
// Returns the final discounted price rounded to 2 decimal places.
// Returns ErrInvalidPrice if basePrice is negative.
// Returns ErrInvalidQuantity if quantity is zero or negative.
//
// Play: https://go.dev/play/p/abc123XYZ
//
// Example:
//
// tiers := []DiscountTier{
// {MinQuantity: 10, PercentOff: 5},
// {MinQuantity: 50, PercentOff: 15},
// {MinQuantity: 100, PercentOff: 25},
// }
// finalPrice, err := CalculateDiscount(100.00, 75, tiers)
// if err != nil {
// log.Fatalf("Discount calculation failed: %v", err)
// }
// log.Printf("Ordered 75 units at $100 each: final price = $%.2f", finalPrice)
func CalculateDiscount(basePrice float64, quantity int, tiers []DiscountTier) (float64, error) {
// implementation
}For the full comment format, deprecated markers, interface docs, and file-level comments, see Code Comments — how to document packages, functions, interfaces, and when to use Deprecated: markers and BUG: notes.
Step 4: README Structure
README SHOULD follow this exact section order. Copy the template from templates/README.md:
- Title — project name as
# heading - Badges — shields.io pictograms (Go version, license, CI, coverage, Go Report Card...)
- Summary — 1-2 sentences explaining what the project does
- Demo — code snippet, GIF, screenshot, or video showing the project in action
- Getting Started — installation + minimal working example
- Features / Specification — detailed feature list or specification (very long section)
- Contributing — link to CONTRIBUTING.md or inline if very short
- Contributors — thank contributors (badge or list)
- License — license name + link
Common badges for Go projects:
[](https://go.dev/) [](./LICENSE) [](https://github.com/{owner}/{repo}/actions) [](https://codecov.io/gh/{owner}/{repo}) [](https://goreportcard.com/report/github.com/{owner}/{repo}) [](https://pkg.go.dev/github.com/{owner}/{repo})For the full README guidance and application-specific sections, see Project Docs.
Step 5: CONTRIBUTING & Changelog
CONTRIBUTING.md — Help contributors get started in under 10 minutes, covering prerequisites, clone, build, test, and PR process. If setup takes longer, improve the process with a Makefile, docker-compose, or devcontainer. See Project Docs.
Changelog — Track changes using Keep a Changelog format or GitHub Releases, copying the template from templates/CHANGELOG.md. Write each entry to answer what changed for the reader — internal refactors without user-visible impact belong in commit history, and a fixed edge case never becomes a broad "reliability improvement" claim. See Project Docs.
Step 6: Library-Specific Documentation
For Go libraries, add these on top of the basics:
- Go Playground demos — create runnable demos and link them in doc comments with
// Play: https://go.dev/play/p/xxx. Use a Go Playground integration when one is available to create and share playground URLs. - Example test functions — write
func ExampleXxx()in_test.gofiles. These are executable documentation verified bygo test. - Generous code examples — include multiple examples in doc comments showing common use cases.
- godoc — your doc comments render on pkg.go.dev. Use
go doclocally to preview; to inspect how a published package renders its docs, symbols, and examples, → Seesamber/cc-skills-golang@golang-pkg-go-devskill. - Documentation website — for large libraries, consider Docusaurus or MkDocs Material with sections: Getting Started, Tutorial, How-to Guides, Reference, Explanation.
- Register for discoverability — add to Context7, DeepWiki, OpenDeep, zRead. Even for private libraries.
See Library Documentation for details.
Step 7: Application-Specific Documentation
For Go applications/CLIs:
- Installation methods — pre-built binaries (GoReleaser),
go install, Docker images, Homebrew... - CLI help text — make
--helpcomprehensive; it's the primary documentation - Configuration docs — document all env vars, config files, CLI flags
See Application Documentation for details.
Step 8: API Documentation
If your project exposes an API:
| API Style | Format | Tool |
| REST/HTTP | OpenAPI 3.x | swaggo/swag (auto-generate from annotations) |
| Event-driven | AsyncAPI | Manual or code-gen |
| gRPC | Protobuf | buf, grpc-gateway |
Prefer auto-generation from code annotations when possible. See Application Documentation for details.
Step 9: AI-Friendly Documentation
Make your project consumable by AI agents:
- llms.txt — add a
llms.txtfile at the repository root. Copy the template from templates/llms.txt. This file gives LLMs a structured overview of your project. - Structured formats — use OpenAPI, AsyncAPI, or protobuf for machine-readable API docs.
- Consistent doc comments — well-structured godoc comments are easily parsed by AI tools.
- Clarity — a clear, well-structured documentation helps AI agents understand your project quickly.
Step 10: Delivery Documentation
Document how users get your project:
Libraries:
go get github.com/{owner}/{repo}Applications:
# Pre-built binary
curl -sSL https://github.com/{owner}/{repo}/releases/latest/download/{repo}-$(uname -s)-$(uname -m) -o /usr/local/bin/{repo}
# From source
go install github.com/{owner}/{repo}@latest
# Docker
docker pull {registry}/{owner}/{repo}:latestSee Project Docs for Dockerfile best practices and Homebrew tap setup.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

