ln-310-story-validator
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseStory Verification Skill
Story验证技能
Validate Stories/Tasks with explicit GO/NO-GO verdict, Readiness Score, and Anti-Hallucination verification.
对用户故事(Stories)/任务(Tasks)进行验证,明确给出GO/NO-GO结论、就绪度评分以及反幻觉验证结果。
Purpose & Scope
目标与范围
- Validate Story plus child Tasks against industry standards and project patterns
- Calculate Penalty Points for violations, then auto-fix to reach 0 points
- Delegate to ln-002-best-practices-researcher for creating documentation (guides, manuals, ADRs, research)
- Support Plan Mode: show audit results, wait for approval, then fix
- Approve Story after fixes (Backlog -> Todo) with tabular output summary
- 对照行业标准和项目模式,验证用户故事及其子任务
- 针对违规项计算扣分项,然后自动修复以将扣分项降至0
- 委托ln-002-best-practices-researcher创建文档(指南、手册、架构决策记录ADR、研究报告)
- 支持计划模式:展示审计结果,等待审批后再执行修复
- 修复完成后批准用户故事(从待办积压Backlog移至待办Todo),并以表格形式输出摘要
When to Use
使用场景
- Reviewing Stories before approval (Backlog -> Todo)
- Validating implementation path across Story and Tasks
- Ensuring standards, architecture, and solution fit
- Optimizing or correcting proposed approaches
- 批准前评审用户故事(从Backlog移至Todo)
- 验证用户故事与任务的实现路径一致性
- 确保符合标准、架构和解决方案要求
- 优化或修正拟议的实现方案
Penalty Points System
扣分项系统
Goal: Quantitative assessment of Story/Tasks quality. Target = 0 penalty points after fixes.
| Severity | Points | Description |
|---|---|---|
| CRITICAL | 10 | RFC/OWASP/security violations |
| HIGH | 5 | Outdated libraries, architecture issues |
| MEDIUM | 3 | Best practices violations |
| LOW | 1 | Structural/cosmetic issues |
Workflow:
- Audit: Calculate penalty points for all 17 criteria
- Fix: Auto-fix and zero out points
- Report: Total Before -> 0 After
目标: 量化评估用户故事/任务的质量。修复后的目标扣分项为0。
| 严重程度 | 扣分 | 描述 |
|---|---|---|
| CRITICAL(严重) | 10 | 违反RFC/OWASP/安全标准 |
| HIGH(高) | 5 | 使用过时库、架构问题 |
| MEDIUM(中) | 3 | 违反最佳实践 |
| LOW(低) | 1 | 结构/格式问题 |
工作流程:
- 审计:针对全部17项准则计算扣分项
- 修复:自动修复问题,将扣分项清零
- 报告:展示修复前总分 → 修复后0分
Mode Detection
模式检测
Detect operating mode at startup:
Plan Mode Active:
- Phase 1-2: Full audit (discovery + research + penalty calculation)
- Phase 3: Show results + fix plan -> WAIT for user approval
- Phase 4-5: After approval -> execute fixes
Normal Mode:
- Phase 1-5: Standard workflow without stopping
- Automatically fix and approve
启动时自动检测运行模式:
计划模式激活:
- 阶段1-2:完整审计(发现+研究+扣分计算)
- 阶段3:展示结果+修复计划 → 等待用户审批
- 阶段4-5:获得审批后 → 执行修复
普通模式:
- 阶段1-5:执行标准工作流程,无需停顿
- 自动完成修复并批准
Workflow Overview
工作流程概述
Phase 1: Discovery & Loading
阶段1:发现与加载
Step 1: Configuration & Metadata Loading
- Auto-discover configuration: Team ID (), project docs (
docs/tasks/kanban_board.md), epic from Story.projectCLAUDE.md - Load metadata only: Story ID/title/status/labels, child Task IDs/titles/status/labels
- Expect 3-8 implementation tasks; record parentId for filtering
- Rationale: keep loading light; full descriptions arrive in Phase 2
步骤1:配置与元数据加载
- 自动发现配置:团队ID(来自)、项目文档(
docs/tasks/kanban_board.md)、用户故事所属的史诗(epic)CLAUDE.md - 仅加载元数据:用户故事ID/标题/状态/标签、子任务ID/标题/状态/标签
- 预期包含3-8个实现任务;记录父ID用于筛选
- 设计思路:轻量加载;完整描述将在阶段2获取
Phase 2: Research & Audit
阶段2:研究与审计
Always execute for every Story - no exceptions.
Step 1: Domain Extraction
- Extract technical domains from Story title + Technical Notes + Implementation Tasks
- Load pattern registry from
references/domain_patterns.md - Scan Story content for pattern matches via keyword detection
- Build list of detected domains requiring documentation
Step 2: Documentation Delegation
- For EACH detected pattern, delegate to ln-002:
Skill(skill="ln-002-best-practices-researcher", args="doc_type=[guide|manual|adr] topic='[pattern]'") - Receive file paths to created documentation (,
docs/guides/,docs/manuals/,docs/adrs/)docs/research/
Step 3: Research via MCP
- Query MCP Ref for industry standards:
ref_search_documentation(query="[topic] RFC OWASP best practices 2025") - Query Context7 for library versions: +
resolve-library-idquery-docs - Extract: standards (RFC numbers, OWASP rules), library versions, patterns
Step 3.5: Anti-Hallucination Verification
- Scan Story/Tasks for technical claims (RFC references, library versions, security requirements)
- Verify each claim has MCP Ref/Context7 evidence
- Flag unverified claims for correction
- Status: VERIFIED (all sourced) or FLAGGED (list unverified)
Step 4: Penalty Points Calculation
- Evaluate all 17 criteria against Story/Tasks
- Assign penalty points per violation (CRITICAL=10, HIGH=5, MEDIUM=3, LOW=1)
- Calculate total penalty points
- Build fix plan for each violation
所有用户故事必须执行此阶段,无例外。
步骤1:领域提取
- 从用户故事标题+技术说明+实现任务中提取技术领域
- 从加载模式注册表
references/domain_patterns.md - 通过关键词检测扫描用户故事内容,匹配模式
- 构建需要文档支持的已检测领域列表
步骤2:文档委托
- 针对每个已检测到的模式,委托给ln-002:
Skill(skill="ln-002-best-practices-researcher", args="doc_type=[guide|manual|adr] topic='[pattern]'") - 接收生成的文档路径(存储在、
docs/guides/、docs/manuals/、docs/adrs/)docs/research/
步骤3:通过MCP进行研究
- 查询MCP Ref获取行业标准:
ref_search_documentation(query="[topic] RFC OWASP best practices 2025") - 查询Context7获取库版本:+
resolve-library-idquery-docs - 提取内容:标准(RFC编号、OWASP规则)、库版本、模式
步骤3.5:反幻觉验证
- 扫描用户故事/任务中的技术声明(RFC引用、库版本、安全要求)
- 验证每个声明都有MCP Ref/Context7的证据支持
- 标记未经验证的声明以便修正
- 状态:VERIFIED(所有声明均有来源)或FLAGGED(列出未验证项)
步骤4:扣分项计算
- 对照用户故事/任务评估全部17项准则
- 根据违规严重程度分配扣分项(严重=10,高=5,中=3,低=1)
- 计算总扣分项
- 针对每个违规项制定修复计划
Phase 3: Audit Results & Fix Plan
阶段3:审计结果与修复计划
Display audit results:
- Penalty Points table (criterion, severity, points, description)
- Total: X penalty points
- Fix Plan: list of fixes for each criterion
Mode handling:
- IF Plan Mode: Show results + "After your approval, changes will be applied" -> WAIT
- ELSE (Normal Mode): Proceed to Phase 4 immediately
展示审计结果:
- 扣分项表格(准则、严重程度、扣分、描述)
- 总分:X扣分项
- 修复计划:列出每个准则对应的修复项
模式处理:
- 若为计划模式: 展示结果并提示“获得您的批准后,将应用变更” → 等待
- 否则(普通模式): 直接进入阶段4
Phase 4: Auto-Fix
阶段4:自动修复
Execute fixes for ALL 19 criteria on the spot.
- Execution order (7 groups):
- Structural (#1-#4) — Story/Tasks template compliance + AC completeness/specificity
- Standards (#5) — RFC/OWASP compliance FIRST (before YAGNI/KISS!)
- Solution (#6) — Library versions
- Workflow (#7-#13) — Test strategy, docs integration, size, cleanup, YAGNI, KISS, task order, Database Creation
- Quality (#14-#15) — Documentation complete, hardcoded values
- Dependencies (#18-#19) — Story/Task independence (no forward dependencies)
- Traceability (#16-#17) — Story-Task alignment, AC coverage quality (LAST, after all fixes)
- Use Auto-Fix Actions table below as authoritative checklist
- Zero out penalty points as fixes applied
- Test Strategy section must exist but remain empty (testing handled separately)
立即针对全部19项准则执行修复。
- 执行顺序(7组):
- 结构类(#1-#4) — 用户故事/任务模板合规性+验收标准(AC)完整性与明确性
- 标准类(#5) — 优先确保RFC/OWASP合规(先于YAGNI/KISS原则!)
- 解决方案类(#6) — 库版本
- 工作流类(#7-#13) — 测试策略、文档集成、规模、清理、YAGNI、KISS、任务顺序、数据库创建
- 质量类(#14-#15) — 文档完整性、硬编码值
- 依赖类(#18-#19) — 用户故事/任务独立性(无前置依赖)
- 可追溯性类(#16-#17) — 用户故事-任务对齐、验收标准覆盖质量(最后执行,在所有修复完成后)
- 以下方的自动修复操作表作为权威检查清单
- 修复完成后将扣分项清零
- 测试策略部分必须存在但保持为空(测试由其他模块单独处理)
Phase 5: Approve & Notify
阶段5:批准与通知
- Set Story + all Tasks to Todo (Linear); update with APPROVED marker
kanban_board.md - Add Linear comment with full validation summary:
- Penalty Points table (Before -> After = 0)
- Auto-Fixes Applied table
- Documentation Created table (docs created via ln-002)
- Standards Compliance Evidence table
- Display tabular output (Unicode box-drawing) to terminal
- Final: Total Penalty Points = 0
- Optional: If flag provided, delegate to ln-400-story-executor to start execution immediately after approval
--execute
- 将用户故事及所有任务设置为Todo状态(在Linear中);更新并添加APPROVED标记
kanban_board.md - 添加Linear评论,包含完整的验证摘要:
- 扣分项表格(修复前 → 修复后=0)
- 已应用的自动修复表格
- 已创建的文档表格(通过ln-002生成的文档)
- 标准合规性证据表格
- 在终端以表格形式输出(使用Unicode框线绘制)
- 最终状态:总扣分项=0
- 可选: 若提供参数,修复批准后立即委托ln-400-story-executor启动执行
--execute
Auto-Fix Actions Reference
自动修复操作参考
Structural (#1-#4)
结构类(#1-#4)
| # | Criterion | What it checks | Penalty | Auto-fix actions |
|---|---|---|---|---|
| 1 | Story Structure | 8 sections per template | LOW (1) | Add/reorder sections with TODO placeholders; update Linear |
| 2 | Tasks Structure | Each Task has 7 sections | LOW (1) | Load each Task; add/reorder sections; update Linear |
| 3 | Story Statement | As a/I want/So that clarity | LOW (1) | Rewrite using persona/capability/value; update Linear |
| 4 | Acceptance Criteria | Given/When/Then, 3-5 items | MEDIUM (3) | Normalize to G/W/T; add edge cases; update Linear |
| # | 准则 | 检查内容 | 扣分 | 自动修复操作 |
|---|---|---|---|---|
| 1 | 用户故事结构 | 符合8个章节的模板要求 | LOW(1) | 添加/调整章节顺序并插入TODO占位符;更新Linear |
| 2 | 任务结构 | 每个任务包含7个章节 | LOW(1) | 加载每个任务;添加/调整章节顺序;更新Linear |
| 3 | 用户故事声明 | 符合“As a/I want/So that”的清晰表述 | LOW(1) | 重写为角色/能力/价值的结构;更新Linear |
| 4 | 验收标准 | 符合Given/When/Then格式,包含3-5项内容 | MEDIUM(3) | 标准化为G/W/T格式;添加边缘场景;更新Linear |
Standards (#5)
标准类(#5)
| # | Criterion | What it checks | Penalty | Auto-fix actions |
|---|---|---|---|---|
| 5 | Standards Compliance | RFC, OWASP, REST, Security | CRITICAL (10) | Query MCP Ref; update Technical Notes with compliant approach |
| # | 准则 | 检查内容 | 扣分 | 自动修复操作 |
|---|---|---|---|---|
| 5 | 标准合规性 | 符合RFC、OWASP、REST、安全标准 | CRITICAL(10) | 查询MCP Ref;更新技术说明为合规方案 |
Solution (#6)
解决方案类(#6)
| # | Criterion | What it checks | Penalty | Auto-fix actions |
|---|---|---|---|---|
| 6 | Library & Version | Libraries are latest stable | HIGH (5) | Query Context7; update to recommended versions |
| # | 准则 | 检查内容 | 扣分 | 自动修复操作 |
|---|---|---|---|---|
| 6 | 库与版本 | 使用最新稳定版库 | HIGH(5) | 查询Context7;更新为推荐版本 |
Workflow (#7-#13)
工作流类(#7-#13)
| # | Criterion | What it checks | Penalty | Auto-fix actions |
|---|---|---|---|---|
| 7 | Test Strategy | Section exists but empty | LOW (1) | Ensure section present; leave empty (testing handled separately) |
| 8 | Documentation Integration | No standalone doc tasks | MEDIUM (3) | Remove doc-only tasks; fold into implementation DoD |
| 9 | Story Size | 3-8 tasks; 3-5h each | MEDIUM (3) | If <3 or >8, add TODO; flag task size issues |
| 10 | Test Task Cleanup | No premature test tasks | MEDIUM (3) | Remove test tasks before final; testing appears later |
| 11 | YAGNI | No premature features | MEDIUM (3) | Move speculative items to Out of Scope unless standards require |
| 12 | KISS | Simplest solution | MEDIUM (3) | Simplify unless standards require complexity |
| 13 | Task Order | DB→Service→API→UI | MEDIUM (3) | Reorder Tasks foundation-first |
| # | 准则 | 检查内容 | 扣分 | 自动修复操作 |
|---|---|---|---|---|
| 7 | 测试策略 | 存在该章节但内容为空 | LOW(1) | 确保章节存在;保持为空(测试由其他模块单独处理) |
| 8 | 文档集成 | 无独立的文档任务 | MEDIUM(3) | 删除仅含文档的任务;将文档要求纳入实现任务的完成定义(DoD) |
| 9 | 用户故事规模 | 包含3-8个任务;每个任务耗时3-5小时 | MEDIUM(3) | 若任务数<3或>8,添加TODO;标记任务规模问题 |
| 10 | 测试任务清理 | 无提前创建的测试任务 | MEDIUM(3) | 删除最终阶段前的测试任务;测试任务将在后续阶段添加 |
| 11 | YAGNI原则 | 无提前实现的功能 | MEDIUM(3) | 将推测性功能移至“超出范围”,除非标准要求必须实现 |
| 12 | KISS原则 | 使用最简解决方案 | MEDIUM(3) | 简化方案,除非标准要求必须复杂实现 |
| 13 | 任务顺序 | 遵循DB→Service→API→UI的顺序 | MEDIUM(3) | 重新排序任务,优先实现基础组件 |
Quality (#14-#15)
质量类(#14-#15)
| # | Criterion | What it checks | Penalty | Auto-fix actions |
|---|---|---|---|---|
| 14 | Documentation Complete | Pattern docs exist + referenced | HIGH (5) | Delegate to ln-002; add all doc links to Technical Notes |
| 15 | Code Quality Basics | No hardcoded values | MEDIUM (3) | Add TODOs for constants/config/env |
| # | 准则 | 检查内容 | 扣分 | 自动修复操作 |
|---|---|---|---|---|
| 14 | 文档完整性 | 存在模式文档并已引用 | HIGH(5) | 委托ln-002生成文档;在技术说明中添加所有文档链接 |
| 15 | 代码质量基础 | 无硬编码值 | MEDIUM(3) | 添加TODO标记,提示替换为常量/配置/环境变量 |
Traceability (#16-#17)
可追溯性类(#16-#17)
| # | Criterion | What it checks | Penalty | Auto-fix actions |
|---|---|---|---|---|
| 16 | Story-Task Alignment | Tasks implement Story statement | MEDIUM (3) | Add TODO to misaligned Tasks; warn user |
| 17 | AC-Task Coverage | Each AC has implementing Task | MEDIUM (3) | Add TODO for uncovered ACs; suggest missing Tasks |
| # | 准则 | 检查内容 | 扣分 | 自动修复操作 |
|---|---|---|---|---|
| 16 | 用户故事-任务对齐 | 任务实现用户故事声明 | MEDIUM(3) | 对未对齐的任务添加TODO标记;向用户发出警告 |
| 17 | 验收标准-任务覆盖 | 每个验收标准都有对应的实现任务 | MEDIUM(3) | 对未覆盖的验收标准添加TODO标记;建议补充缺失的任务 |
Dependencies (#18-#19)
依赖类(#18-#19)
| # | Criterion | What it checks | Penalty | Auto-fix actions |
|---|---|---|---|---|
| 18 | Story Dependencies | No forward Story dependencies | CRITICAL (10) | Flag forward dependencies; suggest reorder |
| 19 | Task Dependencies | No forward Task dependencies | MEDIUM (3) | Flag forward dependencies; reorder Tasks |
Maximum Penalty: 60 points
| # | 准则 | 检查内容 | 扣分 | 自动修复操作 |
|---|---|---|---|---|
| 18 | 用户故事依赖 | 无前置用户故事依赖 | CRITICAL(10) | 标记前置依赖;建议重新排序 |
| 19 | 任务依赖 | 无前置任务依赖 | MEDIUM(3) | 标记前置依赖;重新排序任务 |
最高扣分项: 60分
Final Assessment Model
最终评估模型
Outputs after all fixes applied:
| Metric | Value | Meaning |
|---|---|---|
| Gate | GO / NO-GO | Final verdict for execution readiness |
| Readiness Score | 1-10 | Quality confidence level |
| Penalty Points | 0 (after fixes) | Validation completeness |
| Anti-Hallucination | VERIFIED / FLAGGED | Technical claims verified |
| AC Coverage | 100% (N/N) | All ACs mapped to Tasks |
所有修复完成后的输出:
| 指标 | 取值 | 含义 |
|---|---|---|
| Gate(准入) | GO / NO-GO | 执行就绪度的最终结论 |
| 就绪度评分 | 1-10 | 质量置信度等级 |
| 扣分项 | 0(修复后) | 验证完成度 |
| 反幻觉验证 | VERIFIED / FLAGGED | 技术声明是否已验证 |
| 验收标准覆盖率 | 100%(N/N) | 所有验收标准均映射到任务 |
Readiness Score Calculation
就绪度评分计算
Readiness Score = 10 - (Penalty Points / 5)| Score | Status | Gate |
|---|---|---|
| 9-10 | Excellent | GO |
| 7-8 | Good | GO |
| 5-6 | Acceptable | GO (with notes) |
| 3-4 | Concerns | NO-GO (requires review) |
| 1-2 | Critical | NO-GO (major issues) |
Readiness Score = 10 - (Penalty Points / 5)| 评分 | 状态 | 准入结论 |
|---|---|---|
| 9-10 | 优秀 | GO |
| 7-8 | 良好 | GO |
| 5-6 | 可接受 | GO(附带说明) |
| 3-4 | 存在问题 | NO-GO(需评审) |
| 1-2 | 严重问题 | NO-GO(重大问题) |
Anti-Hallucination Verification
反幻觉验证
Verify technical claims have evidence:
| Claim Type | Verification |
|---|---|
| RFC/Standard reference | MCP Ref search confirms existence |
| Library version | Context7 query confirms version |
| Security requirement | OWASP/CWE reference exists |
| Performance claim | Benchmark/doc reference |
Status: VERIFIED (all claims sourced) or FLAGGED (unverified claims listed)
验证技术声明是否有证据支持:
| 声明类型 | 验证方式 |
|---|---|
| RFC/标准引用 | 通过MCP Ref搜索确认存在 |
| 库版本 | 通过Context7查询确认版本有效性 |
| 安全要求 | 存在OWASP/CWE引用 |
| 性能声明 | 存在基准测试/文档引用 |
状态: VERIFIED(所有声明均有来源)或FLAGGED(列出未验证声明)
Task-AC Coverage Matrix
任务-验收标准覆盖矩阵
Output explicit mapping:
| AC | Task(s) | Coverage |
|----|---------|----------|
| AC1: Given/When/Then | T-001, T-002 | ✅ |
| AC2: Given/When/Then | T-003 | ✅ |
| AC3: Given/When/Then | — | ❌ UNCOVERED |Coverage: (target: 100%)
{covered}/{total} ACs输出明确的映射关系:
| AC | Task(s) | Coverage |
|----|---------|----------|
| AC1: Given/When/Then | T-001, T-002 | ✅ |
| AC2: Given/When/Then | T-003 | ✅ |
| AC3: Given/When/Then | — | ❌ UNCOVERED |覆盖率: 验收标准(目标:100%)
{已覆盖数}/{总数}Self-Audit Protocol (Mandatory)
自审计协议(强制要求)
Before marking any criterion as complete, provide concrete evidence (doc path, MCP result, Linear update).
| # | Self-Audit Question | Required Evidence |
|---|---|---|
| 1 | Validated all 8 Story sections? | Section list |
| 2 | Loaded full description for each Task? | Task validation count |
| 3 | Statement in As a/I want/So that? | Quoted statement |
| 4 | AC are G/W/T and testable? | AC count and format |
| 5 | Verified RFC/OWASP/REST compliance? | Standards list + MCP result |
| 6 | Checked library versions via Context7? | Context7 result |
| 7 | Test Strategy kept empty? | Note that testing deferred |
| 8 | Docs integrated, no standalone tasks? | Integration evidence |
| 9 | Task count 3-8 and 3-5h? | Task count/sizes |
| 10 | No premature test tasks? | Search result |
| 11 | Only current-scope features (YAGNI)? | Scope review |
| 12 | Simplest approach within standards (KISS)? | Simplicity justification |
| 13 | Tasks ordered Foundation-First? | Task order list |
| 14 | All pattern docs exist and referenced? | Doc paths from ln-002 |
| 15 | Hardcoded values handled? | TODO/config evidence |
| 16 | Each Task aligns with Story statement? | Alignment check result |
| 17 | Each AC has implementing Task? | Coverage matrix |
在标记任何准则为完成前,需提供具体证据(文档路径、MCP结果、Linear更新记录)。
| # | 自审计问题 | 所需证据 |
|---|---|---|
| 1 | 是否已验证全部8个用户故事章节? | 章节列表 |
| 2 | 是否已加载每个任务的完整描述? | 任务验证计数 |
| 3 | 用户故事声明是否符合As a/I want/So that格式? | 引用声明内容 |
| 4 | 验收标准是否为G/W/T格式且可测试? | 验收标准数量与格式说明 |
| 5 | 是否已验证RFC/OWASP/REST合规性? | 标准列表+MCP结果 |
| 6 | 是否已通过Context7检查库版本? | Context7查询结果 |
| 7 | 测试策略是否保持为空? | 测试延迟处理的说明 |
| 8 | 是否已集成文档,无独立文档任务? | 集成证据 |
| 9 | 任务数是否为3-8个且每个任务耗时3-5小时? | 任务数量/规模说明 |
| 10 | 是否无提前创建的测试任务? | 搜索结果 |
| 11 | 是否仅包含当前范围内的功能(符合YAGNI原则)? | 范围评审结果 |
| 12 | 是否在标准允许范围内使用最简方案(符合KISS原则)? | 简化方案的合理性说明 |
| 13 | 任务是否按基础优先的顺序排列? | 任务顺序列表 |
| 14 | 所有模式文档是否已存在并被引用? | ln-002返回的文档路径 |
| 15 | 硬编码值是否已处理? | TODO/配置证据 |
| 16 | 每个任务是否与用户故事声明对齐? | 对齐检查结果 |
| 17 | 每个验收标准是否有对应的实现任务? | 覆盖矩阵 |
Definition of Done
完成定义
- Phase 1: Auto-discovery done; Story + Tasks metadata loaded; task count checked
- Phase 2: Domain extraction complete; ln-002 delegated for docs; MCP research done; Anti-Hallucination verification done; Penalty Points calculated
- Phase 3: Audit results shown; IF Plan Mode: user approved
- Phase 4: All 17 criteria auto-fixed; Penalty Points = 0; Test Strategy empty; test tasks removed
- Phase 5: Final Assessment output:
yaml
gate: GO | NO-GO readiness_score: {1-10} penalty_points: 0 (was {N}) anti_hallucination: VERIFIED | FLAGGED ac_coverage: "{N}/{M} (100%)" ac_matrix: - ac: "AC1" tasks: ["T-001", "T-002"] status: covered - Story/Tasks set to Todo; updated; Linear comment with Final Assessment added
kanban_board.md - Optional: If flag, ln-400-story-executor invoked after approval
--execute
- 阶段1: 自动发现完成;已加载用户故事+任务元数据;已检查任务数量
- 阶段2: 领域提取完成;已委托ln-002生成文档;MCP研究完成;反幻觉验证完成;扣分项计算完成
- 阶段3: 已展示审计结果;若为计划模式:已获得用户批准
- 阶段4: 全部17项准则已自动修复;扣分项=0;测试策略为空;已移除测试任务
- 阶段5: 输出最终评估结果:
yaml
gate: GO | NO-GO readiness_score: {1-10} penalty_points: 0 (was {N}) anti_hallucination: VERIFIED | FLAGGED ac_coverage: "{N}/{M} (100%)" ac_matrix: - ac: "AC1" tasks: ["T-001", "T-002"] status: covered - 用户故事/任务已设置为Todo状态;已更新;已在Linear中添加包含最终评估的评论
kanban_board.md - 可选: 若提供参数,批准后已调用ln-400-story-executor
--execute
Example Workflow
示例工作流程
Story: "Create user management API with rate limiting"
- Phase 1: Load metadata (5 Tasks, status Backlog)
- Phase 2:
- Domain extraction: REST API, Rate Limiting
- Delegate ln-002: creates Guide-05 (REST patterns), Guide-06 (Rate Limiting)
- MCP Ref: RFC 7231 compliance, OWASP API Security
- Context7: Express v4.19 (current v4.17)
- Penalty Points: 18 total (version=5, missing docs=5, structure=3, standards=5)
- Phase 3:
- Show Penalty Points table
- IF Plan Mode: "18 penalty points found. Fix plan ready. Approve?"
- Phase 4:
- Fix #6: Update Express v4.17 -> v4.19
- Fix #5: Add RFC 7231 compliance notes
- Fix #13: Add Guide-05, Guide-06 references
- Fix #17: Docs already created by ln-002
- All fixes applied, Penalty Points = 0
- Phase 5: Story -> Todo, tabular report
用户故事: "创建带速率限制的用户管理API"
- 阶段1: 加载元数据(5个任务,状态为Backlog)
- 阶段2:
- 领域提取:REST API、速率限制
- 委托ln-002:生成指南Guide-05(REST模式)、Guide-06(速率限制)
- MCP Ref:确认符合RFC 7231、OWASP API安全标准
- Context7:当前使用Express v4.17(最新稳定版为v4.19)
- 扣分项:总计18分(版本问题=5分,缺失文档=5分,结构问题=3分,标准合规=5分)
- 阶段3:
- 展示扣分项表格
- 若为计划模式:提示“发现18个扣分项。修复计划已就绪。是否批准?”
- 阶段4:
- 修复#6:将Express v4.17更新为v4.19
- 修复#5:添加RFC 7231合规说明
- 修复#13:添加Guide-05、Guide-06的引用
- 修复#17:文档已由ln-002生成
- 所有修复完成,扣分项=0
- 阶段5: 用户故事状态改为Todo,输出表格报告
Template Loading
模板加载
Templates: ,
story_template.mdtask_template_implementation.mdLoading Logic:
- Check if exists in target project
docs/templates/{template}.md - IF NOT EXISTS:
a. Create directory if missing b. Copy
docs/templates/→shared/templates/{template}.mdc. Replace placeholders in the LOCAL copy:docs/templates/{template}.md- → from
{{TEAM_ID}}docs/tasks/kanban_board.md - → "docs" (standard)
{{DOCS_PATH}}
- Use LOCAL copy () for all validation operations
docs/templates/{template}.md
Rationale: Templates are copied to target project on first use, ensuring:
- Project independence (no dependency on skills repository)
- Customization possible (project can modify local templates)
- Placeholder replacement happens once at copy time
模板文件: 、
story_template.mdtask_template_implementation.md加载逻辑:
- 检查目标项目中是否存在
docs/templates/{template}.md - 若不存在:
a. 若目录不存在则创建 b. 将
docs/templates/复制到shared/templates/{template}.mdc. 替换本地副本中的占位符:docs/templates/{template}.md- → 来自
{{TEAM_ID}}的团队IDdocs/tasks/kanban_board.md - → 标准值“docs”
{{DOCS_PATH}}
- 使用本地副本()进行所有验证操作
docs/templates/{template}.md
设计思路: 首次使用时将模板复制到目标项目,确保:
- 项目独立性(不依赖技能仓库)
- 支持自定义(项目可修改本地模板)
- 占位符仅在复制时替换一次
Reference Files
参考文件
- AC validation rules:
shared/references/ac_validation_rules.md - Plan mode behavior:
shared/references/plan_mode_pattern.md - Final Assessment: (GO/NO-GO rules, Readiness Score calculation)
references/readiness_scoring.md - Templates (centralized): ,
shared/templates/story_template.mdshared/templates/task_template_implementation.md - Local copies: (in target project)
docs/templates/ - Validation Checklists (Progressive Disclosure):
- (overview of 7 categories)
references/verification_checklist_template.md - (criteria #1-#4)
references/structural_validation.md - (criterion #5)
references/standards_validation.md - (criterion #6)
references/solution_validation.md - (criteria #7-#13)
references/workflow_validation.md - (criteria #14-#15)
references/quality_validation.md - (criteria #18-#19)
references/dependency_validation.md - (criteria #16-#17)
references/traceability_validation.md - (pattern registry for ln-002 delegation)
references/domain_patterns.md - (penalty system details)
references/penalty_points.md
- Linear integration:
../shared/templates/linear_integration.md
Version: 7.0.0 (BREAKING: Added 2 new criteria #18-#19 for Story/Task dependencies per BMAD Method. Expanded criterion #4 with AC completeness/specificity, #9 with Database Creation Principle, #13 with forward dependency checks, #17 with STRONG/WEAK/MISSING coverage quality. Total 19 criteria, max 60 penalty points.)
Last Updated: 2026-02-03
- 验收标准验证规则:
shared/references/ac_validation_rules.md - 计划模式行为:
shared/references/plan_mode_pattern.md - 最终评估: (GO/NO-GO规则、就绪度评分计算方法)
references/readiness_scoring.md - 集中式模板: 、
shared/templates/story_template.mdshared/templates/task_template_implementation.md - 本地副本: (目标项目中)
docs/templates/ - 验证检查清单(渐进式披露):
- (7类准则概述)
references/verification_checklist_template.md - (准则#1-#4)
references/structural_validation.md - (准则#5)
references/standards_validation.md - (准则#6)
references/solution_validation.md - (准则#7-#13)
references/workflow_validation.md - (准则#14-#15)
references/quality_validation.md - (准则#18-#19)
references/dependency_validation.md - (准则#16-#17)
references/traceability_validation.md - (用于委托ln-002的模式注册表)
references/domain_patterns.md - (扣分项系统细节)
references/penalty_points.md
- Linear集成:
../shared/templates/linear_integration.md
版本: 7.0.0(重大更新:根据BMAD方法新增2项准则#18-#19,用于检查用户故事/任务依赖。扩展了准则#4(验收标准完整性与明确性)、#9(数据库创建原则)、#13(前置依赖检查)、#17(覆盖质量分为STRONG/WEAK/MISSING)。总计19项准则,最高扣分项60分。)
最后更新日期: 2026-02-03