@xulthekl/team-flow 0.28.0 → 0.28.1

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.
@@ -51,6 +51,66 @@ Scientific method: form a single hypothesis ("I think X is the root cause becaus
51
51
 
52
52
  3+ failed fixes = architectural problem. Each fix revealing new problems elsewhere = wrong architecture. Record: `tf state set <change-dir> dp_5_result <decision>`. Discuss with user before attempting more fixes.
53
53
 
54
+ ## Report Format
55
+
56
+ Write the investigation report with this structure:
57
+
58
+ ```markdown
59
+ # Bug Investigation Report
60
+
61
+ ## Summary
62
+ [One-paragraph description of the bug and investigation outcome]
63
+
64
+ ## Symptom
65
+ - **What happens:** [Exact observed behavior]
66
+ - **Expected behavior:** [What should happen]
67
+ - **Reproduction:** [Exact steps, commands, or conditions]
68
+ - **Frequency:** [Always / intermittent / specific conditions]
69
+
70
+ ## Investigation Trail
71
+ [Chronological record of what you investigated, in order]
72
+
73
+ ### Phase 1: Root Cause Investigation
74
+ - Error messages analyzed: [details]
75
+ - Recent changes checked: [git log summary, relevant commits]
76
+ - Data flow traced: [path from symptom to source]
77
+ - Component boundaries tested: [if applicable]
78
+
79
+ ### Phase 2: Pattern Analysis
80
+ - Working examples found: [file references]
81
+ - Key differences identified: [list]
82
+
83
+ ### Phase 3: Hypotheses Tested
84
+ | # | Hypothesis | Test | Result |
85
+ |---|-----------|------|--------|
86
+ | 1 | [hypothesis] | [what you did] | Confirmed / Rejected |
87
+ | 2 | ... | ... | ... |
88
+
89
+ ## Root Cause
90
+ [Clear, specific statement of the root cause with evidence]
91
+ - **Location:** [file:line]
92
+ - **Mechanism:** [How the bug works, step by step]
93
+ - **Evidence:** [What proves this is the cause]
94
+
95
+ ## Recommended Fix
96
+ [Suggested approach — describe what to change and why, but do NOT implement it]
97
+ - **Fix location:** [where to change]
98
+ - **Fix approach:** [what to change]
99
+ - **Test to add:** [regression test suggestion]
100
+ - **Risk assessment:** [what could go wrong with this fix]
101
+
102
+ ## DP-5 Escalation
103
+ [Only if 3+ hypotheses failed — architectural concern details]
104
+ ```
105
+
106
+ ## Writing Investigation Notes
107
+
108
+ During investigation, you may write intermediate notes to track your progress:
109
+ - Use a working file (e.g., `investigation-notes.md`) for scratch work
110
+ - Record each hypothesis, test, and result as you go
111
+ - This protects against losing your train of thought on complex investigations
112
+ - Clean up or consolidate into the final report when done
113
+
54
114
  ## Red Flags — Return to Phase 1
55
115
 
56
116
  "Quick fix, investigate later" / "Just try changing X" / "Skip the test, I'll verify manually" / "It's probably X, let me fix that" / "I don't fully understand but this might work" / "One more fix attempt" (after 2+) / Proposing solutions before tracing data flow.
@@ -75,3 +135,18 @@ If truly environmental/timing-dependent/external: document what you investigated
75
135
  - **Parse failures**: Report raw output, ask for clarification — don't guess
76
136
  - **Missing files**: Escalate immediately — not a normal debugging scenario
77
137
  - **User interruption**: Re-read investigation report on resume, continue from last completed phase
138
+
139
+ ## Quality Standards
140
+
141
+ 1. **Evidence over intuition**: Every claim in your report must be backed by observable evidence (test output, code path, git history)
142
+ 2. **Specificity**: Name exact files, line numbers, functions, and values — not "somewhere in the auth module"
143
+ 3. **Completeness**: Document what you ruled OUT, not just what you found. Negative results are valuable.
144
+ 4. **Actionability**: Your recommended fix should be specific enough that an implementer can act on it without re-investigating
145
+ 5. **Honesty**: If you cannot determine root cause, say so explicitly and document what you DID investigate. 95% of "no root cause found" cases are incomplete investigation — but the remaining 5% are genuinely environmental/timing/external.
146
+
147
+ ## Edge Cases
148
+
149
+ - **Environmental issues**: If the bug is environment-specific, document the environment differences and suggest environment normalization
150
+ - **Timing/race conditions**: Document the timing window, suggest synchronization or defensive handling
151
+ - **External dependencies**: If the root cause is in a third-party library, document the version, the specific behavior, and suggest workarounds or upstream issues
152
+ - **Cannot reproduce**: Document everything you tried. Suggest monitoring/instrumentation for the next occurrence. Do NOT guess at a cause you cannot verify.
@@ -86,3 +86,98 @@ Suggestion breaks existing functionality, reviewer lacks context, violates YAGNI
86
86
  - **Parse failures**: Report specific file, request regenerated review package
87
87
  - **Missing files**: Regenerate via `scripts/review-package`. Empty diff = nothing to review
88
88
  - **User interruption**: Re-read review report on resume, continue from next unreviewed batch
89
+
90
+ ---
91
+
92
+ ## Review Process (Agent Methodology)
93
+
94
+ The code-reviewer agent follows this 6-step process:
95
+
96
+ ### Step 1: Gather Context
97
+
98
+ 1. Read `change-brief.md` to understand scope and constraints
99
+ 2. Read `specs/*.md` to understand requirements
100
+ 3. Read `design.md` to understand architectural decisions
101
+ 4. Get the list of changed files: `git diff --name-only BASE..HEAD` or from the change directory
102
+
103
+ ### Step 2: Spec Compliance Check
104
+
105
+ For each requirement in specs/:
106
+ 1. Locate the corresponding implementation
107
+ 2. Check if the implementation faithfully reflects the spec
108
+ 3. Note any deviations (with justification or flag as Critical)
109
+ 4. Build a compliance matrix: spec requirement → implementation status
110
+
111
+ ### Step 3: Code Quality Review
112
+
113
+ Check for:
114
+ - **Readability**: Clear naming, appropriate comments, logical structure
115
+ - **Maintainability**: DRY principles, appropriate abstraction, no code smells
116
+ - **Error handling**: Proper exception handling, meaningful error messages
117
+ - **Performance**: No obvious N+1 queries, no unnecessary loops, appropriate caching
118
+ - **Security**: Input validation, SQL injection prevention, XSS prevention, auth checks
119
+
120
+ ### Step 4: Architecture Review
121
+
122
+ Check for:
123
+ - **Separation of concerns**: Each module/class has a single responsibility
124
+ - **Dependency direction**: Dependencies flow inward (domain ← application ← infrastructure)
125
+ - **Interface design**: Clean APIs, appropriate abstraction layers
126
+ - **Scalability**: No obvious bottlenecks, appropriate use of async/queue for heavy operations
127
+ - **Consistency**: Follows established patterns in the codebase
128
+
129
+ ### Step 5: Test Coverage Review
130
+
131
+ Check for:
132
+ - **Unit tests**: Each function/method has corresponding unit tests
133
+ - **Integration tests**: API endpoints have integration tests
134
+ - **Edge cases**: Tests cover boundary conditions, error cases
135
+ - **Test quality**: Tests are meaningful (not just "it works"), assertions are specific
136
+
137
+ ### Step 6: Documentation Review
138
+
139
+ Check for:
140
+ - **Code comments**: Complex logic is explained
141
+ - **API documentation**: Endpoints are documented (Swagger/OpenAPI)
142
+ - **README updates**: User-facing changes are documented
143
+ - **Change log**: Significant changes are noted
144
+
145
+ ## Severity Levels
146
+
147
+ | Level | Meaning | Examples |
148
+ |-------|---------|----------|
149
+ | **Critical** | Must fix before merge | Spec violations, bugs, security issues, data loss risks |
150
+ | **Important** | Should fix before next batch | Architecture problems, poor error handling, missing tests |
151
+ | **Minor** | Nice to have, note for later | Code style, optimization opportunities, documentation polish |
152
+
153
+ ## Verdict Criteria
154
+
155
+ | Verdict | Condition |
156
+ |---------|-----------|
157
+ | **PASS** | No Critical or Important findings |
158
+ | **PASS_WITH_WARNINGS** | No Critical, but Important findings exist |
159
+ | **FAIL** | Any Critical finding |
160
+
161
+ ## Calibration Rules
162
+
163
+ 1. **Evidence-based**: Every finding must cite specific file:line
164
+ 2. **Severity-appropriate**: Don't mark style issues as Critical
165
+ 3. **Constructive**: Provide actionable suggestions, not just complaints
166
+ 4. **Context-aware**: Consider the change scope and constraints
167
+ 5. **Spec-grounded**: Spec violations are always Critical (unless explicitly justified)
168
+
169
+ ## Critical Rules
170
+
171
+ **DO:**
172
+ - Read specs and design BEFORE reading implementation
173
+ - Build an explicit spec compliance matrix
174
+ - Cite file:line for every finding
175
+ - Distinguish Critical (spec violation/bug) from Important (architecture/quality)
176
+ - Give a clear, unambiguous verdict
177
+
178
+ **DON'T:**
179
+ - Guess at spec requirements not explicitly stated
180
+ - Mark style issues as Critical (they're Minor)
181
+ - Produce vague findings without file:line references
182
+ - Skip the spec compliance check (it's the core deliverable)
183
+ - Implement fixes (that's the implementer's job after your review)
@@ -103,6 +103,10 @@ prototype/
103
103
  ## 脚手架
104
104
  新建项目:`cp -r references/prototype-scaffold/ <project>/prototype/`,再按 `.team-flow/design-system/` 的设计系统填 token(缺设计系统先用 `/team-flow:design-system` 创建)。
105
105
 
106
+ ## prototype-builder agent 方法论(v0.28.1 §37,Agent/Skill 职责分离)
107
+
108
+ `prototype-builder` agent 通过 `skills: [prototype]` 预加载本 SKILL.md。其详细构建方法论(Hard Constraints / Build Process Steps 0-4 / Seed Composition / P0-P2 Quality Self-Check / Structured Handoff / Deliverable Hard Gate / Decision-Point Interaction)已迁移至 `references/builder-methodology.md`,由 agent 在执行中按需 Read。
109
+
106
110
  ## 方法论参考与归因
107
111
 
108
112
  > ⚠️ **命名区分**:本 skill 负向清单中排除的「Open Design 桌面应用」(nexu-io/open-design 出品的 Electron 桌面设计工作台产品)与 `references/craft/anti-ai-slop.md` 借鉴的「nexu-io/open-design 开源设计方法论」**同名不同义**:
@@ -0,0 +1,138 @@
1
+ # Builder Methodology(prototype-builder agent 详细方法论)
2
+
3
+ > 从 agents/prototype-builder.md 提取的详细构建方法论(v0.28.1 §37 Agent/Skill 职责分离)。
4
+ > Agent prompt 只保留 WHO/WHAT,详细 HOW 在此 reference 中。
5
+
6
+ ## Hard Constraints(零依赖 + 防漂移)
7
+
8
+ 1. **零外部依赖、可离线**:
9
+ - 无 CDN、无外部字体、无外部脚本/样式表。
10
+ - CSS 一律进 `<style>`,JS 一律进 `<script>`,页面内 `<div id="tweaks">` 控件替代云端工具栏。
11
+ - 资源仅来自 `prototype/assets/`(本地)。
12
+ 2. **复用设计系统 token,禁止内联样式漂移**:
13
+ - 渲染 `design-system.md` 的 token 到 `assets/design-tokens.css`(CSS 变量),所有页面/组件通过 `var(--token)` 引用。
14
+ - 颜色/间距/字号/圆角等一律走 token,**禁止**在页面里写死 `#hex` / `padding: 13px` 之类非 token 值。
15
+ - 复用 `components/` 已有组件;新增组件**先沉淀进 design-system 再引用**(如发现 design-system 缺组件,记入 outstanding_questions,不擅自新建漂移组件)。
16
+ 3. **遵循 confirmed_plan**:页面清单、组件清单、导航流以确认方案为准,不自行增删页面。
17
+
18
+ ## Build Process
19
+
20
+ ### Step 0: Precondition Gate(阻断检查)
21
+
22
+ Before writing anything, verify:
23
+ - `design_system_path` exists and is readable → if missing/unreadable, return `status: blocked` (blocker: 设计系统缺失,需先派 design-system-architect).
24
+ - `confirmed_plan` is present and marked confirmed → if absent or explicitly unconfirmed, return `status: blocked` (blocker: 原型方案未确认,需主代理先完成方案评审 + 人工确认).
25
+ - `prd_path` readable → if missing, `status: blocked` (blocker: PRD 缺失).
26
+
27
+ Do NOT proceed past a failed gate.
28
+
29
+ ### Step 1: Render Design Tokens
30
+
31
+ 1. Read `.team-flow/design-system/<variant>.md` + `base.md`(合并 base 品牌层 + 变体端特有层:9 段 schema + palette 5 方向调色板 + aliases 别名层 + extensions 待提升清单).
32
+ 2. Generate/refresh `assets/design-tokens.css` with CSS custom properties for every token (colors incl. palette 50–900 steps, spacing scale, font scale, radii, shadows, durations, A2 派生状态色, B-slot 别名).
33
+ 3. **完整性约束**:design-tokens.css 必须声明全部 A1+A2+B-slot token——agent 把单份 `:root` 块粘进单个 `<style>`,无全局级联,缺一个 token 规则悄悄失效。可运行 `node scripts/guard/design-token-guard.mjs <design-system.md> <design-tokens.css>` 自检。
34
+
35
+ ### Step 1.5: Seed Composition(种子优先,v0.18.0)
36
+
37
+ **不从零写 CSS——从种子模板 + 骨架库组合。**
38
+
39
+ 1. 读 `references/template.html`(至少到 `</style>` 结尾)+ 读 `references/layouts.md`(8 个 section 骨架 + 类清单契约 + 页面类型节奏表)。
40
+ 2. **先选 section 列表再写文案**:按页面类型查节奏表(管理后台列表页 / 表单页 / 仪表盘 / Landing / 文档索引),为每个页面选定 section 组合。选定后**用一句话向主代理报出 section 列表**(写入 `outstanding_questions`,question = "页面 X 计划用 section 组合:hero → log → stats,此刻改向便宜,而不是 200 行 HTML 之后",default_assumption = 按此组合继续)。
41
+ 3. 从 `layouts.md` 粘贴对应骨架到 `<main id="content">`,替换 `[REPLACE]` 槽为 PRD 中的真实、具体文案。
42
+ - **"槽位空着说明选错了布局,换一个,不许编文案。"**
43
+ - 类清单契约:只用 template.html `<style>` 中已定义的类;够不到的类先在页面 `<style>` 定义,绝不凭空发明全局类。
44
+ 4. 纪律约束(来自 layouts.md 各骨架):stats ≤3 个且不编造指标;quote 每页 ≤1 个;accent 每屏 ≤2 处;section 节奏交替(禁止连续同类型)。
45
+
46
+ ### Step 2: Build Structure
47
+
48
+ ```
49
+ prototype/
50
+ ├── index.html # 入口 / 全局导航(列出所有页面,可达)
51
+ ├── pages/ # 每个 confirmed_plan 页面一个 HTML
52
+ ├── components/ # 可复用组件(统一设计系统 token)
53
+ ├── assets/ # design-tokens.css / design-tokens.js
54
+ └── flow.md # 页面跳转 / 用户流(与 PRD 导航一致)
55
+ ```
56
+
57
+ For each page in `confirmed_plan`:
58
+ - Create `pages/<slug>.html`, self-contained (inline `<style>`/`<script>` referencing `var(--token)`).
59
+ - Wire navigation links so every page is reachable from `index.html`.
60
+ - Reflect PRD §4 画面 / §7 功能清单 / §8.4 字段 / §8.2 交互 in the page content.
61
+
62
+ **大产出分片纪律(v0.20.0,防输出预算耗尽/单次 Write 截断)**:规划要**克制**——数据模型/改善方向等推演够用即可,不要把大量输出预算耗在 thinking 阶段的详尽规划上,留足预算给真正 Write 产物。对超大文件(经验阈值 ~800 行,如带完整数据层的 `index.html`)**默认分片写**:
63
+
64
+ 1. 先 `Write` 主体骨架(HTML 结构 + `<style>` token 引用 + 导航 + 空的 `<script>` 数据/渲染占位),落盘一个**可运行的最小入口**;
65
+ 2. 再 `Edit` 分段追加:数据层 → 渲染层 → 各页面/组件,每段追加后文件保持完整;
66
+ 3. **任何一刻被中断,已落盘的骨架都构成有效进展**——配合下方 Deliverable Hard Gate,绝不出现"规划完、产物没写、却报 done"。
67
+
68
+ ### Step 3: Flow + Consistency
69
+
70
+ 1. Write/refresh `flow.md` describing page transitions / user flows, consistent with PRD navigation.
71
+ 2. Self-check (Bash): grep for hardcoded colors/spacing outside tokens; grep for any `http://`/`https://`/CDN/`@import` external references — if found, remove and replace with tokens/local.
72
+ 3. Verify every confirmed page file exists and is linked from `index.html`.
73
+
74
+ ### Step 3.5: P0/P1/P2 Quality Self-Check(v0.18.0)
75
+
76
+ 逐项过 `references/checklist.md`。**P0 用 Bash grep 机械验证**,任一失败 → 自行修正后再提交:
77
+
78
+ - 裸 hex 检查:grep `#[0-9a-fA-F]{3,8}` 在 `:root{}` 块外 = 0 命中
79
+ - 靛蓝黑名单:grep `#6366f1\|#4f46e5\|#4338ca\|#3730a3\|#8b5cf6\|#7c3aed\|#a855f7` = 0 命中
80
+ - emoji 图标:grep `✨\|🚀\|🎯\|⚡\|🔥\|💡` 在 h*/button/li 中 = 0 命中
81
+ - 填充文案:grep `lorem\|功能一\|功能二\|功能三\|placeholder\|示例文本` = 0 命中
82
+ - scrollIntoView:grep `scrollIntoView` = 0 命中(用 `scrollTo({...})` 替代)
83
+ - data-testid:每个顶层 `<section>` 有 `data-testid` 属性
84
+ - accent 超限:每屏 `var(--accent)` 使用 ≤2 处
85
+
86
+ P1 逐项自查(节奏交替 / 标题 ≤14 词 / CTA 说明动作 / hover 态);P2 酌情加分。
87
+ **Anti-slop 两秒直觉检查**:截图后外人能认出是哪个产品?看不出 → 把一个特性格换成只有这个产品才有的东西,去掉一个 accent。
88
+
89
+ ### Step 4: 修正轮(when review_findings provided)
90
+
91
+ - Address each finding on the specific page/component cited.
92
+ - Keep token reuse; do not introduce new inline drift while fixing.
93
+ - Do not touch unrelated pages.
94
+
95
+ ## data-testid Discipline(可选,config 驱动)
96
+
97
+ When the project enables E2E (`prototype.e2e: true` or stated in the plan):
98
+ - 场景级 `S-{nn}-{slug}` / 页面级 `P-{xx}-{slug}` 必带;元素级仅关键交互锚点(提交/主操作/状态切换)。
99
+ - `data-testid` 是纯 HTML 属性,零依赖,守离线约束。
100
+ When not enabled, do not over-tag.
101
+
102
+ ## Structured Handoff(强制,主代理据此编排)
103
+
104
+ 你的 final response 必须是如下结构化交接(JSON 风格描述即可,主代理据此编排):
105
+ ```
106
+ {
107
+ status: "done" | "done_with_questions" | "blocked",
108
+ deliverable: <prototype 入口绝对路径 + 页面/组件清单>,
109
+ blockers: [ { question, why_blocking, options[] } ], # 阻断项:无法继续、必须主代理裁决
110
+ outstanding_questions: [ { question, default_assumption } ], # 非阻断:已按默认假设继续,回主代理批量确认
111
+ summary: <3-5 行 gist>
112
+ }
113
+ ```
114
+
115
+ ### Deliverable Hard Gate(v0.20.0,修订设计 §18.1.1——禁止谎报完成)
116
+
117
+ **返回 `status: done` 的硬前置:你声明的 `deliverable`(`<abs>/prototype/index.html`)必须已 `Write` 落盘且非空。** 终态交接前**必须**自检(Bash):
118
+
119
+ ```bash
120
+ test -f <prototype_root>/index.html && test -s <prototype_root>/index.html && echo OK
121
+ ```
122
+
123
+ - 自检 **OK** 才可返回 `done` / `done_with_questions`。
124
+ - 若核心产物(index.html / confirmed_plan 要求的页面)**尚未落盘或非空**——无论原因是输出预算将尽、单次 Write 担心截断、还是规划过重——**禁止返回 `done`**。改为返回 `status: blocked`,blocker 写明:「核心产物 `<文件>` 未落盘/未完成,原因 `<输出预算不足 | 单次 Write 过大>`,请 resume 续写」,由主代理裁决续跑。
125
+ - **绝不把中间状态汇报(如 "Scaffold is ready… Next I'll write index.html…")当作终态交接返回 done**——那只是进度,不是产物。
126
+
127
+ 规则:非阻断疑问(如某页面状态展示方式未明确→按合理默认实现)→ 按 default_assumption 继续跑完,记入 outstanding_questions(status=done_with_questions);
128
+ 阻断疑问(Precondition Gate 任一输入缺失:设计系统/confirmed_plan/PRD,**或核心产物未落盘**)→ 立即停止,返回 status=blocked + blockers[],绝不臆造 token 或臆测页面,**绝不谎报 done**。你不能调用 AskUserQuestion。
129
+
130
+ ## Decision-Point Interaction(v0.21.0,设计 §22.1.1 stop-and-resume)
131
+
132
+ 你**没有 AskUserQuestion**。绘制中遇到**无法用 default_assumption 化解、必须用户/主代理拍板**的决策点(如:某关键交互/布局有两个合理走向需用户选、方案暴露 PRD 歧义需澄清),**不要猜、也不要直接 terminate 丢上下文**,走中继:
133
+
134
+ 1. **发问即停**:`SendMessage(to: "main")` 发结构化提问 `{ question, why, options[] }`,随后**停止**(任务 completed)。末条消息明示「已发问、等待主代理回传后续跑」——让主代理识别为中继请求,**不是终态交接**(区别于上面的 `done/blocked`)。
135
+ 2. **被唤醒续跑**:主代理代问用户后会 `SendMessage` 回传答案并**自动 resume 你**,你带答案从断点继续绘制(上下文经 transcript 保留)。
136
+ 3. **应答校验(正确优先)**:收到回传时核对「这是否对应我实际发出的提问」;**不匹配(无主答案/串线)→ 拒绝将错就错**,按 default_assumption 继续或重新发问,并在 summary 标注。
137
+
138
+ **边界**:能用 `default_assumption` 化解的非阻断疑问 → 照旧跑完记入 `outstanding_questions`(不必发问);Precondition Gate 输入缺失等硬阻断 → 照旧 `blocked` 终态返回。stop-and-resume **仅用于"需真实用户决策、且默认假设不安全"的中途点**。harness 不支持 resume 时,降级为 `blocked` + 主代理携答案重派。
@@ -55,8 +55,16 @@ Validate mode against artifact content. If hotfix/tweak criteria not met → upg
55
55
  ### Route to need-explorer
56
56
  Change is fuzzy, scope unclear, comparing options, no stable change name.
57
57
 
58
- ### Route to architecture-design (v0.9 §26)
59
- Guard: `arch_design_decision` in `.team-flow.yaml` is `null` → must run before spec-writer. Dispatch `architecture-design` as sub-agent; after return, run reasonableness check and write yaml. Full protocol in `references/routing-rules.md`「Route to architecture-design」.
58
+ ### Route to architecture-design (v0.9 §26, v0.28.1 §36 审查增强)
59
+ Guard: `arch_design_decision` in `.team-flow.yaml` is `null` → must run before spec-writer.
60
+
61
+ **Three-step protocol (MUST execute in order)**:
62
+
63
+ 1. **Dispatch**: `architecture-design` as sub-agent → returns `decision` + `reason` + `artifacts`
64
+ 2. **Auto-review** (decision=required 时触发): 校验产物文件存在且非空 → dispatch `architecture-reviewer` sub-agent → FAIL 则循环修正(≤3 轮 + 收敛检测,不收敛转人工)→ 报告落盘 `changes/<name>/architecture/auto-review.md`
65
+ 3. **Reasonableness check + state write**: PASS/PASS_WITH_WARNINGS → write `arch_design_decision` + `arch_review_*` to yaml; skipped + brief 含架构关键词 → BLOCK; required + artifacts 缺失 → BLOCK; required + auto-review FAIL → BLOCK
66
+
67
+ Full protocol in `references/routing-rules.md`「Route to architecture-design」.
60
68
 
61
69
  ### Route to spec-writer
62
70
  Guard: `tf runtime guard check <dir> exploring specifying --json` → fail = BLOCK. **arch_design_decision must not be null** → fail = BLOCK (v0.9 §26). User knows what they want, artifacts missing/incomplete.
@@ -135,6 +143,7 @@ Use content inspection, not timestamps.
135
143
  - No auto-abandon without user confirmation
136
144
  - No merging delta specs from abandoned change
137
145
  - **No routing to spec-writer without architecture-design gate pass** (v0.9 §26): `arch_design_decision` must be `required` or `skipped` (not `null`). hotfix/tweak 不豁免
146
+ - **No arch state write without auto-review PASS** (v0.28.1 §36): when `decision: required`, auto-review MUST complete with PASS or PASS_WITH_WARNINGS before writing `arch_design_decision` to yaml. FAIL → loop fix (≤3 rounds) or escalate to human
138
147
 
139
148
  ## State Writes (v0.22.5 F06 修复)
140
149
 
@@ -154,12 +163,17 @@ workflow-start 负责写入以下字段到 `.team-flow.yaml`:
154
163
  - `dp_7_*`:其他决策点
155
164
 
156
165
  **架构设计门控字段**(v0.9 §26,v0.22.5 F02 修复):
157
- - `arch_design_decision`:`required` | `skipped`(architecture-design 子代理返回,workflow-start 经 reasonableness check 后写入)
166
+ - `arch_design_decision`:`required` | `skipped`(architecture-design 子代理返回,workflow-start 经 auto-review + reasonableness check 后写入)
158
167
  - `arch_design_reason`:判断理由
159
168
  - `arch_design_timestamp`:ISO 8601 时间戳(UTC)
160
169
  - `arch_design_artifacts`:产出路径列表(required 时必填,skipped 时为空)
161
170
 
162
- **职责边界**:architecture-design 负责判断+产出,workflow-start 负责 reasonableness check + 状态写入。详细写入命令见 `references/routing-rules.md`「Route to architecture-design」。
171
+ **架构审查字段**(v0.28.1 §36,decision=required 时写入):
172
+ - `arch_review_verdict`:`PASS` | `PASS_WITH_WARNINGS`(auto-review 最终判定)
173
+ - `arch_review_rounds`:审查轮次(1-3)
174
+ - `arch_review_report`:`architecture/auto-review.md` 路径
175
+
176
+ **职责边界**:architecture-design 负责判断+产出,architecture-reviewer 负责 6 维度审查,workflow-start 负责编排三步协议(dispatch → auto-review → reasonableness check)+ 状态写入。详细写入命令见 `references/routing-rules.md`「Route to architecture-design」。
163
177
 
164
178
  ## Output Standard
165
179
 
@@ -5,7 +5,7 @@
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, v0.11 §34 审查增强)
8
+ ## Route to architecture-design (v0.9 §26, v0.11 §34 审查增强, v0.28.1 §36 主干补强)
9
9
 
10
10
  Guard: `arch_design_decision` in `.team-flow.yaml` is `null` → must run before spec-writer.
11
11
 
@@ -68,6 +68,10 @@ tf state set <change-dir> arch_design_reason "<reason>"
68
68
  tf state set <change-dir> arch_design_timestamp $(date -u +%Y-%m-%dT%H:%M:%SZ)
69
69
  # if required:
70
70
  tf state set <change-dir> arch_design_artifacts "architecture/architecture.md,architecture/database.md,architecture/api.md"
71
+ # if required + auto-review completed (v0.28.1 §36):
72
+ tf state set <change-dir> arch_review_verdict "<PASS|PASS_WITH_WARNINGS>"
73
+ tf state set <change-dir> arch_review_rounds "<N>"
74
+ tf state set <change-dir> arch_review_report "architecture/auto-review.md"
71
75
  ```
72
76
 
73
77
  **hotfix / tweak 不豁免**:同样过 architecture-design 子代理判断门(hotfix 可能正是架构缺陷导致)。