blueprint-derive-prd
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGenerate a Product Requirements Document (PRD) for an existing project by analyzing README, documentation, and project structure.
Use Case: Onboarding existing projects to Blueprint Development system.
Prerequisites:
- Blueprint Development initialized (exists)
docs/blueprint/ - Project has some existing documentation (README.md, docs/, etc.)
Steps:
通过分析README、文档和项目结构,为现有项目生成产品需求文档(PRD)。
使用场景:将现有项目接入Blueprint Development系统。
前置条件:
- 已初始化Blueprint Development(目录存在)
docs/blueprint/ - 项目已有部分现有文档(README.md、docs/等)
步骤:
Phase 1: Discovery
阶段1:发现
1.1 Check Prerequisites
1.1 检查前置条件
bash
ls docs/blueprint/manifest.jsonIf not found → suggest running first.
/blueprint:initbash
ls docs/blueprint/manifest.json如果未找到 → 建议先运行。
/blueprint:init1.2 Gather Project Documentation
1.2 收集项目文档
Search for existing documentation:
bash
fd -e md -d 3 . | head -20Key files to look for:
- - Primary project description
README.md - - Documentation directory
docs/ - - Contribution guidelines
CONTRIBUTING.md - - Architecture overview
ARCHITECTURE.md - /
package.json/pyproject.toml- Project metadataCargo.toml
搜索现有文档:
bash
fd -e md -d 3 . | head -20重点查找的关键文件:
- - 项目主描述文件
README.md - - 文档目录
docs/ - - 贡献指南
CONTRIBUTING.md - - 架构概述
ARCHITECTURE.md - /
package.json/pyproject.toml- 项目元数据Cargo.toml
1.3 Read Primary Documentation
1.3 阅读核心文档
Read and analyze:
- README.md for project purpose, features, and usage
- Package manifest for dependencies and scripts
- Any existing architecture or design docs
阅读并分析:
- README.md中的项目目标、功能和使用方法
- 包清单中的依赖项和脚本
- 任何现有架构或设计文档
Phase 2: Analysis & Extraction
阶段2:分析与提取
2.1 Extract Project Context
2.1 提取项目上下文
From documentation, identify:
| Aspect | Source | Questions if Missing |
|---|---|---|
| Project name | Package manifest, README | Ask user |
| Purpose/Problem | README intro | "What problem does this project solve?" |
| Target users | README, docs | "Who are the primary users?" |
| Core features | README features section | "What are the main capabilities?" |
| Tech stack | Dependencies, file extensions | Infer from files |
从文档中识别以下信息:
| 维度 | 来源 | 缺失时的问题 |
|---|---|---|
| 项目名称 | 包清单、README | 询问用户 |
| 目标/解决的问题 | README引言 | "该项目解决的核心问题是什么?" |
| 目标用户 | README、文档 | "主要用户群体是谁?" |
| 核心功能 | README功能模块 | "主要功能有哪些?" |
| 技术栈 | 依赖项、文件扩展名 | 从文件中推断 |
2.2 Ask Clarifying Questions
2.2 提出澄清问题
Use AskUserQuestion for unclear items:
question: "What is the primary problem this project solves?"
options:
- "[Inferred from docs]: {description}" → confirm inference
- "Let me describe it" → free text inputquestion: "Who are the target users?"
options:
- "Developers" → technical documentation focus
- "End users" → user experience focus
- "Both developers and end users" → balanced approach
- "Other" → custom descriptionquestion: "What is the current project phase?"
options:
- "Early development / MVP" → focus on core features
- "Active development" → feature expansion
- "Maintenance mode" → stability and bug fixes
- "Planning major changes" → architectural considerations对不明确的内容使用AskUserQuestion提问:
question: "该项目解决的核心问题是什么?"
options:
- "[从文档推断]: {描述}" → 确认推断结果
- "我来描述" → 自由文本输入question: "主要用户群体是谁?"
options:
- "开发者" → 侧重技术文档
- "终端用户" → 侧重用户体验
- "开发者和终端用户" → 平衡两种需求
- "其他" → 自定义描述question: "当前项目处于什么阶段?"
options:
- "早期开发 / MVP" → 聚焦核心功能
- "活跃开发" → 功能扩展阶段
- "维护模式" → 稳定性与Bug修复
- "规划重大变更" → 架构层面考量2.3 Identify Stakeholders
2.3 识别利益相关者
Ask about stakeholders:
question: "Who are the key stakeholders for this project?"
options:
- "Solo project (just me)" → simplified RACI
- "Small team (2-5 people)" → team collaboration
- "Larger organization" → formal stakeholder matrix
- "Open source community" → contributor-focused询问利益相关者信息:
question: "该项目的关键利益相关者有哪些?"
options:
- "个人项目(仅我自己)" → 简化RACI矩阵
- "小型团队(2-5人)" → 团队协作模式
- "大型组织" → 正式利益相关者矩阵
- "开源社区" → 侧重贡献者Phase 3: PRD Generation
阶段3:PRD生成
3.1 Generate Document ID
3.1 生成文档ID
Before creating the PRD, generate a unique ID:
bash
undefined在创建PRD之前,生成一个唯一ID:
bash
undefinedGet next PRD ID from manifest
从清单中获取下一个PRD ID
next_prd_id() {
local manifest="docs/blueprint/manifest.json"
local last=$(jq -r '.id_registry.last_prd // 0' "$manifest" 2>/dev/null || echo "0")
local next=$((last + 1))
printf "PRD-%03d" "$next"
}
Store the generated ID for use in the document and manifest update.next_prd_id() {
local manifest="docs/blueprint/manifest.json"
local last=$(jq -r '.id_registry.last_prd // 0' "$manifest" 2>/dev/null || echo "0")
local next=$((last + 1))
printf "PRD-%03d" "$next"
}
保存生成的ID,用于文档和清单更新。3.2 Create PRD File
3.2 创建PRD文件
Create the PRD in :
docs/prds/docs/prds/project-overview.md在目录下创建PRD:
docs/prds/docs/prds/project-overview.md3.3 PRD Template
3.3 PRD模板
Generate PRD with this structure:
markdown
---
id: {PRD-NNN}
created: {YYYY-MM-DD}
modified: {YYYY-MM-DD}
status: Draft
version: "1.0"
relates-to: []
github-issues: []
name: blueprint-derive-prd
---按照以下结构生成PRD:
markdown
---
id: {PRD-NNN}
created: {YYYY-MM-DD}
modified: {YYYY-MM-DD}
status: Draft
version: "1.0"
relates-to: []
github-issues: []
name: blueprint-derive-prd
---{Project Name} - Product Requirements Document
{项目名称} - 产品需求文档
Executive Summary
执行摘要
Problem Statement
问题陈述
{Extracted or confirmed problem description}
{提取或确认的问题描述}
Proposed Solution
拟议解决方案
{Project description and approach}
{项目描述与实现思路}
Business Impact
业务影响
{Value proposition and expected outcomes}
{价值主张与预期成果}
Stakeholders & Personas
利益相关者与用户画像
Stakeholder Matrix
利益相关者矩阵
| Role | Name/Team | Responsibility | Contact |
|---|---|---|---|
| {role} | {name} | {responsibility} | {contact} |
| 角色 | 姓名/团队 | 职责 | 联系方式 |
|---|---|---|---|
| {角色} | {姓名} | {职责} | {联系方式} |
User Personas
用户画像
Primary: {Persona Name}
核心用户:{画像名称}
- Description: {who they are}
- Needs: {what they need}
- Pain Points: {current frustrations}
- Goals: {what success looks like}
- 描述:{用户身份}
- 需求:{用户需求}
- 痛点:{当前困扰}
- 目标:{成功标准}
Functional Requirements
功能需求
Core Features
核心功能
{List of main capabilities extracted from docs}
| ID | Feature | Description | Priority |
|---|---|---|---|
| FR-001 | {feature} | {description} | {P0/P1/P2} |
{从文档中提取的主要功能列表}
| ID | 功能 | 描述 | 优先级 |
|---|---|---|---|
| FR-001 | {功能} | {描述} | {P0/P1/P2} |
User Stories
用户故事
{User stories derived from features}
- As a {user type}, I want to {action} so that {benefit}
{从功能衍生的用户故事}
- 作为{用户类型},我希望{操作},以便{收益}
Non-Functional Requirements
非功能需求
Performance
性能
- {Response time expectations}
- {Throughput requirements}
- {响应时间要求}
- {吞吐量要求}
Security
安全性
- {Authentication requirements}
- {Data protection needs}
- {身份验证要求}
- {数据保护需求}
Accessibility
可访问性
- {Accessibility standards to follow}
- {需遵循的可访问性标准}
Compatibility
兼容性
- {Browser/platform/version support}
- {浏览器/平台/版本支持}
Technical Considerations
技术考量
Architecture
架构
{High-level architecture from docs or inferred}
{从文档中提取或推断的高层架构}
Dependencies
依赖项
{Key dependencies from package manifest}
{从包清单中提取的关键依赖}
Integration Points
集成点
{External services, APIs, databases}
{外部服务、API、数据库}
Success Metrics
成功指标
| Metric | Current | Target | Measurement |
|---|---|---|---|
| {metric} | {baseline} | {goal} | {how to measure} |
| 指标 | 当前值 | 目标值 | 测量方式 |
|---|---|---|---|
| {指标} | {基准值} | {目标} | {测量方法} |
Scope
范围
In Scope
包含范围
- {Included features and capabilities}
- {涵盖的功能与能力}
Out of Scope
排除范围
- {Explicitly excluded items}
- {Future considerations}
- {明确排除的内容}
- {未来规划项}
Timeline & Phases
时间线与阶段
Current Phase: {phase name}
当前阶段:{阶段名称}
{Description of current work focus}
{当前工作重点描述}
Roadmap
路线图
| Phase | Focus | Status |
|---|---|---|
| {phase} | {focus areas} | {status} |
Generated from existing documentation via /blueprint:derive-prd
Review and update as project evolves
undefined| 阶段 | 重点 | 状态 |
|---|---|---|
| {阶段} | {重点领域} | {状态} |
通过/blueprint:derive-prd从现有文档生成
随着项目演进,请持续审阅和更新
undefinedPhase 4: Validation & Follow-up
阶段4:验证与跟进
4.1 Present Summary
4.1 展示摘要
Show the user:
✅ PRD Generated: {Project Name}
**ID**: {PRD-NNN}
**Location**: `docs/prds/project-overview.md`
**Extracted from**:
- {list of source documents}
**Key sections**:
- Executive Summary: {status}
- Stakeholders: {count} identified
- Functional Requirements: {count} features
- Non-Functional Requirements: {status}
**Confidence**: {High/Medium/Low}
- {High confidence areas}
- {Areas needing review}
**Recommended next steps**:
1. Review and refine the generated PRD
2. Run `/blueprint:derive-adr` to document architecture decisions
3. Run `/blueprint:prp-create` for specific features
4. Run `/blueprint:generate-skills` to create project skills向用户展示:
✅ 已生成PRD:{项目名称}
**ID**:{PRD-NNN}
**位置**:`docs/prds/project-overview.md`
**提取来源**:
- {源文档列表}
**核心章节**:
- 执行摘要:{状态}
- 利益相关者:已识别{数量}个
- 功能需求:{数量}个功能
- 非功能需求:{状态}
**置信度**:{高/中/低}
- {高置信度领域}
- {需审阅的领域}
**建议下一步操作**:
1. 审阅并优化生成的PRD
2. 运行`/blueprint:derive-adr`记录架构决策
3. 运行`/blueprint:prp-create`针对特定功能创建PRP
4. 运行`/blueprint:generate-skills`生成项目技能4.2 Suggest Follow-up
4.2 建议后续操作
Based on what was generated:
- If architecture unclear → suggest
/blueprint:derive-adr - If features identified → suggest for key features
/blueprint:prp-create - If PRD complete → suggest
/blueprint:generate-skills
基于生成结果提供建议:
- 如果架构不明确 → 建议运行
/blueprint:derive-adr - 如果已识别功能 → 建议为关键功能运行
/blueprint:prp-create - 如果PRD已完成 → 建议运行
/blueprint:generate-skills
Phase 5: Update Manifest
阶段5:更新清单
Update :
docs/blueprint/manifest.json- Add PRD to
generated_artifacts - Update to true
has_prds - Update timestamp
updated_at - Update ID registry:
json
{ "id_registry": { "last_prd": {new_number}, "documents": { "{PRD-NNN}": { "path": "docs/prds/{filename}.md", "title": "{Project Name}", "github_issues": [], "created": "{date}" } } } }
Tips:
- Be thorough in reading existing docs - they often contain valuable context
- Ask clarifying questions for ambiguous or missing information
- Infer from code structure when documentation is sparse
- Mark uncertain sections for user review
- Keep PRD focused on "what" and "why", not "how"
更新:
docs/blueprint/manifest.json- 将PRD添加至
generated_artifacts - 将更新为true
has_prds - 更新时间戳
updated_at - 更新ID注册表:
json
{ "id_registry": { "last_prd": {new_number}, "documents": { "{PRD-NNN}": { "path": "docs/prds/{filename}.md", "title": "{Project Name}", "github_issues": [], "created": "{date}" } } } }
提示:
- 仔细阅读现有文档——它们通常包含有价值的上下文信息
- 对模糊或缺失的信息提出澄清问题
- 当文档不足时,从代码结构中推断信息
- 为不确定的部分标记需用户审阅
- PRD聚焦于“做什么”和“为什么”,而非“怎么做”
4.3 Prompt for GitHub Issue (use AskUserQuestion):
4.3 询问是否创建GitHub Issue(使用AskUserQuestion):
question: "Create a GitHub issue to track this PRD?"
options:
- label: "Yes, create issue (Recommended)"
description: "Creates issue with title '[PRD-NNN] {Project Name}'"
- label: "No, skip for now"
description: "Can link later by editing github-issues in frontmatter"If yes, create GitHub issue:
bash
gh issue create \
--title "[{PRD-NNN}] {Project Name}" \
--body "## Product Requirements Document
**Document**: \`docs/prds/{filename}.md\`
**ID**: {PRD-NNN}question: "是否创建GitHub Issue来跟踪此PRD?"
options:
- label: "是,创建Issue(推荐)"
description: "创建标题为'[PRD-NNN] {Project Name}'的Issue"
- label: "否,暂时跳过"
description: "后续可通过编辑前置内容中的github-issues进行关联"如果选择是,创建GitHub Issue:
bash
gh issue create \
--title "[{PRD-NNN}] {Project Name}" \
--body "## 产品需求文档
**文档**: \`docs/prds/{filename}.md\`
**ID**: {PRD-NNN}Summary
摘要
{Executive summary from PRD}
{PRD中的执行摘要}
Key Features
核心功能
{List of FR-* features}
name: blueprint-derive-prd
Auto-generated from PRD. See linked document for full requirements."
--label "prd,requirements"
--label "prd,requirements"
Capture issue number and update:
1. PRD frontmatter: add issue number to `github-issues`
2. Manifest: add issue to `id_registry.documents[PRD-NNN].github_issues`
3. Manifest: add mapping to `id_registry.github_issues`{FR-*功能列表}
name: blueprint-derive-prd
*从PRD自动生成。完整需求请查看关联文档。"
--label "prd,requirements"
--label "prd,requirements"
捕获Issue编号并更新:
1. PRD前置内容:将Issue编号添加至`github-issues`
2. 清单:将Issue添加至`id_registry.documents[PRD-NNN].github_issues`
3. 清单:在`id_registry.github_issues`中添加映射关系4.4 Prompt for next action (use AskUserQuestion):
4.4 询问下一步操作(使用AskUserQuestion):
question: "PRD generated. What would you like to do next?"
options:
- label: "Document architecture decisions (Recommended)"
description: "Run /blueprint:derive-adr to capture technical decisions"
- label: "Generate project skills"
description: "Extract skills from PRD for Claude context"
- label: "Create a PRP for a feature"
description: "Start implementing a specific feature"
- label: "Review and refine PRD"
description: "I want to edit the generated PRD first"
- label: "I'm done for now"
description: "Exit - PRD is saved"Based on selection:
- "Document architecture decisions" → Run
/blueprint:derive-adr - "Generate project skills" → Run
/blueprint:generate-skills - "Create a PRP" → Run (ask for feature name)
/blueprint:prp-create - "Review and refine" → Show PRD file location and key sections needing attention
- "I'm done" → Exit
Error Handling:
- If no README.md → ask user for project description
- If blueprint not initialized → suggest
/blueprint:init - If conflicting information in docs → ask user to clarify
question: "PRD已生成。接下来您想执行什么操作?"
options:
- label: "记录架构决策(推荐)"
description: "运行/blueprint:derive-adr捕获技术决策"
- label: "生成项目技能"
description: "从PRD中提取技能用于Claude上下文"
- label: "为某个功能创建PRP"
description: "开始实现特定功能"
- label: "审阅并优化PRD"
description: "我想先编辑生成的PRD"
- label: "暂时完成"
description: "退出 - PRD已保存"根据选择执行:
- "记录架构决策" → 运行
/blueprint:derive-adr - "生成项目技能" → 运行
/blueprint:generate-skills - "创建PRP" → 运行(询问功能名称)
/blueprint:prp-create - "审阅并优化" → 展示PRD文件位置和需重点关注的章节
- "暂时完成" → 退出
错误处理:
- 如果未找到README.md → 询问用户提供项目描述
- 如果未初始化Blueprint → 建议运行
/blueprint:init - 如果文档中存在冲突信息 → 请用户澄清