domain-driven-design

domain-driven-design is a skill for Claude Code from techygarg/lattice. It costs 88 tokens per session (1,554 once invoked), scanned A, original, MIT.

A set of domain-driven design rules for modeling business concepts in software. Domain-driven design is an approach that keeps code structure aligned with the business area it represents.

In plain words
What is it for?
Use it when designing or changing domain models, deciding aggregate boundaries, or reviewing business-focused code.
Why use it?
It helps avoid vague data structures and unclear boundaries between parts of the business model. It checks identities, value objects, aggregates, and bounded contexts before design approval.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the lattice plugin — 33 skills, 2 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/techygarg/lattice/domain-driven-design
Any agent
npx skills add techygarg/lattice --skill domain-driven-design
Clone the repo
git clone --depth 1 https://github.com/techygarg/lattice

Made for: Claude Code.

Or install lattice, the plugin that ships this one along with the rest of its 33 skills, 2 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for domain-driven-design

README.md
[![agentmods](https://agentmods.dev/badge/skills/techygarg/lattice/domain-driven-design.svg)](https://agentmods.dev/skills/techygarg/lattice/domain-driven-design)
Your own site
<a href="https://agentmods.dev/skills/techygarg/lattice/domain-driven-design"><img src="https://agentmods.dev/badge/skills/techygarg/lattice/domain-driven-design.svg" alt="Measured on agentmods" height="20"></a>
Per session 88 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,554 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00088 $0.01554
Opus 5 $0.00044 $0.00777
Sonnet 5 $0.00018 $0.00311
Haiku 4.5 $0.00009 $0.00155

Measured 6d ago against content hash a0d3996244fb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

domain-driven-design scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/domain-driven-design/SKILL.md · 74 lines

How it starts

The opening of the file, as written. The whole thing — 74 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Domain-Driven Design

Config Resolution

The skill supports project-custom principles. Resolution:

  1. Look for .lattice/config.yaml in the repo root.
  2. If found, check paths.ddd_principles for a custom doc path.
  3. If a custom document exists at that path, read it and check its YAML frontmatter mode:
    • mode: override: the custom doc has full precedence. Use it instead of the embedded default. It must be comprehensive -- sole reference.
    • mode: overlay (or no mode): read the embedded ./references/defaults.md first, then apply the custom doc on top. A custom section replaces the matching default section (matched by heading); new sections append after the defaults.
  4. If a custom path is configured but no document exists at it → tell the user which configured path is missing, then read ./references/defaults.md.
  5. If there is no config file or no paths.ddd_principles key → read ./references/defaults.md.
  6. Language adaptation: if paths.language_idioms is set in the config and the document exists, read its "Type System & Object Model" section and adapt entity, value object, and aggregate implementation patterns to language constructs (e.g., struct vs class, trait vs interface, data class vs record). Language idioms take precedence over pseudocode defaults.

Self-Validation Checklist

STOP after generating each component. Verify ALL checks before proceeding. If any check fails, fix before presenting. If a check is a judgment call with multiple valid approaches (see Ambiguity Signals), flag it — present options and reasoning rather than silently choosing; if framework:collaborative-judgment is loaded, use its presentation format.

  1. ENTITY VS VALUE OBJECT: For each domain object — does the business track individual instances over time? Yes → entity with identity. No → value object, immutable and self-validating.
  2. AGGREGATE BOUNDARY: Does a transactional invariant require this object inside the aggregate? If not → reference it from a separate aggregate by ID.
  3. RICH BEHAVIOR: Does the entity have methods that enforce business rules, guard state transitions, raise events? If the entity is just a data holder → move logic from services into the entity.
  4. VALUE OBJECT COVERAGE: Scan for primitives that should be value objects — string emails, number amounts, raw UUIDs as identifiers → wrap in a validating value object.
  5. AGGREGATE COHESION: List the business rules the root enforces. Does every internal entity participate in at least one invariant? If not → it belongs in its own aggregate.
  6. DOMAIN EVENTS: Should a domain event be raised — a state transition another aggregate reacts to, a change triggering notification, an audit/compliance requirement? Do not raise events for internal changes nothing reacts to.
  7. DOMAIN SERVICE: Does stateless logic spanning multiple entities belong in a domain service rather than an application service? Keep I/O and infrastructure calls out of it.
  8. FACTORY: Is complex aggregate creation encapsulated behind a factory method (Order.create(...)) or a standalone factory class? Are initial creation and reconstitution from persistence handled separately?

Read the full file on GitHub · 74 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 74 lines · 88 tokens per session scan A a0d3996244fb

Subscribe to this mod's changes

domain-driven-design is a skill published in the GitHub repository techygarg/lattice (185 stars, last pushed yesterday), licensed MIT. It adds 88 tokens to every session and 1,554 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

name-your-business

Generate, refine, compare, and when needed validate distinctive names for startups, AI products, developer tools, protocols, open-source projects, apps, product families, local businesses, services, companies, nonprofits, and other organizations. Use when asked to name or rename a business, brand, product, venture…

tamdogood/builder-essential-skills · 156 tokens

top-one-percent

Teach any topic deeply from first principles and build evidence-based paths toward exceptional capability. Use when a user asks to understand, explain, learn, or deep-dive into a topic; asks why or how something works, why it matters, how alternatives compare, or what different perspectives reveal; requests current…

tamdogood/builder-essential-skills · 111 tokens

paper-opportunity-radar

Run a cumulative daily or retrospective sweep of research papers on a chosen topic, audit their claims, methods, integrity signals, and independent support, then identify overlooked but feasible project or business opportunities in a detailed source-grounded report. Use when asked to monitor papers every day, mine…

tamdogood/builder-essential-skills · 98 tokens

repo-system-map

Analyze a software repository at the latest remote main commit and turn its implemented architecture into a citation-backed interactive isometric system map with a legend, selectable infrastructure buildings, dependency and payload flows, and plain-language learner explanations. For eligible public GitHub…

tamdogood/builder-essential-skills · 123 tokens

build-scenario-tests

Inspect an unfamiliar repository, turn a focused Markdown behavior scenario into a deterministic test in the repository's native test stack, run it, and preserve traceability between intent and code. Use when asked to add scenario tests, compile acceptance criteria or Given/When/Then Markdown into executable tests…

tamdogood/builder-essential-skills · 104 tokens

create-marketing-kit

Create truthful, human-centered marketing campaigns for an app or product, including positioning, channel copy, original artwork, editable layouts, README banners, and selective website integration. Use when asked to make launch materials, promotional artwork, social assets, campaign kits, ads, or marketing content…

tamdogood/builder-essential-skills · 106 tokens