| name | pr-review |
| description | Cognitive pre-merge linter — analyzes full diff against conventions and best practices |
| version | 2.0.0 |
| compat | claude-code, codex, cursor, openclaw |
Skill: PR Review (Cognitive Pre-Merge Linter)
Purpose
Act as an automated second pair of eyes. Analyzes the full branch diff (git diff main...HEAD) against repository conventions and engineering best practices before consolidating code.
Audit Dimensions
1. Functional Correctness and Edge Cases
- Look for unhandled error paths (promises without
.catch or try/catch, null/undefined values that could break the flow).
- Detect potential race conditions or inconsistent client/server states.
2. Test Coverage
- Validate that core business logic or new endpoints have corresponding test files.
- Lack of coverage in critical components is considered blocking.
3. Conventions, Architecture, and Cleanliness
- Contrast changes against the repository's architectural definitions.
- Detect residual
console.log, debug comments (// TODO: remove this), or dead code.
4. Early Layer Security
- Secrets: Strictly prohibit hardcoded credentials, tokens, or API keys.
- Injections: Verify that user inputs are typed, validated, or sanitized before touching databases or system operations.
- Auth guards: Ensure every new route has its corresponding middleware or session validation.
5. Efficiency and Performance
- Identify unnecessary iterations, heavy main-thread mutations, or inefficient database queries (e.g., avoidable N+1 pattern).
Strict Output Report Structure
The agent must render the review using exactly this Markdown template:
## 🔍 Code Review Report — [Branch/Task]
### ✅ Positives
- [Design strengths, modularity, or good practices applied]
### 🔴 Blocking Findings (Require Mandatory Fix)
- **[File:Line]** — [Description of security, build, or severe logic issue]
### 🟡 Suggested Improvements (Do Not Block Merge)
- **[File:Line]** — [Readability recommendation, minor optimization, or future refactor]
### 🔵 Technical Notes / Debt
- [Contextual notes on architecture or long-term behavior]
### 🛠️ FINAL VERDICT
[APPROVED / REQUEST CHANGES]