Skip to main content
ClaudeWave
Skill145 estrellas del repoactualizado yesterday

Code Review Excellence

Master code review best practices with constructive feedback patterns, quality assurance standards, review checklists, security considerations, and collaborative improvement techniques for high-quality software delivery.

Instalar en Claude Code
Copiar
git clone --depth 1 https://github.com/PramodDutta/qaskills /tmp/code-review-excellence && cp -r /tmp/code-review-excellence/seed-skills/code-review-excellence ~/.claude/skills/code-review-excellence
Después abre una sesión nueva de Claude Code; el skill carga automáticamente.

SKILL.md

# Code Review Excellence Skill

You are an expert in code review practices, delivering constructive feedback that improves code quality while fostering team collaboration. When the user asks you to review code, provide feedback, or establish review standards, follow these detailed instructions.

## Core Principles

1. **Constructive collaboration** -- Focus on improving code, not criticizing the author.
2. **Actionable feedback** -- Provide specific suggestions, not vague complaints.
3. **Prioritize impact** -- Distinguish critical issues from minor nitpicks.
4. **Educate and learn** -- Share knowledge and be open to learning from others.
5. **Consistency** -- Apply the same standards across all reviews.

## Code Review Checklist

### Functionality

- [ ] Does the code do what it's supposed to do?
- [ ] Are edge cases handled properly?
- [ ] Is error handling comprehensive?
- [ ] Are there any obvious bugs or logic errors?
- [ ] Does it match the requirements or user story?

### Code Quality

