architecture-ddd
Architecture DDD
Overview
Use this skill to model complex domains so teams can evolve behavior without constant cross-team coupling.
Scope Boundaries
- Domain language differs across teams or subsystems.
- Invariants are hard to maintain because boundaries are unclear.
- A single model is causing conflicting meanings and high coordination cost.
Core Judgments
- Bounded context cuts: where language and invariants legitimately diverge.
- Aggregate boundaries: where consistency must be immediate versus eventual.
- Context integration style: ACL, conformist, published language, or shared kernel.
- Ownership model: which team can change which part without global coordination.
Practitioner Heuristics
- Bound contexts by change patterns and invariants, not by database tables.
- Aggregates should protect invariants with minimal transactional scope.
- Cross-context communication should exchange explicit contracts, not internal models.
- In dynamic languages, model entities/value objects with explicit typed schemas instead of broad maps that require repetitive casting.
Workflow
- Build ubiquitous language per domain area and identify conflicting terms.
- Partition bounded contexts by invariants, autonomy, and change cadence.
- Design aggregates with clear consistency and lifecycle rules.
- Define context map and integration contracts between contexts.
- Identify anti-corruption needs and translation responsibilities.
- Document residual ambiguity and model evolution triggers.
Common Failure Modes
- "DDD" applied as folder naming without boundary behavior changes.
- Aggregates oversized, causing lock contention and slow writes.
- Shared database schema used as de facto integration API.
Failure Conditions
- Stop when bounded contexts cannot be separated by language/invariant boundaries.
- Stop when aggregate consistency needs conflict with transaction feasibility.
- Escalate when cross-context contracts remain uncontrolled.
More from kentoshimizu/sw-agent-skills
graph-algorithms
Graph algorithm workflow for modeling entities/relations and selecting traversal, path, ordering, or flow strategies. Use when correctness or performance depends on graph representation and algorithm choice; do not use for schema-only modeling or deployment topology planning.
14bash-style-guide
Style, review, and refactoring standards for Bash shell scripting. Trigger when `.sh` files, files with `#!/usr/bin/env bash` or `#!/bin/bash`, or CI workflow blocks with `shell: bash` are created, modified, or reviewed and Bash-specific quality controls (quoting safety, error handling, portability, readability) must be enforced. Do not use for generic POSIX `sh`, PowerShell, or language-specific application style rules. In multi-language pull requests, run together with other applicable `*-style-guide` skills.
11architecture-clean-architecture
Clean Architecture workflow for enforcing dependency direction, stable domain boundaries, and use-case-centered application design. Use when teams must separate business rules from frameworks and delivery mechanisms; do not use for isolated module cleanup without boundary implications.
11powershell-style-guide
Style, review, and refactoring standards for PowerShell scripting. Trigger when `.ps1`, `.psm1`, `.psd1` files, or CI workflow blocks with `shell: pwsh` or `shell: powershell` are created, modified, or reviewed and PowerShell-specific quality controls (error handling, parameter validation, readability, operational safety) must be enforced. Do not use for Bash, generic POSIX `sh`, or language-specific application style rules. In multi-language pull requests, run together with other applicable `*-style-guide` skills.
10github-codeowners-management
Govern CODEOWNERS rules so review routing reflects real ownership and risk boundaries on GitHub. Use when repository ownership mapping or mandatory reviewer rules must be defined, updated, or audited; do not use for non-GitHub runtime architecture or data-layer design.
9security-authentication
Security workflow for authentication architecture, credential lifecycle, and session/token assurance. Use when login, identity proofing, MFA, or session security decisions are required; do not use for authorization policy design or non-security quality tuning.
9