/tsal:domain-driven-designfrom tsal
Guides domain modeling using type-driven and data-oriented design principles. Builds ubiquitous language, identifies inconsistencies, and creates visualizations for domain logic.
Ships in tsal. 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.
This skill provides guidance for domain modeling based on Rich Hickey's data-oriented design principles and Scott Wlaschin's type-driven design approach. Focus on building systems that make illegal states unrepresentable, prioritize data and transformations over objects and methods, and establish a ubiquitous language that bridges technical implementation and business domain.
Simplicity over Ease
Data is King
Value of Values
Decomplecting
Make Illegal States Unrepresentable
Domain Modeling Made Functional
Railway-Oriented Programming
Types as Documentation
Entities are defined by identity, not attributes:
Value Objects are defined entirely by attributes:
Decision Guide:
Aggregate: A cluster of entities and value objects treated as a single unit for data changes.
Aggregate Root: The single entity through which all external access to the aggregate must pass.
Purpose:
Rules:
When NOT to create an aggregate:
Definition: An explicit boundary within which a domain model applies.
Purpose:
Key Insight: Ubiquitous language is only ubiquitous within a context. "Customer" in Sales context may be different from "Customer" in Shipping context.
When modeling:
Definition: Something important that happened in the domain.
Characteristics:
Uses:
Purpose: Provide illusion of an in-memory collection of aggregates, abstracting persistence.
Characteristics:
Pattern: Application layer uses repository to get/save aggregates; domain layer remains pure.
Start by identifying the domain concepts, using terminology from domain experts:
Action Items:
Output Format: Create a glossary section documenting each term:
**Term** (Type: Entity/ValueObject/Event/Command)
- Definition: [Clear, domain-expert-approved definition]
- Examples: [Concrete examples]
- Invariants: [Rules that must always hold]
Before making changes, understand the current state:
Exploration Steps:
Questions to Answer:
Common problems to surface:
Naming Inconsistencies
Structural Problems
status: "approved" | "rejected" with separate approved_at and rejected_at fields that can both be set)Complected Concerns
Missing Concepts
Apply type-driven and data-driven principles:
Data Modeling:
Type Design:
type PaymentStatus =
| Pending
| Approved { approvedAt: Timestamp, approvedBy: UserId }
| Rejected { rejectedAt: Timestamp, reason: string }
type EmailAddress = EmailAddress of string // with validation
type Money = { amount: Decimal, currency: Currency }
Workflow Modeling:
ValidateInput → ExecuteBusinessLogic → HandleResult → Persist → Notify
Consistency Rules:
Code Conventions:
Documentation:
Use diagrams to communicate domain structure and relationships:
Mermaid for Relationships:
classDiagram
Order --> Customer
Order --> OrderLine
OrderLine --> Product
Order --> PaymentStatus
class Order {
+OrderId id
+CustomerId customerId
+List~OrderLine~ lines
+PaymentStatus status
}
class PaymentStatus {
<<enumeration>>
Pending
Approved
Rejected
}
Mermaid for Workflows:
graph LR
A[Receive Order] --> B{Valid?}
B -->|Yes| C[Calculate Total]
B -->|No| D[Return Validation Error]
C --> E[Process Payment]
E --> F{Payment Success?}
F -->|Yes| G[Fulfill Order]
F -->|No| H[Cancel Order]
Mermaid for State Transitions:
stateDiagram-v2
[*] --> Draft
Draft --> Submitted: submit()
Submitted --> Approved: approve()
Submitted --> Rejected: reject()
Approved --> Fulfilled: fulfill()
Fulfilled --> [*]
Rejected --> [*]
Graphviz/DOT for Complex Relationships:
digraph domain {
rankdir=LR;
node [shape=box];
Customer -> Order [label="places"];
Order -> OrderLine [label="contains"];
OrderLine -> Product [label="references"];
Order -> Payment [label="requires"];
Payment -> PaymentMethod [label="uses"];
}
ASCII for Quick Sketches:
Customer
└─> Order (1:N)
├─> OrderLine (1:N)
│ └─> Product
└─> Payment (1:1)
└─> PaymentMethod
When to Use Each:
Anemic Domain Model
Entity Services Anti-Pattern
UserService, OrderManager, ProductFactoryapproveOrder, cancelSubscription, calculateDiscountPrimitive Obsession
Accidental Complexity
Hidden Temporal Coupling
Boolean Blindness
When adding to or changing an existing domain model:
Key Questions:
Before completing domain modeling work:
Language & Communication:
Type Design:
Domain Logic:
Aggregates & Boundaries:
Consistency & Integration:
Documentation:
This skill includes reference documentation for deeper exploration:
ddd_foundations_and_patterns.md: Eric Evans' foundational DDD concepts (entities, value objects, aggregates, bounded contexts, repositories, domain events), Martin Fowler's Ubiquitous Language guidance, and practical Clojure/functional patterns. Essential reading for understanding DDD building blocks and how to apply them.
rich_hickey_principles.md: Core concepts from Rich Hickey's talks including Simple Made Easy, Value of Values, and The Language of the System. Focus on data-oriented design, simplicity, decomplecting, and the power of immutable values.
wlaschin_patterns.md: Scott Wlaschin's type-driven design patterns, domain modeling recipes, functional architecture guidance, and railway-oriented programming. Emphasis on making illegal states unrepresentable and designing with types.
visualization_examples.md: Comprehensive examples of Mermaid, Graphviz, and ASCII diagram patterns for domain modeling. Includes entity relationships, workflows, state machines, aggregate boundaries, and bounded context maps.
Load these references when deeper context is needed on specific principles or patterns.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub bfollington/terma --plugin tsal8 skills in this plugin
/bevyThis skill should be used when working on Bevy game engine projects. It provides specialized knowledge for Bevy's Entity Component System (ECS) architecture, component-driven design patterns, system ordering, UI development, build strategies, and common pitfalls. Use this skill when implementing game features, debugging Bevy code, designing component architectures, or working with Bevy's UI system./claude-pluginsReference for building and distributing Claude Code plugins — plugin.json and marketplace.json structure, bundling commands, agents, skills and hooks, versioning, and publishing a marketplace. Use when creating or packaging a plugin, setting up a marketplace, or debugging why a plugin's components are not loading./godotThis skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components./godot-interactiveInteract with a running Godot game via MCP — launch, screenshot, click, inspect scene tree, get/set properties, call methods, run dev-console commands. Powered by godot-mcp + the GodotMCPBridge autoload (protocol v4.0)./pattrnsGuide for creating generative, emergent music with Pattrns, the Lua-based pattern sequencing engine for Renoise. Use when composing algorithmic patterns, generating evolving breakbeats/rhythms, creating generative melodies/harmonies, designing textures, or working with euclidean rhythms and live coding patterns. Covers breakbeat/jungle/DnB, IDM/experimental, jazz, industrial/trip-hop, and ambient styles./shadertoyThis skill should be used when working with Shadertoy shaders, GLSL fragment shaders, or creating procedural graphics for the web. Use when writing .glsl files, implementing visual effects, creating generative art, or working with WebGL shader code. This skill provides GLSL ES syntax reference, common shader patterns, and Shadertoy-specific conventions.2 plugins ship this exact skill · first indexed Sep 5, 2026
Other plugins' skills for the same job