@xulthekl/team-flow 0.42.0 → 0.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/.claude/always/phase-guard.md +1 -1
  2. package/.claude-plugin/marketplace.json +3 -3
  3. package/.claude-plugin/plugin.json +2 -2
  4. package/.codex-plugin/plugin.json +2 -2
  5. package/.cursor-plugin/marketplace.json +2 -2
  6. package/.cursor-plugin/plugin.json +2 -2
  7. package/.github/plugin/marketplace.json +3 -3
  8. package/.zcode/skills/workflow-start/SKILL.md +2 -2
  9. package/AGENTS.md +16 -9
  10. package/CHANGELOG.md +38 -1
  11. package/GEMINI.md +1 -1
  12. package/HANDOFF.md +1 -1
  13. package/INSTALL.md +26 -24
  14. package/README.md +8 -7
  15. package/agents/architecture-design.md +2 -2
  16. package/agents/architecture-reviewer.md +3 -3
  17. package/agents/business-analysis.md +53 -0
  18. package/agents/change-split-auditor.md +3 -3
  19. package/agents/need-explorer.md +1 -1
  20. package/agents/prd-completeness-reviewer.md +2 -2
  21. package/agents/prototype-env-scout.md +2 -2
  22. package/agents/prototype-reviewer.md +2 -2
  23. package/agents/spec-writer.md +1 -1
  24. package/docs/README_en.md +1 -1
  25. package/docs/examples/add-dark-mode/specs/ui-theme/spec.md +15 -17
  26. package/docs/examples/refactor-auth-boundary/specs/auth-boundary/spec.md +15 -27
  27. package/docs/solutions/INDEX.md +1 -0
  28. package/docs/solutions/cross-phase/2026-08-17-no-summary.md +17 -0
  29. package/docs/usage-guide.md +619 -0
  30. package/gemini-extension.json +2 -2
  31. package/hooks/session-start +3 -3
  32. package/llms.txt +1 -1
  33. package/package.json +2 -2
  34. package/plugin.json +2 -2
  35. package/scripts/lib/cmd-deisolate.mjs +68 -4
  36. package/scripts/team-flow.mjs +1 -1
  37. package/skills/architecture-design/SKILL.md +2 -2
  38. package/skills/architecture-design/references/s3.5-product-architecture.md +3 -3
  39. package/skills/architecture-design/templates/change-brief.md +3 -3
  40. package/skills/build-executor/SKILL.md +24 -4
  41. package/skills/build-executor/implementer-prompt.md +1 -0
  42. package/skills/business-analysis/SKILL.md +80 -0
  43. package/skills/business-analysis/references/interaction-rules.md +86 -0
  44. package/skills/business-analysis/references/output-schema.md +88 -0
  45. package/skills/business-analysis/references/qa-checklist.md +31 -0
  46. package/skills/business-analysis/references/version-resolution.md +41 -0
  47. package/skills/ce-brainstorm/SKILL.md +50 -4
  48. package/skills/ce-brainstorm/references/brainstorm-sections.md +3 -3
  49. package/skills/ce-brainstorm/references/business-processes.md +42 -9
  50. package/skills/ce-brainstorm/references/handoff.md +1 -1
  51. package/skills/ce-brainstorm/references/phase0-routing.md +11 -10
  52. package/skills/ce-brainstorm/references/prd-mapping.md +3 -3
  53. package/skills/ce-brainstorm/references/prototype-loop.md +2 -2
  54. package/skills/ce-compound/references/three-tier-index.md +1 -1
  55. package/skills/ce-plan/SKILL.md +2 -2
  56. package/skills/ce-plan/references/core-principles.md +1 -1
  57. package/skills/ce-plan/references/intake-routing.md +5 -5
  58. package/skills/ce-plan/references/plan-structure.md +2 -2
  59. package/skills/ce-plan/references/planning-modes.md +2 -2
  60. package/skills/ce-plan/references/review-and-write.md +3 -3
  61. package/skills/code-reviewer/SKILL.md +9 -0
  62. package/skills/code-reviewer/code-reviewer-prompt.md +7 -0
  63. package/skills/need-explorer/SKILL.md +1 -1
  64. package/skills/prototype/references/orchestration-flow.md +2 -2
  65. package/skills/release-archivist/SKILL.md +21 -2
  66. package/skills/release-archivist/references/worktree-merge.md +69 -0
  67. package/skills/session-handoff/SKILL.md +1 -1
  68. package/skills/session-handoff/references/handoff-template.md +2 -2
  69. package/skills/spec-writer/SKILL.md +6 -3
  70. package/skills/workflow-bootstrap/SKILL.md +2 -2
  71. package/skills/workflow-bootstrap/references/b1-reconnaissance.md +1 -1
  72. package/skills/workflow-bootstrap/references/b5-path-decision.md +1 -1
  73. package/skills/workflow-bootstrap/templates/claude-md-team-flow.md +2 -2
  74. package/skills/workflow-orchestrator/SKILL.md +3 -3
  75. package/skills/workflow-orchestrator/references/feedback-loops.md +1 -1
  76. package/skills/workflow-orchestrator/references/s1-path-router.md +1 -1
  77. package/skills/workflow-orchestrator/references/s2-prd-prototype-loop.md +6 -6
  78. package/skills/workflow-orchestrator/references/s3-plan-pipeline.md +3 -3
  79. package/skills/workflow-orchestrator/references/s4-split-validate.md +5 -5
  80. package/skills/workflow-orchestrator/references/state-model.md +4 -4
  81. package/skills/workflow-start/SKILL.md +2 -2
  82. package/skills/workflow-start/references/routing-rules.md +3 -3
  83. package/templates/change-brief.md +3 -3
  84. package/templates/plan.md +1 -1
