documenting-legacy-codebases
БесплатноБез исполняемых скриптовНе проверенLoad when documentation must be rebuilt from the code of an existing system: an inherited codebase, missing or stale docs, or writing up what a system really…
от riekelt★ 43 звезды на GitHubОб этом скилле
Documenting legacy codebases
REQUIRED BACKGROUND: the technical-writing skill (hard rules, kind classification, truth rules, style).
Overview
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.
When to invoke, and not
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).
Survey before prose
Do not start writing at the first interesting file. First enumerate the system's surfaces:
- Entry points and processes: executables, services, scheduled jobs, queue consumers, request handlers.
- Commands and endpoints: everything an operator or client can invoke.
- Configuration: every key, flag, and environment variable the code reads.
- Data: schemas, tables, migrations, files on disk, external stores.
- Integrations: every external system touched, with direction and protocol.
- Build and deploy: how the artifact is produced and where it lands.
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.
Depth follows the surface
The tree describes the generic system; the code states its own implementation, and prose never re-documents it. Kind decides the depth:
- Contract surfaces are exhaustive. What outside parties bind to and cannot read the code for: HTTP endpoints, message payloads, commands, file formats, config keys. These are reference kind, so the core Reference rule applies: every endpoint, every field, every key.
documenting-contractscarries the template for endpoints, messages, commands, and payloads; config keys follow the core Reference rule inconfig-reference.md. - Internals get the gist. A descriptive document states the mechanism and its consequences ("the store is append-only; reads take the tip of the chain; an update replaces the whole record"). The classes, database keys, mappings, and call chains that implement the mechanism stay in the code.
- The refactor test. A finished document sits still while the code is refactored, and changes only when behavior changes or a feature lands. A sentence that a rename would falsify (a method name, a line number, a list of classes) is implementation detail in prose form; lift it to the behavior it implements or cut it.
- Prose carries no code references. A document names the module or path it describes once, in its opening: the drift anchor the core skill's
references/truth.mdrequires. Running prose stays free of paths, class names, and line numbers; exactfile:linebelongs in the findings note, where it is working material for the owner. - The boundary check: a paragraph that only helps a reader who already has the file open is transcription; delete it or reduce it to its anchor. A detail that survives the check is usually a quirk, and quirks are content (below).
The evidence hierarchy
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:
- Code read at HEAD. The source of truth for every descriptive claim.
- Tests that cover the path. A test names expected behavior and proves the code executes; reachability in production comes from the wiring proof under "Dead or alive".
- Runtime evidence, where it exists and reading it is safe: logs, database contents, live configuration. Date it: logs rotate, data changes, and configuration gets edited, so it shows only the moment it was read.
- Commit history. Evidence for the historical document and for when behavior changed; never a substitute for reading the current code.
- Names, comments, existing docs, and human memory. Testimony: quote it, verify it, and only then repeat it. When
Установить documenting-legacy-codebases в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл documenting-legacy-codebases?
Load when documentation must be rebuilt from the code of an existing system: an inherited codebase, missing or stale docs, or writing up what a system really does. Not for documenting a change in progress. Builds on technical-writing: load both.
Как установить скилл documenting-legacy-codebases?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл documenting-legacy-codebases запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic