@xulthekl/team-flow 0.65.0 → 0.67.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 (50) 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 +31 -0
  9. package/GEMINI.md +1 -1
  10. package/INSTALL.md +1 -1
  11. package/README.md +1 -1
  12. package/agents/architecture-reviewer.md +4 -0
  13. package/agents/prd-completeness-reviewer.md +10 -0
  14. package/agents/prd-writer.md +1 -0
  15. package/agents/release-archivist.md +2 -0
  16. package/docs/README_en.md +1 -1
  17. package/docs/team-flow /344/275/277/347/224/250/350/257/264/346/230/216/357/274/210/347/240/224/345/217/221/345/233/242/351/230/237/347/211/210/357/274/211.md" +8 -6
  18. package/gemini-extension.json +1 -1
  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/prd/v1/prd.md +1 -1
  24. package/scripts/guard/checks/history-risk.mjs +132 -0
  25. package/scripts/guard/checks/prd-clarity-state.mjs +41 -0
  26. package/scripts/guard/checks/prd-clarity.mjs +176 -0
  27. package/scripts/guard/guard.mjs +16 -8
  28. package/scripts/infer-workflow.mjs +20 -0
  29. package/scripts/lib/cmd-doctor.mjs +2 -2
  30. package/scripts/lib/cmd-prd.mjs +84 -1
  31. package/scripts/lib/cmd-solutions.mjs +3 -0
  32. package/scripts/lib/cmd-state.mjs +31 -1
  33. package/scripts/lib/solutions-capture.mjs +5 -0
  34. package/scripts/lib/solutions-index-gen.mjs +33 -3
  35. package/scripts/lib/solutions-inject.mjs +34 -9
  36. package/scripts/lib/state-loader.mjs +13 -0
  37. package/skills/ce-brainstorm/SKILL.md +3 -3
  38. package/skills/ce-brainstorm/references/grounding.md +1 -1
  39. package/skills/ce-brainstorm/references/prd-84-authoring-spec.md +26 -3
  40. package/skills/ce-brainstorm/references/prototype-loop.md +8 -0
  41. package/skills/ce-compound/references/promotion-rules.md +1 -1
  42. package/skills/ce-compound/references/three-tier-index.md +1 -1
  43. package/skills/ce-plan/references/research-workflow.md +1 -1
  44. package/skills/jarvis/references/protocols.md +1 -0
  45. package/skills/workflow-orchestrator/SKILL.md +6 -2
  46. package/skills/workflow-orchestrator/references/s1-path-router.md +7 -0
  47. package/skills/workflow-orchestrator/references/s2-prd-prototype-loop.md +16 -2
  48. package/skills/workflow-orchestrator/references/s3-plan-pipeline.md +1 -1
  49. package/skills/workflow-start/SKILL.md +1 -1
  50. package/templates/prd.md +9 -1
@@ -1,3 +1,3 @@
1
- # team-flow v0.65.0 | 阶段: {{state}} | 工作流: {{workflow}}
1
+ # team-flow v0.67.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 + independent business analysis. 28 skills + 17 agents with embedded TDD, SDD, code review, debugging, delta spec sync, and design-system-driven prototyping.",
12
- "version": "0.65.0",
12
+ "version": "0.67.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.65.0",
3
+ "version": "0.67.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) + business-analysis (independent requirement/scenario artifact) + design-system (design tokens + component contract + AI primer + showcase) + test-strategy (test strategy design) + project-initialize (new service onboarding) + jarvis (team-flow decision agent, opt-in). 28 skills + 17 agents, one install.",
5
5
  "source": "./",
6
6
  "author": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "team-flow",
3
- "version": "0.65.0",
3
+ "version": "0.67.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.65.0"
8
+ "version": "0.67.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) + business-analysis (independent requirement/scenario artifact) + jarvis (team-flow decision agent, opt-in). 28 skills + 17 agents, one install.",
5
- "version": "0.65.0",
5
+ "version": "0.67.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.65.0"
9
+ "version": "0.67.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, independent business analysis, and local HTML prototyping.",
15
- "version": "0.65.0",
15
+ "version": "0.67.0",
16
16
  "source": ".",
