一键导入
pr-reviewer
用于 GitHub PR 自动代码审查,支持 diff 分析、lint 集成和结构化报告;适用于审查 PR、安全问题、错误处理缺口、测试覆盖和代码风格问题;支持 Go、Python、JavaScript/TypeScript,要求 gh CLI 已完成仓库授权。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
用于 GitHub PR 自动代码审查,支持 diff 分析、lint 集成和结构化报告;适用于审查 PR、安全问题、错误处理缺口、测试覆盖和代码风格问题;支持 Go、Python、JavaScript/TypeScript,要求 gh CLI 已完成仓库授权。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
用于任务涉及 ECC、Everything Claude Code、Claude Code 工作流、Codex 适配、Codex 插件、ECC Skill、ECC 规则,或需要把 Claude Code 资产转换为宿析OS Codex 可控使用的场景。
Coordinate project code reviews across PR intake, critical review, coding standards, security, clean-code analysis, and report synthesis.
Use when working on hotel-auto-x Ctrip collection, including Ctrip review collection, bad reviews across ctrip/qunar/tongcheng/zhixing, review score, full daily collection, realtime Ctrip metrics, Ctrip session/profile problems, and Ctrip data mapping into daily_report.
Use when working on hotel-auto-x platform login/session/Profile handling for PMS, Meituan, or Ctrip, including manual login, session checks, expired cookies, browser profile safety, and login-related alerts.
Use when working on hotel-auto-x Meituan collection, including Meituan review collection, bad reviews, review score, full daily collection, realtime traffic/order metrics, ad collection, Meituan session/profile problems, and Meituan data mapping into daily_report.
Use when working on hotel-auto-x PMS collection, including JY01/JY03/hybrid daily report collection, PMS realtime collection, PMS quality gates, PMS session issues, and PMS data entering daily_report or realtime_snapshot.
基于 SOC 职业分类
| name | pr-reviewer |
| version | 1.0.1 |
| description | 用于 GitHub PR 自动代码审查,支持 diff 分析、lint 集成和结构化报告;适用于审查 PR、安全问题、错误处理缺口、测试覆盖和代码风格问题;支持 Go、Python、JavaScript/TypeScript,要求 gh CLI 已完成仓库授权。 |
| metadata | {"openclaw":{"requires":{"bins":["gh","python3"],"anyBins":["golangci-lint","ruff"]}}} |
Automated code review for GitHub pull requests. Analyzes diffs for security issues, error handling gaps, style problems, and test coverage.
gh CLI installed and authenticated (gh auth status)golangci-lint for Go linting, ruff for Python linting# Review all open PRs in current repo
scripts/github/pr-reviewer.sh check
# Review a specific PR
scripts/github/pr-reviewer.sh review 42
# Post review as GitHub comment
scripts/github/pr-reviewer.sh post 42
# Check status of all open PRs
scripts/github/pr-reviewer.sh status
# List unreviewed PRs (useful for heartbeat/cron integration)
scripts/github/pr-reviewer.sh list-unreviewed
Set these environment variables or the script auto-detects from the current git repo:
PR_REVIEW_REPO — GitHub repo in owner/repo format (default: detected from gh repo view)PR_REVIEW_DIR — Local checkout path for lint (default: git root of cwd)PR_REVIEW_STATE — State file path (default: ./data/pr-reviews.json)PR_REVIEW_OUTDIR — Report output directory (default: ./data/pr-reviews/)PR_REVIEW_STATE (default: ./data/pr-reviews.json) — Tracks reviewed PRs and their HEAD SHAsPR_REVIEW_OUTDIR (default: ./data/pr-reviews/) — Markdown review reports| Category | Icon | Examples |
|---|---|---|
| Security | 🔴 | Hardcoded credentials, AWS keys, secrets in code |
| Error Handling | 🟡 | Discarded errors (Go _ :=), bare except: (Python), unchecked Close() |
| Risk | 🟠 | panic() calls, process.exit() |
| Style | 🔵 | fmt.Print/print()/console.log in prod, very long lines |
| TODOs | 📝 | TODO, FIXME, HACK, XXX markers |
| Test Coverage | 📊 | Source files changed without corresponding test changes |
Tracks HEAD SHA per PR. Only re-reviews when new commits are pushed. Use review <PR#> to force re-review.
Reports are saved as markdown files in the output directory. Each report includes:
Add to a periodic check (heartbeat, cron job, or CI):
UNREVIEWED=$(scripts/github/pr-reviewer.sh list-unreviewed)
if [ -n "$UNREVIEWED" ]; then
scripts/github/pr-reviewer.sh check
fi
The analysis patterns in the script are organized by language. Add new patterns by appending to the relevant pattern list in the analyze_diff() function:
# Add a new Go pattern
go_patterns.append((r'^\+.*os\.Exit\(', 'RISK', 'Direct os.Exit() — consider returning error'))