从功能需求生成结构化产品需求文档(PRD)。当用户想要创建 PRD、记录新功能、编写产品规格、形式化用户故事、说"为 X 写 PRD"、需要记录需求、或正在准备产品评审会议时使用。即使没有明确说"PRD",当用户需要包含用户故事、验收标准和成功指标的结构化产品文档时也应激活。 Also triggers on: write a PRD, product requirements doc, user stories and acceptance criteria.
从功能需求生成结构化产品需求文档(PRD)。当用户想要创建 PRD、记录新功能、编写产品规格、形式化用户故事、说"为 X 写 PRD"、需要记录需求、或正在准备产品评审会议时使用。即使没有明确说"PRD",当用户需要包含用户故事、验收标准和成功指标的结构化产品文档时也应激活。 Also triggers on: write a PRD, product requirements doc, user stories and acceptance criteria.
Generate structured Product Requirements Documents from feature ideas.
What This Skill Does
Transforms informal feature requests into complete PRDs with user stories, acceptance criteria, functional requirements, success metrics, and compliance guidance. The output is ready for engineering teams to implement and stakeholders to review.
When to Use
Activate this skill when:
User wants to document a new feature or product idea
Phrases like "write a PRD", "create requirements", "document this feature"
Preparing for product review, stakeholder alignment, or engineering handoff
User mentions user stories, acceptance criteria, or success metrics
Need to formalize a rough idea into structured documentation
Scenario Detection (CRITICAL - First Step)
Before generating any PRD content, you MUST identify the scenario.
Ask the user which scenario applies (use the host's structured-question tool if available, e.g. AskUserQuestion on Claude Code; otherwise present a numbered option list and wait for the reply):
Q: 请选择 PRD 生成场景
Option
Description
迭代更新
基于现有功能进行迭代优化
新功能
在现有产品上添加新模块
0-1 新产品
从零开始规划全新产品
Context Collection by Scenario
Once scenario is identified, collect required context:
Scenario
Required Information
Collection Method
迭代更新
1. 当前功能描述 2. UI 状态(截图/HTML/链接) 3. 迭代目标
User input + structured question for UI state option
新功能
1. 产品整体架构 2. 设计规范(组件库/交互模式) 3. 入口位置
Read from docs/product/ or user input
0-1 新产品
1. 产品背景与目标用户 2. 资源约束 3. 参考产品
User input + competitive analysis
UI State Collection for Iteration Updates:
When user selects "迭代更新", ask how they want to provide current UI state:
截图 - User provides screenshot; read it with the host's image-understanding capability (on Claude Code, e.g. mcp__4_5v_mcp__analyze_image / mcp__zai-mcp-server__ui_to_artifact MCP tools; other hosts use their built-in image reading)
HTML 文件 - User provides local HTML path, use Read tool to parse DOM structure
在线链接 - User provides URL; read it with the host's web-reading capability (on Claude Code, e.g. mcp__web_reader__webReader; other hosts use their built-in web access) (no login required)
Step 0.5: Information Gap Analysis & PRD Plan (CRITICAL — HARD GATE)
HARD GATE: Do NOT proceed to Industry Benchmark Check or PRD generation until this step is complete and user has approved the plan.
Gap Analysis、PRD Plan 生成、Industry Benchmark Check 与正文生成为内部处理步骤,无需前缀。
Explicit-Skip Protocol(用户显式拒绝交互时): If the user explicitly forbids questions (e.g. "别问了,直接写"), you MAY skip the interactive gates — but then you MUST start the output with an 假设声明 block listing every assumption made (scenario, selected/excluded chapters, target product, key defaults), so the user can correct them. The 假设声明同时充当 Evidence Discipline 的完整度清单:未确认信息标【待确认】、无证据断言标【未验证】(见下文 Evidence Discipline),不得脑补填默认值。Never skip silently.
After scenario detection and context collection:
Gap Analysis: Compare user-provided information against context-requirements for this scenario. List every missing required field. Also check docs/product/ for existing perception data (market-analysis.json, competitive-analysis, user-research.json, positioning.md).
One Question At A Time: For each missing item, ask the user with a structured question offering multiple choice options. Do NOT bundle multiple questions into one message.
Missing Item
Example Question
UI 截图
"当前功能的界面状态,你如何提供?" → A. 已有截图 B. 有 HTML 文件 C. 有在线链接 D. 暂无,先跳过
竞品列表
"需要分析哪些竞品?" → multi-select + "其他"
目标用户
"目标用户是?" → A. 已定义画像 B. 我口述你来整理 C. 需要先做用户研究
参考产品
"有参考产品吗?" → A. 有,我来说 B. 你帮我搜索行业标杆 C. 不需要参考
Handle Missing Assets: If user says "I'll provide screenshots later" or "先跳过", record which items are pending and note them in the PRD plan as [待补充].
Generate PRD Plan: Prepare (but do not yet display) the PRD Plan structure. The table below shows the template with default selections:
Note: The table above uses default selections. The actual「选中」values will be filled in Step 4.5 based on user's chapter selection responses. Do NOT present this table to the user yet.
4.5. Chapter Selection (HARD GATE — Before presenting PRD Plan):
Present chapter selection to the user as a structured multi-select question. If the host's question tool limits options (e.g. 4-option limit), split into 3 sequential questions. Build selected_chapters and excluded_chapters lists from responses, and update the PRD Plan table's「选中」column accordingly.
IMPORTANT: The template shows all possible chapters. Generate ONLY the chapters selected by the user. Skip unselected chapters entirely. Do NOT generate technical architecture, API specifications, or database designs under any circumstances.
docs/product/.ompm/user-research.json - User insights
Writes:
docs/product/prd/{feature-name}-{date}-v{version}.md - The generated PRD (versioned output)
Legacy: docs/product/.ompm/prd-draft.md for backward compatibility
HTML 原型生成
Only trigger this step if the user selected 第8章 原型设计 in the chapter selection.
If 原型设计 was selected, generate the HTML prototype directly (no additional confirmation needed — the user already opted in during chapter selection):
Generate interactive HTML prototype based on PRD content
Output to docs/product/prototypes/{feature-name}.html
Include basic styling and interaction for demonstration
Update PRD with HTML prototype link
Notify user with preview instructions
If 原型设计 was NOT selected, skip this step and notify the user that PRD generation is complete.
Example Usage
User: "Write a PRD for dark mode"
→ Generates complete PRD with user stories, requirements, metrics
User: "Document the user onboarding feature"
→ Activates prd-gen to create structured requirements
User: "I need user stories for the checkout flow"
→ Generates PRD section focused on checkout user stories