Commit 26f7bfd7b2b61216447b9efb198baf05b1966ffe

Authored by zichun
1 parent ef50b32e

fix(lite): frontend two-layer evidence template, spec section names, proper comm…

…it trailer, verify-fail guidance
skills/coding/feature-review/SKILL.md
@@ -77,7 +77,7 @@ allowed-tools: Read Write Edit Skill Agent Bash(git add *) Bash(git commit *) @@ -77,7 +77,7 @@ allowed-tools: Read Write Edit Skill Agent Bash(git add *) Bash(git commit *)
77 77
78 3. 渲染 `## 验证证据` 节(填入 `${CLAUDE_SKILL_DIR}/templates/feature-review-template.md` 的 verify 部分)。 78 3. 渲染 `## 验证证据` 节(填入 `${CLAUDE_SKILL_DIR}/templates/feature-review-template.md` 的 verify 部分)。
79 79
80 -4. **`exit_code != 0` 或 `failed > 0`**(任一目标失败)→ **停止,不进入 review 阶段**。等待下轮或用户介入 80 +4. **`exit_code != 0` 或 `failed > 0`**(任一目标失败)→ **停止,不进入 review 阶段**。打印一行结构化摘要(`feature-review[verify] 失败: <command> exit=<code> failed=<n>;详见 <reviews 路径>`)+ 提示「修复后重跑 `/erp-workflow:coding-start`(loop 幂等会回到本步)」,然后停下,不调用下游。环境/依赖类失败可主动 `Skill(interrupt-check)`
81 81
82 5. 全部通过 → 进入 review 阶段。 82 5. 全部通过 → 进入 review 阶段。
83 83
skills/coding/feature-review/templates/commit-message-template.md
1 -{{type}}({{scope}}): {{subject}} {{req_id}} 1 +{{type}}({{scope}}): {{subject}}
  2 +
  3 +REQ_ID: {{req_id}}
skills/coding/feature-review/templates/feature-review-template.md
@@ -9,20 +9,33 @@ round: {{round}} @@ -9,20 +9,33 @@ round: {{round}}
9 9
10 ## 验证证据 10 ## 验证证据
11 11
12 -- 命令: `{{command}}`  
13 -- 子会话: {{subagent_id}}  
14 -- 退出码: {{exit_code}}  
15 -- 通过用例数: {{passed}}  
16 -- 失败用例数: {{failed}}  
17 -- 失败列表: {{failed_list}} 12 +> **phase=backend** 只填「单测/集成」一段。
  13 +> **phase=frontend** 填「单测(vitest/jsdom)」+「E2E(Playwright)」两段,两段都通过才算 pass。
  14 +
  15 +### 单测 / 集成(phase=backend 用此段;phase=frontend 填 vitest)
  16 +- 命令: `{{unit_command}}`
  17 +- 子会话: {{unit_subagent_id}}
  18 +- 退出码: {{unit_exit_code}}
  19 +- 通过 / 失败用例数: {{unit_passed}} / {{unit_failed}}
  20 +- 失败列表: {{unit_failed_list}}
18 21
19 关键 stdout 片段 (≤30 行): 22 关键 stdout 片段 (≤30 行):
20 23
21 ``` 24 ```
22 -{{stdout_excerpt}} 25 +{{unit_stdout_excerpt}}
  26 +```
  27 +
  28 +### E2E(仅 phase=frontend;phase=backend 填 N/A)
  29 +- 命令: `{{e2e_command}}`
  30 +- 子会话: {{e2e_subagent_id}}
  31 +- 退出码: {{e2e_exit_code}}
  32 +- 通过 / 失败用例数: {{e2e_passed}} / {{e2e_failed}}
  33 +
  34 +```
  35 +{{e2e_stdout_excerpt}}
