diff --git a/skills/coding/milestone-tag/SKILL.md b/skills/coding/milestone-tag/SKILL.md deleted file mode 100644 index 3a3a432..0000000 --- a/skills/coding/milestone-tag/SKILL.md +++ /dev/null @@ -1,99 +0,0 @@ ---- -name: milestone-tag -description: 完成报告生成后,把当前分支(module-* 后端 / frontend-phase 前端)本地合并进默认分支并打里程碑 tag(milestone/),把 tag 名回写 docs/08(§ 二 模块行 / § 三 整体里程碑)+ 报告 § ⑫,然后自动回调 coding-start 推进下一阶段。全程无人工介入。 -user-invocable: false -allowed-tools: Read Edit Skill Bash(git *) ---- - -**所有输出必须使用中文。** - -# milestone-tag - -## 前置条件 - -- `module-report` 已生成报告并 commit 到当前分支 -- `test-gate` 绿色,test-gate.md 已 commit 到当前分支 -- 当前分支 = `module-` 或 `frontend-phase`(由 `module-start` 步骤 3 / `frontend-start` 步骤 4 切入) - -## 执行步骤 - -### 步骤 1:验证当前分支并推断 phase - -`git branch --show-current`: - -- 匹配 `module-*` → `phase=backend`,`phase_id=` 去掉 `module-` 前缀,`tag=milestone/` -- 等于 `frontend-phase` → `phase=frontend`,`phase_id=frontend-phase`,`tag=milestone/frontend-phase` -- 其它 → 停下报错(不自动建分支——分支职责在上游 `module-start` / `frontend-start`) - -### 步骤 2:验证 worktree 干净 - -`git status --porcelain` 输出非空 → 停下打印 dirty 文件清单: - -``` -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - [milestone-tag] ⚠️ worktree 不干净,无法集成 + 打里程碑 - - - - 集成前所有 evidence 必须已 commit。检查点: - - test-gate 步骤 3 是否已 commit test-gate.md? - - module-report 步骤 5 是否已 commit 报告 + cross-module log? - - 修复:git add && git commit -m "...",然后重跑 /erp-workflow:coding-start。 -━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -``` - -### 步骤 3:探测本地默认分支 - -无远程,用 `git rev-parse --verify` 依次探测本地 `main` / `master`,取第一个存在的作为 `default_branch`。两者都不存在 → 停下报错。 - -### 步骤 4:本地集成(合并模块分支进默认分支) - -替代原来的"远程 push + 人工 MR merge"——本地完成集成: - -```bash -git checkout -git merge --no-ff -m "merge(): integrate " -``` - -合并冲突 → 停下打印冲突文件清单,引导人工解决后重跑 `/erp-workflow:coding-start`(不自动 `--abort`、不强制覆盖)。 - -### 步骤 5:回写 docs/08 里程碑字段并 commit - -在 `default_branch` 上 `Edit docs/08-模块任务管理.md`: - -- **phase=backend**:在 § 二 中找到当前模块的 ` - 里程碑: —` 改为 ` - 里程碑: milestone/` -- **phase=frontend**:在 § 三 中找到 `- 整体里程碑: —` 改为 `- 整体里程碑: milestone/frontend-phase` - -```bash -git add docs/08-模块任务管理.md -git commit -m "chore(): record milestone/ in docs/08" -``` - -### 步骤 6:在默认分支 HEAD 打 annotated 里程碑 tag - -```bash -git tag -a milestone/ -m "milestone(): 阶段完成" -``` - -tag 已存在(重跑场景)→ 跳过,不重复打。 - -### 步骤 7:追加里程碑 tag 到完成报告 § ⑫ 并 commit - -`Edit docs/superpowers/module-reports/-.md` 的 § ⑫,把 `{{milestone_tag}}` 替换为 `milestone/`(已替换则跳过)。 - -```bash -git add docs/superpowers/module-reports/-.md -git commit -m "docs(): record milestone/ in completion report" -``` - -### 步骤 8:自动回调 coding-start 推进下一阶段 - -本阶段已集成 + 打 tag,**不停下等人工**。立即用 Skill 工具调用 `coding-start`: - -- coding-start 重新做后端 / 前端完成性检查(按 `里程碑:` 字段 + `git tag -l`),未完则推进下一模块 / 前端阶段,全部完成则打印"所有阶段已完成"。 - -## 参考 - -- 上游:`module-report` -- 下游:`coding-start`(自治回调,由其路由下一阶段) diff --git a/skills/coding/milestone/SKILL.md b/skills/coding/milestone/SKILL.md new file mode 100644 index 0000000..2854af6 --- /dev/null +++ b/skills/coding/milestone/SKILL.md @@ -0,0 +1,205 @@ +--- +name: milestone +description: 单元(后端模块 / 前端阶段)全部 approve 后的收尾闸门:子会话跑测试 → 写精简完成报告 → 本地 merge 进默认分支 + 打 milestone/ tag + 回写 docs/08 → 自动回调 coding-start。phase 由当前分支推断。 +user-invocable: false +allowed-tools: Read Write Edit Skill Agent Bash(git *) +--- + +**所有输出必须使用中文。** + +# milestone + +单元(后端模块 / 前端阶段)所有功能完成、所有 approve 齐全后的唯一收尾闸门。把原来三个 skill 的职责合并为四个阶段依次执行: + +1. **推断 phase**(分支名 → backend / frontend) +2. **测试闸门**(子会话跑测试,绿才能继续) +3. **精简完成报告**(6 节,commit 到当前分支) +4. **本地集成 + tag + 回写 docs/08 + 自动回调** + +## 阶段 0:推断 phase 与关键变量 + +执行 `git branch --show-current`: + +- 匹配 `module-` → `phase=backend`,`phase_id=`(去掉 `module-` 前缀),`tag=milestone/`,`test_command=./scripts/test.sh` +- 等于 `frontend-phase` → `phase=frontend`,`phase_id=frontend-phase`,`tag=milestone/frontend-phase`;`test_command` 从 `docs/04-技术规范.md § 零 frontend.test_command` / `frontend.e2e_command` 拼接(缺失则 `pnpm test:ci && pnpm e2e:ci`) +- 其它任何分支 → **硬停**,打印以下诊断并终止(分支切换职责在上游 `phase-driver`,不在此处): + + ``` + [milestone] ⛔ 当前分支 不满足执行条件。 + milestone 只能在 module- 或 frontend-phase 分支上运行。 + 请检查 phase-driver 是否正确切换了分支。 + ``` + +记录变量:`branch`(原始分支名),`phase`,`phase_id`,`tag`,`test_command`。 + +## 阶段 1:测试闸门(子会话硬门) + +> **护栏(绝对规则):绝不在主会话直接执行测试命令。必须通过 Agent 子会话(general-purpose)运行,主会话只接收结构化 JSON 结论。** + +1. 派发 Agent 子会话,传入 `test_command`,要求子会话仅返回以下结构化 JSON(不输出任何描述文字): + + ```json + { + "command": "<实际执行的命令>", + "exit_code": , + "passed": , + "failed": , + "stdout_excerpt": "<最后 30 行,含 FAIL 摘要>" + } + ``` + +2. 接收 JSON 后保存为本地变量(`test_json`),不写独立文件——测试证据将折叠进阶段 2 的报告 `## ② 测试证据` 节。 + +3. **`exit_code = 0`(绿色)** → 进入阶段 2。 + +4. **`exit_code ≠ 0`(红色)** → 打印以下横幅并**停止**,不进入任何下游阶段,不自动重试,不自动修复: + + ``` + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + [milestone] ⚠️ 测试未通过 (phase=) + 命令: + 退出码: + 失败: + 摘要: + + 按失败类型选恢复路径: + ① 测试脆弱(偶发 flakey)→ 重跑 /erp-workflow:coding-start + (phase-driver 幂等:所有单元已 approve 会跳过功能循环,直接重跑本闸门) + ② 真有回归 + 后端:rm docs/superpowers/reviews/*-.md + → 重跑 /erp-workflow:coding-start(phase-driver 视该 REQ 未完成,重走功能循环) + 前端:rm docs/superpowers/reviews/*-FE-.md + → 重跑 /erp-workflow:coding-start(phase-driver 视该 FE 未完成,重走功能循环) + ③ 环境 / 依赖问题(DB 连不上 / 外部 API 失败 / 证书失效 / Playwright 浏览器未装) + → Skill(interrupt-check) 追加 Blocker → 修复环境 + → 参考 .env.local / docs/04 § 零 环境配置 → 重跑 + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + ``` + +## 阶段 2:精简完成报告 + +> **核心约束:只收集 git 摘要,绝不把 diff 正文读入主会话上下文。** + +### 2.1 收集输入 + +**后端(phase=backend):** + +- §③ 文件变更: + ```bash + git diff --stat ..HEAD + git diff --name-status ..HEAD + git log --oneline ..HEAD + ``` + `` = 本模块分支从默认分支分叉的 commit(`git merge-base `) +- §④ Migration:`git diff --name-only --diff-filter=A ..HEAD -- 'sql/migrations/V*.sql'` 列新增 migration 文件名;若有,逐个 Read 第一行作简短说明。 +- §⑤ 偏离:Read `docs/superpowers/reviews/<日期>--*.md`(如存在),提取偏离与取舍说明。 +- §① 覆盖单元:扫 `docs/superpowers/reviews/` 下属于本模块的 `<日期>-.md`,列出 REQ ID 与标题。 + +**前端(phase=frontend):** + +- §③ 文件变更:同上,区间为 `frontend-phase` 分支起点 → HEAD +- §① 覆盖单元:扫 `docs/superpowers/reviews/<日期>-FE-*.md`,按 FE-NN 顺序列出 +- §④ Migration:填 `N/A(前端阶段)` +- §⑤ 偏离:除常规偏离外,额外审查"实际渲染 DOM 与各 FE 关联原型主结构的差异",逐 FE 列出(关联原型清单见每个 FE 的 spec) + +### 2.2 渲染并 commit 报告 + +按 `${CLAUDE_SKILL_DIR}/templates/milestone-report-template.md` 渲染 6 节。`{{milestone_tag}}` 先填占位符 `{{milestone_tag}}`(阶段 3 步骤 6 回写)。 + +写入 `docs/superpowers/module-reports/-.md`。 + +```bash +git add docs/superpowers/module-reports/-.md +git commit -m "docs(): add completion report" +``` + +**此 commit 是必需的**——阶段 3 的 worktree-clean 前置检查依赖于此。 + +## 阶段 3:本地集成 + tag + 回写 docs/08 + +### 3.1 验证 worktree 干净 + +```bash +git status --porcelain +``` + +输出非空 → **停止**,打印 dirty 文件清单: + +``` +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + [milestone] ⚠️ worktree 不干净,无法集成 + 打里程碑 + + + + 集成前所有 evidence 必须已 commit。检查点: + - 阶段 2 是否已 commit 完成报告? + (阶段 1 测试证据已折叠进报告,无单独文件需 commit) + + 修复:git add && git commit -m "...",然后重跑 /erp-workflow:coding-start。 +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +``` + +### 3.2 探测本地默认分支 + +用 `git rev-parse --verify` 依次探测本地 `main`、`master`,取第一个存在的作为 `default_branch`。两者都不存在 → 停止报错(不自动创建分支)。 + +### 3.3 本地 merge + +```bash +git checkout +git merge --no-ff -m "merge(): integrate " +``` + +合并冲突 → 停止,打印冲突文件清单,引导人工解决后重跑 `/erp-workflow:coding-start`(不自动 `--abort`,不强制覆盖)。 + +### 3.4 回写 docs/08 里程碑字段 + +在 `default_branch` 上 `Edit docs/08-模块任务管理.md`: + +- **phase=backend**:在 § 二 找到当前模块行 ` - 里程碑: —` → ` - 里程碑: milestone/` +- **phase=frontend**:在 § 三 找到 `- 整体里程碑: —` → `- 整体里程碑: milestone/frontend-phase` + +```bash +git add docs/08-模块任务管理.md +git commit -m "chore(): record milestone/ in docs/08" +``` + +### 3.5 打 annotated tag + +```bash +git tag -a milestone/ -m "milestone(): 阶段完成" +``` + +tag 已存在(重跑场景)→ 跳过,不重复打。 + +### 3.6 追加 tag 到报告 §⑥ 并 commit + +`Edit docs/superpowers/module-reports/-.md`,把 `{{milestone_tag}}` 替换为 `milestone/`(已替换则跳过)。 + +```bash +git add docs/superpowers/module-reports/-.md +git commit -m "docs(): record milestone/ in completion report" +``` + +## 阶段 4:自动回调 + +本阶段已集成 + 打 tag,**不停下等人工**。立即调用: + +``` +Skill(coding-start) +``` + +coding-start 重新检查后端 / 前端完成性(按 `里程碑:` 字段 + `git tag -l`),未完则推进下一模块 / 前端阶段;全部完成则打印"所有阶段已完成"。 + +## 护栏 + +- **绝不**在主会话直接执行 `./scripts/test.sh` / `pnpm test` / `pnpm e2e`——必须通过 Agent 子会话 +- 本闸门是里程碑 tag 前唯一的硬测试门——红色时**绝不**跳过直接进入集成 / 打 tag +- worktree 不干净时不执行 merge(停下,不修复) +- 合并冲突时不自动解决(停下,指引人工) + +## 参考 + +- `${CLAUDE_SKILL_DIR}/templates/milestone-report-template.md`(6 节精简报告) +- 上游:`phase-driver`(后端所有 REQ / 前端所有 FE 全部 approve 后派发到此) +- 下游:`coding-start`(自治回调,由其路由下一阶段) diff --git a/skills/coding/milestone/templates/milestone-report-template.md b/skills/coding/milestone/templates/milestone-report-template.md new file mode 100644 index 0000000..fa7ee4e --- /dev/null +++ b/skills/coding/milestone/templates/milestone-report-template.md @@ -0,0 +1,24 @@ +# 完成报告 — {{phase_id}}({{phase}}) + +> 生成: {{date}} | 分支: {{branch}} | 里程碑: {{milestone_tag}} + +## ① 单元信息 +- 类型: {{phase}} | ID: {{phase_id}} | 名称: {{name}} +- 覆盖单元(REQ / FE): {{covered_list}} + +## ② 测试证据 +- 命令: {{test_command}} | 退出码: {{exit_code}} | 通过/失败: {{passed}}/{{failed}} +- 摘要: {{stdout_excerpt}} + +## ③ 文件变更 +{{git_diff_stat}} + +## ④ 数据库 / Migration(前端填 N/A) +{{migrations_summary}} + +## ⑤ 偏离与取舍 +{{deviations}} + +## ⑥ 里程碑 +- tag: {{milestone_tag}} +- 下一步: {{next_unit}} diff --git a/skills/coding/module-report/SKILL.md b/skills/coding/module-report/SKILL.md deleted file mode 100644 index 979d3d7..0000000 --- a/skills/coding/module-report/SKILL.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -name: module-report -description: 本地测试闸门通过后,生成标准化 12 节完成报告(后端模块 OR 前端阶段)并 commit 到当前分支(供里程碑标记)。 -user-invocable: false -allowed-tools: Read Write Glob Grep Skill Bash(git diff *) Bash(git log *) Bash(git add *) Bash(git commit *) Bash(git branch *) ---- - -**所有输出必须使用中文。** - -# module-report - -`test-gate` 绿色后渲染 12 节完成报告,commit 到当前分支供里程碑标记。**只读摘要,不读 diff 正文进上下文**。 - -按当前分支自动推断 `phase`: - -- `module-` → `phase=backend`,`phase_id=` -- `frontend-phase` → `phase=frontend`,`phase_id=frontend-phase` -- 其它分支 → 硬停 - -## 执行步骤 - -### 步骤 0:推断 phase 与上下文 - -从 `git branch --show-current` 取分支名,按上述规则推出 `phase` 与 `phase_id`。 - -1. 验证上游 `test-gate` 已绿(读 `docs/superpowers/module-reports/-test-gate.md`);红色则停。 - -2. 收集输入(核心约束:取 git 摘要而非 diff 正文): - - **后端阶段 (phase=backend)**: - - § ③ 文件变更:`git diff --stat` / `--name-status` / `git log --oneline`(区间:module 分支起点 → HEAD) - - § ② / § ⑨:Read `docs/superpowers/{specs,plans,reviews}/<日期>-<本模块的 REQ>.md` - - § ⑤:Read `docs/superpowers/module-reports/-test-gate.md` - - § ⑥ Migration:`git diff --name-only --diff-filter=A -- 'sql/migrations/V*.sql'` 列新增 migration,每个 Read 第一行作说明 - - § ⑦ 跨模块改动:Read `docs/superpowers/module-reports/-cross-module.md`(如存在) - - § ④ 读写的表:用 grep 定位涉 SQL 的文件后按需读片段,**不全量读 docs/03** - - **前端阶段 (phase=frontend)**: - - § ① 模块信息:`module_id` 填 `frontend-phase`,`module_name` 填 `前端阶段(整体)` - - § ② 改为"FE 完成清单":扫 `docs/superpowers/{specs,plans,reviews}/<日期>-FE-*.md`,按 FE-NN 顺序列出 - - § ③ 文件变更:`git diff --stat` 区间 `frontend-phase` 分支起点 → HEAD - - § ④ 数据库使用表:填 `N/A(前端阶段)` - - § ⑤:Read `docs/superpowers/module-reports/frontend-phase-test-gate.md` - - § ⑥ Migration:填 `N/A(前端阶段)` - - § ⑦:填 `N/A(前端阶段不涉及跨模块代码改动;token 漂移见 § ⑧)` - - § ⑧ 偏离清单:除常规偏离外,额外审查"实际渲染 DOM 与各 FE 关联原型主结构的差异",逐 FE 列出(关联原型清单见每个 FE 的 spec) - - § ⑪ 下一模块预览:填"上线/部署后续步骤" - -3. 按 `${CLAUDE_SKILL_DIR}/templates/module-report-template.md` 渲染 12 节。 - -4. **硬验证**: - - § ⑦(仅 backend):跨模块日志中任何 `TBD(CC 补)` 或敷衍填充 → 调用 `Skill(cross-module-log)` 一次性批量补齐,补完回本步骤重验(**整模块周期内唯一补 TBD 的时机**) - - § ⑧:必须列举所有偏离之处;若无,写"无偏离" - -5. 写入 `docs/superpowers/module-reports/-.md`,连同跨模块日志(如存在)一起 commit 到当前分支: - ```bash - git add docs/superpowers/module-reports/-.md - [ -f docs/superpowers/module-reports/-cross-module.md ] && \ - git add docs/superpowers/module-reports/-cross-module.md - git commit -m "docs(): add completion report + cross-module log" - ``` - commit 是必需的——`milestone-tag` 的 worktree-clean 前置条件依赖此步。 - -6. 调用 `Skill(milestone-tag)` 本地集成并打里程碑 tag。 - -## 参考 - -- `${CLAUDE_SKILL_DIR}/templates/module-report-template.md`(12 节,后端 + 前端共用) -- 上游:`test-gate`(绿色时派发) -- 下游:`milestone-tag`(phase 由当前分支推断) diff --git a/skills/coding/module-report/templates/module-report-template.md b/skills/coding/module-report/templates/module-report-template.md deleted file mode 100644 index f808d5e..0000000 --- a/skills/coding/module-report/templates/module-report-template.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -module_id: {{module_id}} -date: {{date}} -git_range: {{git_range}} ---- - -# 模块完成报告 — {{module_id}} {{module_name}} - -## ① 模块信息 -- 模块 ID: {{module_id}} -- 模块名: {{module_name}} -- 开发区间: {{git_range}} - -## ② REQ 完成清单 -{{#each reqs}} -- [{{status}}] {{req_id}} — {{title}} - - spec: docs/superpowers/specs/{{date}}-{{req_id}}.md - - plan: docs/superpowers/plans/{{date}}-{{req_id}}.md - - review: docs/superpowers/reviews/{{date}}-{{req_id}}.md -{{/each}} - -## ③ 文件变更表 -| 文件 | 操作 | 说明 | -|---|---|---| -{{#each file_changes}} -| {{path}} | {{action}} | {{note}} | -{{/each}} - -## ④ 数据库使用表 -- 读: {{tables_read}} -- 写: {{tables_written}} - -## ⑤ 测试结果 -- `scripts/test.sh` 最终:{{test_conclusion}} -- 通过: {{passed}} / 失败: {{failed}} / 跳过: {{skipped}} -- 覆盖率: {{coverage}} - -## ⑥ 本模块新增 Migration - -{{#each migrations}} -- `sql/migrations/{{filename}}` — {{desc}} -{{/each}} - - - - -## ⑦ 跨模块改动清单(软规则 S2) - -{{cross_module_contents}} - -## ⑧ 偏离 spec 清单 -{{#each deviations}} -- {{req_id}}: {{deviation}} (原因: {{reason}}) -{{/each}} - -## ⑨ AI reviewer 报告汇总 -{{#each reviews}} -- {{req_id}}: round {{round}} — {{verdict}}(link: docs/superpowers/reviews/{{date}}-{{req_id}}.md) -{{/each}} - -## ⑩ 已知问题 -{{known_issues}} - -## ⑪ 下一模块预览 -{{next_module}} - -## ⑫ 里程碑 tag -{{milestone_tag}} diff --git a/skills/coding/test-gate/SKILL.md b/skills/coding/test-gate/SKILL.md deleted file mode 100644 index df6d188..0000000 --- a/skills/coding/test-gate/SKILL.md +++ /dev/null @@ -1,76 +0,0 @@ ---- -name: test-gate -description: 打里程碑 tag 前的硬闸门。后端阶段子会话跑 scripts/test.sh,前端阶段跑前端测试命令;绿则进入 module-report,红则停下并按失败类型引导用户。 -user-invocable: false -allowed-tools: Read Write Skill Agent Bash(git add *) Bash(git commit *) Bash(git branch *) ---- - -**所有输出必须使用中文。** - -# test-gate - -模块(后端阶段)或整个前端阶段所有功能完成后的硬闸门。按当前分支自动推断 `phase`: - -- `module-*` 分支 → `phase=backend`:子会话跑 `./scripts/test.sh`(含本模块新增 + 已合并模块回归) -- `frontend-phase` 分支 → `phase=frontend`:子会话跑前端测试命令(vitest + playwright) - -按模板渲染证据并 commit 到当前分支。绿色继续,红色停下。 - -## 执行步骤 - -### 步骤 0:推断 phase 与目标命令 - -`git branch --show-current`: - -- `module-` → `phase=backend`,`phase_id=`,`command=./scripts/test.sh` -- `frontend-phase` → `phase=frontend`,`phase_id=frontend-phase`;命令从 `docs/04-技术规范.md § 零 frontend.test_command` / `frontend.e2e_command` 拼接(缺失则 `pnpm test:ci && pnpm e2e:ci`) -- 其它分支 → 硬停打印 `test-gate 仅在 module-* 或 frontend-phase 分支可调用,当前 ` - -1. 派发 Agent 子会话(general-purpose)运行上述 `command`,子会话只返回结构化 JSON(不输出描述文字): - ```json - { - "command": "", - "exit_code": , - "passed": , - "failed": , - "stdout_excerpt": "<最后 30 行,含 FAIL 摘要>" - } - ``` -2. 按 `${CLAUDE_SKILL_DIR}/templates/test-gate-result-template.md` 渲染证据,写入 `docs/superpowers/module-reports/-test-gate.md`(后端:`-test-gate.md`;前端:`frontend-phase-test-gate.md`)。 -3. Commit evidence 到当前分支(保证证据随里程碑 merge 进默认分支可审计): - ```bash - git add docs/superpowers/module-reports/-test-gate.md - git commit -m "chore(): add local test-gate evidence" - ``` -4. **`exit_code = 0`** → 调用 `Skill(module-report)`。 -5. **失败** → 打印以下横幅并停止,不调用下游 skill;不自动重试、不自动修复(失败分类需人工判断): - - ``` - ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - [test-gate] ⚠️ 未通过 (phase=) - 失败清单: <子会话 JSON 的 failed 摘要> - 详细证据: docs/superpowers/module-reports/-test-gate.md - - 按失败类型选恢复路径: - ① 测试脆弱(偶发 flakey)→ 重跑 /erp-workflow:coding-start - (module-start / frontend-start 幂等:reviews 已全 approve 会跳过功能循环,直接重跑本闸门) - ② 真有回归 - 后端:rm docs/superpowers/reviews/*-.md - → 重跑 /erp-workflow:coding-start(module-start 视该 REQ 未完成,重走功能循环) - 前端:rm docs/superpowers/reviews/*-FE-.md - → 重跑 /erp-workflow:coding-start(frontend-start 视该 FE 未完成,重走功能循环) - ③ 环境/依赖问题(DB 连不上 / 外部 API 失败 / 证书失效 / Playwright 浏览器未装) - → Skill(interrupt-check) 追加 Blocker 到任一 plan 文件 → 修复环境 → 重跑 - ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - ``` - -## 护栏 - -- **绝不**在主会话直接执行 `./scripts/test.sh` / `pnpm test` / `pnpm e2e`,必须通过子会话 -- 本闸门是里程碑 tag 前唯一的硬测试门:红色时**绝不**跳过直接进入 `module-report` / `milestone-tag` - -## 参考 - -- `${CLAUDE_SKILL_DIR}/templates/test-gate-result-template.md` -- 上游:`module-start`(后端阶段 REQ 全 approve 后派发到此);`frontend-start`(前端阶段 FE 全 approve 后派发到此) -- 下游:`module-report`(绿色时;后端 + 前端共用,phase 由当前分支推断) diff --git a/skills/coding/test-gate/templates/test-gate-result-template.md b/skills/coding/test-gate/templates/test-gate-result-template.md deleted file mode 100644 index 1382801..0000000 --- a/skills/coding/test-gate/templates/test-gate-result-template.md +++ /dev/null @@ -1,16 +0,0 @@ -## Local test gate — {{module_id}} - -执行时间: {{timestamp}} - -### scripts/test.sh (subagent) -- 子会话: {{subagent_id}} -- 命令: {{command}} -- 退出码: {{exit_code}} -- 通过: {{passed}} / 失败: {{failed}} -- 关键 stdout (≤30 行): - -``` -{{stdout_excerpt}} -``` - -结论: {{conclusion}} (green / red)