Model business domains using DDD tactical and strategic patterns
Converts business requirements into domain models using tactical and strategic DDD patterns. Triggers when you need to identify entities, aggregates, or bounded contexts from domain descriptions.
/plugin marketplace add pluginagentmarketplace/custom-plugin-software-design/plugin install custom-plugin-software-design@pluginagentmarketplace-software-designThis skill inherits all available tools. When active, it can use any tool Claude has access to.
assets/config.yamlassets/schema.jsonreferences/GUIDE.mdreferences/PATTERNS.mdscripts/validate.pyAtomic skill for domain modeling and DDD pattern application
skill_id: domain-driven-design
responsibility: Single - Domain modeling and DDD pattern guidance
atomic: true
idempotent: true
interface SkillParams {
// Required
action: 'model' | 'aggregate' | 'context_map' | 'event_storm';
domain_description: string;
// Optional
existing_models?: string;
stakeholder_terms?: string[];
complexity?: 'core' | 'supporting' | 'generic';
output_format?: 'text' | 'code' | 'diagram';
}
interface SkillResult {
domain_model?: DomainModel;
aggregates?: AggregateDefinition[];
context_map?: ContextMap;
event_storm?: EventStormResult;
ubiquitous_language?: GlossaryEntry[];
}
input_validation:
action:
required: true
enum: [model, aggregate, context_map, event_storm]
domain_description:
required: true
min_length: 50
max_length: 10000
retry_config:
max_attempts: 3
backoff:
type: exponential
initial_delay_ms: 1500
max_delay_ms: 15000
multiplier: 2
retryable_errors:
- TIMEOUT
- RATE_LIMIT
non_retryable_errors:
- INSUFFICIENT_DOMAIN_INFO
entity:
characteristics:
- Has identity
- Has lifecycle
- Can change state
example:
name: Order
identity: orderId
value_object:
characteristics:
- No identity
- Immutable
- Equality by attributes
example:
name: Money
attributes: [amount, currency]
aggregate:
characteristics:
- Consistency boundary
- Single root entity
- Transactional unit
rules:
- Reference by ID only
- Single aggregate per transaction
bounded_context:
identification:
- Linguistic boundary
- Team ownership
- Model consistency scope
context_map_patterns:
- partnership
- customer_supplier
- conformist
- anticorruption_layer
- open_host_service
// Input
{
action: "model",
domain_description: `
E-commerce order management system. Customers place orders
containing multiple products.
`
}
// Output
{
domain_model: {
entities: [
{ name: "Order", identity: "orderId" },
{ name: "Customer", identity: "customerId" }
],
value_objects: [
{ name: "Address", attributes: ["street", "city", "zip"] },
{ name: "Money", attributes: ["amount", "currency"] }
],
aggregates: [
{
name: "Order",
root_entity: "Order",
entities: ["OrderLine"],
invariants: ["Order total must equal sum of line totals"]
}
]
},
ubiquitous_language: [
{ term: "Order", definition: "A customer's request to purchase products" }
]
}
describe('DomainDrivenDesignSkill', () => {
describe('model', () => {
it('should identify entities from domain description', async () => {
const result = await skill.execute({
action: 'model',
domain_description: 'Customers place orders for products'
});
expect(result.domain_model.entities.map(e => e.name))
.toContain('Customer');
});
});
describe('aggregate', () => {
it('should define aggregate boundaries based on invariants', async () => {
const result = await skill.execute({
action: 'aggregate',
domain_description: 'Order with lines, total must match'
});
expect(result.aggregates[0].invariants).toBeDefined();
});
});
});
errors:
INSUFFICIENT_DOMAIN_INFO:
code: 400
message: "Domain description lacks sufficient detail"
recovery: "Provide more business context and rules"
AMBIGUOUS_BOUNDARIES:
code: 422
message: "Cannot determine clear aggregate boundaries"
recovery: "Clarify invariants and transactional requirements"
requires:
- nlp_analyzer
- domain_extractor
emits:
- domain_modeled
- aggregate_defined
- context_mapped
consumed_by:
- 05-domain-driven (bonded agent)
- 07-architecture-patterns (for architecture mapping)
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.