Install any skill in seconds. Free to start, no credit card required.
Get Started Free →nwave-ai/nw-fp-domain-modeling
Domain modeling with algebraic data types, smart constructors, and type-level error handling
Passed 21 of 22 test cases with the skill, and 14 of 22 without it.
and 7 more in the full report
7 fixed14 passed either way1 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 7 test cases the skill fixed. Same model, same prompt, with and without the skill.
Write the function signature for an order pricing step that needs access to a price database query function `GetProductPrice` and a tax calculator function `CalculateTax`, along with the `ValidatedOrder` to price.
| Checked | Without skill | With skill |
|---|---|---|
| Dependency functions like GetProductPrice and CalculateTax appear as parameters before the primary input parameter. | Missed | Passed |
| The primary domain input parameter ValidatedOrder appears as the final parameter. | Missed | Passed |
The instructions your model reads when the skill loads.
Domain modeling with types. Make illegal states unrepresentable, workflows as pipelines, error handling at the type level.
Cross-references: fp-principles | fp-hexagonal-architecture | fp-algebra-driven-design
[STARTER]
All domain types compose from two operations:
Combined recursively, these express virtually any domain structure.
[STARTER]
Never use primitives directly in the domain model. Each domain concept gets its own wrapper type.
What: Wrap primitives so the compiler distinguishes CustomerId from OrderId. When: Every primitive with domain meaning. Why: Prevents accidental mixing (compiler rejects comparing CustomerId with OrderId). Each wrapper carries its own validation rules. The type name IS the documentation.
[STARTER]
Raw constructor is private. A create function validates input and returns a Result type, making validation failure explicit.
Pattern: UnitQuantity must be between 1 and 1000. Its create function rejects values outside that range. A companion value function provides read access to the inner primitive.
test cases passed, vs 14 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.