@xulthekl/team-flow 0.68.0 → 0.70.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.
@@ -1,3 +1,3 @@
1
- # team-flow v0.68.0 | 阶段: {{state}} | 工作流: {{workflow}}
1
+ # team-flow v0.70.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.68.0",
12
+ "version": "0.70.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.68.0",
3
+ "version": "0.70.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.68.0",
3
+ "version": "0.70.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.68.0"
8
+ "version": "0.70.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.68.0",
5
+ "version": "0.70.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.68.0"
9
+ "version": "0.70.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.68.0",
15
+ "version": "0.70.0",
16
16
  "source": ".",
17
17
  "author": {
18
18
  "name": "LT",
package/CHANGELOG.md CHANGED
@@ -4,6 +4,34 @@ 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.70.0] - 2026-09-30
8
+
9
+ ### Added(glaf4 规范直读通道:非委托路径实施/审查规范注入——来源 = LT 提出「不使用 glaf4-dev 时 glaf4 体系项目无法识别规范指导实施」+ glaf4-spec-direct-read-design v1.2 P1.5 两轮收敛)
10
+
11
+ **核心:sdd/inline/batch-inline/hotfix/tweak/planned(实施面) 及委托降级回退路径下,直读 glaf4-dev 插件 `references/` 编码规范(不落盘)**
12
+ - 新增 `skills/build-executor/references/glaf4-spec-retrieval.md`:十步检索协议(体系判据 → installPath 定位 → 运行时读 `_index.md` → 任务面路由 touched_domains → ≤5 标签/≤3 文档预算 → 双形态注入 → 裁决 → 留痕)+ **体系判据双充分**(walk 全仓 pom 含 `<glaf4.version>`/父 pom `gtmc-glaf4-starter-parent`,或 config 顶层 `glaf4_project:true`;解析失败显式记录不静默)+ 43 标签任务面路由表 + 互斥对优先级清单(6 对,首版)+ 四层裁决链(契约 > 有来源的项目约定 > glaf4 > 通用)+ 违例分级(默认 Important,安全/事务/分层硬规则 Critical)。
13
+ - **五处注入点(规则送到执行者)**:build-executor SKILL(实施主注入,双形态=sdd 子代理 prompt / 其余主会话自注入)、workflow-start planned 步骤 7(planned 不经 build-executor,P3 横展补断链)、code-reviewer SKILL + `code-reviewer-prompt.md` 模板 + `task-reviewer-prompt.md`(审查双路径,v0.57.0 同型事故防线)、clean-code §7 外部框架权威层。
14
+ - **机械守护**:`doc-consistency.test.mjs` 新增 glaf4 断言矩阵(多副本中英锚点含 Critical/≤3 预算、双形态措辞、planned 断链锚、路由表标签 ⊆ `tests/fixtures/glaf4-references-index-0.6.2.md` 基准夹具 43 标签、clean-code 层级句);反向验证通过(移除注入段 → 2 红,恢复 → 全绿)。
15
+ - **边界(设计 §4.5)**:quick/direct、lightweight 前门与 planned 审查面留 Roadmap(P2-74/75/76);`references/packs/` 不在路由范围;与委托路径(glaf4-delegation)完全正交。
16
+ - P1.5 标准档两轮对抗验证(3+2 独立代理,R1 3C/12M/7m + R2 1C/11M/5m 全处置)+ 收官定点复验 0 Critical;P3 三发现(planned 断链/glaf4_project 键名/断言补全);P4 双门禁(validator PASS_WITH_WARNINGS 0C / skill-reviewer PASS_WITH_WARNINGS 0C+1M+6m 修复后过);`npm test` 1437→**1446**。
17
+
18
+ ## [0.69.0] - 2026-09-30
19
+
20
+ ### Added(mermaid 语法快速验证:最小闭环——脚本 + 双 reviewer 接入 + 仓库回归;来源 = LT 实测 PRD mermaid 渲染失败)
21
+
22
+ **验证脚本(唯一实现)**
23
+ - 新增 `scripts/validate-mermaid.mjs`:提取 md 中全部 ```mermaid fence → `mermaid.parse()` 逐个校验(jsdom 提供 DOM,单图 <20ms)。四态契约与 `tf prd check-clarity` 同构 + 用法错误参照其 exit 2 惯例:`STATUS: PASS`(exit 0)/ `FAIL`(exit 1,stdout 必带 `file:line`)/ `SKIP`(exit 0,**仅限**依赖不可用且安装失败——LT 裁定「先尝试安装、装败才降级」)/ `ERROR`(exit 2,用法错误:无参数/路径不存在/传入目录)。顶层异常兜底保证任何场景必有 STATUS 行。
24
+ - **依赖策略**:`mermaid ^12.0.0` + `jsdom ^26.0.0` 入 `dependencies`(用户装插件即带上);运行时缺依赖 → 先 `npm install`(限时 90s)→ 装败才 WARN 降级 SKIP。
25
+ - **实现陷阱(脚本头注已记)**:Node 同进程内失败的 dynamic import 会缓存为失败(实测安装后重试无效)——必须先 `createRequire` 文件系统级 resolve 探测(不进 ESM 缓存),装完再 import。
26
+
27
+ **Reviewer 接入(判级:语法错误 = 机械客观缺陷,Critical)**
28
+ - `agents/prd-completeness-reviewer.md`:Phase 1 新增第 3 步 mermaid 机械校验(FAIL=Critical 挂 D6 名下;SKIP=依赖降级不判级;ERROR/无 STATUS=环境错误不判级、不造 Critical);Phase 2 步骤 3-8 顺延 4-9;6 维清单 D6 行补 (c) mermaid 归属;FAIL 判据扩展;报告模板增 `Mermaid check` Metadata + D6-(c) 占位;「回 Phase 1.3」歧义改写为「回 ce-brainstorm Phase 1.3/Phase 3」。
29
+ - `agents/architecture-reviewer.md`:Phase 1 新增第 4 步 mermaid 机械校验(A1 名下,Critical;路径基于 Inputs 的 `${architecture_dir}`/`${product_snapshot_path}` 拼接,防相对 cwd 假 Critical;domains/ 用 `--dir` 单独跑);Phase 2 步骤 4-6 顺延 5-7;A1 维度行与报告 Metadata 同步。
30
+
31
+ **测试(`npm test` 1419 → 1437)**
32
+ - 新增 `tests/lib/validate-mermaid.test.mjs`(18 测试):fence 提取(含未闭合/非 mermaid fence 不误提)/ ensureDeps 降级路径注入(禁装/装败/装成三态)/ 正负例对照(坏图必须 FAIL、好图必须 PASS)/ CLI 四态 exit code / **skills/ 全量目录扫描回归**(存量 5 fence 基线,新增 fence 文件自动纳管,非硬编码清单)。
33
+ - 评审:plugin-validator PASS(0C+3W)、skill-reviewer PASS_WITH_WARNINGS(0C+3M+7m),全部发现已修复后收口。
34
+
7
35
  ## [0.68.0] - 2026-09-30
8
36
 
9
37
  ### Added(security-baseline 企业安全基线集成:四层全量落地;设计 = 工作区 `docs/plan/security-baseline-integration-design.md` v1.3 + P3 修正,P1.5 完整档三轮闭合 0 Critical)
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.68.0 | 阶段: {{state}} | 工作流: {{workflow}}
11
+ # team-flow v0.70.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.68.0**。
10
+ 当前发布版本:**v0.70.0**。
11
11
 
12
12
  ---
13
13
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # team-flow
2
2
 
3
- > 当前版本:`v0.68.0`
3
+ > 当前版本:`v0.70.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
 
