ln-221-story-creator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Story Creator

用户故事创建工具

Universal factory worker for creating Stories. Supports two modes:
  • CREATE MODE: Epic has no Stories → create from IDEAL plan (5-10 Stories)
  • ADD MODE: Epic has Stories → append new Story(s) from user request
Invoked by ln-220-story-coordinator (Phase 5a for CREATE, Phase 5c for ADD).
通用的用户故事创建工具,支持两种模式:
  • CREATE模式:当Epic下无用户故事时,基于IDEAL计划创建5-10个用户故事
  • ADD模式:当Epic下已有用户故事时,根据用户请求追加新的用户故事
由ln-220-story-coordinator触发调用(CREATE模式对应阶段5a,ADD模式对应阶段5c)。

When Invoked

触发时机

1. ln-220-story-coordinator CREATE MODE (Phase 5a):
  • Epic has NO existing Stories (Linear query count = 0)
  • IDEAL plan generated (Phase 3)
  • Standards Research completed by ln-001 (Phase 2)
  • Parameters:
    epicData
    ,
    idealPlan
    ,
    standardsResearch
    ,
    teamId
    ,
    autoApprove
2. ln-220-story-coordinator ADD MODE (Phase 5c):
  • Epic HAS existing Stories, user wants to ADD more (not replan)
  • Single Story or few Stories from user request
  • Parameters:
    epicData
    ,
    appendMode: true
    ,
    newStoryDescription
    ,
    standardsResearch
    ,
    teamId
1. ln-220-story-coordinator的CREATE模式(阶段5a):
  • Epic下无现有用户故事(Linear查询计数=0)
  • 已生成IDEAL计划(阶段3)
  • 已由ln-001完成标准研究(阶段2)
  • 参数:
    epicData
    idealPlan
    standardsResearch
    teamId
    autoApprove
2. ln-220-story-coordinator的ADD模式(阶段5c):
  • Epic下已有用户故事,用户希望追加更多(而非重新规划)
  • 根据用户请求创建单个或少量用户故事
  • 参数:
    epicData
    appendMode: true
    newStoryDescription
    standardsResearch
    teamId

Input Parameters

输入参数

For CREATE MODE (from ln-220-story-coordinator Phase 5a):
javascript
{
  epicData: {id, title, description},
  idealPlan: [
    {
      number: "US004",
      title: "Register OAuth client",
      statement: {persona, capability, value},
      ac: [GWT scenarios],
      technicalNotes: {architecture, integrations, performance},
      estimatedHours: 12,
      testCounts: {e2e: 2, integration: 5, unit: 11}
    }
  ],
  standardsResearch: "OAuth 2.0 (RFC 6749)...",
  teamId: "team-id",
  autoApprove: true
}
For ADD MODE (from ln-220-story-coordinator Phase 5c with appendMode):
javascript
{
  epicData: {id, title, description},
  appendMode: true,                    // Signals ADD MODE - append to existing
  newStoryDescription: "User's request for new Story",
  standardsResearch: "Focused research for new Story only",
  teamId: "team-id",
  autoApprove: false                   // User confirmation recommended
}
  • appendMode:
    true
    signals ADD MODE - append to existing Stories
  • newStoryDescription: User's request for new Story(s) to add
  • NO idealPlan - creates only what user requested (single Story or few)
CREATE模式(来自ln-220-story-coordinator阶段5a):
javascript
{
  epicData: {id, title, description},
  idealPlan: [
    {
      number: "US004",
      title: "Register OAuth client",
      statement: {persona, capability, value},
      ac: [GWT scenarios],
      technicalNotes: {architecture, integrations, performance},
      estimatedHours: 12,
      testCounts: {e2e: 2, integration: 5, unit: 11}
    }
  ],
  standardsResearch: "OAuth 2.0 (RFC 6749)...",
  teamId: "team-id",
  autoApprove: true
}
ADD模式(来自ln-220-story-coordinator阶段5c,带appendMode参数):
javascript
{
  epicData: {id, title, description},
  appendMode: true,                    // 标识ADD模式 - 追加到现有用户故事中
  newStoryDescription: "User's request for new Story",
  standardsResearch: "Focused research for new Story only",
  teamId: "team-id",
  autoApprove: false                   // 建议需用户确认
}
  • appendMode
    true
    表示ADD模式 - 追加到现有用户故事列表
  • newStoryDescription:用户对新增用户故事的需求描述
  • idealPlan
    参数 - 仅创建用户请求的内容(单个或少量用户故事)

Workflow

工作流程