package/llms.txt CHANGED
@@ -3,7 +3,7 @@
3
3
  ## Overview
4
4
  spec-superflow is a self-contained workflow integration plugin for Claude Code, Cursor, OpenAI Codex CLI/App, GitHub Copilot CLI, Gemini CLI, OpenCode, WorkBuddy, and Trae. It merges spec-driven planning artifacts (proposal, specs, design, tasks) with disciplined execution guardrails (TDD, review gates, controlled handoff) into one unified workflow.
5
5
 
6
- Current version: v0.42.0.
6
+ Current version: v0.44.0.
7
7
 
8
8
  ## Key Documents
9
9
  - README.md: Chinese homepage with full usage guide and FAQ
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xulthekl/team-flow",
3
- "version": "0.42.0",
4
- "description": "Unified plugin (24 skills + 15 agents) integrating team-flow, compound-engineering, architecture-design, prototype, design-system, workflow-orchestrator, workflow-bootstrap, e2e, session-handoff, workflow-feedback for multi-agent coding tools.",
3
+ "version": "0.44.0",
4
+ "description": "Unified plugin (25 skills + 16 agents) integrating team-flow, compound-engineering, architecture-design, prototype, design-system, workflow-orchestrator, workflow-bootstrap, e2e, session-handoff, workflow-feedback, business-analysis for multi-agent coding tools.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "bin": {
package/plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "team-flow",
3
- "version": "0.42.0",
4
- "description": "Unified workflow plugin: team-flow (spec-driven dev: TDD/SDD/code-review/debugging) + compound-engineering core subset (brainstorm/plan/compound/strategy/ideate/proof, global compounding) + architecture-design (4A+DDD incremental design & global compounding) + prototype (local HTML prototype, zero external deps) + e2e (Playwright E2E, AC-driven) + workflow-orchestrator (product-level workflow orchestration) + workflow-bootstrap (existing project onboarding) + session-handoff (context transfer) + workflow-feedback (issue tracking). 24 skills + 15 agents, one install.",
3
+ "version": "0.44.0",
4
+ "description": "Unified workflow plugin: team-flow (spec-driven dev: TDD/SDD/code-review/debugging) + compound-engineering core subset (brainstorm/plan/compound/strategy/ideate/proof, global compounding) + architecture-design (4A+DDD incremental design & global compounding) + prototype (local HTML prototype, zero external deps) + e2e (Playwright E2E, AC-driven) + workflow-orchestrator (product-level workflow orchestration) + workflow-bootstrap (existing project onboarding) + session-handoff (context transfer) + workflow-feedback (issue tracking) + business-analysis (independent requirement/scenario artifact). 25 skills + 16 agents, one install.",
5
5
  "author": {
6
6
  "name": "LT"
7
7
  },
