Install
openclaw skills install cm-code-review-assistantAI-powered code review assistant that analyzes pull requests for bugs, security issues, performance problems, and style violations with actionable feedback.
openclaw skills install cm-code-review-assistantPerform thorough AI-powered code reviews on pull requests or local changes. Analyzes diffs for bugs, security vulnerabilities, performance issues, maintainability concerns, and style violations. Provides actionable, specific feedback — not generic advice.
"Review the current PR"
"Review the changes on this branch vs main"
"Review these specific files for security issues"
"Do a deep review of the authentication changes"
Collect the diff and context:
# PR review
gh pr diff <number> --color=never
# Branch review
git diff main...HEAD
# Staged changes
git diff --cached
Also gather:
Each pass focuses on a different concern:
Pass 1 — Correctness:
Pass 2 — Security:
Pass 3 — Performance:
Pass 4 — Maintainability:
Pass 5 — Testing:
Each finding gets a severity:
Every comment includes:
Overall assessment with:
## Code Review Summary
**Risk Level:** 🟡 Needs Changes (2 must-fix, 4 should-fix)
**Files Reviewed:** 12 files, +342/-89 lines
### 🔴 Must Fix
1. **SQL Injection in user search** — `src/api/users.ts:47`
The search query interpolates user input directly:
```typescript
// Current (vulnerable)
db.query(`SELECT * FROM users WHERE name LIKE '%${query}%'`)
// Fix: use parameterized query
db.query('SELECT * FROM users WHERE name LIKE $1', [`%${query}%`])
src/services/wallet.ts:112-118
Read-then-write without transaction. Two concurrent requests
can both read the same balance and overwrite each other.
Fix: wrap in a database transaction with SELECT FOR UPDATE.N+1 query in order listing — src/api/orders.ts:23
Each order triggers a separate query for user details.
Use a JOIN or batch load users by ID.
Missing error handling — src/services/payment.ts:67
API call result is not checked for errors before accessing .data.
[...]
formatDate utility is duplicated in 3 files — extract to shared utils
## Configuration
The review depth adapts to PR size:
- **Small** (<100 lines): Full deep review, every line examined
- **Medium** (100-500 lines): Focused review on high-risk areas
- **Large** (500+ lines): Architectural review + spot-check critical paths, suggest splitting PR
## Integration
Works with:
- GitHub PRs (via `gh` CLI)
- GitLab MRs (via `glab` CLI)
- Local git branches (via `git diff`)
- Patch files (via `git apply --stat`)