go-source-documentation

Adds idiomatic godoc-compliant doc comments to Go source and test files.

37|4|Updated Apr 11, 2026
One-click install
npx skills add https://github.com/jmrplens/gitlab-mcp-server --skill go-source-documentation-jmrplens
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-source-documentation
Source: https://github.com/jmrplens/gitlab-mcp-server/tree/main/.github/skills/go-source-documentation
Command: npx skills add https://github.com/jmrplens/gitlab-mcp-server --skill go-source-documentation-jmrplens

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Go codebases often lack consistent, godoc-compliant documentation, making packages hard to navigate and maintain. This Skill applies standardized documentation patterns to Go source and test files without altering any code logic. ## Core Features & Use Cases - 16 Documentation Patterns: Covers package comments, file headers, input/output structs, handler functions, interfaces, deprecations, benchmarks, fuzz tests, examples, and BUG/TODO annotations. - Detailed Test Documentation: Enforces What/How/Expected/Why doc comments on test functions, including table-driven tests and test helpers. - Validation Workflow: Verifies results with golangci-lint, go build, go test, and go doc to confirm only comments changed and all exported symbols are documented. - Use Case: Ask the assistant to document an undocumented Go package, and it will add package comments, struct and function docs, and detailed test explanations while running build and lint checks to confirm nothing broke. ## Quick Start Document all Go files in the internal/tools/branches package with idiomatic godoc comments.

Frequently Asked Questions about go-source-documentation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add godoc-compliant comments to Go code?

Start each doc comment with the symbol name, place it immediately before the declaration with no blank line, and use // line comments rather than block comments. Every package needs exactly one Package comment, typically in doc.go.

How should Go test functions be documented?

Document each test with four elements: what behavior is tested, how the test is set up such as mock configuration, the expected assertions, and why the test protects a business rule or edge case. Table-driven tests should also list every covered scenario.

Does documenting Go code require changing any code logic?

No. Documentation work must never modify function bodies, signatures, or variable names. After adding comments, verify with go build, go test, and golangci-lint that only comments changed and everything still compiles and passes.

Why does my Go doc comment not appear in godoc output?

A blank line between the comment and the declaration breaks the association, rendering it a regular comment. Also ensure the comment starts with the symbol name and that doc links only reference exported symbols, since unexported links do not resolve.

When should I use Deprecated comments in Go?

Use the standard // Deprecated: directive on its own paragraph for any symbol being phased out, and always name the replacement. This convention is recognized by Go 1.19+ tooling and surfaces the notice in godoc and IDEs.