domain-driven-design/SKILL.md
Enforces Domain-Driven Design strategic and tactical patterns including Bounded Contexts, Aggregates, Value Objects, Domain Events, and Context Mapping. Use when modeling a business domain, defining bounded context boundaries, designing aggregates, applying ubiquitous language, running Event Storming workshops, implementing CQRS or Event Sourcing, or reviewing domain models for DDD anti-patterns like Anemic Domain Models.
npx skillsauth add kayaman/skills domain-driven-designInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Reference: Domain-Driven Design (Evans), Implementing DDD (Vernon), Learning DDD (Khononov)
MUST NOT apply full DDD tactical patterns to simple CRUD applications — the overhead is not justified.
A bounded context is the boundary within which a domain model is consistent and a ubiquitous language applies.
Define relationships between bounded contexts using these patterns:
| Pattern | Relationship | Use When | |---------|-------------|----------| | Partnership | Mutual dependency, coordinated development | Two teams succeed or fail together | | Shared Kernel | Small shared model subset, joint ownership | Limited overlap that both contexts need identically | | Customer-Supplier | Upstream serves downstream; downstream can negotiate | Teams have a clear provider/consumer relationship | | Conformist | Downstream conforms to upstream's model without negotiation | Upstream has no incentive to accommodate downstream | | Anti-Corruption Layer | Translation layer protecting downstream from upstream's model | Integrating with legacy systems or external services | | Open Host Service | Well-defined public API serving multiple consumers | Upstream provides a stable protocol for any consumer | | Published Language | Shared exchange format (JSON schema, Protobuf, Avro) | Multiple contexts exchange data using a documented format | | Separate Ways | No integration — contexts are independent | Integration cost exceeds value |
| Type | Description | Investment Strategy | |------|-------------|-------------------| | Core Domain | Competitive differentiator — what makes the business unique | Invest heavily; use best engineers; full DDD | | Supporting Subdomain | Necessary but not differentiating; custom but simpler | Moderate investment; simpler models | | Generic Subdomain | Commodity functionality (auth, email, payments) | Buy or use off-the-shelf; do not build |
order.cancel() not order.setStatus("cancelled")Money.add(other), EmailAddress.validate()An aggregate is a cluster of objects treated as a single unit for data changes, defining a consistency boundary.
Vaughn Vernon's aggregate design rules:
save(), findById(), remove()OrderPlaced, PaymentReceived, InventoryReservedA collaborative workshop technique (Brandolini) for discovering domain events, commands, and bounded context boundaries.
| Level | Purpose | Output | |-------|---------|--------| | Big Picture | Explore the entire business domain | Domain events timeline, hot spots, bounded context boundaries | | Process Modeling | Detail a specific business process | Commands, actors, policies, read models, external systems | | Software Design | Translate process into architecture | Aggregates, bounded contexts, event flows |
| Color | Element | Example | |-------|---------|---------| | Orange | Domain Event (past tense) | "Order Placed" | | Blue | Command (imperative) | "Place Order" | | Yellow | Aggregate | "Order" | | Lilac | Policy / Automation | "When payment received, ship order" | | Pink | Hot Spot / Question | "What if payment fails?" | | Green | Read Model / View | "Order Summary" | | Large Pink | External System | "Payment Gateway" |
Separate read and write models. Apply selectively — Greg Young: "CQRS is a supporting pattern, not a top-level architecture."
Store state changes as an immutable, append-only sequence of events. Current state is derived by replaying events.
| Anti-Pattern | Signal | Remedy | |-------------|--------|--------| | Anemic Domain Model | Objects are data bags; all logic in service classes | Move behavior into entities and value objects | | Oversized Aggregates | Large object graphs; frequent concurrency conflicts | Split into smaller aggregates; use domain events for cross-aggregate coordination | | Ignoring Ubiquitous Language | Developers use different terms than domain experts | Establish a glossary; rename code to match domain terms | | DDD on CRUD | Full tactical patterns on simple data entry screens | Use DDD strategically (bounded contexts) but skip tactical patterns for simple operations | | Shared Database | Multiple contexts read/write the same tables | Give each context its own storage; synchronize via events | | Leaking Context | One context's model concepts appear in another | Introduce Anti-Corruption Layer or Published Language |
Before finalizing a domain model, verify:
| Book | Author(s) | Publisher | Year | |------|-----------|-----------|------| | Domain-Driven Design: Tackling Complexity in the Heart of Software | Eric Evans | Addison-Wesley | 2003 | | Implementing Domain-Driven Design | Vaughn Vernon | Addison-Wesley | 2013 | | Domain-Driven Design Distilled | Vaughn Vernon | Addison-Wesley | 2016 | | Learning Domain-Driven Design | Vlad Khononov | O'Reilly | 2021 | | Domain Modeling Made Functional | Scott Wlaschin | Pragmatic Bookshelf | 2018 | | Patterns, Principles, and Practices of Domain-Driven Design | Millett & Tune | Wrox | 2015 | | Balancing Coupling in Software Design | Vlad Khononov | Addison-Wesley | 2024 | | Architecture for Flow | Andrew Harmel-Law | O'Reilly | 2023 | | Introducing EventStorming | Alberto Brandolini | Leanpub | ~2024 |
tools
Guidance for designing charts, graphs, plots, dashboards, and data visualizations that communicate clearly and persuade. Use when creating or reviewing a visualization, choosing a chart type, picking a color palette, decluttering a busy graphic, fixing misleading axes or proportions, building a dashboard, annotating a figure, or turning data into a presentation, report, or data-driven story. Grounded in the standard data-visualization literature (Knaflic, Tufte, Cleveland & McGill, Cairo, Wilke, Munzner, Few, Berinato). Covers chart selection, graphical perception and encoding, color and accessibility, decluttering, graphical integrity, dashboards, and narrative. Does NOT cover building data pipelines or ETL, statistical modeling or analysis methods, BI tool/vendor selection, or general UI/UX layout (see ux-design-principles). Tool-agnostic, with optional Python recipes.
development
Architect and implement production-grade microservices systems in TypeScript (NestJS) and Python (FastAPI), including resilience, observability, testing, deployment, and migration guidance.
development
--- name: databricks-genie-spaces-best-practices description: Design, configure, curate, govern, monitor, and integrate Databricks AI/BI Genie Spaces — the natural-language-to-SQL surface over Unity Catalog. Covers space scoping, general instructions, parameterized example SQL, SQL functions, trusted assets, JOIN configuration, knowledge store, certified queries, benchmarks, monitoring tab, feedback loops, the Genie Conversation API, governance via Unity Catalog (row filters, column masks, embed
tools
Implement OTP and passwordless authentication on AWS for TypeScript projects using Cognito CUSTOM_AUTH triggers (default) or a custom DynamoDB-backed flow, with SES (email) and SNS (SMS) delivery. Use when the user mentions OTP, one-time password, passwordless login, magic link, Cognito custom auth, DefineAuthChallenge, CreateAuthChallenge, VerifyAuthChallengeResponse, SES verification email, SNS SMS code, or MFA over email/SMS. Covers architecture decision (Cognito vs custom), Lambda trigger handlers, SES/SNS notifiers, DynamoDB schema with TTL, rate limiting, constant-time comparison, threat model (enumeration, replay, brute force), and aws-sdk-client-mock testing.