pr-review
by @glucksberg
Find and fix code issues before publishing a PR. Single-pass review with auto-fix. Use when reviewing code changes before submission or auditing existing cod...
clawhub install pr-reviewπ About This Skill
name: pr-review description: Find and fix code issues before publishing a PR. Single-pass review with auto-fix. Use when reviewing code changes before submission or auditing existing code for bugs/security. Don't use when running a coding agent to write code (use coding-agent) or checking GitHub CI status (use github). metadata: {"openclaw": {"requires": {"bins": ["git"]}}}
Pre-Review
Find and fix issues before publishing your PR β not after.
Single-pass review using one capable model. No orchestration overhead, no agent swarm. Fast, cheap, thorough.
When to use
When NOT to use
coding-agentgithubfork-managerUsage
/pr-review # Review changes on current branch vs main/master
/pr-review src/api/ src/auth/ # Audit specific directories
/pr-review **/*.ts # Audit files matching a pattern
/pr-review --audit # Audit entire codebase with smart prioritization
Two modes:
| Mode | Trigger | Scope | Fix threshold |
|------|---------|-------|---------------|
| Diff | No args, on branch with changes | Changed files only | >= 70 |
| Audit | Paths, patterns, or --audit | Specified files or full codebase | >= 80 |
Instructions
Step 1: Detect Mode and Scope
No arguments provided:
git diff main...HEAD --name-only 2>/dev/null || git diff master...HEAD --name-only
Paths/patterns provided or --audit:
Step 2: Gather Context
Read project guidelines (quick scan, don't overthink):
# Check for project conventions
cat CLAUDE.md .claude/settings.json CONTRIBUTING.md 2>/dev/null | head -100
cat .eslintrc* .prettierrc* biome.json tsconfig.json 2>/dev/null | head -50
cat package.json 2>/dev/null | head -20 # tech stack
Get the diff or file contents:
# Diff mode
git diff main...HEAD # or masterAudit mode
cat # read target files
Step 3: Review (Single Pass)
Analyze all code in one pass. Cover these areas in priority order:
1. Correctness (highest priority)
2. Security
3. Reliability
4. Performance
5. Quality (lowest priority β skip if trivial)
Step 4: Score and Classify
For each issue found, assign:
| Score | Meaning | Action | |-------|---------|--------| | 90-100 | Critical bug or vulnerability | Must fix | | 70-89 | Real issue, will cause problems | Should fix | | 50-69 | Code smell, needs human judgment | Report only | | < 50 | Minor, likely false positive | Discard |
Discard thresholds:
Classify each issue:
blocker β security, data corruption, crash riskimportant β likely bug, perf regression, missing validationminor β edge case, maintainability, styleStep 5: Auto-Fix
Apply fixes directly for issues meeting the threshold:
For each fix: read file β apply edit β verify surrounding code preserved.
Never auto-fix:
After fixing, if any files were modified:
git diff --stat # show what changed
Step 6: Report
Format:
## Pre-Review CompleteRisk: Low / Medium / High
Verdict: β
Clean | β οΈ Issues found | π΄ Blockers
π΄ Blockers (must fix)
1. file:line β Description
- Impact: what goes wrong
- Fix: applied β
| manual required (reason)β οΈ Important (should fix)
1. file:line β Description (score: XX)
- Fix: applied β
| suggestionπ‘ Minor
1. file:line β DescriptionTests to Add
description of test Files Modified: N
path/to/file.ts
If zero issues found: ## Pre-Review Complete β β
Clean. No issues found.
Guidelines
DO:
DON'T:
False Positives to Avoid
β‘ When to Use
π‘ Examples
/pr-review # Review changes on current branch vs main/master
/pr-review src/api/ src/auth/ # Audit specific directories
/pr-review **/*.ts # Audit files matching a pattern
/pr-review --audit # Audit entire codebase with smart prioritization
Two modes:
| Mode | Trigger | Scope | Fix threshold |
|------|---------|-------|---------------|
| Diff | No args, on branch with changes | Changed files only | >= 70 |
| Audit | Paths, patterns, or --audit | Specified files or full codebase | >= 80 |