--- name: erp-module-report description: 本地测试闸门通过后,生成标准化 12 节模块完成报告,嵌入本模块新增的 migration 清单和跨模块改动日志。 user-invocable: false allowed-tools: Read Write Glob Grep Skill Bash(git diff *) Bash(git log *) Bash(git add *) Bash(git commit *) --- **所有输出必须使用中文。** # erp-module-report ## 执行步骤 0. **红旗检查**:调用 `Skill(erp-red-flag-check)` → 命中则停止(与 `erp-red-flag-check` SKILL 描述"生成模块级制品前"对齐)。 1. 验证上游:`erp-local-test-gate` 返回了绿色。否则停止。 2. 收集输入(优先 shell 摘要,避免把 diff 正文读进上下文): - **文件变更 § ③** — 只用摘要,**不**读 diff 正文: - `git diff --stat ..HEAD` → 每文件增减行数 - `git diff --name-status ..HEAD` → A/M/D 状态 - `git log --oneline ..HEAD` → commit 列表 - `docs/superpowers/specs|plans|reviews/-<本模块的 REQ>.md` → § ②、§ ⑨(正常 Read,一般不大) - **§ ⑥ 本模块新增 migration**:用 `git diff --name-only --diff-filter=A ..HEAD -- 'sql/migrations/V*.sql'` 列出本模块提交的新 migration 文件;每个文件 Read 第一行(V_n 描述)作为说明 - `docs/superpowers/module-reports/-cross-module.md` → § ⑦ - `docs/superpowers/module-reports/-test-gate.md` → § ⑤ - § ④(读写的表):**用 `grep -rlE "(SELECT|INSERT|UPDATE|DELETE).*FROM|INTO"` 定位涉及 SQL 的文件,再按需读取片段**。不要全量读取 docs/03。 3. 用 `Read` 读取 `${CLAUDE_SKILL_DIR}/templates/module-report-template.md`,填充全部 12 节。 4. **硬性验证**: - § ⑦:如果 cross-module 有任何行含 `TBD(CC 补)` → **停止**,调用 `Skill(erp-cross-module-log)` 让 CC **自主推断**补齐,补完再回本步骤重验。 - § ⑦:如果非空但某行缺少影响评估(被填成空/敷衍)→ 同样调 `erp-cross-module-log` 重补。 - § ⑧ 必须列举所有偏离规格之处;如果没有,明确写"无偏离"。 5. 写入 `docs/superpowers/module-reports/$(date +%F)-.md`。 5b. **commit 模块报告 + cross-module 日志到 module 分支**(确保审计证据随 MR 合并进默认分支;erp-mr-create 的 worktree clean 前置条件依赖此步): ```bash git add docs/superpowers/module-reports/$(date +%F)-.md # cross-module log 若存在且有改动(erp-cross-module-log 补齐过 TBD)也一并提交 [ -f "docs/superpowers/module-reports/-cross-module.md" ] && \ git add docs/superpowers/module-reports/-cross-module.md git commit -m "docs(): add module completion report + cross-module log" ``` 6. 交接给 `erp-mr-create`。 ## 衔接 立即调用 `Skill(erp-mr-create)` 推送并创建 MR。 ## 参考 - `${CLAUDE_SKILL_DIR}/templates/module-report-template.md`(12 节) - 上游:`erp-local-test-gate` - 下游:`erp-mr-create`