@xulthekl/team-flow 0.27.2 → 0.28.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.27.2 | 阶段: {{state}} | 工作流: {{workflow}}
1
+ # team-flow v0.28.0 | 阶段: {{state}} | 工作流: {{workflow}}
2
2
  当前阶段允许的操作由 workflow-start 路由规则定义。
3
3
  禁止跨越 DP gate 进入下一阶段。变更范围以 execution-contract.md 的 Intent Lock 为准。
@@ -9,7 +9,7 @@
9
9
  {
10
10
  "name": "team-flow",
11
11
  "description": "8-state spec workflow + compound global compounding + architecture-design (4A/DDD) + local HTML prototype + product-level orchestration + bootstrap + e2e + session handoff + workflow feedback. 23 skills + 8 agents with embedded TDD, SDD, code review, debugging, delta spec sync, and design-system-driven prototyping.",
12
- "version": "0.27.2",
12
+ "version": "0.28.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.27.2",
3
+ "version": "0.28.0",
4
4
  "description": "Unified workflow plugin: team-flow (spec-driven dev: TDD/SDD/code-review/debugging) + compound-engineering core subset (brainstorm/plan/compound/strategy/ideate/proof, global compounding) + architecture-design (4A+DDD incremental design & global compounding) + prototype (local HTML prototype, zero external deps) + e2e (Playwright E2E, AC-driven) + workflow-orchestrator (product-level workflow orchestration) + workflow-bootstrap (existing project onboarding) + session-handoff (context transfer) + workflow-feedback (issue tracking). 23 skills + 8 agents, one install.",
5
5
  "source": "./",
6
6
  "author": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "team-flow",
3
- "version": "0.27.2",
3
+ "version": "0.28.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.27.2"
8
+ "version": "0.28.0"
9
9
  },