@@ -26,6 +26,7 @@ export async function run(args) {
26
26
  options: {
27
27
  merge: { type: 'boolean', default: false },
28
28
  clean: { type: 'boolean', default: false },
29
+ force: { type: 'boolean', default: false }, // v0.43.1:跳过 dirty 阻断
29
30
  'project-root': { type: 'string' },
30
31
  json: { type: 'boolean', default: false },
31
32
  help: { type: 'boolean', default: false },
@@ -69,6 +70,12 @@ export async function run(args) {
69
70
  } else {
70
71
  printReport(results, values);
71
72
  }
73
+
74
+ // v0.43.1:merge 失败(冲突 / dirty 阻断)→ exit 非零,调用方(release-archivist)可检测。
75
+ // nothing-to-merge(success + skipped)不算失败。
76
+ if (results.some(r => r.merge && r.merge.success === false)) {
77
+ process.exitCode = 1;
78
+ }
72
79
  }
73
80
 
74
81
 
@@ -163,9 +170,9 @@ function processRepo(repo, values) {
163
170
  result.dirty = '?';
164
171
  }
165
172
 
166
- // 操作
173
+ // 操作(v0.43.1:合并前防护——dirty 阻断 / ahead==0 短路,设计增强方案 v0.18 §74)
167
174
  if (values.merge) {
168
- result.merge = mergeBranch(repo, branch, masterBranch);
175
+ result.merge = doMerge(repo, branch, masterBranch, result, values);
169
176
  }
170
177
  if (values.clean) {
171
178
  result.clean = cleanWorktree(repo, branch);
@@ -194,6 +201,28 @@ function detectMasterBranch(repoPath) {
194
201
  return 'master';
195
202
  }
196
203
 
204
+ // v0.43.1:合并前防护(设计增强方案 v0.18 §74)
205
+ // 1. dirty 阻断:worktree 有未提交改动时默认不合并(避免改动混入 master),--force 跳过
206
+ // 2. ahead==0 短路:分支相对目标分支无新 commit 时跳过合并(幂等,可安全重复调用)
207
+ // 3. 冲突报告:merge 失败时解析 unmerged 文件列表,引导人工解决而非静默失败
208
+ function doMerge(repo, branch, masterBranch, state, values) {
209
+ if (state.dirty === true && !values.force) {
210
+ return {
211
+ success: false,
212
+ skipped: 'dirty',
213
+ message: `Worktree has uncommitted changes — commit or stash them before merging, or use --force`,
214
+ };
215
+ }
216
+ if (typeof state.ahead === 'number' && state.ahead === 0) {
217
+ return {
218
+ success: true,
219
+ skipped: 'nothing-to-merge',
220
+ message: `Branch '${branch}' is up to date with '${masterBranch}' — nothing to merge`,
221
+ };
222
+ }
223
+ return mergeBranch(repo, branch, masterBranch);
224
+ }
225
+
197
226
  function mergeBranch(repo, branch, masterBranch) {
198
227
  try {
199
228
  const output = execFileSync('git', ['merge', branch, '--no-edit'], {
@@ -201,7 +230,30 @@ function mergeBranch(repo, branch, masterBranch) {
201
230
  });
202
231
  return { success: true, message: output.trim() };
203
232
  } catch (e) {
204
- return { success: false, message: (e.stderr || e.stdout || e.message || '').toString().trim() };
233
+ const raw = (e.stderr || e.stdout || e.message || '').toString().trim();
234
+ const conflicts = collectConflicts(repo.repoPath);
235
+ return {
236
+ success: false,
237
+ conflicts,
238
+ message: conflicts.length > 0
239
+ ? `Merge conflict in ${conflicts.length} file(s): ${conflicts.join(', ')}. Resolve manually, then 'git add' + 'git commit' to complete the merge.`
240
+ : raw,
241
+ };
242
+ }
243
+ }
244
+
245
+ // v0.43.1:解析 merge 冲突的 unmerged 文件列表(git status --porcelain 的 UU/AA/DD/AU/UA/DU/UD)
246
+ function collectConflicts(repoPath) {
247
+ try {
248
+ const status = execFileSync('git', ['status', '--porcelain'], {
249
+ encoding: 'utf-8', cwd: repoPath, stdio: ['ignore', 'pipe', 'pipe'],
250
+ });
251
+ return status
252
+ .split('\n')
253
+ .filter(line => /^(UU|AA|DD|AU|UA|DU|UD)/.test(line.trim()))
254
+ .map(line => line.trim().replace(/^(UU|AA|DD|AU|UA|DU|UD)\s+/, ''));
255
+ } catch {
256
+ return [];
205
257
  }
206
258
  }
207
259
 
@@ -260,7 +312,18 @@ function printReport(results, values) {
260
312
  console.log(` Uncommitted changes: ${r.dirty === true ? '⚠️ YES' : r.dirty === false ? 'no' : 'unknown'}`);
261
313
 
262
314
  if (r.merge) {
263
- console.log(` Merge: ${r.merge.success ? '✅ ' + r.merge.message : ' ' + r.merge.message}`);
315
+ if (r.merge.skipped === 'nothing-to-merge') {
316
+ console.log(` Merge: ⏭️ ${r.merge.message}`);
317
+ } else if (r.merge.skipped === 'dirty') {
318
+ console.log(` Merge: ⛔ ${r.merge.message}`);
319
+ } else if (r.merge.success) {
320
+ console.log(` Merge: ✅ ${r.merge.message}`);
321
+ } else {
322
+ console.log(` Merge: ❌ ${r.merge.message}`);
323
+ if (r.merge.conflicts && r.merge.conflicts.length > 0) {
324
+ console.log(` Conflicts: ${r.merge.conflicts.length} file(s)`);
325
+ }
326
+ }
264
327
  }
265
328
  if (r.clean) {
266
329
  console.log(` Worktree removed: ${r.clean.worktreeRemoved ? '✅' : '❌'}`);
@@ -282,6 +345,7 @@ function printHelp() {
282
345
  console.log(`Usage:
283
346
  tf deisolate <change-dir> # dry-run: show worktree status
284
347
  tf deisolate <change-dir> --merge # merge worktree branch back to master
348
+ tf deisolate <change-dir> --merge --force # merge even with uncommitted changes
285
349
  tf deisolate <change-dir> --merge --clean # merge + remove worktree + delete branch
286
350
  tf deisolate <change-dir> --clean # remove worktree only (no merge)
287
351
  tf deisolate <change-dir> --json # JSON output`);
@@ -101,7 +101,7 @@ Commands:
101
101
  Upgrade inline/batch to SDD, or replan existing SDD waves, as a new revision
102
102
  execution review <change-dir> --wave <id> --base <sha> --head <sha> --report <path> --verdict pass|fail
103
103
  Record one review receipt for a planned wave
104
- deisolate <change-dir> [--merge] [--clean] [--json]
104
+ deisolate <change-dir> [--merge] [--force] [--clean] [--json]
105
105
  Show worktree status / merge branch back / clean worktree
106
106
  runtime check-update Run a portable update check for canonical skills
107
107
  runtime infer <dir> Infer workflow mode without a plugin-root path
@@ -66,7 +66,7 @@ description: 基于 4A 企业架构 + DDD 领域驱动设计的架构/API/DB 设
66
66
  ### 输入
67
67
 
68
68
  - `change-brief.md`(scope / AC / 技术方向)
69
- - `prd/vN/plan.md` 高阶技术设计段(模块边界/技术选型/数据流/关键聚合划分)
69
+ - `requirement/vN/plan.md` 高阶技术设计段(模块边界/技术选型/数据流/关键聚合划分)
70
70
  - `docs/architecture/iterations/vN/architecture.md`(产品级架构快照,**主输入**,v0.35.0)——BC 边界/聚合所有权/全局契约的唯一事实源
71
71
  - 全局 `docs/architecture/`(As-Is 实际态基线,已落地部分)
72
72
  - 现有 `specs/`(若有)
@@ -156,7 +156,7 @@ changes/<name>/
156
156
  - **不**重复 Swagger 管理的内容:请求/响应 schema、错误码定义、参数明细等由 Swagger/OpenAPI 规范承载
157
157
  - frontmatter 须声明 `api_contract_manager: swagger`,表明详细契约由 Swagger 工具链管理
158
158
  - sql/ 目录中的 DDL 和 migration 脚本为独立可执行 `.sql` 文件,不嵌入 markdown 文档
159
- - **PRD 功能清单 → API 端点映射表(v0.29.0 §37 新增)**:在 api.md 中增加独立章节,逐条对照 `prd/vN/prd.md` 功能清单(如 F001_P0_P1 ~ P0_PN),映射每个功能点到对应的 API 端点。对于涉及子实体(明细/子项)的功能,必须确保独立 CRUD 端点存在——仅查询端点不覆盖"新增/编辑"功能。此映射表供 architecture-reviewer A4 交叉验证使用
159
+ - **PRD 功能清单 → API 端点映射表(v0.29.0 §37 新增)**:在 api.md 中增加独立章节,逐条对照 `requirement/vN/prd.md` 功能清单(如 F001_P0_P1 ~ P0_PN),映射每个功能点到对应的 API 端点。对于涉及子实体(明细/子项)的功能,必须确保独立 CRUD 端点存在——仅查询端点不覆盖"新增/编辑"功能。此映射表供 architecture-reviewer A4 交叉验证使用
160
160
 
161
161
  **下游消费**:
162
162
  - `architecture/architecture.md` → spec-writer:design.md Decisions 约束
@@ -6,8 +6,8 @@
6
6
 
7
7
  ## 输入
8
8
 
9
- - prd/vN/prd.md(frozen_downstream,功能清单 F001_P0 等)
10
- - prd/vN/plan.md(高阶技术设计段:模块边界/技术选型/数据流/关键聚合划分)
9
+ - requirement/vN/prd.md(frozen_downstream,功能清单 F001_P0 等)
10
+ - requirement/vN/plan.md(高阶技术设计段:模块边界/技术选型/数据流/关键聚合划分)
11
11
  - prototype/(S2 产物,页面结构)
12
12
  - docs/architecture/baseline.md(S1 注入)
13
13
  - docs/architecture/CONCEPTS.md(领域词汇)
@@ -87,7 +87,7 @@ ARCH 完成(评审 PASS 或 skip 已物化)后,**阻塞确认**(AskUserQ
87
87
  - 产品级评审门 verdict = PASS(或 skip 已物化)
88
88
  - orchestrator.yaml 中 ARCH 阶段状态 = completed(workflow_phase: architecture)
89
89
  - **未触发** arch-merge 全局覆盖写(预测态不进实际态,P1)
90
- - **架构基线打戳(v0.36.3)**:首轮项目(`arch_baseline` 缺失)评审 PASS 后执行 `tf arch init --mode reconstruction --baseline-ref prd/vN/`(旧项目逆向重建)或 `--mode design`(全新项目正向设计)——arch-readiness/arch-snapshot 门禁的豁免键在此建立,项目进入「已建档」正轨
90
+ - **架构基线打戳(v0.36.3)**:首轮项目(`arch_baseline` 缺失)评审 PASS 后执行 `tf arch init --mode reconstruction --baseline-ref requirement/vN/`(旧项目逆向重建)或 `--mode design`(全新项目正向设计)——arch-readiness/arch-snapshot 门禁的豁免键在此建立,项目进入「已建档」正轨
91
91
 
92
92
  ## 常见陷阱
93
93
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  upstream_source: orchestrator | manual | null
3
3
  upstream_req_id: <req-id>
4
- upstream_plan_ref: prd/vN/plan.md
4
+ upstream_plan_ref: requirement/vN/plan.md
5
5
  upstream_change_id: C2
6
6
  plan_hash: sha256:<plan.md 内容摘要>
7
7
  ---
@@ -25,5 +25,5 @@ plan_hash: sha256:<plan.md 内容摘要>
25
25
 
26
26
  ## PRD & plan 引用
27
27
 
28
- - PRD: prd/vN/prd.md §<相关章节>
29
- - Plan: prd/vN/plan.md ### <C-ID>
28
+ - PRD: requirement/vN/prd.md §<相关章节>
29
+ - Plan: requirement/vN/plan.md ### <C-ID>
@@ -46,7 +46,7 @@ Branch/worktree preflight before ANY implementation edit (mandatory — do not s
46
46
  ### UI Contract Prototype Location (v0.37.0 §68.5)
47
47
 
48
48
  When implementing UI tasks, the UI contract source is the **prototype version worktree**, not the change worktree's prototype copy:
49
- - **定位**:读 `change-brief.md` 的 `upstream_plan_ref: prd/vN/plan.md`(或 change 目录名 `v{N}-` 前缀)→ PRD 版本 vN → 原型 worktree = `<workspace>/.worktrees/prd-vN/prototype/`
49
+ - **定位**:读 `change-brief.md` 的 `upstream_plan_ref: requirement/vN/plan.md`(或 change 目录名 `v{N}-` 前缀)→ PRD 版本 vN → 原型 worktree = `<workspace>/.worktrees/prd-vN/prototype/`
50
50
  - **回退**:该 worktree 不存在时用 `<workspace>/prototype/`,并提示 `tf prototype branch <prd-vN>` 创建
51
51
  - **引用**:execution-contract / design.md 中引用的原型页面(`prototype/pages/<page>.html` 等)以此为基准定位;**禁止**引用主干上其他版本的旧原型
52
52
 
@@ -111,6 +111,14 @@ For full/hotfix by default. Execute waves as dispatched by workflow-start.
111
111
 
112
112
  **v0.39.0 主动串行编排**:build-executor 不再负责安排 code-reviewer。workflow-start 会主动串行编排:每个 wave 完成后,workflow-start 会 dispatch code-reviewer 审查。build-executor 只需执行当前 wave,完成后通知 workflow-start。
113
113
 
114
+ ### Test Infrastructure Check (v0.43.1, before first wave)
115
+
116
+ 开始实施前检测项目测试基础设施,避免测试静默跳过(设计增强方案 v0.18 §76,来源:workflow-feedback 2026-08-06——surefire 2.22.2 不支持 JUnit 5 `@Nested`,64% 测试从未执行但报告 "91 tests pass"):
117
+
118
+ 1. **Java 项目**:读 `pom.xml` 的 maven-surefire-plugin 版本 + JUnit 版本。
119
+ 2. **兼容性判断**:surefire < 2.22.2 且测试计划含 JUnit 5 `@Nested` → 警告"@Nested 自动发现不兼容,建议 flatten 测试类或升级 surefire"。
120
+ 3. **沉淀 conventions**:检测结果写入 `.team-flow/conventions/`(项目级测试基础设施约束,v0.11 §33 机制),供后续 change 复用。写入方式沿用下方「阶段转换前规范建议」协议——YAML frontmatter(name/description/date)+ 正文约束,用户确认后追加,更新 date 字段。
121
+
114
122
  ### Planned-Wave Loop
115
123
  1. Read the current plan with `tf execution show <change-dir> --json`; only waves shown with `current: true` and `eligible: true` may start. A `retryable: true` wave may only be repaired and re-reviewed; do not dispatch its dependents until its replacement receipt is `pass`. The CLI encodes dependencies in `--wave <id>:<strategy>:<tasks>[:<depends-on,...>]` and rejects a review receipt for a wave whose prerequisites lack current `pass` receipts.
116
124
  2. A `parallel` wave may dispatch independent tasks simultaneously only when the platform supports concurrent dispatch. If it does not, disclose the unavailable capability and execute the same wave one task at a time without changing its stored strategy.
@@ -124,12 +132,24 @@ For full/hotfix by default. Execute waves as dispatched by workflow-start.
124
132
  5. **Do not** attempt to dispatch code-reviewer or write review receipts — that is workflow-start's responsibility.
125
133
  6. Critical/Important findings require a `fail` receipt, a focused repair, re-review, then a replacement `pass` receipt. Never advance or close with a missing or failed receipt.
126
134
 
135
+ ### Wave Verify: Actual Test Count (v0.43.1)
136
+
137
+ 每个 wave 完成、通知 workflow-start 审查前,验证测试**实际执行**的数量(设计增强方案 v0.18 §76,来源:workflow-feedback 2026-08-06——64% 测试静默跳过但报告全绿):
138
+
139
+ 1. 运行测试套件后,用 `tf test record <change-dir> --from <runner-output-file>` 解析**实际执行数量**(`Tests run: N`)。
140
+ 2. 对照 test-matrix 当前 wave 覆盖的用例数(**分母排除 `test_tier=e2e`**——E2E case 由 Playwright 执行,不进入 `mvn test`/`npm test` 的 `Tests run: N`,口径与 code-reviewer Step 5b / release-archivist Step 2b 一致):实际执行数明显低于预期(< 70%)→ **警告 + 调查**(@Nested 静默跳过、测试未被发现、编译期跳过等),未查明前不得报告 "N tests pass"。
141
+ 3. 报告引用实际执行数(`Tests run: N`),而非 BUILD SUCCESS 或编译通过数量。
142
+
127
143
  ### Per-Task Loop
128
144
  1. **Dispatch implementer**: Load the template with `tf runtime asset read skills/build-executor/implementer-prompt.md`. Extract task brief with `scripts/task-brief PLAN_FILE N`. Include: where task fits, brief path, interfaces from prior tasks, report file path.
129
145
  2. **Handle response**: DONE → generate review package + dispatch reviewer. DONE_WITH_CONCERNS → assess. NEEDS_CONTEXT → provide context. BLOCKED → re-dispatch with better model or escalate.
130
- 3. **Review**: Load `tf runtime asset read skills/build-executor/task-reviewer-prompt.md`. Reviewer returns spec compliance + code quality verdicts with the wave ID, git range, report path, and `pass`/`fail` receipt command.
131
- 4. **Fix**: If Critical or Important issues, write the `fail` receipt, dispatch fix subagent, re-review, and write the replacement `pass` receipt.
132
- 5. **Mark complete**: Append to `.superpowers/sdd/progress.md`: `Task N: complete (commits <base7>..<head7>, review clean)`
146
+ 3. **Verify task output(v0.43.1)**:任务标记完成前验证产物——**前置到审查前**(源头校验:文件存在性是审查的前提,让 reviewer 专注质量而非兜底)。设计增强方案 v0.18 §75,来源:workflow-feedback 2026-08-06——Task 标记 [x] 但文件未创建):
147
+ - Create 任务:目标文件必须存在且非空(`test -s <path>`)
148
+ - Modify 任务:目标文件必须有变更(相对 wave base `git diff --name-only` 包含该文件)
149
+ - 验证失败 → 不标记完成,先补创建/修改——"标记完成"与"文件存在"绑定,杜绝任务状态失真
150
+ 4. **Review**(task 级轻量审查;wave 级 code-reviewer 由 workflow-start 主动编排,v0.39.0): Load `tf runtime asset read skills/build-executor/task-reviewer-prompt.md`. Reviewer returns spec compliance + code quality verdicts with the wave ID, git range, report path, and `pass`/`fail` receipt command.
151
+ 5. **Fix**: If Critical or Important issues, write the `fail` receipt, dispatch fix subagent, re-review, and write the replacement `pass` receipt.
152
+ 6. **Mark complete**: Append to `.superpowers/sdd/progress.md`: `Task N: complete (commits <base7>..<head7>, review clean)`
133
153
 
134
154
  ### Model Selection
135
155
  Use the configured profile that matches the task role. Resolve it before dispatch:
@@ -140,6 +140,7 @@ Subagent (general-purpose):
140
140
  - Did I follow TDD if required?
141
141
  - Are tests comprehensive?
142
142
  - Is the test output pristine (no stray warnings or noise)?
143
+ - Tests actually EXECUTED (`Tests run: N`), not just compiled — surefire/@Nested version mismatches can silently skip tests (v0.43.1)
143
144
  - If test-matrix.md exists: matrix coverage = passed cases / total cases for my module
144
145
  - Each case's `design_method` matches the actual test approach (boundary case uses real boundary values, not happy-path disguised as boundary)
145
146
 
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: business-analysis
3
+ description: "独立业务分析 skill:将任意用户输入整理为结构化 requirement/vN/business-analysis.md,产出 Requirements List 与 Scenario List,支持多轮单问澄清、待办记录、新增/更新模式,写入前必须阻塞用户确认。不写入 ledger.md,不替代 workflow-orchestrator/ce-brainstorm。"
4
+ argument-hint: "[需求/会议/文档描述] [vN 可选]"
5
+ ---
6
+
7
+ # Business Analysis
8
+
9
+ 把任意输入(一句话、文档、会议纪要)整理成 `requirement/vN/business-analysis.md`,只含需求列表与业务场景列表两大板块。
10
+
11
+ ## Primary Goal
12
+
13
+ - 提取并结构化需求(REQ-xxx)与业务场景(SC-xxx)
14
+ - 通过多轮单问澄清补全缺失维度
15
+ - 用户无法回答的问题记录为 TODO
16
+ - 最终经用户阻塞确认后落盘
17
+
18
+ ## Inputs
19
+
20
+ | 参数 | 说明 |
21
+ |---|---|
22
+ | `user_input` | 用户原始输入 |
23
+ | `version` | 目标版本,如 `v1`;未提供时自动解析 |
24
+
25
+ ## Mode
26
+
27
+ - **Create**:`requirement/vN/business-analysis.md` 不存在时新建
28
+ - **Update**:已存在时读取现有条目,追加或修订
29
+
30
+ ## Process
31
+
32
+ ### 1. Resolve Version
33
+
34
+ 按 `references/version-resolution.md` 解析目标 `vN`,判断 Create / Update 模式。若文件已存在,询问用户「继续完善 / 新建版本 / 覆盖」。
35
+
36
+ ### 2. First-Pass Extraction
37
+
38
+ 从 `user_input` 中提取候选 REQ 与 SC,识别缺失维度。先以 🔵 pending 状态写入内部草案。
39
+
40
+ ### 3. One Question at a Time
41
+
42
+ 每次只问 1 个问题,优先选择题,其次开放题。问题应针对当前最大缺失:角色、目标、触发条件、前置条件、约束、可测试验收标准。
43
+
44
+ ### 4. TODO Handling
45
+
46
+ 用户答不上来时,立即在 `## Open Questions / TODOs` 段落记录 `TODO-xxx`,状态 `pending`。相关 REQ/SC 保持 🔵 pending。
47
+
48
+ ### 5. QA Check
49
+
50
+ 每轮更新后运行 `references/qa-checklist.md` 的 5 项 Error 检查。未通过则继续提问,最多 3 轮自修正。
51
+
52
+ ### 6. Final Confirmation
53
+
54
+ 展示完整文档预览,用户选择:
55
+ - **Confirm**:写入文件,所有 🔵 翻转为 ✅ confirmed
56
+ - **Adjust**:返回对话循环
57
+ - **Abort**:保持 pending,不写入最终确认
58
+
59
+ ## Output Contract
60
+
61
+ 只写 `requirement/vN/business-analysis.md`。输出格式见 `references/output-schema.md`。
62
+
63
+ 严格禁止:
64
+ - 写入 `ledger.md`
65
+ - 写入 PRD、流程、架构等下游制品
66
+ - 修改 `.team-flow.yaml`
67
+
68
+ ## Anti-Patterns
69
+
70
+ - 一次问多个问题
71
+ - 使用泛化角色如 "user"
72
+ - Acceptance 写成不可测试的模糊描述
73
+ - 未确认直接落盘
74
+
75
+ ## References
76
+
77
+ - `references/output-schema.md` — 输出文档格式
78
+ - `references/qa-checklist.md` — QA 检查标准
79
+ - `references/interaction-rules.md` — 多轮交互与确认规则
80
+ - `references/version-resolution.md` — 版本解析规则
@@ -0,0 +1,86 @@
1
+ # 业务分析多轮交互规则
2
+
3
+ 本规则约束业务分析 skill 与用户的对话方式、待办处理、确认机制和断点恢复。
4
+
5
+ ## 核心交互原则
6
+
7
+ ### 一次只问一个问题
8
+
9
+ - 每轮只向用户提出 **1 个** 清晰问题
10
+ - 等待用户回答后再决定下一个问题
11
+ - 禁止一次抛出 2 个及以上问题
12
+
13
+ ### 优先选择题
14
+
15
+ - 当答案有限时,给出 2–3 个选项并推荐其一
16
+ - 选项后简述每个选项的 trade-off
17
+ - 用户可自由选择或给出新答案
18
+
19
+ ### 开放题仅用于真正开放的场景
20
+
21
+ - 以下情况使用开放题:
22
+ - 用户首次输入极短,需要补充背景
23
+ - 询问 Acceptance 的具体阈值
24
+ - 确认业务角色名称
25
+
26
+ ## 待办(TODO)处理规则
27
+
28
+ ### 何时记录 TODO
29
+
30
+ - 用户明确表示 "不知道"、"需要确认"、"后续补充"
31
+ - 问题虽然重要,但当前无法获得可靠答案
32
+ - 继续追问会影响对话收敛效率
33
+
34
+ ### 如何记录 TODO
35
+
36
+ 1. 在 `## Open Questions / TODOs` 段落新增一行:
37
+ - `TODO-xxx`
38
+ - 问题原文
39
+ - 记录日期
40
+ - 状态 `pending`
41
+ - 关联的 `REQ-xxx` / `SC-xxx`(如有)
42
+ 2. 将相关 REQ/SC 的状态保持为 🔵 pending
43
+ 3. 向用户复述已记录的 TODO,确认无误后继续
44
+
45
+ ### TODO 后续回填
46
+
47
+ - 用户补充答案后,将 TODO 状态改为 `answered`
48
+ - 把答案回填到对应 REQ/SC 的缺失维度
49
+ - 重新运行 QA 检查
50
+
51
+ ## 确认机制
52
+
53
+ ### 增量确认(默认)
54
+
55
+ - 每轮提取的结构化内容先以 🔵 pending 写入 `business-analysis.md`
56
+ - 最终确认时统一把所有 🔵 翻转为 ✅ confirmed
57
+ - 最终确认前展示完整文档预览,让用户选择 **Confirm / Adjust / Abort**
58
+
59
+ ### 最终确认内容
60
+
61
+ 确认前必须展示:
62
+ - 当前 Requirements List 完整表格
63
+ - 当前 Scenario List 完整表格
64
+ - Open Questions / TODOs 列表
65
+ - 本轮回新增/修改的摘要
66
+
67
+ ### 用户选择
68
+
69
+ - **Confirm**:写入文件,pending → confirmed
70
+ - **Adjust**:指出需要调整的条目,返回对话循环
71
+ - **Abort**:保持当前 pending 状态,不翻转 confirmed,向用户说明已保存的 pending 内容
72
+
73
+ ## 终止条件
74
+
75
+ 正常终止需满足:
76
+ - QA 所有 Error 检查通过,或
77
+ - 用户明确说 "生成文档" / "确认输出"
78
+
79
+ 安全兜底:
80
+ - 单轮对话最多 10 个问题;达到上限时强制进入最终确认
81
+
82
+ ## 断点恢复
83
+
84
+ - `business-analysis.md` 本身就是断点载体
85
+ - 恢复时先读取现有文件,把 ✅ confirmed 条目作为基线,🔵 pending 条目作为待确认内容
86
+ - 向用户展示当前进度并询问 "继续完善 / 新建版本 / 覆盖"
@@ -0,0 +1,88 @@
1
+ # business-analysis.md 输出格式
2
+
3
+ 本文件定义 `requirement/vN/business-analysis.md` 的精确格式。业务分析 skill 只能输出此格式,不得写入 `ledger.md`、PRD、流程或架构等下游制品。
4
+
5
+ ## 文件定位
6
+
7
+ - 路径:`requirement/vN/business-analysis.md`
8
+ - 作用:承接对话沉淀,为 PRD 提供需求与场景数据
9
+ - 不直接写入 `requirement/ledger.md`;版本归档由 orchestrator 统一处理
10
+
11
+ ## Frontmatter
12
+
13
+ ```yaml
14
+ ---
15
+ version: vN
16
+ status: draft | confirmed
17
+ last_updated: YYYY-MM-DD
18
+ source: business-analysis skill
19
+ ---
20
+ ```
21
+
22
+ ## 必须包含的两大板块
23
+
24
+ 1. **需求列表(Requirements List)**
25
+ 2. **业务场景列表(Scenario List)**
26
+
27
+ 可选追加板块:
28
+
29
+ 3. **Open Questions / TODOs** —— 仅用于记录用户暂时无法回答的问题
30
+
31
+ ## 需求列表格式
32
+
33
+ 每个需求一行,字段如下:
34
+
35
+ | 字段 | 要求 |
36
+ |------|------|
37
+ | ID | `REQ-xxx`,版本内顺序编号 |
38
+ | Description | 一句话意图,用 SHALL/MUST 表达 |
39
+ | Related Scenarios | `SC-xxx` 列表,逗号分隔 |
40
+ | Status | 🔵 pending / ✅ confirmed |
41
+ | Change History | `[vN.M YYYY-MM-DD create/modify 摘要]` |
42
+
43
+ ## 业务场景格式
44
+
45
+ 每个场景一行,字段如下:
46
+
47
+ | 字段 | 要求 |
48
+ |------|------|
49
+ | ID | `SC-xxx` |
50
+ | Role | 具体角色,禁止泛化 "user" |
51
+ | Goal | 角色目标 |
52
+ | Trigger | 触发事件/条件 |
53
+ | Precondition | 前置条件 |
54
+ | Constraint | 规则/限制/策略 |
55
+ | Acceptance | 可测试成功条件,必须含具体阈值/字段/结果 |
56
+ | Related Requirements | `REQ-xxx` 列表 |
57
+ | Status | 🔵 pending / ✅ confirmed |
58
+ | Change History | `[vN.M YYYY-MM-DD create/modify 摘要]` |
59
+
60
+ ## Open Questions / TODOs 格式
61
+
62
+ | 字段 | 要求 |
63
+ |------|------|
64
+ | ID | `TODO-xxx` |
65
+ | Question | 未能回答的问题原文 |
66
+ | Recorded At | YYYY-MM-DD |
67
+ | Status | pending / answered / dropped |
68
+ | Related REQ/SC | 可选 |
69
+
70
+ ## 状态管理
71
+
72
+ - 仅两种状态:🔵 pending、✅ confirmed
73
+ - 状态转换只能经由用户阻塞确认
74
+ - 确认前必须先通过 QA 检查
75
+
76
+ ## 与 PRD 的映射
77
+
78
+ | PRD 章节 | 来源内容 |
79
+ |---------|---------|
80
+ | §7 D7.5_系统功能清单 | 需求列表 + 场景关联(REQ / SC) |
81
+ | §8 D7.6_系统功能处理说明书 | 按场景分组的功能模块 |
82
+
83
+ ## 禁止事项
84
+
85
+ - 禁止在 `business-analysis.md` 中直接写入 `ledger.md`
86
+ - 禁止用泛化角色如 "user" 替代具体业务角色
87
+ - 禁止 Acceptance 写成不可测试的模糊描述
88
+ - 禁止写入业务流程详情(L1-L4、Mermaid、活动表等)
@@ -0,0 +1,31 @@
1
+ # 业务分析 QA 检查清单
2
+
3
+ 业务分析 skill 在最终确认前必须执行以下 QA 检查。所有 Error 级别项必须全部通过,否则不得将条目标记为 ✅ confirmed。
4
+
5
+ ## Error 级别检查
6
+
7
+ - [ ] **C1 角色覆盖**:用户输入中提到的所有具体角色都有对应的场景(SC-xxx)覆盖
8
+ - [ ] **C2 六维度齐全**:每个场景都填满 Role / Goal / Trigger / Precondition / Constraint / Acceptance
9
+ - [ ] **C3 REQ 引用存在**:场景中引用的 `REQ-xxx` 必须出现在需求列表中
10
+ - [ ] **C4 对话证据可追溯**:每个场景都能在对话记录或输入中找到证据,禁止编造
11
+ - [ ] **C5 Acceptance 可测试**:验收标准必须具体、可验证,含明确阈值/字段/结果
12
+
13
+ ## Warning 级别检查
14
+
15
+ - [ ] **W1 角色具体化**:不存在 "user"、"管理员" 等泛化角色,除非已明确定义为业务角色
16
+ - [ ] **W2 需求表述**:需求描述使用 SHALL/MUST,避免 "should"、"可以" 等弱约束
17
+ - [ ] **W3 变更历史**:新增或修改的条目都含变更历史
18
+
19
+ ## QA 不通过时的处理
20
+
21
+ 1. 定位导致失败的条目和维度
22
+ 2. 向用户提出**一个**针对性的澄清问题
23
+ 3. 根据回答更新文档
24
+ 4. 重新运行 QA 检查
25
+ 5. 最多允许 3 轮内部自修正;仍无法通过则记录 TODO 并保持 pending
26
+
27
+ ## 待办(TODO)的 QA 规则
28
+
29
+ - TODO 问题可以暂时不阻塞其他已确认条目的确认
30
+ - 与 TODO 相关的 REQ/SC 必须保持 🔵 pending 状态
31
+ - 用户后续补充答案后,应更新 TODO 状态为 answered 并回填到对应条目
@@ -0,0 +1,41 @@
1
+ # 业务分析版本解析规则
2
+
3
+ 本规则定义业务分析 skill 如何确定目标版本 `vN`。
4
+
5
+ ## 解析顺序
6
+
7
+ 按以下优先级依次解析:
8
+
9
+ 1. **显式参数**:用户在调用 skill 时传入的版本,如 `business-analysis v2`
10
+ 2. **运行时配置**:`tf runtime config --get active.requirement`(若返回有效值)
11
+ 3. **目录扫描**:读取 `requirement/` 下已有的 `vN` 目录,取最大 N
12
+ 4. **默认回退**:以上皆无时使用 `v1`
13
+
14
+ ## 目录扫描规则
15
+
16
+ - 只识别 `requirement/vN/` 形式目录,其中 N 为正整数
17
+ - 忽略非版本目录(如 `archived/`、`draft/`)
18
+ - 若存在 `v1`、`v2`、`v3`,则取 `v3`
19
+
20
+ ## 模式判断
21
+
22
+ 解析出版本后,判断当前是 Create 还是 Update 模式:
23
+
24
+ | 条件 | 模式 | 行为 |
25
+ |---|---|---|
26
+ | `requirement/vN/business-analysis.md` 不存在 | Create | 新建文件 |
27
+ | 文件已存在 | Update | 读取现有条目,追加或修订 |
28
+
29
+ ## 已存在文件的处理
30
+
31
+ 检测到文件已存在时,必须向用户询问以下三者之一:
32
+
33
+ - **继续完善**:在当前版本基础上追加/修改条目
34
+ - **新建版本**:创建 `v(N+1)/business-analysis.md`,旧版本保持 archived
35
+ - **覆盖**:清空当前版本重新生成(不推荐,需用户明确确认)
36
+
37
+ ## 版本号输出
38
+
39
+ - 最终输出的 `business-analysis.md` frontmatter 中必须包含 `version: vN`
40
+ - Change History 中的版本号采用 `vN.M` 形式,其中 M 为本次编辑的次要版本(同一 vN 内递增)
41
+ - 首次创建使用 `vN.1`,后续补充依次递增