/software-design:j5ik2o-ddd-when-to-wrap-primitivesfrom software-design
Decides whether a primitive value should become a domain-specific type or value object, balancing primitive obsession against value-object obsession using risk, invariants, behavior, and cost.
Ships in software-design. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Wrap primitives when the wrapper changes correctness, not when it only signals virtue.
The value has a domain name and invariant.
Two values of the same primitive type can be confused.
Validation is repeated or easy to forget.
Behavior naturally belongs with the value.
Invalid states cause meaningful business risk.
The value has no behavior or invariant.
The wrapper would only forward primitive operations.
The type is local, temporary, or purely technical.
The team would pay high ceremony for little safety.
List candidate primitives and their risks.
Score invariant strength, misuse risk, behavior, reuse, and migration cost.
Wrap the highest-value candidates first.
Keep construction explicit and error reporting useful.
For non-trivial implementation, review, or refactoring work, read references/details.md before giving final guidance. It contains the detailed rules, examples, smells, and migration notes that do not belong in the short invocation body.
Return a wrap/keep table with rationale and example APIs for the chosen wrappers.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
ddd, value-object, primitive-obsession, domain-modeling, type-design
29 skills in this plugin
/j5ik2o-breach-encapsulation-namingUse when designing or reviewing domain-model accessors that expose internal state for persistence, serialization, tests, or framework integration. Applies the breachEncapsulationOf naming pattern so unavoidable getters are visibly treated as encapsulation breaches, not casual domain APIs. Trigger for getter naming conventions, persistence-only getters, serialization accessors, Tell Don't Ask pressure, or requests to prevent getter misuse./j5ik2o-clean-architectureUse only when the user explicitly asks for Clean Architecture design, implementation, or review. Applies a domain, use case, interface adapter, and infrastructure layer model, with persistence and RPC adapters outside the domain and use-case rules. Do not trigger for generic architecture advice, hexagonal architecture, onion architecture, or ordinary design review unless Clean Architecture is named./j5ik2o-cqrs-aggregate-modelingUse when CQRS changes aggregate boundaries or state shape. Helps reduce oversized command aggregates by moving read concerns to read models, keeping only command-decision state in aggregates, and using events for state transitions. Trigger for large aggregates, heavy command updates, aggregates containing query-only data, or boundary redesign during CQRS adoption.npx claudepluginhub j5ik2o/ai-tools --plugin software-designOther plugins' skills for the same job