17
17
  "author": {
18
18
  "name": "LT",
package/CHANGELOG.md CHANGED
@@ -4,6 +4,37 @@ All notable changes to `team-flow` will be documented in this file.
4
4
 
5
5
  The format loosely follows Keep a Changelog.
6
6
 
7
+ ## [0.67.0] - 2026-09-25
8
+
9
+ ### Added(agent-governance 治理演进全量:P0–P2 七批次;设计 = 工作区 `teamflow-agent-governance-design-memo.md` v0.5 + 实施计划 v1.2,P1.5 标准档两轮 + 收官验证 0 Critical)
10
+
11
+ **版本号说明**:**跳过 0.66.0**——该号预留给 ddd-purity 的 legacy 回写硬切(`docs/plan/ddd-purity-and-arch-merge-design.md` §5.4-7 等 13 处引用 + arch-merge/arch-registry 代码注释),agent-governance 先行完成故占 0.67.0。
12
+
13
+ **P0-1 · PRD 清晰度机械门(DEC-8a 复议推翻落地,Q5)**
14
+ - 新增 `scripts/guard/checks/prd-clarity.mjs` + `tf prd check-clarity <dir|file>`:弱词 8 类(权威正文 = prd-84 §4,收口 5→8 类)/ 必需段缺失 / §8.4 左列技术维度漂移,**fail-closed**(段缺失即 FAIL、FAIL exit 1),兼容 `requirement/vN` 与 `prd/vN` 老布局;误报校准唯一落点 = `WEAK_RULES` 词表(「处理」/单字「等」刻意排除,双侧留痕)。
15
+ - **三处接入**:CLI / standalone(`prototype-loop.md` §3.5.5 前置)/ orchestrated(`s2-prd-prototype-loop.md` step 3.4,**含无 UI 路径不可绕过**);FAIL 不派发 reviewer 直接回改。
16
+ - **DEC-8 拆 a/b scope**:a=弱词机械门推翻(回写 5 文件勘误)/ b=历史痕迹检测维持;模板撰写指引 blockquote **实例化剥离规则**(模板+prd-writer+prd-84 三处送执行者,防指引弱词死循环)。
17
+ - **跨层管道**:check-clarity 落 `.team-flow/prd-clarity.json` → `tf state init` 拷贝 change state(`prd_clarity_result`,**有意不在 SETTABLE_FIELDS**——可自助写 = 绕过通道)→ 变更级维度消费。
18
+
19
+ **P0-2 · reviewer 异常上报(双通道)**
20
+ - prd-completeness-reviewer / architecture-reviewer / release-archivist:会话输出先 `FINAL VERDICT` 一行、仅 Critical/Important 展开;**落盘报告保留全量明细**(SendMessage fallback 修正链与 DP-A 裁定依赖);release-archivist `dp_6`/`dp_7` 必填字段任何 status 不删、pass 仅省展开块。
21
+
22
+ **P1-1 · 接活前双维度(guard 31→33 维)**
23
+ - 新维度 `prd-clarity` + `history-risk`:挂 full `bridging→approved-for-build`/`approved→executing` 与 quick/lightweight/planned 前门;hotfix/tweak 有意不挂。
24
+ - `history-risk`(experimental):INDEX severity 风险向(confirmations 是复发信号不作正向分)、**N<3 最小样本中性**(单条不压制)、通用词根黑名单(防 source 列误关联)、命中 critical 即阻断(补救 = 改 INDEX 源头,无 state 确认通道——如实声明)。
25
+ - 缺失态三处中性(无记录/INDEX 空/无匹配)→ **冷启动零行为变化**;`inferMode` 新增 `clarity`/`risk` 双信号(workflow-start 路由建议级消费,与 guard 阻断分工)。
26
+ - 横展 9 处齐(guard/state-loader/cmd-state/新测试/使用说明矩阵/test-matrix/guard-dimensions 头部映射/e2e skill/.gitignore),**v0.64 遗留计数三分裂一并对齐**(test 头 20 / 使用说明 31 / e2e skill 19 → 统一 33)。
27
+
28
+ **P1-2 · 产品级 A 档文案降级**
29
+ - S1 确认合并(低风险三条件)/ ce-brainstorm scope 推荐 Lightweight(判定不清按 Standard 起步)/ ARCH 增量裁剪轻审 / S3 一次确认;**红线不动**:prd_draft 强制确认、红区永久挂起、DP-A、4A+DDD 六产物、skip 物化。
30
+
31
+ **P2-1/2/3 · 复利三件**
32
+ - P2-1:`tf solutions capture --source-event` 来源事件锚 + `type: correction` 纠错类;jarvis HOLD 协议新增 ④' 纠错捕获步骤(**纪律级**——两个自动钩子候选均观测不到 HOLD 已证伪;误捕获不可接受;非 Jarvis 场景显式缩范围入待办)。
33
+ - P2-2:INDEX 第 9 列 `flags`(**纯派生随重建重算**:有锚+confirmations<3=probation 见习 / ≥3=auto-ok 毕业 / 无锚存量 grandfather auto-ok)+ inject 双门控(见习排除 + `DP-A|Code Landing|publish|发布闸|代码落地` 红区硬排除,计数可见含空结果分支)+ doctor 列数 7–9 + **五处手动读 fallback 同门**(降级不降门)+ 8 测试含重建存活正例。
34
+ - P2-3:S1/S3/ce-brainstorm 三处顶层 `tf solutions inject` 调用(注入不限 scope——防 A 档默认轻档零注入)+ 收益量化协议入 S1(冷启动 0 条目不计收益 0;真实样例收益实测入待办)。
35
+
36
+ **验证**:P4 双门禁——plugin-validator **PASS**(Major:`.npmignore` 漏排 `/.team-flow/` 运行时记录已修 + pack 反验);skill-reviewer **PASS_WITH_WARNINGS**(1C+4M+7m 全修,含 s2 无 UI 路径绕过 3.4 的 fail-open、S3 phase 口径 build→plan、红区关键词 3→5);`npm run check-versions` ✓;`npm test` 1343→**1383**(+40:prd-clarity 18 + clarity-history 14 + probation 8);`test:e2e` 103 全绿;`lint:skills` 87/7 与基线同。存量 PRD 校准 1 处真命中按「不过就改」修正,`check-clarity` PASS。
37
+
7
38
  ## [0.65.0] - 2026-09-25
8
39
 
9
40
  ### Added(DDD 纯度 + 架构回写机制重构:O1–O9 全量落地;设计 = docs/plan/ddd-purity-and-arch-merge-design.md v1.5,P1.5 完整档 3 轮闭合 + 三批 P3/P4 独立评审全处置)
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.65.0 | 阶段: {{state}} | 工作流: {{workflow}}
11
+ # team-flow v0.67.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.65.0**。
10
+ 当前发布版本:**v0.67.0**。
11
11
 
12
12
  ---
13
13
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # team-flow
2
2
 
3
- > 当前版本:`v0.65.0`
3
+ > 当前版本:`v0.67.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
 
@@ -143,6 +143,10 @@ Aggregate all findings and determine verdict.
143
143
 
144
144
  ## Output Format
145
145
 
146
+ **双通道协议(agent-governance P0-2,异常才上报;change/product 两模式同样适用)**:
147
+ 1. **落盘通道**:按下方模板完整写审查报告(change 模式 = change 目录内 auto-review;**product 模式 = `docs/architecture/iterations/vN/auto-review.md`**)——**必须保留全量维度明细**(SendMessage fallback 修正链与 DP-A 人工裁定依赖落盘全量,不得删减)。
148
+ 2. **会话输出通道**(返回派发方的消息):**先打印 Verdict 一行**(形如 `FINAL VERDICT: PASS (C0/I1/M2) — report: <落盘路径>`——标记名遵循 workflow-start 结果协议 `FINAL VERDICT:`);随后**仅当 Critical>0 或 Important>0 时**展开对应 findings;**Critical=0 且 Important=0 时只输出 Verdict 一行**,不展开 A1–A6 明细。
149
+
146
150
  ```markdown
147
151
  # Architecture Auto-Review Report
148
152
 
@@ -93,6 +93,12 @@ If `prd_path` is missing or unreadable, report `FAIL` with reason `INPUT_ERROR`.
93
93
 
94
94
  **(b)形态核验(v0.62.0 · G7)——判据必须同时查「形态」与「内容」**:
95
95
 
96
+ > **机械结果引用(agent-governance P0-1,D6)**:派发方(orchestrated 路径 = 编排层 S2;
97
+ > standalone 路径 = ce-brainstorm 主会话)在派发本 agent **之前**已跑 `tf prd check-clarity`
98
+ > (弱词 8 类 / 必需段 / §8.4 左列漂移,PASS 才会派发到此处)。若输入材料(或派发消息)携带其
99
+ > 输出,G7 第 1 条与精确性判级**直接引用该机械结果**(命中即记,不重复人工扫词);未携带时按下方
100
+ > 判据独立执行(机械结果是加速器不是前置依赖,缺了照常判)。
101
+
96
102
  | # | 核验项 | 判级 |
97
103
  |---|---|---|
98
104
  | 1 | §8.4 是否「一功能一表 + 编号业务叙述」,且**左列为画面/入口锚点**(出现「维度 / 字段 / 类型」等技术维度名 = 违规) | Important |
@@ -123,6 +129,10 @@ Aggregate findings → final verdict per the Judgment Criteria.
123
129
 
124
130
  ## Output Format
125
131
 
132
+ **双通道协议(agent-governance P0-2,异常才上报)**:
133
+ 1. **落盘通道**:按下方模板完整写 `requirement/{ITERATION_VERSION}/prd-completeness-review.md`——**必须保留全量维度明细**(SendMessage fallback 修正链与人工裁定依赖落盘全量,不得删减)。
134
+ 2. **会话输出通道**(返回派发方的消息):**先打印 Verdict 一行**(形如 `FINAL VERDICT: PASS (C0/I2/M3) — report: requirement/vN/prd-completeness-review.md`——标记名遵循 workflow-start 结果协议 `FINAL VERDICT:`);随后**仅当 Critical>0 或 Important>0 时**展开对应 findings(逐条带 D 维度与定位);**Critical=0 且 Important=0 时只输出 Verdict 一行**,不展开维度明细。Minor 计数不展开。
135
+
126
136
  ```markdown
127
137
  # PRD Completeness Review Report
128
138
 
@@ -96,6 +96,7 @@ summary: "..." # 2-3 sentence overview + 待主会话确认
96
96
  - 不写接口 / 表 / 类 / 算法等实现契约(属 change 级 spec/design)
97
97
  - 不修改 business-analysis.md / dialogue-log.md / detail_ledger / ledger.md
98
98
  - 不删除模板占位——无信息章节保留 `{占位}`
99
+ - **剥离撰写指引 blockquote**(agent-governance P0-1 模板声明同步):模板中所有 `>` 元指令指引段(「语汇/精确/完整性」「可解析性」等,含模板内 `⚠ 撰写指引剥离规则` 自身)是给撰写者的指令,**实例化时整体剥离、不写入 prd.md 正文**——指引自带弱词示例,保留会直接触发冻结前 `tf prd check-clarity` FAIL 且首版无豁免 = 死循环(剥离规则见 `templates/prd.md` §8.4 指引块)
99
100
  - **不把维度清单写进 §8.4 正文**(无列名清单、无 checkbox 列表、无「按…维覆盖,不适用标 NA」式转述)
100
101
  - **不写历史痕迹**:删除线、版本锚点(`v0.5ac` / `v0.47`)、「原口径作废」「已被推翻」一律不进正文
101
102
  - **不写技术标识符**:类名 / 方法名 / 表名 / 行号不进正文主干
@@ -33,6 +33,8 @@ If `change_dir` or the contract is missing/unreadable, report `FAIL` with reason
33
33
 
34
34
  ## Structured Output Contract
35
35
 
36
+ **异常才上报(agent-governance P0-2)**:返回给编排层的会话输出 = 下方 YAML **恒返回**(`dp_6`/`dp_7` 是 `workflow-start` 发起 closing 决策的必填字段,**任何 status 下都不得删字段**——只收摘要不收明细);YAML **之后的展开明细**(逐项验证记录、writeback 过程、WARN 讨论)**仅当 `status != pass` 时输出**——`status=pass` 时省略展开块。**YAML 与展开块之外,仍按 Red Lines 协议以 `FINAL VERDICT: …` 行结尾**(本段只约束展开明细的省略,不改变终态标记要求)。落盘的 closing 总结保留全量明细(人工追溯依赖)。
37
+
36
38
  Return the following YAML to the orchestration layer:
37
39
 
38
40
  ```yaml
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.65.0`
129
+ - Current: `v0.67.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)
@@ -1,6 +1,6 @@
1
1
  # team-flow 使用说明(研发团队版)
