x-doc-go

Enforce doc.go contracts and Russian doc-comments for exported Go symbols.

2|Updated Apr 12, 2026
One-click install
npx skills add https://github.com/pure-golang/level85 --skill x-doc-go
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: x-doc-go
Source: https://github.com/pure-golang/level85/tree/main/.agents/skills/x-doc-go
Command: npx skills add https://github.com/pure-golang/level85 --skill x-doc-go

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill prevents Go packages from becoming hard to understand and risky to reuse by enforcing a consistent contract via doc.go, complete Russian doc-comments, and testable examples.

Core Features & Use Cases

  • doc.go as a package contract: ensures each (non-cmd/non-mocks) package defines a clear contract that explains what it implements, how to create it, which environment variables it supports, and what lifecycle/usage constraints apply.
  • Exported symbol documentation enforcement: requires every exported type/function/method to have a full Russian doc-comment sentence ending with a period, enabling reliable discovery and review.
  • Example-driven clarity: encourages adding Go Example tests when they replace or validate documentation snippets, keeping docs and behavior in sync.
  • Smoke-check workflow: provides an automated way to run a doc.go structure check via the included script.

Quick Start

Ask the assistant to review or fix the target Go package by adding/updating doc.go and ensuring all exported symbols have proper Russian doc-comments, then run the doc.go smoke-check for that package directory.

Frequently Asked Questions about x-doc-go

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

FAQPage Schema
How do I enforce consistent Go package documentation across my codebase?

Enforcing consistent Go package documentation requires adding a doc.go file to define the package contract, supported environment variables, and lifecycle constraints. This standardization prevents packages from becoming hard to understand and risky to reuse.

What is the standard structure for a doc.go file in a Go package?

A standard doc.go file acts as a contract explaining what the package implements, how to create it, supported environment variables, and lifecycle constraints. It must contain a correct package comment and declaration structure.

How do I validate exported Go symbols have proper doc-comments?

You validate exported Go symbols by ensuring every exported type, function, and method has a full Russian doc-comment sentence ending with a period. An included smoke-check script can automatically validate this structure for a package directory.

Does my Go package require Example tests to document behavior?

Go Example tests are optional but encouraged when they clarify documented behavior or validate documentation snippets. Adding them keeps the package's documentation and runtime behavior in sync.

Can I use this documentation enforcement for command packages and mocks?

You cannot use this enforcement for command packages and mocks. The doc.go contract and Russian doc-comment rules explicitly exclude non-cmd and non-mocks Go packages from these mandatory documentation requirements.