@xulthekl/team-flow 0.23.0 → 0.24.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 (54) hide show
  1. package/.claude/always/phase-guard.md +1 -1
  2. package/.claude-plugin/marketplace.json +1 -1
  3. package/.claude-plugin/plugin.json +1 -1
  4. package/.codex-plugin/plugin.json +1 -1
  5. package/.cursor-plugin/marketplace.json +1 -1
  6. package/.cursor-plugin/plugin.json +1 -1
  7. package/.github/plugin/marketplace.json +2 -2
  8. package/CHANGELOG.md +50 -0
  9. package/GEMINI.md +1 -1
  10. package/INSTALL.md +1 -1
  11. package/README.md +1 -1
  12. package/docs/README_en.md +1 -1
  13. package/docs/solutions/INDEX.md +5 -0
  14. package/docs/solutions/cross-phase/2026-07-28-no-summary.md +17 -0
  15. package/gemini-extension.json +1 -1
  16. package/hooks/pre-tool-use-guard +9 -9
  17. package/hooks/session-start +2 -2
  18. package/llms.txt +1 -1
  19. package/package.json +1 -1
  20. package/plugin.json +1 -1
  21. package/scripts/guard/checks/compound-captured.mjs +70 -0
  22. package/scripts/guard/guard.mjs +3 -1
  23. package/scripts/lib/cmd-state.mjs +2 -0
  24. package/scripts/lib/solutions-promote.mjs +1 -1
  25. package/scripts/lib/state-loader.mjs +5 -0
  26. package/skills/bug-investigator/SKILL.md +1 -1
  27. package/skills/build-executor/SKILL.md +19 -19
  28. package/skills/build-executor/implementer-prompt.md +1 -1
  29. package/skills/build-executor/references/execution-modes.md +6 -6
  30. package/skills/build-executor/task-reviewer-prompt.md +1 -1
  31. package/skills/code-reviewer/SKILL.md +2 -2
  32. package/skills/code-reviewer/code-reviewer-prompt.md +1 -1
  33. package/skills/contract-builder/SKILL.md +6 -6
  34. package/skills/need-explorer/SKILL.md +2 -2
  35. package/skills/release-archivist/SKILL.md +12 -12
  36. package/skills/release-archivist/references/closing-procedures.md +8 -8
  37. package/skills/spec-merger/SKILL.md +2 -2
  38. package/skills/spec-writer/SKILL.md +3 -3
  39. package/skills/workflow-bootstrap/SKILL.md +13 -2
  40. package/skills/workflow-bootstrap/references/b1-reconnaissance.md +13 -7
  41. package/skills/workflow-bootstrap/scripts/recon-probe.sh +122 -1
  42. package/skills/workflow-orchestrator/references/s2-prd-prototype-loop.md +1 -1
  43. package/skills/workflow-orchestrator/references/s4-split-validate.md +1 -1
  44. package/skills/workflow-orchestrator/references/s5-monitoring.md +1 -1
  45. package/skills/workflow-start/SKILL.md +16 -16
  46. package/skills/workflow-start/references/routing-rules.md +17 -17
  47. package/tests/lib/guard-compound-captured.test.mjs +92 -0
  48. package/tests/lib/guard-specs-merged.test.mjs +2 -0
  49. package/tests/lib/guard-tests-passing.test.mjs +2 -0
  50. package/tests/lib/guard.test.mjs +2 -0
  51. package/tests/lib/solutions-capture.test.mjs +108 -0
  52. package/tests/lib/solutions-index-gen.test.mjs +147 -0
  53. package/tests/lib/solutions-inject.test.mjs +115 -0
  54. package/tests/lib/solutions-promote.test.mjs +200 -0
@@ -1,3 +1,3 @@
1
- # team-flow v0.23.0 | 阶段: {{state}} | 工作流: {{workflow}}
1
+ # team-flow v0.24.0 | 阶段: {{state}} | 工作流: {{workflow}}
2
2
  当前阶段允许的操作由 workflow-start 路由规则定义。
3
3
  禁止跨越 DP gate 进入下一阶段。变更范围以 execution-contract.md 的 Intent Lock 为准。
