domain-model-extractor
npx machina-cli add skill a5c-ai/babysitter/domain-model-extractor --openclawFiles (1)
SKILL.md
2.4 KB
Domain Model Extractor Skill
Extracts domain models from monolithic codebases using Domain-Driven Design principles to support microservices decomposition.
Purpose
Enable domain analysis for:
- Bounded context identification
- Aggregate detection
- Entity relationship mapping
- Domain event discovery
- Ubiquitous language extraction
Capabilities
1. Bounded Context Identification
- Analyze code modules
- Identify domain boundaries
- Map team ownership
- Define context relationships
2. Aggregate Detection
- Find aggregate roots
- Map entity relationships
- Identify invariants
- Define consistency boundaries
3. Entity Relationship Mapping
- Extract entities
- Map relationships
- Identify value objects
- Document associations
4. Domain Event Discovery
- Find implicit events
- Map state changes
- Identify triggers
- Document event flows
5. Ubiquitous Language Extraction
- Build domain vocabulary
- Map term usage
- Identify synonyms
- Create glossary
6. Context Map Generation
- Map context relationships
- Identify integration patterns
- Document shared kernels
- Define anti-corruption layers
Tool Integrations
| Tool | Purpose | Integration Method |
|---|---|---|
| EventStorming tools | Domain discovery | Manual/Digital |
| Architecture analyzers | Code analysis | CLI |
| Visualization tools | Context mapping | Export |
| Custom AST analyzers | Code parsing | CLI |
Output Schema
{
"extractionId": "string",
"timestamp": "ISO8601",
"domain": {
"boundedContexts": [
{
"name": "string",
"purpose": "string",
"aggregates": [],
"entities": [],
"events": [],
"services": []
}
],
"contextMap": {
"relationships": []
}
},
"ubiquitousLanguage": {
"terms": []
},
"recommendations": {
"serviceDecomposition": [],
"integrationPatterns": []
}
}
Integration with Migration Processes
- monolith-to-microservices: Domain analysis
- migration-planning-roadmap: Strategic design
Related Skills
architecture-analyzer: Structure analysis
Related Agents
ddd-analyst: DDD expertisemicroservices-decomposer: Service extraction
Source
git clone https://github.com/a5c-ai/babysitter/blob/main/plugins/babysitter/skills/babysit/process/specializations/code-migration-modernization/skills/domain-model-extractor/SKILL.mdView on GitHub Overview
Extracts domain models from monolithic codebases using Domain-Driven Design principles to support microservices decomposition. It identifies bounded contexts, aggregates, entities, domain events, and ubiquitous language, then builds a context map to guide migration.
How This Skill Works
It analyzes code modules to identify domain boundaries, detect aggregates, map entity relationships, discover domain events, and extract ubiquitous language terms. The results include a context map and an output schema ready for monolith-to-microservices migration planning.
When to Use It
- Planning a monolith-to-microservices migration and need clear bounded contexts
- Analyzing a large codebase with ambiguous boundaries to identify aggregates and context relationships
- Defining the ubiquitous language and glossary to align development teams
- Generating a context map to document integration patterns and anti-corruption layers
- Preparing migration artifacts for strategic decomposition and team ownership mapping
Quick Start
- Step 1: Analyze your monolith modules and code boundaries
- Step 2: Run the domain-model-extractor to identify bounded contexts, aggregates, and domain events
- Step 3: Review and refine the context map and ubiquitous language glossary for migration planning
Best Practices
- Start with domain experts to validate bounded contexts and vocabularies
- Use AST analyzers and CLI tools to extract entities, events, and relations
- Capture invariants and state changes to define aggregate boundaries
- Regularly review the context map with cross-team stakeholders
- Document shared kernels and anti-corruption layers in the context map
Example Use Cases
- A retail platform decomposing into Catalog, Cart, Order, and Payment bounded contexts
- Banking system separating Customer, Account, Transaction, and Risk contexts with a context map
- SaaS platform breaking out Identity, Authorization, Billing, and Usage domains
- Logistics system isolating Inventory, Shipment, Routing, and Returns contexts
- Healthcare system modeling Patient, Appointment, Billing, and Records domains
Frequently Asked Questions
Add this skill to your agents