agent-instructions
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when the code's vocabulary does not match the business's. Establishes a ubiquitous language, models domain concepts as explicit types, and identifies bounded contexts.
$ npx -y skills add nimadorostkar/Claude-Skills-collection --skill domain-modeling --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/domain-modelingContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when the code's vocabulary does not match the business's. Establishes a ubiquitous language, models domain concepts as explicit types, and identifies bounded contexts.
name: domain-modeling description: Use when the code's vocabulary does not match the business's. Establishes a ubiquitous language, models domain concepts as explicit types, and identifies bounded contexts. metadata: category: development version: 1.0.0 tags: [ddd, domain-model, ubiquitous-language, bounded-context]
Make the code speak the business's language precisely. Most long-lived complexity comes from a mismatch between the words the business uses and the structures the code has — where "user" means four different things and none of them are named.
1. **Collect the vocabulary** — Listen to how the domain experts speak. When they say "a subscription lapses", the code should have a `lapse()` and not a `status = 3`. 2. **Find the collisions** — The same word meaning two things is the highest-value finding. "Order" in fulfilment and "Order" in billing are usually different concepts. 3. **Draw the context boundaries** — Where the meaning of a word changes, a context boundary exists. Draw it explicitly and translate at the edge. 4. **Replace primitives with types** — `Money`, `EmailAddress`, `SubscriptionId`. A type that validates on construction cannot be invalid downstream. 5. **Move invariants into the model** — If a rule is currently enforced in a controller, the model permits an invalid state. Move it. 6. **Rename ruthlessly** — Code that uses a word the business does not use is code the business cannot verify.
**Primitive obsession versus a domain type:**
// Before: every caller must remember the currency and the unit.
function refund(orderId: string, amount: number, currency: string) { ... }
refund("ord_1", 19.99, "USD"); // floating point money, in an unvalidated string id
// After: the types make the mistakes impossible.
class Money {
private constructor(readonly cents: bigint, readonly currency: Currency) {}
static of(cents: bigint, currency: Currency): Money {
if (cents < 0n) throw new DomainError("Money cannot be negative");
return new Money(cents, currency);
}
plus(other: Money): Money {
if (other.currency !== this.currency) {
throw new DomainError(`Cannot add ${other.currency} to ${this.currency}`);
}
return new Money(this.cents + other.cents, this.currency);
}
}
function refund(orderId: OrderId, amount: Money): Refund { ... }Currency mismatches and negative amounts are now compile-time or construction-time errors rather than production incidents.
A curated library of 137 production-grade skills for Claude and other AI coding agents. Every skill follows one structure, speaks with one voice, and earns its place by changing what the agent does.
Repo: nimadorostkar/Claude-Skills-collection
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when an agent needs state that survives a session or a context compaction. Covers what to persist, file-based memory, structuring notes for retrieval, and…
Use when automating agent behavior with lifecycle hooks. Covers hook events, deterministic enforcement of rules the model should not be trusted to remember,…
Use when packaging skills, commands, hooks, and MCP servers into a distributable plugin. Covers manifest structure, bundling, versioning, testing, and…
Use when writing a new skill for an AI agent. Covers scoping, description writing for reliable triggering, progressive disclosure, and the difference between a…
Use when reviewing or improving an existing agent skill. Covers triggering accuracy, content quality, redundancy with the base model, and measuring whether the…