SKILL.md 3.78 KB

name: module-report description: 本地测试闸门通过后,生成标准化 12 节完成报告(后端模块 OR 前端阶段)并 commit 到当前分支供 MR 嵌入。 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 到当前分支供 MR 嵌入。只读摘要,不读 diff 正文进上下文

按当前分支自动推断 phase

  • module-<id>phase=backendphase_id=<id>
  • frontend-phasephase=frontendphase_id=frontend-phase
  • 其它分支 → 硬停

执行步骤

步骤 0:推断 phase 与上下文

git branch --show-current 取分支名,按上述规则推出 phasephase_id

  1. 验证上游 test-gate 已绿(读 docs/superpowers/module-reports/<phase_id>-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/<phase_id>-test-gate.md
  • § ⑥ Migration:git diff --name-only --diff-filter=A -- 'sql/migrations/V*.sql' 列新增 migration,每个 Read 第一行作说明
  • § ⑦ 跨模块改动:Read docs/superpowers/module-reports/<phase_id>-cross-module.md(如存在)
  • § ④ 读写的表:用 grep 定位涉 SQL 的文件后按需读片段,不全量读 docs/03

前端阶段 (phase=frontend)

  • § ① 模块信息:module_idfrontend-phasemodule_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)
  • § ⑪ 下一模块预览:填"上线/部署后续步骤"
  1. ${CLAUDE_SKILL_DIR}/templates/module-report-template.md 渲染 12 节。

  2. 硬验证

    • § ⑦(仅 backend):跨模块日志中任何 TBD(CC 补) 或敷衍填充 → 调用 Skill(cross-module-log) 一次性批量补齐,补完回本步骤重验(整模块周期内唯一补 TBD 的时机
    • § ⑧:必须列举所有偏离之处;若无,写"无偏离"
  3. 写入 docs/superpowers/module-reports/<YYYY-MM-DD>-<phase_id>.md,连同跨模块日志(如存在)一起 commit 到当前分支:

    git add docs/superpowers/module-reports/<YYYY-MM-DD>-<phase_id>.md
    [ -f docs/superpowers/module-reports/<phase_id>-cross-module.md ] && \
     git add docs/superpowers/module-reports/<phase_id>-cross-module.md
    git commit -m "docs(<phase_id>): add completion report + cross-module log"
    

    commit 是必需的——mr-create 的 worktree-clean 前置条件依赖此步。

  4. 调用 Skill(mr-create) 推送并创建 MR。

参考

  • ${CLAUDE_SKILL_DIR}/templates/module-report-template.md(12 节,后端 + 前端共用)
  • 上游:test-gate(绿色时派发)
  • 下游:mr-create(phase 由当前分支推断)