go-doc

Format Go doc comments for go doc and pkgsite rendering.

Updated Dec 1, 2025
One-click install
npx skills add https://github.com/zskulcsar/code-stats --skill go-doc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-doc
Source: https://github.com/zskulcsar/code-stats/tree/main/.codex/skills/go-doc
Command: npx skills add https://github.com/zskulcsar/code-stats --skill go-doc

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill ensures your Go documentation adheres to official standards, making it clear, discoverable, and correctly rendered across Go tools and platforms.

Core Features & Use Cases

  • Style & Rendering: Formats doc comments for go doc and pkgsite.
  • Content Guidance: Provides rules for lead sentences, linking, and structured content.
  • Use Case: When documenting a new Go package, use this Skill to draft comments that will look professional and be easily understood by other developers.

Quick Start

Format the Go doc comment for the MyFunction function in the current package.

Frequently Asked Questions about go-doc

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

FAQPage Schema
How do I format Go doc comments to render correctly on pkgsite?

To format Go doc comments for pkgsite, structure lead sentences, cross-references, lists, and code blocks according to official style rules. This ensures documentation renders correctly and is discoverable across Go tools.

What is the standard structure for a Go doc comment lead sentence?

A standard Go doc comment lead sentence begins with the exported identifier name and provides a concise summary. Formatting this lead sentence correctly is required for proper indexing and rendering in go doc and pkgsite.

How do I convert informal code notes into formal golang doc comments?

To convert informal notes into formal golang doc comments, review existing text and restructure it to align with official documentation style. This applies specific formatting rules for lists, cross-references, and structured content.

Does every exported Go identifier need a formal doc comment?

Yes, every exported Go identifier should have a formal doc comment to ensure package documentation is complete. Adhering to official style rules makes the API clear, discoverable, and correctly rendered on platforms like pkgsite.

What is the best way to add cross-references in Go documentation?

The best way to add cross-references in Go documentation is to follow official style rules for linking identifiers. Proper cross-referencing ensures that related packages and functions are correctly linked when rendered by pkgsite.

When should I not use standard formatting for Go doc comments?

You should not skip standard formatting for Go doc comments when preparing a package for public or team use. Ignoring official style and pkgsite rendering rules leads to misformatted lists, code blocks, and broken cross-references.