@@ -50,7 +50,7 @@ If change_brief_path or architecture_dir is missing or unreadable **in change mo
50
50
 
51
51
  | Dim | Name | Baseline Source | Check Content | Severity |
52
52
  |-----|------|----------------|---------------|----------|
53
- | A1 | 产出完整性 | architecture-design 结构化输出 | `architecture.md` / `database.md` / `api.md` 文件存在且非空 | Critical |
53
+ | A1 | 产出完整性 | architecture-design 结构化输出 | `architecture.md` / `database.md` / `api.md` 文件存在且非空 + 内含 mermaid fence 语法可 parse(Phase 1 第 4 步机械校验) | Critical |
54
54
  | A2 | SQL 制品完整性 | `database.md` 中引用的 SQL 路径 | `sql/ddl/*.sql` / `sql/migration/*.sql` 文件存在且语法可检查 | Critical |
55
55
  | A3 | 模板合规性 | `architecture-design/templates/` | 产出文件结构与模板一致(YAML frontmatter + 必要章节) | Important |
56
56
  | A4 | 需求覆盖 | change-brief + plan | 每个业务需求 → 对应的架构设计覆盖(聚合/BC/API/DB) | Critical |
@@ -84,11 +84,21 @@ Mechanical verification, no LLM semantic judgment needed:
84
84
  - api.md → templates/api.md (sections: Command, Read, Query, frontmatter api_contract_manager)
85
85
  - Missing required section = Important finding
86
86
 
87
+ 4. **Mermaid 图语法机械校验(v0.69.0,A1 名下)**:
88
+ - `node ${CLAUDE_PLUGIN_ROOT}/scripts/validate-mermaid.mjs <文件列表>`(**路径基于 Inputs 传入的目录参数拼接,不是相对 cwd 的字面路径**——传错路径脚本会 `STATUS: ERROR` exit 2,将产生假 Critical/假评审失败):
89
+ - change 模式:`${architecture_dir}/architecture.md ${architecture_dir}/database.md ${architecture_dir}/api.md`(三件套逐文件显式传入;**不要**把目录本身传给脚本)
90
+ - product 模式:`${product_snapshot_path}` 单文件;`domains/` 下多个 .md 用 `--dir <domains目录>` **单独再跑一次**
91
+ - 脚本自带依赖自愈(缺则先装、装败降级,安装最多阻塞约 90s——依赖装入插件包 node_modules,不触碰审查制品,不违反 Iron Law)
92
+ - 末行 `STATUS: FAIL`(exit 1)→ 每个 `file:line` 命中 = **Critical finding**(架构图含 mermaid(context map/时序/状态/ER),语法错误渲染必失败;附行号与 parse 错误)。**FAIL 但 stdout 无任何 `file:line` 命中 = 异常输出,按环境错误处理,不得凭空造 Critical。**
93
+ - 末行 `STATUS: SKIP` → 依赖降级(缺依赖且安装失败),不判级,报告 Metadata 记 `Mermaid check: SKIPPED(依赖不可用)`;不得因 SKIP 判 FAIL
94
+ - 末行 `STATUS: PASS` → 记 `Mermaid check: PASS (n fences)`
95
+ - 末行 `STATUS: ERROR`(exit 2,用法错误:路径不对/传了目录)**或无 STATUS 行**(脚本不存在/崩溃)→ **环境错误,不判级**:Metadata 记 `Mermaid check: ERROR (<原因>)`,会话输出通道向派发方提一行(如 `${CLAUDE_PLUGIN_ROOT} 未解析`);不得记为 SKIPPED,不得判 FAIL
96
+
87
97
  ### Phase 2: Deep-check (LLM Semantic Comparison, A4/A5/A6)
88
98
 
89
99
  Dimensions requiring semantic understanding, marked as "advisory, false positives can be overridden":
90
100
 
91
- 4. **A4 需求覆盖** (v0.29.0 §37 增强:双对照源 + 子实体 CRUD 检查):
101
+ 5. **A4 需求覆盖** (v0.29.0 §37 增强:双对照源 + 子实体 CRUD 检查):
92
102
  - **对照源 1(现有)**:Read change-brief.md → extract all requirement items (scope, AC, technical direction)
93
103
  - **对照源 2(v0.29.0 新增)**:Read `requirement/vN/prd.md` → extract feature list (e.g., F001_P0_P1 ~ P0_PN)
94
104
  - Read plan.md → extract relevant technical design sections
@@ -107,7 +117,7 @@ Dimensions requiring semantic understanding, marked as "advisory, false positive
107
117
  - Uncovered requirement = Critical finding
108
118
  - Build coverage matrix table (MUST include columns for both brief source AND PRD source)
109
119
 
110
- 5. **A5 基线一致性**:
120
+ 6. **A5 基线一致性**:
111
121
  - Read global `ARCHITECTURE.md` → check naming conventions, BC boundaries
112
122
  - Read global `PHYSICAL-MODEL.md` → check table naming patterns, field conventions
113
123
  - Read global `API-INDEX.md` → check API routing patterns
@@ -118,7 +128,7 @@ Dimensions requiring semantic understanding, marked as "advisory, false positive
118
128
  - API endpoint conflicts with API-INDEX → Critical
119
129
  - BC boundary contradictions → Critical
120
130
 
121
- 6. **A6 conventions 合规**:
131
+ 7. **A6 conventions 合规**:
122
132
  - Read `team-flow.config.json` → `conventions` section
123
133
  - Load applicable convention files:
124
134
  - `conventions.database` → check DB naming rules, primary key strategy, audit fields
@@ -156,6 +166,7 @@ Aggregate all findings and determine verdict.
156
166
  - **Change Brief**: {change_brief_path}
157
167
  - **Architecture Dir**: {architecture_dir}
158
168
  - **Global Arch Dir**: {global_arch_dir}
169
+ - **Mermaid check**: {PASS (n fences) | FAIL (n errors) | SKIPPED(依赖不可用) | ERROR (&lt;原因&gt;)}
159
170
  - **Review round**: {N}
160
171
  - **Reviewer**: architecture-reviewer agent (independent)
161
172
  - **Timestamp**: {ISO 8601}
@@ -41,7 +41,7 @@ If `prd_path` is missing or unreadable, report `FAIL` with reason `INPUT_ERROR`.
41
41
  | D3 | 边界与非功能 | 空/错/异常状态、性能/兼容约束 | Important |
42
42
  | D4 | 术语一致性 | 与 CONCEPTS.md / §6 业务术语一致 | Minor |
43
43
  | D5 | 范围闭环 | in/out scope 明确,无悬空功能 | Important |
