go-documentation

Write Go documentation following doc comment and godoc formatting standards.

2|1|Updated Mar 12, 2026
One-click install
npx skills add https://github.com/zajca/zfaktury --skill go-documentation-zajca
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-documentation
Source: https://github.com/zajca/zfaktury/tree/main/.agents/skills/go-documentation
Command: npx skills add https://github.com/zajca/zfaktury --skill go-documentation-zajca

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidelines and best practices for writing clear, effective, and discoverable documentation for Go code, ensuring consistency and maintainability.

Core Features & Use Cases

  • Doc Comment Standards: Learn the rules for documenting exported names, structs, and methods.
  • Package Documentation: Understand how to write effective package-level comments, including for main packages.
  • Code Examples: Discover how to create runnable examples that demonstrate package usage.
  • Use Case: When writing a new Go package, use this Skill to ensure all exported functions, types, and methods are documented according to Go's established conventions, making the code easier for others to understand and use.

Quick Start

Consult the go-documentation skill for guidance on writing effective doc comments for Go functions.

Frequently Asked Questions about go-documentation

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

FAQPage Schema
How do I write effective Go documentation for exported functions and types?

To write effective Go documentation, you must add doc comments directly preceding exported names, structs, and methods. Following these godoc standards ensures your Go code is clear, discoverable, and maintainable for other users.

What is the best way to document a Go package?

Documenting a Go package requires adding a package comment that provides a clear overview, including specific guidance for main packages. This package-level documentation establishes context and usage conventions for the entire codebase.

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

You can add runnable examples to your Go package documentation by writing example functions that demonstrate package usage. These code examples appear in godoc and help users understand how to interact with your exported APIs.

What should I include in Go doc comments for struct fields and parameters?

Go doc comments for struct fields and parameters should provide concise descriptions of their purpose and constraints. Documenting these elements according to Go's established conventions improves overall code clarity and error reporting.

When do I need to follow godoc formatting standards for code comments?

You need to follow godoc formatting standards whenever you write comments for exported names in Go. Adhering to these documentation standards ensures your code comments are properly parsed and displayed by documentation tools.

Does Go documentation best practices require specific formatting for error reporting?

Yes, Go documentation best practices include specific guidelines for error reporting to ensure clarity and maintainability. Documenting errors and exported names according to conventions makes your Go code easier for others to understand and use.