One-click install
npx skills add https://github.com/phant-app/phant --skill go-documentation-phant-app
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-documentation
Source: https://github.com/phant-app/phant/tree/main/.agents/skills/go-documentation
Command: npx skills add https://github.com/phant-app/phant --skill go-documentation-phant-app

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Go projects often struggle with inconsistent and unclear documentation, leading to onboarding bottlenecks and maintenance challenges. This skill provides structured guidelines for doc comments, package docs, godoc formatting, runnable examples, and signal-boosting to ensure readable and reliable Go documentation.

Core Features & Use Cases

  • Doc comment conventions for exported names and internal APIs, including sentence structure and capitalization.
  • Guidance on package-level documentation, godoc formatting, and the inclusion of runnable examples.
  • Techniques for clear, consistent documentation across codebases, enabling easier code reviews and onboarding.

Quick Start

Review a Go package and align its documentation with these guidelines to improve readability and maintainability.

Frequently Asked Questions about go-documentation

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

FAQPage Schema
How do I write doc comments for exported Go functions?

Doc comments for exported Go functions should start with the function name as a complete sentence, describing its behavior clearly. Following these conventions ensures consistency and improves readability across the codebase.

What is the best way to format package-level documentation in Go?

Package-level documentation in Go should be placed in a doc.go file or above the package clause. It should provide a clear overview of the package's purpose and usage, adhering to godoc formatting norms.

How do I add runnable examples to my Go package docs?

Runnable examples in Go are added by creating functions named Example in test files. These examples are formatted and displayed in godoc, demonstrating actual API usage that can be executed directly.

Does this approach work for large Go codebases with varying sizes?

Yes, these documentation guidelines apply to Go codebases of varying sizes. They provide structured standards for doc comments and formatting, ensuring maintainability and easier onboarding for large projects.

Why does consistent Go documentation matter for code reviews?

Consistent Go documentation matters because it establishes clear norms for sentence structure and capitalization. This consistency enables easier code reviews by reducing cognitive load and ensuring reliable, readable documentation.