MCPInstall

ddd-architecture-selector

Architecture selection decision guide — help users choose from 5 DDD architectures (Layered/Onion/Hexagonal/Clean/COLA) with decision matrix, team size mapping, domain classification (core/generic/supporting), microservice splitting recommendation, and CQRS level suggestion. Use when user asks about architecture selection, 架构选型, COLA vs 六边形, cleaner architecture vs onion, 微服务拆分, or which architecture to use.

Installs
136
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/full-stack-skills/ddd-skills --skill ddd-architecture-selector
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads ddd-architecture-selector automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

DDD Architecture Selector

Architecture selection decision guide that evaluates 5 DDD architecture patterns (Layered, Onion, Hexagonal, Clean, COLA) against project context — team size, business complexity, tech stack, infrastructure change frequency, and ecosystem preference.

Workflow

Step 1: Collect Project Context

  • Team size & DDD experience level
  • Business complexity (simple CRUD / moderate / high)
  • Technical stack (Spring Boot / Go / Node.js / .NET / Python)
  • Infrastructure change frequency (low / medium / high)
  • Multi-entry needs (REST + CLI + MQ + gRPC?)
  • Test coverage requirements (unit / integration / E2E)
  • Ecosystem preference (Chinese community / international)

Step 2: Run Decision Matrix

  • Compare 5 architectures across 7+ dimensions

Step 3: Apply Decision Tree

  • Complexity → Team Size → Tech Stack → Recommended Architecture

Step 4: Recommend CQRS Level

  • L0: None, L1: Model Separation, L2: DB Separation, L3: Event Sourcing

Step 5: Classify Domain Types

  • Core / Generic / Supporting → Apply different architectures per domain

Step 6: Suggest Microservice Splitting

  • One BC → One Service, with merge/split rules

Step 7: Route to Specific Architecture Skill

  • Link to detailed implementation guidance

When to Use (and When NOT to)

✅ Use When❌ Skip When
Starting a new project: need architecture decisionArchitecture already decided → go directly to that skill
Comparing multiple DDD architecturesJust need DDD learning → use ddd-architecture-awesome
Team unsure which approach fits bestNeed architecture evaluation of existing project → use ddd-architecture-evaluator
Planning microservice splitting strategyNeed domain modeling after selection → use ddd-domain-designer
Evaluating CQRS necessityNon-DDD project evaluation (consider standard MVC)
Chinese enterprise team making tech decisionsSimple CRUD with no DDD needed → use standard MVC
Team size / DDD maturity unknownNeed code review of existing DDD code → use ddd-code-reviewer

Boundary

CategoryDescriptionAlternative
✅ HandlesNew project architecture selection (5 DDD architectures)—
✅ HandlesArchitecture comparison for migration decisions—
✅ HandlesCQRS / Event Sourcing necessity assessment—
✅ HandlesDomain classification (Core / Generic / Supporting)—
✅ HandlesMicroservice splitting based on bounded contexts—
✅ HandlesTeam size → architecture mapping—
⚠️ RequiresBasic project context: team size, business complexity, tech stack—
⚠️ RequiresDomain expert or product owner involvement for classification—
❌ Out of ScopeArchitecture already decided — do not use this skillddd-architecture-layered / ddd-architecture-onion / ddd-architecture-hexagonal / ddd-architecture-clean / ddd-architecture-cola (Install each with: npx skills add full-stack-skills/ddd-skills --skill <name>)
❌ Out of ScopeJust need DDD learning & concepts — should not use this skillddd-architecture-awesome (Install: npx skills add full-stack-skills/ddd-skills --skill ddd-architecture-awesome)
❌ Out of ScopeEvaluate existing architecture health & quality — do not useddd-architecture-evaluator (Install: npx skills add full-stack-skills/ddd-skills --skill ddd-architecture-evaluator)
❌ Out of ScopeDomain modeling / aggregate design after selection — not useddd-domain-designer (Install: npx skills add full-stack-skills/ddd-skills --skill ddd-domain-designer)
❌ Out of ScopeCode review for DDD compliance — do not use this skillddd-code-reviewer (Install: npx skills add full-stack-skills/ddd-skills --skill ddd-code-reviewer)
❌ Out of ScopeNon-DDD / standard MVC projects — not use this skillUse standard MVC guides (not DDD skills)

