AgentSkillsCN

documentation

撰写与更新文档:README、API 文档、ADR、内联文档与操作手册。适用于用户要求为某项内容撰写文档、更新 README、编写 API 文档、撰写 ADR,或添加内联文档时使用。

SKILL.md
--- frontmatter
name: documentation
description: "Write and update documentation: README, API docs, ADRs, inline docs, and runbooks. Use when the user asks to document this, update README, write API docs, write ADR, or add inline documentation."
triggers:
  - "/docs"
  - "document this"
  - "update README"
  - "write README"
  - "API docs"
  - "write ADR"
  - "architecture decision"
  - "add comments"
  - "inline docs"
  - "runbook"

Documentation Skill

Core Philosophy

"Docs that stay in sync with code and intent."

Write documentation that is accurate, scannable, and updated when behavior changes. Prefer living docs over one-off writeups.


Protocol

1. Identify Type

TypeUse forLocation / format
READMEProject overview, setup, usageRoot README.md
API docsEndpoints, params, responsesOpenAPI/Swagger, or docs/api.md
ADRArchitecture decisions and rationaledocs/adr/ or context/adr/
InlinePublic APIs, non-obvious logicCode comments, docstrings
RunbookOperational proceduresdocs/runbooks/ or docs/ops/

2. Conventions

  • README: Quick start, prerequisites, install, run, test, contribute. Keep under ~200 lines; link to detailed docs.
  • API docs: Method/path, request/response shape, errors, examples. Prefer OpenAPI when the project uses it.
  • ADR: Context, decision, consequences. One file per decision; number and date in filename.
  • Inline: Explain why, not what. Docstrings for public functions/classes; avoid noise on trivial code.
  • Runbook: Steps, checks, rollback, contacts. Assume someone unfamiliar can follow.

3. Commands

No mandatory commands. Use project structure: if docs/ or CONTRIBUTING.md exists, follow existing layout and style.

4. MCP (Atlassian Confluence)

When documentation lives in Confluence or the user wants to sync with Confluence, use the Atlassian MCP (after /setup) to fetch pages, search with CQL, and list spaces. Use tools such as getConfluencePage, searchConfluenceUsingCql, getConfluenceSpaces, and getPagesInConfluenceSpace to read or align with existing Confluence docs. Ensure /setup has been run so Atlassian MCP is configured.

5. Output

When adding or updating docs, provide the content and say what was created/updated. If the project has a docs style guide, follow it.


Checklist

  • Matches current behavior (no outdated steps or APIs).
  • Scannable (headings, lists, code blocks where useful).
  • Links to related docs or code when helpful.
  • No duplicate info across README and other docs; cross-reference instead.