PRD Skill
Create and manage Product Requirements Documents (PRDs) for feature planning.
What is a PRD?
A PRD (Product Requirements Document) is a structured specification that:
- 1. Breaks a feature into small, independent user stories
- Defines verifiable acceptance criteria for each story
- Orders tasks by dependency (schema → backend → UI)
Quick Start
- 1. Create/edit
agents/prd.json in the project - Define user stories with acceptance criteria
- Track progress by updating
passes: false → INLINECODE2
prd.json Format
CODEBLOCK0
Field Descriptions
| Field | Description |
|---|
| INLINECODE3 | Project name for context |
| INLINECODE4 |
Git branch for this feature (prefix with
ralph/) |
|
description | One-line feature summary |
|
userStories | List of stories to complete |
|
userStories[].id | Unique identifier (US-001, US-002) |
|
userStories[].title | Short descriptive title |
|
userStories[].description | "As a [user], I want [feature] so that [benefit]" |
|
userStories[].acceptanceCriteria | Verifiable checklist items |
|
userStories[].priority | Execution order (1 = first) |
|
userStories[].passes | Completion status (
false →
true when done) |
|
userStories[].notes | Runtime notes added by agent |
Story Sizing
Each story should be completable in one context window.
✅ Right-sized:
- - Add a database column and migration
- Add a UI component to an existing page
- Update a server action with new logic
- Add a filter dropdown to a list
❌ Too large (split these):
- - "Build the entire dashboard" → Split into: schema, queries, UI, filters
- "Add authentication" → Split into: schema, middleware, login UI, session
Story Ordering
Stories execute in priority order. Earlier stories must NOT depend on later ones.
Correct order:
- 1. Schema/database changes (migrations)
- Server actions / backend logic
- UI components that use the backend
- Dashboard/summary views
Acceptance Criteria
Must be verifiable, not vague.
✅ Good:
- - "Add
status column to tasks table with default 'pending'" - "Filter dropdown has options: All, Active, Completed"
- "Typecheck passes"
❌ Bad:
- - "Works correctly"
- "User can do X easily"
Always include: INLINECODE18
Progress Tracking
Update passes: true when a story is complete. Use notes field for runtime observations:
CODEBLOCK1
Quick Reference
| Action | Command |
|---|
| Create PRD | Save to INLINECODE21 |
| Check status |
cat prd.json | jq '.userStories[] | {id, passes}' |
| View incomplete |
jq '.userStories[] | select(.passes == false)' prd.json |
Resources
See references/ for detailed documentation:
- -
agent-usage.md - How AI agents execute PRDs (Claude Code, OpenCode, etc.) - INLINECODE26 - Sequential workflow patterns
- INLINECODE27 - Templates and examples
PRD 技能
创建并管理用于功能规划的产品需求文档(PRD)。
什么是 PRD?
PRD(产品需求文档) 是一份结构化规范,用于:
- 1. 将功能拆分为小型、独立的用户故事
- 为每个故事定义可验证的验收标准
- 按依赖关系排列任务顺序(模式 → 后端 → 界面)
快速开始
- 1. 在项目中创建/编辑 agents/prd.json
- 定义带有验收标准的用户故事
- 通过将 passes: false 更新为 true 来跟踪进度
prd.json 格式
json
{
project: MyApp,
branchName: ralph/feature-name,
description: 功能的简短描述,
userStories: [
{
id: US-001,
title: 向数据库添加优先级字段,
description: 作为开发者,我需要存储任务优先级。,
acceptanceCriteria: [
添加优先级列:high | medium | low,
生成并运行迁移,
类型检查通过
],
priority: 1,
passes: false,
notes:
}
]
}
字段说明
| 字段 | 描述 |
|---|
| project | 用于上下文的项目名称 |
| branchName |
此功能的 Git 分支(以 ralph/ 为前缀) |
| description | 一行功能摘要 |
| userStories | 待完成的故事列表 |
| userStories[].id | 唯一标识符(US-001、US-002) |
| userStories[].title | 简短描述性标题 |
| userStories[].description | 作为 [用户],我想要 [功能] 以便 [收益] |
| userStories[].acceptanceCriteria | 可验证的检查清单项 |
| userStories[].priority | 执行顺序(1 = 优先) |
| userStories[].passes | 完成状态(完成后从 false 变为 true) |
| userStories[].notes | 代理添加的运行时备注 |
故事规模
每个故事应在一个上下文窗口内完成。
✅ 规模合适:
- - 添加数据库列和迁移
- 向现有页面添加 UI 组件
- 用新逻辑更新服务器操作
- 向列表添加筛选下拉框
❌ 规模过大(需拆分):
- - 构建整个仪表盘 → 拆分为:模式、查询、UI、筛选器
- 添加身份验证 → 拆分为:模式、中间件、登录 UI、会话
故事排序
故事按优先级顺序执行。较早的故事不能依赖于较晚的故事。
正确顺序:
- 1. 模式/数据库变更(迁移)
- 服务器操作 / 后端逻辑
- 使用后端的 UI 组件
- 仪表盘/汇总视图
验收标准
必须可验证,不能模糊。
✅ 好的示例:
- - 向 tasks 表添加 status 列,默认值为 pending
- 筛选下拉框包含选项:全部、活跃、已完成
- 类型检查通过
❌ 差的示例:
始终包含: 类型检查通过
进度跟踪
故事完成后更新 passes: true。使用 notes 字段记录运行时观察:
json
notes: 迁移时使用了 IF NOT EXISTS
快速参考
| 操作 | 命令 |
|---|
| 创建 PRD | 保存到 agents/prd.json |
| 检查状态 |
cat prd.json | jq .userStories[] | {id, passes} |
| 查看未完成 | jq .userStories[] | select(.passes == false) prd.json |
资源
详见 references/ 中的详细文档:
- - agent-usage.md - AI 代理如何执行 PRD(Claude Code、OpenCode 等)
- workflows.md - 顺序工作流模式
- output-patterns.md - 模板和示例