code-review-standards
Code review framework and criteria. References security-sentinel for security checks. Use when performing code reviews or defining review standards.
What this skill does
# Code Review Standards
## When to Use
- Reviewing pull requests
- Performing code reviews
- Defining review criteria
- Establishing review process
## Overview
Code review standards ensure consistent, thorough reviews that catch bugs before they reach production. This skill aggregates criteria from specialized skills.
## Review Framework
### 4-Level Severity Classification
1. **CRITICAL** ๐ด - Must fix before merge
- Security vulnerabilities
- Data loss risks
- Authentication bypasses
- SQL injection risks
2. **HIGH** ๐ - Should fix before merge
- TypeScript strict mode violations
- Missing error handling
- Performance issues (N+1 queries)
- Missing input validation
3. **MEDIUM** ๐ก - Fix soon (can merge with plan)
- Code quality issues
- Missing tests
- Poor naming
- Missing documentation
4. **LOW** ๐ข - Nice to have
- Style suggestions
- Optimization opportunities
- Refactoring ideas
---
## Review Checklist
### 1. Correctness
โ See: [correctness-criteria.md](./correctness-criteria.md)
- [ ] Logic is correct for all test cases
- [ ] Edge cases handled (null, empty, max, min)
- [ ] Error conditions properly handled
- [ ] Return types match function signatures
- [ ] Async operations properly awaited
- [ ] No race conditions
- [ ] No off-by-one errors
---
### 2. Security
โ See: [security-sentinel skill](../security-sentinel/SKILL.md)
โ See: [security-checklist.md](./security-checklist.md)
**CRITICAL - Must check every review:**
- [ ] No hardcoded secrets
- [ ] Input validation with Zod (ALL inputs)
- [ ] Authentication checked on protected routes
- [ ] Authorization enforced (resource ownership)
- [ ] SQL injection prevented (using Drizzle)
- [ ] XSS prevented (no dangerouslySetInnerHTML without sanitization)
- [ ] CSRF protection on state-changing operations
- [ ] No sensitive data in logs
- [ ] Passwords hashed (bcrypt, 12+ rounds)
- [ ] JWTs properly verified
**For complete security criteria:**
โ [security-sentinel/SKILL.md](../security-sentinel/SKILL.md)
---
### 3. TypeScript Quality
โ See: [typescript-strict-guard skill](../typescript-strict-guard/SKILL.md)
- [ ] No `any` types
- [ ] No `@ts-ignore` without extensive comment
- [ ] No `!` non-null assertions without comment
- [ ] Explicit types on all function parameters
- [ ] Explicit return types on all functions
- [ ] Type guards used for unknown types
- [ ] Proper use of generics
- [ ] No implicit any
---
### 4. Testing
โ See: [quality-gates/test-patterns.md](../quality-gates/test-patterns.md)
- [ ] Tests exist for new code
- [ ] Tests follow AAA pattern
- [ ] Coverage meets thresholds (75%/90%)
- [ ] UI tests verify DOM state (not just mocks)
- [ ] E2E tests for visual changes
- [ ] No skipped tests without reason
- [ ] Tests are independent
- [ ] Tests clean up after themselves
---
### 5. Performance
โ See: [performance-criteria.md](./performance-criteria.md)
- [ ] No N+1 query problems
- [ ] Database queries optimized
- [ ] Async operations parallelized where possible
- [ ] Large datasets paginated
- [ ] Images optimized
- [ ] No unnecessary re-renders
- [ ] Expensive calculations memoized
---
### 6. Code Quality
โ See: [maintainability-rules.md](./maintainability-rules.md)
- [ ] No console.log in production code
- [ ] No commented-out code
- [ ] No TODO without GitHub issue
- [ ] Functions have single responsibility
- [ ] Variable names are descriptive
- [ ] No dead code
- [ ] No duplicated logic
- [ ] Proper error messages
---
### 7. Architecture Compliance
โ See: [architecture-patterns skill](../architecture-patterns/SKILL.md)
- [ ] Correct pattern chosen for problem
- [ ] Pattern implemented correctly
- [ ] No pattern violations
- [ ] Follows Next.js best practices
- [ ] Server vs Client Components correct
- [ ] State management appropriate
---
## Review Process
### Step 1: Pre-Review (2 minutes)
1. Read PR description
2. Understand what changed and why
3. Check CI/CD status (tests, build, coverage)
4. Identify high-risk areas (auth, payments, data handling)
### Step 2: Security Review (5 minutes)
**For ALL PRs:**
- Check for hardcoded secrets
- Verify input validation
- Check authentication/authorization
**For Auth/API/Data PRs:**
- Run security-sentinel skill
- Review OWASP Top 10 criteria
- Check for injection risks
โ [security-checklist.md](./security-checklist.md)
### Step 3: Code Review (10-20 minutes)
1. **Correctness**: Does it work as intended?
2. **TypeScript**: Strict mode compliance?
3. **Testing**: Adequate coverage and quality?
4. **Performance**: Any obvious issues?
5. **Quality**: Readable, maintainable code?
6. **Architecture**: Follows established patterns?
### Step 4: Write Feedback (5 minutes)
Use severity levels and templates:
โ [review-templates.md](./review-templates.md)
**Format:**
```markdown
## ๐ด CRITICAL Issues
- [ ] [Security] Hardcoded API key in auth.ts:45
- **Risk**: API key exposed in version control
- **Fix**: Move to environment variable
- **File**: src/lib/auth.ts:45
## ๐ HIGH Issues
- [ ] [TypeScript] Using `any` type in processData()
- **Issue**: No type safety
- **Fix**: Define explicit interface
- **File**: src/utils/process.ts:12
## ๐ก MEDIUM Issues
- [ ] [Testing] Missing tests for error cases
- **Coverage**: Only happy path tested
- **Needed**: Test null input, invalid format
- **File**: tests/unit/process.test.ts
## ๐ข LOW Issues / Suggestions
- Consider extracting helper function for readability
```
### Step 5: Verdict
**Choose one:**
- โ
**APPROVE** - No critical/high issues
- ๐ **REQUEST CHANGES** - Critical or multiple high issues
- ๐ฌ **COMMENT** - Questions or low/medium issues only
---
## Review Templates
### Security Issue Template
```markdown
๐ด **[Security] [Vulnerability Type]**
**Location**: `src/path/file.ts:123`
**Issue**: [Description of vulnerability]
**Risk**: [What could go wrong]
**Fix**:
```typescript
// Suggested fix
```
**Reference**: [OWASP link or skill reference]
```
### TypeScript Issue Template
```markdown
๐ **[TypeScript] [Issue Type]**
**Location**: `src/path/file.ts:45`
**Issue**: [What's wrong]
**Fix**:
```typescript
// Current (bad)
function process(data: any) { }
// Suggested (good)
function process(data: ProcessData): ProcessedResult { }
```
**Reference**: typescript-strict-guard skill
```
### Performance Issue Template
```markdown
๐ก **[Performance] [Issue Type]**
**Location**: `src/path/file.ts:78`
**Issue**: N+1 query problem in getUserProjects()
**Impact**: Linear time complexity, slow for large datasets
**Fix**:
```typescript
// Use join instead of separate queries
const projects = await db
.select()
.from(projectsTable)
.leftJoin(usersTable, eq(projectsTable.userId, usersTable.id))
```
```
---
## Common Review Patterns
### Code Smells
**Long Functions**
```typescript
// ๐ด BAD: 100+ line function
function processEverything() {
// ... 100 lines
}
// โ
GOOD: Extracted helpers
function processEverything() {
const validated = validateInput()
const processed = processData(validated)
const saved = saveToDatabase(processed)
return saved
}
```
**Deeply Nested Logic**
```typescript
// ๐ด BAD: 4+ levels of nesting
if (user) {
if (user.projects) {
if (user.projects.length > 0) {
if (user.projects[0].status === 'active') {
// ...
}
}
}
}
// โ
GOOD: Early returns
if (!user) return
if (!user.projects || user.projects.length === 0) return
if (user.projects[0].status !== 'active') return
// ...
```
**Magic Numbers**
```typescript
// ๐ด BAD: Unexplained numbers
setTimeout(callback, 3600000)
// โ
GOOD: Named constants
const ONE_HOUR_MS = 60 * 60 * 1000
setTimeout(callback, ONE_HOUR_MS)
```
---
## Progressive Disclosure
1. **SKILL.md** (this file) - Review framework overview
2. **security-checklist.md** - OWASP Top 10 checklist
3. **performance-criteria.md** - Performance review criteria
4. **maintainability-rules.md** Related in Security
mac-ops
IncludedComprehensive macOS workstation operations โ diagnose kernel panics, identify failing drives, audit launchd startup items, decode wake reasons, triage TCC permission denials, manage APFS snapshots, recover from no-boot. Use for: Mac is slow, slow bootup, won't boot, kernel panic, kernel_task hot, mds_stores CPU, photoanalysisd, cloudd, login loop, gray screen, sleep wake failure, drive failing, IO errors, APFS snapshots eating space, Time Machine local snapshots, Spotlight indexing, launchd, LaunchAgent, LaunchDaemon, login items, TCC permissions, Full Disk Access, Screen Recording denied, Gatekeeper, quarantine, com.apple.quarantine, app is damaged, helper tool, /Library/PrivilegedHelperTools, pmset, wake reasons, dark wake, sysdiagnose, panic.ips, DiagnosticReports, configuration profile, MDM profile, remote diagnostics over SSH.
a11y-audit
IncludedRun accessibility audits on web projects combining automated scanning (axe-core, Lighthouse) with WCAG 2.1 AA compliance mapping, manual check guidance, and structured reporting. Output is configurable: markdown report only, markdown plus machine-readable JSON, or markdown plus issue tracker integration. Use this skill whenever the user mentions "accessibility audit", "a11y audit", "WCAG audit", "accessibility check", "compliance scan", or asks to check a web project for accessibility issues. Also trigger when the user wants to verify WCAG conformance or map findings to a specific standard (CAN-ASC-6.2, EN 301 549, ADA/AODA).
erpclaw
IncludedAI-native ERP system with self-extending OS. Full accounting, invoicing, inventory, purchasing, tax, billing, HR, payroll, advanced accounting (ASC 606/842, intercompany, consolidation), and financial reporting. 413 actions across 14 domains, 43 expansion modules. Constitutional guardrails, adversarial audit, schema migration. Double-entry GL, immutable audit trail, US GAAP.
assess
IncludedAssesses and rates quality 0-10 across multiple dimensions (correctness, maintainability, security, performance, testability, simplicity) with pros/cons analysis. Compares against project conventions and prior decisions from memory. Produces structured evaluation reports with actionable improvement suggestions. Use when evaluating code, designs, architectures, or comparing alternative approaches.
spring-boot-security-jwt
IncludedProvides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based access control using Spring Security 6.x. Use when implementing authentication or authorization in Spring Boot applications.
code-hardcode-audit
IncludedDetect hardcoded values, magic numbers, and leaked secrets. TRIGGERS - hardcode audit, magic numbers, PLR2004, secret scanning.