Audience

This skill is designed for: Backend developers (implementing DDD architectures), Software architects (evaluating and selecting patterns), Tech leads (reviewing team implementations), and DDD beginners (learning domain-driven design fundamentals).

Rules

  1. Architecture selection must evaluate at least 5 dimensions.
  2. Never recommend Event Sourcing as default — only after L2 CQRS success.
  3. Team size and domain complexity must be the primary selection factors.

5-Architecture Decision Matrix

DimensionLayeredOnionHexagonalCleanCOLA
Learning Cost★☆☆★★★★★★★★★★★☆
Business Complexity Fit★☆☆★★★★★★★★★★★★
CRUD Efficiency★★★★☆☆★☆☆★☆☆★★☆
Infrastructure Replaceability★☆☆★★★★★★★★★★★☆
Test Friendliness★☆☆★★★★★★★★★★★★
Chinese Community★★★★☆☆★☆☆★☆☆★★★
Code Generation SupportGoodPoorPoorPoorExcellent
Module Physical IsolationLowMediumMediumHighHigh
Evolution Path Clarity★☆☆★★★★★★★★★★★★
Team Size Fit1-55-155-1515-505-50
OriginMartin FowlerJeffrey Palermo (2008)Alistair Cockburn (2005)Robert C. Martin (2012)Alibaba (2018)
ArchitectureBest ForAvoid When
LayeredSimple CRUD, small teams, traditional MVC migrationComplex business rules, frequent infra changes
OnionHigh test coverage, changing infrastructureCRUD-heavy apps, teams with no abstraction experience
HexagonalMulti-entry systems, microservice standardizationSimple single-entry CRUD, quick prototypes
CleanLarge enterprise systems, strict physical isolationSmall teams (<5), rapid MVP iterations
COLAChinese Spring Boot ecosystem, engineering standardsNon-Java stacks, international teams

3-Step Decision Tree

Step 1: Assess Business Complexity

Business Complexity?
│
├── Simple CRUD (80%+ CRUD operations)
│   └── Planning DDD adoption in future?
│       ├── No  → LAYERED ARCHITECTURE
│       └── Yes → COLA Simplified (single module)
│
├── Moderate (core business logic with rules)
│   ├── Chinese ecosystem / Spring Boot + MyBatis?   → COLA
│   ├── Value domain layer purity most?               → HEXAGONAL
│   ├── Multi-entry system (REST + CLI + MQ)?         → HEXAGONAL
│   ├── Infrastructure changes often?                 → HEXAGONAL / ONION
│   └── .NET / Python stack?                          → ONION
│
└── High (multiple BCs, microservices)
    ├── Enterprise / international team?              → CLEAN ARCHITECTURE
    ├── Chinese enterprise, per-service standards?     → COLA (multi-module)
    ├── Mixed tech stack per service?                 → HEXAGONAL per service
    └── Need microservice + standard per module?      → COLA + HEXAGONAL hybrid

Step 2: Match Team Size

Team SizeRecommended ArchitectureRationale
1-5Layered or COLA simplifiedLowest ceremony, fastest delivery
5-15Hexagonal / Onion / COLA (single module)Balance abstraction and productivity
15-50Clean / COLA (multi-module)Physical isolation, parallel team work
50+Microservices + Hexagonal per serviceAutonomous teams, independent deploy

Evolution Path: Team grows → upgrade architecture progressively: 1-5 (Layered) → 5-15 (Hexagonal) → 15-50 (Clean/COLA) → 50+ (Microservices+Hex).

