/technical-writer:documenting-legacy-codebasesfrom technical-writer
Documents legacy or inherited codebases where documentation is missing, stale, or untrusted. Uses survey-first inventory, evidence hierarchy, and coverage ledger to reconstruct docs from code at HEAD.
Ships in technical-writer. 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.
None: SKILL.md is the whole skill.
REQUIRED BACKGROUND: the technical-writing skill (hard rules, kind classification, truth rules, style).
A legacy codebase has one reliable witness: the code at HEAD. Everything else that speaks about it (names, comments, old documents, diagrams, the memory of whoever is left) is testimony. Core principle: describe how the system works and what to look out for, verified against the code; the code stays the authority on how it is implemented. The deliverable is a docs tree the next engineer trusts and the next refactor leaves untouched: only changed behavior or a new feature sends anyone back to edit it.
Invoke when documenting a system that exists and is under-documented: an inherited or acquired codebase, a system whose authors left, a docs tree that no longer matches the code. A "what does this actually do" investigation that must end in documents also qualifies. Do NOT invoke for documenting a change you are making; the core skill and the document-type skills cover documentation-with-change. Not for arguing a rewrite, which is writing-design-docs, fed by these documents. And not for fixing what the grounding finds: the code fix sits outside this plugin; noting the oddity does not (see quirks and defects).
Do not start writing at the first interesting file. First enumerate the system's surfaces:
Each count is a claim, so the count rule in references/truth.md in the core skill applies: print the command behind it, run it at HEAD, date it. Commands, counts, and dates land in the coverage ledger, where drift is expected; the documents stay still. Derive the docs tree from the inventory, not from reading order.
The tree describes the generic system; the code states its own implementation, and prose never re-documents it. Kind decides the depth:
documenting-contracts carries the template for endpoints, messages, commands, and payloads; config keys follow the core Reference rule in config-reference.md.references/truth.md requires. Running prose stays free of paths, class names, and line numbers; exact file:line belongs in the findings note, where it is working material for the owner.What a claim may rest on before it is written, in descending order of trust. The hierarchy binds the writer's verification; the page shows one opening anchor per document, and the depth rules above decide the rest:
A briefing from the previous owner, an architecture diagram, a "the sync service handles that" all get verified in code before they enter a document; only what the code confirmed gets written.
Code that looks load-bearing can be unreachable, and code that looks dead can be the production path. Never assume; prove:
references/truth.md forbids present-tense prose about code that cannot currently run.The proof convinces the writer and its command goes in the coverage ledger; the document states the outcome. Dead code earns prose only where a reader would trip over it, and that mention is a quirk.
The core skill's classification table governs every document you touch or create. Reference kind is settled by the depth rules above, and a runbook you touch follows writing-runbooks; the remaining kinds:
references/truth.md).git log shows goes in the historical document as history. Inferred intent ("this appears to have been a workaround for...") is labeled as inference and carries what it is inferred from.file:line in the findings note for the owner to pick up, and the documents link that line rather than repeating it: no severity triage, no verification pipeline. Judging and fixing belong to the owner, and an audit is its own engagement.Keep one ledger beside the tree (coverage.md in the skeleton below):
reviewing-technical-prose allows is not enough here.The campaign parallelizes along the inventory, and where the runtime can orchestrate multiple agents (a workflow tool, subagent dispatch), use it; the same phases run sequentially when it cannot:
processes.md, drawn per diagramming-processes; the trace runs at the mid-sized tier.The one-writer rule and the trust rule from the coverage ledger apply throughout, and model choice follows the labels above: mechanical work small, extraction small to mid-sized, judgment mid-sized. Where the prompt-engineer plugin is installed, its isolating-untrusted-work, writing-prompt-contracts, tiering-models, and verifying-agent-claims skills govern the agent mechanics, and they win over this section on any point of agent handling. Their fast, strong, and judge roles map onto small, mid-sized, and largest here.
Shape the tree from the inventory; a serviceable default:
docs/
README.md # index of this tree, one line per document, how to read this
# (confidence tiers: Measured / Sourced / Estimated)
overview.md # system boundary and the real dependency map, from imports and
# wiring, never from an old diagram
<subsystem>.md # one descriptive doc per subsystem; its module named once
# in the opening, no code references in the prose
config-reference.md # every key with default, binding evidence, and Usage; dead
# knobs marked dead
api-reference.md # every endpoint, command, and message payload, written
# per documenting-contracts; file formats included
integrations.md # every external system, direction, protocol, failure behavior
data-model.md # what is stored, who owns it, its lifecycle, and its
# quirks; the migrations own the columns and keys
processes.md # the end-to-end business processes: prose with the
# diagrams in diagrams/ (see diagramming-processes)
diagrams/ # one source file per process, plus the diagram index
history.md # what git log shows, dated; inference labeled as inference
findings.md # the findings note: suspected defects, one line each with
# file:line, for the owner
coverage.md # the coverage ledger: denominators, counts, per-document status
unknowns.md # what was not determined, and what was checked before giving up
The unknowns document is required even when empty: "no unknowns" is a claim. Every entry names what was checked, so the next attempt starts where this one stopped.
What SKILL.md sets; muted values are Claude Code's defaults
11 skills in this plugin
/diagramming-processesUse when a business process, workflow, lifecycle, or interaction between systems needs a diagram - a flow that prose serializes badly, a state machine, a message sequence, an enterprise process map - or when drawing the process documentation of a legacy campaign. Encodes diagrams-as-source, the notation ladder from ArchiMate to PlantUML, the kind-per-question table, behavior-level participants, the diagram index, and the same-change maintenance rule. Use whenever a document needs a graph rather than more paragraphs, even if nobody says "PlantUML"./documenting-contractsUse when documenting an HTTP API, message payloads, queue contracts, DTOs, file formats, or webhooks - or when writing the api-reference of a legacy campaign, or when callers keep asking what a field means or which errors an endpoint returns. Encodes the four detail levels, the DTO-first catalog, wire types with source anchors, the generated-spec one-home rule, and omitted-versus-null semantics. Use whenever a machine interface needs documenting for its callers, even if nobody says "API docs"./recording-decisionsUse when a decision needs recording - an ADR, a decision log entry, or when someone asks to write down why something was chosen, rejected, or superseded. Encodes the ADR and decision-log formats. Use whenever a choice was made that would otherwise live only in chat, even if nobody says "ADR".npx claudepluginhub riekelt/technical-writer --plugin technical-writerOther plugins' skills for the same job