shinpr/claude-code-workflows/recipe-reverse-engineer
- community
Checking that the SKILL.md file is still in the repository.
Generate PRD and Design Docs from existing codebase through discovery, generation, verification, and review workflow
Install
npx vskill@latest install shinpr/claude-code-workflows/recipe-reverse-engineerSKILL.md
Explicit User Instruction: The user explicitly instructs and authorizes every subagent call named in this recipe. Execute each applicable call when its prerequisites are met.
Execute Skill: llm-friendly-context before writing Agent prompts, handoffs, or generated artifacts. Execute Skill: subagents-orchestration-guide before making workflow decisions, invoking agents, or resolving findings.
Context: Reverse engineering workflow to create documentation from existing code
Target: $ARGUMENTS
Orchestrator Definition
Core Identity: "I am an orchestrator."
Local authority gate: Make this recipe's workflow decisions and validate each returned result directly; delegate semantic deliverable production to the named specialist.
Review Resolution Gate [MANDATORY]: Resolve every actionable deliverable-review finding through subagents-orchestration-guide Review Resolution before correction or progression. Before the first finding disposition, read references/review-resolution.md from the loaded subagents-orchestration-guide skill.
Execution Protocol:
- Invoke named specialists for deliverable production — pass deliverable paths between them and validate their results (see subagents-orchestration-guide "Orchestrator Execution Boundary")
- Respect evidence dependencies: Generation precedes verification and review for each unit; revision reruns the affected checks. Independent units may be scheduled without changing these gates.
- Preserve evidence while bridging outputs — copy the fields required by the next specialist in their declared form; apply Review Resolution before routing any correction
At each Agent invocation below, build the prompt as a mechanical extraction: copy the named source values into the exact fields, apply only the declared serialization, then invoke immediately.
Execution Gate: Each Design Doc depends on its completed parent PRD and scope mapping. Advance each unit only when its stated evidence and Unit Completion conditions are satisfied; a document path proves generation only. Continue independent units when another has a recorded failure, and report incomplete units explicitly.
Step 0: Initial Configuration
0.1 Scope Confirmation
Use supplied instructions and repository context first. Ask only for missing choices that materially change scope or execution; retain prior authorization and preferences:
- Target path: Which directory/module to document
- Depth: PRD only, or PRD + Design Docs
- Reference Architecture: layered / mvc / clean / hexagonal / none
- Human review: Yes (recommended) / No (fully autonomous)
- Fullstack design: Yes / No
- Yes: For each functional unit, generate backend + frontend Design Docs
- Note: Requires both agents (technical-designer, technical-designer-frontend)
0.2 Output Configuration
- PRD output:
docs/prd/or existing PRD directory - Design Doc output:
docs/design/or existing design directory - Verify directories exist, create if needed
Workflow Overview
Phase 1: PRD Generation
Step 1: PRD Scope Discovery
Agent tool invocation:
Store output as: $STEP_1_OUTPUT
Quality Gate:
- At least one unit discovered → proceed
- No units discovered → ask user for hints
$STEP_1_OUTPUT.prdUnitsexists- Flatten
sourceUnitsacrossprdUnitswithout deduplication: every discovered ID occurs exactly once, with no unknown IDs - Each discovered unit has source evidence and an inventory containing the applicable categories; empty categories are valid, but each unit requires at least one behavior-bearing route, public export, or
otherEntryPointsitem with a defining source location. Resolve a material coverage limitation through targeted discovery; preserve non-blocking limitations.
Human Review Point (if enabled): Present $STEP_1_OUTPUT.prdUnits with their source unit mapping. The user confirms, adjusts grouping, or excludes units from scope. This is the most important review point — incorrect grouping cascades into all downstream documents.
Step 2-5: Per-Unit Processing
FOR each unit in $STEP_1_OUTPUT.prdUnits:
Derive $PRD_UNIT_INVENTORY by joining this PRD unit's sourceUnits to discoveredUnits[].id and merging their unitInventory categories. Deduplicate the merged inventory by item identity (route method/path/owner, test path, export file/name, other entry-point file/name), preserving source evidence. Use this same baseline for generation and verification.
Step 2: PRD Generation
Agent tool invocation:
Store output as: $STEP_2_OUTPUT (PRD path)
Step 3: Code Verification
Prerequisite: $STEP_2_OUTPUT (PRD path from Step 2)
Agent tool invocation:
unit_inventory supplies the completeness baseline while repository evidence supplies the search scope.
Store output as: $STEP_3_OUTPUT
Quality Gate:
summary.statusisblocked, inventory coverage is missing, or counts do not balance → re-run or escalate with the exact unusable input or evidence- Any balanced non-blocked result → proceed to review with the complete verifier output;
needs_review/inconsistentand any unaccounted items become explicit review evidence
Step 4: Review
Required Input: $STEP_3_OUTPUT (verification JSON from Step 3)
Agent tool invocation:
Store output as: $STEP_4_OUTPUT
Step 5: Revision (conditional)
Pass $STEP_3_OUTPUT to document-reviewer as verification evidence, then apply the Review Resolution Gate to $STEP_4_OUTPUT. Run revision only when at least one finding is apply; a decline-only result completes the review.
Agent tool invocation:
Re-validation: After each revision, pass code-verifier the same unit_inventory plus the previous complete verifier result, dispositions and correction diff or paths as prior_feedback. Follow code-verifier’s rerun boundary: recheck all inventory items against the current document, while reusing unchanged repository evidence. Re-run document-reviewer with the latest verification_evidence, prior_feedback.
Unit Completion
- [ ] No
applyfindings remain - [ ] Human review passed (if enabled in Step 0)
Next: Proceed to next unit. After all units → Phase 2.
Phase 2: Design Doc Generation
Execute only if Design Docs were requested in Step 0
Step 6: Design Doc Scope Mapping
No additional discovery required. Use $STEP_1_OUTPUT.discoveredUnits (implementation-granularity units) for technical profiles. Use $STEP_1_OUTPUT.prdUnits[].sourceUnits to trace which discovered units belong to each PRD unit.
Each PRD unit from Phase 1 maps to Design Doc unit(s):
- Standard mode (fullstack=No): 1 PRD unit → 1 Design Doc (using technical-designer)
- Fullstack mode (fullstack=Yes): 1 PRD unit → 2 Design Docs (technical-designer + technical-designer-frontend)
For each PRD unit, join its sourceUnits to discovered units and merge their technical evidence and inventory, preserving provenance. Map the result to Design Doc targets, carrying forward:
technicalProfile.primaryModules→ Primary FilestechnicalProfile.publicInterfaces→ Public Interfacesdependencies→ DependenciesrelatedFiles→ Scope boundaryunitInventory→ Unit Inventory (routes, test files, public exports, other entry points)
In fullstack mode, partition each unit inventory by the owning path into backend and frontend target inventories. Assign a shared entry to each Design Doc whose public contract must account for it and record that shared reason; otherwise assign it once. Each Step 7 and Step 8 invocation receives its target's inventory, not the unpartitioned combined unit.
Assign each target a distinct output_path before generation. Use [feature]-design.md in standard mode and [feature]-backend-design.md / [feature]-frontend-design.md in fullstack mode. Check existing destinations and preserve unrelated artifacts.
Store output as: $STEP_6_OUTPUT
Step 7-10: Per-Unit Processing
FOR each unit in $STEP_6_OUTPUT:
Step 7: Design Doc Generation
Scope: Document the current architecture exactly as implemented in code.
Standard mode (fullstack=No):
Agent tool invocation:
Store output as: $STEP_7_OUTPUT
Fullstack mode (fullstack=Yes):
For each unit, invoke 7a then 7b sequentially (7b depends on 7a output):
7a. Backend Design Doc:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/recipe-reverse-engineer/SKILL.md
Popularity
- Repository stars
- 280
- Repository forks
- 47
- 7-day trend score
- 28
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 6 Apr 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/shinpr/claude-code-workflows/recipe-reverse-engineer)