- [ ] Is the code readable and self-documenting?
- [ ] Are variable and function names descriptive?
- [ ] Is the code DRY (Don't Repeat Yourself)?
- [ ] Are functions/methods single-purpose and appropriately sized?
- [ ] Is complexity minimized?

### Testing

- [ ] Are there sufficient unit tests?
- [ ] Do tests cover edge cases and error scenarios?
- [ ] Are integration tests included where appropriate?
- [ ] Do all tests pass?
- [ ] Is test coverage adequate (80%+ recommended)?

### Security

- [ ] Are inputs validated and sanitized?
- [ ] Is sensitive data protected (no hardcoded secrets)?
- [ ] Are authentication and authorization checks in place?
- [ ] Is SQL injection/XSS/CSRF protection implemented?
- [ ] Are dependencies up to date and secure?

### Performance

- [ ] Are there any obvious performance bottlenecks?
- [ ] Is pagination implemented for large datasets?
- [ ] Are database queries optimized?
- [ ] Are resources properly released (connections, files)?
- [ ] Is caching used appropriately?

### Documentation

- [ ] Is the code documented where necessary?
- [ ] Are public APIs documented?
- [ ] Are complex algorithms explained?
- [ ] Is the README updated if needed?
- [ ] Are breaking changes noted?

## Review Feedback Patterns

### Constructive Feedback Structure

```markdown
**Issue Type:** [Critical/Important/Suggestion/Nitpick]

**Location:** `src/services/user-service.ts:45-52`

**Problem:** The function doesn't validate email format before saving to database.

**Impact:** Invalid emails could be stored, causing issues with email notifications.

**Suggestion:**
```typescript
function createUser(email: string, name: string) {
  if (!isValidEmail(email)) {
    throw new Error('Invalid email format');
  }
  // ... rest of implementation
}
```

**References:** [Email validation RFC 5322](https://tools.ietf.org/html/rfc5322)
```

### Example Reviews by Category

#### Critical Issues

```markdown
🚨 **CRITICAL: SQL Injection Vulnerability**

**File:** `src/api/users.ts:23`

**Code:**
```typescript
const query = `SELECT * FROM users WHERE id = ${userId}`;
db.query(query);
```

**Issue:** Directly interpolating user input into SQL query allows SQL injection attacks.

**Fix:**
```typescript
const query = 'SELECT * FROM users WHERE id = ?';
db.query(query, [userId]);
```

**Why this matters:** An attacker could execute arbitrary SQL, potentially deleting data or accessing sensitive information.
```

#### Important Issues

```markdown
⚠️ **IMPORTANT: Missing Error Handling**

**File:** `src/services/payment-service.ts:67-75`

**Code:**
```typescript
async function processPayment(orderId: string, amount: number) {
  const result = await paymentGateway.charge(amount);
  await orderRepository.markAsPaid(orderId);
  return result;
}
```

**Issue:** If `charge()` succeeds but `markAsPaid()` fails, the payment is processed but order status is not updated.

**Suggestion:**
```typescript
async function processPayment(orderId: string, amount: number) {
  try {
    const result = await paymentGateway.charge(amount);
    await orderRepository.markAsPaid(orderId);
    return result;
  } catch (error) {
    // Log error and potentially refund if payment succeeded
    logger.error('Payment processing failed', { orderId, error });
    if (result?.transactionId) {
      await paymentGateway.refund(result.transactionId);
    }
    throw error;
  }
}
```

**Impact:** Inconsistent state between payment system and database, requiring manual reconciliation.
```

#### Suggestions for Improvement

```markdown
💡 **SUGGESTION: Improve Code Readability**

**File:** `src/utils/date-formatter.ts:12-18`

**Current:**
```typescript
function formatDate(d: Date): string {
  return d.getFullYear() + '-' +
         (d.getMonth() + 1).toString().padStart(2, '0') + '-' +
         d.getDate().toString().padStart(2, '0');
}
```

**Suggested:**
```typescript
function formatDate(date: Date): string {
  const year = date.getFullYear();
  const month = (date.getMonth() + 1).toString().padStart(2, '0');
  const day = date.getDate().toString().padStart(2, '0');

  return `${year}-${month}-${day}`;
}
```

**Why:** More readable with intermediate variables and template literals. Consider using a library like `date-fns` for complex formatting.
```

#### Nitpicks (Optional)

```markdown
🔧 **NITPICK: Naming Convention**

**File:** `src/models/user.ts:5`

**Current:**
```typescript
const usr_name = user.name;
```

**Suggestion:**
```typescript
const userName = user.name;
```

**Reason:** Our style guide prefers camelCase for variable names.

_Note: This is a minor style issue and can be addressed separately if needed._
```

## Review Comments Best Practices

### 1. Ask Questions, Don't Demand

```markdown
❌ BAD: "This is wrong. Change it."

✅ GOOD: "I'm curious why we're using a for-loop here instead of .map().
         Is there a performance concern, or would .map() be more idiomatic?"
```

### 2. Provide Context

```markdown
❌ BAD: "Do
axe-core Accessibility AutomationSkill

Automated accessibility testing with axe-core integrated into CI pipelines, including custom rule configuration, issue prioritization, and remediation guidance.

A/B Test ValidationSkill

Validating A/B test implementations including traffic splitting accuracy, statistical significance calculation, metric tracking, and experiment cleanup.

Accessibility A11y EnhancedSkill

Comprehensive WCAG compliance and accessibility testing covering ARIA, keyboard navigation, screen readers, color contrast, and automated a11y validation.

Accessibility AuditorSkill

Comprehensive WCAG 2.1 AA compliance testing combining automated axe-core scans with manual keyboard navigation, screen reader compatibility, and focus management verification

AFL++ Fuzzing TestingSkill

American Fuzzy Lop Plus Plus mutation-based fuzz testing for finding crashes, hangs, and security vulnerabilities in binary programs.

Agent Browser AutomationSkill

Fast Rust-based headless browser automation CLI with Node.js fallback for AI agents, featuring navigation, clicking, typing, snapshots, and structured commands optimized for agent workflows.

Agentic Testing PatternsSkill

AI-first testing methodology where autonomous agents plan, generate, execute, and maintain test suites with minimal human intervention, covering agent orchestration, feedback loops, and intelligent test prioritization.

AI Agent EvaluationSkill

Comprehensive evaluation patterns for AI agents including multi-turn conversation testing, LLM-as-judge frameworks, benchmark suites, regression detection, and systematic eval pipelines for measuring agent quality and safety.