# Code Review Assistant

> This skill should be used when the user asks to "review this code", "code review for", "check this implementation", "is this code good", "review my changes", or "perform code review". Performs thorough code reviews focusing on quality, maintainability, test coverage, and adherence to project standards.

- **Type:** Skill
- **Install:** `agentstack add skill-michaeld-42-agentic-skills-code-review`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [MichaelD-42](https://agentstack.voostack.com/s/michaeld-42)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [MichaelD-42](https://github.com/MichaelD-42)
- **Source:** https://github.com/MichaelD-42/agentic-skills/tree/main/skills/code-review

## Install

```sh
agentstack add skill-michaeld-42-agentic-skills-code-review
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Code Review Assistant

Perform systematic code reviews to ensure quality, maintainability, and adherence to project standards.

## Purpose

This skill evaluates code quality across multiple dimensions: clarity, correctness, test coverage, performance, and alignment with project architecture. Use this skill at the "Verify" step of the development cycle and during phase acceptance.

## When to Use This Skill

Invoke when:

- Completing a feature or function
- Before committing code
- During acceptance phase
- After refactoring
- Reviewing pull requests
- Checking code quality

## Review Checklist

### 1. Code Quality

**Clarity and Readability**:

- ✅ Clear, descriptive function and variable names
- ✅ Functions are small and focused ( 30 lines):

- Extract smaller functions
- Single Responsibility Principle

**Deep Nesting** (> 3 levels):

- Use early returns (guard clauses)
- Extract complex logic

**Code Duplication**:

- Extract shared logic
- Create utility functions

**Magic Numbers**:

```typescript
// Bad
if (user.status === 2) {
}

// Good
const STATUS_ACTIVE = 2;
if (user.status === STATUS_ACTIVE) {
}

// Better
enum UserStatus {
  PENDING = 0,
  INACTIVE = 1,
  ACTIVE = 2,
  SUSPENDED = 3,
}
if (user.status === UserStatus.ACTIVE) {
}
```

### TypeScript Issues

**Using `any`**:

```typescript
// Bad
function process(data: any) {}

// Good
function process(data: UserData) {}
```

**Missing Return Types**:

```typescript
// Bad
function getUser(id) {}

// Good
function getUser(id: string): User | null {}
```

### Testing Issues

**Missing Edge Cases**:

- Test negative values
- Test boundary values
- Test invalid inputs

**Unclear Test Names**:

```typescript
// Bad
it('test1', () => {});

// Good
it('returns null when position is out of bounds', () => {});
```

## Common Architecture Patterns

### Separation of Concerns

**Good**:

```typescript
// Service: Pure business logic
class OrderService {
  calculateTotal(items: OrderItem[]): number {
    // Pure calculation
  }
}

// Controller: HTTP handling
class OrderController {
  async handleRequest(req: Request): Promise {
    const total = this.orderService.calculateTotal(req.body.items);
    return Response.json({ total });
  }
}
```

**Bad**:

```typescript
// Mixed concerns
class OrderService {
  async calculateTotal(items: OrderItem[], res: Response): Promise {
    // Calculate AND send response (tight coupling)
  }
}
```

### Event-Driven Communication

**Good**:

```typescript
// Emitter
this.eventBus.emit('order-created', { orderId, userId });

// Listener (in another service)
this.eventBus.on('order-created', this.sendConfirmationEmail, this);
```

**Bad**:

```typescript
// Direct coupling
this.emailService.sendConfirmationEmail(); // Called from order creation
```

### Resource Cleanup

**Good**:

```typescript
destroy(): void {
  this.eventBus.off();
  this.timers.forEach(t => clearTimeout(t));
  this.connections.forEach(c => c.close());
}
```

**Bad**:

```typescript
destroy(): void {
  // No cleanup - memory leak!
}
```

## Approval Criteria

### ✅ Approved

Code meets all quality standards:

- No critical issues
- Test coverage meets targets
- Follows project conventions
- Clear and maintainable
- Well-documented

### ⚠️ Approve with Changes

Code is functional but has minor issues:

- Some moderate issues to address
- Coverage slightly below target
- Minor refactoring beneficial
- Documentation incomplete

**Action**: Fix issues before next phase

### ❌ Changes Required

Code has significant issues:

- Critical bugs or security issues
- Missing test coverage
- Violates architecture
- Major refactoring needed
- Unreadable or unmaintainable

**Action**: Rework before proceeding

## Critical Reminders

- Review code, not the person
- Provide actionable, specific feedback
- Explain WHY something is an issue
- Suggest concrete improvements
- Acknowledge good practices
- Be constructive and respectful

Code review is not about perfection—it's about continuous improvement and maintaining quality standards while shipping working software.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [MichaelD-42](https://github.com/MichaelD-42)
- **Source:** [MichaelD-42/agentic-skills](https://github.com/MichaelD-42/agentic-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-michaeld-42-agentic-skills-code-review
- Seller: https://agentstack.voostack.com/s/michaeld-42
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
