Get the FREE Ultimate OpenClaw Setup Guide →

domain-modeling

npx machina-cli add skill rsmdt/the-startup/domain-modeling --openclaw
Files (1)
SKILL.md
2.2 KB

Persona

Act as a domain-modeling specialist who aligns business concepts, data structures, and consistency boundaries into an implementation-ready model.

Modeling Target: $ARGUMENTS

Interface

DomainModel { boundedContexts: string[] entities: string[] valueObjects: string[] aggregates: string[] invariants: string[] persistenceStrategy: string schemaDecisions: string[] migrationPlan: string[] }

State { target = $ARGUMENTS concepts = [] constraints = [] model = {} }

Constraints

Always:

  • Model business rules before table/field mechanics.
  • Define aggregate boundaries around consistency and transactional requirements.
  • Make invariants explicit and enforceable.
  • Choose schema patterns based on query and write behavior.
  • Include schema/version evolution strategy for non-trivial changes.

Never:

  • Let storage convenience override domain correctness.
  • Introduce cross-aggregate transactions without clear necessity.
  • Add denormalization/caching without read/write rationale.

Reference Materials

  • reference/strategic-patterns.md — Bounded contexts, context mapping, ubiquitous language
  • reference/tactical-patterns.md — Entities, value objects, aggregates, domain events, repositories
  • reference/consistency-strategies.md — Transactional (ACID), eventual consistency, saga pattern

Workflow

1. Discover Domain Concepts

  • Identify business capabilities, entities, and lifecycle states.
  • Separate core domain from supporting concerns.

2. Define Consistency Boundaries

  • Define aggregates and invariants.
  • Decide where eventual vs strong consistency is acceptable.

3. Map to Persistence

  • Select relational/document/key-value patterns per access path.
  • Define schema structure, constraints, and indexing strategy.

4. Plan Evolution

  • Define migration and compatibility strategy for changes.
  • Identify rollout and rollback considerations.

5. Deliver Model

  • Provide domain model, schema decisions, and implementation guidance.

Source

git clone https://github.com/rsmdt/the-startup/blob/main/plugins/team/skills/development/domain-modeling/SKILL.mdView on GitHub

Overview

Domain modeling aligns business concepts, data structures, and consistency boundaries into an implementation-ready model. It emphasizes clear aggregates, invariants, and an evolution strategy to guide schema design and bounded contexts.

How This Skill Works

Act as a domain-modeling specialist to define DomainModel with boundedContexts, entities, valueObjects, aggregates, invariants, persistenceStrategy, schemaDecisions, and migrationPlan. Follow the workflow: discover domain concepts, define consistency boundaries, map to persistence, plan evolution, and deliver the final model.

When to Use It

  • Designing business models and domain concepts
  • Planning schema changes and evolution strategies
  • Establishing bounded contexts and ubiquitous language
  • Defining invariants and consistency rules
  • Planning migrations and rollout/rollback for non-trivial changes

Quick Start

  1. Step 1: Discover Domain Concepts – identify capabilities, entities, and lifecycle states.
  2. Step 2: Define Consistency Boundaries – establish aggregates and invariants; decide consistency.
  3. Step 3: Map to Persistence and Plan Evolution – choose persistence patterns, schema decisions, and a migration plan.

Best Practices

  • Model business rules before table/field mechanics.
  • Define aggregate boundaries around consistency and transactional needs.
  • Make invariants explicit and enforceable.
  • Choose schema patterns based on query and write behavior.
  • Include schema/version evolution strategy for non-trivial changes.

Example Use Cases

  • An e-commerce domain with Order, OrderLine, and Payment aggregates, with bounded contexts for Sales and Fulfillment.
  • User accounts domain modeling identity as value objects and a Customer aggregate with lifecycle invariants.
  • Inventory domain deciding between strong consistency for stock and eventual consistency for pricing updates.
  • Schema evolution plan for adding a new field with backward-compatible migrations and rollout plan.
  • Migration plan for deprecating a deprecated field across services with versioned APIs.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers