Skill 详情
code-to-prd
Directly helps PMs document and understand existing products from code.
使用前先检查
自动化审核只检查相关性,不代表安全审查或推荐。使用前请阅读来源中的说明。
SKILL.md
这段内容是审核时保存的快照。外部来源才是完整且最新的版本。
--- name: code-to-prd description: "Reverse-engineer any codebase into a complete Product Requirements Document (PRD). Analyzes routes, components, state management, API integrations, and user interactions to produce business-readable documentation detailed enough for engineers or AI agents to fully reconstruct every page and endpoint. Works with frontend frameworks (React, Vue, Angular, Svelte, Next.js, Nuxt), backend frameworks (NestJS, Django, Express, FastAPI), and fullstack applications. Use when users mention: generate PRD, reverse-engineer requirements, code to documentation, extract product specs from code, document page logic, analyze page fields and interactions, create a functional inventory, write requirements from an existing codebase, document API endpoints, or analyze backend routes." license: MIT metadata: updated: 2026-03-17 tier: STANDARD category: product dependencies: none author: Alireza Rezvani version: 2.1.2 --- ## Name Code → PRD ## Description Reverse-engineer any frontend, backend, or fullstack codebase into a complete Product Requirements Document (PRD). Analyzes routes, components, models, APIs, and user interactions to produce business-readable documentation detailed enough for engineers or AI agents to fully reconstruct every page and endpoint. # Code → PRD: Reverse-Engineer Any Codebase into Product Requirements ## Features - **3-phase workflow**: global scan → page-by-page analysis → structured document generation - **Frontend support**: React, Vue, Angular, Svelte, Next.js (App + Pages Router), Nuxt, SvelteKit, Remix - **Backend support**: NestJS, Express, Django, Django REST Framework, FastAPI, Flask - **Fullstack support**: Combined frontend + backend analysis with unified PRD output - **Mock detection**: Automatically distinguishes real API integrations from mock/fixture data - **Enum extraction**: Exhaustively lists all status codes, type mappings, and constants - **Model extraction**: Parses Django models, NestJS entities, Pydantic schemas - **Automation scripts**: `codebase_analyzer.py` for scanning, `prd_scaffolder.py` for directory generation - **Quality checklist**: Validation checklist for completeness, accuracy, readability ## Usage ```bash # Analyze a project and generate PRD skeleton python3 scripts/codebase_analyzer.py /path/to/project -o analysis.json python3 scripts/prd_scaffolder.py analysis.json -o prd/ -n "My App" # Or use the slash command /code-to-prd /path/to/project ``` ## Examples ### Frontend (React) ```bash /code-to-prd ./src # → Scans components, routes, API calls, state management # → Generates prd/ with per-page docs, enum dictionary, API inventory ``` ### Backend (Django) ```bash /code-to-prd ./myproject # → Detects Django via manage.py, scans urls.py, views.py, models.py # → Documents endpoints, model schemas, admin config, permissions ``` ### Fullstack (Next.js) ```bash /code-to-prd . # → Analyzes both app/ pages and api/ routes # → Generates unified PRD covering UI pages and API endpoints ``` --- ## Role You are a senior product analyst and technical architect. Your job is to read a frontend codebase, understand every page's business purpose, and produce a complete PRD in **product-manager-friendly language**. ### Dual Audience 1. **Product managers / business stakeholders** — need to understand *what* the system does, not *how* 2. **Engineers / AI agents** — need enough detail to **fully reconstruct** every page's fields, interactions, and relationships Your document must describe functionality in non-technical language while omitting zero business details. ### Supported Stacks | Stack | Frameworks | |-------|-----------| | **Frontend** | React, Vue, Angular, Svelte, Next.js (App/Pages Router), Nuxt, SvelteKit, Remix, Astro | | **Backend** | NestJS, Express, Fastify, Django, Django REST Framework, FastAPI, Flask | | **Fullstack** | Next.js (API routes + pages), Nuxt (server/ + pages/), Django (views + templates) | For **backen在 GitHub 阅读完整来源 (打开外部页面)