44
- | D6 | §8.4 信息齐备性与业务可读形态 | **(a)信息齐备性**:逐功能模块核对业务信息是否**可定位**(不核对"正文里有没有该维度标题");§7↔§8.4 交叉核对无悬空功能。**(b)形态核验(v0.62.0 G7)**:按 6 条判据核验产出形态是否符合规范(见下方 D6 执行细则)。**基准 = `prd-84-authoring-spec.md`(唯一权威,不是模板 §8.4)** | Critical(核心信息缺失 / 悬空功能)/ Important(辅助信息缺失、**形态核验命中**) |
44
+ | D6 | §8.4 信息齐备性与业务可读形态 | **(a)信息齐备性**:逐功能模块核对业务信息是否**可定位**(不核对"正文里有没有该维度标题");§7↔§8.4 交叉核对无悬空功能。**(b)形态核验(v0.62.0 G7)**:按 6 条判据核验产出形态是否符合规范(见下方 D6 执行细则)。**(c)mermaid fence 语法机械校验(Phase 1 第 3 步)**:parse 失败 = Critical。**基准 = `prd-84-authoring-spec.md`(唯一权威,不是模板 §8.4)** | Critical(核心信息缺失 / 悬空功能 / mermaid 语法错误)/ Important(辅助信息缺失、**形态核验命中**) |
45
45
 
46
46
  ## Review Process
47
47
 
@@ -49,33 +49,38 @@ If `prd_path` is missing or unreadable, report `FAIL` with reason `INPUT_ERROR`.
49
49
 
50
50
  1. Read the PRD fully. Locate the functional requirement sections (用户故事 / 功能清单 / 系统功能), acceptance criteria, scope (in/out), and glossary (§6 业务术语).
51
51
  2. Use `grep` to enumerate requirement items and check for the presence of AC markers / actor markers / scope markers — this grounds the per-item review.
52
+ 3. **Mermaid 语法机械校验(v0.69.0)**:`node ${CLAUDE_PLUGIN_ROOT}/scripts/validate-mermaid.mjs <prd_path>`(脚本自带依赖自愈:缺则先装、装败降级,安装最多阻塞约 90s——依赖装入插件包 node_modules,不触碰任何评审制品,不违反 Iron Law)。
53
+ - 末行 `STATUS: FAIL`(exit 1)→ 每个 `file:line` 命中记 **Critical**(D6 名下,描述注明「mermaid 语法错误,渲染必失败」,附行号与 parse 错误)——语法失败是机械判定的客观缺陷,非语义裁量,无误报面。**FAIL 但 stdout 无任何 `file:line` 命中 = 异常输出,按下方环境错误处理,不得凭空造 Critical。**
54
+ - 末行 `STATUS: SKIP` → 依赖降级(缺依赖且安装失败),**不判级**,在报告 Metadata 记 `Mermaid check: SKIPPED(依赖不可用)`;不得因 SKIP 判 FAIL。
55
+ - 末行 `STATUS: PASS` → 记 `Mermaid check: PASS (n fences)`,无 finding。
56
+ - 末行 `STATUS: ERROR`(exit 2,用法错误:路径不对/传了目录)**或无 STATUS 行**(脚本不存在/崩溃)→ **环境错误,不判级**:Metadata 记 `Mermaid check: ERROR (<原因>)`,同时在会话输出通道向派发方提一行(如 `${CLAUDE_PLUGIN_ROOT} 未解析`);不得记为 SKIPPED(依赖问题),不得判 FAIL。
52
57
 
53
58
  ### Phase 2: Per-Dimension Deep Check(LLM 语义判断)
54
59
 
55
- 3. **D1 用户故事完整性**(Critical):For each functional requirement, check it has:
60
+ 4. **D1 用户故事完整性**(Critical):For each functional requirement, check it has:
56
61
  - **actors**(谁触发/谁参与)— explicit or unambiguously inferable
57
62
  - **流程**(关键步骤/交互路径)
58
63
  - **结果**(完成态/输出/系统响应)
59
64
  Missing any of the three for a requirement = Critical finding (cite §X.X + requirement id).
60
65
 
61
- 4. **D2 验收标准**(Critical):For each functional requirement, check there is at least one **verifiable** acceptance criterion or success signal (testable condition, observable outcome, measurable threshold).
66
+ 5. **D2 验收标准**(Critical):For each functional requirement, check there is at least one **verifiable** acceptance criterion or success signal (testable condition, observable outcome, measurable threshold).
62
67
  - AC present but vague/unverifiable ("系统应表现良好") = Critical.
63
68
  - AC entirely missing = Critical.
64
69
 
65
- 5. **D3 边界与非功能**(Important):Check whether the PRD addresses:
70
+ 6. **D3 边界与非功能**(Important):Check whether the PRD addresses:
66
71
  - 边界状态:空态 / 错误态 / 异常 / 并发 / 极值
67
72
  - 非功能约束:性能 / 兼容性 / 安全 / 可用性(where relevant to the product)
68
73
  Missing edge-state coverage for a core flow, or no non-functional constraints where they clearly matter = Important.
69
74
 
70
- 6. **D4 术语一致性**(Minor):Compare terms used in the PRD against CONCEPTS.md (if provided) and the PRD's own §6 业务术语. Same concept named differently, or undefined jargon used = Minor.
75
+ 7. **D4 术语一致性**(Minor):Compare terms used in the PRD against CONCEPTS.md (if provided) and the PRD's own §6 业务术语. Same concept named differently, or undefined jargon used = Minor.
71
76
 
72
- 7. **D5 范围闭环**(Important):
77
+ 8. **D5 范围闭环**(Important):
73
78
  - in scope and out scope explicitly declared?
74
79
  - Any "悬空功能" — a feature mentioned in scope but with no actors/AC/implementation path (dangling)?
75
80
  - Any out-of-scope item that other requirements implicitly depend on?
76
81
  Missing scope declaration or dangling feature = Important.
77
82
 
78
- 8. **D6 §8.4 信息齐备性与业务可读形态**:Read the **spec file** FIRST — `spec_path`
83
+ 9. **D6 §8.4 信息齐备性与业务可读形态**:Read the **spec file** FIRST — `spec_path`
79
84
  (默认 `${CLAUDE_PLUGIN_ROOT}/skills/ce-brainstorm/references/prd-84-authoring-spec.md`)
80
85
  is the **single authority**——never judge against your own expectations,
81
86
  and never against the template skeleton(模板只承载骨架与槽位).
@@ -123,9 +128,9 @@ Aggregate findings → final verdict per the Judgment Criteria.
123
128
  |---------|-----------|--------|
124
129
  | **PASS** | Critical=0 且 Important=0 | 可进入冻结 / 下游 plan |
125
130
  | **PASS_WITH_WARNINGS** | Critical=0 且 Important>0 | 警告项交人工裁定,不阻断 |
126
- | **FAIL** | Critical>0 | 必须回 Phase 1.3/Phase 3 补充后重新评审 |
131
+ | **FAIL** | Critical>0 | 必须回 ce-brainstorm Phase 1.3(澄清)/ Phase 3(撰写)补充后重新评审——注意是 ce-brainstorm 的阶段号,非本 agent 的 Phase 编号 |
127
132
 
