askill
code-review

code-reviewSafety 100Repository

Combined DDD and OOP code review. Run after implementation to validate code against both checklists. For focused reviews, use code-review-ddd or code-review-oop.

0 stars
1.2k downloads
Updated 2/6/2026

Package Files

Loading files...
SKILL.md

Code Review (Combined)

Overview

Validates implemented code against both DDD and OOP principles. This is the standard post-implementation review.

Announce at start: "Using ddd-workflow:code-review to validate implementation."

What This Reviews

Runs both checklists:

  1. DDD review — Domain modeling, bounded contexts, layer purity
  2. OOP review — SRP, patterns, conditionals, composition

Quick Combined Checklist

DDD Compliance (from criteria/ddd-checklist.md)

Layered Architecture:

  • Domain layer has zero external imports (no SQLAlchemy, requests, etc.)
  • Application layer orchestrates; no business logic
  • Infrastructure implements domain interfaces
  • Dependencies point inward: infrastructure → application → domain

Value Objects:

  • Immutable (@dataclass(frozen=True))
  • Equality by value, not identity
  • Validation in __post_init__

Entities:

  • Identity-based equality
  • Factory methods for creation (Entity.create(...))
  • State transitions via State pattern (no conditionals)
  • Emits domain events for significant changes

Repositories:

  • Interface defined in domain layer
  • Works with domain models only (not ORM)
  • Implementation in infrastructure layer

OOP Compliance (from criteria/oop-checklist.md)

Conditionals (Zero Tolerance):

  • No if/elif/else controlling behavior in domain/application
  • State Pattern for state-dependent behavior
  • Strategy Pattern for algorithm selection
  • Factory Pattern for type-based creation

Method Design:

  • Single responsibility per method
  • No "and" in method names (unless single business action)
  • Methods fit on one screen (~20 lines)

Composition:

  • Prefer composition over inheritance
  • Inject behavior via protocols/ABCs
  • Dependencies injected, not constructed internally

Red Flags

Red FlagProblemFix
from sqlalchemy in domainInfrastructure leakProtocol in domain, impl in infrastructure
if in entity methodConditional smellState pattern, composed objects
Mutable value objectIdentity confusionfrozen=True dataclass
Service modifies entityAnemic modelEntity coordinates via composition
"and" in method nameMixed responsibilitiesSplit into focused methods
Boolean flag parameterHidden branchingExtract strategies/states

Review Process

  1. Identify files to review - Ask user or detect from recent changes
  2. Run DDD checklist - Check each item against the code
  3. Run OOP checklist - Check each item against the code
  4. Compile findings - Group by severity
  5. Present report - With specific file:line references

Output Format

## Code Review Results

### Critical Issues
| File | Line | Issue | Fix |
|------|------|-------|-----|
| domain/user.py | 45 | Conditional in entity | Use State pattern |

### Suggestions
- Consider extracting X to improve testability

### Passed Checks
- ✓ Domain layer purity
- ✓ Value object immutability
- ✓ Repository pattern compliance

### Summary
X critical issues, Y suggestions. [Ready for merge / Needs fixes]

When to Use

  • After completing a task from an implementation plan
  • Before creating a PR
  • When refactoring existing code
  • During code review of others' work

Related Skills

  • ddd-workflow:code-review-ddd — DDD-focused review only
  • ddd-workflow:code-review-oop — OOP-focused review only

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

95/100Analyzed 2/13/2026

A comprehensive and well-structured skill for performing code reviews based on DDD and OOP principles. It includes detailed checklists, specific red flags, a clear execution process, and a defined output template, making it highly actionable for an AI agent.

100
95
85
95
95

Metadata

Licenseunknown
Version-
Updated2/6/2026
Publishertzenderman

Tags

github-actions