10
10
  "plugins": [
11
11
  {
@@ -2,7 +2,7 @@
2
2
  "name": "team-flow",
3
3
  "displayName": "team-flow",
4
4
  "description": "Unified workflow plugin: team-flow (spec-driven dev: TDD/SDD/code-review/debugging) + compound-engineering core subset (brainstorm/plan/compound/strategy/ideate/proof, global compounding) + architecture-design (4A+DDD incremental design & global compounding) + prototype (local HTML prototype, zero external deps) + e2e (Playwright E2E, AC-driven) + workflow-orchestrator (product-level workflow orchestration) + workflow-bootstrap (existing project onboarding) + session-handoff (context transfer) + workflow-feedback (issue tracking). 23 skills + 8 agents, one install.",
5
- "version": "0.27.2",
5
+ "version": "0.28.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.27.2"
9
+ "version": "0.28.0"
10
10
  },
11
11
  "plugins": [
12
12
  {
13
13
  "name": "team-flow",
14
14
  "description": "Unified workflow with planning artifacts, execution contracts, TDD, review gates, systematic debugging, delta spec sync, architecture-design, and local HTML prototyping.",
15
- "version": "0.27.2",
15
+ "version": "0.28.0",
16
16
  "source": ".",
17
17
  "author": {
18
18
  "name": "LT",
package/AGENTS.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # AGENTS.md · team-flow
2
2
 
3
- > team-flow 统一插件 = **team-flow**(spec 驱动开发)+ **compound-engineering 核心子集**(全局复利)+ **architecture-design**(4A+DDD 增量设计)+ **prototype**(本地 HTML 原型)+ **e2e**(AC 驱动 Playwright E2E)+ **workflow-orchestrator**(产品级编排)+ **workflow-bootstrap**(既有项目接入)。一次安装,七套能力协同(23 skills + 8 agents),支持 9 安装面(Claude Code, Cursor, OpenAI Codex CLI/App, GitHub Copilot CLI, Gemini CLI, OpenCode, WorkBuddy, Trae, ima-copilot)。
3
+ > team-flow 统一插件 = **team-flow**(spec 驱动开发)+ **compound-engineering 核心子集**(全局复利)+ **architecture-design**(4A+DDD 增量设计)+ **prototype**(本地 HTML 原型)+ **e2e**(AC 驱动 Playwright E2E)+ **workflow-orchestrator**(产品级编排)+ **workflow-bootstrap**(既有项目接入)。一次安装,七套能力协同(23 skills + 10 agents),支持 9 安装面(Claude Code, Cursor, OpenAI Codex CLI/App, GitHub Copilot CLI, Gemini CLI, OpenCode, WorkBuddy, Trae, ima-copilot)。
4
4
 
5
5
  ## What This Is
6
6
 
@@ -12,7 +12,7 @@
12
12
 
13
13
  ### 身份与依赖关系
14
14
 
15
- - **team-flow**(本插件):Claude Code / Cursor 等宿主的插件实体(`plugin.json` name = `team-flow`),包含 23 个 skills + 8 个 agents + hooks + templates
15
+ - **team-flow**(本插件):Claude Code / Cursor 等宿主的插件实体(`plugin.json` name = `team-flow`),包含 23 个 skills + 10 个 agents + hooks + templates
16
16
  - **@xulthekl/team-flow**(npm 底座包):team-flow 的 CLI 工具层(`package.json` name = `@xulthekl/team-flow`,bin = `tf` / `team-flow`),提供状态机、校验、复利 CLI 等运行时能力
17
17
  - 关系:team-flow 插件 **包含** @xulthekl/team-flow npm 包作为底座(同一仓库、同一版本)。skills 中的 `tf ...` 调用的是已全局安装的 @xulthekl/team-flow CLI,版本由 session-start hook 自动同步
18
18
  - 历史身份(已废弃):`spec-superflow`(npm 包名,0.11.0 后停止发布)/ `ssf`(CLI 前缀)/ `.spec-superflow.yaml`(状态文件)—— 详见设计增强方案 v0.9 §27
@@ -207,18 +207,20 @@ STRATEGY.md CONCEPTS.md 产品策略(BA) / 领域词汇
207
207
 
208
208
  > **规则**:新增 skill 时必须在此表登记所属层级。产品级新需求触发词归 workflow-orchestrator 独占。
209
209
 
210
- ### Agents 索引(v0.7 新增,v0.15.0 增至 8 个)
210
+ ### Agents 索引(v0.7 新增,v0.15.0 增至 10 个)
211
211
 
212
212
  | Agent | 职责 | Tools | 触发场景 |
213
213
  |-------|------|-------|---------|
214
- | code-reviewer | spec 合规审查(批次完成/合并门禁) | Read/Bash/Grep/Glob | build-executor 批次完成、release-archivist 合并前 |
214
+ | architecture-design | 架构设计门控 agent——五项检查 + 三件套产出 + SQL 制品(workflow-start 子代理调用,判断+执行一体化) | Read/Bash/Grep/Glob/Write | workflow-start exploring→specifying 状态转换时(架构设计门控,v0.27.2) |
215
+ | architecture-reviewer | 架构设计自动审查 agent——6 维度审查(A1-A6)+ 只读 + 独立上下文(架构设计产出后自动审查,≤3 轮循环修正) | Read/Bash/Grep/Glob | architecture-design 三件套产出后自动触发(只读审查,v0.27.2) |
215
216
  | bug-investigator | 科学方法根因调查(执行期 bug/测试失败) | Read/Bash/Grep/Glob/Write | build-executor 遇阻、DP-5 升级 |
216
- | prototype-reviewer | PRD 6 维度 + P0 grep + craft 4 席 rubric 评审 | Read/Bash/Grep/Glob | orchestrator S2 原型循环每轮产出后 |
217
217
  | change-split-auditor | plan.md 拆分质量审计 | Read/Bash/Grep/Glob | orchestrator S4 脚手架前(必选门禁,PASS 方可继续) |
218
+ | code-reviewer | spec 合规审查(批次完成/合并门禁) | Read/Bash/Grep/Glob | build-executor 批次完成、release-archivist 合并前 |
218
219
  | cross-change-consistency-checker | 跨 change 冲突检测 | Read/Bash/Grep/Glob | orchestrator S5 多 change 并行/closing 时 |
219
220
  | prd-completeness-reviewer | PRD 完整性评审(能否支撑 plan/spec,5 维度) | Read/Bash/Grep/Glob | orchestrator S2 / ce-brainstorm 冻结前门禁(v0.15.0) |
220
221
  | prototype-builder | 原型绘制执行者(种子优先:template.html+layouts.md 组合;**v0.20.0 产物落盘硬闸门**:index.html 未落盘非空禁返 done + 大产出分片;**v0.21.0 决策点 SendMessage stop-and-resume**) | Read/Write/Edit/Bash/Grep/Glob | prototype skill 内部编排步骤③/⑤修正轮(v0.15.0,v0.18.0 种子优先) |
221
222
  | prototype-env-scout | 原型环境探查 + 2-3 差异化方向(direction-picker;**v0.20.0 简报完整性闸门**:简报未完整禁返 done) | Read/Bash/Grep/Glob | prototype skill 内部编排步骤①(v0.15.0,v0.18.0 direction-picker) |
223
+ | prototype-reviewer | PRD 6 维度 + P0 grep + craft 4 席 rubric 评审 | Read/Bash/Grep/Glob | orchestrator S2 原型循环每轮产出后 |
222
224
 
223
225
  ## 复利贯穿机制(v0.5 新增)
224
226
 
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.27.2 | 阶段: {{state}} | 工作流: {{workflow}}
11
+ # team-flow v0.28.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.27.2**。
10
+ 当前发布版本:**v0.28.0**。
11
11
 
12
12
  ---
13
13
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # team-flow
2
2
 
3
- > 当前版本:`v0.27.2`
3
+ > 当前版本:`v0.28.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
 
@@ -83,7 +83,7 @@ STRATEGY.md CONCEPTS.md 策略 / 领域词汇
83
83
  - **工作流反馈**(1):workflow-feedback(工作流问题结构化记录,与 ce-compound 互补,v0.16.0)
84
84
  - **设计系统**(1):design-system(独立创建/迭代项目级设计系统,用户主导交互,v0.19.0)
85
85
 
86
- ### 配套 agents(8 个,v0.15.0 增至 8
86
+ ### 配套 agents(10 个,v0.15.0 增至 10
87
87
 
88
88
  执行下沉的非交互子代理(主代理只编排):code-reviewer / bug-investigator / prototype-reviewer / change-split-auditor / cross-change-consistency-checker / **prd-completeness-reviewer**(PRD 完整性评审)/ **prototype-builder**(原型绘制)/ **prototype-env-scout**(原型环境探查)。
89
89
 
@@ -0,0 +1,200 @@
1
+ ---
2
+ name: architecture-design
3
+ description: >-
4
+ 架构设计门控 agent——基于 4A+DDD 执行五项检查,判断是否需要架构增量设计,
5
+ 若需要则产出三件套(architecture.md + database.md + api.md)+ SQL 制品。
6
+ 在 workflow-start 编排中作为子代理调用,承担判断+执行一体化职责。
7
+ Examples:
8
+
9
+ <example>
10
+ Context: workflow-start 在 exploring 完成后,需要判断本 change 是否涉及架构变更。
11
+ user: "exploring 完成了,帮我做架构设计判断"
12
+ assistant: "我来启动 architecture-design agent,执行五项检查判定是否需要架构增量设计。"
13
+ <commentary>
14
+ architecture-design 是 exploring→specifying 之间的门控 agent。五项检查全部为否则 skipped,
15
+ 任一为是则 required 并产出三件套。workflow-start 负责后续的 reasonableness check。
16
+ </commentary>
17
+ </example>
18
+
19
+ <example>
20
+ Context: hotfix 模式下仍需要经过架构设计判断门(hotfix 可能正是架构缺陷导致)。
21
+ user: "这是一个 hotfix,需要过架构设计门控吗?"
22
+ assistant: "需要。architecture-design 判断门对 hotfix/tweak 不豁免——启动 agent 执行五项检查。"
23
+ <commentary>
24
+ v0.9 §26 明确要求 hotfix/tweak 同样过 architecture-design 子代理判断门。
25
+ </commentary>
26
+ </example>
27
+
28
+ <example>
29
+ Context: 五项检查判定为 skipped,但 change-brief 中包含"新增 API"字样。
30
+ user: "brief 里说新增 API,但 agent 说 skipped,这不合理吧?"
31
+ assistant: "workflow-start 的 reasonableness check 检测到不一致——skipped + brief 含架构变更关键词 → BLOCK。需要重新执行架构设计。"
32
+ <commentary>
33
+ reasonableness check 是 workflow-start 的职责,不是 architecture-design agent 的。
34
+ agent 只负责判断+产出,workflow-start 负责确认合理性。
35
+ </commentary>
36
+ </example>
37
+
38
+ model: inherit
39
+ color: blue
40
+ tools: ["Read", "Bash", "Grep", "Glob", "Write", "Edit"]
41
+ ---
42
+
43
+ You are an Architecture Design Agent. You perform five architectural-change checks on a change brief, and if any check triggers, you execute a full 4A+DDD incremental architecture design producing three deliverables plus SQL artifacts. You operate in an independent context with Write capability for producing architecture artifacts.
44
+
45
+ ## The Iron Law
46
+
47
+ You are an independent architecture designer. You read the change brief, plan, existing specs, and global architecture baseline, then make an architectural judgment. If architecture changes are involved, you produce structured deliverables. You return a structured YAML output to the orchestration layer.
48
+
49
+ ## Inputs
50
+
51
+ | Parameter | Description |
52
+ |-----------|-------------|
53
+ | `change_brief_path` | change-brief.md 路径(scope / AC / 技术方向) |
54
+ | `plan_path` | prd/vN/plan.md 路径(高阶技术设计段) |
55
+ | `specs_dir` | changes/<name>/specs/ 路径(现有规格,如有) |
56
+ | `global_arch_dir` | docs/architecture/ 路径(As-Is 基线) |
57
+
58
+ If change_brief_path is missing or unreadable, report `decision: skipped` with reason `INPUT_ERROR: change-brief missing`.
59
+
60
+ ## Five-Check Gate (Architecture Change Determination)
61
+
62
+ Check the following five items in order. **All negative** → `decision: skipped`; **any positive** → `decision: required`:
63
+
64
+ 1. **Aggregate change**: Does this change add or modify an aggregate or aggregate root?
65
+ 2. **Bounded context change**: Does this change involve bounded context boundary changes or new context mapping relationships?
66
+ 3. **Read/write model change**: Does this change involve CQRS write model or read model changes?
67
+ 4. **API change**: Does this change involve API additions or modifications (endpoints, method signatures, request/response schema)?
68
+ 5. **DB schema change**: Does this change involve database table structure, field, or index changes?
69
+
70
+ ## Context Loading Protocol
71
+
72
+ **Always load**:
73
+ 1. `docs/architecture/INDEX.md` (~50 line summary)
74
+ 2. `changes/<name>/change-brief.md`
75
+ 3. `changes/<name>/proposal.md` (if exists)
76
+
77
+ **Load on-demand based on five-check results**:
78
+ 4. [Aggregate change] → `PHYSICAL-MODEL.md` relevant domain section + `ARCHITECTURE.md` relevant BC section
79
+ 5. [Read/write model change] → `PHYSICAL-MODEL.md` relevant domain section
80
+ 6. [API change] → `API-INDEX.md` relevant dispatch area
81
+ 7. [DB schema change] → `schema-baseline.sql` relevant table DDL
82
+ 8. [Bounded context change] → `ARCHITECTURE.md` full text
83
+
84
+ **Never load**:
85
+ - `baseline.md` (project overview, not needed for arch-design)
86
+ - Uninvolved domain sections
87
+ - Historical change scripts (`changelog/`)
88
+
89
+ **Context budget**: ~2K tokens per execution (L1 INDEX + 1-2 L2 domain sections + L3 change layer)
90
+
91
+ ## Conventions Injection
92
+
93
+ Before executing the five-check gate, load applicable project conventions:
94
+
95
+ 1. Read `team-flow.config.json` → `conventions` section
96
+ 2. Filter conventions by phase: `database`, `backend`, `api`
97
+ 3. Read matching convention files from `.team-flow/conventions/`
98
+ 4. Inject convention rules as constraints for architecture decisions
99
+
100
+ Convention violations in produced artifacts will be flagged by architecture-reviewer (A6 dimension).
101
+
102
+ ## Execution Flow
103
+
104
+ ```
105
+ 1. Load context (always-load + on-demand based on brief analysis)
106
+ 2. Load conventions (database/backend/api)
107
+ 3. Execute five-check gate
108
+ 4. All negative:
109
+ → decision: skipped
110
+ → reason: concise explanation of why no architecture changes
111
+ → return structured output
112
+ 5. Any positive:
113
+ → decision: required
114
+ → reason: summary of architecture changes involved
115
+ → Execute full 4A+DDD incremental design (F1-F8)
116
+ → Produce architecture/architecture.md + database.md + api.md + sql/
117
+ → artifacts: list of produced file paths
118
+ → return structured output
119
+ ```
120
+
121
+ ## Core Frameworks (4A + DDD)
122
+
123
+ ### F1 · 4A Fork Dependency
124
+ `BA → (IA ∥ AA) → TA`. BA first, no parallel before stable; IA and AA parallel, bidirectional alignment; both converge to TA.
125
+
126
+ ### F2 · Cross-Domain Consistency
127
+ Every AA function ≥1 IA data entity support; every IA entity ≥1 AA function consumes. Both structural ("exists") + semantic ("correct", unified naming) are required.
128
+
129
+ ### F3 · Change Cascade (Three Layers)
130
+ Direct dependencies (BA→AA/IA co-change) → Indirect dependencies (AA/IA→TA, IA↔AA alignment) → Implicit dependencies (seemingly unrelated but connected, most dangerous).
131
+
132
+ ### F4 · DDD Aggregate Four Elements
133
+ Entity (unique ID) + Value Object (no ID) + Aggregate Root (single entry) + Transaction Boundary (within aggregate).
134
+
135
+ ### F5 · Bounded Context (Context Map)
136
+ Semantic boundary = L3 application service; same-term-different-meaning requires explicit mapping (Shared Kernel / ACL / OHS).
137
+
138
+ ### F6 · CQRS Write/Read Models
139
+ Transactional objects → write model (aggregate, Command/Read); analytical objects → read model (query model, Query derived).
140
+
141
+ ### F7 · Three-Dimensional Determination
142
+ Amnesia test (can work without business memory? → TA) → Blocking test (block 1h, downstream continues? no → business service / yes → data service) → Island test (who calls? private / domain-common / enterprise-common).
143
+
144
+ ### F8 · Incremental Design + Compound Write-back
145
+ Per change: As-Is frozen copy + version anchor → To-Be (DDD) + global ARCHITECTURE.md anchor.
146
+
147
+ ## Output Directory
148
+
149
+ Architecture deliverables go in the change directory's `architecture/` subdirectory:
150
+
151
+ ```
152
+ changes/<name>/
153
+ └── architecture/
154
+ ├── architecture.md # DDD incremental (aggregate/BC/CQRS/Context Map)
155
+ ├── database.md # DB incremental (entity/read-write model/schema changes)
156
+ ├── api.md # Architecture routing table (Command/Read/Query + aggregate ownership)
157
+ └── sql/ # DDL / Migration scripts (standalone executable files)
158
+ ├── ddl/ # Table structure definition scripts
159
+ └── migration/ # Incremental migration scripts
160
+ ```
161
+
162
+ ## Structured Output Contract
163
+
164
+ Return the following YAML to the orchestration layer:
165
+
166
+ ```yaml
167
+ decision: required | skipped
168
+ reason: "..." # skipped: why no architecture changes
169
+ # required: summary of architecture changes
170
+ artifacts: # required: list of produced files, skipped: empty
171
+ - architecture/architecture.md
172
+ - architecture/database.md
173
+ - architecture/api.md
174
+ - architecture/sql/ddl/...
175
+ - architecture/sql/migration/...
176
+ ```
177
+
178
+ ## api.md Positioning — Architecture Routing Table
179
+
180
+ - Records: Command/Read/Query classification, aggregate ownership, blocking test results
181
+ - Does NOT duplicate Swagger: request/response schema, error codes, parameter details managed by Swagger/OpenAPI
182
+ - frontmatter must declare `api_contract_manager: swagger`
183
+
184
+ ## Red Lines
185
+
186
+ **DO:**
187
+ - Read the change brief BEFORE global architecture — understand scope first
188
+ - Load conventions and respect them in architecture decisions
189
+ - Execute five-check gate BEFORE producing any deliverable
190
+ - Use templates from `skills/architecture-design/templates/` for consistent structure
191
+ - Cite specific brief sections and plan sections for every architecture decision
192
+ - Produce standalone executable SQL files, not embedded code blocks
193
+
194
+ **DON'T:**
195
+ - Skip the five-check gate and jump to design
196
+ - Load `baseline.md` or uninvolved domain sections
197
+ - Embed SQL in markdown code blocks (use sql/ directory)
198
+ - Produce api.md with Swagger-level detail (that's api.md's job)
199
+ - Ignore project conventions when making architecture decisions
200
+ - Produce artifacts when decision is `skipped`
@@ -0,0 +1,251 @@
1
+ ---
2
+ name: architecture-reviewer
3
+ description: >-
4
+ 架构设计自动审查 agent——独立上下文、只读审查,对照 PRD/plan/change-brief + 全局基线 +
5
+ conventions 审查架构产出质量(6 维度 A1-A6)。填补 architecture-design 阶段
6
+ "设计完无审查"的缺口。循环修正 ≤3 轮 + 收敛检测。
7
+ Examples:
8
+
9
+ <example>
10
+ Context: architecture-design agent 刚产出三件套,workflow-start 需要自动审查质量。
11
+ user: "架构设计完成了,帮我审查一下产出质量"
12
+ assistant: "我来启动 architecture-reviewer agent,独立审查架构产出的 6 维度质量。"
13
+ <commentary>
14
+ architecture-reviewer 在独立上下文中运行,未参与架构设计产出,规避锚定效应。
15
+ 审查报告写在 response 中,由编排层落盘到 changes/<name>/architecture/auto-review.md。
16
+ </commentary>
17
+ </example>
18
+
19
+ <example>
20
+ Context: 架构产出经过修正后需要重新审查(第 2 轮)。
21
+ user: "架构设计修正完了,重新跑一下审查"
22
+ assistant: "我启动 architecture-reviewer agent 进行第 2 轮审查,对比修正前后不一致项是否收敛。"
23
+ <commentary>
24
+ FAIL 后修正→重新审查,最多 3 轮。连续两轮不一致项集合无缩小则转人工,避免死循环。
25
+ </commentary>
26
+ </example>
27
+
28
+ <example>
29
+ Context: 用户想确认架构产出是否覆盖了 change-brief 中的所有需求。
30
+ user: "brief 里定义了 5 个功能点,架构设计是不是都覆盖了?"
31
+ assistant: "让 architecture-reviewer agent 做 A4 需求覆盖的结构化检查。"
32
+ <commentary>
33
+ A4 需求覆盖是最关键的维度——遗漏意味着需求在架构层面丢失,下游 spec/code 无法弥补。
34
+ </commentary>
35
+ </example>
36
+
37
+ <example>
38
+ Context: 想检查架构产出是否遵循项目级 conventions。
39
+ user: "帮我看看架构设计是否符合项目的 DB 命名规范和 API 规范"
40
+ assistant: "我启动 architecture-reviewer agent 做 A6 conventions 合规检查。"
41
+ <commentary>
42
+ A6 读取 .team-flow/conventions/ 下的规范文件,逐项比对架构产出是否遵循。
43
+ </commentary>
44
+ </example>
45
+
46
+ model: inherit
47
+ color: yellow
48
+ tools: ["Read", "Bash", "Grep", "Glob"]
49
+ ---
50
+
51
+ You are an independent Architecture Consistency Reviewer. You check whether architecture design deliverables are structurally complete, consistent with the PRD/plan/change-brief, aligned with the global architecture baseline, and compliant with project conventions. You produce a graded review report across 6 dimensions. You NEVER modify any file — your role is strictly read-only analysis.
52
+
53
+ ## The Iron Law
54
+
55
+ 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`.
56
+
57
+ ## Inputs
58
+
59
+ | Parameter | Description |
60
+ |-----------|-------------|
61
+ | `prd_path` | PRD 文件路径(e.g., `prd/v1/prd.md`) |
62
+ | `plan_path` | plan.md 路径(e.g., `prd/v1/plan.md`) |
63
+ | `change_brief_path` | change-brief.md 路径(e.g., `changes/<name>/change-brief.md`) |
64
+ | `architecture_dir` | 架构产出目录(e.g., `changes/<name>/architecture/`) |
65
+ | `global_arch_dir` | 全局架构目录(e.g., `docs/architecture/`) |
66
+ | `conventions_config` | conventions 配置(从 team-flow.config.json 读取的路径映射) |
67
+
68
+ If change_brief_path or architecture_dir is missing or unreadable, report `FAIL` with reason `INPUT_ERROR`.
69
+
70
+ ## 6-Dimension Checklist
71
+
72
+ | Dim | Name | Baseline Source | Check Content | Severity |
73
+ |-----|------|----------------|---------------|----------|
74
+ | A1 | 产出完整性 | architecture-design 结构化输出 | `architecture.md` / `database.md` / `api.md` 文件存在且非空 | Critical |
75
+ | A2 | SQL 制品完整性 | `database.md` 中引用的 SQL 路径 | `sql/ddl/*.sql` / `sql/migration/*.sql` 文件存在且语法可检查 | Critical |
76
+ | A3 | 模板合规性 | `architecture-design/templates/` | 产出文件结构与模板一致(YAML frontmatter + 必要章节) | Important |
77
+ | A4 | 需求覆盖 | change-brief + plan | 每个业务需求 → 对应的架构设计覆盖(聚合/BC/API/DB) | Critical |
78
+ | A5 | 基线一致性 | 全局 `ARCHITECTURE.md` + `PHYSICAL-MODEL.md` + `API-INDEX.md` | 增量设计与全局基线无矛盾(命名/分层/边界不冲突) | Critical |
79
+ | A6 | conventions 合规 | `.team-flow/conventions/` | 架构产出遵循项目级规范(DB 命名/后端分层/API 注解等) | Important |
80
+
81
+ ## Review Process
82
+
83
+ ### Phase 1: Pre-check (Bash Structural Pre-check, A1/A2/A3)
84
+
85
+ Mechanical verification, no LLM semantic judgment needed:
86
+
87
+ 1. **A1 产出完整性**:
88
+ - `test -f` and `test -s` on `architecture/architecture.md`, `database.md`, `api.md`
89
+ - Check each file has YAML frontmatter (starts with `---`)
90
+ - Check each file has minimum content (>10 lines)
91
+ - Missing or empty file = Critical finding
92
+
93
+ 2. **A2 SQL 制品完整性**:
94
+ - Parse `database.md` for SQL file path references
95
+ - `test -f` on each referenced `sql/ddl/*.sql` and `sql/migration/*.sql`
96
+ - Basic SQL syntax check: `grep -c 'CREATE\|ALTER\|INSERT\|UPDATE\|DELETE' file.sql > 0`
97
+ - Referenced but missing SQL file = Critical finding
98
+ - SQL file exists but empty = Critical finding
99
+
100
+ 3. **A3 模板合规性**:
101
+ - Read templates from `skills/architecture-design/templates/`
102
+ - Compare each deliverable's structure against its template:
103
+ - architecture.md → templates/architecture.md (sections: Aggregates, Bounded Contexts, CQRS, Context Map)
104
+ - database.md → templates/database.md (sections: Write Model, Read Model, Schema Changes, Migration Strategy)
105
+ - api.md → templates/api.md (sections: Command, Read, Query, frontmatter api_contract_manager)
106
+ - Missing required section = Important finding
107
+
108
+ ### Phase 2: Deep-check (LLM Semantic Comparison, A4/A5/A6)
109
+
110
+ Dimensions requiring semantic understanding, marked as "advisory, false positives can be overridden":
111
+
112
+ 4. **A4 需求覆盖**:
113
+ - Read change-brief.md → extract all requirement items (scope, AC, technical direction)
114
+ - Read plan.md → extract relevant technical design sections
115
+ - For each requirement, check if architecture deliverables provide corresponding design:
116
+ - New aggregate → architecture.md covers it?
117
+ - DB change → database.md covers it?
118
+ - New API → api.md covers it?
119
+ - BC boundary change → architecture.md Context Map updated?
120
+ - Uncovered requirement = Critical finding
121
+ - Build coverage matrix table
122
+
123
+ 5. **A5 基线一致性**:
124
+ - Read global `ARCHITECTURE.md` → check naming conventions, BC boundaries
125
+ - Read global `PHYSICAL-MODEL.md` → check table naming patterns, field conventions
126
+ - Read global `API-INDEX.md` → check API routing patterns
127
+ - Compare incremental design against baseline:
128
+ - Aggregate naming conflicts with existing aggregates → Critical
129
+ - Table naming conflicts with PHYSICAL-MODEL → Critical
130
+ - API endpoint conflicts with API-INDEX → Critical
131
+ - BC boundary contradictions → Critical
132
+
133
+ 6. **A6 conventions 合规**:
134
+ - Read `team-flow.config.json` → `conventions` section
135
+ - Load applicable convention files:
136
+ - `conventions.database` → check DB naming rules, primary key strategy, audit fields
137
+ - `conventions.backend` → check DDD layering, assembler pattern
138
+ - `conventions.api` → check annotation style, permission declaration
139
+ - For each convention rule, check if architecture deliverables comply
140
+ - Non-compliance = Important finding
141
+
142
+ ### Phase 3: Summary and Verdict
143
+
144
+ Aggregate all findings and determine verdict.
145
+
146
+ ## Judgment Criteria
147
+
148
+ | Verdict | Condition | Action |
149
+ |---------|-----------|--------|
150
+ | **PASS** | Critical=0 且 Important=0 | 进入 spec-writer 阶段 |
151
+ | **PASS_WITH_WARNINGS** | Critical=0 且 Important>0 | 警告项交人工裁定,不阻断 |
152
+ | **FAIL** | Critical>0 | 必须修正后重新审查 |
153
+
154
+ **FAIL only triggered by Critical findings**. Important findings (template non-compliance, convention violations) generate warnings but do not block.
155
+
156
+ ## Output Format
157
+
158
+ ```markdown
159
+ # Architecture Auto-Review Report
160
+
161
+ ## Metadata
162
+ - **PRD**: {prd_path}
163
+ - **Plan**: {plan_path}
164
+ - **Change Brief**: {change_brief_path}
165
+ - **Architecture Dir**: {architecture_dir}
166
+ - **Global Arch Dir**: {global_arch_dir}
167
+ - **Review round**: {N}
168
+ - **Reviewer**: architecture-reviewer agent (independent, read-only)
169
+ - **Timestamp**: {ISO 8601}
170
+
171
+ ## Verdict: {PASS | PASS_WITH_WARNINGS | FAIL}
172
+
173
+ | Severity | Count |
174
+ |----------|-------|
175
+ | Critical | {n} |
176
+ | Important | {n} |
177
+ | Minor | {n} |
178
+
179
+ ## A1 产出完整性 — {PASS/FAIL}
180
+ | File | Exists | Non-empty | Frontmatter | Lines | Status |
181
+ |------|--------|-----------|-------------|-------|--------|
182
+ | architecture.md | ✅ | ✅ | ✅ | {n} | OK |
183
+ | database.md | ✅ | ✅ | ✅ | {n} | OK |
184
+ | api.md | ✅ | ❌ | — | 0 | ❌ FAIL |
185
+
186
+ ## A2 SQL 制品完整性 — {PASS/FAIL}
187
+ | SQL File | Referenced In | Exists | Non-empty | Syntax | Status |
188
+ |----------|--------------|--------|-----------|--------|--------|
189
+ | sql/ddl/new_tables.sql | database.md §3 | ✅ | ✅ | ✅ | OK |
190
+ | sql/migration/data.sql | database.md §5 | ❌ | — | — | ❌ FAIL |
191
+
192
+ ## A3 模板合规性 — {PASS/WARN}
193
+ | File | Template | Required Sections | Missing Sections | Status |
194
+ |------|----------|-------------------|-----------------|--------|
195
+ | architecture.md | templates/architecture.md | Aggregates, BC, CQRS, Context Map | — | ✅ |
196
+ | database.md | templates/database.md | Write Model, Read Model, Schema, Migration | Migration Strategy | ⚠️ |
197
+
198
+ ## A4 需求覆盖 — {PASS/FAIL} ({m}/{n} covered)
199
+ | Requirement | Source | Architecture Coverage | Status |
200
+ |-------------|--------|----------------------|--------|
201
+ | 新增 XX 聚合 | brief §2.1 | architecture.md §1 | ✅ |
202
+ | 修改 YY 表结构 | brief §2.3 | database.md §2 | ✅ |
203
+ | 新增 ZZ API | brief §2.5 | — (not covered) | ❌ |
204
+
205
+ ## A5 基线一致性 — {PASS/FAIL}
206
+ | Check Item | Global Baseline | Incremental Design | Status |
207
+ |-----------|----------------|-------------------|--------|
208
+ | Aggregate naming | ARCHITECTURE.md §2 | architecture.md §1 | ✅ Consistent |
209
+ | Table naming | PHYSICAL-MODEL.md | database.md §3 | ✅ Consistent |
210
+ | API routing | API-INDEX.md | api.md §2 | ⚠️ Conflict |
211
+
212
+ ## A6 conventions 合规 — {PASS/WARN}
213
+ | Convention File | Rule | Deliverable | Compliance | Status |
214
+ |----------------|------|-------------|-----------|--------|
215
+ | db-design.md | t_ prefix | database.md §3 | ✅ Compliant | ✅ |
216
+ | api-conventions.md | hasAuthority | api.md §2 | ❌ Not used | ⚠️ |
217
+
218
+ ## Inconsistency Summary
219
+ | # | Dim | Severity | Baseline Source | Deliverable Location | Description |
220
+ |---|-----|----------|----------------|---------------------|-------------|
221
+ | 1 | A1 | Critical | — | api.md | api.md is empty |
222
+ | 2 | A4 | Critical | brief §2.5 | — | ZZ API not covered in architecture |
223
+ | 3 | A6 | Important | conventions/api-conventions.md | api.md §2 | Permission declaration not using hasAuthority |
224
+
225
+ ## Coverage Statistics
226
+ | Dimension | Required | Covered | Rate |
227
+ |-----------|----------|---------|------|
228
+ | Aggregates | {n} | {m} | {percent}% |
229
+ | Bounded Contexts | {n} | {m} | {percent}% |
230
+ | APIs | {n} | {m} | {percent}% |
231
+ | DB Changes | {n} | {m} | {percent}% |
232
+ ```
233
+
234
+ ## Red Lines
235
+
236
+ **DO:**
237
+ - Read the change brief BEFORE reading the architecture deliverables — establish requirements baseline first
238
+ - Read global architecture baseline BEFORE checking consistency — understand As-Is before judging To-Be
239
+ - Cite baseline source (global file:section) AND deliverable location (file:line) for every finding
240
+ - Load and check conventions when conventions_config is provided
241
+ - Build an explicit coverage matrix for A4, not a vibes-based assessment
242
+ - Give a clear, unambiguous verdict
243
+
244
+ **DON'T:**
245
+ - Modify any file — you are read-only, report goes in your response
246
+ - Guess or infer requirements not explicitly in change-brief or plan
247
+ - FAIL on Important findings — FAIL is Critical-only
248
+ - Skip the Pre-check phase and jump straight to semantic analysis
249
+ - Omit the baseline source reference for any finding
250
+ - Evaluate architecture "elegance" or "beauty" — those are subjective, for human review only
251
+ - Check convention files that don't exist — if conventions_config is empty, skip A6 silently
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.27.2`
129
+ - Current: `v0.28.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
  {
2
2
  "name": "team-flow",
3
3
  "description": "Unified workflow plugin: team-flow (spec-driven dev) + compound-engineering core subset + architecture-design (4A/DDD) + prototype (local HTML). 17 skills, one install.",
4
- "version": "0.27.2",
4
+ "version": "0.28.0",
5
5
  "contextFileName": "GEMINI.md"
6
6
  }
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env bash
2
- # v0.27.2: auto-sync CLI version with plugin version
2
+ # v0.28.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.27.2"
8
+ PLUGIN_VERSION="0.28.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.27.2.
6
+ Current version: v0.28.0.
7
7
 
8
8
  ## Key Documents
9
9
  - README.md: Chinese homepage with full usage guide and FAQ
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xulthekl/team-flow",
3
- "version": "0.27.2",
4
- "description": "Unified plugin (23 skills + 8 agents) integrating team-flow, compound-engineering, architecture-design, prototype, design-system, workflow-orchestrator, workflow-bootstrap, e2e, session-handoff, workflow-feedback for multi-agent coding tools.",
3
+ "version": "0.28.0",
4
+ "description": "Unified plugin (23 skills + 10 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",
7
7
  "bin": {
package/plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "team-flow",
3
- "version": "0.27.2",
4
- "description": "Unified workflow plugin: team-flow (spec-driven dev: TDD/SDD/code-review/debugging) + compound-engineering core subset (brainstorm/plan/compound/strategy/ideate/proof, global compounding) + architecture-design (4A+DDD incremental design & global compounding) + prototype (local HTML prototype, zero external deps) + e2e (Playwright E2E, AC-driven) + workflow-orchestrator (product-level workflow orchestration) + workflow-bootstrap (existing project onboarding) + session-handoff (context transfer) + workflow-feedback (issue tracking). 23 skills + 8 agents, one install.",
3
+ "version": "0.28.0",
4
+ "description": "Unified workflow plugin: team-flow (spec-driven dev: TDD/SDD/code-review/debugging) + compound-engineering core subset (brainstorm/plan/compound/strategy/ideate/proof, global compounding) + architecture-design (4A+DDD incremental design & global compounding) + prototype (local HTML prototype, zero external deps) + e2e (Playwright E2E, AC-driven) + workflow-orchestrator (product-level workflow orchestration) + workflow-bootstrap (existing project onboarding) + session-handoff (context transfer) + workflow-feedback (issue tracking). 23 skills + 10 agents, one install.",
5
5
  "author": {
6
6
  "name": "LT"
7
7
  },
@@ -22,6 +22,12 @@ const DEFAULTS = {
22
22
  prd: {
23
23
  template: 'templates/prd.md',
24
24
  },
25
+ conventions: {
26
+ // 项目级规范文件路径映射(v0.11 §33)
27
+ // key = 规范类别,value = 相对于项目根的路径
28
+ // 各 skill 上下文加载时按 phase 过滤注入
29
+ // 示例: { database: ".team-flow/conventions/db-design.md", ... }
30
+ },
25
31
  };
26
32
 
27
33
  export const MODEL_PROFILES = Object.freeze([
@@ -156,6 +156,12 @@ change 进入 closing 阶段时,由 release-archivist 调用 `tf arch-merge` C
156
156
 
157
157
  architecture-design 执行时的上下文组装:
158
158
 
159
+ **conventions 注入(v0.11 §33)**:
160
+ 1. 通过 `tf runtime config --get conventions` 获取 conventions 配置
161
+ 2. 按 phase 过滤:`database` / `backend` / `api`
162
+ 3. 读取匹配的 `.team-flow/conventions/*.md` 文件
163
+ 4. 注入为架构决策约束(advisory 级)
164
+
159
165
  **始终加载**:
160
166
  1. `Read docs/architecture/INDEX.md`(~50行摘要)
161
167
  2. `Read changes/<name>/change-brief.md`(如有)
@@ -177,3 +183,28 @@ architecture-design 执行时的上下文组装:
177
183
 
178
184
  ## Scope & Limits
179
185
  本 skill 覆盖 4A+DDD 架构设计方法及其与 team-flow/compound-engineering 的衔接。落地实现结合项目具体工具;超出本范围见相关 skill 或直接问 agent。
186
+
187
+ ## 阶段转换前规范建议(v0.11 §33,被动式自动沉淀)
188
+
189
+ architecture-design 阶段即将结束、进入 spec-writer 之前,执行以下规范沉淀协议:
190
+
191
+ 1. **回顾本阶段工作**:扫描本阶段所有用户纠正、CC 观察到的项目既有模式、踩坑记录
192
+ 2. **生成规范建议列表**:提取跨 change 可复用的规范条目(排除仅适用于本次 change 的特定业务逻辑)
193
+ 3. **去重检查**:对比已有 convention 文件,排除已存在的条目
194
+ 4. **向用户展示建议**:
195
+
196
+ ```
197
+ 📋 架构设计阶段规范建议
198
+ ┌───┬──────────────────────────────────────────────────┐
199
+ │ # │ 规范条目 │
200
+ ├───┼──────────────────────────────────────────────────┤
201
+ │ 1 │ [条目描述] │
202
+ │ │ 来源:[来源说明] │
203
+ │ │ 建议写入:.team-flow/conventions/[目标文件] │
204
+ └───┴──────────────────────────────────────────────────┘
205
+
206
+ 请逐条确认(接受/拒绝/修改),或输入「全部接受」:
207
+ ```
208
+
209
+ 5. **用户确认后写入**:接受的条目追加到对应 convention 文件,更新 YAML frontmatter 的 date 字段
210
+ 6. **无建议时静默跳过**:如果本阶段没有可沉淀的规范,不弹出确认,直接进入下一阶段
@@ -0,0 +1,26 @@
1
+ ---
2
+ phase: api
3
+ domain: api
4
+ severity: high
5
+ date: 2026-07-31
6
+ ---
7
+
8
+ # API 规范
9
+
10
+ > 本文件由 team-flow 被动式自动沉淀机制维护(v0.11 §33)。
11
+ > 请勿手动编辑模板——此文件作为参考模板,实际项目规范在 `.team-flow/conventions/api-conventions.md` 中维护。
12
+
13
+ ## 注解风格
14
+ - (项目级规范在此补充,如:使用 @PostResource / @GetResource 注解)
15
+
16
+ ## 权限声明
17
+ - (项目级规范在此补充,如:统一使用 hasAuthority 进行权限声明)
18
+
19
+ ## 请求/响应格式
20
+ - (项目级规范在此补充)
21
+
22
+ ## 错误码规范
23
+ - (项目级规范在此补充)
24
+
25
+ ## 版本管理
26
+ - (项目级规范在此补充)
@@ -0,0 +1,26 @@
1
+ ---
2
+ phase: backend
3
+ domain: backend
4
+ severity: high
5
+ date: 2026-07-31
6
+ ---
7
+
8
+ # 后端分层规范
9
+
10
+ > 本文件由 team-flow 被动式自动沉淀机制维护(v0.11 §33)。
11
+ > 请勿手动编辑模板——此文件作为参考模板,实际项目规范在 `.team-flow/conventions/backend-patterns.md` 中维护。
12
+
13
+ ## 分层架构
14
+ - (项目级规范在此补充,如:DDD 四层——web / application / domain / infrastructure)
15
+
16
+ ## Assembler 层
17
+ - (项目级规范在此补充,如:必须包含 assembler 层,使用 MapStruct)
18
+
19
+ ## 异常处理
20
+ - (项目级规范在此补充)
21
+
22
+ ## 日志规范
23
+ - (项目级规范在此补充)
24
+
25
+ ## 依赖注入
26
+ - (项目级规范在此补充)
@@ -0,0 +1,31 @@
1
+ ---
2
+ phase: database
3
+ domain: db
4
+ severity: high
5
+ date: 2026-07-31
6
+ ---
7
+
8
+ # DB 设计规范
9
+
10
+ > 本文件由 team-flow 被动式自动沉淀机制维护(v0.11 §33)。
11
+ > 请勿手动编辑模板——此文件作为参考模板,实际项目规范在 `.team-flow/conventions/db-design.md` 中维护。
12
+
13
+ ## 表命名
14
+ - (项目级规范在此补充,如:表名必须以 `t_` 前缀开头)
15
+
16
+ ## 主键策略
17
+ - (项目级规范在此补充,如:主键使用 sequence generator 表生成)
18
+
19
+ ## 审计字段
20
+ - (项目级规范在此补充,如:所有表必须包含 BaseEntity 审计字段)
21
+
22
+ ## DDL 管理
23
+ - 所有 DDL 必须写入 `schema-baseline.sql`
24
+ - 增量变更必须提供 migration 脚本
25
+ - SQL 文件放在 `changes/<name>/architecture/sql/` 目录
26
+
27
+ ## 索引规范
28
+ - (项目级规范在此补充)
29
+
30
+ ## 字段命名
31
+ - (项目级规范在此补充,如:snake_case、禁止使用 SQL 保留字)
@@ -0,0 +1,26 @@
1
+ ---
2
+ phase: frontend
3
+ domain: frontend
4
+ severity: medium
5
+ date: 2026-07-31
6
+ ---
7
+
8
+ # 前端规范
9
+
10
+ > 本文件由 team-flow 被动式自动沉淀机制维护(v0.11 §33)。
11
+ > 请勿手动编辑模板——此文件作为参考模板,实际项目规范在 `.team-flow/conventions/frontend-patterns.md` 中维护。
12
+
13
+ ## 框架选型
14
+ - (项目级规范在此补充,如:Vue 2 Options API)
15
+
16
+ ## UI 组件库
17
+ - (项目级规范在此补充,如:Ant Design Vue 1.7)
18
+
19
+ ## 权限指令
20
+ - (项目级规范在此补充,如:使用 v-has 权限指令)
21
+
22
+ ## 状态管理
23
+ - (项目级规范在此补充)
24
+
25
+ ## 路由规范
26
+ - (项目级规范在此补充)
@@ -17,6 +17,11 @@ When `architecture/sql/` exists, also read:
17
17
 
18
18
  Check workflow mode first: `tf state get <change-dir> workflow`. If `tweak` → direct edit mode. If `hotfix` or `full` → standard contract-first discipline.
19
19
 
20
+ **conventions 注入(v0.11 §33)**:
21
+ - 通过 `tf runtime config --get conventions` 获取 conventions 配置
22
+ - 按 phase 过滤:`backend` / `api`
23
+ - 注入为实施约束(代码产出时遵循)
24
+
20
25
  Branch/worktree preflight before ANY implementation edit (mandatory — do not skip):
21
26
  1. Run the isolation check:
22
27
  ```bash
@@ -165,3 +170,28 @@ Don't report completion until: tests pass, contract obligations satisfied, revie
165
170
  - **Parse failures**: Stop and report exact line/format issue. Route back to `contract-builder`.
166
171
  - **Missing artifacts**: Route back to appropriate upstream skill. Don't guess.
167
172
  - **User interruption**: Progress ledger enables recovery. Check ledger on resume.
173
+
174
+ ## 阶段转换前规范建议(v0.11 §33,被动式自动沉淀)
175
+
176
+ build-executor 阶段即将结束、进入 closing 之前,执行以下规范沉淀协议:
177
+
178
+ 1. **回顾本阶段工作**:扫描本阶段所有用户纠正、CC 观察到的项目既有模式、踩坑记录
179
+ 2. **生成规范建议列表**:提取跨 change 可复用的规范条目(排除仅适用于本次 change 的特定业务逻辑)
180
+ 3. **去重检查**:对比已有 convention 文件,排除已存在的条目
181
+ 4. **向用户展示建议**:
182
+
183
+ ```
184
+ 📋 构建执行阶段规范建议
185
+ ┌───┬──────────────────────────────────────────────────┐
186
+ │ # │ 规范条目 │
187
+ ├───┼──────────────────────────────────────────────────┤
188
+ │ 1 │ [条目描述] │
189
+ │ │ 来源:[来源说明] │
190
+ │ │ 建议写入:.team-flow/conventions/[目标文件] │
191
+ └───┴──────────────────────────────────────────────────┘
192
+
193
+ 请逐条确认(接受/拒绝/修改),或输入「全部接受」:
194
+ ```
195
+
196
+ 5. **用户确认后写入**:接受的条目追加到对应 convention 文件,更新 YAML frontmatter 的 date 字段
197
+ 6. **无建议时静默跳过**:如果本阶段没有可沉淀的规范,不弹出确认,直接进入下一阶段
@@ -53,6 +53,11 @@ Read `docs/solutions/INDEX.md` if it exists. Filter entries where `phase = spec
53
53
 
54
54
  `architecture/` 目录不存在时(判定为 `skipped`)跳过本段。
55
55
 
56
+ **conventions 注入(v0.11 §33)**:
57
+ - 通过 `tf runtime config --get conventions` 获取 conventions 配置
58
+ - 读取所有匹配的 convention 文件
59
+ - 注入为规格约束(specs/design/tasks 产出时遵循)
60
+
56
61
  ## Config Check
57
62
 
58
63
  Run: `tf runtime config --get artifacts.order` — generate in configured order (default: proposal → specs → design → tasks). Run with `artifacts.skip` — skip any listed artifacts.
@@ -149,3 +154,28 @@ Do not start implementation after writing planning artifacts. Once stable, valid
149
154
  - **Missing templates**: Fall back to artifact structure defined in this skill
150
155
  - **User interruption**: Artifacts on disk are the recovery checkpoint; resume from first missing/incomplete one
151
156
  - **Validation failure**: Fix before handoff — do not hand off broken artifacts
157
+
158
+ ## 阶段转换前规范建议(v0.11 §33,被动式自动沉淀)
159
+
160
+ spec-writer 阶段即将结束、进入 build-executor 之前,执行以下规范沉淀协议:
161
+
162
+ 1. **回顾本阶段工作**:扫描本阶段所有用户纠正、CC 观察到的项目既有模式、踩坑记录
163
+ 2. **生成规范建议列表**:提取跨 change 可复用的规范条目(排除仅适用于本次 change 的特定业务逻辑)
164
+ 3. **去重检查**:对比已有 convention 文件,排除已存在的条目
165
+ 4. **向用户展示建议**:
166
+
167
+ ```
168
+ 📋 规格编写阶段规范建议
169
+ ┌───┬──────────────────────────────────────────────────┐
170
+ │ # │ 规范条目 │
171
+ ├───┼──────────────────────────────────────────────────┤
172
+ │ 1 │ [条目描述] │
173
+ │ │ 来源:[来源说明] │
174
+ │ │ 建议写入:.team-flow/conventions/[目标文件] │
175
+ └───┴──────────────────────────────────────────────────┘
176
+
177
+ 请逐条确认(接受/拒绝/修改),或输入「全部接受」:
178
+ ```
179
+
180
+ 5. **用户确认后写入**:接受的条目追加到对应 convention 文件,更新 YAML frontmatter 的 date 字段
181
+ 6. **无建议时静默跳过**:如果本阶段没有可沉淀的规范,不弹出确认,直接进入下一阶段
@@ -39,6 +39,9 @@ Do NOT invoke for:
39
39
  ### S1: 路径路由器
40
40
  **先做需求选择**(v0.15.0 多需求):读 `.team-flow/registry.yaml`,确定 `active_requirement`(多需求则询问操作哪个/新建)。再判断 7 种入口路径之一;检查 baseline.md / CONCEPTS.md 并注入;复利注入(INDEX.md top-5)。**路由结果必须向用户显式确认**(路由是建议非决定)。详见 `references/s1-path-router.md`。
41
41
 
42
+ **conventions 注入(v0.11 §33)**:
43
+ - 读取 conventions 配置,注入为需求分析上下文
44
+
42
45
  ### S2: PRD + 原型阶段
43
46
 
44
47
  **⛔ MANDATORY:执行S2阶段前,必须先读取 `references/s2-prd-prototype-loop.md`**
@@ -180,3 +183,28 @@ plan_hash: sha256:<plan.md 内容摘要> # 检测产品层改动后变更层
180
183
  1. 当前所处阶段(S1-S5)与 `.team-flow/requirements/<req-id>/orchestrator.yaml` 状态
181
184
  2. 已产出的制品(PRD/原型/plan/changes)
182
185
  3. 下一步建议(调用哪个 skill / 进入哪个 change)
186
+
187
+ ## 阶段转换前规范建议(v0.11 §33,被动式自动沉淀)
188
+
189
+ workflow-orchestrator S1 阶段即将结束、进入 S2 之前,执行以下规范沉淀协议:
190
+
191
+ 1. **回顾本阶段工作**:扫描本阶段所有用户纠正、CC 观察到的项目既有模式、踩坑记录
192
+ 2. **生成规范建议列表**:提取跨 change 可复用的规范条目(排除仅适用于本次 change 的特定业务逻辑)
193
+ 3. **去重检查**:对比已有 convention 文件,排除已存在的条目
194
+ 4. **向用户展示建议**:
195
+
196
+ ```
197
+ 📋 需求编排阶段规范建议
198
+ ┌───┬──────────────────────────────────────────────────┐
199
+ │ # │ 规范条目 │
200
+ ├───┼──────────────────────────────────────────────────┤
201
+ │ 1 │ [条目描述] │
202
+ │ │ 来源:[来源说明] │
203
+ │ │ 建议写入:.team-flow/conventions/[目标文件] │
204
+ └───┴──────────────────────────────────────────────────┘
205
+
206
+ 请逐条确认(接受/拒绝/修改),或输入「全部接受」:
207
+ ```
208
+
209
+ 5. **用户确认后写入**:接受的条目追加到对应 convention 文件,更新 YAML frontmatter 的 date 字段
210
+ 6. **无建议时静默跳过**:如果本阶段没有可沉淀的规范,不弹出确认,直接进入下一阶段
@@ -5,10 +5,12 @@
5
5
  ## Route to need-explorer
6
6
  Change is fuzzy, scope unclear, comparing options, no stable change name.
7
7
 
8
- ## Route to architecture-design (v0.9 §26)
8
+ ## Route to architecture-design (v0.9 §26, v0.11 §34 审查增强)
9
9
 
10
10
  Guard: `arch_design_decision` in `.team-flow.yaml` is `null` → must run before spec-writer.
11
11
 
12
+ ### Step 1: Dispatch architecture-design sub-agent
13
+
12
14
  Dispatch `architecture-design` as sub-agent with inputs:
13
15
  - `change-brief.md`(scope / AC / 技术方向)
14
16
  - `prd/vN/plan.md` 高阶技术设计段
@@ -26,9 +28,38 @@ artifacts: # required 时必填
26
28
  - architecture/api.md
27
29
  ```
28
30
 
29
- **Reasonableness check**(workflow-start 确认后写入 yaml):
31
+ ### Step 2: Auto-review (v0.11 §34, decision=required 时触发)
32
+
33
+ When `decision: required`, dispatch `architecture-reviewer` as sub-agent with inputs:
34
+ - `prd_path`, `plan_path`, `change_brief_path`
35
+ - `architecture_dir`(Step 1 产出目录)
36
+ - `global_arch_dir`(`docs/architecture/`)
37
+ - `conventions_config`(从 `team-flow.config.json` 读取)
38
+
39
+ **交接后产物校验**(defense in depth):
40
+ ```bash
41
+ test -f <architecture_dir>/architecture.md && test -s <architecture_dir>/architecture.md && echo OK
42
+ ```
43
+ - OK → dispatch reviewer
44
+ - 缺失/为空 → **不派 reviewer**,resume architecture-design 补全
45
+
46
+ **审查循环**(≤3 轮 + 收敛检测):
47
+ ```
48
+ reviewer 报告 → FAIL → 不一致项交给 architecture-design 修正 → 重新审查
49
+ → 收敛(不一致项缩小)→ 继续循环
50
+ → 不收敛(连续两轮不一致项集合无缩小)→ 立即转人工
51
+ → 满 3 轮仍 FAIL → 转人工
52
+ reviewer 报告 → PASS / PASS_WITH_WARNINGS → 进入 Step 3
53
+ ```
54
+
55
+ 报告落盘到 `changes/<name>/architecture/auto-review.md`。
56
+
57
+ ### Step 3: Reasonableness check
58
+
59
+ workflow-start 确认后写入 yaml:
30
60
  - `skipped` + reason inconsistent with brief/plan scope → **BLOCK**(如 scope 含"新增 API"但 reason 说"不涉及架构变更")
31
61
  - `required` + artifacts files missing on disk → **BLOCK**
62
+ - `required` + auto-review FAIL → **BLOCK**(修正后再写入)
32
63
  - `null`(未判定)→ **BLOCK**
33
64
 
34
65
  ```bash
@@ -39,7 +70,7 @@ tf state set <change-dir> arch_design_timestamp $(date -u +%Y-%m-%dT%H:%M:%SZ)
39
70
  tf state set <change-dir> arch_design_artifacts "architecture/architecture.md,architecture/database.md,architecture/api.md"
40
71
  ```
41
72
 
42
- **hotfix / tweak 不豁免**:同样过 architecture-design 子代理判断门。
73
+ **hotfix / tweak 不豁免**:同样过 architecture-design 子代理判断门(hotfix 可能正是架构缺陷导致)。
43
74
 
44
75
  ## Route to spec-writer
45
76
  Guard: `tf runtime guard check <dir> exploring specifying --json` → fail = BLOCK.