128
- **FAIL 仅由 Critical 触发**(D1/D2 缺失;D6 核心维度缺失、D6 悬空功能)。Important(D3/D5/D6 辅助维度)误报不触发 FAIL。Minor(D4/D6 可读性)仅记录。
133
+ **FAIL 仅由 Critical 触发**(D1/D2 缺失;D6 核心维度缺失、D6 悬空功能;D6 mermaid 语法错误——Phase 1 第 3 步机械判定)。Important(D3/D5/D6 辅助维度)误报不触发 FAIL。Minor(D4/D6 可读性)仅记录。
129
134
 
130
135
  ## Output Format
131
136
 
@@ -139,6 +144,7 @@ Aggregate findings → final verdict per the Judgment Criteria.
139
144
  ## Metadata
140
145
  - **PRD**: {prd_path}
141
146
  - **CONCEPTS**: {concepts_path or "N/A"}
147
+ - **Mermaid check**: {PASS (n fences) | FAIL (n errors) | SKIPPED(依赖不可用) | ERROR (&lt;原因&gt;)}
142
148
  - **Review round**: {N}
143
149
  - **Reviewer**: prd-completeness-reviewer agent (independent)
144
150
  - **Timestamp**: {ISO 8601}
@@ -184,6 +190,9 @@ Aggregate findings → final verdict per the Judgment Criteria.
184
190
  | 6 维度清单未写入正文 | {是/否} | {Important/—} | |
185
191
  [逐功能模块检查:功能形态 | 适用维度覆盖 | NA 标注 | 悬空功能 | 状态]
186
192
 
193
+ #### D6-(c) Mermaid 语法机械校验(Phase 1 第 3 步)
194
+ {PASS (n fences) | FAIL (n errors,逐条 file:line + parse 错误) | SKIPPED(依赖不可用) | ERROR (&lt;原因&gt;)}
195
+
187
196
  ## Findings
188
197
  | # | Dim | Severity | PRD Source | Requirement | Description | Suggestion |
189
198
  |---|-----|----------|-----------|-------------|-------------|------------|
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.68.0`
129
+ - Current: `v0.70.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.68.0(28 skills + 17 agents)· 更新日期:2026-09-21
3
+ > 版本锚点:v0.70.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
 
@@ -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.68.0",
4
+ "version": "0.70.0",
5
5
  "contextFileName": "GEMINI.md"
6
6
  }
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env bash
2
- # v0.68.0: auto-sync CLI version with plugin version
2
+ # v0.70.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.68.0"
8
+ PLUGIN_VERSION="0.70.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.68.0.
6
+ Current version: v0.70.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.68.0",
3
+ "version": "0.70.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",
@@ -50,5 +50,9 @@
50
50
  "devDependencies": {
51
51
  "js-yaml": "^5.2.3",
52
52
  "typescript": "^6.0.3"
53
+ },
54
+ "dependencies": {
55
+ "mermaid": "^12.0.0",
56
+ "jsdom": "^26.0.0"
53
57
  }
54
58
  }