[!NOTE] ADD MODE (appendMode: true): When adding Stories to existing Epic, workflow is simplified:
  • Phase 1: Generate only requested Story(s) from
    newStoryDescription
  • Skip full IDEAL plan comparison
  • Standards Research is focused only on new Story topics
  • Other phases proceed normally (INVEST, Preview, Create)
[!NOTE] ADD模式(appendMode: true):向现有Epic追加用户故事时,工作流程会简化:
  • 阶段1:仅基于
    newStoryDescription
    生成请求的用户故事
  • 跳过完整的IDEAL计划对比步骤
  • 标准研究仅聚焦于新增用户故事的主题
  • 其他阶段(INVEST验证、预览、创建)正常执行

Phase 1: Generate Story Documents

阶段1:生成用户故事文档

Load story template (see "Template Loading" section) and use 8 sections.
For EACH Story in IDEAL plan:
SectionContent
1. Story StatementAs a [persona] / I want [capability] / So that [value]
2. ContextCurrent Situation (from Epic Scope Out) / Desired Outcome (from Epic Success Criteria)
3. ACCopy AC from idealPlan (3-5 GWT scenarios)
4. TasksPlaceholder: "Tasks created via ln-300-task-coordinator after ln-310-story-validator"
5. Test StrategyCopy test counts from idealPlan, Risk-Based Testing note
6. Technical NotesINSERT Standards Research in Library Research subsection
7. DoDStandard checklist from template
8. DependenciesEmpty OR "Depends On: US00X" if ordering implies dependency
Output: Array of N complete Story documents (5-10) with Standards Research inserted.
加载用户故事模板(见“模板加载”章节),使用8个部分的结构。
针对IDEAL计划中的每个用户故事:
章节内容
1. 用户故事描述作为[角色] / 我希望[功能] / 以便[价值]
2. 背景当前现状(来自Epic范围定义) / 期望成果(来自Epic成功标准)
3. 验收标准(AC)从idealPlan中复制验收标准(3-5个GWT场景)
4. 任务占位符:“用户故事通过ln-310-story-validator验证后,由ln-300-task-coordinator创建任务”
5. 测试策略从idealPlan中复制测试数量,添加基于风险的测试说明
6. 技术说明在“库研究”小节中插入标准研究内容
7. 完成定义(DoD)模板中的标准检查清单
8. 依赖关系为空或“依赖于:US00X”(若顺序隐含依赖)
输出:包含N个完整用户故事文档的数组(5-10个),且已插入标准研究内容。

Phase 2: Validate INVEST

阶段2:验证INVEST标准

For EACH Story, check:
CriterionCheckPassFail
IndependentNo circular dependencies❌ STOP
NegotiableAC focus on WHAT not HOW❌ STOP
ValuableClear "So that" value❌ STOP
Estimable6-20 hours❌ STOP
Small3-5 AC, 10-28 tests❌ STOP
TestableMeasurable AC (GWT format)❌ STOP
Error if ANY Story fails → Report to orchestrator, stop execution.
针对每个用户故事,检查以下标准:
准则检查内容通过失败
独立性(Independent)无循环依赖❌ 终止执行
可协商性(Negotiable)验收标准聚焦于“做什么”而非“怎么做”❌ 终止执行
价值性(Valuable)“以便”部分明确体现价值❌ 终止执行
可估算性(Estimable)预估工时在6-20小时之间❌ 终止执行
规模适中(Small)3-5条验收标准,10-28个测试用例❌ 终止执行
可测试性(Testable)验收标准可量化(GWT格式)❌ 终止执行
若任意用户故事未通过检查则报错 → 向协调器报告错误,终止执行。

Phase 3: Show Preview

阶段3:展示预览

STORY CREATION PREVIEW for Epic 7: OAuth Authentication

Will create 5 Stories:

1. US004: Register OAuth client
   Persona: Third-party developer | Capability: Register app, get credentials
   Value: Can integrate with API | AC: 4 | Estimate: 12h | Tests: 18

2. US005: Request access token
   Persona: API client | Capability: Exchange credentials for token
   Value: Authenticate to API | AC: 5 | Estimate: 18h | Tests: 24

... (3 more)

Total: 5 Stories, 62h, 90 tests

Standards Research: OAuth 2.0 (RFC 6749), RFC 7636 (PKCE), RFC 7009 (Revocation)
Story ordering: Dependency-aware (US004 → US005 → US006)
INVEST validation: ✓

Type "confirm" to create.
Epic 7:OAuth认证的用户故事创建预览

将创建5个用户故事:

1. US004:注册OAuth客户端
   角色:第三方开发者 | 功能:注册应用、获取凭证
   价值:可与API集成 | 验收标准:4条 | 预估工时:12h | 测试用例:18个