2
2
 
3
- > 版本锚点:v0.65.0(28 skills + 17 agents)· 更新日期:2026-09-21
3
+ > 版本锚点:v0.67.0(28 skills + 17 agents)· 更新日期:2026-09-21
4
4
  > 读者:使用 team-flow 做日常研发的工程师。不需要你懂插件内部实现,只需要照着路径走。
5
5
  > 配套文档:安装细节见 [INSTALL.md](../INSTALL.md);状态机细节见 [state-machine.md](state-machine.md);决策点细节见 [decision-points.md](decision-points.md);平台差异见 [platform-matrix.md](platform-matrix.md)。
6
6
 
@@ -70,7 +70,7 @@ npm install -g @xulthekl/team-flow
70
70
  ### 2.2 验证安装
71
71
 
72
72
  ```bash
73
- tf --version # 应输出 0.60.0
73
+ tf --version # 应输出 0.67.0
74
74
  tf doctor # 体检 13 项固定 + 1 项条件:版本一致性 / plugin author / hooks / Codex manifest / skills /
75
75
  # runtime 分发 / dist / Node 版本 / docs / change 状态 / change 测试门禁 / 架构状态 / 复利台账
76
76
  # (末项"配置"仅在仓库根存在 team-flow.config.json 时出现)
@@ -232,14 +232,14 @@ workflow-start 在初始化时自动推断(`tf runtime infer`),你也可
232
232
  tf runtime guard check <change-dir> <from-state> <to-state> [--workflow full|hotfix|tweak]
233
233
  ```
