Files
claude-skills-reference/product-team/code-to-prd
Reza Rezvani fd1d86ba0b fix(code-to-prd): achieve 97.6 validator score — frontmatter, sections, expected outputs
- SKILL.md frontmatter: add Name, Tier, Category, Dependencies, Author,
  Version as capitalized top-level keys (validator requirement)
- SKILL.md sections: add Name and Description headings (validator requirement)
- Add expected_outputs/ with 3 sample files: PRD README, page doc, enum dict
- prd_scaffolder.py: add validate_analysis(), --validate-only, --dry-run
  flags, structured print_summary() — now 333 LOC (was 255, within 300-500)
- Add scripts/.gitignore to exclude generated prd/ test output

Scores: validator 65→97.6 (EXCELLENT), quality 51→73.2 (B-), scripts 2/2 PASS

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 13:18:33 +01:00
..

Code → PRD

Reverse-engineer any codebase into a complete Product Requirements Document (PRD).

Quick Start

# One command
/code-to-prd /path/to/project

# Or step by step
python3 scripts/codebase_analyzer.py /path/to/project -o analysis.json
python3 scripts/prd_scaffolder.py analysis.json -o prd/ -n "My App"

Supported Frameworks

Stack Frameworks
Frontend React, Vue, Angular, Svelte, Next.js, Nuxt, SvelteKit, Remix
Backend NestJS, Express, Django, DRF, FastAPI, Flask
Fullstack Next.js (pages + API), Nuxt (pages + server), Django (views + templates)

What It Generates

prd/
├── README.md                  # System overview
├── pages/
│   ├── 01-user-mgmt-list.md   # Per-page/endpoint docs
│   └── ...
└── appendix/
    ├── enum-dictionary.md      # All enums and status codes
    ├── api-inventory.md        # Complete API reference
    └── page-relationships.md   # Navigation and data coupling

Scripts

Script Purpose
codebase_analyzer.py Scan codebase → extract routes, APIs, models, enums
prd_scaffolder.py Generate PRD directory skeleton from analysis JSON

Both are stdlib-only — no pip install needed. Run --help for full usage.

References

  • references/framework-patterns.md — Route, state, API, form, and model patterns per framework
  • references/prd-quality-checklist.md — Validation checklist for completeness and accuracy

Attribution

Inspired by code-to-prd by @lihanglogan.

License

MIT