.agents/skills/domain-analysis/SKILL.md
Identifies subdomains and suggests bounded contexts in any codebase following DDD Strategic Design. Use when analyzing domain boundaries, identifying business subdomains, assessing domain cohesion, mapping bounded contexts, or when the user asks about DDD strategic design, domain analysis, or subdomain classification.
npx skillsauth add baotoq/micro-commerce domain-analysisInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill analyzes codebases to identify subdomains (Core, Supporting, Generic) and suggest bounded contexts following Domain-Driven Design Strategic Design principles.
Apply this skill when:
Core Domain: Competitive advantage, highest business value, requires best developers
Supporting Subdomain: Essential but not differentiating, business-specific
Generic Subdomain: Common functionality, could be outsourced
An explicit linguistic boundary where domain terms have specific, unambiguous meanings.
Scan codebase for business concepts (not infrastructure):
Entities (domain models with identity)
@Entity, class, domain modelsServices (business operations)
*Service, *Manager, *HandlerUse Cases (business workflows)
*UseCase, *Command, *HandlerControllers/Resolvers (entry points)
*Controller, *Resolver, API endpointsFor each concept, determine:
Primary Language Context
Subscription, Invoice, Payment → Billing languageMovie, Video, Episode → Content languageUser, Authentication → Identity languageLinguistic Boundaries
Concept Relationships
A subdomain has:
Common Domain Patterns:
Classify Each Subdomain:
Use this decision tree:
Is it a competitive advantage?
YES → Core Domain
NO → Does it require business-specific knowledge?
YES → Supporting Subdomain
NO → Generic Subdomain
High Cohesion Indicators ✅
Low Cohesion Indicators ❌
Cohesion Score Formula:
Score = (
Linguistic Cohesion (0-3) + // Shared vocabulary
Usage Cohesion (0-3) + // Used together
Data Cohesion (0-2) + // Entity relationships
Change Cohesion (0-2) // Change together
) / 10
8-10: High Cohesion ✅
5-7: Medium Cohesion ⚠️
0-4: Low Cohesion ❌
Rule 1: Linguistic Mismatch
User (identity) + Subscription (billing) in same serviceRule 2: Cross-Domain Dependencies
Rule 3: Mixed Responsibilities
Rule 4: Generic in Core
Rule 5: Unclear Boundaries
For each subdomain identified, suggest bounded context:
Bounded Context Characteristics:
Integration Patterns:
For each domain/subdomain:
## Domain: {Name}
**Type**: Core Domain | Supporting Subdomain | Generic Subdomain
**Ubiquitous Language**: {key business terms}
**Business Capability**: {what business problem it solves}
**Key Concepts**:
- {Concept} (Entity|Service|UseCase) - {brief description}
**Subdomains** (if applicable):
1. {Subdomain} (Core|Supporting|Generic)
- Concepts: {list}
- Cohesion: {score}/10
- Dependencies: → {other domains}
**Suggested Bounded Context**: {Name}Context
- Linguistic boundary: {where terms have specific meaning}
- Integration: {how it should integrate with other contexts}
**Dependencies**:
- → {OtherDomain} via {interface/API}
- ← {OtherDomain} via {interface/API}
**Cohesion Score**: {score}/10
## Cross-Domain Cohesion
| Domain A | Domain B | Cohesion | Issue | Recommendation |
| -------- | -------- | -------- | ------------------ | ----------------------- |
| Billing | Identity | 2/10 | ❌ Direct coupling | Use interface |
| Content | Billing | 6/10 | ⚠️ Usage tracking | Event-based integration |
## Issues Detected
### Priority: High
**Issue**: {description}
- **Location**: {file/class/method}
- **Problem**: {what's wrong}
- **Concepts**: {involved concepts}
- **Cohesion**: {score}/10
- **Recommendation**: {suggested fix}
### Priority: Medium
{similar format}
## Suggested Bounded Contexts
### {ContextName}Context
**Contains Subdomains**:
- {Subdomain1} (Core)
- {Subdomain2} (Supporting)
**Ubiquitous Language**:
- Term: Definition in this context
**Integration Requirements**:
- Consumes from: {OtherContext} via {pattern}
- Publishes to: {OtherContext} via {pattern}
**Implementation Notes**:
- Separate persistence
- Independent deployment
- Explicit API boundaries
For Each Concept:
For Each Domain:
For Cohesion Analysis:
Analyze business capability
└─ Is it competitive advantage?
├─ YES → Core Domain
└─ NO → Is it business-specific?
├─ YES → Supporting Subdomain
└─ NO → Generic Subdomain
Same vocabulary? → High linguistic cohesion
Used together? → High usage cohesion
Direct relationships? → High data cohesion
Change together? → High change cohesion
All high → Strong subdomain candidate
Mix of high/low → Review boundaries
All low → Likely wrong grouping
Clear boundary signs:
✅ Distinct Ubiquitous Language
✅ Concepts have unambiguous meaning
✅ Different meanings across contexts
✅ Clear integration points
Unclear boundary signs:
❌ Same terms with same meanings everywhere
❌ Concepts used identically across system
❌ No clear linguistic differences
❌ Tight coupling everywhere
Big Ball of Mud
All-Inclusive Model
Mixed Linguistic Concepts
Good domain identification has:
development
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
development
React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.
testing
Generate comprehensive, maintainable unit tests across languages with strong coverage and edge case focus.
tools
UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 9 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient. Integrations: shadcn/ui MCP for component search and examples.