agentleFS
charlesmsiegelcharlesmsiegel/coding-skills/skills/update-docs/SKILL.md

update-docs

Skill2 starsChanged 4 months agoMITView on GitHub

Build or refresh a project's own documentation skill — a SKILL.md plus references/ that gives an agent (or a new developer) working knowledge of the codebase. Use when the user says "update the docs", "regenerate the documentation", "refresh the project docs", "document this codebase", "write a CLAUDE.md for this", or "the docs are out of date". Checks the existing docs against the tree first — broken citations, files that changed since, directories churning with no coverage — and revises what actually went stale instead of rewriting from scratch. Every claim it writes must be traceable to a file it read. For a visual codebase atlas with diagrams, use code-visualization instead.

89 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use get-pr-reviews, push-everything and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • saffron-healthSkill

    get-pr-reviews

    Get nicely formatted output of the last review comments on a PR. Used internally by other skills.

    Also in 3 projects that use this

  • saffron-healthSkill

    push-everything

    Stage ALL changes in the repository (not just session changes), commit, and push. Use when you need to commit all pending changes.

    Also in 3 projects that use this

  • TheKREATORSSkill

    instinct-export

    Export instincts from project/global scope to a file

    Also in 3 projects that use this

  • TheKREATORSSkill

    instinct-import

    Import instincts from file or URL into project/global scope

    Also in 3 projects that use this

  • NVIDIASkill

    generate-spec

    Produce a feature specification covering API changes, backward compatibility, cross-language impact, performance, and a file-level change plan. Use when designing a new feature, planning a significant change, or the user asks to spec something out.

    Also in 3 projects that use this

  • belokonmSkill

    fullstack-developer

    End-to-end feature expert specializing in frontend-backend integration, system architecture, and complete application development

    Also in 4 projects that use this

  • +1 more from saffron-health
  • +1 more from TheKREATORS

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 83 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If there are no docs yet, it says so — that is a first write, and the whole staleness step is skipped.

    line 39
  2. Distinctive:

    Run them in parallel only if the user has asked for subagents — otherwise work the four axes yourself, in order.

    line 53
  3. Very specific:

    Cite: Every non-obvious claim carries a path/to/file.py:88.

    line 65
  4. Distinctive:

    Never write a claim you cannot cite: If you can't point at the line, you are guessing.

    line 99
  5. Distinctive:

    Don't invent conventions: Document what the code does, not what it should do.

    line 107

“Common” is measured: kept by at least 6 in 10 of the 83 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Update the Project Documentation

Produce documentation whose claims are true of the code as it is now, and keep it that way cheaply. Every statement traces to a file that was read; nothing is inferred from a directory name.

Let SKILL=/path/to/this/skill — the directory holding this SKILL.md. Commands run from the repository being documented, not from the skill directory. Needs Python 3.11+ and git; the churn analysis reads history, so on a shallow clone (git rev-parse --is-shallow-repository → true) the "directories churning with no coverage" finding is unreliable — fetch full history or say the check was skipped.

First: is this a refresh or a first write?

python "$SKILL/scripts/check_doc_staleness.py"                       # .claude/skills/documentation
python "$SKILL/scripts/check_doc_staleness.py" --docs docs/ --repo .
python "$SKILL/scripts/check_doc_staleness.py" --format json

The script reports four mechanically-checkable things:

FindingMeaning
missing_pathA cited path matches nothing in the tree — it moved or was deleted
citation_past_eofA file:line citation points past the end of that file
changed_since_documentedA cited file has been committed to since the docs were written
undocumented_churnA directory is churning and no doc page mentions it

The last one is the one worth reading carefully: missing documentation is invisible by construction. You cannot spot it by reading the docs, only by comparing them against where the work is actually happening.

If there are no docs yet, it says so — that is a first write, and the whole staleness step is skipped.

A refresh is not a rewrite. Findings tell you which pages to revisit. Prose that is still accurate stays; rewriting it burns tokens and throws away judgment that was correct. Rewrite from scratch only when the architecture genuinely changed out from under the docs.

Explore

For a first write, or for the areas the staleness pass flagged, survey along four axes — structure, stack and patterns, data flow, and conventions. references/exploration-plan.md has the four briefs and what each must return.

Run them in parallel only if the user has asked for subagents — otherwise work the four axes yourself, in order. They are a checklist, not a mandated fan-out.

Then read the files the survey flagged. Entry points, core modules, configs, schemas. Not everything — enough that every claim you are about to write is one you have evidence for.

Write

Structure and the SKILL.md/references split are in references/doc-structure.md. The rules that matter most:

  • Cite. Every non-obvious claim carries a path/to/file.py:88. This is what makes the next staleness pass possible — an uncited claim can never be checked, only re-derived.
  • Prefer paths to line numbers where the file is small or the symbol is unique. Line numbers rot fastest.
  • Write what is not in the code. Why this structure, what the constraints were, which alternative was rejected, where the sharp edges are. A reader can read the code; they cannot read the reasoning.
  • Say what you did not cover. A documentation set claiming no gaps is lying.

Verify before finishing

Re-run the staleness check against what you just wrote:

python "$SKILL/scripts/check_doc_staleness.py" --format json

missing_path and citation_past_eof must be empty. If you wrote a citation that does not resolve, you wrote a claim you did not check — fix it now rather than shipping documentation that is wrong on its first day.

Then spot-check two or three substantive claims by opening the file and confirming the code says what you said it says.

The failure this exists to prevent

Documentation generated from directory names and file names — plausible, well-organized, and wrong. It reads as authoritative and costs more than no documentation, because a reader trusts it instead of the code.

Three habits prevent it:

  1. Never describe a file you did not open. A name is a hypothesis.
  2. Never write a claim you cannot cite. If you can't point at the line, you are guessing.
  3. When you are unsure, say so in the text. "The retry path here is not obvious to me; see worker.py:120" is worth more than a confident wrong sentence, and it tells the next reader where to look.

Boundaries

  • Don't invent conventions. Document what the code does, not what it should do. A style critique belongs in a review, not in documentation.
  • Don't delete reference pages just because they weren't regenerated. Confirm the subject is actually gone first.
  • Commit as its own change (docs: refresh project documentation), never mixed with code — a docs diff mixed into a feature diff gets skimmed.

Reference index (load on demand)

Load this when…File
Surveying the codebase — the four briefs and what each must returnreferences/exploration-plan.md
Deciding what goes in SKILL.md vs references/, and how to write each pagereferences/doc-structure.md

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.