Reverse-engineer a frontend codebase into a PRD. Usage: /code-to-prd [path]
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-claude-skills-00ff342ecf87 ,按照其中的说明把「code-to-prd」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Reverse-engineer a frontend codebase into a complete Product Requirements Document.
/code-to-prd # Analyze current project
/code-to-prd ./src # Analyze specific directory
/code-to-prd /path/to/project # Analyze external project
codebase_analyzer.py to detect framework, routes, APIs, enums, and project structureprd_scaffolder.py to create prd/ directory with README.md, per-page stubs, and appendix filesDetermine the project path (default: current directory). Run the frontend analyzer:
python3 {skill_path}/scripts/codebase_analyzer.py {project_path} -o .code-to-prd-analysis.json
Display a summary of findings: framework, page count, API count, enum count.
Generate the PRD directory skeleton:
python3 {skill_path}/scripts/prd_scaffolder.py .code-to-prd-analysis.json -o prd/
For each page in the inventory, follow the SKILL.md Phase 2 workflow:
prd/pages/ stubWork in batches of 3-5 pages for large projects (>15 pages). Ask the user to confirm after each batch.
Complete the appendix files:
prd/appendix/enum-dictionary.md — all enums and status codes foundprd/appendix/api-inventory.md — consolidated API referenceprd/appendix/page-relationships.md — navigation and data coupling mapClean up the temporary analysis file:
rm .code-to-prd-analysis.json
A prd/ directory containing:
README.md — system overview, module map, page inventorypages/*.md — one file per page with fields, interactions, APIsappendix/*.md — enum dictionary, API inventory, page relationshipsproduct-team/code-to-prd/skills/code-to-prd/SKILL.mdproduct-team/code-to-prd/skills/code-to-prd/scripts/codebase_analyzer.pyproduct-team/code-to-prd/skills/code-to-prd/scripts/prd_scaffolder.pyproduct-team/code-to-prd/skills/code-to-prd/references/prd-quality-checklist.md