go-documentation

Enforce Go documentation best practices across packages, types, and functions.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Go projects often struggle with maintaining consistent, high-quality documentation across packages, types, and functions.

Core Features & Use Cases

  • Doc Comment Rules: ensure all exported identifiers have clear doc comments that start with the name and end with punctuation.
  • Package and Godoc Formatting: guidelines for package comments, package-level docs, and Godoc-friendly formatting.
  • Runnable Examples & Testing: provide runnable examples that compile and demonstrate usage.
  • Clarity and Style: enforce complete sentences and Go style conventions in comments.

Quick Start

Review a Go package and add clear doc comments, runnable examples, and proper package documentation to meet Go style guidelines.

Frequently Asked Questions about go-documentation

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

FAQPage Schema
How do I write Go documentation that complies with Godoc style guidelines?

To write Godoc-compliant Go documentation, ensure all exported identifiers have doc comments starting with the identifier name and ending with punctuation. Package comments should provide package-level documentation using proper Godoc formatting conventions.

What are the rules for Go package comments and doc comments?

Go package comments and doc comments must start with the name of the element being documented and end with a period. Complete sentences are required for clarity, and package-level documentation needs to summarize the package's purpose according to Go style conventions.

How do I add runnable examples to a Go package?

Runnable examples in a Go package are added as example functions that compile and demonstrate usage. They must be executable to pass example verification, showing users exactly how to interact with the package's exported functions and types.

Can I enforce Go documentation standards during code reviews or CI?

Yes, you can enforce Go documentation standards during code reviews or CI by checking for complete doc comments on exported identifiers, package documentation, and runnable examples. This ensures all Godoc formatting and style requirements are met automatically.

Why does my Go code review fail on missing doc comments?

Go code reviews fail on missing doc comments when exported packages, types, or functions lack proper documentation. Enforcing doc comment norms requires every exported identifier to have a clear comment starting with its name to satisfy Go style guidelines.

Does Go documentation require runnable examples for all exported functions?

Go documentation best practices require runnable examples that compile and demonstrate usage for packages. While not every single exported function needs an example, providing runnable examples ensures the package's functionality is verified and clearly demonstrated.