package/plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "team-flow",
3
- "version": "0.68.0",
3
+ "version": "0.70.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"
@@ -0,0 +1,240 @@
1
+ #!/usr/bin/env node
2
+ // scripts/validate-mermaid.mjs — Markdown 内 ```mermaid 围栏语法快速验证
3
+ //
4
+ // 背景(2026-09-30,LT 提出):实际用 team-flow 产 PRD 时 mermaid 语法错误导致无法渲染。
5
+ // 仓库此前无任何 mermaid 校验(lint 6 规则 / validate-artifacts / 模板测试均只查存在性正则)。
6
+ //
7
+ // 用法:
8
+ // node scripts/validate-mermaid.mjs <file.md> [more.md ...]
9
+ // node scripts/validate-mermaid.mjs --dir <dir> # 递归扫描目录下全部 .md
10
+ //
11
+ // 输出约定(与 `tf prd check-clarity` 同构 + 用法错误参照其 exit 2 惯例):
12
+ // 逐 fence 报告 `file:line: <错误>`;末行 `STATUS: PASS | FAIL | SKIP | ERROR`。
13
+ // PASS → exit 0(全部 fence 可 parse,或无 fence);
14
+ // FAIL → exit 1(语法错误,stdout 必带 file:line 命中——调用方按行号记 finding);
15
+ // SKIP → exit 0(**仅限**依赖不可用且安装失败——按 LT 裁定降级不阻断,显眼告警);
16
+ // ERROR → exit 2(**调用方用法错误**:无参数 / 路径不存在 / 传入目录 / 脚本自身异常——
17
+ // 不是依赖问题,调用方应报环境错误,不得记为 SKIP 依赖降级)。
18
+ //
19
+ // 依赖策略(LT 2026-09-30 裁定):
20
+ // 1. mermaid + jsdom 声明在 package.json dependencies(用户装插件即带上);
21
+ // 2. 运行时缺依赖 → 先尝试 `npm install`(限时)→ 成功则继续;
22
+ // 3. 安装仍失败 → WARN 降级:`STATUS: SKIP` + exit 0,不阻断主流程。
23
+ //
24
+ // 实现要点:
25
+ // - **先 createRequire resolve 再 import**:Node 同进程内失败的 dynamic import 会被
26
+ // 缓存为失败(实测 ERR_MODULE_NOT_FOUND 重试无效),所以绝不能"先 import 失败再装再
27
+ // import"——必须用文件系统级 resolve 探测(不进 ESM 缓存),装完后 import 必成功。
28
+ // - jsdom 提供最小 DOM(mermaid.parse 需要 document/window),实测单图 parse <20ms。
29
+ // - parse 错误信息含 mermaid 内部行号(相对 fence),输出时换算为 md 文件绝对行号。
30
+
31
+ import { readFileSync, readdirSync, statSync, existsSync } from 'node:fs';
32
+ import { join, resolve, dirname, relative } from 'node:path';
33
+ import { fileURLToPath } from 'node:url';
34
+ import { createRequire } from 'node:module';
35
+ import { spawnSync } from 'node:child_process';
36
+
37
+ const __dirname = dirname(fileURLToPath(import.meta.url));
38
+ const PKG_ROOT = resolve(__dirname, '..');
39
+ const require = createRequire(import.meta.url);
40
+ const INSTALL_TIMEOUT_MS = 90_000;
41
+
42
+ /**
43
+ * 提取 md 文本中全部 ```mermaid 围栏。
44
+ * 返回 [{ startLine (fence 行, 1-based), content, contentStartLine }]。
45
+ * 不支持嵌套 fence(mermaid 内容本身不含 ```),标准围栏配对即可。
46
+ */
47
+ export function extractMermaidFences(text) {
48
+ const lines = text.split(/\r?\n/);
49
+ const fences = [];
50
+ let cur = null;
51
+ for (let i = 0; i < lines.length; i++) {
52
+ const line = lines[i];
53
+ if (!cur && /^\s*```mermaid\s*$/.test(line)) {
54
+ cur = { startLine: i + 1, buf: [], contentStartLine: i + 2 };
55
+ } else if (cur && /^\s*```\s*$/.test(line)) {
56
+ fences.push({ startLine: cur.startLine, contentStartLine: cur.contentStartLine, content: cur.buf.join('\n') });
57
+ cur = null;
58
+ } else if (cur) {
59
+ cur.buf.push(line);
60
+ }
61
+ }
62
+ if (cur) {
63
+ // 未闭合 fence:也算一个待校验项(mermaid.parse 会因缺尾部语法报错,或直接标 ERROR)
64
+ fences.push({ startLine: cur.startLine, contentStartLine: cur.contentStartLine, content: cur.buf.join('\n'), unclosed: true });
65
+ }
66
+ return fences;
67
+ }
68
+
69
+ /**
70
+ * 依赖探测 + 按需安装。返回 { ok: true } 或 { ok: false, reason }。
71
+ * 用 resolve 而非 import 做探测(见文件头注:失败 import 会污染同进程 ESM 缓存)。
72
+ */
73
+ export function ensureDeps({ allowInstall = true, timeoutMs = INSTALL_TIMEOUT_MS, installer = defaultInstall, resolvelike = defaultResolve } = {}) {
74
+ if (resolvelike()) return { ok: true };
75
+ if (!allowInstall) return { ok: false, reason: 'mermaid/jsdom 未安装(安装被禁用)' };
76
+
77
+ process.stderr.write('[validate-mermaid] mermaid/jsdom 缺失,尝试安装...\n');
78
+ const r = installer(timeoutMs);
79
+ if (r.error || r.status !== 0) {
80
+ const why = r.error ? r.error.message : `npm exit ${r.status}: ${(r.stderr || '').trim().split('\n').slice(-3).join(' | ')}`;
81
+ return { ok: false, reason: `依赖安装失败:${why}` };
82
+ }
83
+ return resolvelike()
84
+ ? { ok: true }
85
+ : { ok: false, reason: 'npm install 完成但依赖仍不可 resolve' };
86
+ }
87
+
88
+ /** 默认依赖探测:文件系统级 resolve(不进 ESM import 缓存——见文件头注)。 */
89
+ function defaultResolve() {
90
+ try {
91
+ require.resolve('mermaid');
92
+ require.resolve('jsdom');
93
+ return true;
94
+ } catch {
95
+ return false;
96
+ }
97
+ }
98
+
99
+ /** 默认安装器:在插件包根执行 npm install。 */
100
+ function defaultInstall(timeoutMs) {
101
+ return spawnSync('npm', ['install', '--no-audit', '--no-fund', '--loglevel=error'], {
102
+ cwd: PKG_ROOT,
103
+ timeout: timeoutMs,
104
+ encoding: 'utf8',
105
+ });
106
+ }
107
+
108
+ /** 初始化 mermaid 解析运行时(jsdom DOM + mermaid.initialize)。仅在 ensureDeps ok 后调用。导出供测试复用——进程内 parse 必须先有 DOM,否则恒报错(假绿风险)。 */
109
+ export async function initRuntime() {
110
+ const { JSDOM } = await import('jsdom');
111
+ const dom = new JSDOM('<!DOCTYPE html><body></body>', { pretendToBeVisual: true });
112
+ if (!globalThis.window) globalThis.window = dom.window;
113
+ if (!globalThis.document) globalThis.document = dom.window.document;
114
+ try {
115
+ Object.defineProperty(globalThis, 'navigator', { value: dom.window.navigator, configurable: true });
116
+ } catch { /* Node >=21 navigator 只读,已有值则忽略 */ }
117
+ const mermaid = (await import('mermaid')).default;
118
+ mermaid.initialize({ startOnLoad: false, securityLevel: 'loose' });
119
+ return mermaid;
120
+ }
121
+
122
+ /** 把 mermaid parse 错误信息里的相对行号换算为 md 绝对行号。 */
123
+ function reline(msg, contentStartLine) {
124
+ const m = /on line (\d+)/.exec(msg);
125
+ if (!m) return contentStartLine;
126
+ return contentStartLine + (parseInt(m[1], 10) - 1);
127
+ }
128
+
129
+ /**
130
+ * 校验单个 md 文件。返回 { file, fenceCount, errors: [{ line, message }], skipped? }。
131
+ * deps.ok=false 时返回 skipped 态(不读文件不 parse)。
132
+ */
133
+ export async function validateFile(mdPath, mermaid) {
134
+ const text = readFileSync(mdPath, 'utf8');
135
+ const fences = extractMermaidFences(text);
136
+ const errors = [];
137
+ for (const f of fences) {
138
+ if (!f.content.trim()) {
139
+ if (f.unclosed) errors.push({ line: f.startLine, message: 'mermaid fence 未闭合' });
140
+ else errors.push({ line: f.startLine, message: 'mermaid fence 为空' });
141
+ continue;
142
+ }
143
+ try {
144
+ await mermaid.parse(f.content);
145
+ } catch (e) {
146
+ const raw = String(e?.message || e).split('\n').filter(Boolean)[0] || 'parse error';
147
+ errors.push({ line: reline(raw, f.contentStartLine), message: raw, mermaidLine: (/on line (\d+)/.exec(raw)?.[1]) });
148
+ }
149
+ if (f.unclosed) errors.push({ line: f.startLine, message: 'mermaid fence 未闭合' });
150
+ }
151
+ return { file: mdPath, fenceCount: fences.length, errors };
152
+ }
153
+
154
+ function collectMdFiles(dir, out = []) {
155
+ for (const name of readdirSync(dir)) {
156
+ if (name === 'node_modules' || name.startsWith('.')) continue;
157
+ const p = join(dir, name);
158
+ const st = statSync(p);
159
+ if (st.isDirectory()) collectMdFiles(p, out);
160
+ else if (name.endsWith('.md')) out.push(p);
161
+ }
162
+ return out;
163
+ }
164
+
165
+ async function main() {
166
+ const args = process.argv.slice(2);
167
+ const files = [];
168
+ // 用法错误统一 STATUS: ERROR + exit 2(区别于 SKIP=依赖降级 exit 0——
169
+ // 混用会让调用方把"路径没传对"误记成"依赖不可用",门检查不到)
170
+ const usageError = (msg) => {
171
+ console.error(msg);
172
+ console.error('Usage: node scripts/validate-mermaid.mjs <file.md> [...] | --dir <dir>');
173
+ console.log('STATUS: ERROR');
174
+ process.exit(2);
175
+ };
176
+ if (args.length === 0) usageError('no arguments');
177
+ if (args[0] === '--dir') {
178
+ if (!args[1]) usageError('--dir requires a path');
179
+ if (!existsSync(args[1])) usageError(`dir not found: ${args[1]}`);
180
+ if (!statSync(args[1]).isDirectory()) usageError(`not a directory: ${args[1]}`);
181
+ files.push(...collectMdFiles(resolve(args[1])));
182
+ } else {
183
+ for (const a of args) {
184
+ if (!existsSync(a)) usageError(`file not found: ${a}`);
185
+ if (statSync(a).isDirectory()) usageError(`is a directory (use --dir): ${a}`);
186
+ files.push(resolve(a));
187
+ }
188
+ }
189
+
190
+ // 1) 依赖:缺则先装,装不上才降级(LT 裁定)
191
+ const deps = ensureDeps();
192
+ if (!deps.ok) {
193
+ process.stderr.write(`⚠️ [validate-mermaid] ${deps.reason} —— mermaid 校验跳过(WARN 降级,不阻断)\n`);
194
+ console.log('STATUS: SKIP');
195
+ process.exit(0);
196
+ }
197
+
198
+ // 2) 运行时(此时尚未 import mermaid/jsdom,ESM 缓存干净)
199
+ let mermaid;
200
+ try {
201
+ mermaid = await initRuntime();
202
+ } catch (e) {
203
+ process.stderr.write(`⚠️ [validate-mermaid] 运行时初始化失败:${String(e?.message || e)} —— mermaid 校验跳过\n`);
204
+ console.log('STATUS: SKIP');
205
+ process.exit(0);
206
+ }
207
+
208
+ // 3) 逐文件校验(0-fence 文件不逐行打印,防目录扫描刷屏;汇总行给出计数)
209
+ let fenceTotal = 0;
210
+ let errorTotal = 0;
211
+ let filesWithFences = 0;
212
+ for (const f of files) {
213
+ const r = await validateFile(f, mermaid);
214
+ fenceTotal += r.fenceCount;
215
+ if (r.fenceCount === 0 && r.errors.length === 0) continue;
216
+ filesWithFences++;
217
+ const rel = relative(process.cwd(), r.file) || r.file;
218
+ if (r.errors.length === 0) {
219
+ console.log(` ✅ ${rel} (${r.fenceCount} fence)`);
220
+ } else {
221
+ errorTotal += r.errors.length;
222
+ for (const err of r.errors) console.log(` ❌ ${rel}:${err.line}: ${err.message}`);
223
+ }
224
+ }
225
+ if (filesWithFences === 0) console.log(' (no mermaid fences found)');
226
+ console.log(`fences: ${fenceTotal} | errors: ${errorTotal} | files: ${files.length} (${filesWithFences} with fences)`);
227
+ console.log(`STATUS: ${errorTotal > 0 ? 'FAIL' : 'PASS'}`);
228
+ process.exit(errorTotal > 0 ? 1 : 0);
229
+ }
230
+
231
+ // 直接执行时跑 main;被 import(测试)时不跑。
232
+ // 顶层兜底:任何未捕获异常也必须输出 STATUS 行——否则调用方(agent)连
233
+ // "出错"都感知不到,只会看到无 STATUS 的裸异常输出(评审 skill-reviewer M3)。
234
+ if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
235
+ main().catch((e) => {
236
+ console.error(`unexpected error: ${String(e?.stack || e)}`);
237
+ console.log('STATUS: ERROR');
238
+ process.exit(2);
239
+ });
240
+ }
@@ -28,6 +28,10 @@ Check workflow mode first: `tf state get <change-dir> workflow`. If `tweak` →
28
28
  - 按 phase 过滤:`backend` / `api`
