@xulthekl/team-flow 0.36.2 → 0.36.4

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 (43) 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/AGENTS.md +4 -4
  9. package/CHANGELOG.md +23 -0
  10. package/GEMINI.md +1 -1
  11. package/INSTALL.md +1 -1
  12. package/README.md +2 -2
  13. package/agents/architecture-design.md +24 -4
  14. package/agents/architecture-reviewer.md +10 -6
  15. package/agents/cross-change-consistency-checker.md +2 -1
  16. package/docs/README_en.md +1 -1
  17. package/gemini-extension.json +1 -1
  18. package/hooks/pre-tool-use-guard +15 -0
  19. package/hooks/session-start +2 -2
  20. package/llms.txt +1 -1
  21. package/package.json +1 -1
  22. package/plugin.json +1 -1
  23. package/scripts/guard/checks/arch-gate-exemptions.mjs +32 -17
  24. package/scripts/guard/checks/arch-snapshot.mjs +7 -0
  25. package/scripts/lib/arch-merge.mjs +22 -6
  26. package/scripts/lib/cmd-doctor.mjs +27 -0
  27. package/scripts/lib/solutions-capture.mjs +1 -1
  28. package/skills/architecture-design/SKILL.md +14 -0
  29. package/skills/architecture-design/chapters/ch06-integration.md +2 -2
  30. package/skills/architecture-design/references/s3.5-architecture-template.md +1 -1
  31. package/skills/architecture-design/references/s3.5-loading-protocol.md +1 -1
  32. package/skills/architecture-design/references/s3.5-product-architecture.md +13 -1
  33. package/skills/ce-compound/references/v0.5-upgrade.md +3 -0
  34. package/skills/release-archivist/SKILL.md +2 -0
  35. package/skills/workflow-bootstrap/SKILL.md +8 -5
  36. package/skills/workflow-bootstrap/references/b1-reconnaissance.md +2 -2
  37. package/skills/workflow-orchestrator/SKILL.md +1 -1
  38. package/skills/workflow-orchestrator/references/s4-split-validate.md +2 -1
  39. package/skills/workflow-orchestrator/references/s5-monitoring.md +1 -0
  40. package/skills/workflow-orchestrator/references/state-model.md +1 -1
  41. package/skills/workflow-start/SKILL.md +3 -0
  42. package/skills/workflow-start/references/routing-rules.md +2 -0
  43. package/wave-batch-receipt-analysis-report.md +0 -561
@@ -1,3 +1,3 @@
1
- # team-flow v0.36.2 | 阶段: {{state}} | 工作流: {{workflow}}
1
+ # team-flow v0.36.4 | 阶段: {{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. 24 skills + 15 agents with embedded TDD, SDD, code review, debugging, delta spec sync, and design-system-driven prototyping.",
12
- "version": "0.36.2",
12
+ "version": "0.36.4",
13
13
  "source": "./",
14
14
  "author": {
15
15
  "name": "LT",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "team-flow",
3
- "version": "0.36.2",
3
+ "version": "0.36.4",
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). 24 skills + 15 agents, one install.",
5
5
  "source": "./",
6
6
  "author": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "team-flow",
3
- "version": "0.36.2",
3
+ "version": "0.36.4",
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.36.2"
8
+ "version": "0.36.4"
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). 24 skills + 15 agents, one install.",
5
- "version": "0.36.2",
5
+ "version": "0.36.4",
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.36.2"
9
+ "version": "0.36.4"
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.36.2",
15
+ "version": "0.36.4",
16
16
  "source": ".",