234
234
 
235
- **full 模式的完整转换矩阵**(31 个维度 + 1 个 workflow 限制维度;v0.64.0 增 quick/lightweight/planned 轻路径 11 维):
235
+ **full 模式的完整转换矩阵**(**33 个维度** + 1 个 workflow 限制维度;v0.64.0 增 quick/lightweight/planned 轻路径 11 维;agent-governance P1-1 增 **prd-clarity / history-risk** 接活前双维度——**无记录/INDEX 空的冷启动场景**零行为变化;INDEX 积累丰富的项目 history-risk 命中即阻断,属该维 experimental 设计而非回归):
236
236
 
237
237
  | 转换 | 维度 |
238
238
  |------|------|
239
239
  | exploring→specifying | arch-design、arch-readiness |
240
240
  | specifying→bridging | artifacts-exist、schema-valid |
241
- | bridging→approved-for-build | artifacts-exist、schema-valid、contract-fresh、dp-gate-passed、dp3-approved、**gates-probed**(v0.63.0) |
242
- | approved-for-build→executing | artifacts-exist、contract-fresh、dp-gate-passed、execution-plan-ready、test-matrix-ready |
241
+ | bridging→approved-for-build | artifacts-exist、schema-valid、contract-fresh、dp-gate-passed、dp3-approved、**gates-probed**(v0.63.0)、**prd-clarity**、**history-risk**(P1-1) |
242
+ | approved-for-build→executing | artifacts-exist、contract-fresh、dp-gate-passed、execution-plan-ready、test-matrix-ready、**prd-clarity**、**history-risk**(P1-1) |
243
243
  | **executing→closing** | **11 维**:**contract-fresh(v0.63.0)**、tasks-complete、tests-passing、specs-merged、execution-plan-ready、execution-reviews-passed、compound-captured、test-matrix-complete、arch-snapshot、delegation-status、arch-merged |
