关于 prd
将功能描述整理为面向实现的产品需求文档(PRD)。它先提出针对性澄清问题,再组织需求和验收标准,并将文档保存到 `/tasks/`。
主要功能
- 01提供选项的澄清问题
- 02结构化 PRD 章节
- 03用户故事与验收标准
- 04编号功能需求
- 05将 PRD 保存至 `/tasks/`
适用场景
- 01澄清含糊的功能请求
- 02为开发团队准备实现需求
- 03编码前定义范围与非目标
- 04为界面工作设定可验证标准
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ snarktank/ amp-skills --skill prd安装后在 Claude Code 中输入/prd确认已加载。
详细介绍
PRD 生成器
创建详细的产品需求文档(PRD),确保内容清晰、可执行,并适合用于实现。
任务
- 接收用户提供的功能描述
- 提出 3-5 个关键澄清问题(提供字母选项)
- 根据回答生成结构化的 PRD
- 保存到
/tasks/prd-[feature-name].md
**重要:**不要开始实现。只创建 PRD。
步骤 1:澄清问题
仅在初始提示存在歧义时提出关键问题。重点关注:
- **问题/目标:**要解决什么问题?
- **核心功能:**有哪些关键操作?
- **范围/边界:**哪些内容不应包含?
- **成功标准:**如何判断任务已完成?
问题格式如下:
1. What is the primary goal of this feature?
A. Improve user onboarding experience
B. Increase user retention
C. Reduce support burden
D. Other: [please specify]
2. Who is the target user?
A. New users only
B. Existing users only
C. All users
D. Admin users only
3. What is the scope?
A. Minimal viable version
B. Full-featured implementation
C. Just the backend/API
D. Just the UI
这样用户就能回复“1A、2C、3B”,快速完成迭代。
步骤 2:PRD 结构
按以下章节生成 PRD:
1. 简介/概述
简要描述此功能及其解决的问题。
2. 目标
具体、可衡量的目标(项目符号列表)。
3. 用户故事
每个故事都需要包含:
- **标题:**简短的描述性名称
- 描述:“作为一名[用户],我希望[功能],以便[收益]”
- **验收标准:**可验证的清单,用于定义“完成”的含义
每个故事的规模都应适合在一个专注的工作时段内实现。
格式:
### US-001: [Title]
**Description:** As a [user], I want [feature] so that [benefit].
**Acceptance Criteria:**
- [ ] Specific verifiable criterion
- [ ] Another criterion
- [ ] npm run typecheck passes
- [ ] **[UI stories only]** Verify in browser using dev-browser skill
重要:
- 验收标准必须可验证,不能含糊。“正常工作”不合适,“删除前显示确认对话框”则合适。
- **对于任何涉及 UI 更改的故事:**验收标准中必须包含“使用 dev-browser skill 在浏览器中验证”。这样可以确保对前端工作进行视觉验证。
4. 功能需求
列出具体功能的编号列表:
- “FR-1:系统必须允许用户……”
- “FR-2:用户点击 X 时,系统必须……”
要求明确无歧义。
5. 非目标(范围之外)
说明此功能不会包含哪些内容。这对于管理范围至关重要。
6. 设计考量(可选)
- UI/UX 要求
- 可用时附上原型图链接
- 可复用的相关现有组件
7. 技术考量(可选)
- 已知限制或依赖项
- 与现有系统的集成点
- 性能要求
8. 成功指标
如何衡量成功?
- “将完成 X 所需的时间缩短 50%”
- “将转化率提高 10%”
9. 待解决问题
仍待回答的问题或需要澄清的事项。
面向初级开发者编写
PRD 的读者可能是初级开发者或 AI Agent。因此:
- 表述明确、无歧义
- 避免使用术语,或对术语进行解释
- 提供足够的细节,让读者理解目的和核心逻辑
- 为需求编号,便于引用
- 适时提供具体示例
输出
- **格式:**Markdown(
.md) - 位置:
/tasks/ - 文件名:
prd-[feature-name].md(kebab-case)
PRD 示例
# PRD: Task Priority System
## Introduction
Add priority levels to tasks so users can focus on what matters most. Tasks can be marked as high, medium, or low priority, with visual indicators and filtering to help users manage their workload effectively.
## Goals
- Allow assigning priority (high/medium/low) to any task
- Provide clear visual differentiation between priority levels
- Enable filtering and sorting by priority
- Default new tasks to medium priority
## User Stories
### US-001: Add priority field to database
**Description:** As a developer, I need to store task priority so it persists across sessions.
**Acceptance Criteria:**
- [ ] Add priority column to tasks table: 'high' | 'medium' | 'low' (default 'medium')
- [ ] Generate and run migration successfully
- [ ] npm run typecheck passes
### US-002: Display priority indicator on task cards
**Description:** As a user, I want to see task priority at a glance so I know what needs attention first.
**Acceptance Criteria:**
- [ ] Each task card shows colored priority badge (red=high, yellow=medium, gray=low)
- [ ] Badge includes icon: 🔴 high, 🟡 medium, ⚪ low
- [ ] Priority visible without hovering or clicking
- [ ] npm run typecheck passes
- [ ] Verify in browser using dev-browser skill
### US-003: Add priority selector to task edit
**Description:** As a user, I want to change a task's priority when editing it.
**Acceptance Criteria:**
- [ ] Priority dropdown in task edit modal
- [ ] Shows current priority as selected
- [ ] Saves immediately on selection change
- [ ] npm run typecheck passes
- [ ] Verify in browser using dev-browser skill
### US-004: Filter tasks by priority
**Description:** As a user, I want to filter the task list to see only high-priority items when I'm focused.
**Acceptance Criteria:**
- [ ] Filter dropdown with options: All | High | Medium | Low
- [ ] Filter persists in URL params
- [ ] Empty state message when no tasks match filter
- [ ] npm run typecheck passes
- [ ] Verify in browser using dev-browser skill
## Functional Requirements
- FR-1: Add `priority` field to tasks table ('high' | 'medium' | 'low', default 'medium')
- FR-2: Display colored priority badge on each task card
- FR-3: Include priority selector in task edit modal
- FR-4: Add priority filter dropdown to task list header
- FR-5: Sort by priority within each status column (high → medium → low)
## Non-Goals
- No priority-based notifications or reminders
- No automatic priority assignment based on due date
- No priority inheritance for subtasks
## Technical Considerations
- Reuse existing badge component with color variants
- Filter state managed via URL search params
- Priority stored in database, not computed
## Success Metrics
- Users can change priority in <2 clicks
- High-priority tasks immediately visible at top of lists
- No regression in task list performance
## Open Questions
- Should priority affect task ordering within a column?
- Should we add keyboard shortcuts for priority changes?
检查清单
保存 PRD 前:
- 已提出带字母选项的澄清问题
- 已纳入用户的回答
- 用户故事规模适中且具体
- 功能需求已编号且无歧义
- 非目标章节明确界定了范围
- 已保存到
/tasks/prd-[feature-name].md
评论
支持 Markdown