17
17
  "author": {
18
18
  "name": "LT",
package/AGENTS.md CHANGED
@@ -100,13 +100,13 @@ prd/ PRD(有版本 v1→v2→v3,git 分支隔离)
100
100
  ├── prd-completeness-review.md # PRD 完整性评审报告(prd-completeness-reviewer 产出,v0.15.0 新增)
101
101
  prototype/ 全局原型系统(UI 契约真相源):index.html / pages / components / assets / design-system.md / flow.md
102
102
  docs/
103
- ├── architecture/ 全局架构锚点:ARCHITECTURE.md / DATABASE.md / <bc>/(限界上下文目录)/ baseline.md(v0.6 新增)
103
+ ├── architecture/ 全局架构三层(v0.36.0):L1 当前态(ARCHITECTURE.md marker 区 / PHYSICAL-MODEL.md / DATABASE.md / API-INDEX.md / INDEX.md / domains/<bc>.md / diagrams/ / schema-baseline.sql / baseline.md)+ L2 changelog/ + L3 iterations/vN/architecture.md(产品级快照,archived 退役)
104
104
  └── solutions/ 复利经验库(v0.5 新增,三层索引)
105
105
  ├── INDEX.md # L1 轻量索引(≤150行,每条一行摘要+标签)
106
- ├── prd/ plan/ prototype/ spec/ build/ review/ cross-phase/ # L2 分阶段目录
106
+ ├── prd/ plan/ architecture/ prototype/ spec/ build/ review/ cross-phase/ # L2 分阶段目录(v0.36.0 加 architecture)
107
107
  └── <file>.md # L3 经验文件(YAML frontmatter: phase/domain/type/severity)
108
- changes/<name>/ 变更脚手架(S4 创建):.team-flow.yaml(变更级状态文件,P1-6 第二阶段改名 .team-flow.yaml)
109
- specs/<cap>/ 每变更设计/任务/契约:spec.md / design.md / tasks.md / execution-contract.md / architecture.md / database.md / api.md / learnings.md
108
+ changes/<name>/ 变更脚手架(S4 创建):.team-flow.yaml(变更级状态文件)/ change-brief.md(产品级交接物,含 upstream_arch_ref)/ architecture/(变更级三件套 + sql/)
109
+ specs/<cap>/ 每变更设计/任务/契约:spec.md / design.md / tasks.md / execution-contract.md / learnings.md(v0.9 architecture/ 三件套已迁至 changes/<name>/architecture/)
110
110
  STRATEGY.md CONCEPTS.md 产品策略(BA) / 领域词汇
111
111
  ```
112
112
 
package/CHANGELOG.md CHANGED
@@ -6,6 +6,29 @@ The format loosely follows Keep a Changelog.
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.36.4] - 2026-08-05
10
+
11
+ ### Added(Wave 审查纪律 + 上下文轮转)
12
+
13
+ - **workflow-start SKILL.md**:Route to code-reviewer 增加逐 wave 审查纪律——每次 code-reviewer dispatch 只审查一个 wave,禁止合并多 wave 审查(vrm4teamflow C1 事件修复)
14
+ - **workflow-start SKILL.md**:Sub-agent Dispatch Protocol 增加 build-executor 交互轮次轮转——累计 ≥6 轮 SendMessage 交互时启动新 build-executor 子代理(交接文档必须含已完成 waves + 累积决策 + worktree SHA)
15
+
16
+ ## [0.36.3] - 2026-08-05
17
+
18
+ ### Fixed(v0.14 全链路缺口修复——27 项,复利链路 + agent 契约 + 门禁时序 + 交接/决策门 + guard hook + 快照生命周期 + 旧项目 + 文档同步 + 横展)
19
+
20
+ - **复利链路(严重 #4)**:solutions PHASES 加 architecture;architecture-design 加载协议加复利注入(`tf solutions inject --phase architecture`);S3.5 SOP 加复利捕获(Step 9);ce-compound 补架构自动捕获场景
21
+ - **agent 契约(严重 #1 #2)**:architecture-design / architecture-reviewer agent 加 product 模式(mode 参数/快照输入/INPUT_ERROR 分 mode/Phase1-A3 分叉/报告落盘 iterations/vN/auto-review.md)
22
+ - **门禁触发点(严重 #3)**:`tf arch init` 打戳加 SOP 触发点(S3.5 完成条件 + orchestrator ARCH 节)——arch_baseline 从此可建立,arch 门禁不再永久空转
23
+ - **门禁时序(重要 #5 + 一般 #16 #21)**:skip 物化限定最新迭代(防旧 SKIPPED 错误豁免);iterations 数字排序(v10+);FAIL 提示文案修正
24
+ - **arch 门禁测试(重要 #10)**:新增 tests/lib/guard-arch-gates.test.mjs(7 例);guard-dimensions 更新 16 维度 + arch-readiness 断言
25
+ - **交接/决策门(重要 #12 #7 #6)**:change-brief 加 upstream_arch_ref;架构修订决策门 SOP 定义(deviation 登记);API-INDEX 只扫已关闭 change;首轮特例状态标注;arch-snapshot 在途兜底
26
+ - **guard hook + 门禁说明(重要 #9 #11)**:pre-tool-use-guard 豁免 docs/architecture/iterations/ + .team-flow/;workflow-start/release-archivist 补 arch 门禁说明 + FAIL 升级路径
27
+ - **快照生命周期(重要 #8 + 一般 #17)**:s5-monitoring 迭代收尾标 archived;S3.5 补 domains/ + diagrams/ 产出 SOP
28
+ - **旧项目链路(重要 #14 + 一般 #22)**:workflow-bootstrap 感知 arch-reverse-analyst/逆向重建(B5 + 修正陈旧指引);recon-probe.sh 路径修正
29
+ - **文档同步(一般 #15 #19 #20)**:AGENTS.md/README 目录树三层化;ch06/state-model/loading-protocol/模板 marker 陈旧修正;workspace 登记(design-doc-system/roadmap)
30
+ - **横展(一般 #13 + 建议 #24 #25)**:arch-merge 白名单补 changelog/;doctor 加 arch-state 体检;cross-change 对照产品级注册表
31
+
9
32
  ## [0.36.2] - 2026-08-05
10
33
 
11
34
  ### Fixed
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.36.2 | 阶段: {{state}} | 工作流: {{workflow}}
11
+ # team-flow v0.36.4 | 阶段: {{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.36.2**。
10
+ 当前发布版本:**v0.36.4**。
11
11
 
12
12
  ---
13
13
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # team-flow
2
2
 
3
- > 当前版本:`v0.36.2`
3
+ > 当前版本:`v0.36.4`
4
4
 
5
5
  > 统一插件:**team-flow**(spec 驱动开发)+ **compound-engineering 核心子集**(全局复利)+ **architecture-design**(4A+DDD 增量设计)+ **prototype**(本地 HTML 原型)+ **e2e**(AC 驱动 E2E)+ **workflow-orchestrator**(产品级编排)+ **workflow-bootstrap**(既有项目接入)。一次安装,七套能力协同。
6
6
 
@@ -64,7 +64,7 @@ cp -r <plugin>/skills/prototype/references/prototype-scaffold/ <project>/prototy
64
64
  prd/ PRD + 实施方案 + 原型审查记录(v1→v2,分支隔离)
65
65
  prototype/ 全局原型(UI 契约真相源)
66
66
  docs/
67
- ├── architecture/ 全局架构锚点(ARCHITECTURE.md / DATABASE.md / <bc>/ / baseline.md
67
+ ├── architecture/ 全局架构三层(v0.36.0):ARCHITECTURE.md / PHYSICAL-MODEL.md / DATABASE.md / API-INDEX.md / INDEX.md / domains/<bc>.md / iterations/vN/(产品级快照)/ baseline.md
68
68
  └── solutions/ 复利经验库(三层索引:INDEX.md → 分阶段目录 → 经验文件)
69
69
  specs/<cap>/ 每变更设计/任务/契约 + learnings.md
70
70
  STRATEGY.md CONCEPTS.md 策略 / 领域词汇
@@ -21,16 +21,27 @@ You are an independent architecture designer. You read the change brief, plan, e
21
21
 
22
22
  **Your preloaded Skill contains the detailed methodology** (F1-F8 frameworks, chapter knowledge, templates, conventions protocol, context loading protocol). Follow it for HOW. This prompt defines WHO you are and WHAT you must deliver.
23
23
 
24
+ ## Call Mode(v0.36.0:变更级 / 产品级)
25
+
26
+ | 模式 | 编排入口 | 判定 | 产出 | 唯一事实源 |
27
+ |------|---------|------|------|-----------|
28
+ | change(默认) | workflow-start(exploring→specifying) | 五项检查 | `changes/<name>/architecture/` 三件套 + sql/ | 产品级快照(BC 边界/聚合注册表),只引用不重定义 |
29
+ | product | workflow-orchestrator S3.5(ARCH 阶段) | 8 步全系统结构级设计(无五项检查) | `docs/architecture/iterations/vN/architecture.md`(6 产物) | 本快照是产品级唯一事实源 |
30
+
31
+ **product 模式**:按 `references/s3.5-product-architecture.md` SOP(8 步)+ `references/s3.5-architecture-template.md` 模板 + `references/s3.5-loading-protocol.md` 加载协议;产出经 architecture-reviewer product 视角评审(`review_mode: product`)PASS 才进 S4;时序 P1:只写快照不写全局。
32
+
24
33
  ## Inputs
25
34
 
26
35
  | Parameter | Description |
27
36
  |-----------|-------------|
28
- | `change_brief_path` | change-brief.md 路径(scope / AC / 技术方向) |
37
+ | `mode` | `change`(默认,workflow-start 五项检查)\| `product`(v0.36.0,S3.5 产品级架构设计) |
38
+ | `change_brief_path` | change-brief.md 路径(scope / AC / 技术方向;change 模式必填) |
29
39
  | `plan_path` | prd/vN/plan.md 路径(高阶技术设计段) |
40
+ | `snapshot_path` | docs/architecture/iterations/vN/architecture.md(产品级快照;change 模式主输入,product 模式产出目标) |
30
41
  | `specs_dir` | changes/<name>/specs/ 路径(现有规格,如有) |
31
42
  | `global_arch_dir` | docs/architecture/ 路径(As-Is 基线) |
32
43
 
33
- If change_brief_path is missing or unreadable, report `decision: skipped` with reason `INPUT_ERROR: change-brief missing`.
44
+ If change_brief_path is missing or unreadable **in change mode**, report `decision: skipped` with reason `INPUT_ERROR: change-brief missing`. In product mode change_brief_path is optional(产品级设计发生在 change 存在之前); 缺少时正常执行 8 步设计。
34
45
 
35
46
  ## Five-Check Gate (Architecture Change Determination)
36
47
 
@@ -44,7 +55,7 @@ Check the following five items in order. **All negative** → `decision: skipped
44
55
 
45
56
  ## Output Directory
46
57
 
47
- Architecture deliverables go in the change directory's `architecture/` subdirectory:
58
+ **change 模式**(默认):架构产出在 change 目录的 `architecture/` 子目录:
48
59
 
49
60
  ```
50
61
  changes/<name>/
@@ -57,11 +68,14 @@ changes/<name>/
57
68
  └── migration/ # Incremental migration scripts
58
69
  ```
59
70
 
71
+ **product 模式**(v0.36.0):产出在 `docs/architecture/iterations/vN/architecture.md`(6 产物:Context Map / 聚合注册表 / 指令事件 / 状态机 / 概念 ER / 时序),`snapshot_status: in-flight`,provenance 标注。**不写全局**(P1:预测态不进实际态)。
72
+
60
73
  ## Structured Output Contract
61
74
 
62
75
  Return the following YAML to the orchestration layer:
63
76
 
64
77
  ```yaml
78
+ # change 模式
65
79
  decision: required | skipped
66
80
  reason: "..." # skipped: why no architecture changes
67
81
  # required: summary of architecture changes
@@ -71,6 +85,12 @@ artifacts: # required: list of produced files, skipped: em
71
85
  - architecture/api.md
72
86
  - architecture/sql/ddl/...
73
87
  - architecture/sql/migration/...
88
+
89
+ # product 模式(v0.36.0)
90
+ decision: completed | skipped # completed: 8 步设计完成;skipped: 迭代无结构性变更(须物化 SKIPPED 标记)
91
+ reason: "..."
92
+ snapshot_path: docs/architecture/iterations/vN/architecture.md
93
+ verdict: pending_review # 评审门(architecture-reviewer product 视角)在产出后进行
74
94
  ```
75
95
 
76
96
  ## api.md Positioning — Architecture Routing Table
@@ -92,7 +112,7 @@ artifacts: # required: list of produced files, skipped: em
92
112
 
93
113
  **DON'T:**
94
114
  - Skip the five-check gate and jump to design
95
- - Load `baseline.md` or uninvolved domain sections (Skill defines what to load)
115
+ - Load `baseline.md`(change 模式遵循 Skill 加载协议;**product 模式**须读 baseline.md + CONCEPTS.md 作输入,见 s3.5-product-architecture.md)
96
116
  - Embed SQL in markdown code blocks (use sql/ directory)
97
117
  - Produce api.md with Swagger-level detail (that's Swagger's job)
98
118
  - Produce artifacts when decision is `skipped`
@@ -11,7 +11,7 @@ You are an independent Architecture Consistency Reviewer. You check whether arch
11
11
 
12
12
  ## The Iron Law
13
13
 
14
- You are an independent reviewer. You did NOT participate in producing the architecture design. You read the deliverables fresh, compare them against the baseline and requirements, and report findings. You must NEVER write, edit, create, or delete any file. Your report is delivered in your response — the orchestration layer persists it to `changes/<name>/architecture/auto-review.md`.
14
+ You are an independent reviewer. You did NOT participate in producing the architecture design. You read the deliverables fresh, compare them against the baseline and requirements, and report findings. You must NEVER write, edit, create, or delete any file. Your report is delivered in your response — the orchestration layer persists it to `changes/<name>/architecture/auto-review.md`(change 模式)或 `docs/architecture/iterations/vN/auto-review.md`(product 模式,v0.36.0).
15
15
 
16
16
  ## Inputs
17
17
 
@@ -23,20 +23,24 @@ You are an independent reviewer. You did NOT participate in producing the archit
23
23
  | `architecture_dir` | 架构产出目录(e.g., `changes/<name>/architecture/`) |
24
24
  | `global_arch_dir` | 全局架构目录(e.g., `docs/architecture/`) |
25
25
  | `conventions_config` | conventions 配置(从 team-flow.config.json 读取的路径映射) |
26
- | `review_mode` | `change`(默认,审查 `changes/<name>/architecture/` 三件套)\| `product`(v0.35.0,审查 `docs/architecture/iterations/vN/architecture.md` 产品级快照) |
26
+ | `review_mode` | `change`(默认,审查 `changes/<name>/architecture/` 三件套)\| `product`(v0.36.0,审查 `docs/architecture/iterations/vN/architecture.md` 产品级快照) |
27
+ | `product_snapshot_path` | docs/architecture/iterations/vN/architecture.md(product 模式审查对象;v0.36.2 起 dispatch 传入) |
27
28
 
28
- If change_brief_path or architecture_dir is missing or unreadable, report `FAIL` with reason `INPUT_ERROR`.
29
+ If change_brief_path or architecture_dir is missing or unreadable **in change mode**, report `FAIL` with reason `INPUT_ERROR`. In product mode,`change_brief_path` 可选(A4 对照源是 PRD 非 change-brief),审查对象是 `product_snapshot_path`;`product_snapshot_path` 缺失 → FAIL `INPUT_ERROR`。
29
30
 
30
- ## Product Mode(v0.35.0,v0.14 §60.5)
31
+ ## Product Mode(v0.36.0,v0.14 §60.5)
31
32
 
32
33
  `review_mode: product` 时(S3.5 产品级评审门),审查对象与维度适配变化:
33
34
 
34
- - **审查对象**:`docs/architecture/iterations/vN/architecture.md`(6 产物:Context Map / 聚合注册表 / 指令事件 / 状态机 / 概念 ER / 时序)+ `domains/` 按域详细页;**不审查** change 内三件套。
35
- - **A1**:6 产物章节存在 + marker 成对 + anchor id 可解析(机械预检)。
35
+ - **审查对象**:`product_snapshot_path`(`docs/architecture/iterations/vN/architecture.md`,6 产物:Context Map / 聚合注册表 / 指令事件 / 状态机 / 概念 ER / 时序)+ `domains/` 按域详细页;**不审查** change 内三件套。
36
+ - **A1**:6 产物章节存在 + marker 成对 + anchor id 可解析(机械预检);**不执行** change 模式的 `test -f architecture/{architecture,database,api}.md`。
37
+ - **A2**:SQL/结构有效(若快照含 sql/ 引用;机械 grep)。
38
+ - **A3**:对照 `references/s3.5-architecture-template.md`(产品级模板),非 `templates/architecture.md`(变更级模板)。
36
39
  - **A4**:对照 PRD 功能清单(F001_P0 逐条)→ BC/聚合/API 全覆盖映射;对照源是 PRD(非 change-brief——change-brief 是变更级输入)。
37
40
  - **A5**:旧项目逆向重建场景对照现状代码/全局基线;正向设计场景仅检查与既有基线无矛盾。
38
41
  - **A6**:conventions 合规(同 change 模式)。
39
42
  - **skip 处理**:S3.5 显式跳过(`iterations/vN/SKIPPED` 标记)时本 agent 不执行。
43
+ - **报告落盘**:product 模式评审报告落盘 `docs/architecture/iterations/vN/auto-review.md`(非 `changes/<name>/architecture/auto-review.md`——product 模式无 change 目录)。
40
44
 
41
45
  ## 6-Dimension Checklist
42
46
 
@@ -20,6 +20,7 @@ You are a read-only checker. You did NOT implement any change. You read all chan
20
20
  |-----------|-------------|
21
21
  | `change_dirs[]` | 多个 change 目录路径(e.g., `changes/change-1/`, `changes/change-2/`) |
22
22
  | `arch_path` | 全局架构目录(e.g., `docs/architecture/`,含 ARCHITECTURE.md / DATABASE.md) |
23
+ | `product_snapshot_path` | 产品级架构快照 `docs/architecture/iterations/vN/architecture.md`(v0.36.3;聚合注册表唯一事实源,若存在) |
23
24
  | `prototype_path` | 全局原型目录(e.g., `prototype/`) |
24
25
 
25
26
  If `change_dirs` has fewer than 2 entries, Dim 1/2 are skipped (single change has no cross-change conflict). If `arch_path` or `prototype_path` is missing, the corresponding dimension is skipped with a note.
@@ -81,7 +82,7 @@ Use `grep` to search for API references across change specs and design docs.
81
82
  1. **Enumerate changes**: read each change directory's spec/design/tasks files
82
83
  2. **Dim 1**: Extract modified domain files per change, build mutation map, identify overlaps
83
84
  3. **Dim 2**: Extract API surface changes per change, cross-reference dependencies
84
- 4. **Dim 3**: Read architecture anchors, compare each change against them
85
+ 4. **Dim 3**: Read architecture anchors **+ 产品级快照聚合注册表**(`product_snapshot_path`,v0.36.3——聚合注册表是唯一事实源,跨 change 冲突检测以它为准),compare each change against them
85
86
  5. **Dim 4**: Scan prototype testids, compare against change implementations
86
87
  6. **Aggregate**: collect all findings, grade by severity, produce report
87
88
 
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.36.2`
129
+ - Current: `v0.36.4`
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)
@@ -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). 24 skills, one install.",
4
- "version": "0.36.2",
4
+ "version": "0.36.4",
5
5
  "contextFileName": "GEMINI.md"
6
6
  }
@@ -142,6 +142,21 @@ if [ -n "$file_path" ] && [ "${file_path##*/}" != ".team-flow.yaml" ]; then
142
142
  esac
143
143
  fi
144
144
 
145
+ # --- v0.36.3 (§7.3): product-level architecture dir exemption ---------------
146
+ # ARCH 阶段(S3.5)写 docs/architecture/iterations/ 快照、SKIPPED 标记、
147
+ # .team-flow/ 产品级状态(orchestrator.yaml)是合法非 build 态写入。
148
+ # .team-flow.yaml(change 状态)不在豁免内(state 禁写红线保留)。
149
+ if [ -n "$file_path" ]; then
150
+ case "$file_path" in
151
+ */docs/architecture/iterations/*) allow ;;
152
+ */.team-flow/*) allow ;;
153
+ esac
154
+ case "${file_path#/private}" in
155
+ */docs/architecture/iterations/*) allow ;;
156
+ */.team-flow/*) allow ;;
157
+ esac
158
+ fi
159
+
145
160
  # --- decision --------------------------------------------------------------
146
161
  case "$state" in
147
162
  approved-for-build|executing|debugging)
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env bash
2
- # v0.36.2: auto-sync CLI version with plugin version
2
+ # v0.36.4: auto-sync CLI version with plugin version
3
3
  set -e
4
4
 
5
5
  # ═══════════════════════════════════════════════════════════════
6
6
  # Plugin version (update this when releasing new versions)
7
7
  # ═══════════════════════════════════════════════════════════════
8
- PLUGIN_VERSION="0.36.2"
8
+ PLUGIN_VERSION="0.36.4"
9
9
 
10
10
  # ═══════════════════════════════════════════════════════════════
11
11
  # Step 1: Auto-sync CLI version with plugin version
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.36.2.
6
+ Current version: v0.36.4.
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.36.2",
3
+ "version": "0.36.4",
4
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.",
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.36.2",
3
+ "version": "0.36.4",
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). 24 skills + 15 agents, one install.",
5
5
  "author": {
6
6
  "name": "LT"
@@ -39,30 +39,45 @@ export function isLegacyArch(state) {
39
39
  return state?.arch_baseline == null;
40
40
  }
41
41
 
42
- /** 项目级显式 skip 是否已物化(iterations/vN/SKIPPED 标记存在)。 */
43
- export function isArchSkipMaterialized(root) {
42
+ /** 列出所有迭代目录(数字排序,v10 正确处理——字典序 v10 < v2 会取错最新)。 */
43
+ export function listIterationDirs(root) {
44
44
  const iterationsDir = root && path.join(root, 'docs', 'architecture', 'iterations');
45
- if (!iterationsDir || !fs.existsSync(iterationsDir)) return false;
45
+ if (!iterationsDir || !fs.existsSync(iterationsDir)) return [];
46
46
  return fs.readdirSync(iterationsDir, { withFileTypes: true })
47
47
  .filter(d => d.isDirectory())
48
- .some(d => fs.existsSync(path.join(iterationsDir, d.name, 'SKIPPED')));
48
+ .map(d => d.name)
49
+ .sort((a, b) => {
50
+ const na = parseInt(a.replace(/\D/g, ''), 10) || 0;
51
+ const nb = parseInt(b.replace(/\D/g, ''), 10) || 0;
52
+ return na - nb;
53
+ });
54
+ }
55
+
56
+ /** 最新迭代目录路径(数字排序后最后)。无迭代 → null。 */
57
+ export function findLatestIterationDir(root) {
58
+ const dirs = listIterationDirs(root);
59
+ if (dirs.length === 0) return null;
60
+ return path.join(root, 'docs', 'architecture', 'iterations', dirs[dirs.length - 1]);
61
+ }
62
+
63
+ /**
64
+ * skip 物化检查:只认最新迭代目录的 SKIPPED(v0.36.3 修复——防旧迭代陈旧标记
65
+ * 错误豁免新迭代的结构性变更,P3 原则要防的失效模式)。
66
+ */
67
+ export function isArchSkipMaterialized(root) {
68
+ const latest = findLatestIterationDir(root);
69
+ if (!latest) return false;
70
+ return fs.existsSync(path.join(latest, 'SKIPPED'));
49
71
  }
50
72
 
51
73
  /** 最近一个迭代的产品级架构快照路径(iterations/<latest>/architecture.md)。不存在 → null。 */
52
74
  export function findLatestIterationSnapshot(root) {
53
- const iterationsDir = root && path.join(root, 'docs', 'architecture', 'iterations');
54
- if (!iterationsDir || !fs.existsSync(iterationsDir)) return null;
55
- const dirs = fs.readdirSync(iterationsDir, { withFileTypes: true })
56
- .filter(d => d.isDirectory())
57
- .map(d => d.name)
58
- .sort();
59
- for (let i = dirs.length - 1; i >= 0; i--) {
60
- const snap = path.join(iterationsDir, dirs[i], 'architecture.md');
61
- if (fs.existsSync(snap)) return snap;
62
- }
63
- return null;
75
+ const latest = findLatestIterationDir(root);
76
+ if (!latest) return null;
77
+ const snap = path.join(latest, 'architecture.md');
78
+ return fs.existsSync(snap) ? snap : null;
64
79
  }
65
80
 
66
81
  export const ARCH_READINESS_FAIL_HINT =
67
- 'iterations/vN/architecture.md missing — 回 ARCH 阶段补快照,'
68
- + '或显式 skip 物化(iterations/vN/<vN>/SKIPPED 标记 + 理由)';
82
+ 'iterations/<vN>/architecture.md missing — 回 ARCH 阶段补快照,'
83
+ + '或显式 skip 物化(iterations/<vN>/SKIPPED 标记 + 理由)';
@@ -31,5 +31,12 @@ export function checkArchSnapshot(changeDir) {
31
31
  const snap = findLatestIterationSnapshot(root);
32
32
  if (snap) return { pass: true, failures: [] };
33
33
 
34
+ // v0.36.3 §63.4 在途 change 兜底:快照缺失但 change 已有增量产物 → 以 change 产物为实际态(存量升级场景)
35
+ const archDir = join(changeDir, 'architecture');
36
+ if (existsSync(archDir) && existsSync(join(archDir, 'architecture.md'))) {
37
+ console.warn(' [WARN] arch-snapshot: 产品级快照缺失,以 change 增量产物兜底(存量升级在途 change,快照后补为 v0)');
38
+ return { pass: true, failures: [] };
39
+ }
40
+
34
41
  return { pass: false, failures: [ARCH_READINESS_FAIL_HINT] };
35
42
  }
@@ -120,9 +120,10 @@ function buildCurrentStateSection(aggregates, changeName) {
120
120
  lines.push(`| ${bc} | ${aggs.length} |`);
121
121
  }
122
122
  lines.push('', '### 聚合注册表');
123
- lines.push('| 聚合ID | 上下文 | 根实体 | 来源 | 关键不变量 |', '|--------|--------|--------|------|-----------|');
123
+ // v0.36.3 §62.1 首轮特例:全局聚合全部来自已合并 change(=已落地态);状态列标注
124
+ lines.push('| 聚合ID | 上下文 | 根实体 | 来源 | 状态 | 关键不变量 |', '|--------|--------|--------|------|------|-----------|');
124
125
  for (const a of aggregates) {
125
- lines.push(`| ${a.id} | ${a.context} | ${a.root} | change:${changeName} | ${a.invariants || '—'} |`);
126
+ lines.push(`| ${a.id} | ${a.context} | ${a.root} | change:${changeName} | 已落地 | ${a.invariants || '—'} |`);
126
127
  }
127
128
  return lines.join('\n');
128
129
  }
@@ -224,10 +225,19 @@ function generateDatabase(globalArchDir, schemaPath) {
224
225
  return { generated: true, file: 'DATABASE.md', tables: tables.length };
225
226
  }
226
227
 
228
+ /** v0.36.3 §62.4:判断 change 是否已关闭(读 .team-flow.yaml state)。 */
229
+ function isChangeClosed(changeRoot) {
230
+ const stateFile = join(changeRoot, '.team-flow.yaml');
231
+ if (!existsSync(stateFile)) return false;
232
+ const m = readFileSync(stateFile, 'utf-8').match(/^state:\s*(.*)$/m);
233
+ const state = m ? m[1].trim() : '';
234
+ return state === 'closed' || state === 'closing';
235
+ }
236
+
227
237
  /**
228
238
  * Step 6: API-INDEX.md 生成式(api-scan 核心)。
229
239
  * 扫描项目根下所有已关闭 change 的 architecture/api.md + domains/,归一化端点重建。
230
- * 保护:重建结果为空拒绝覆盖(防历史手工端点被抹)。
240
+ * 保护:①重建结果为空拒绝覆盖(防历史手工端点被抹);②只扫已关闭 change(v0.36.3,在途半成品端点不得入全局)。
231
241
  */
232
242
  function generateApiIndex(projectRoot, globalArchDir, changeName) {
233
243
  const changesDir = join(projectRoot, 'changes');
@@ -237,7 +247,9 @@ function generateApiIndex(projectRoot, globalArchDir, changeName) {
237
247
  const endpoints = [];
238
248
  if (existsSync(changesDir)) {
239
249
  for (const changeDirName of readdirSync(changesDir)) {
240
- const apiPath = join(changesDir, changeDirName, 'architecture', 'api.md');
250
+ const changeRoot = join(changesDir, changeDirName);
251
+ if (!isChangeClosed(changeRoot)) continue; // v0.36.3:只扫已关闭 change
252
+ const apiPath = join(changeRoot, 'architecture', 'api.md');
241
253
  if (!existsSync(apiPath)) continue;
242
254
  const ep = extractEndpoints(readFileSync(apiPath, 'utf-8'));
243
255
  for (const e of ep) endpoints.push({ ...e, source: changeDirName });
@@ -378,14 +390,17 @@ function preCheck(changeDir, archDir, projectRoot) {
378
390
  /* ============ Step 5: 变更脚本归档(保留) ============ */
379
391
 
380
392
  function archiveChangeScripts(changeDir, archDir, globalArchDir, changeName) {
381
- const report = { ddl: 0, migration: 0 };
393
+ const report = { ddl: 0, migration: 0, files: [] };
382
394
  for (const subDir of ['ddl', 'migration']) {
383
395
  const srcDir = join(archDir, 'sql', subDir);
384
396
  const dstDir = join(globalArchDir, 'changelog', subDir);
385
397
  if (!existsSync(srcDir)) continue;
386
398
  if (!existsSync(dstDir)) makeDir(dstDir);
387
399
  const files = readdirSync(srcDir).filter(f => f.endsWith('.sql'));
388
- for (const f of files) copyFile(join(srcDir, f), join(dstDir, f));
400
+ for (const f of files) {
401
+ copyFile(join(srcDir, f), join(dstDir, f));
402
+ report.files.push(join(dstDir, f)); // v0.36.3:changelog 文件入白名单(防自我制造脏文件告警)
403
+ }
389
404
  report[subDir] += files.length;
390
405
  }
391
406
  return report;
@@ -513,6 +528,7 @@ export function run(args = {}) {
513
528
  join(globalArchDir, 'schema-baseline.sql'),
514
529
  join(globalArchDir, 'API-INDEX.md'),
515
530
  join(globalArchDir, 'INDEX.md'),
531
+ ...(archiveResult.files || []), // v0.36.3:changelog/ 复制文件入白名单
516
532
  ].filter(p => existsSync(p));
517
533
  const dirty = detectUntouchedDirtyFiles(globalArchDir, touchedFiles);
518
534
  if (dirty.length > 0) {
@@ -299,6 +299,32 @@ function checkChangeTestGates(root) {
299
299
  return { pass: true, message: `${checked} change(s) pass test-gate hygiene (skip reasons + artifact references)` };
300
300
  }
301
301
 
302
+ // v0.36.3 建议项:arch-state / iterations 一致性体检
303
+ // 1. arch_baseline 已打戳但 iterations/ 无任何产品级快照 → arch 门禁将 FAIL(需回 ARCH 补快照)
304
+ // 2. SKIPPED 与快照并存 → 语义矛盾
305
+ function checkArchState(root) {
306
+ const warnings = [];
307
+ const archStatePath = join(root, '.team-flow', 'arch-state.json');
308
+ const iterationsDir = join(root, 'docs', 'architecture', 'iterations');
309
+ if (existsSync(archStatePath)) {
310
+ const hasSnapshot = existsSync(iterationsDir)
311
+ && readdirSync(iterationsDir, { withFileTypes: true })
312
+ .filter(d => d.isDirectory())
313
+ .some(d => existsSync(join(iterationsDir, d.name, 'architecture.md')));
314
+ if (!hasSnapshot) {
315
+ warnings.push('arch_baseline 已打戳但 iterations/ 无产品级快照——arch-readiness/arch-snapshot 门禁将 FAIL,需回 ARCH 阶段补快照');
316
+ }
317
+ }
318
+ if (existsSync(iterationsDir)) {
319
+ for (const d of readdirSync(iterationsDir, { withFileTypes: true }).filter(x => x.isDirectory())) {
320
+ const hasSkip = existsSync(join(iterationsDir, d.name, 'SKIPPED'));
321
+ const hasSnap = existsSync(join(iterationsDir, d.name, 'architecture.md'));
322
+ if (hasSkip && hasSnap) warnings.push(`${d}: SKIPPED 与快照并存,语义矛盾`);
323
+ }
324
+ }
325
+ return { pass: warnings.length === 0, message: warnings.length ? warnings.join('; ') : 'arch-state/iterations 一致' };
326
+ }
327
+
302
328
  export async function run(args) {
303
329
  const root = process.cwd();
304
330
  const config = loadConfig(root);
@@ -317,6 +343,7 @@ export async function run(args) {
317
343
  ['Docs', checkDocs(root)],
318
344
  ['Change states', checkChangeStates(root)],
319
345
  ['Change test gates', checkChangeTestGates(root)],
346
+ ['Arch state', checkArchState(root)],
320
347
  ];
321
348
 
322
349
  // Config check
@@ -14,7 +14,7 @@
14
14
  import { readFileSync, writeFileSync, existsSync, mkdirSync, appendFileSync } from 'node:fs';
15
15
  import { join } from 'node:path';
16
16
 
17
- const PHASES = ['prd', 'plan', 'prototype', 'spec', 'build', 'review', 'cross-phase'];
17
+ const PHASES = ['prd', 'plan', 'architecture', 'prototype', 'spec', 'build', 'review', 'cross-phase'];
18
18
  const MAX_INDEX_LINES = 150;
19
19
 
20
20
  function slugify(text) {
@@ -90,6 +90,16 @@ description: 基于 4A 企业架构 + DDD 领域驱动设计的架构/API/DB 设
90
90
 
91
91
  变更级聚合动作限三类:`extend`(既有聚合加字段/指令/事件/状态)、`new`(新增聚合,flag 登记待产品级晋升)、`refactor`(需决策门)。聚合 id 一律引用产品级注册表,不重定义(防重发明,v0.14 §61.3)。
92
92
 
93
+ ### 架构修订决策门(v0.36.3 定义,v0.14 §61.3/§61.4)
94
+
95
+ **触发**:change 级设计触及产品级决策(BC 边界变更 / 聚合所有权变更 / 全局契约变更),或 arch-merge 冲突预检阻断聚合重定义。
96
+
97
+ **流程**(不硬阻断,显式确认 + 登记 deviation):
98
+ 1. **呈现变更摘要**:涉及的产品级决策 + 影响范围(引用快照章节)
99
+ 2. **用户确认**(阻塞问题工具):接受 → 执行变更;拒绝 → 保持产品级定义,change 内走增量
100
+ 3. **登记 deviation**:确认后写入 `orchestrator.yaml` 的 `replan_log`(`seq/trigger: arch-deviation/before/after/approved_by`)+ 在 `iterations/vN/architecture.md` 演进日志追加修订记录(迭代收尾 S3.5 确认晋升)
101
+ 4. **`new` 聚合 flag**:在 `iterations/vN/architecture.md` 聚合注册表标注 `[pending-promotion]`,待下一迭代产品级晋升
102
+
93
103
  ### 执行流程
94
104
 
95
105
  ```
@@ -182,6 +192,10 @@ architecture-design 执行时的上下文组装:
182
192
  3. 读取匹配的 `.team-flow/conventions/*.md` 文件
183
193
  4. 注入为架构决策约束(advisory 级)
184
194
 
195
+ **架构复利注入(v0.36.3,复利链路修复)**:
196
+ 1. 执行 `tf solutions inject --phase architecture`(失败静默)——注入 `docs/solutions/` 中 phase=architecture 的历史架构决策经验(BC 边界取舍/聚合划分理由/事件投影设计踩坑)
197
+ 2. 读取失败 / 无条目 → 静默跳过,不阻断(advisory 级,与 S1 复利注入同语义)
198
+
185
199
  **始终加载**:
186
200
  1. `Read docs/architecture/INDEX.md`(~50行摘要)
187
201
  2. `Read changes/<name>/change-brief.md`(如有)