244
244
  | executing↔debugging | debugging 入口无门禁;回 executing 挂 contract-fresh、execution-plan-ready |
245
245
  | exploring→bridging / exploring→approved-for-build | 0 维,但**一一对应**:`exploring→bridging` 仅 hotfix 可走、`exploring→approved-for-build` 仅 tweak 可走;full 走或其他组合都直接 FAIL |
@@ -263,6 +263,8 @@ tf runtime guard check <change-dir> <from-state> <to-state> [--workflow full|hot
263
263
  | arch-merged | executing→closing | 架构增量未回写全局台账 → **先跑 `tf arch-merge <change-dir>` 再转换**(v0.53.0 B' 时序);确无增量可回写时 `tf state set <dir> arch_merge_skipped true` + `arch_merge_skip_reason` |
264
264
  | delegation-status | executing→closing | 非 glaf4-delegation 模式直接 PASS;该模式须 `delegation_status=success` |
265
265
  | artifacts-exist / schema-valid | specifying→bridging 起 | 四件套缺失或 Validator 不通过(SHALL/MUST、Scenario、跨段冲突) |
266
+ | prd-clarity | 接活前(bridging→approved / approved→executing,quick/lightweight/planned 前门) | 产品级 PRD 清晰度记录为 fail → 回 S2 重跑 `tf prd check-clarity` 修至 PASS 后重建 change;无记录 = 中性放行(存量/direct/hotfix) |
267
+ | history-risk | 同上(experimental) | solutions INDEX 中**按 change 名词根匹配**的条目 N≥3 且最高 severity=critical → 阻断。**出路(改数据源头,无 state 确认通道)**:① 坑已根治 → 按 compound 退役/降档处理相关条目后重建 INDEX;② 误关联 → 调整 change 名避开词根。N<3 / INDEX 空 / 无匹配 = 中性 |
266
268
 
267
269
  **设计哲学**:门禁硬,但**可豁免的维度都有留痕出口,不可豁免的维度只能改产物**——这点要分清,不要以为万事都能绕:
268
270
 
@@ -752,4 +754,4 @@ tf runtime guard check <change-dir> <from> <to> --json
752
754
 
753
755
  ---
754
756
 
755
- *本文档基于 v0.60.0 源码全量核对产出(2026-09-13 同步)。发现与实际行为不符,请 `/team-flow:workflow-feedback` 反馈——这正是本插件的演进方式。*
757
+ *本文档基于 v0.60.0 源码全量核对产出(2026-09-13 同步),v0.67.0 增量同步 agent-governance 改动(33 维矩阵 / prd-clarity·history-risk 出路 / 复利注入与见习门控,2026-09-25)。发现与实际行为不符,请 `/team-flow:workflow-feedback` 反馈——这正是本插件的演进方式。*
@@ -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) + business-analysis (independent requirement/scenario artifact) + jarvis (team-flow decision agent, opt-in). 28 skills, one install.",
4
- "version": "0.65.0",
4
+ "version": "0.67.0",
5
5
  "contextFileName": "GEMINI.md"
6
6
  }
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env bash
2
- # v0.65.0: auto-sync CLI version with plugin version
2
+ # v0.67.0: 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.65.0"
8
+ PLUGIN_VERSION="0.67.0"
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.65.0.
6
+ Current version: v0.67.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.65.0",
3
+ "version": "0.67.0",
4
4
  "description": "Unified plugin (28 skills + 17 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",
