dirien/yet-another-agent-harness / .claude/skills/code-reviewer
code-reviewer
VerifiedAnalyzes code diffs and files to identify bugs, security vulnerabilities (SQL injection, XSS, insecure deserialization), code smells, N+1 queries, naming issues, and architectural concerns, then produces a structured review report with prioritized, actionable feedback. Use when reviewing pull requests, conducting code quality audits, identifying refactoring opportunities, or checking for security issues. Invoke for PR reviews, code quality checks, refactoring suggestions, review code, code quality. Complements specialized skills (security-reviewer, test-master) by providing broad-scope review across correctness, performance, maintainability, and test coverage in a single pass.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 5.0 KB |
| references/common-issues.md | markdown | 2.9 KB |
| references/feedback-examples.md | markdown | 3.4 KB |
| references/receiving-feedback.md | markdown | 6.5 KB |
| references/report-template.md | markdown | 3.0 KB |
| references/review-checklist.md | markdown | 2.4 KB |
| references/spec-compliance-review.md | markdown | 8.8 KB |
references/common-issues.md
View on GitHub# Common Issues
## N+1 Query Problem
```typescript
// N+1 queries - BAD
const posts = await Post.findAll();
for (const post of posts) {
post.author = await User.findById(post.authorId); // N queries!
}
// Single query with join - GOOD
const posts = await Post.findAll({ include: [User] });
// Or batch load
const posts = await Post.findAll();
const authorIds = posts.map(p => p.authorId);
const authors = await User.findByIds(authorIds);
```
## Missing Error Handling
```typescript
// Unhandled rejection - BAD
const data = await fetch('/api/data').then(r => r.json());
// Proper error handling - GOOD
try {
const response = await fetch('/api/data');
if (!response.ok) {
throw new Error(`HTTP ${response.status}`);
}
const data = await response.json();
} catch (error) {
logger.error('Failed to fetch data', { error });
throw new DataFetchError('Could not load data');
}
```
## Magic Numbers/Strings
```typescript
// Magic number - BAD
if (user.age >= 18) { ... }
setTimeout(fn, 86400000);
// Named constant - GOOD
const MINIMUM_AGE = 18;
const ONE_DAY_MS = 24 * 60 * 60 * 1000;
if (user.age >= MINIMUM_AGE) { ... }
setTimeout(fn, ONE_DAY_MS);
```
## Deep Nesting
```typescript
// Deep nesting - BAD
if (user) {
if (user.isActive) {
if (user.hasPermission) {
doSomething();
}
}
}
// Early returns - GOOD
if (!user || !user.isActive || !user.hasPermission) {
return;
}
doSomething();
```
## God Functions
```typescript
// Does too much - BAD
async function processOrder(order) {
// validate
// check inventory
// process payment
// send email
// update database
// log analytics
}
// Single responsibility - GOOD
async function processOrder(order) {
await validateOrder(order);
await reserveInventory(order);
await chargePayment(order);
await sendConfirmation(order);
}
```
## Mutable Shared State
```typescript
// Shared mutable - BAD
const config = { debug: false };
function enableDebug() {
config.debug = true;
}
// Immutable pattern - GOOD
function createConfig(overrides = {}) {
return Object.freeze({ debug: false, ...overrides });
}
```
## Missing Null Checks
```typescript
// Unsafe access - BAD
const name = user.profile.name;
// Safe access - GOOD
const name = user?.profile?.name ?? 'Unknown';
```
## Synchronous File Operations
```typescript
// Blocks event loop - BAD
const data = fs.readFileSync('file.txt');
// Non-blocking - GOOD
const data = await fs.promises.readFile('file.txt');
```
## Quick Reference
| Issue | Impact | Fix |
|-------|--------|-----|
| N+1 queries | Performance | Eager load or batch |
| Missing error handling | Reliability | Try/catch + logging |
| Magic numbers | Maintainability | Named constants |
| Deep nesting | Readability | Early returns |
| God functions | Testability | Single responsibility |
| Mutable shared state | Bugs | Immutable patterns |
| Missing null checks | Crashes | Optional chaining |
| Sync file operations | Performance | Async operations |
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 470k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 470k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 470k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |