/docs:writing-docsfrom docs
Use when starting, designing, or building a new feature (it needs a feature doc), when making or recording a major technical decision (it needs an ADR), or when writing or revising any project documentation in Markdown.
Ships in docs. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Write a feature doc for each new feature, and an architecture decision record (ADR) for each major decision. The rules for both are in this file. The templates contain structure only.
Write the feature doc before or alongside the code, and update it whenever the feature changes.
Write an ADR when a decision meets any of these:
When unsure, write the ADR. It is short.
Follow the project's existing layout if it has one. Otherwise:
| Doc | Path | Template |
|---|---|---|
| Feature doc | docs/features/<feature-name>.md | templates/feature.md |
| ADR | docs/adr/NNNN-<decision-title>.md | templates/adr.md |
Names are lowercase kebab-case. ADR numbers have four digits and count up from 0001. Don't keep a separate list of ADRs, because the folder listing is the index.
To start a doc, copy its template and fill in the sections, removing the HTML guidance comments as you go. Delete a section that has nothing to say rather than writing "N/A" in it.
Write each fact in one place. Other docs link to that place.
[retry policy](../features/sync.md#retry-policy).CLAUDE.md, and code comments link to the doc with the fact instead of summarizing it.Before adding a fact, search the docs for it. If it already exists, link to it.
A doc describes the current state. When the design changes or a revision is requested, rewrite the affected text so the doc reads as if it had always said the new thing.
Never add:
Git keeps the history. Describe a past state only when the past state is the subject, as in the context section of an ADR.
While an ADR has status: proposed, revise it in place like any other doc.
Once its status is accepted, its decision is fixed. If the decision changes:
status: superseded and superseded-by: NNNN-title.md.Typo and broken-link fixes in an accepted ADR are fine.
Draw diagrams in Mermaid code blocks, so they render on GitHub and change in the same diff as the text. Don't use ASCII art or image files.
Use the diagram type that matches the subject:
| Subject | Mermaid type |
|---|---|
| Control flow, components | flowchart |
| Interactions over time | sequenceDiagram |
| Lifecycles | stateDiagram-v2 |
| Data models | erDiagram |
Add a diagram when it shows structure that prose can't show briefly, and leave it out when it would only repeat a short paragraph. A diagram goes in the same single place as the facts it shows, and other docs link to it. Use short node labels, and put explanations in the surrounding prose.
sequenceDiagram
Client->>API: POST /sessions
API->>Redis: store session
API-->>Client: 201 Created
A hook runs Vale with vale-ai-tells after every .md write and sends you its findings. Fix each finding by rewriting the passage. Add a suppression comment only for a false positive, such as a quoted term or a literal name, and scope it to that one rule and passage:
<!-- vale ai-tells.RuleName = NO -->
The passage that quotes the flagged term.
<!-- vale ai-tells.RuleName = YES -->
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub hiroshisuda/agent-skills --plugin docs