--- 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` - 其它分支 → 硬停 `[ERP-HALT]` ## 执行步骤 ### 步骤 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. **同一 turn 内立即** `Skill(milestone-tag)` 本地集成并打里程碑 tag(直接调用,**不要**先输出"已完成 / 接下来 / 请检查 / 等你确认"之类桥接叙述——会被解读为 turn 结束信号、害用户手敲 continue)。 ## 参考 - `${CLAUDE_SKILL_DIR}/templates/module-report-template.md`(12 节,后端 + 前端共用) - 上游:`test-gate`(绿色时派发) - 下游:`milestone-tag`(phase 由当前分支推断)