Skip to content
Back to skills

Ddd

ASecurity

Domain-driven design guidance for C# applications. Use whenever designing, building, implementing, refactoring, or reviewing domain models — including aggregate design, bounded contexts, value objects, domain events, module structure, or any domain concept.

  • 2 stars
  • 0 votes
  • 0 copies
  • 7 views
  • Added September 19, 2026
developmentgoc#testingrefactoringapidatabase

Works with

  • api

Security analysis

A100/100

Pro scans all 12 files and shows the line behind each finding

Scanned September 19, 2026

npx -y skills add bobtat/claude-plugins --skill ddd --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ddd?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ddd
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/bobtat-ddd/badge)](https://www.skillsdirectory.com/skills/bobtat-ddd)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ddd
description: Domain-driven design guidance for C# applications. Use whenever designing, building, implementing, refactoring, or reviewing domain models — including aggregate design, bounded contexts, value objects, domain events, module structure, or any domain concept.
user-invocable: false
effort: high
---

# Domain-Driven Design Skill

You are a DDD expert. Apply DDD tactical and strategic patterns appropriate to the project's architecture. Adapt your response to what is asked — don't force every pattern into every situation.

Examples in this skill use illustrative domains (e-commerce, health tracking). Adapt naming, namespaces, and conventions to the project you're working in.

## Strategic Design

### Bounded Contexts
In a modular monolith, each module is a bounded context:
- **Each module owns its data** — no shared database tables across modules
- **Modules communicate through contracts** — shared interfaces/types live in a shared kernel or contracts project
- **Keep contracts lean** — only what other modules actually need; avoid leaking domain internals
- **Anti-corruption layers** — when integrating with external systems or other modules, translate at the boundary

### Context Mapping
When designing cross-module interactions, identify the relationship type:
- **Shared Kernel** — types in a shared contracts project
- **Customer/Supplier** — one module publishes events, another consumes
- **Conformist** — module adapts to an external model
- **Anti-Corruption Layer** — module translates external concepts to its own ubiquitous language

## Design Checklist

When reviewing or designing domain models, verify:

1. **Ubiquitous Language** — Do class/method names match domain terminology?
2. **Aggregate Boundaries** — Can this aggregate be persisted in a single transaction? Is it too large?
3. **Invariant Protection** — Are business rules enforced inside the domain, not in controllers/services?
4. **Encapsulation** — Can external code put the aggregate in an invalid state?
5. **Value Objects** — Are there primitive types that should be value objects?
6. **Event Completeness** — Does every meaningful state change raise a domain event?
7. **Module Independence** — Does this module depend only on contracts, not other modules directly?

## Reference Files

Read these from `${CLAUDE_SKILL_DIR}/references/` as needed for the task at hand:

| File | When to read |
|------|-------------|
| `aggregates.md` | Designing aggregate roots, entities, consistency boundaries, AggregateRoot base class |
| `value-objects.md` | Modeling value objects, strongly-typed IDs |
| `domain-events.md` | Domain events, cross-module event contracts |
| `domain-services.md` | Stateless domain logic spanning aggregates, when to use vs. aggregate methods |
| `application-layer.md` | Command/query handlers, CQRS, DTOs, orchestration patterns |
| `module-structure.md` | Scaffolding new modules, folder layout, service registration |
| `persistence.md` | EF Core mappings, repository patterns, DbContext setup |
| `testing.md` | Testing aggregates, value objects, domain services, invariants |
| `anti-patterns.md` | Common DDD mistakes: anemic models, god aggregates, logic leaking, over-engineering |
| `integration-mediatr.md` | When using MediatR: mapping DDD concepts to MediatR's request/notification model |
| `integration-graphql.md` | When exposing domain models via GraphQL API |

## Adapting to Your Project

- Detect the target framework, language version, and persistence layer from the project's files (`.csproj`, `CLAUDE.md`, etc.)
- Follow the project's existing naming conventions for namespaces, folders, and types
- The patterns here are framework-agnostic — adapt examples to your ORM, database, and API technology

Files in this skill

  • SKILL.md3.7 KB
  • references/aggregates.md5 KB
  • references/anti-patterns.md7.5 KB
  • references/application-layer.md6.6 KB
  • references/domain-events.md3.6 KB
  • references/domain-services.md5.6 KB
  • references/integration-graphql.md3.7 KB
  • references/integration-mediatr.md4.8 KB
  • references/module-structure.md2.9 KB
  • references/persistence.md5.9 KB
  • references/testing.md7.2 KB
  • references/value-objects.md3.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.