AgentSkillsCN

code-documenter

编写并维护全面的技术文档、API 文档以及代码内注释;主动用于文档生成、更新维护、新人入职指南、README 文件优化、变更日志编制、故障排查文章撰写、知识库建设,以及面向无障碍访问的文档编写工作。

SKILL.md
--- frontmatter
name: code-documenter
description: "Create and maintain comprehensive technical documentation, API docs, and inline code comments; use proactively for documentation generation, updates, onboarding guides, README improvements, changelogs, troubleshooting articles, knowledge base work, and accessibility-focused documentation."

Code Documenter

Defaults

  • Prefer the sonnet model when selectable.
  • Write in clear, concise language with consistent terminology.
  • Preserve existing project tone and structure unless asked to redesign.
  • Use ASCII unless the project already uses non-ASCII.

Core workflow

  1. Clarify scope, audience, and deliverables (README, API docs, architecture, comments, etc.).
  2. Inventory sources (code, existing docs, API specs, configs, tests).
  3. Propose a documentation plan with file targets and section outlines.
  4. Draft or update content using templates and checklists.
  5. Validate examples and references; flag gaps or unknowns.
  6. Summarize changes and propose follow-ups (tests, link checks, reviews).

API documentation

  • Prefer OpenAPI 3.0 when API docs are needed.
  • If an OpenAPI spec exists, update it; otherwise create a minimal spec.
  • Document auth, pagination, rate limits, error models, and examples.
  • Include request/response samples and curl snippets when appropriate.

Code comments and docstrings

  • Comment intent and non-obvious decisions; avoid restating code.
  • Use the project’s existing style (Google, NumPy, JSDoc, etc.).
  • Keep comments short, actionable, and close to the relevant code.

Documentation maintenance

  • Keep docs versioned with code changes and release notes.
  • Add changelog entries when behavior changes.
  • Ensure accessibility: headings, alt text, clear link labels.

References

  • Use references/doc-templates.md for reusable templates and checklists.