Lang go
Skill xiaolai/docs-guardian-for-claude/skills/docs-guardian/languages/lang-go
Use when writing, auditing, or generating documentation for Go projects — covers docstring conventions, API doc extraction, and Go-specific patterns.From its SKILL.md
npx -y skills add xiaolai/docs-guardian-for-claude --skill lang-goAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 6 stars6 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.5 KB, as published. Nobody here has run it
Go Language Adapter
Public API Detection
Go uses capitalization as the visibility mechanism. A symbol is public (exported) if:
- Its name starts with an uppercase letter
- It is defined at package level (not inside a function)
| Pattern | Public? |
|---|---|
func ProcessData( | Yes (uppercase P) |
func processData( | No (lowercase p) |
type Config struct | Yes |
type config struct | No |
var MaxRetries = | Yes |
const DefaultTimeout = | Yes |
Symbol Types to Document
| Type | Detection | Documentation Expected |
|---|---|---|
| Functions | func Name( at package level | Godoc comment starting with function name |
| Methods | func (r *Receiver) Name( | Godoc comment starting with method name |
| Types | type Name struct/interface | Godoc comment starting with type name |
| Constants | const Name = (exported) | Godoc comment or inline comment |
| Variables | var Name = (exported) | Godoc comment |
| Package | package name | Package comment in doc.go or any file |
Godoc Format
Go documentation comments must:
- Start with the symbol name
- Be a complete sentence
- Appear directly above the declaration (no blank line between)
// ProcessData reads input from r and returns processed results.
// It returns an error if the input is malformed.
func ProcessData(r io.Reader) ([]Result, error) {
Package Documentation
// Package auth provides user authentication and session management.
//
// It supports OAuth2, JWT, and API key authentication methods.
package auth
Prefer doc.go for package-level documentation.
Documentation Completeness Check
A Go symbol is fully documented when:
- Has a comment directly above it (no blank line gap)
- Comment starts with the symbol's name
- Comment is a complete sentence (ends with period)
- For functions: parameters and return values are described in the prose
Special Cases
internal/packages: exclude from public API coverage (they are internal)_test.gofiles: exclude (test code)generatedfiles (containing// Code generated): exclude- Interface methods: each method should have a comment
File Patterns
Source files: **/*.go
Exclude: vendor/, *_test.go, files with // Code generated header