Step 3: Final Recommendation

If you have...Then choose...Why
Spring Boot + MyBatis + Chinese teamCOLAEcosystem match, Chinese docs, scaffolding
Multi-entry (REST + CLI + MQ + gRPC)HexagonalAdapter pattern handles multiple entry points
Strict module physical isolation, large enterpriseCleanEntity → UseCase → Adapter enforced isolation
Infrastructure changes often (DB, MQ swap)Hexagonal or OnionPort/Adapter makes swapping trivial
Rapid prototype → evolve DDD laterLayered → upgradeLowest startup cost, clear evolution path
Complex business rules + TDDHexagonalDomain layer independently testable
Team new to DDD, incremental adoptionLayeredClosest to traditional 3-tier, gentlest learning curve
Microservice internal architecture standardHexagonal + COLA per servicePort isolation + engineering standards
Read-heavy, complex queriesCQRS L2Read/write separation, independent optimization
Full audit trail neededEvent Sourcing (L3)Event stream naturally supports audit

Domain Partitioning + Microservice Splitting

Domain Classification (Core / Generic / Supporting)

Domain TypeInvestment StrategyArchitecture RecommendationExamples
Core Domain (核心域)Max investment, build in-houseHexagonal / Clean / COLA with rich domain modelOrder management, Payment processing, Pricing engine
Generic Domain (通用域)Purchase or open-source reuseLayered or off-the-shelf SaaSAuthentication, Authorization, Notification
Supporting Domain (支撑域)Outsource or low priorityLayered or simple CRUDReports, Admin dashboard, Data export

Key rule: Don't apply Hexagonal or Clean to generic/supporting domains — it wastes effort. Reserve complex architectures for Core domains only.

Microservice Splitting Rules

  1. Default: One Bounded Context → One Microservice
  2. Split when: Different deployment cadence, different scaling needs, different team ownership
  3. Merge when: Strong transactional consistency needed, small context (< 2 weeks dev), same team
  4. Start conservative: Fewer services, split as needed (proven by need, not anticipation)
  5. Communication: Events for eventual consistency, RPC for strong consistency (rare)

CQRS Level Suggestion

LevelDescriptionCostArchitecture SupportWhen to Use
L0 — NoneSingle model, single DBZeroAll architectures (default)Simple CRUD, no read/write conflict
L1 — Model SeparationCommandService + QueryService, shared DBLowAll architecturesModerate read/write disparity
L2 — DB SeparationCommand DB + Read DB (ES/slave), sync via eventsMediumHexagonal / Clean / COLAHigh read volume, complex queries
L3 — Event SourcingEvent Store + Projections, full event replayHighHexagonal / CleanAudit trail, temporal queries, compliance

Recommendation: Start at L0, prove need for higher levels. L2+ should only be adopted alongside Hexagonal or Clean architectures for proper port isolation.

Architecture Skill Navigation

SelectedNext Skill
Layeredddd-architecture-layered (Install: npx skills add full-stack-skills/ddd-skills --skill ddd-architecture-layered)
Onionddd-architecture-onion (Install: npx skills add full-stack-skills/ddd-skills --skill ddd-architecture-onion)
Hexagonalddd-architecture-hexagonal (Install: npx skills add full-stack-skills/ddd-skills --skill ddd-architecture-hexagonal)
Cleanddd-architecture-clean (Install: npx skills add full-stack-skills/ddd-skills --skill ddd-architecture-clean)
COLAddd-architecture-cola (Install: npx skills add full-stack-skills/ddd-skills --skill ddd-architecture-cola)

Related: ddd-cqrs-architecture / ddd-domain-designer / ddd-architecture-evaluator (each installable via npx skills add full-stack-skills/ddd-skills --skill <name>)

Gotchas

See references/gotchas.md for 15 pitfalls.

FAQ

See references/faq.md for 15 Q&A.

Security & Safety