package/plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "team-flow",
3
- "version": "0.65.0",
3
+ "version": "0.67.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) + business-analysis (independent requirement/scenario artifact) + design-system (design tokens + component contract + AI primer + showcase) + test-strategy (test strategy design) + project-initialize (new service onboarding) + jarvis (team-flow decision agent, opt-in). 28 skills + 17 agents, one install.",
5
5
  "author": {
6
6
  "name": "LT"
package/prd/v1/prd.md CHANGED
@@ -24,7 +24,7 @@
24
24
  | L1流程分类 | L2流程分组 | L3业务流程 | L4子流程 | 利益相关 | 价值描述 | 流程名称 | 流程描述 | 变更类型 | 关联系统 | 关联需求编号 | 备注 |
25
25
  |---|---|---|---|---|---|---|---|---|---|---|---|
26
26
  | 研发工作流 | 协作协议层 | TF-COLLAB-001 | / | 开发团队 | 统一 skill 间数据流转和衔接 | Skill 协作协议流程 | 为 17 个 skill 建立声明式 Schema + Handoff 模板协作机制 | 新增 | team-flow plugin | TF-2026-001 | 覆盖四套子系统 |
27
- | 研发工作流 | 协作协议层 | TF-COLLAB-001 | TF-COLLAB-001-S1 | 开发团队 | PRD 产出标准化 | PRD 对齐子流程 | ce-brainstorm 产出 PRD 格式到 prd/vN/prd.md,支持可配置模板 | 新增 | ce-brainstorm skill | TF-2026-001-S1 | Phase 1 交付物 |
27
+ | 研发工作流 | 协作协议层 | TF-COLLAB-001 | TF-COLLAB-001-S1 | 开发团队 | PRD 产出标准化 | PRD 对齐子流程 | ce-brainstorm 产出 PRD 格式到 prd/vN/prd.md,模板可配置 | 新增 | ce-brainstorm skill | TF-2026-001-S1 | Phase 1 交付物 |
28
28
  | 研发工作流 | 协作协议层 | TF-COLLAB-001 | TF-COLLAB-001-S2 | 开发团队 | 工件契约机器可解析 | Schema 协议子流程 | 每个 skill 声明 input/output schema,建立工件契约 | 新增 | 全部 17 个 skill | TF-2026-001-S2 | Phase 2 交付物 |
29
29
  | 研发工作流 | 协作协议层 | TF-COLLAB-001 | TF-COLLAB-001-S3 | 开发团队 | 决策点交互优化 | Handoff + DP 优化子流程 | 标准化 handoff 文件,优化 8 个 DP 信息展示 | 新增 | DP-0 ~ DP-7 | TF-2026-001-S3 | Phase 3 交付物 |
30
30
 
@@ -0,0 +1,132 @@
1
+ // scripts/guard/checks/history-risk.mjs — 变更级历史履历维度(agent-governance P1-1,experimental)
2
+ //
3
+ // 三维路由(风险 × 清晰度 × 履历)的履历维。设计要点(memo §3.2 v0.5 / plan §6 v1.2):
4
+ //
5
+ // 1. **信号方向**:数据源 = compound solutions INDEX(severity 列)+ 条目 frontmatter
6
+ // (confirmations)。`confirmations` 源语义是**复发信号**(每来源 change 升一档 severity,
7
+ // solutions-promote.mjs)——**不得当"履历好"正向分**。本 runner 取
8
+ // 「相关条目最高 severity」作风险信号:复发越重 → severity 越高 → 越阻断。
9
+ //
10
+ // 2. **任务→条目映射**:change_name 分词(去纯数字段/日期段)与 INDEX 的 domain/summary
11
+ // 关键词匹配。词根为空或无匹配 = 无法关联 = 中性(不是低风险判定)。
12
+ //
13
+ // 3. **最小样本规则(反方 I5)**:相关条目 **N < 3 → 中性**——1 条 critical 不得永久压制全域
14
+ // (severity 只升不降 + 退役语义是 compound-lifecycle P2 待决策,恢复路径未建,
15
+ // 故以样本量作压制闸)。N ≥ 3 且最高 severity = critical → **FAIL(强制 HITL)**。
16
+ //
17
+ // 4. **缺失态**:INDEX 不存在 / 空表(本仓冷启动现状)→ 中性 PASS,零行为变化。
18
+ //
19
+ // experimental 绑定行为:命中即阻断(= 强制 HITL)并带 reason 留痕(非纯标签)。
20
+ // 首版为保守方向的有意代价(压制恢复路径待退役语义立项,plan §12)。
21
+ import fs from 'node:fs';
22
+ import path from 'node:path';
23
+
24
+ const MIN_SAMPLE = 3;
25
+ const BLOCK_SEVERITY = 'critical';
26
+ const SEVERITY_ORDER = ['low', 'medium', 'high', 'critical'];
27
+
28
+ /** 自 changeDir 向上定位含 docs/solutions/INDEX.md 的工作区根(限 6 层)。 */
29
+ export function findSolutionsIndex(changeDir) {
30
+ let dir = path.resolve(changeDir);
31
+ for (let i = 0; i < 6; i += 1) {
32
+ const idx = path.join(dir, 'docs', 'solutions', 'INDEX.md');
33
+ if (fs.existsSync(idx)) return idx;
34
+ const parent = path.dirname(dir);
35
+ if (parent === dir) break;
36
+ dir = parent;
37
+ }
38
+ return null;
39
+ }
40
+
41
+ /**
42
+ * 解析 INDEX 表数据行 → [{phase, domain, severity, summary, source}]。
43
+ * 列:| date | phase | domain | type | severity | summary | file | source(可选) |
44
+ */
45
+ export function parseIndexRows(indexText) {
46
+ const rows = [];
47
+ for (const line of indexText.split(/\r?\n/)) {
48
+ if (!line.trim().startsWith('|')) continue;
49
+ const cells = line.split('|').map((c) => c.trim());
50
+ // cells[0] === '',数据列从 index 1 起
51
+ const phase = cells[2] || '';
52
+ const domain = cells[3] || '';
53
+ const severity = (cells[5] || '').toLowerCase();
54
+ const summary = cells[6] || '';
55
+ const source = cells[8] || '';
56
+ if (!phase || phase.toLowerCase() === 'phase') continue; // 表头
57
+ if (/^-+$/.test(phase)) continue; // 分隔行
58
+ if (!severity || !SEVERITY_ORDER.includes(severity)) continue; // 坏行丢弃(与 inject 同策略)
59
+ rows.push({ phase, domain, severity, summary, source });
60
+ }
61
+ return rows;
62
+ }
63
+
64
+ // 通用词黑名单:change 名里的流程词会命中 INDEX 的 source 列(来源 change 名)与
65
+ // 任意 summary(如 'change' 命中一切 source='…-change-…'),造成全表误关联 → N 虚高。
66
+ const GENERIC_WORDS = new Set([
67
+ 'change', 'feature', 'fixing', 'fixed', 'update', 'upgrade', 'release',
68
+ 'version', 'branch', 'story', 'task', 'batch', 'patch', 'review',
69
+ ]);
70
+
71
+ /** change_name → 匹配词根(去数字段/日期段/通用流程词,长度 ≥ 4 的词)。 */
72
+ export function changeKeywords(changeName) {
73
+ return String(changeName || '')
74
+ .split(/[-_\s]+/)
75
+ .filter((w) => w.length >= 4 && !/^\d+$/.test(w) && !GENERIC_WORDS.has(w.toLowerCase()))
76
+ .map((w) => w.toLowerCase());
77
+ }
78
+
79
+ export function checkHistoryRisk(changeDir) {
80
+ const indexFile = findSolutionsIndex(changeDir);
81
+ if (!indexFile) {
82
+ return { pass: true, failures: [], reason: 'no solutions INDEX (neutral — 冷启动)' };
83
+ }
84
+ const rows = parseIndexRows(fs.readFileSync(indexFile, 'utf-8'));
85
+ if (rows.length === 0) {
86
+ return { pass: true, failures: [], reason: 'INDEX empty (neutral — 冷启动)' };
87
+ }
88
+
89
+ const changeName = path.basename(path.resolve(changeDir));
90
+ const keys = changeKeywords(changeName);
91
+ if (keys.length === 0) {
92
+ return { pass: true, failures: [], reason: `no matchable keywords in change name '${changeName}' (neutral)` };
93
+ }
94
+
95
+ const related = rows.filter((r) => {
96
+ const hay = `${r.domain} ${r.summary} ${r.source}`.toLowerCase();
97
+ return keys.some((k) => hay.includes(k));
98
+ });
99
+
100
+ if (related.length < MIN_SAMPLE) {
101
+ return {
102
+ pass: true,
103
+ failures: [],
104
+ reason: `related entries N=${related.length} < ${MIN_SAMPLE} (neutral — 最小样本规则,单条不压制)`,
105
+ };
106
+ }
107
+
108
+ const worst = related.reduce(
109
+ (acc, r) => (SEVERITY_ORDER.indexOf(r.severity) > SEVERITY_ORDER.indexOf(acc) ? r.severity : acc),
110
+ 'low',
111
+ );
112
+
113
+ if (worst === BLOCK_SEVERITY) {
114
+ const samples = related.filter((r) => r.severity === BLOCK_SEVERITY).slice(0, 3)
115
+ .map((r) => `"${r.summary}"`).join('; ');
116
+ return {
117
+ pass: false,
118
+ failures: [
119
+ `history risk: ${related.length} related solution entries (N≥${MIN_SAMPLE}), worst severity=critical — ${samples}.`,
120
+ // 如实声明补救通道(P4 skill-reviewer M3:本维度只读 INDEX 不读 state,无 state 确认落点)
121
+ '出路(均改数据源头,无 state 确认通道):① 坑已根治 → 按 compound 退役/降档流程处理相关条目后重建 INDEX;'
122
+ + '② 误关联(change 名词根撞车)→ 调整 change 名避开匹配。确认前该转换保持阻断(experimental 保守方向的有意代价)。',
123
+ ],
124
+ };
125
+ }
126
+
127
+ return {
128
+ pass: true,
129
+ failures: [],
130
+ reason: `related N=${related.length}, worst severity=${worst} (below block threshold)`,
131
+ };
132
+ }
@@ -0,0 +1,41 @@
1
+ // scripts/guard/checks/prd-clarity-state.mjs — 变更级 PRD 清晰度维度(agent-governance P1-1)
2
+ //
3
+ // 与产品级 `prd-clarity.mjs`(checker 本体,跑在 S2 冻结前)的分工:
4
+ // - 产品级门:对 requirement/vN/prd.md 做机械判定(弱词/段/§8.4 漂移);
5
+ // - 本 runner(变更级):**只读 change state 的记录**(prd_clarity_result),不重跑判定——
6
+ // clarity 跨层管道 = 产品级 `tf prd check-clarity` 落 `.team-flow/prd-clarity.json`
7
+ // → `tf state init` 拷入 change state → 本维度在接活前转换消费。
8
+ //
9
+ // 三态语义(缺失态中性,memo §2.4 / plan §6):
10
+ // - `fail` → **FAIL**(阻断转换 = 强制 HITL):带病 PRD 不得接活;
11
+ // - `pass` → PASS;
12
+ // - 未记录(null;存量 change、绕过产品级的 direct change、hotfix 语义)→ **中性 PASS**,
13
+ // 冷启动零行为变化——缺数据不得判低(全量 HITL)也不得伪造高。
14
+ //
15
+ // 防绕过([[gate-hint-is-a-bypass]]):prd_clarity_result **不在** `tf state set` 白名单
16
+ // (SETTABLE_FIELDS 有意不含)——唯一写入路径 = init 从产品级落盘文件拷贝。
17
+ // 手改 state 的逃生通道由 hook 拦截(非 build 态禁写 .team-flow.yaml)。
18
+ import { readState } from '../../lib/state-loader.mjs';
19
+
20
+ export function checkPrdClarityState(changeDir) {
21
+ const state = readState(changeDir);
22
+ const result = state.prd_clarity_result;
23
+
24
+ if (result === 'fail') {
25
+ return {
26
+ pass: false,
27
+ failures: [
28
+ 'product-level PRD clarity gate recorded FAIL (state.prd_clarity_result=fail) — '
29
+ + '回 S2 重跑 `tf prd check-clarity` 并修 PRD 至 PASS,或重建 change(init 会重新拷贝记录)。',
30
+ ],
31
+ };
32
+ }
33
+ if (result === 'pass') {
34
+ return { pass: true, failures: [], reason: 'prd_clarity_result=pass' };
35
+ }
36
+ return {
37
+ pass: true,
38
+ failures: [],
39
+ reason: 'no clarity record (neutral — 产品级门未覆盖本 change:存量/direct/hotfix)',
40
+ };
41
+ }