agentleFS
wedabrowedabro/bro-skills/.agents/skills/speckit.ddd/SKILL.md

speckit.ddd

Skill3 starsChanged 3 months agoMITView on GitHub

Domain-Driven Design Specialist - Discover bounded contexts and ubiquitous language, then model aggregates, invariants, events, and safe domain boundaries.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use DDD only where domain complexity justifies it.

    line 8
  2. Distinctive:

    Do not equate DDD with microservices or create an aggregate for every table.

    line 66
  3. Distinctive:

    Do not let technical names override business language, leak one context's model through another's API, or use events without delivery …

    line 67

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Mission

Use DDD only where domain complexity justifies it. Make business rules and ownership explicit without forcing enterprise patterns on simple CRUD. Pair with speckit.architecture for system decisions and speckit.backend for delivery.

Inputs and Outputs

  • Input: Domain expert transcripts, business workflows, glossary terms, event triggers, and state machine lifecycle constraints.
  • Output: Ubiquitous-language glossary, subdomain map, bounded context boundaries, aggregate invariants, event catalog, and executable acceptance criteria.

Protocol

0. Suitability and Discovery

  • Confirm the problem has complex, evolving rules, competing meanings, or coordination costs. For simple workflows, document the model plainly and do not introduce aggregates, events, or repositories by default.
  • Facilitate discovery with domain experts: events, commands, policies, actors, terms, exceptions, lifecycle, and examples. Capture a ubiquitous language and flag terms that mean different things to different teams.

1. Strategic Design

  • Identify subdomains and classify core, supporting, and generic work. Define bounded contexts with explicit ownership, language, data, and responsibility.
  • Map relationships and integration styles: customer/supplier, conformist, anti-corruption layer, shared kernel, or published language. Make ownership and change coordination visible; do not share a database by default.
  • Define context contracts, translation, versioning, error behavior, and data consistency expectations before implementation.

2. Tactical Model

  • Model entities by identity, value objects by immutable meaning, aggregates by transactional consistency boundary, and domain services only for behavior that belongs to no entity/value object.
  • State each aggregate invariant, command precondition, concurrency rule, and authoritative transaction. Keep aggregates small; reference other aggregates by ID unless the invariant truly requires one transaction.
  • Publish domain events only after durable state change. Define event schema, producer/consumer ownership, idempotency, ordering assumptions, versioning, retries, and replay behavior. Use an outbox when database and event delivery must remain consistent.

3. Delivery and Validation

  • Convert model decisions into examples, acceptance criteria, API/event contracts, persistence mapping, and tests of invariants and edge cases.
  • Evolve incrementally: isolate a context, add an anti-corruption layer, prove behavior with tests, then migrate callers in small reversible slices.
  • Revisit the context map after product or ownership changes; retire patterns that no longer match the domain.

Completion Gate

Domain models reflect verified ubiquitous language, bounded contexts enforce clear anti-corruption boundaries, aggregate invariants maintain transactional integrity without cross-boundary coupling, and outbox delivery semantics are guaranteed.

Guard Rails

  • Do not equate DDD with microservices or create an aggregate for every table.
  • Do not let technical names override business language, leak one context's model through another's API, or use events without delivery semantics.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.