joabgonzalez/ai-agents-skills/clean-architecture
Claude Code and agent skill by joabgonzalez/ai-agents-skills
- community
Checking that the SKILL.md file is still in the repository.
Layer-based architecture with inward dependency rule. Trigger: When separating business logic from frameworks, databases, and external services.
Install
npx vskill@latest install joabgonzalez/ai-agents-skills/clean-architectureSKILL.md
The same SKILL.md was published earlier as joabgonzalez/ai-agents-skills/clean-architecture.
Clean Architecture
Organizes code into concentric layers where dependencies point inward. Business rules stay independent of frameworks, databases, and external systems.
When to Use
- Backend projects >500 LOC with business logic
- Need to swap databases, frameworks, or external services
- Want business logic testable without spinning up infrastructure
- Building multi-layered services
Don't use for:
- Simple CRUD APIs without real business rules
- Scripts and utilities
- Prototypes
Critical Patterns
✅ REQUIRED: The Dependency Rule
Dependencies must point inward only. Inner layers know nothing about outer layers.
✅ REQUIRED: Domain Layer — Pure Business Rules
Entities contain business rules. Zero framework or DB dependencies.
✅ REQUIRED: Application Layer — Ports + Use Cases
Defines interfaces (ports) for what it needs. Orchestrates domain entities.
✅ REQUIRED: Infrastructure Layer — Port Implementations
Implements ports with concrete tech. Only layer that knows about Prisma, Stripe, etc.
❌ NEVER: Mix Layers
✅ REQUIRED: Standard Folder Structure
Decision Tree
Example
UserRegistration use case passing through all four clean architecture layers.
Dependency rule satisfied: Domain ← Application ← Infrastructure / Presentation. Domain has zero external imports.
Edge Cases
Frontend Clean Architecture: Usually overkill for React/Vue apps. State management + component composition covers most needs. Apply only if the frontend has substantial business logic.
Partial adoption: Can apply just the domain + ports/adapters without full layer separation. Start with isolating external dependencies via interfaces.
Shared domain types: DTOs and value objects can cross layer boundaries, but only flowing inward. Infrastructure maps external data to domain types.
Anemic domain models: Entities with only getters/setters and all logic in services is an anti-pattern. Business rules belong in domain entities.
Resources
- layer-examples.md — Full layer examples, folder structure, React + Node.js
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/clean-architecture/SKILL.md
Popularity
- Repository stars
- 9
- Repository npm downloads, 7 days
- 66
- 7-day trend score
- 22
Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 7 Oct 2026, a month ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/joabgonzalez/ai-agents-skills/clean-architecture)