Generate and keep up to date a complete documentation set for a codebase - CLAUDE.md (repo /init), root and per-directory README.md files, application/API reference docs covering endpoints and functions, an architecture design document, TODO.md, SECURITY.md, CHANGELOG.md, and handoff notes for the next person or session. Use this skill whenever the user asks to document a repo or app, write or refresh a README, produce handoff or onboarding notes, draft an architecture doc, build an API or function reference, start or update a changelog, create a TODO or security doc, run or verify /init and CLAUDE.md, or says anything like "the docs are stale", "document this codebase", "I'm handing this project off", "write up what we did", "wrap up this session", or "get this repo ready for someone else". Also use it proactively at the end of a substantial coding session, before a handoff, or after a large refactor, even if the user only asks for one of these documents - offer the rest.
Ships in repo-docs. 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.
Read when SKILL.md points to them; scripts run unread.
Produce and maintain a coherent documentation set for a codebase. The value is not in writing eight files once; it is in writing them so they can be re-run against a changed repo without destroying human edits and without drifting from the code.
1. Ground everything in the code. Never document a function, endpoint, env var, or
data flow you have not read. Auto-generated docs fail almost exclusively by confident
invention — an endpoint that was renamed, a config key that never existed. If you cannot
find it in the source, either leave it out or mark it <!-- unverified --> with a note.
Every API entry and architecture claim should be traceable to a real path/to/file.py:42.
2. Never leak secrets. You will be reading .env files, configs, and CI definitions.
Document that a secret exists and where it is read from; never write the value. If you
find a live credential committed to the repo, stop, tell the user directly, and add it to
SECURITY.md as an unresolved finding — do not paste the value into any document.
| Artifact | Default location | Purpose |
|---|---|---|
| CLAUDE.md | repo root | Working instructions for Claude: commands, conventions, gotchas |
| README.md | repo root | What it is, how to run it, where to look next |
| README.md | each significant directory | What lives here, why, and how it connects |
| API / reference | docs/API.md | Endpoints, CLI commands, public functions, events |
| Architecture | docs/ARCHITECTURE.md | Components, data flow, decisions, diagram |
| TODO | TODO.md | Prioritized, sourced backlog |
| Security | SECURITY.md | Posture, boundaries, secrets handling, findings |
| Changelog | CHANGELOG.md | Keep a Changelog format, derived from git history |
| Handoff notes | docs/HANDOFF.md | State of play for whoever picks this up next |
Follow whatever the repo already does over these defaults. If docs live in documentation/
or the changelog is HISTORY.md, keep it there; adopt the existing house style rather
than imposing this one.
Determine which of three modes you are in, and say which one you picked:
For bootstrap on a repo of any size, confirm scope before writing: which directories,
whether per-directory READMEs are wanted everywhere or only in top-level packages, and
whether docs go in docs/ or root. Cheap question, expensive mistake.
python scripts/repo_survey.py /path/to/repo --json > /tmp/survey.json
This inventories directories, languages, entry points, dependency manifests, config and env files, existing docs, git metadata, and — if a previous run left a manifest — which files changed since. Read the summary, then read the actual code: entry points first, then routing/CLI definitions, then the modules the entry points import. Tests are the best available specification of intended behavior; read them when the source is ambiguous.
references/extraction.md has per-language and per-framework guidance for locating
routes, exported functions, background jobs, and config surfaces. Read it when you hit a
stack you are not immediately fluent in.
Later documents cite earlier ones, so order matters:
CLAUDE.md → root README → ARCHITECTURE → API reference → per-directory READMEs → SECURITY → TODO → CHANGELOG → HANDOFF
HANDOFF goes last because it summarizes the state including what you just changed.
Templates and required sections for each artifact are in references/templates.md.
Read it before writing the first artifact.
Run these checks; they catch the errors that make generated docs untrustworthy:
file:line reference resolves to a real file, and the symbol is on/near that line.package.json scripts / Makefile /
pyproject.toml / equivalent. Do not invent npm run dev because it is conventional.repo_survey.py --secrets-scan flags
likely credentials in your output files.Tell the user what you created, what you updated, what you deliberately left alone, and — importantly — what you could not verify. A short list of open questions is more useful than a confident document with three guesses buried in it.
This is what makes the skill re-runnable. Content this skill owns goes inside markers:
<!-- repo-docs:begin id=api-endpoints hash=a1b2c3 -->
...generated content...
<!-- repo-docs:end id=api-endpoints -->
Rules:
hash), do not silently overwrite. Preserve their text, write your update
below it under a > Note: generated update, prior text preserved above line, and flag
it in your report.## [Unreleased] is editable.## Done section with a date; they are not deleted,
because "was this ever done?" is a real question a month later.State lives in docs/.repo-docs.json: last run timestamp, commit SHA, artifacts written,
block hashes. repo_survey.py reads it to compute what changed. Update it at the end of
every run.
Check for CLAUDE.md at the repo root (also check .claude/CLAUDE.md).
/init and then improve
its output — /init gives a decent skeleton but rarely captures the gotchas./init is unavailable (Claude.ai, Cowork, API), write CLAUDE.md directly using the
template in references/templates.md. Note in your report that it was written manually
rather than via /init, so the user knows.A good CLAUDE.md is short and specific: the commands that actually work, the conventions that are not obvious from reading one file, and the traps. Not a restatement of the README.
python scripts/git_changelog.py /path/to/repo --since-tag auto
Groups commits since the last tag into Keep a Changelog categories, using conventional
commit prefixes where present and falling back to keyword heuristics. Treat the output as
a draft: rewrite entries in user-facing language. fix(parser): handle null in tokenize() becomes "Fixed a crash when parsing files with empty lines." Drop pure-noise
commits (merges, formatting, dependency bumps unless security-relevant). Cluster the ten
commits that were one feature into one entry.
If the repo has no tags, treat all history as [Unreleased] and say so.
SECURITY.md here is a defensive posture document: how to report a vulnerability, what the trust boundaries are, how secrets and authn/authz are handled, what dependency and data-handling risks exist, and what is explicitly out of scope.
Document weaknesses at the level a maintainer needs to act — "the admin endpoints in
routes/admin.py have no authorization check" — not as a reproducible exploit. If you
find something that looks seriously exploitable, tell the user in conversation and record
it as a finding with a severity and a suggested fix, rather than writing a walkthrough
into a file that lives in the repo.
Never invent a CVE, a compliance claim, or a security guarantee the code does not provide. "No rate limiting is implemented" is useful. "Rate limiting protects all endpoints" when you have not verified it is worse than saying nothing.
Do not try to read 4,000 files. Sample deliberately:
utils/ with four files does not need a README per file.references/templates.md — required structure and templates for all nine artifacts. Read
before writing.references/extraction.md — how to find routes, functions, jobs, and config across common
languages and frameworks. Read when the stack is unfamiliar.scripts/repo_survey.py — repo inventory, doc status, change detection, secrets scan.scripts/git_changelog.py — commits since last tag, grouped into changelog categories.Both are plain Python 3, no third-party dependencies. Run --help for options.
What SKILL.md sets; muted values are Claude Code's defaults
/repo-docs:repo-docsfrom repo-docs
npx claudepluginhub mbadali25/useful-claude-add-ons --plugin repo-docsOther plugins' skills for the same job