29
29
  - 注入为实施约束(代码产出时遵循)
30
30
 
31
+ **glaf4 编码规范注入(glaf4-spec-direct-read-design v1.2,非委托路径)**:
32
+ - 仅当 `execution_mode != glaf4-delegation`(委托 run 自带规范通道)时执行。实施前 Read `references/glaf4-spec-retrieval.md` 并按其十步协议执行:体系判据(pom walk / 显式键)→ 定位插件 `references/_index.md` → 按任务面推断 touched_domains → 取命中文档(≤5 标签/≤3 文档)注入**实际执行者上下文**(sdd=子代理 prompt;inline/hotfix/tweak/planned=主会话自注入)→ 报告留痕(version+标签+文档清单)。
33
+ - 体系判据不成立 → 本通道静默跳过;插件不可用 / 判据无法解析 → 显式记录后降级,不静默。裁决链与违例分级见该 reference §3/§4(与契约/项目 conventions 冲突时以契约为准并回报登记)。
34
+
31
35
  Branch/worktree preflight before ANY implementation edit (mandatory — do not skip):
32
36
  1. Run the isolation check:
33
37
  ```bash
@@ -0,0 +1,94 @@
1
+ # glaf4 编码规范直读检索协议(glaf4-spec-retrieval)
2
+
3
+ > 设计真相源:工作区 `docs/plan/glaf4-spec-direct-read-design.md`(v1.2,P1.5 两轮收敛)。
4
+ > 适用:glaf4 体系项目的**非委托**实施(sdd / inline / batch-inline / hotfix / tweak / planned 实施面,及委托降级回退)与对应审查。
5
+ > 基准:glaf4-dev **0.6.2**(标签集与文件名以本机插件 `references/_index.md` 运行时为准,本文件静态表仅作路由推断;两者不一致时以 `_index.md` 为准并提示漂移)。
6
+
7
+ ## 0. 体系判据(门禁,两条充分判据 + 一条辅助信号)
8
+
9
+ - **充分 A(pom 特征,机械首选)**:界定 change 触及 repo(单仓=项目根;多仓=diff 路径前缀 ∩ 项目 config 的 `repo_layout/repos` 清单)→ **walk 该 repo 全部 `pom.xml`**:任一 pom 含 `<glaf4.version>` 属性,或 `<parent>` 为 `gtmc-glaf4-starter-parent` → 成立。
10
+ - **充分 B(显式标记)**:项目 config(`.team-flow/team-flow.config.json` **顶层**键,独立于 `glaf4_dev` 段——体系身份 ≠ 插件状态)存在 `glaf4_project: true` → 成立。
11
+ - **辅助信号(不单独成立)**:`.glaf4-dev/` 目录存在(曾试跑委托后弃用的非 glaf4 项目可能残留)。
12
+ - **判据无法穷尽判定**(pom 不可读 / 多层内部 parent 链无法解析)≠ 确认非体系 → **必须显式记录「glaf4 体系判据无法解析」,不得静默跳过**。
13
+ - 确认非 glaf4 体系 → 本通道不适用,静默跳过(无需降级提示)。
14
+
15
+ ## 1. 检索协议(十步)
16
+
17
+ 0. **体系判据**:执行上节;多仓 repo 界定按 `repo_layout`。
18
+ 1. **插件可用性**(自行执行,勿仅提示用户):Read `~/.claude/plugins/installed_plugins.json` 定位 `glaf4-dev@*` 条目 →
19
+ - 无条目 / `installPath` 不存在 / `installPath/references/_index.md` 缺失 → 显式降级「glaf4 编码规范不可用,按通用规范实施」记入报告 → **跳至步骤 9 记录后终止**;
20
+ - 有条目 → `installPath` 为规范根。
21
+ 2. **detect 状态**:读项目根 `.team-flow/team-flow.config.json`(区别于状态文件 `.team-flow.yaml`;多仓读 change 所属根)的**裸 JSON** `glaf4_dev` 键(`config-loader` 默认值使「未跑过」与「跑过 enabled=false」不可区分)——
22
+ - 键不存在 → 自行执行 `tf glaf4-delegation detect <root>`;
23
+ - 键存在 → 读取,不重复跑。
24
+ detect 用途 = 保持与委托链下游(execution-recommendation / contract-builder)状态一致;副作用如实声明:`enabled` 翻转会把 `glaf4-delegation` 注入 `tf execution recommend` 的 `available_modes`(影响后续 plan 的推荐 receipt,当前 change 已过 plan 的不受影响)。
25
+ 3. **技术面复核**(change 级):多仓 OR 聚合下 `enabled` 永不回退,前置通过 ≠ 本次 change 是 Java——按实际触及文件的技术面路由,非 Java change 不注入 Java 专属标签。
26
+ 4. **读注册表**:Read `<插件根>/references/_index.md`,解析 标签→文档 映射(运行时唯一权威)。
27
+ 5. **路由**:按 §2 判据推断 `touched_domains`。输入优先级:proposal/specs/tasks → 缺失时(hotfix/tweak)回退 execution-contract + change diff 文件清单。**零标签命中 → 显式记录「glaf4 规范未命中」,不注入**。
28
+ 6. **取数与预算**:仅 Read 命中标签文档;**上限 ≤5 标签 / ≤3 份文档**,超出按任务面主次取前 N,截断项记入报告。
29
+ 7. **注入(双形态,送达实际执行者)**:sdd 派子代理 → **子代理任务 prompt**;inline/batch-inline/hotfix/tweak/planned 单 wave 主会话执行 → **主会话自注入**。规则必须送到执行者手上,不得只在编排层自读。
30
+ 8. **裁决**:按 §3 执行;与 execution-contract/spec 冲突 → **以契约为准 + 回报 workflow-start 登记**,不自行 rewind、不静默违反。
31
+ 9. **留痕**(实施总结/审查报告必列):`glaf4_dev_version` + `touched_domains` + 实际读取文档清单 + 被截断项 + 零命中/判据无法解析标记。
32
+
33
+ ## 2. 功能 → 标签路由判据(43 标签全覆盖,基准 0.6.2)
34
+
35
+ 标签名与文档名以运行时 `_index.md` 为准;下表为任务面推断依据。
36
+
37
+ | 任务面信号 | 命中标签 |
38
+ |---|---|
39
+ | REST 接口 / Controller / API 契约 | `api`, `annotation`, `http-request`, `api-templates` |
40
+ | Service 业务逻辑 / 分层 / 组件编排 | `service`, `architecture`, `design-patterns` |
41
+ | 实体 / DTO / VO / 字段与模型 | `object-model`, `enum`, `json-serialization` |
42
+ | 数据库表 / SQL / MyBatis 持久化 | `db`, `persistence`, `multi-datasource`, `sharding-jdbc` |
43
+ | 事务边界 | `transaction` |
44
+ | 缓存 / 分布式锁 | `cache`, `ratelimiter` |
45
+ | MQ 生产 / 消费 | `mq` |
46
+ | 定时任务 | `scheduled` |
47
+ | 异常处理 / 错误码 | `exception` |
48
+ | 幂等 | `idempotence` |
49
+ | 鉴权 / 脱敏 / 安全 / 账号模型 | `security`, `security-masking`, `security-authority`, `account-model` |
50
+ | Feign 远程调用 | `feign` |
51
+ | 重试机制 | `retry` |
52
+ | 命名(类/方法/服务/DB) | `naming-java`, `naming-service`, `db` |
53
+ | 技术栈版本 / 工程约束 | `tech-stack` |
54
+ | 测试(非委托路径写测试) | `testing-unit`, `testing-integration`, `testing-anti-patterns`, `testing-archunit` |
55
+ | ArchUnit / 分层规则校验 | `archunit` |
56
+ | 性能优化 | `performance` |
57
+ | 可观测(日志/监控) | `observability` |
58
+ | 配置管理 | `configuration` |
59
+ | 部署 / 运维 | `deployment` |
60
+ | 工作流扩展 / Excel 扩展 | `workflow`, `excel` |
61
+ | 失败模式 / 审查规则(validate 面参考) | `failure-modes`, `code-review-rules` |
62
+
63
+ > `references/packs/`(46 个 pack 目录)不在本通道路由范围;`error-handling` 等 pack 目录名**不是** `_index.md` 标签。
64
+
65
+ ## 3. 裁决(按域分解前置)
66
+
67
+ **测试面**:项目 `.team-flow/conventions/` / `test-strategy` 口径优先,glaf4 文档作补充(域分工:glaf4-compliant 模板纯测试、`references/` 纯编码)。
68
+
69
+ **编码面四层裁决链**(高→低):
70
+ 1. **execution-contract / spec / architecture 已批准内容**(契约权威)——冲突 → 以契约为准 + 回报 workflow-start 登记;
71
+ 2. **项目 conventions 编码面同域明文约定**——须带 `MUST + 来源 + 证据段`(clean-code `backend-patterns.md` 范式)才参与;无来源标注的沉淀不压过 glaf4 权威;
72
+ 3. **glaf4 编码规范**(本通道注入);
73
+ 4. team-flow 通用缺省(clean-code / test-strategy)。
74
+
75
+ **glaf4 文档间互斥对优先级**(首版清单:标签语义交叉 + 抽查实测得出,随迭代补充;未列对按下方两原则就近适用):
76
+
77
+ | 互斥对 | 冲突面 | 处置 | 来源 |
78
+ |---|---|---|---|
79
+ | `naming-java` × `enum` | 通用命名规则 vs `enum-design` 的 code/name 字段与枚举命名专节 | **`enum` 优先**(具体域细则) | 实测(enum-design.md 含独立命名节) |
80
+ | `architecture` × `design-patterns` | 分层铁律 vs 模式建议 | **`architecture` 优先**(硬规则 > 建议) | 语义 |
81
+ | `security` × `api` / `annotation` | 安全校验要求 vs 接口/注解定义简洁性 | **`security` 优先**(硬规则) | 语义 |
82
+ | `transaction` × `cache` / `ratelimiter` | 事务一致性边界 vs 缓存/限流性能建议 | **`transaction` 优先**(一致性硬规则) | 语义 |
83
+ | `db` × `persistence` | SQL/表命名 vs MyBatis 映射写法 | 按变更对象:写 SQL → `db`,写 Mapper/实体映射 → `persistence` | 语义 |
84
+ | `naming-*` × `service` / `object-model` | 命名风格 vs 结构规则 | 结构规则优先,命名在其约束内就近满足 | 语义 |
85
+
86
+ 通用两原则(上表未列的互斥对按此裁决):**硬规则 > 风格**(security/transaction/architecture 域命中即优先);**组件/具体域 > 通用**(cache/mq/persistence 命中优先于 design-patterns)。全部命中标签记入留痕供审查复核。
87
+
88
+ **与既有代码风格冲突**:按 clean-code「增量归因边界」——只对本 change 新增/修改行判 glaf4 违例,存量不追溯。
89
+
90
+ ## 4. 违例分级
91
+
92
+ - 默认 **Important**(Important 即 fail receipt,与 team-flow 统一映射一致);
93
+ - 触及 `security` / `transaction` / `architecture` 硬规则 → **Critical**;
94
+ - 与 clean-code 机械项重合 → 按 clean-code 既有阈值,不另立标准。
@@ -94,6 +94,14 @@ Subagent (general-purpose):
94
94
 
95
95
  ## Part 2: Code Quality
96
96
 
97
+ **GLAF4 spec conformance (non-delegation path, glaf4-spec-direct-read-design v1.2):**
98
+ Apply ONLY when this is a glaf4 system project AND `execution_mode != glaf4-delegation`
99
+ (identity gate and branches: `skills/build-executor/references/glaf4-spec-retrieval.md`).
100
+ Reuse the implementation's step-9 trace (version + touched_domains + doc list) when present;
101
+ otherwise fetch docs yourself under the budget (≤5 tags / ≤3 docs from `<plugin>/references/_index.md`).
102
+ Grade: default **Important**, security/transaction/layering hard rules **Critical**;
103
+ adjudication chain and incremental boundary per protocol §3/§4.
104
+
97
105
  **Code quality:**
98
106
  - Clean separation of concerns?
99
107
  - Proper error handling?
@@ -92,6 +92,7 @@ DRY 的取证范围是「本 diff 内或本仓内」,两条派发路径的依
92
92
  ## 7. 与 conventions 的关系
93
93
 
94
94
  - conventions 优先:项目 conventions 与本 skill 冲突时以项目为准(项目级契约 > 通用缺省)。
95
+ - 外部框架权威层(glaf4-spec-direct-read-design v1.2):项目 conventions 与外部框架权威规范(如 glaf4 编码规范)同域冲突时,**仅带 `MUST + 来源 + 证据段` 的项目约定参与裁决**;完整裁决链见 `skills/build-executor/references/glaf4-spec-retrieval.md` §3(契约/spec > 有来源的项目约定 > glaf4 规范 > 本 skill 通用缺省)。
95
96
  - 追加通道:项目可沉淀「本项目特有的结构约定」,格式参照项目级 `backend-patterns.md` 的 `MUST + 来源 + 证据段` 范式。
96
97
  - 引用约定:conventions 引用插件侧 references 时 MUST 写全路径 `skills/<skill>/references/<file>.md`,不得写裸 `references/...`。
97
98
  - 参数口径:`test-strategy` 的 `param_count>6` 判测试复杂度,本 skill 的「参数 >3」判可读性——管辖不同,非矛盾。
@@ -145,6 +145,8 @@ Check for:
145
145
 
146
146
  本 SKILL.md 与 `clean-code` skill 是判据的**真相源**,供 agent 路径预加载与维护参考;两侧核心判据 MUST 保持一致(由 P4 一致性检查守护)。
147
147
 
148
+ **GLAF4 spec conformance(glaf4-spec-direct-read-design v1.2,非委托路径)**:glaf4 体系项目且 `execution_mode != glaf4-delegation` 时,按 `skills/build-executor/references/glaf4-spec-retrieval.md` 协议核验编码规范符合性——优先复用实施侧步骤 9 留痕(version + touched_domains + 文档清单),缺失则自行按协议取数(≤5 标签/≤3 文档);判级默认 Important、security/transaction/分层硬规则 Critical,裁决链与增量归因见协议 §3/§4。**执行处是两条派发路径的模板副本**(`code-reviewer-prompt.md` 的 GLAF4 段 + `build-executor/task-reviewer-prompt.md` 的 GLAF4 段),与本文件同口径——三副本由 `tests/lib/doc-consistency.test.mjs` 断言一致;本 SKILL.md 为 agent 预加载路径的真相源。
149
+
148
150
  ### Step 4: Architecture Review
149
151
 
150
152
  Check for:
@@ -62,6 +62,19 @@ Subagent (general-purpose):
62
62
  - Modify files (in the diff) must have a diff → no change = Critical finding (`no-change`)
63
63
  File existence is a precondition — a file that does not exist cannot be spec-compliant.
64
64
 
65
+ **GLAF4 spec conformance (glaf4-spec-direct-read-design v1.2, non-delegation path):**
66
+ Apply ONLY when this is a glaf4 system project AND `execution_mode != glaf4-delegation`
67
+ (identity gate: walk repo poms for `<glaf4.version>` / parent `gtmc-glaf4-starter-parent`,
68
+ or explicit `glaf4_project` config key — see the protocol for the exact branches).
69
+ - Read `skills/build-executor/references/glaf4-spec-retrieval.md` and follow it.
70
+ - Prefer the implementation's step-9 trace (glaf4_dev_version + touched_domains + doc list)
71
+ from the implementation summary; if absent, fetch docs yourself under the budget
72
+ (≤5 tags / ≤3 docs, tags from `<plugin>/references/_index.md`).
73
+ - Grade violations per protocol §4: default **Important** (→ fail receipt); security /
74
+ transaction / layering-law hard rules → **Critical**. Adjudication chain per §3
75
+ (contract/spec > project conventions WITH source+evidence > glaf4 spec > team-flow defaults);
76
+ incremental boundary applies — judge only lines this diff adds or modifies.
77
+
65
78
  **Code quality:**
66
79
  - Clean separation of concerns?
67
80
  - Proper error handling?
@@ -51,7 +51,7 @@ tf state set <change-dir> planned_arch true # 仅 planned 且用户选
51
51
  4. **plan 派生**:`tf execution plan <dir> --derive --confirm --reason "<一句话>"`——tasks.md → 单 wave(serial),写入即同步 `state.execution_mode/execution_plan_hash/execution_plan_revision`;**无需 recommend/receipt/DP-4**(validatePlan 对 planned 豁免)
52
52
  5. D4:最小 `test-matrix.md` 或显式 skip(同 direct)
53
53
  6. 转换 `exploring→approved-for-build→executing`(planned 维度表:无契约、无 DP-3、无 architecture-design 重门)
54
- 7. 实施:主代理当前会话执行单 wave;完成 → 跑测试 → `tf test record`
54
+ 7. 实施:主代理当前会话执行单 wave;完成 → 跑测试 → `tf test record`。**glaf4 编码规范注入(规则送到执行者——planned 不经 build-executor,指令只能送到本分支)**:glaf4 体系项目且非委托模式时,按 `skills/build-executor/references/glaf4-spec-retrieval.md` 十步协议在主会话自注入(体系判据 → `_index.md` 路由 → ≤5 标签/≤3 文档 → 留痕),裁决链见其 §3
55
55
  8. **关门 → dispatch/执行 release-archivist(planned 分支单点执行)**:回写三步(`arch-merge --light` / `test-merge --light` / `tf solutions capture --source "change:<name>"`)→ `final-review.md` 最终审查(**在回写之后核验台账条目 vs diff 抽样**,B-01/D5;**v1.3:planned 不派 code-reviewer——最终审查同步按 `tf security scope` 适用集产 `.security-verification.json`**,见 release-archivist ④)→ security/handoff.md(④b)→ 转 `closing` → prototype-sync(closing 后,有原型才跑)。**序列只存在于 release-archivist「⚠ 执行顺序」块(唯一真相源,§3.7 B-13),本 skill 不重复执行、不本地复述命令(防双跑)**。
56
56
 
57
57
  ### Upgrade(升档,G5/D9)