# dotnet-domain-modeling

Guides pure C# Domain-Driven Design modeling with entities, aggregate roots, value objects, and domain events, keeping business logic isolated from ORM concerns.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 535 installs · ★ 86
- Author: wshaddix
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/wshaddix/dotnet-skills/tree/HEAD/skills/dotnet-domain-modeling/SKILL.md
- Updated: 2026-02-27
- HTML: https://affpapa.org/en/nevibecode/skills/dotnet-domain-modeling

## What it does

The skill guides tactical Domain-Driven Design modeling in C#. It keeps the domain model isolated. Instructions structure strongly typed entity identifiers, aggregate roots collecting events, and immutable value objects implemented via records.

All state changes pass through aggregate roots. Internal collections hide behind `IReadOnlyList` instances, while external aggregates connect solely through IDs. This avoids bloated boundaries and unexpected database locks.

Database mappings and API validation remain out of scope. Persistence details and messaging infrastructure belong to dedicated companion skills from the same author.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add wshaddix/dotnet-skills --skill dotnet-domain-modeling -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/dotnet-domain-modeling/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/dotnet-domain-modeling/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add wshaddix/dotnet-skills --skill dotnet-domain-modeling -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/dotnet-domain-modeling/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add wshaddix/dotnet-skills --skill dotnet-domain-modeling -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/dotnet-domain-modeling/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install wshaddix/dotnet-skills dotnet-domain-modeling
```

2. **Manually: put the files in place**
- File: `.github/skills/dotnet-domain-modeling/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add wshaddix/dotnet-skills --skill dotnet-domain-modeling -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/wshaddix/dotnet-skills --path skills/dotnet-domain-modeling
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/dotnet-domain-modeling/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add wshaddix/dotnet-skills --skill dotnet-domain-modeling -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/wshaddix/dotnet-skills/tree/HEAD/skills/dotnet-domain-modeling/SKILL.md

## When to use it
- structure aggregate roots with encapsulated `IReadOnlyList` collections
- build immutable value objects using C# records with self-validating constructors
- register domain events inside aggregate lifecycles
- convert anemic C# models into rich domain entities

## Example prompts
- Design an Order aggregate root with OrderLine items and an OrderSubmitted domain event
- Create CustomerId and Money value objects using C# records with constructor validation
- Implement an Entity<TId> base class with equality operators and ORM constructor support

## Similar
- [mcp-builder](https://affpapa.org/en/nevibecode/skills/mcp-builder.md) — skill · 130949 installs
- [claude-api](https://affpapa.org/en/nevibecode/skills/claude-api.md) — skill · 74198 installs
- [lark-im](https://affpapa.org/en/nevibecode/skills/lark-im.md) — skill · 472900 installs
- [lark-event](https://affpapa.org/en/nevibecode/skills/lark-event.md) — skill · 466800 installs
- [caveman-discover](https://affpapa.org/en/nevibecode/skills/caveman-discover.md) — skill · 104400 installs
- [migration](https://affpapa.org/en/nevibecode/skills/migration.md) — skill · 103900 installs

From the same set: [wshaddix/dotnet-skills](https://affpapa.org/en/nevibecode/by/wshaddix/dotnet-skills.md) — 13 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
