What problem does it solve?
Software often struggles with complexity, inconsistent terminology, and invalid states, leading to bugs and difficult maintenance. This skill provides a structured approach to domain modeling, leveraging principles from Rich Hickey and Scott Wlaschin, to ensure your software accurately reflects the business domain, prevents illegal states, and fosters a clear, ubiquitous language.
Core Features & Use Cases
- Ubiquitous Language Development: Guides you in establishing consistent terminology across code, documentation, and business conversations, reducing ambiguity.
- Type-Driven Design: Helps you model data and workflows using types that make illegal states unrepresentable, catching errors at compile time.
- Architectural Patterns: Provides guidance on entities, value objects, aggregates, bounded contexts, and functional core/imperative shell architecture.
- Visualization Tools: Generates Mermaid, Graphviz/DOT, or ASCII diagrams to clearly communicate complex domain structures and workflows.
- Use Case: You're designing an e-commerce order system. Use this skill to define
Order as an aggregate root, model its PaymentStatus using a sum type to prevent invalid states, and visualize the order lifecycle with a Mermaid state diagram, ensuring a robust and clear design.
Quick Start
Help me define the core entities and value objects for a simple banking domain, focusing on Account and Money.