Documentation Maintenance
Keep documentation true to the code. Out-of-date docs mislead humans and agents
and are often worse than none. Treat documentation as part of the change, not a
follow-up.
Identify What a Change Invalidates
- Review the change and list every document it could contradict:
- README — setup, commands, prerequisites, and feature summaries.
- API docs — signatures, parameters, return values, errors, and examples.
- Architecture notes — component responsibilities, data flow, and diagrams.
- ADRs — decisions the change reverses, supersedes, or fulfills.
- Changelog — any user-visible addition, change, fix, or removal.
- Inline comments and docstrings near the edited code.
- Search the documentation for the names, commands, flags, paths, and values the
change touched. Renamed or removed identifiers are a common source of staleness.
- Decide for each affected document whether to update, supersede, or delete
content. Do not leave a contradiction unresolved.
Update Principles
- Document rationale, not just mechanics. Explain why something works the way
it does and what constraint it satisfies, so a reader can adapt it rather than
copy it blindly. The code already shows the mechanics.
- Keep setup instructions executable and verified. Run the documented setup
and command sequence, or trace it exactly, and confirm it still works. Update
any step the change altered.
- Keep examples runnable. Ensure code samples compile or run against the
current interfaces. A broken example is a defect.
- Remove stale content; do not append to it. Delete or rewrite the outdated
passage rather than adding a correction beside it. Layered corrections rot fast.
- Use consistent terminology with the code and the rest of the documentation.
- Use relative links within the repository so they survive relocation.
Architecture Decision Records
Write an ADR when a change makes or reverses a significant, hard-to-undo decision,
such as a technology choice, an interface contract, or a structural boundary.
- Copy the ADR template.
- Record the context and forces, the decision, the alternatives considered and
why they were rejected, and the consequences including trade-offs.
- Give the ADR a stable number and a status: proposed, accepted, superseded, or
deprecated.
- Do not edit an accepted ADR's decision after the fact. Supersede it with a new
ADR that links back to the one it replaces, preserving the history.
Changelog
Update the changelog whenever a change is visible to users of the software.
- Add an entry under the unreleased section using
the changelog entry format.
- Classify it as Added, Changed, Deprecated, Removed, Fixed, or Security.
- Describe the effect on the user, not the internal implementation.
- Call out breaking changes explicitly and describe the migration.
- Skip purely internal changes with no user-visible effect, such as a refactor
that alters no behavior.
Verify
- Re-read each updated document in full for internal consistency.
- Confirm every documented command and example was checked against the current
code, and note which were run.
- Confirm no contradiction, dead link, or stale identifier remains.
Report
Return: the documents updated, superseded, or deleted; the commands and examples
verified and their result; any ADR added or superseded; the changelog entry; and
any documentation gap left for follow-up.
1---2name: documentation-maintenance3description: Keeps README, API docs, architecture notes, ADRs, and changelogs accurate when code changes by identifying which documents a change invalidates, documenting rationale, keeping setup instructions and examples runnable, updating the changelog with user-visible changes, and removing stale content. Use when code, configuration, commands, interfaces, or behavior change and documentation must be updated, or when writing an ADR or changelog entry.4license: MIT5---67# Documentation Maintenance89Keep documentation true to the code. Out-of-date docs mislead humans and agents10and are often worse than none. Treat documentation as part of the change, not a11follow-up.1213## Identify What a Change Invalidates14151. Review the change and list every document it could contradict:16 * **README** — setup, commands, prerequisites, and feature summaries.17 * **API docs** — signatures, parameters, return values, errors, and examples.18 * **Architecture notes** — component responsibilities, data flow, and diagrams.19 * **ADRs** — decisions the change reverses, supersedes, or fulfills.20 * **Changelog** — any user-visible addition, change, fix, or removal.21 * **Inline comments and docstrings** near the edited code.222. Search the documentation for the names, commands, flags, paths, and values the23 change touched. Renamed or removed identifiers are a common source of staleness.243. Decide for each affected document whether to update, supersede, or delete25 content. Do not leave a contradiction unresolved.2627## Update Principles2829* **Document rationale, not just mechanics.** Explain why something works the way30 it does and what constraint it satisfies, so a reader can adapt it rather than31 copy it blindly. The code already shows the mechanics.32* **Keep setup instructions executable and verified.** Run the documented setup33 and command sequence, or trace it exactly, and confirm it still works. Update34 any step the change altered.35* **Keep examples runnable.** Ensure code samples compile or run against the36 current interfaces. A broken example is a defect.37* **Remove stale content; do not append to it.** Delete or rewrite the outdated38 passage rather than adding a correction beside it. Layered corrections rot fast.39* **Use consistent terminology** with the code and the rest of the documentation.40* **Use relative links** within the repository so they survive relocation.4142## Architecture Decision Records4344Write an ADR when a change makes or reverses a significant, hard-to-undo decision,45such as a technology choice, an interface contract, or a structural boundary.46471. Copy [the ADR template](assets/adr-template.md).482. Record the context and forces, the decision, the alternatives considered and49 why they were rejected, and the consequences including trade-offs.503. Give the ADR a stable number and a status: proposed, accepted, superseded, or51 deprecated.524. Do not edit an accepted ADR's decision after the fact. Supersede it with a new53 ADR that links back to the one it replaces, preserving the history.5455## Changelog5657Update the changelog whenever a change is visible to users of the software.58591. Add an entry under the unreleased section using60 [the changelog entry format](assets/changelog-entry.md).612. Classify it as Added, Changed, Deprecated, Removed, Fixed, or Security.623. Describe the effect on the user, not the internal implementation.634. Call out breaking changes explicitly and describe the migration.645. Skip purely internal changes with no user-visible effect, such as a refactor65 that alters no behavior.6667## Verify68691. Re-read each updated document in full for internal consistency.702. Confirm every documented command and example was checked against the current71 code, and note which were run.723. Confirm no contradiction, dead link, or stale identifier remains.7374## Report7576Return: the documents updated, superseded, or deleted; the commands and examples77verified and their result; any ADR added or superseded; the changelog entry; and78any documentation gap left for follow-up.