generate-docs
Skill6 starsChanged 4 months agoMITView on GitHub
Generates a complete, verified documentation suite for a codebase and wires it into AI-agent context files. Runs a multi-phase explore → generate → verify loop: scans the repo, writes ~15 docs in docs/ (architecture, API reference, database schema, services, glossary, error catalog, security, and more) with Mermaid diagrams, grades every doc A–F on 5 dimensions against the actual source code, and regenerates failing docs until all pass. Then updates CLAUDE.md (progressive-disclosure section) and creates AGENTS.md for cross-tool compatibility. Use when the user asks to document a codebase, generate or refresh project documentation, create a docs/ suite, or bootstrap/update CLAUDE.md or AGENTS.md context files. Harness-agnostic — works with or without subagents.
12 other projects use a version of this.
Adopted by
Most recently taken up by
- gohypergiant/agent-skillstheir own version, first seen Sep 9, 2026
- aToy0m0/skillstheir own version, first seen Sep 7, 2026
- tzoofu/skillstheir own version, first seen Sep 3, 2026
- buildpad-ai/skillstheir own version, first seen Jul 19, 2026
- viksant/swe-skillstheir own version, first seen Jul 15, 2026
- zaridan/job-hunt-hqtheir own version, first seen Jul 13, 2026
Other versions12 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 12
- DasDigitaleMomentum/opencode-processing-skills★ 59same name
- connerohnesorge/conclaude★ 37same name
- gohypergiant/agent-skills★ 24same name
- ZeyuLing/research_autocode_skills★ 9same name
- viknesh20-20/claude-code-tool-kit★ 7same name
- viksant/swe-skills★ 4same name
- zaridan/job-hunt-hq★ 4same name
- Imran-ml/claude-skills★ 3same name
- aToy0m0/skills★ 2same name
- zahardev/aicontext★ 2same name
2 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 11 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 40
Completion: when ALL docs score A across ALL dimensions, or max retries is reached.
- Distinctive: line 86
When the loop ends, print a summary to the console:
- Distinctive: line 121
Never invent information: Document only what actually exists in the codebase.
- Distinctive: line 130
Never delete human-written CLAUDE.md content: Only manage the marked auto-generated section.
“Common” is measured: kept by at least 6 in 10 of the 11 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.
Files
generate-docs
You are the orchestrator for a documentation-generation pipeline. Coordinate five phases — Bootstrap → Explore → Generate → Verify → Context Update — in an iterative loop until every document meets grade A on every rubric dimension, or the retry budget is exhausted.
Detailed instructions for each phase live in references/. Read the relevant reference file when you
reach that phase (progressive disclosure — don't load them all up front).
| Phase | What it does | Read |
| 0 — Bootstrap | Detect/back-up/create CLAUDE.md; note AGENTS.md | references/context-files.md |
| 1 — Explore | Scan the codebase across 8 domains → docs/_exploration_report.md | references/exploration.md |
| 2 — Generate | Write ~15 docs in docs/ with Mermaid diagrams | references/generation.md |
| 3 — Verify | Grade every doc A–F against the source → docs/_verification_report.md | references/verification.md + references/grading-rubric.md |
| 4 — Context Update | Update CLAUDE.md + write AGENTS.md (progressive disclosure) | references/context-files.md |
Configuration
- Max retries: the first argument, if given (e.g.
generate-docs 5). If blank or non-numeric, default to 3. - Output directory:
docs/at the project root. - Passing grade: A on every document and every rubric dimension.
- Completion: when ALL docs score A across ALL dimensions, or max retries is reached.
How to run the phases (any harness)
This skill is harness-agnostic. Each phase is a batch of independent work that parallelizes cleanly:
- If your harness supports subagents / parallel tasks (e.g. a Task tool, an agent-spawn
primitive, or a workflow engine): dispatch the phase's work as parallel subagents — 8 explorers in
Phase 1, up to 15 writers in Phase 2, 1 verifier in Phase 3. Give each subagent the matching
references/file as its instructions, plus its specific brief/doc. Prefer read-only tools for explorers and verifiers. - If your harness has no subagents: perform each phase's work yourself, sequentially, following
the same
references/files. The output is identical; only the wall-clock time differs.
Whichever mode you use, the phase boundaries, working files, and grading are the same.
Iteration loop
Phase 0: Bootstrap (run once)
iteration = 0
max_retries = first argument or 3
WHILE iteration < max_retries:
iteration += 1
IF iteration == 1:
Run Phase 1 (Explore)
Run Phase 2 (Generate ALL docs)
ELSE:
Run Phase 2 ONLY for docs that scored below A,
using the verifier's feedback (revision mode). Preserve passing docs.
Run Phase 3 (Verify)
IF verdict == PASS:
Run Phase 4 (Context Update); BREAK → success
IF iteration == max_retries:
Run Phase 4 (Context Update, even on partial pass); BREAK → partial success
Print the summary table.Final output
When the loop ends, print a summary to the console:
📚 Documentation Generation Report
Iteration: {n} / {max_retries}
Verdict: {PASS ✅ | FAIL ❌}
CLAUDE.md: {Created ✨ | Updated 🔄 | Unchanged ─}
AGENTS.md: {Created ✨ | Updated 🔄 | Unchanged ─}
Document CMP ACC CLR DIA COV Overall
README.md ...
architecture.md ...
tech-stack.md ...
api-reference.md ...
database-schema.md ...
frontend-backend.md ...
services.md ...
workflows-and-triggers.md ...
devops.md ...
glossary.md ...
error-catalog.md ...
testing-strategy.md ...
environment-setup.md ...
coding-conventions.md ...
security.md ...
Docs generated: docs/ (15 files)
Context updated: CLAUDE.md, AGENTS.md
SpecKit-ready: docs/ structure compatible with /speckit.analyzeOn FAIL, also list the specific failing dimensions and the verifier's feedback for each doc.
Critical rules
- Never invent information. Document only what actually exists in the codebase.
- Always include Mermaid diagrams where the doc table marks them "Required".
- Verify against code, not just the exploration report. The verifier reads actual source files.
- On retries, only regenerate failing docs — never the whole set.
- Preserve passing docs across iterations — do not overwrite docs that already scored A.
- The exploration and verification reports are working files (
docs/_*.md) — don't delete them. - Be honest about gaps. Flag uncertainties with
⚠️rather than guessing. - CLAUDE.md stays under ~200 lines total; the auto-generated section under 80. Use progressive disclosure — point to docs, don't duplicate their content.
- Never delete human-written CLAUDE.md content. Only manage the marked auto-generated section.
- AGENTS.md is tool-agnostic — no Claude-specific syntax; keep it under 120 lines.
- Structure for AI agents. Explicit headings, tables, and "Read when" triggers so SpecKit, Cursor, Copilot, and other tools can extract context efficiently.
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
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.

