golang-comments

Craft Go doc comments with [Name] links and standard formatting.

3|Updated Jul 13, 2020
One-click install
npx skills add https://github.com/nieomylnieja/dotfiles --skill golang-comments
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-comments
Source: https://github.com/nieomylnieja/dotfiles/tree/main/config/agents/skills/golang-comments
Command: npx skills add https://github.com/nieomylnieja/dotfiles --skill golang-comments

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Go projects often struggle with inconsistent, hard-to-navigate documentation. This skill provides structured guidelines to ensure every exported symbol has a proper doc comment, and that references, headings, and formatting follow Go conventions.

Core Features & Use Cases

  • Doc comment style guidance for packages, types, functions, methods, and variables.
  • Correct use of doc links in Go comments using [Name] style references to enable navigation in pkg.go.dev.
  • Clear rules for headings, lists, and code blocks to improve readability and consistency.
  • Use Case: apply these rules when documenting a library or updating documentation across a Go codebase.

Quick Start

Apply these Go doc comment rules to a package to ensure clean, navigable, and consistent documentation.

Frequently Asked Questions about golang-comments

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

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

Navigable Go doc comments require proper syntax using [Name] style references to enable documentation navigation on pkg.go.dev. Structured guidelines ensure exported functions, methods, and types have consistent formatting and compliant references.

What is the correct syntax for doc links in Go documentation?

Correct doc links in Go documentation use [Name] style references to create navigable connections between packages, types, and functions. This syntax ensures references resolve correctly on pkg.go.dev.

How do I format headings and code blocks in Go doc comments?

Formatting headings and code blocks in Go doc comments requires following specific style-guide rules for lists and references. Clear formatting rules improve readability and maintain consistency across a library codebase.

Does every exported symbol in a Go package need a doc comment?

Yes, every exported symbol in a Go package needs a doc comment. Structured guidelines ensure exported variables, types, and functions have proper documentation that follows Go conventions.

What's the best way to ensure consistent documentation across a Go codebase?

The best way to ensure consistent documentation across a Go codebase is applying structured style-guide rules for doc comments. This enforces proper formatting, correct link syntax, and clear headings across packages.

Why are my Go package comments not generating links on pkg.go.dev?

Go package comments fail to generate links on pkg.go.dev when they lack correct [Name] style doc link syntax. Applying proper documentation conventions resolves navigation issues and ensures references resolve.