Applies Clean Architecture, SOLID principles, and domain-driven design to structure new systems and refactors.
---
name: Software Architecture
description: Design systems with Clean Architecture, SOLID principles, and clear dependency rules.
---
# Software Architecture
Design for change. Every decision is a trade-off - name it.
## Clean Architecture layers (inside → outside)
1. **Entities**: Business objects and rules. No framework dependencies.
2. **Use Cases**: Application-specific business rules. Orchestrate entities.
3. **Interface Adapters**: Controllers, presenters, gateways. Transform data.
4. **Frameworks & Drivers**: UI, DB, web framework. The outer ring.
**Dependency Rule**: Source code dependencies only point inward.
## SOLID applied
- **S**: One reason to change. If two actors own a class, split it.
- **O**: Open for extension, closed for modification. Use interfaces.
- **L**: Subtypes substitutable for their base type. No surprise behavior.
- **I**: Small, specific interfaces over one general one.
- **D**: Depend on abstractions. Pass dependencies in, don't instantiate.
## Decision checklist
- Where does this business rule live? (Entity or Use Case)
- What changes independently? (Separate those)
- What will likely change together? (Keep those together)
- What are the external dependencies? (Wrap them in interfaces)
- How do you test this in isolation?
## Red flags… load the full skill through Skill Me