跳到正文
Skillpedia
任务与项目29k · #9688

code-to-prd

它能做什么

这项技能阅读现有应用的代码,并用通俗的业务语言撰写产品需求文档。适合已经有一个可用应用、却没有书面规格说明的产品经理和团队。

适用场景

  • ✓当现有应用没有书面产品需求文档的时候。
  • ✓当你需要记录代码库中每一个页面、字段和接口的时候。
  • ✓当你想要一份足够详细、能让工程师或 AI 智能体重建应用的规格说明的时候。

技能链接

https://github.com/alirezarezvani/claude-skills/blob/main/product-team/code-to-prd/skills/code-to-prd/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/alirezarezvani/claude-skills/blob/main/product-team/code-to-prd/skills/code-to-prd/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请阅读我们的代码库,撰写一份产品需求文档,描述每一个页面和 API 接口。”

每周 5 个新技能,1 分钟读完。

工作原理

它会扫描项目,梳理路由、组件、数据模型和接口,然后搭建文档框架并填充内容,同时区分真实的数据对接和模拟数据。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

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

# 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)

/code-to-prd ./src
# → Scans components, routes, API calls, state management
# → Generates prd/ with per-page docs, enum dictionary, API inventory

Backend (Django)

/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)

/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 backend-only projects, the "page" concept maps to API resource groups or admin views. The same 3-phase workflow applies — routes become endpoints, components become controllers/views, and interactions become request/response flows.


Workflow

Phase 1 — Project Global Scan

Build global context before diving into pages.

1. Identify Project Structure

Scan the root directory and understand organization:

Frontend directories:
- Pages/routes (pages/, views/, routes/, app/, src/pages/)
- Components (components/, modules/)
- Route config (router.ts, routes.ts, App.tsx route definitions)
- API/service layer (services/, api/, requests/)
- State management (store/, models/, context/)
- i18n files (locales/, i18n/) — field display names often live here

Backend directories (NestJS):
- Modules (src/modules/, src/*.module.ts)
- Controllers (*.controller.ts) — route handlers
- Services (*.service.ts) — business logic
- DTOs (dto/, *.dto.ts) — request/response shapes
- Entities (entities/, *.entity.ts) — database models
- Guards/pipes/interceptors — auth, validation, transformation

Backend directories (Django):
- Apps (*/apps.py, */views.py, */models.py, */urls.py)
- URL config (urls.py, */urls.py)
- Views (views.py, viewsets.py) — route handlers
- Models (models.py) — database schema
- Serializers (serializers.py) — request/response shapes
- Forms (forms.py) — validation and field definitions
- Templates (templates/) — serv
常见问题

它支持哪些框架?

它支持 React、Vue 和 Next.js 等常见前端框架,以及 NestJS、Express、Django 和 FastAPI 等后端框架。

它能区分真实数据和模拟数据吗?

可以,它会尽量区分真实的 API 对接和模拟数据或测试样本。

输出结果需要审阅吗?

需要,这项技能附带一份完整性和准确性的检查清单,你应该逐项核对。

详情

作者的原始描述

Use when asked to write a PRD or product spec from an existing codebase (reverse-engineer requirements, document pages, fields, routes and endpoints). Maps the code with codebase_analyzer.py and scaffolds the PRD with prd_scaffolder.py.

repo: alirezarezvani/claude-skills

热度

GitHub 星标
29k
排名
#9688
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能