reverse-engineer-docs
Skill0 starsChanged 2 months agoMITView on GitHub
Reverse-engineer a complete product documentation set from an existing codebase that has little or no documentation. Use when the user has already built an app or proof of concept and wants a PRD, user flows, architecture, data model, API contract, tech stack register, security review, and test plan generated from the actual code. Also use when the user asks to "document my existing app", "figure out what I built", or "create docs from my code".
In this repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-featureSkill
- bootstrap-docsSkill
- doc-drift-auditSkill
- implement-featureSkill
- release-prepSkill
- stack-auditSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
Read the full procedure in prompts/02-reverse-engineer-from-poc.md and follow it exactly, stage by stage.
- Distinctive: line 21
Evidence over invention: Every statement about what the system does must cite the file it came from.
- Distinctive: line 34
Document reality, not the ideal: If there is no error handling, the docs say there is no error handling — and it becomes a finding.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Reverse-Engineer Documentation From an Existing Codebase
Produce an accurate documentation set from the code, filling in the templates
already present in docs/.
Before you start
- Confirm
docs/contains the kit templates. If not, tell the user to copy them in first — seeGETTING-STARTED.mdPart A Step 1. Do not proceed without them. - Read
AGENTS.md. - Read the full procedure in
prompts/02-reverse-engineer-from-poc.mdand follow it exactly, stage by stage.
Non-negotiable rules
Evidence over invention. Every statement about what the system does must cite the file it came from.
Label every uncertainty, inline:
[INFERRED]— deduced from code with high confidence[ASSUMPTION]— you chose something to make progress; state the alternative[NEEDS CONFIRMATION]— a human must decide; you cannot know this from code
Never fabricate intent. Code shows what, never why. You must NOT invent
business objectives, target personas, success metrics, revenue model, compliance
obligations, or roadmap. Mark them [NEEDS CONFIRMATION] and ask a specific
question.
Document reality, not the ideal. If there is no error handling, the docs say there is no error handling — and it becomes a finding. Never describe what the code should do as though it already does.
Do not change any code. Documentation only. Record bugs in the Stage 6 findings register.
Do not write docs/00-vision.md. That is the user's to write.
Stages — stop and wait for the user after each
| Stage | Produces |
| 0 | Reconnaissance report + questions. No documents yet. |
| 1 | 04-architecture.md, 12-tech-stack.md, 05-data-model.md, 06-api-contract.md |
| 2 | 02-user-flows.md, 03-design-system.md |
| 3 | 01-prd.md — present requirements as a table and ask the user to confirm each |
| 4 | 07-security-privacy.md, 08-test-plan.md |
| 5 | 09-traceability-matrix.md, ADRs, CHANGELOG.md, 11-glossary.md, AGENTS.md |
| 6 | docs/REVERSE-ENGINEERING-FINDINGS.md — confidence report, open questions, findings, next actions |
Do not run stages back to back without user input. The confirmation between stages is where errors get caught cheaply.
On finishing
Set every document to version: 0.1.0, status: Draft, today's date, and add the
first Change Log row. Do not mark anything Approved — the user approves
documents, you do not.
Then tell the user to read Stage 6's findings register first, resolve the
uncertainty markers, and write docs/00-vision.md themselves.
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.

