clean-architecture
Skill17 starsChanged 4 months agoMITView on GitHub
Clean Architecture practitioner's guide. Trigger when users ask about four-layer architecture, dependency direction & inversion (DIP), an entity directly depending on external SDKs, ORM/data access layer (Repository pattern) design, microservice decomposition, technology selection, over-engineering, or architecture refactoring. Covers business logic organization in Express/Next.js/Go/Spring projects, MongoDB→PostgreSQL migrate, REST→GraphQL migrate, third-party integration (Stripe/PayPal), Redis caching, and Kafka message queue evaluation. Evaluates architecture against Robert C. Martin's Clean Architecture, SOLID principles, and the Dependency Rule; uses Musk's five-step algorithm as an anti-over-engineering gate. Do NOT trigger on: pure code quality, DDD, system design interviews, single-DTO micro-decisions, cache library selection, DI framework debugging, diagram drawing, translation, or formatting requests — answer directly without invoking this skill.
37 other projects use a version of this.
Adopted by
Most recently taken up by
- AtulPurohit/Antigravity-Awesome-Skillstheir own version, first seen Nov 29, 2026
- marcioaltoe/skillstheir own version, first seen Nov 29, 2026
- parvez3019/ai-coding-microservices-skillstheir own version, first seen Nov 22, 2026
- novatic-cu/nova-skills-coretheir own version, first seen Nov 22, 2026
- TeFuirnever/azhou-ai-hubtheir own version, first seen Nov 22, 2026
- LetermeFlorent/claude-skillstheir own version, first seen Nov 16, 2026
Used with
Projects with it also use designing-data-intensive-applications, implementing-domain-driven-design and 9 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
ciemborSkilldesigning-data-intensive-applications
Apply Martin Kleppmann-inspired data-system rules when designing reliability, scalability, consistency, replication, transactions, streams, or schema evolution.
Also in 3 projects that use this
ciemborSkillimplementing-domain-driven-design
Apply Vaughn Vernon-inspired implementation DDD rules when building aggregates, domain events, repositories, application services, or context integrations.
Also in 3 projects that use this
MovGP0Skillmodern-csharp
Modern C# style guidance for Bendex and MicroSea code changes, including primary constructors, expression-bodied members, var usage, target-typed new, lambdas, and pattern matching.
Also in 3 projects that use this
codewithmukeshSkillopentelemetry
OpenTelemetry for .NET 10: traces, metrics and logs via the OTel SDK and OTLP export, ActivitySource, IMeterFactory, Aspire Dashboard. Use for "OpenTelemetry", "OTLP", "traces", "ActivitySource", "IMeterFactory", "distributed tracing", "OTEL". Do NOT use for log messages, levels and Serilog sinks (use logging), AppHost wiring (use aspire), or retries and health checks (use resilience).
Also in 3 projects that use this
OleksandrKucherenkoSkillrelease-it
Automate versioned releases of NPM packages to GitHub repositories. Use this skill when setting up or configuring release-it for version bumping, changelog generation, npm publishing, GitHub releases, and CI/CD integration. Triggers include requests to: (1) Set up automated releases for an npm package, (2) Configure release-it for a project, (3) Create GitHub Actions workflows for releases, (4) Set up conventional commits with changelog generation, (5) Configure pre-release versioning (alpha/beta/rc), (6) Troubleshoot release-it issues.
Also in 3 projects that use this
jarrodmedranoSkilldomain-driven-design
This skill should be used whenever domain modeling is taking place. It provides specialized guidance for type-driven and data-driven design based on Rich Hickey and Scott Wlaschin's principles. The skill helps contextualize current modeling within the existing domain model, identifies inconsistencies, builds ubiquitous language, and creates visualizations (Mermaid, Graphviz/DOT, ASCII diagrams) to communicate domain concepts clearly. Use this skill when designing types, modeling business domains, refactoring domain logic, or ensuring domain consistency across a codebase.
Also in 6 projects that use this
- +1 more from ciembor
Other versions37 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 37
- wondelai/skills★ 2.8ksame name
- ciembor/agent-rules-books★ 2.8ksame name
- Mindrally/skills★ 275same name
- Resgrid/Core★ 239same name
- GabrielMartinMoran/mind★ 193same name
- G1Joshi/Agent-Skills★ 15same name
- korallis/skills-collection★ 14same name
- nledford/engineering-review-board★ 11same name
- AtulPurohit/Antigravity-Awesome-Skills★ 6same name
- kinhluan/skills★ 6same name
27 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 33 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Read-only audit requests: zero file modifications.
- Distinctive: line 48
Anti-over-engineering gate: Every "adopt complex solution" recommendation must survive Musk's five steps — Question → Delete → Simplify → …
“Common” is measured: kept by at least 6 in 10 of the 33 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Clean Architecture
Practical layering, DIP enforcement, and anti-over-engineering — grounded in Robert C. Martin's Clean Architecture, SOLID (SRP/OCP/LSP/ISP/DIP), component principles (CCP/CRP/ADP/SDP/SAP), and Musk's five-step algorithm.
Router Rules
- Description-based routing: trigger on architecture-significant scenarios — four-layer decomposition, DIP violation, Repository/Adapter boundary design, technology evaluation, over-engineering detection.
- Once triggered, follow Workflow. This is an architecture governance entrypoint, not a debugging or code-review tool.
- Hard-exclusion list (answer directly, do NOT invoke): pure code quality, DDD, system design interviews, single-DTO micro-decisions, cache library selection, DI framework debugging, diagram drawing, translation, formatting.
- Stack-agnostic: explain in canonical four-layer terms (Entities / Use Cases / Interface Adapters / Frameworks & Drivers), then map to the user's actual framework (Express/Next.js/Go/Spring). Service/Repository/Controller are implementation-pattern mappings, not primary layer names. Adopt the user's existing conventions where established.
- Read-only audit requests: zero file modifications.
Use when
- Monolithic controller/route bloat → SRP decomposition + DIP-driven refactoring into four layers
- Entity/Use Case directly importing external SDK (Stripe/PayPal) or DB driver → Dependency Rule audit
- Technology evaluation: microservices / Kafka / Redis / caching → bounded-context fitness and CCP alignment
- Storage or API migration (MongoDB→PostgreSQL, REST→GraphQL) → Repository boundary design, Ports & Adapters impact
- Multi-vendor integration → Adapter layer design, swappability via interface contracts
Do NOT use when
- Diagramming, translation, formatting, title-writing, document summarization
- Framework debugging: DI wiring failures, HTTP 500, slow SQL, index optimization
- Micro-decisions: React component splitting, single DTO addition, naming
- System design interview problems (Twitter-scale, bit.ly, Saga pattern, multi-tenancy)
- User explicitly opts out ("don't talk about architecture," "just explain")
Workflow
- Diagnose — probe before prescribe: Elicit scale, team size, concurrency, change frequency. CCP: same change reason + same change cadence → co-locate. SRP: different actors → separate. Invest boundaries only on proven variation axes (3+ historical changes at the same seam); YAGNI on unproven axes.
- Principle evaluation: Assess against the four-layer concentric model + Dependency Rule (∀ dep → inward; Entities ⊥ Use Cases ⊥ Interface Adapters ⊥ Frameworks & Drivers), SOLID (SRP/OCP/LSP/ISP/DIP), component cohesion (REP/CCP/CRP) + coupling (ADP/SDP/SAP), Musk's five-step algorithm, and engineering dialectics (unity of opposites, quantitative→qualitative change, negation of negation). See Reference Map.
- Structured answer (architecture scenario confirmed):
- Four-layer map: Entities / Use Cases / Interface Adapters / Frameworks & Drivers — each layer named with contents
- Dependency Rule: source-code dependencies point inward only — concrete direction arrows drawn
- Stack mapping: canonical layers projected onto user's actual framework + directory structure
- Code example: minimal before/after with layer labels, ≤ 50 lines
- Anti-over-engineering gate: Every "adopt complex solution" recommendation must survive Musk's five steps — Question → Delete → Simplify → Accelerate → Automate, order invariant. Monolith suffices → do NOT propose microservices. Single implementation → do NOT propose interface abstraction.
- Documentation isomorphism (as needed): Architecture decisions must persist as discoverable artifacts for downstream Agents and developers. Code change without documentation update = incomplete. Granularity matches impact radius: cross-layer refactor → L3→L2→L1 full loop; single import change → one L3 line. See Reference Map → Documentation Isomorphism.
Output Contract
- Hit: diagnosis + four-layer map + Dependency Rule explication + stack mapping + ≤50-line code example + anti-over-engineering verdict. Major architecture decisions → append L2/L3 documentation skeletons.
- Miss: answer directly; suppress this skill's template.
- Scaffold restraint: full directory scaffold (> 5 directories or named files) only on explicit request. Default: layer-level directory suggestions (≤ 5 directory names, no specific files).
Reference Map
- Theory & Principles:
references/clean-architecture.md - Anti-Over-Engineering:
references/musk-algorithm.md - Engineering Philosophy:
references/engineering-philosophy.md - Documentation Isomorphism:
references/geb-fractal-docs.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