23 ``` 36 ```
24 37
25 -结论: {{verify_conclusion}} (pass / fail 38 +结论: {{verify_conclusion}} (pass / fail —— frontend 需两段皆 pass
26 39
27 --- 40 ---
28 41
skills/coding/feature-tdd/SKILL.md
@@ -61,15 +61,15 @@ allowed-tools: Read Write Edit Agent Skill Bash(git add *) Bash(git commit *) @@ -61,15 +61,15 @@ allowed-tools: Read Write Edit Agent Skill Bash(git add *) Bash(git commit *)
61 61
62 c. 在 `impl_file` 处写**最小**实现使测试通过。**严格遵守**: 62 c. 在 `impl_file` 处写**最小**实现使测试通过。**严格遵守**:
63 - `phase=backend`:`impl_file` 不得以 `frontend/` 开头(违反 → 护栏硬停) 63 - `phase=backend`:`impl_file` 不得以 `frontend/` 开头(违反 → 护栏硬停)
64 - - `phase=frontend`:`impl_file` 必须以 `frontend/` 开头(违反 → 护栏硬停);色值用 `var(--color-*)`(来自 spec §六),不硬编码 hex;业务校验按 spec §五 在 form-level 复刻 64 + - `phase=frontend`:`impl_file` 必须以 `frontend/` 开头(违反 → 护栏硬停);色值用 `var(--color-*)`(来自 spec「Design Tokens 引用清单」节),不硬编码 hex;业务校验按 spec「业务规则前端复刻清单」节在 form-level 复刻
65 65
66 d. 再次派发子会话确认通过 66 d. 再次派发子会话确认通过
67 67
68 e. 同一测试 >10 次修复仍失败 → 调用 `Skill(interrupt-check)`(中断 #1:测试反复失败) 68 e. 同一测试 >10 次修复仍失败 → 调用 `Skill(interrupt-check)`(中断 #1:测试反复失败)
69 69
70 f. 按 `${CLAUDE_SKILL_DIR}/templates/commit-message-template.md` 格式 commit: 70 f. 按 `${CLAUDE_SKILL_DIR}/templates/commit-message-template.md` 格式 commit:
71 - - `phase=backend`:`scope` = 任务模块;`subject` ≤ 50 字符;内含 `REQ-XXX-NNN` 标签  
72 - - `phase=frontend`:`scope` = 组件名(如 `dashboard` / `user-form`);`subject` ≤ 50 字符;必含 trailer `REQ_ID: FE-NN` 71 + - `phase=backend`:`scope` = 任务模块;`subject` ≤ 50 字符;trailer `REQ_ID: REQ-XXX-NNN`
  72 + - `phase=frontend`:`scope` = 组件名(如 `dashboard` / `user-form`);`subject` ≤ 50 字符;trailer `REQ_ID: FE-NN`
73 73
74 4. **全部任务完成** → 调用 `Skill(feature-review)` 传入 `{ phase, id }` 74 4. **全部任务完成** → 调用 `Skill(feature-review)` 传入 `{ phase, id }`
75 75
@@ -87,7 +87,7 @@ allowed-tools: Read Write Edit Agent Skill Bash(git add *) Bash(git commit *) @@ -87,7 +87,7 @@ allowed-tools: Read Write Edit Agent Skill Bash(git add *) Bash(git commit *)
87 ``` 87 ```
88 feature-tdd 前端阶段不允许写非前端文件:<impl_file>。前端阶段任务的 impl_file 必须落在 frontend/ 目录下。 88 feature-tdd 前端阶段不允许写非前端文件:<impl_file>。前端阶段任务的 impl_file 必须落在 frontend/ 目录下。
89 ``` 89 ```
90 -- 不硬编码颜色 hex(`phase=frontend`);token 引用必须对齐 spec §六 90 +- 不硬编码颜色 hex(`phase=frontend`);token 引用必须对齐 spec「Design Tokens 引用清单」节
91 91
92 --- 92 ---
93 93
skills/coding/feature-tdd/templates/commit-message-template.md
1 -{{type}}({{scope}}): {{subject}} {{req_id}} 1 +{{type}}({{scope}}): {{subject}}
  2 +
  3 +REQ_ID: {{req_id}}