The agent-code-review-skill is a 5-phase SKILL.md behavioral protocol for systematic AI agent code review. It teaches agents to analyze cyclomatic complexity, surface pre-commit security issues (OWASP patterns), detect test coverage gaps, generate actionable PR comments with blocking/suggestion/nit severity levels, and apply multi-language pattern libraries for TypeScript, Python, Go, and Rust. Built for vibe coding workflows where an agent reviews AI-generated code before merge — and for developer teams that want a consistent, automated review baseline across every PR. Compatible with Claude Code, OpenAI Codex CLI, Cursor, GitHub Copilot, and VS Code Copilot.
| Phase | Topic | Key Output |
|---|---|---|
| 1 | Code Quality Analysis | Complexity scoring (cyclomatic + cognitive), duplication detection, naming quality checklist, structural anti-pattern flagging (God Functions, deep nesting, Shotgun Surgery) |
| 2 | Security-Aware Review | Pre-commit security checklist (input validation, secrets, output encoding, dependencies); automated red-flag pattern scanner (eval(), innerHTML, SQL string concat, command injection) |
| 3 | Test Coverage Gap Detection | Happy path, error path, edge case, and integration test gap identification; coverage thresholds by layer (unit: 85%+, critical paths: 95%+) |
| 4 | PR Comment Generation | Structured blocking/suggestion/nit/praise comments; PR summary table with severity counts; actionable fix suggestions inline |
| 5 | Multi-Language Pattern Library | TypeScript, Python, Go, and Rust idiomatic patterns — what to flag, what to prefer, with code examples |
npx skills install agent-code-review-skill for any SKILL.md-compatible agent runtime// From agent-code-review-skill Phase 1
// Cyclomatic + cognitive complexity scoring for any function
interface ComplexityScore {
cyclomatic: number; // Decision points + 1
cognitive: number; // Nesting depth × decision points
verdict: 'green' | 'yellow' | 'red';
action: string;
}
function scoreComplexity(fn: FunctionNode): ComplexityScore {
const cyclomatic = countDecisionPoints(fn) + 1;
const cognitive = countNestingPenalty(fn);
// Green: cyclomatic ≤ 10 — maintainable
// Yellow: cyclomatic 11–20 — review closely
// Red: cyclomatic > 20 — must refactor
const verdict =
cyclomatic <= 10 && cognitive <= 15 ? 'green' :
cyclomatic <= 20 && cognitive <= 25 ? 'yellow' : 'red';
return { cyclomatic, cognitive, verdict,
action: verdict === 'red' ? 'Extract sub-functions, reduce nesting depth' : 'OK' };
}
// From agent-code-review-skill Phase 2
// Automated security pattern detection
const SECURITY_RED_FLAGS = [
{ pattern: /evals*(/, severity: 'critical', msg: 'eval() — remote code execution risk' },
{ pattern: /innerHTMLs*=/, severity: 'high', msg: 'innerHTML — XSS risk if user data involved' },
{ pattern: /querys*+s*['"`]/, severity: 'high', msg: 'SQL string concat — injection risk' },
{ pattern: /execs*(.*${/, severity: 'high', msg: 'Template literal in exec() — command injection' },
{ pattern: /console.log(.*key|secret|password/i, severity: 'medium', msg: 'Potential credential logging' },
];
function scanForSecurityIssues(code: string): SecurityFinding[] {
return SECURITY_RED_FLAGS
.filter(({ pattern }) => pattern.test(code))
.map(({ severity, msg }) => ({ severity, message: msg }));
}
| Client | Install Method | Notes |
|---|---|---|
| Claude Code | npx skills install agent-code-review-skill | Full SKILL.md support; works in Auto Mode |
| OpenAI Codex CLI | npx skills install agent-code-review-skill | Compatible with Codex CLI agent runtime |
| Cursor | npx skills install agent-code-review-skill | Load as agent context in Cursor AI settings |
| GitHub Copilot | npx skills install agent-code-review-skill | Use as Copilot workspace instruction |
| VS Code Copilot | npx skills install agent-code-review-skill | Add to .github/copilot-instructions.md |
| AutoGen / CrewAI / LangGraph | npx skills install agent-code-review-skill | Load SKILL.md as agent system prompt |
npx skills install agent-code-review-skillGET https://clawmerchants.com/v1/preview/agent-code-review-skill — inspect protocol structure before payingGET https://clawmerchants.com/v1/data/agent-code-review-skill → HTTP 402 with USDC payment detailsX-PAYMENT: <base64 proof> → HTTP 200 with full 5-phase code review protocol# Step 1: Probe — discover payment requirements
curl -i https://clawmerchants.com/v1/data/agent-code-review-skill
# HTTP/1.1 402 Payment Required
# X-Payment-Required: {"amount":"50000","currency":"USDC","chain":8453,...}
# Step 2: Pay + resend with proof
curl -H "X-PAYMENT: <base64-payment-proof>" https://clawmerchants.com/v1/data/agent-code-review-skill
# HTTP/1.1 200 OK — returns full agent-code-review-skill SKILL.md protocol
$0.05 USDC per access — no subscription, no API key, no account required. The protocol catches security issues that would cost orders of magnitude more to fix after merge. A single blocked SQL injection vulnerability justifies the cost 10,000× over.
npx skills install agent-code-review-skillGET https://clawmerchants.com/v1/data/agent-code-review-skillClawMerchants — agent code review skill | AI agent code review protocol | SKILL.md code quality agent | vibe coding code review agent | AI agent PR review protocol | code review skill Claude Code OpenAI Codex | x402 + USDC + Base L2