This Claude skill automates comprehensive code reviews for commits and pull requests, focusing on identifying security vulnerabilities, ensuring Test-Driven Development (TDD) compliance, and maintaining high code quality standards. It provides developers with structured feedback, including security checklists and documentation requirements, to ensure a secure, maintainable, and robust codebase.
Use Cases
Automated Security Auditing: Detecting OWASP Top 10 vulnerabilities such as SQL injection, XSS, and hardcoded secrets during the PR process.
TDD Validation: Verifying that new features are accompanied by behavior-driven tests rather than just implementation-focused tests.
Code Quality Enforcement: Identifying technical debt like silent exceptions, 'any' types in TypeScript, and hardcoded magic numbers.
Documentation Compliance: Ensuring all files, classes, and functions meet mandatory documentation standards (e.g., JSDoc/TSDoc) before merging.
Standardized PR Verdicts: Providing a clear 'Ready', 'Review', or 'Rework' status based on a rigorous multi-step review flow.
name
code-review
description
Comprehensive code review for commits and pull requests. Covers security, TDD, code quality, and documentation standards.
Code Review Skill
Thorough review with emphasis on Security and TDD.
// BAD: No documentation
export function createUser(data) {
return db.create(data);
}
// GOOD: Full documentation
/**
* Creates a new user account with validation.
*
* @param data - User creation input
* @returns Created user object
* @throws {ValidationError} If email invalid
*
* @related
* - ./UserRepository.ts - Database persistence
* - ../validators/email.ts - Email validation
*/
export async function createUser(data: CreateUserInput): Promise<User>
# Check for secrets
grep -r "password\|secret\|api_key\|token" --include="*.ts"
# Check for SQL injection
grep -r "SELECT.*\${" --include="*.ts"
# Check for XSS
grep -r "innerHTML\|dangerouslySetInnerHTML" --include="*.tsx"
Step 2: TDD Validation
# Check test coverage
npm test -- --coverage
# Verify tests exist for changed files
Verdict Rules
Condition
Verdict
Any critical security
Needs Rework
No tests for new functionality
Needs Review
Minor issues only
Ready (with suggestions)
No issues
Ready to merge
Example: Transparency Block
<decision-transparency>
**Decision:** Approve with minor suggestions (Ready)
**Reasoning:**
- **Security**: No vulnerabilities found
- **Testing**: All new code has tests
- **Quality**: Minor naming suggestions only
**Issues Found:**
1. Minor: Variable name `d` could be `data` (line 42)
2. Minor: Consider extracting magic number 5 to constant
**Confidence:** High - Standard approval scenario
</decision-transparency>
Example: Debate Invitation
<debate-invitation>
**Topic:** Handling of deprecated API usage
**Option A: Block Until Fixed**
- Pros: No technical debt
- Cons: Delays release
**Option B: Approve with Follow-up Task**
- Pros: Pragmatic, allows progress
- Cons: Debt may linger
**My Lean:** Option B - Create ticket, set deadline
**Your Input Needed:** Is there a release deadline? How critical is this code path?
</debate-invitation>