Update docs

From Kevin-Liu-01/Agent-Machines · View interactive version

Update docs is an AI agent skill from the GitHub repository Kevin-Liu-01/Agent-Machines. Update documentation after code changes. Covers source-level docs (module docs, docstrings, inline comments) and docs-site pages. Use after any code change to keep documentation in sync with reality.

How to use this skill

Skill file

Update Docs

Keep documentation in sync with code. Run this after code changes to find

and fix stale, missing, or unclear documentation.

Scope

Documentation lives in two places:

  1. Source-level: module docs, docstrings, inline comments, README files

adjacent to the code.

  1. Docs site: docs/src/ (Mintlify). Architecture pages, product

pages, internal references.

Both layers must agree with each other and with the code.

Phase 1: Identify what changed

Run git diff (or git diff HEAD if staged) to see the code changes.

For each changed file, note:

Phase 2: Update source-level docs

Apply the /comment skill principles to every changed file.

Module docs must answer three questions

A reader opening the file cold must know within 30 seconds:

  1. What does this module do?
  2. Why does it exist? (What problem does it solve? Why is it separate

from the neighboring module?)

  1. Where does it fit? (Who calls it? What does it depend on?)

If the code change alters any of these answers, update the module doc.

Least experienced reader rule

transformations

What to check per changed file

of non-obvious wrappers?

lose information the code alone cannot convey?)

citations) still point to correct targets?

What NOT to add

Phase 3: Update docs site

Check whether the code change affects any page in docs/src/.

Decision tree

  1. New subsystem or service: add a page under the appropriate group

in docs/src/docs.json. Follow the structure of existing peers.

  1. Changed architecture or contracts: update the relevant architecture

page (e.g., dcs/architecture/runtime.mdx for runtime changes).

  1. Changed public API surface: update the product page and any

getting-started or pricing pages that reference the API.

  1. Internal-only change (refactor, extract helper, rename private

symbol): usually no docs-site change needed. Only update if the

architecture page describes the internal structure at a level that

would now be wrong.

Docs site principles

The docs site explains what the system does and why. Source comments

explain how the code works. Do not put implementation details (wire

formats, trait bounds, helper functions) on the docs site. Do not put

architectural context (system diagrams, ownership tables, product

contracts) only in source comments.

Least experienced reader applies here too. A new engineer reading the

docs site should understand the system without opening the code. Spell out

jargon. Define terms inline. Use diagrams when they clarify a mechanism.

Docs site checklist

removed? Group structure still makes sense?

renamed pages?

Phase 4: Verify consistency

Check that the three layers (code, source docs, site docs) agree:

Common drift patterns

What to skip

update pipelines

scope of the code change

Anti-patterns

change that caused the drift should have updated the docs. Fix forward,

but note the gap.

line-by-line translation of the code. It explains the system at the

level a human needs to make decisions.

belong on the docs site where they render. Source comments get

file-local diagrams only (byte layouts, small state machines).

updated. A new reader might enter through either path.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.