← ClaudeAtlas

neo-clean-architecturelisted

Use this skill when the user wants to design, implement, review, or refactor software systems conforming to Clean Architecture principles. It structures code into Domain, Application, Infrastructure, and Presentation/API layers, enforcing inward-only dependencies. It advocates rich domain models, CQRS, and the Result pattern, operating on technology-neutral concepts without database or framework bindings.
Benknightdark/neo-skills · ★ 5 · AI & Automation · score 80
Install: claude install-skill Benknightdark/neo-skills
# Clean Architecture Design and review software systems using Clean Architecture. The core objective is separating concerns based on their rate of change, directing all source code dependencies inward toward the Domain core. ## Gotchas * **Anemic Models**: Entities that are mere data containers (only getters/setters) leak business logic. Entities must protect their invariants. State changes must go through explicit, business-oriented methods. * **Pointless Value Objects**: Avoid wrapping primitives (e.g., string, number) unless they encapsulate validation (e.g., email format) or behavior (e.g., auto-slug generation). * **Deep Object Graphs**: Do not nest full entities for associations. Loading a parent entity will trigger database performance issues. Reference other aggregates using IDs instead. * **Dependency Leakage**: Repository interfaces must reside in the Application layer, with implementations in Infrastructure. Never return query streams (e.g., `IQueryable`) to Application, as it leaks database concerns. * **Exception Control Flow**: Do not throw runtime exceptions for expected business failures (e.g., duplicate title, user not found). Use the Result pattern for flow control. --- ## Workflow Checklist Progress: - [ ] Step 1: Analyze Core & Boundaries (See `references/design_principles.md`). - [ ] Step 2: Design Domain Layer (Build entities and value objects; protect invariants). - [ ] Step 3: Design Application Layer (Define use case handlers, CQRS inputs, and re