agentleFS
sbrudzsbrudz/agent-skills/skills/domain-driven-design/SKILL.md

domain-driven-design

Skill2 starsChanged 9 months agoMITView on GitHub

Use when planning features that involve business logic or domain modeling, and during code review to check naming consistency and module boundary violations — applies strategic DDD patterns

25 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use hexagonal-architecture, clean-architecture and 2 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • ffsshhttiikkSkill

    hexagonal-architecture

    Hexagonal architecture patterns and implementation

    Also in 4 projects that use this

  • harrissohail6Skill

    clean-architecture

    Clean architecture and SOLID principles. Auto-activates when designing systems or refactoring code structure.

    Also in 4 projects that use this

  • xenitV1Skill

    clean-code

    Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments

    Also in 4 projects that use this

  • SentrySkill

    review

    Fixture review skill.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 23 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before technical questions, establish the language the code will use.

    line 16
  2. Distinctive:

    Do these names already exist in the codebase?: Use them. Don't introduce synonyms ("order" in one module, "purchase" in another).

    line 19
  3. Very specific:

    Existing codebases: Don't define the whole language upfront.

    line 23
  4. Distinctive:

    Context mapping: When a feature spans contexts, name the relationship.

    line 37
  5. Distinctive:

    Do new names follow the established ubiquitous language?

    line 44
  6. Very specific:

    Do functions describe domain operations?

    line 46

“Common” is measured: kept by at least 6 in 10 of the 23 edited versions of this file we could read. “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

Domain-Driven Design — Name Things Right, Draw Boundaries Well

Strategic DDD patterns for planning and code review. Focuses on ubiquitous language (naming), bounded contexts (boundaries), and context mapping (how modules relate).

Scope Gate

Does this feature involve business logic or domain concepts? If purely UI, infrastructure, or DevOps with no domain modeling → skip.

During Planning: Ubiquitous Language

Before technical questions, establish the language the code will use.

  • What are the key domain concepts? Name them. One name per concept everywhere — code, UI, docs.
  • Do these names already exist in the codebase? Use them. Don't introduce synonyms ("order" in one module, "purchase" in another).
  • Would a domain expert recognize these names? fulfillOrder over processOrderData. If you have to explain what a "Handler" does, the name is technical, not domain-driven.
  • Does the same term mean different things in different parts of the system? That's a bounded context boundary signal.

Existing codebases: Don't define the whole language upfront. Survey names in the modules you're touching, pick the best existing name for each concept, use it consistently in new code. Don't rename outside touched code — same guardrail as boy-scout-rule.

During Planning: Bounded Contexts

Signals of separate contexts:

  • Same word, different meaning. "Account" in billing (balance) vs. identity (permissions) — two models sharing a name.
  • Different rates of change. Pricing changes weekly; user profiles change yearly. Coupling them means one breaks the other.
  • Different ownership. Different teams making independent decisions about different parts.

Identify during planning:

  • What contexts does this feature touch? Most features live in one context and talk to others.
  • What crosses the boundary? Data crossing a context boundary should be translated at the boundary, not passed as internal types. Don't import another module's domain types directly — define what your context needs and map at the edge.
  • Which context owns this concept? If "Order" exists in both Fulfillment and Billing, each has its own Order model with only the fields it needs.

Context mapping: When a feature spans contexts, name the relationship. Which is upstream (provides data), which is downstream (consumes)? Does one conform to the other's model, or translate at the boundary?

ADR interaction: Bounded context boundaries are decisions architecture-decision-records should capture — they affect multiple components and are hard to reverse.

During Code Review

Naming checklist:

  • Do new names follow the established ubiquitous language?
  • Are there generic names hiding domain meaning? Manager, Handler, Processor, Service, Data, Info — the real domain concept probably hasn't been named yet.
  • Do functions describe domain operations? approveClaim over updateClaimStatus.

Boundary checklist:

  • Does new code reach across module boundaries to access internals?
  • Are domain types shared across contexts? Each context should own its representation.
  • Is translation happening at boundaries? Data crossing contexts should be mapped, not passed through as the sender's types.

Related Skills

During planning:

  • architecture-decision-records — bounded context boundaries warrant ADRs
  • ux-design-principles — ubiquitous language should flow through to UI labels

During implementation:

  • functional-core-imperative-shell — the functional core IS the domain model. DDD structures what goes in the core; FCIS keeps it pure

During refactoring:

  • boy-scout-rule — "rename for clarity" becomes "rename to match ubiquitous language"

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.