Install
openclaw skills install peter-code-review提交前质量闸门。快速完成本地测试、静态检查和风险审查,判断“是否可提交”。
openclaw skills install peter-code-review用于“提交前最后一关”。
它会基于当前改动,执行最小但有效的验证闭环:
HEAD 最近一次提交,并在报告中明确标注。git status -s
git diff --stat
git diff --name-only
若 git status -s 为空,执行:
git show --name-only --stat --pretty="" HEAD
并在报告中标注“基于 HEAD 审查,非工作区审查”。
npm run lint、npx tsc --noEmitnpm run test:unit、npm run test:integration)ruff check .、pytestgo test ./...cargo test如果命令不存在或环境缺失,必须明确记录“未执行原因 + 影响范围”。
package.json、pnpm-lock.yaml、yarn.locknext.config.*、vite.config.*、webpack*.jsprisma/、src/app/api/、CI/构建脚本目录npm run workflow:check(若命令存在)npm run buildnpm run gate:db(若命令存在)workflow:check / gate:db 命令不存在或执行环境缺失,必须记录“未执行原因 + 影响范围”,且不得标记为通过。gate:db 输出包含 GATE_DB_UNREACHABLE(或等价 DB 不可达证据,如 P1001):
High 风险,禁止标记为“通过”可提交(高风险)peter-ci-gate)”检测 UI 改动:
git diff --name-only \
| grep -E '\.(tsx|jsx|css|scss)$|^src/components/|^src/app/' \
| grep -Ev '^src/app/api/'
lint、typecheck、相关模块单元/集成测试(非端到端)。至少覆盖以下检查点:
对照用户需求逐条标注:
## 代码审查报告### 提交标准检查清单(lint / typecheck / test / workflow-check(如执行) / gate:db(如执行) / build(如执行) / 安全 / 需求 / UI(通过/未执行))### Git 改动摘要(文件数、关键文件)### 执行结果(每条命令是否通过,失败摘录)### 问题列表(Critical / High / Medium / Low,含文件:行号、原因、修复建议)### 结论(可提交 / 可提交(高风险) / 需修复后提交)GATE_DB_UNREACHABLE 只能判定为“高风险(可提交但需复核)”,不得写成“通过”。