Generate or maintain a comprehensive, verified documentation set (README.md, ARCHITECTURE.md, DEVELOPMENT.md, CONTRIBUTING.md, DEPLOYMENT.md, ADRs) for an existing code repository. Use this skill whenever the user wants to document a repo, write or rewrite a README, generate project docs from scratch, modernize stale documentation, onboard a legacy codebase, produce architecture documentation for an existing project, or check existing documentation for drift against the codebase — even when they don't explicitly say "use the repo-documenter skill". Trigger on phrases like "document this repo", "write a README for this project", "generate docs", "this repo has no docs", "create architecture docs", "the README is outdated", "check if the docs are still accurate", or "update the docs after my refactor".
Generate a comprehensive, accurate, and professional documentation set for an existing repository through a four-phase pipeline: Discovery → Architecture → Synthesis → Verification. The pipeline is designed to prevent the most common failure mode of AI-generated documentation: plausible-sounding claims about features, files, or commands that don't actually exist.
TODO.The skill is organized into four phases, each with its own detailed instructions in phases/. Read the relevant phase file at the start of that phase rather than trying to hold the entire workflow in context at once.
| Phase | File | Purpose | Stops for user? |
|---|---|---|---|
| 1 | phases/01-discovery.md | Build a factual inventory of the repo | Yes — show inventory before proceeding |
| 2 | phases/02-architecture.md | Map system structure and surface Open Questions | Yes — get answers before proceeding |
| 3 | phases/03-synthesis.md | Generate the actual user-facing docs | No — proceed to verification |
| 4 | phases/04-verification.md | Cross-check every claim against the codebase | Yes — present report and final docs |
| 5 | phases/05-maintenance.md | Detect and fix doc drift on subsequent runs | Yes — present drift report |
Phase 5 is not part of the initial pipeline. It is run separately on subsequent invocations against an already-documented repo to catch drift. The first four phases are the initial pass; Phase 5 is the recurring sweep.
All scratch work goes in docs/_working/. Final docs go in the repo root and docs/.
Before starting Phase 1, do the following:
git rev-parse --show-toplevel to verify.git checkout -b docs/repo-documenter-pass
mkdir -p docs/_working docs/adr
Once those are answered, begin Phase 1 by reading phases/01-discovery.md.
Between each phase, present a clear summary and explicitly ask the user to confirm before proceeding. Example transition message after Phase 1:
Phase 1 (Discovery) complete. I've written the inventory to
docs/_working/repo-inventory.md. Here's a summary: [3-5 bullets]. Please review the inventory and let me know if anything looks wrong or missing. Once you confirm, I'll proceed to Phase 2 (Architecture Mapping).
The final deliverable should look like this:
<repo root>/
├── README.md # Rewritten, structured per templates/README.template.md
├── CHANGELOG.md # Scaffolded if absent
├── docs/
│ ├── ARCHITECTURE.md
│ ├── DEVELOPMENT.md
│ ├── CONTRIBUTING.md
│ ├── DEPLOYMENT.md # Only if deploy config exists
│ ├── adr/
│ │ ├── README.md # ADR index
│ │ └── 0001-record-architecture-decisions.md
│ └── _working/ # Scratch space — gitignore or commit per user preference
│ ├── repo-inventory.md
│ ├── architecture-notes.md
│ └── verification-report.md
All output documents are based on templates in templates/. Read the relevant template at the start of Phase 3 and adapt it to the specific project — do not blindly copy. Templates are starting points, not rigid forms.
| Template | Used for |
|---|---|
templates/README.template.md | The root README |
templates/ARCHITECTURE.template.md | System overview and data flow |
templates/DEVELOPMENT.template.md | Local setup and dev workflows |
templates/CONTRIBUTING.template.md | Contribution process |
templates/DEPLOYMENT.template.md | Build, release, environments |
templates/adr-template.md | Individual ADR entries |
Before declaring the work complete, run through checklists/readme-quality.md against the generated README. This is a hard gate — if any item fails, fix it before presenting to the user.
This skill is designed to be re-runnable after major refactors. When re-running:
When the target repo uses a known stack, read the corresponding reference file in references/ at the start of Phase 1. Reference files contain stack-specific detection signals, additional inventory items, common footguns, and documentation conventions to honor.
| Stack | Reference File | When to Read |
|---|---|---|
| TypeScript | references/typescript.md | Any project with tsconfig.json |
| React | references/react.md | Any project with react in dependencies |
| Rust | references/rust.md | Any project with Cargo.toml |
| Tauri v2 | references/tauri-v2.md | Projects with src-tauri/ and Tauri v2 |
Reference files are additive, not exclusive. A Tauri app written in React + TypeScript should load all four references. Read them once at the start of Phase 1 and apply their guidance throughout subsequent phases.
If the target repo uses a stack without a dedicated reference file, proceed with the phase files alone — they are framework-agnostic and will still work, just without stack-specific shortcuts.
TODO(verify) — never guess.