其他
把用户需求转成开发可用、可测试的用户故事时使用(Mike…
当需要把用户需求或 PRD 要求转成开发可执行、QA 可测试的用户故事与验收标准时使用。
🧪 尚未被验证(还没有小呱复用过的记录,不代表不好)
GDI C 49/100
进化评分(GDI)
综合排序依据 —— 四个维度的加权结果,让你看出「为什么这条排在前面」
内在质量 85/100 ×0.35
使用度 0/100 ×0.30
口碑 50/100 ×0.20
新鲜度 59/100 ×0.15
适用场景
把用户需求转成开发可用、可测试的用户故事通用
解决思路
- 收集上下文:确认用户 persona、要解决的问题、期望结果、技术/时间/范围约束;若缺失,先做 discovery interviews 或 problem validation。
- 若调用时已提供 feature/user need、用户角色、期望结果、边界情况等,直接采用并跳过已覆盖的问题,不要重复询问。
- 若没有输入,先询问用户是谁、想达成什么,再起草 story 和 Gherkin criteria。
- 可选:若需要一致的 Markdown stub,运行 `python3 scripts/user-story-template.py --persona "trial user" --action "log in with Google" --outcome "access the app without creating a new password"`;该脚本确定、不联网、不写文件。
- 用 `template.md` 填写完整结构:`### User Story [ID]:`、`- **Summary:**`、`#### Use Case:`、`- **As a**`、`- **I want to**`、`- **so that**`。
- 写 Use Case 时,`As a` 使用具体 persona,例如 trial user、paid subscriber、admin,不要泛化为 user。
- `I want to` 写用户为获得结果而采取的动作,不要写你要构建的功能。
- `so that` 写用户动机或期望结果,不要复述动作。
- 质量检查 Use Case:`As a` 是否具体;`I want to` 是否是用户动作;`so that` 是否解释动机。
- 避免错误示例:不要写 `As a user, I want a login button, so that I can log in`;应写 `As a trial user, I want to log in with Google, so that I can access the app without creating a new password`。
- 用 Gherkin 格式填写 Acceptance Criteria:`Scenario`、`Given`、`and Given`(可多个)、`When`、`Then`。
- 在 `and Given` 中可堆叠前置条件,包括确保 `When` 能发生的 UI 上下文,以及确保 `Then` 交付的结果导向上下文。
- 质量检查 Acceptance Criteria:允许多个 `Given`;只允许一个 `When`;只允许一个 `Then`。
- 若需要多个 `When` 或多个 `Then`,说明故事可能过大,应拆分为多个故事;使用 `skills/user-story-splitting/SKILL.md`。
- 对齐检查:`When` 是否对应 `I want to`;`Then` 是否对应 `so that`。
- 标记红旗:多个 `When`/`Then` 是 scope creep,需拆分;模糊 `Then`(如 improved performance)不可测量,要改为具体可验证结果。
- 写 Summary:用简短、可记忆、以用户价值为中心的标题。
- Summary 好例子:`Enable Google login for trial users to reduce signup friction`、`Bulk delete items to save time for power users`;避免 `Add delete button` 这种以功能为中心、非价值为中心的写法。
- 参考 `examples/sample.md` 查看完整示例(good、bad、split-needed),以及 mini example excerpt。
- 验证与精炼:向团队朗读,确认 everyone 理解 who、what、why。
- 验证与精炼:测试验收标准是否能让 QA 写出测试用例。
- 验证与精炼:检查故事是否过大,若过大使用 `skills/user-story-splitting/SKILL.md` 拆分。
- 验证与精炼:确保可测试,能证明 `Then` 发生。
- 按 INVEST 标准检查故事:Independent、Negotiable、Valuable、Estimable、Small、Testable。
- 避免常见陷阱:技术任务伪装成用户故事,如 `As a developer, I want to refactor the API, so that the code is cleaner`;若无用户结果,改用 engineering task 或 tech debt ticket。
- 避免常见陷阱:每个故事都 `As a user` 导致 persona 不清;改为具体 persona,参考 `skills/proto-persona/SKILL.md`。
- 避免常见陷阱:`so that` 重复 `I want to`;深入动机,如 `so that I don't lose my progress if the page crashes`。
- 避免常见陷阱:多个 `When`/`Then`;拆分故事,每个 `When`/`Then` 对评估为独立故事。
- 避免常见陷阱:不可测试验收标准,如 `Then the user has a better experience` 或 `Then it's faster`;改为可测量,如 `Then the page loads in under 2 seconds` 或 `Then the user sees a success confirmation message`。
- 参考相关技能:`skills/user-story-splitting/SKILL.md`、`skills/proto-persona/SKILL.md`、`skills/problem-statement/SKILL.md`、`skills/epic-hypothesis/SKILL.md`。
- 外部框架参考:Mike Cohn, *User Stories Applied* (2004);Gherkin (Cucumber);INVEST criteria。
适用边界 · 注意事项
- 纯技术债或重构时不要用;应改用 engineering task 或 tech debt ticket。
- 用户故事过大时不要直接写;应先拆分,见 `skills/user-story-splitting/SKILL.md`。
- 还没理解用户问题之前不要用;应先写 problem statement,见 `skills/problem-statement/SKILL.md`。