2. US005:请求访问令牌
   角色:API客户端 | 功能:用凭证交换令牌
   价值:向API进行身份认证 | 验收标准:5条 | 预估工时:18h | 测试用例:24个

...(剩余3个)

总计:5个用户故事,62工时,90个测试用例

标准研究:OAuth 2.0 (RFC 6749)、RFC 7636 (PKCE)、RFC 7009 (撤销)
用户故事排序:基于依赖关系(US004 → US005 → US006)
INVEST验证:✓

输入"confirm"确认创建。

Phase 4: User Confirmation

阶段4:用户确认

If autoApprove=true: Skip confirmation → Phase 5 Otherwise: Wait for "confirm"
若autoApprove=true:跳过确认步骤,直接进入阶段5 否则:等待用户输入"confirm"

Phase 5: Create in Linear + Update Kanban

阶段5:在Linear中创建并更新看板

Create Linear Issues:
javascript
for each Story:
  create_issue({
    title: Story.number + ": " + Story.title,
    description: Story.generated_document,
    project: epicData.id,
    team: teamId,
    labels: ["user-story"],
    state: "Backlog"
  })
Update kanban_board.md:
Epic Grouping Algorithm:
  1. Find
    ### Backlog
  2. Search
    **Epic {epicNumber}: {epicTitle}**
    • Found: use existing Epic group
    • NOT found: create
      **Epic N: Epic Title**
  3. Add Stories under Epic (2-space indent, 📖 emoji)
Format:
markdown
**Epic 7: OAuth Authentication**

  📖 [ID: US004 Register OAuth client](url)
    _(tasks not created yet)_
  📖 [ID: US005 Request access token](url)
    _(tasks not created yet)_
Update Epic Story Counters table:
  • Last Story: US008
  • Next Story: US009
Return:
STORIES CREATED for Epic 7: OAuth Authentication

✓ Created 5 Stories in Linear:
  1. [ID: US004 Register OAuth client](url)
  2. [ID: US005 Request access token](url)
  3. [ID: US006 Validate access token](url)
  4. [ID: US007 Refresh expired token](url)
  5. [ID: US008 Revoke token](url)

✓ kanban_board.md updated (Backlog + Epic Story Counters)
✓ Standards Research included: OAuth 2.0, RFC 7636 PKCE, RFC 7009 Revocation

Total: 5 Stories, 62h, 90 tests

NEXT STEPS:
1. Run ln-310-story-validator to validate Stories (Backlog → Todo)
2. Use ln-300-task-coordinator to create tasks
创建Linear议题:
javascript
for each Story:
  create_issue({
    title: Story.number + ": " + Story.title,
    description: Story.generated_document,
    project: epicData.id,
    team: teamId,
    labels: ["user-story"],
    state: "Backlog"
  })
更新kanban_board.md:
Epic分组算法:
  1. 找到
    ### Backlog
    章节
  2. 搜索
    **Epic {epicNumber}: {epicTitle}**
    • 找到:使用现有Epic分组
    • 未找到:创建新的
      **Epic N: Epic Title**
      分组
  3. 在Epic分组下添加用户故事(缩进2个空格,📖表情符号)
格式:
markdown
**Epic 7:OAuth认证**

  📖 [ID: US004 注册OAuth客户端](url)
    _(任务尚未创建)_
  📖 [ID: US005 请求访问令牌](url)
    _(任务尚未创建)_
更新Epic用户故事计数器表格:
  • 最后一个用户故事:US008
  • 下一个用户故事编号:US009
返回结果:
Epic 7:OAuth认证的用户故事已创建完成

✓ 在Linear中创建5个用户故事:
  1. [ID: US004 注册OAuth客户端](url)
  2. [ID: US005 请求访问令牌](url)
  3. [ID: US006 验证访问令牌](url)
  4. [ID: US007 刷新过期令牌](url)
  5. [ID: US008 撤销令牌](url)

✓ 已更新kanban_board.md(待办事项 + Epic用户故事计数器)
✓ 已包含标准研究内容:OAuth 2.0、RFC 7636 PKCE、RFC 7009 撤销

总计:5个用户故事,62工时,90个测试用例

下一步操作:
1. 运行ln-310-story-validator验证用户故事(从待办事项→待处理)
2. 使用ln-300-task-coordinator创建任务

Critical Rules

关键规则