@@ -9,7 +9,7 @@
9
9
  {
10
10
  "name": "team-flow",
11
11
  "description": "8-state spec workflow + compound global compounding + architecture-design (4A/DDD) + local HTML prototype + product-level orchestration + bootstrap + e2e + session handoff + workflow feedback. 23 skills + 8 agents with embedded TDD, SDD, code review, debugging, delta spec sync, and design-system-driven prototyping.",
12
- "version": "0.23.0",
12
+ "version": "0.24.0",
13
13
  "source": "./",
14
14
  "author": {
15
15
  "name": "LT",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "team-flow",
3
- "version": "0.23.0",
3
+ "version": "0.24.0",
4
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). 23 skills + 8 agents, one install.",
5
5
  "source": "./",
6
6
  "author": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "team-flow",
3
- "version": "0.23.0",
3
+ "version": "0.24.0",
4
4
  "description": "Spec-first workflow that bridges OpenSpec-style planning and Superpowers-style execution discipline.",
5
5
  "author": {
6
6
  "name": "MageByte",
@@ -5,7 +5,7 @@
5
5
  },
6
6
  "metadata": {
7
7
  "description": "Unified workflow plugin marketplace for Cursor (team-flow: team-flow + compound + architecture-design + prototype).",
8
- "version": "0.23.0"
8
+ "version": "0.24.0"
9
9
  },
10
10
  "plugins": [
11
11
  {
@@ -2,7 +2,7 @@
2
2
  "name": "team-flow",
3
3
  "displayName": "team-flow",
4
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). 23 skills + 8 agents, one install.",
5
- "version": "0.23.0",
5
+ "version": "0.24.0",
6
6
  "author": {
7
7
  "name": "LT",
8
8
  "url": "https://github.com/LT"
@@ -6,13 +6,13 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "Unified workflow plugins and skills for AI coding agents (team-flow: team-flow + compound + architecture-design + prototype).",
9
- "version": "0.23.0"
9
+ "version": "0.24.0"
10
10
  },
11
11
  "plugins": [
12
12
  {
13
13
  "name": "team-flow",
14
14
  "description": "Unified workflow with planning artifacts, execution contracts, TDD, review gates, systematic debugging, delta spec sync, architecture-design, and local HTML prototyping.",
15
- "version": "0.23.0",
15
+ "version": "0.24.0",
16
16
  "source": ".",
17
17
  "author": {
18
18
  "name": "LT",
package/CHANGELOG.md CHANGED
@@ -6,6 +6,56 @@ The format loosely follows Keep a Changelog.
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.24.0] - 2026-07-28
10
+
11
+ ### Fixed(复利工程强制化补强,5 项)
12
+
13
+ #### P0: Hook 旧名修复
14
+ - **hooks/pre-tool-use-guard**: 修复 `.spec-superflow.yaml` → `.team-flow.yaml` 的硬编码旧名(5 处),恢复状态机编辑守卫
15
+ - **hooks/session-start**: 修复 `spec-superflow` → `team-flow` 的硬编码旧名(3 处),恢复会话启动提示
16
+
17
+ #### P1: 复利维度 guard
18
+ - **guard/checks/compound-captured.mjs**: 新增复利捕获检查维度(learnings.md 存在性或显式 compound_skipped)
19
+ - **guard/guard.mjs**: 将 `compound-captured` 维度挂到 `executing:closing` 转换(full 和 hotfix workflow)
20
+ - **state-loader.mjs**: BUILTIN_DEFAULTS 新增 `compound_skipped` 字段
21
+ - **cmd-state.mjs**: SETTABLE_FIELDS 新增 `compound_skipped` 字段,支持 `tf state set` 写入
22
+
23
+ #### P1: Bootstrap DDL 提取
24
+ - **workflow-bootstrap/scripts/recon-probe.sh**: 新增 DDL 提取能力(策略优先级:SQL 文件 > Java Entity 注解 > 占位兜底)
25
+ - 策略 1: 扫描 `db/migration/` 等目录的 `.sql` 文件,提取 CREATE TABLE 语句
26
+ - 策略 2: 扫描 `@Entity`/`@Table` 注解的 Java 类,提取表名和字段定义
27
+ - 策略 3: 无 DDL 源时生成占位文件,提示手动补充
28
+ - 新增 `--ddl-out` 参数,支持独立输出 DDL 文件
29
+ - JSON 输出新增 `ddl_extraction` 字段(source/table_count/tables/ddl_statements)
30
+
31
+ #### P1: Bootstrap 模板引用
32
+ - **workflow-bootstrap/SKILL.md**: B2 阶段新增 Step 0(模板初始化),从 `architecture-design/templates/` 复制 5 个模板到 `docs/architecture/`
33
+ - **workflow-bootstrap/references/b1-reconnaissance.md**: 更新 B1.1a 章节,标注 DDL 提取已实现(v0.24.0),补充 CLI 用法和 JSON 输出字段说明
34
+
35
+ #### P2: solutions 脚本测试
36
+ - **tests/lib/solutions-capture.test.mjs**: 新增 6 个测试用例(文件创建、INDEX 追加、中文 slugify、默认 phase、无效 phase 拒绝)
37
+ - **tests/lib/solutions-inject.test.mjs**: 新增 8 个测试用例(空索引、phase 过滤、cross-phase 包含、domain 匹配、severity 排序、top-5 截断)
38
+ - **tests/lib/solutions-promote.test.mjs**: 新增 8 个测试用例(无 learnings、高/中/低 severity 晋升、insight 类型跳过、重复检测、多条晋升、INDEX 追加)
39
+ - **tests/lib/solutions-index-gen.test.mjs**: 新增 7 个测试用例(全量重建、severity 排序、date 排序、7 phase 扫描、非 .md 跳过、150 条截断、空目录处理)
40
+ - **scripts/lib/solutions-promote.mjs**: CLI 守卫增加 `NODE_ENV !== 'test'` 条件,避免 import 时触发 process.exit
41
+
42
+ #### 测试修复
43
+ - **tests/lib/guard.test.mjs**: `recordPassingClosingPrerequisites()` 新增 learnings.md 创建,满足 compound-captured 维度
44
+ - **tests/lib/guard-specs-merged.test.mjs**: `makeChangeDir()` 新增 learnings.md 创建
45
+ - **tests/lib/guard-tests-passing.test.mjs**: `makeChangeDir()` 新增 learnings.md 创建
46
+
47
+ ### Verified
48
+
49
+ - check-version-consistency: ✅ PASS(全部 0.24.0,自动修复 6 处版本号)
50
+ - npm test: ✅ 457/457 通过(428 既有 + 29 新增)
51
+
52
+ ### Statistics
53
+
54
+ - 新增代码: ~350 行(guard 检查器 + DDL 提取 + 测试用例)
55
+ - 修改文件: 52 个
56
+ - 测试覆盖: solutions 四个脚本从 0% → 100%(29 个测试用例)
57
+ - 复利强制化: executing:closing 转换新增 compound-captured 维度(learnings.md 或显式 skip)
58
+
9
59
  ## [0.22.5] - 2026-07-28
10
60
 
11
61
  ### Fixed(制品链评审与修复,设计 v0.9 §28)
package/GEMINI.md CHANGED
@@ -8,7 +8,7 @@ The workflow is self-contained and does not require OpenSpec or Superpowers at r
8
8
 
9
9
 
10
10
  <!-- team-flow-phase-guard-start -->
11
- # team-flow v0.23.0 | 阶段: {{state}} | 工作流: {{workflow}}
11
+ # team-flow v0.24.0 | 阶段: {{state}} | 工作流: {{workflow}}
12
12
  当前阶段允许的操作由 workflow-start 路由规则定义。
13
13
  禁止跨越 DP gate 进入下一阶段。变更范围以 execution-contract.md 的 Intent Lock 为准。
14
14
  <!-- team-flow-phase-guard-end -->
package/INSTALL.md CHANGED
@@ -7,7 +7,7 @@
7
7
  - [Fission-AI/OpenSpec](https://github.com/Fission-AI/OpenSpec) — 规划引擎(Schema 验证、Delta Spec、工件解析)
8
8
  - [obra/superpowers](https://github.com/obra/superpowers) — 执行纪律(TDD 铁律、SDD、系统化调试、代码审查)
9
9
 
10
- 当前发布版本:**v0.23.0**。
10
+ 当前发布版本:**v0.24.0**。
11
11
 
12
12
  ---
13
13
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # team-flow
2
2
 
3
- > 当前版本:`v0.23.0`
3
+ > 当前版本:`v0.24.0`
4
4
 
5
5
  > 统一插件:**team-flow**(spec 驱动开发)+ **compound-engineering 核心子集**(全局复利)+ **architecture-design**(4A+DDD 增量设计)+ **prototype**(本地 HTML 原型)+ **e2e**(AC 驱动 E2E)+ **workflow-orchestrator**(产品级编排)+ **workflow-bootstrap**(既有项目接入)。一次安装,七套能力协同。
6
6
 
package/docs/README_en.md CHANGED
@@ -126,7 +126,7 @@ npm install -g team-flow
126
126
 
127
127
  ### Version
128
128
 
129
- - Current: `v0.23.0`
129
+ - Current: `v0.24.0`
130
130
  - v0.9.1 highlights: DP-4 execution-mode recommendations, a portable runtime across 17 platforms, and a raw-package smoke with no plugin-root variable.
131
131
  - Self-contained — no OpenSpec or Superpowers runtime required
132
132
  - Upstream: [Fission-AI/OpenSpec](https://github.com/Fission-AI/OpenSpec), [obra/superpowers](https://github.com/obra/superpowers)
@@ -0,0 +1,5 @@
1
+ # Solutions Index
2
+ <!-- 每条一行,按 severity 降序,≤150 行硬上限 -->
3
+ | date | phase | domain | type | severity | summary | file |
4
+ |------|-------|--------|------|----------|---------|------|
5
+ | 2026-07-28 | cross-phase | general | insight | medium | (no summary) | cross-phase/2026-07-28-no-summary.md |
@@ -0,0 +1,17 @@
1
+ ---
2
+ phase: cross-phase
3
+ domain: general
4
+ type: insight
5
+ severity: medium
6
+ date: 2026-07-28
7
+ source:
8
+ ---
9
+
10
+ ## 问题描述
11
+ (no summary)
12
+
13
+ ## 根因/模式
14
+ (待补充)
15
+
16
+ ## 预防措施/应用方式
17
+ (待补充)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "team-flow",
3
3
  "description": "Unified workflow plugin: team-flow (spec-driven dev) + compound-engineering core subset + architecture-design (4A/DDD) + prototype (local HTML). 17 skills, one install.",
4
- "version": "0.23.0",
4
+ "version": "0.24.0",
5
5
  "contextFileName": "GEMINI.md"
6
6
  }
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env bash
2
2
  #
3
- # pre-tool-use-guard — spec-superflow implementation-edit state guard (PreToolUse)
3
+ # pre-tool-use-guard — team-flow implementation-edit state guard (PreToolUse)
4
4
  #
5
5
  # ----------------------------------------------------------------------------
6
6
  # Purpose
7
7
  # ----------------------------------------------------------------------------
8
8
  # Blocks Write/Edit/MultiEdit implementation edits unless the active
9
- # spec-superflow change is in a state that permits building. This enforces the
9
+ # team-flow change is in a state that permits building. This enforces the
10
10
  # state-machine rule that "no implementation is allowed" outside the
11
11
  # build-permitted states (exploring / specifying / bridging must finish and be
12
12
  # approved before any code is written).
@@ -15,8 +15,8 @@
15
15
  # Guard logic
16
16
  # ----------------------------------------------------------------------------
17
17
  # 1. Walk up from $PWD (current dir + max 3 parent levels) looking for
18
- # `.spec-superflow.yaml`.
19
- # - Not found -> ALLOW (no active spec-superflow change in scope).
18
+ # `.team-flow.yaml`.
19
+ # - Not found -> ALLOW (no active team-flow change in scope).
20
20
  # 2. Read the current workflow state from the `state:` line of the yaml.
21
21
  # 3. For Write/Edit/MultiEdit only:
22
22
  # - state in {approved-for-build, executing, debugging} -> ALLOW
@@ -73,13 +73,13 @@ case "$TOOL_NAME" in
73
73
  *) allow ;; # anything else — allow
74
74
  esac
75
75
 
76
- # --- locate .spec-superflow.yaml (cwd + max 3 parent levels) ---------------
76
+ # --- locate .team-flow.yaml (cwd + max 3 parent levels) ---------------
77
77
  dir="$PWD"
78
78
  yaml=""
79
79
  i=0
80
80
  while [ "$i" -le 3 ]; do
81
- if [ -f "$dir/.spec-superflow.yaml" ]; then
82
- yaml="$dir/.spec-superflow.yaml"
81
+ if [ -f "$dir/.team-flow.yaml" ]; then
82
+ yaml="$dir/.team-flow.yaml"
83
83
  break
84
84
  fi
85
85
  [ "$dir" = "/" ] && break # reached filesystem root
@@ -87,7 +87,7 @@ while [ "$i" -le 3 ]; do
87
87
  i=$((i + 1))
88
88
  done
89
89
 
90
- # No active spec-superflow change in scope -> allow.
90
+ # No active team-flow change in scope -> allow.
91
91
  [ -n "$yaml" ] || allow
92
92
  [ -r "$yaml" ] || allow
93
93
 
@@ -107,7 +107,7 @@ case "$state" in
107
107
  allow
108
108
  ;;
109
109
  *)
110
- reason="spec-superflow guard: implementation edits (Write/Edit/MultiEdit) are blocked while the change is in state '$state'. Edits are only allowed in states: approved-for-build, executing, debugging. Advance the workflow to an approved build state first (see docs/state-machine.md or /spec-superflow:workflow-start). If no change is actually active, remove or fix the stray .spec-superflow.yaml."
110
+ reason="team-flow guard: implementation edits (Write/Edit/MultiEdit) are blocked while the change is in state '$state'. Edits are only allowed in states: approved-for-build, executing, debugging. Advance the workflow to an approved build state first (see docs/state-machine.md or /team-flow:workflow-start). If no change is actually active, remove or fix the stray .team-flow.yaml."
111
111
  # Escape backslashes and double quotes for safe JSON string embedding.
112
112
  reason_esc="$(printf '%s' "$reason" | sed 's/\\/\\\\/g; s/"/\\"/g')"
113
113
  printf '{"decision":"block","reason":"%s"}\n' "$reason_esc"
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
- # v0.23.0: conditional injection — detects artifacts, injects workflow-start pointer
3
- msg="<EXTREMELY_IMPORTANT>\nYou have spec-superflow installed. Use /spec-superflow:workflow-start ONLY when you detect an active spec-superflow change in the workspace (look for \`.spec-superflow.yaml\`, \`proposal.md\`, \`execution-contract.md\`, or \`specs/\` directories), OR when the user explicitly invokes it by name. For ordinary coding tasks without spec-superflow artifacts, do NOT invoke workflow-start — just handle the request directly.\n</EXTREMELY_IMPORTANT>"
2
+ # v0.24.0: conditional injection — detects artifacts, injects workflow-start pointer
3
+ msg="<EXTREMELY_IMPORTANT>\nYou have team-flow installed. Use /team-flow:workflow-start ONLY when you detect an active team-flow change in the workspace (look for \`.team-flow.yaml\`, \`proposal.md\`, \`execution-contract.md\`, or \`specs/\` directories), OR when the user explicitly invokes it by name. For ordinary coding tasks without team-flow artifacts, do NOT invoke workflow-start — just handle the request directly.\n</EXTREMELY_IMPORTANT>"
4
4
 
5
5
  # Three platforms share the same message, only output format differs.
6
6
  if [ -n "${CURSOR_PLUGIN_ROOT:-}" ]; then
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.23.0.
6
+ Current version: v0.24.0.
7
7
 
8
8
  ## Key Documents
9
9
  - README.md: Chinese homepage with full usage guide and FAQ
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xulthekl/team-flow",
3
- "version": "0.23.0",
3
+ "version": "0.24.0",
4
4
  "description": "Unified plugin (23 skills + 8 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.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "team-flow",
3
- "version": "0.23.0",
3
+ "version": "0.24.0",
4
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). 23 skills + 8 agents, one install.",
5
5
  "author": {
6
6
  "name": "LT"
@@ -0,0 +1,70 @@
1
+ // scripts/guard/checks/compound-captured.mjs — compound engineering capture guard
2
+ // v0.24.0: 复利贯穿强制化——executing:closing 增加 compound-captured 维度
3
+ //
4
+ // 规则:
5
+ // - learnings.md 存在且非空 → pass(已记录经验)
6
+ // - compound_skipped === true → pass(显式豁免,用户主动跳过)
7
+ // - workflow === 'tweak' → 不进入本检查器(由 WORKFLOW_TRANSITION_CHECKS 豁免)
8
+ // - 其他情况 → fail(提示用户执行 tf solutions capture 或显式 skip)
9
+ //
10
+ // 设计原则:
11
+ // - 与 arch-design 检查器同属"产物存在性"维度,不涉及内容质量评审
12
+ // - 只检查 learnings.md 存在,不验证 frontmatter 格式(advisory 由 ce-compound 保证)
13
+ // - 显式 skip 必须通过 state 字段(`tf state set compound_skipped true`),防止遗忘
14
+
15
+ import fs from 'node:fs';
16
+ import path from 'node:path';
17
+
18
+ /**
19
+ * 从 .team-flow.yaml 提取顶层字段值(与 arch-design.mjs 同源模式)
20
+ */
21
+ function extractYamlField(content, field) {
22
+ for (const line of content.split('\n')) {
23
+ const match = line.match(new RegExp(`^${field}:\\s*(.*)`));
24
+ if (match) {
25
+ const val = match[1].trim();
26
+ return val === 'null' || val === '' ? null : val;
27
+ }
28
+ }
29
+ return null;
30
+ }
31
+
32
+ /**
33
+ * Check compound engineering capture for the executing:closing transition.
34
+ *
35
+ * @param {string} changeDir - change directory path
36
+ * @returns {{ pass: boolean, failures: string[] }}
37
+ */
38
+ export function checkCompoundCaptured(changeDir) {
39
+ const failures = [];
40
+
41
+ // 1. 检查 learnings.md 存在且非空
42
+ const learningsPath = path.join(changeDir, 'learnings.md');
43
+ if (fs.existsSync(learningsPath)) {
44
+ const content = fs.readFileSync(learningsPath, 'utf-8').trim();
45
+ if (content.length > 0) {
46
+ return { pass: true, failures: [] };
47
+ }
48
+ // 文件存在但为空,视为未捕获
49
+ failures.push('learnings.md exists but is empty — run `tf solutions capture` or populate with session learnings');
50
+ return { pass: false, failures };
51
+ }
52
+
53
+ // 2. 检查显式豁免(compound_skipped === true)
54
+ const stateFile = path.join(changeDir, '.team-flow.yaml');
55
+ if (fs.existsSync(stateFile)) {
56
+ const raw = fs.readFileSync(stateFile, 'utf-8');
57
+ const skipped = extractYamlField(raw, 'compound_skipped');
58
+ if (skipped === 'true') {
59
+ return { pass: true, failures: [] };
60
+ }
61
+ }
62
+
63
+ // 3. 未捕获且未豁免 → fail
64
+ failures.push(
65
+ 'Compound capture missing: no learnings.md found in change directory. ' +
66
+ 'Run `tf solutions capture --phase review --domain <d> --type insight --severity medium --summary "..."` ' +
67
+ 'to document session learnings, or `tf state set compound_skipped true` to explicitly skip.'
68
+ );
69
+ return { pass: false, failures };
70
+ }
@@ -13,6 +13,7 @@ import { checkContractCurrent } from './checks/contract-current.mjs';
13
13
  import { checkDp3Approved } from './checks/dp3-approved.mjs';
14
14
  import { checkExecutionPlanReady } from './checks/execution-plan-ready.mjs';
15
15
  import { checkExecutionReviewsPassed } from './checks/execution-reviews-passed.mjs';
16
+ import { checkCompoundCaptured } from './checks/compound-captured.mjs';
16
17
 
17
18
  // Transition matrix: <from>:<to> → required check dimensions
18
19
  const TRANSITION_CHECKS = {
@@ -21,7 +22,7 @@ const TRANSITION_CHECKS = {
21
22
  'specifying:bridging': ['artifacts-exist', 'schema-valid'],
22
23
  'bridging:approved-for-build': ['artifacts-exist', 'schema-valid', 'contract-fresh', 'dp-gate-passed'],
23
24
  'approved-for-build:executing': ['artifacts-exist', 'contract-fresh', 'dp-gate-passed', 'execution-plan-ready'],
24
- 'executing:closing': ['tasks-complete', 'tests-passing', 'specs-merged', 'execution-plan-ready', 'execution-reviews-passed'],
25
+ 'executing:closing': ['tasks-complete', 'tests-passing', 'specs-merged', 'execution-plan-ready', 'execution-reviews-passed', 'compound-captured'],
25
26
 
26
27
  // Debugging side-path
27
28
  'executing:debugging': [],
@@ -165,6 +166,7 @@ async function main() {
165
166
  'execution-plan-ready': (dir) => checkExecutionPlanReady(dir),
166
167
  'execution-reviews-passed': (dir) => checkExecutionReviewsPassed(dir),
167
168
  'arch-design': (dir) => checkArchDesign(dir),
169
+ 'compound-captured': (dir) => checkCompoundCaptured(dir),
168
170
  };
169
171
 
170
172
  const checks = [];
@@ -26,6 +26,8 @@ const SETTABLE_FIELDS = [
26
26
  // Architecture design gate (v0.9 §26, v0.22.5 评审修复 F02)
27
27
  'arch_design_decision', 'arch_design_reason',
28
28
  'arch_design_timestamp', 'arch_design_artifacts',
29
+ // Compound engineering capture gate (v0.24.0 复利贯穿强制化)
30
+ 'compound_skipped',
29
31
  ];
30
32
 
31
33
  export async function run(args) {
@@ -130,7 +130,7 @@ ${learning.body}
130
130
  return { promoted, updated };
131
131
  }
132
132
 
133
- if (process.argv[1]?.includes('solutions-promote')) {
133
+ if (process.env.NODE_ENV !== 'test' && process.argv[1]?.includes('solutions-promote')) {
134
134
  const args = { _: [] };
135
135
  for (let i = 2; i < process.argv.length; i++) {
136
136
  if (process.argv[i].startsWith('--')) {
@@ -43,6 +43,8 @@ const BUILTIN_DEFAULTS = {
43
43
  arch_design_reason: null,
44
44
  arch_design_timestamp: null,
45
45
  arch_design_artifacts: null,
46
+ // Compound engineering capture gate (v0.24.0 复利贯穿强制化)
47
+ compound_skipped: null,
46
48
  };
47
49
 
48
50
  /**
@@ -117,6 +119,9 @@ export function writeState(changeDir, state) {
117
119
  lines.push(`arch_design_reason: ${state.arch_design_reason ?? 'null'}`);
118
120
  lines.push(`arch_design_timestamp: ${state.arch_design_timestamp ?? 'null'}`);
119
121
  lines.push(`arch_design_artifacts: ${state.arch_design_artifacts ?? 'null'}`);
122
+ lines.push('');
123
+ lines.push('# === Compound engineering capture gate (v0.24.0) ===');
124
+ lines.push(`compound_skipped: ${state.compound_skipped ?? 'null'}`);
120
125
 
121
126
  fs.writeFileSync(filePath, lines.join('\n') + '\n', 'utf-8');
122
127
  }
@@ -49,7 +49,7 @@ Scientific method: form a single hypothesis ("I think X is the root cause becaus
49
49
 
50
50
  ### DP-5: Debug Escalation (3+ Failures)
51
51
 
52
- 3+ failed fixes = architectural problem. Each fix revealing new problems elsewhere = wrong architecture. Record: `npx --yes --package @xulthekl/team-flow@0.23.0 tf state set <change-dir> dp_5_result <decision>`. Discuss with user before attempting more fixes.
52
+ 3+ failed fixes = architectural problem. Each fix revealing new problems elsewhere = wrong architecture. Record: `npx --yes --package @xulthekl/team-flow@0.24.0 tf state set <change-dir> dp_5_result <decision>`. Discuss with user before attempting more fixes.
53
53
 
54
54
  ## Red Flags — Return to Phase 1
55
55
 
@@ -15,18 +15,18 @@ When `architecture/sql/` exists, also read:
15
15
  - `architecture/sql/ddl/*.sql` — executable DDL scripts; reference directly for DB schema change tasks instead of hand-writing DDL
16
16
  - `architecture/sql/migration/*.sql` — data migration scripts; execute as-is for data transformation tasks
17
17
 
18
- Check workflow mode first: `npx --yes --package @xulthekl/team-flow@0.23.0 tf state get <change-dir> workflow`. If `tweak` → direct edit mode. If `hotfix` or `full` → standard contract-first discipline.
18
+ Check workflow mode first: `npx --yes --package @xulthekl/team-flow@0.24.0 tf state get <change-dir> workflow`. If `tweak` → direct edit mode. If `hotfix` or `full` → standard contract-first discipline.
19
19
 
20
20
  Branch/worktree preflight before ANY implementation edit (mandatory — do not skip):
21
21
  1. Run the isolation check:
22
22
  ```bash
23
- npx --yes --package @xulthekl/team-flow@0.23.0 tf isolate <change-dir>
23
+ npx --yes --package @xulthekl/team-flow@0.24.0 tf isolate <change-dir>
24
24
  ```
25
25
  This script enforces git isolation: if you are on `main`/`master` it creates a
26
26
  git worktree (preferred) or a new branch, and exits non-zero if it cannot and you
27
27
  have not approved `--force`.
28
- 2. If `npx --yes --package @xulthekl/team-flow@0.23.0 tf isolate` exits non-zero: STOP. Do not edit `main`/`master` in place.
29
- Ask the user for explicit approval (and re-run with `npx --yes --package @xulthekl/team-flow@0.23.0 tf isolate <change-dir> --force`
28
+ 2. If `npx --yes --package @xulthekl/team-flow@0.24.0 tf isolate` exits non-zero: STOP. Do not edit `main`/`master` in place.
29
+ Ask the user for explicit approval (and re-run with `npx --yes --package @xulthekl/team-flow@0.24.0 tf isolate <change-dir> --force`
30
30
  only after they approve).
31
31
  3. If it succeeds, report the chosen branch/worktree and make all implementation
32
32
  edits there.
@@ -52,15 +52,15 @@ Return to `specifying` or `bridging` if: new behavior appears, interfaces change
52
52
  For `full`/`hotfix`, generate proposed waves from the approved contract, then use the recommendation as a decision aid rather than silently defaulting a mode:
53
53
 
54
54
  ```bash
55
- npx --yes --package @xulthekl/team-flow@0.23.0 tf execution recommend <change-dir> \
55
+ npx --yes --package @xulthekl/team-flow@0.24.0 tf execution recommend <change-dir> \
56
56
  --wave <wave-id>:<parallel|serial>:<task,...>[:<depends-on,...>] --json
57
57
  # Show every available mode, the observed facts, and the recommendation to the user.
58
58
  # The command writes a receipt tied to the artifacts, contract, and waves. After the user chooses, record that explicit confirmation:
59
- npx --yes --package @xulthekl/team-flow@0.23.0 tf execution plan <change-dir> \
59
+ npx --yes --package @xulthekl/team-flow@0.24.0 tf execution plan <change-dir> \
60
60
  --mode <selected-mode> --confirm --reason "user-selected execution mode" \
61
61
  --wave <wave-id>:<parallel|serial>:<task,...>[:<depends-on,...>]
62
62
  # Add --acknowledge-recommendation when the selection differs from the recommendation.
63
- npx --yes --package @xulthekl/team-flow@0.23.0 tf execution show <change-dir> --json
63
+ npx --yes --package @xulthekl/team-flow@0.24.0 tf execution show <change-dir> --json
64
64
  ```
65
65
 
66
66
  The optional fourth `--wave` segment names prerequisite wave IDs. `execution show --json` reports `current`, plus each wave's `depends_on`, `receipt`, `blockers`, `retryable`, and `eligible` status. A wave with `retryable: true` has a current `fail` receipt and is eligible only for its focused repair and re-review; its dependents remain blocked until its replacement `pass` receipt. Report the saved plan revision, selected mode, ordered waves, dependencies, and whether every `parallel` wave can actually be dispatched concurrently on the current platform. If concurrency is unavailable, state the capability and reason plainly; retain the planned `parallel` strategy and do not silently execute it as a serial or Batch Inline plan.
@@ -73,7 +73,7 @@ The recommendation uses task count, configured `execution.inlineThreshold`, and
73
73
  | **Inline** | Recommended for a single sequential task; always available for a user-confirmed choice |
74
74
  | **Batch Inline** | Recommended for a bounded sequential batch; it remains serial and is never presented as parallel |
75
75
 
76
- Do not transition to `executing` until `execution show` reports `current: true` and the phase guard passes. A revised plan must repeat `npx --yes --package @xulthekl/team-flow@0.23.0 tf execution recommend` and use `npx --yes --package @xulthekl/team-flow@0.23.0 tf execution revise --confirm`; it creates a new revision and invalidates receipts from the prior revision.
76
+ Do not transition to `executing` until `execution show` reports `current: true` and the phase guard passes. A revised plan must repeat `npx --yes --package @xulthekl/team-flow@0.24.0 tf execution recommend` and use `npx --yes --package @xulthekl/team-flow@0.24.0 tf execution revise --confirm`; it creates a new revision and invalidates receipts from the prior revision.
77
77
 
78
78
  ## Batch Inline Execution
79
79
 
@@ -88,21 +88,21 @@ Boundaries: if any task touches >1 module, involves schema/API/config changes, o
88
88
  For full/hotfix by default. Dispatch according to the persisted plan, review each planned wave, and run a final broad review after all waves.
89
89
 
90
90
  ### Planned-Wave Loop
91
- 1. Read the current plan with `npx --yes --package @xulthekl/team-flow@0.23.0 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.
91
+ 1. Read the current plan with `npx --yes --package @xulthekl/team-flow@0.24.0 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.
92
92
  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.
93
93
  3. A `serial` wave dispatches one task at a time in listed order.
94
94
  4. After every wave, write a non-empty persisted regular-file review report (separate from the implementer's report), then record exactly one receipt that names that review report:
95
95
  ```bash
96
- npx --yes --package @xulthekl/team-flow@0.23.0 tf execution review <change-dir> \
96
+ npx --yes --package @xulthekl/team-flow@0.24.0 tf execution review <change-dir> \
97
97
  --wave <wave-id> --base <sha> --head <sha> --report <review-report-path> --verdict <pass|fail>
98
98
  ```
99
99
  Do not begin a dependent wave until its predecessor receipt is `pass`.
100
100
  5. 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.
101
101
 
102
102
  ### Per-Task Loop
103
- 1. **Dispatch implementer**: Load the template with `npx --yes --package @xulthekl/team-flow@0.23.0 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.
103
+ 1. **Dispatch implementer**: Load the template with `npx --yes --package @xulthekl/team-flow@0.24.0 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.
104
104
  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.
105
- 3. **Review**: Load `npx --yes --package @xulthekl/team-flow@0.23.0 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.
105
+ 3. **Review**: Load `npx --yes --package @xulthekl/team-flow@0.24.0 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.
106
106
  4. **Fix**: If Critical or Important issues, write the `fail` receipt, dispatch fix subagent, re-review, and write the replacement `pass` receipt.
107
107
  5. **Mark complete**: Append to `.superpowers/sdd/progress.md`: `Task N: complete (commits <base7>..<head7>, review clean)`
108
108
 
@@ -110,7 +110,7 @@ For full/hotfix by default. Dispatch according to the persisted plan, review eac
110
110
  Use the configured profile that matches the task role. Resolve it before dispatch:
111
111
 
112
112
  ```bash
113
- npx --yes --package @xulthekl/team-flow@0.23.0 tf runtime config --resolve-model <profile>
113
+ npx --yes --package @xulthekl/team-flow@0.24.0 tf runtime config --resolve-model <profile>
114
114
  ```
115
115
 
116
116
  | Profile | Role |
@@ -123,11 +123,11 @@ npx --yes --package @xulthekl/team-flow@0.23.0 tf runtime config --resolve-model
123
123
  For platforms whose dispatch supports a `model` field, explicitly pass the resolved `model` value. If the result is `configured: false`, automatic selection is unavailable: do not invent a provider model and do not bypass the existing requirement to specify `model` explicitly. Resolution only reads configuration; it does not switch models.
124
124
 
125
125
  ### Progress Ledger
126
- Track in `.superpowers/sdd/progress.md`. Check for existing ledger — completed tasks are done. After each batch: `npx --yes --package @xulthekl/team-flow@0.23.0 tf state set <change-dir> batches_completed <N>`.
126
+ Track in `.superpowers/sdd/progress.md`. Check for existing ledger — completed tasks are done. After each batch: `npx --yes --package @xulthekl/team-flow@0.24.0 tf state set <change-dir> batches_completed <N>`.
127
127
 
128
128
  ## Inline Execution Mode
129
129
 
130
- Only after a user-confirmed `inline` selection is recorded by `npx --yes --package @xulthekl/team-flow@0.23.0 tf execution plan --confirm`; a non-recommended selection also records `--acknowledge-recommendation`. Executes in the current session and still writes one review receipt per planned wave.
130
+ Only after a user-confirmed `inline` selection is recorded by `npx --yes --package @xulthekl/team-flow@0.24.0 tf execution plan --confirm`; a non-recommended selection also records `--acknowledge-recommendation`. Executes in the current session and still writes one review receipt per planned wave.
131
131
 
132
132
  Per-task: extract brief → write failing test → confirm failure → implement → confirm green → checkpoint review (done-when criteria, SHALL/MUST verification) → commit → save a task-level recovery checkpoint when another task remains → append to progress ledger.
133
133
 
@@ -135,7 +135,7 @@ After a task is committed and reviewed, when another task remains, save the
135
135
  recovery context with real evidence:
136
136
 
137
137
  ```bash
138
- npx --yes --package @xulthekl/team-flow@0.23.0 tf checkpoint save <change-dir> \
138
+ npx --yes --package @xulthekl/team-flow@0.24.0 tf checkpoint save <change-dir> \
139
139
  --task <completed-task-id> --next "<next task>" --completed "<completed work>" \
140
140
  --verification "<verification report path>" --review "<review report path>" \
141
141
  --risk "<open risk or None>" --commit-start <base-sha> --commit-end <head-sha>
@@ -143,7 +143,7 @@ npx --yes --package @xulthekl/team-flow@0.23.0 tf checkpoint save <change-dir> \
143
143
 
144
144
  This augments `.superpowers/sdd/progress.md`; it does not replace the progress
145
145
  ledger or add a new core workflow state. Do not claim a checkpoint is current
146
- when `npx --yes --package @xulthekl/team-flow@0.23.0 tf checkpoint list` reports it as stale.
146
+ when `npx --yes --package @xulthekl/team-flow@0.24.0 tf checkpoint list` reports it as stale.
147
147
 
148
148
  If task hits BLOCKED (3+ fix failures or changes outside declared scope), escalate to SDD.
149
149
 
@@ -153,8 +153,8 @@ Skip TDD. Apply changes directly. Verify file integrity (exists, non-empty, vali
153
153
 
154
154
  ## DP Records
155
155
 
156
- DP-4 is written by `npx --yes --package @xulthekl/team-flow@0.23.0 tf execution plan`; do not write it with raw `state set`.
157
- DP-5 (debug escalation): `npx --yes --package @xulthekl/team-flow@0.23.0 tf state set <change-dir> dp_5_result "<resolution>"` + timestamp.
156
+ DP-4 is written by `npx --yes --package @xulthekl/team-flow@0.24.0 tf execution plan`; do not write it with raw `state set`.
157
+ DP-5 (debug escalation): `npx --yes --package @xulthekl/team-flow@0.24.0 tf state set <change-dir> dp_5_result "<resolution>"` + timestamp.
158
158
 
159
159
  ## Completion Standard
160
160
 
@@ -22,7 +22,7 @@ Subagent (general-purpose):
22
22
  ## Planned Wave
23
23
 
24
24
  You are assigned to planned wave [WAVE_ID] with strategy [WAVE_STRATEGY].
25
- Read `npx --yes --package @xulthekl/team-flow@0.23.0 tf execution show <change-dir> --json` before editing. Do not start
25
+ Read `npx --yes --package @xulthekl/team-flow@0.24.0 tf execution show <change-dir> --json` before editing. Do not start
26
26
  unless all declared dependencies have `pass` review receipts. A `parallel`
27
27
  label permits concurrent dispatch only when the controller confirms the
28
28
  platform supports it; never change the saved wave strategy yourself.