This skill is pure documentation. It does not collect user data, does not access external services or networks, and contains no executable scripts.

References

See references/ for deep comparisons, microservice/domain, clean+DDD+hexagonal, ddd4j analysis, gotchas, FAQ, external resources, and 5 case studies.

FAQ

What does the ddd-architecture-selector skill do?

Architecture selection decision guide — help users choose from 5 DDD architectures (Layered/Onion/Hexagonal/Clean/COLA) with decision matrix, team size mapping, domain classification (core/generic/supporting), microservice splitting recommendation, and CQRS level suggestion. Use when user asks about architecture selection, 架构选型, COLA vs 六边形, cleaner architecture vs onion, 微服务拆分, or which architecture to use.

How do I install ddd-architecture-selector?

Run npx skills add https://github.com/full-stack-skills/ddd-skills --skill ddd-architecture-selector in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/ddd-architecture-selector/ (personal) or .claude/skills/ddd-architecture-selector/ (project).

Which AI agents can use ddd-architecture-selector?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is ddd-architecture-selector safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains ddd-architecture-selector?

It is published by full-stack-skills in full-stack-skills/ddd-skills. It has 136 recorded installs.

More from full-stack-skills/ddd-skills

View all →

ddd-code-reviewer

full-stack-skills/ddd-skills

DDD code review and anti-pattern detection — anemia model detection, layered compliance checking, aggregate design review, rich model verification, scoring system (5 dimensions), and ArchUnit automated validation. Use when user asks about code review, 代码审查, DDD review, 架构审查, anti-pattern detection, 反模式检测, or needs to check if code follows DDD.

ddd-api-designer

full-stack-skills/ddd-skills

API design from domain model — CQRS command/query separation, REST API endpoint design, data object conversion chain (PO→DO→DTO→VO), unified response format, OpenAPI/Swagger generation, BFF pattern, API versioning, and security design. Use when user asks about API design, REST API, OpenAPI, BFF, DTO design, 接口设计, or data object conversion.

Backend & APIs139 installs

ddd-architecture-doc

full-stack-skills/ddd-skills

DDD architecture documentation generation — C4 model diagrams (Context/Container/Component/Code), ADR (Architecture Decision Records), domain model documentation, API documentation, architecture decision log, and team communication templates. Use when user asks about architecture documentation, 架构文档, ADR, C4 diagram, domain model doc, 架构决策记录, or needs to document DDD architecture for team.

ddd-domain-designer

full-stack-skills/ddd-skills

Open the skill to read its SKILL.md instructions.

Frontend & Design133 installs

ddd-devops-integration

full-stack-skills/ddd-skills

DDD DevOps integration — CI/CD pipeline with ArchUnit automated architecture validation, multi-module build optimization for DDD projects, containerized deployment with Docker/K8s for layered/hexagonal/clean architectures, database migration strategies for domain events, and monitoring domain health. Use when user asks about DevOps, CI/CD, DDD deployment, ArchUnit CI, or needs to automate DDD project builds.

DevOps & Cloud131 installs

ddd-architecture-hexagonal

full-stack-skills/ddd-skills

Comprehensive guidance for Hexagonal Architecture (Ports & Adapters) — Alistair Cockburn's hexagonal architecture with domain core, port definitions, adapter implementations, and full Java/Spring Boot implementation steps. Covers primary/driving adapters, secondary/driven adapters, use case ports, repository ports, and dependency injection configuration. Use when user asks about hexagonal architecture, 六边形架构, ports and adapters, 端口适配器, Alistair Cockburn, or needs DDD with clean separation.

Popular code quality & workflow skills

View category →

grill-me

mattpocock/skills

A relentless interview to sharpen a plan or design.

Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.

handoff

mattpocock/skills

Compact the current conversation into a handoff document for another agent to pick up.

domain-modeling

mattpocock/skills

Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.

codebase-design

mattpocock/skills

Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.

diagnosing-bugs

mattpocock/skills

Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.