RuleDescription
Standards Research InsertionMUST insert in EVERY Story Technical Notes → Library Research
INVEST ValidationAll Stories must pass before creation (stop if ANY fails)
Template OwnershipThis skill owns story_template_universal.md in references/
Epic GroupingReuse Epic header if exists (search by Epic number), don't duplicate
Story NumberingSequential across ALL Epics (read Next Story from kanban_board.md)
No CodeDescriptions contain approach ONLY, not code
规则描述
标准研究内容插入必须在每个用户故事的技术说明→库研究小节中插入标准研究内容
INVEST标准验证所有用户故事必须通过验证才能创建(若任意失败则终止)
模板归属本工具拥有references/目录下的story_template_universal.md模板
Epic分组若存在Epic标题则复用(通过Epic编号搜索),不得重复创建
用户故事编号所有Epic下的用户故事编号连续递增(从kanban_board.md读取下一个编号)
无代码内容描述仅包含实现思路,不得包含代码

Definition of Done

完成定义

✅ Phase 1:
  • All N Stories have 8 sections
  • Standards Research inserted in Technical Notes → Library Research
✅ Phase 2:
  • All Stories pass INVEST validation
✅ Phase 3:
  • Preview shown (summaries, totals, Standards Research, ordering)
✅ Phase 4:
  • autoApprove=true OR user confirmed
✅ Phase 5:
  • All N Stories created in Linear (project=Epic, labels=user-story, state=Backlog)
  • kanban_board.md updated (Backlog + Epic Story Counters)
  • Summary returned (URLs + next steps)
✅ 阶段1:
  • 所有N个用户故事包含8个章节
  • 标准研究内容已插入技术说明→库研究小节
✅ 阶段2:
  • 所有用户故事通过INVEST标准验证
✅ 阶段3:
  • 已展示预览内容(摘要、总计、标准研究、排序)
✅ 阶段4:
  • autoApprove=true或已获得用户确认
✅ 阶段5:
  • 所有N个用户故事已在Linear中创建(项目=Epic,标签=user-story,状态=Backlog)
  • 已更新kanban_board.md(待办事项 + Epic用户故事计数器)
  • 已返回摘要结果(URL + 下一步操作)

Template Loading

模板加载

MANDATORY READ: Load
shared/references/template_loading_pattern.md
for template copy workflow.
Template:
story_template.md
Local copy:
docs/templates/story_template.md
(in target project)
必须阅读:加载
shared/references/template_loading_pattern.md
了解模板复制工作流程。
模板文件
story_template.md
本地副本:目标项目中的
docs/templates/story_template.md

Reference Files

参考文件

  • Kanban update algorithm:
    shared/references/kanban_update_algorithm.md
  • Template loading:
    shared/references/template_loading_pattern.md
  • Linear creation workflow:
    shared/references/linear_creation_workflow.md
  • 看板更新算法
    shared/references/kanban_update_algorithm.md
  • 模板加载
    shared/references/template_loading_pattern.md
  • Linear创建工作流程
    shared/references/linear_creation_workflow.md

story_template.md

story_template.md

Location:
shared/templates/story_template.md
(centralized) Local Copy:
docs/templates/story_template.md
(in target project) Purpose: Universal Story template (8 sections) Template Version: 9.0.0
位置
shared/templates/story_template.md
(集中存储) 本地副本:目标项目中的
docs/templates/story_template.md
用途:通用用户故事模板(8个章节) 模板版本:9.0.0

Integration

集成

Called by: ln-220-story-coordinator
  • Phase 5a (CREATE MODE, count = 0) - full IDEAL plan
  • Phase 5c (ADD MODE, count ≥ 1, appendMode) - user-requested Story(s)
Returns:
  • Success: Story URLs + summary + next steps
  • Error: "Story USXXX violates INVEST: [details]"
Worker does NOT:
  • Query Linear for Epic (already in context)
  • Analyze Epic complexity (orchestrator Phase 3)
  • Research standards (orchestrator Phase 2 delegates to ln-001)
  • Build IDEAL plan (receives from orchestrator)

Version: 3.0.0 Last Updated: 2025-12-23
调用方:ln-220-story-coordinator
  • 阶段5a(CREATE模式,故事数量=0)- 完整IDEAL计划
  • 阶段5c(ADD模式,故事数量≥1,带appendMode)- 用户请求的用户故事
返回结果
  • 成功:用户故事URL + 摘要 + 下一步操作
  • 错误:"用户故事USXXX违反INVEST标准:[详情]"
本工具不执行
  • 查询Linear获取Epic信息(已在上下文提供)
  • 分析Epic复杂度(由协调器在阶段3处理)
  • 进行标准研究(由协调器在阶段2委托给ln-001处理)
  • 构建IDEAL计划(从协调器接收)

版本:3.0.0 最后更新:2025-12-23