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