clean-ddd-hexagonal
Skill60 starsChanged 2 months agoMITView on GitHub
Design or review backend domain and dependency boundaries using DDD, Clean Architecture, and ports/adapters. Use for aggregate modeling, bounded contexts, use-case isolation, or architecture refactoring; not routine CRUD changes.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- SamuelAlev/control-centertheir own version, first seen Nov 8, 2026
- karlomikus/bar-assistanttheir own version, first seen Oct 8, 2026
- cmnemoi/skillstheir own version, first seen Apr 8, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- karlomikus/bar-assistant★ 1.1ksame name
- SamuelAlev/control-center★ 8same name
- cmnemoi/skills★ 0same name
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.
In this repository10 other files it gives its agents.
- bazelSkill
- feature-slicingSkill
- mermaid-diagramsSkill
- modern-cssSkill
- modern-javascriptSkill
- postgres-drizzleSkill
- slack-block-kitSkill
- slack-mrkdwnSkill
- teams-adaptive-cardsSkill
- teams-message-formattingSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
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 8
Use these related patterns to solve a concrete domain or dependency problem.
- Distinctive: line 12
Start from the requested behavior, existing domain model, and current dependencies.
- Distinctive: line 22
If a business invariant is unknown, identify the specific missing rule and continue work that does not depend on it.
- Distinctive: line 26
Keep domain behavior independent of HTTP, persistence, and messaging implementations.
- Distinctive: line 28
Prefer transactions contained within an aggregate.
- Distinctive: line 29
Use an outbox when a committed database change and external event delivery must be reliable together.
- Distinctive: line 30
Treat CQRS, Event Sourcing, repository interfaces, and separate presentation folders as choices justified by the task.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Clean Architecture, DDD, and Hexagonal Architecture
Use these related patterns to solve a concrete domain or dependency problem. This is an opinionated synthesis, not a mandatory folder layout. The user's explicit instructions take precedence over this skill's guidelines.
Choose the scope
Start from the requested behavior, existing domain model, and current dependencies. Preserve the project's language and architecture unless changing them is part of the task. Simple CRUD can remain simple; team size, entity count, and file length do not determine whether DDD is appropriate.
| Design question | Relevant pattern |
| What language and consistency rules describe the business? | DDD, bounded contexts, aggregates |
| Which way should source dependencies point? | Clean/Onion Architecture |
| How can the application use different interfaces or infrastructure? | Hexagonal ports and adapters |
| Do reads and writes need different models? | CQRS |
| Must state be reconstructed from an event history? | Event Sourcing |
If a business invariant is unknown, identify the specific missing rule and continue work that does not depend on it. Do not invent business behavior or require a discovery workshop for a local fix.
Preserve the boundaries that matter
- Keep domain behavior independent of HTTP, persistence, and messaging implementations. Put orchestration in application use cases and external I/O in adapters.
- Model entity identity separately from value-object equality. Choose aggregate boundaries from transactional invariants and contention.
- Prefer transactions contained within an aggregate. When a requirement needs cross-aggregate atomicity, make that tradeoff explicit rather than silently replacing it with eventual consistency.
- Use an outbox when a committed database change and external event delivery must be reliable together.
- Treat CQRS, Event Sourcing, repository interfaces, and separate presentation folders as choices justified by the task. Adapt example naming and directories to the project.
Deliver the requested model, patch, or review with affected boundaries and the tradeoffs that explain them. Validate changed invariants and adapter contracts at the appropriate level; an architecture question does not require implementing every pattern.
References
Load the reference for the decision being made, not the whole collection.
| Task | Reference |
| Layer placement, dependency direction, composition root | LAYERS.md |
| Bounded contexts, ubiquitous language, context mapping | DDD-STRATEGIC.md |
| Entities, value objects, aggregates, repositories | DDD-TACTICAL.md |
| Ports, driver/driven adapters, alternative layouts | HEXAGONAL.md |
| CQRS, events, outbox, sagas, Event Sourcing | CQRS-EVENTS.md |
| Domain, integration, or architecture test design | TESTING.md |
| Compact pattern and placement lookup | CHEATSHEET.md |
Primary foundations: DDD, Hexagonal Architecture, and Clean Architecture.
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.

