godoc
Installation
SKILL.md
Go Doc for Agents
Make the exported API usable from package and symbol documentation without requiring a separate guide. Put the smallest useful recipe in doc comments and verify it with Go examples.
Steps
- Read repository instructions, the supported Go version, and existing documentation conventions. Identify the requested packages and preserve unrelated changes.
- Read exported declarations, implementations, tests, and current examples. Establish actual behavior before describing it. Flag unresolved contracts instead of inventing guarantees.
- Read the syntax reference before writing comments. Read the examples reference when adding or repairing usage recipes.
- Write one package overview, usually in
doc.go. Name the use case, recommended entry points, shortest setup/use/cleanup sequence, and relevant alternatives. Include an indented code recipe with the real import path so plaingo docexposes basic usage. - Document each in-scope exported symbol's contract at its declaration. Keep each symbol understandable when queried alone. Use the contract table below to select relevant details.
- Add or update external-package examples for the important recipes. Reuse existing examples when they already cover the workflow. Keep the short comment recipe consistent with its compiled example.
- Format changed Go files using the repository's formatter. Inspect package and symbol output with
go doc. Run example tests and the affected package tests. Compile-check comment recipes too; they are not tested automatically. - Review the diff for unsupported promises, broken symbol links, stale examples, and unrelated edits. Report changed packages and verification results.