domain-analysis

Identifies subdomains and suggests bounded contexts in codebases using DDD Strategic Design.

Updated Sep 15, 2026
One-click install
npx skills add https://github.com/Peterson-Benhame/agent-skills --skill domain-analysis-peterson-benhame
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: domain-analysis
Source: https://github.com/Peterson-Benhame/agent-skills/tree/main/packages/skills-catalog/skills/%28architecture%29/domain-analysis
Command: npx skills add https://github.com/Peterson-Benhame/agent-skills --skill domain-analysis-peterson-benhame

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Understanding where to draw service and module boundaries in a codebase is hard, and grouping code by technical layers instead of business language leads to tangled domains, tight coupling, and unclear ownership. This Skill analyzes any codebase to map business domains, classify subdomains, and recommend bounded contexts grounded in Domain-Driven Design. ## Core Features & Use Cases - Subdomain Identification & Classification: Extracts entities, services, use cases, and controllers, groups them by Ubiquitous Language, and classifies each subdomain as Core, Supporting, or Generic using a decision tree. - Cohesion Scoring & Issue Detection: Computes a 10-point cohesion score (linguistic, usage, data, change) and flags low-cohesion problems like linguistic mismatches, cross-domain entity references, and generic logic inside core domains. - Bounded Context Mapping: Produces domain maps, cross-domain cohesion matrices, prioritized issue reports, and suggested bounded contexts with integration patterns such as Domain Events, Anti-Corruption Layers, and Open Host Services. - Use Case: Ask the agent to analyze a monolithic e-commerce codebase; it identifies Catalog, Order, Payment, and Shipping subdomains, scores their cohesion, flags the Customer entity leaking across contexts, and recommends value-object identifiers plus event-driven integration. ## Quick Start Ask the agent to analyze the domains in this codebase and suggest bounded contexts with cohesion scores.

Frequently Asked Questions about domain-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I identify bounded contexts in an existing codebase?

Bounded contexts are identified by grouping code concepts according to Ubiquitous Language rather than technical layers. The skill extracts entities, services, and use cases, detects where term meanings change, and proposes a bounded context per cohesive subdomain with explicit integration points.

What is the difference between Core, Supporting, and Generic subdomains?

A Core subdomain is your competitive advantage requiring the best developers, a Supporting subdomain is business-specific but not differentiating, and a Generic subdomain is standard functionality like authentication that could be outsourced. The skill classifies each using a decision tree based on competitive advantage and business specificity.

How is domain cohesion measured in DDD analysis?

Cohesion is scored out of 10 by summing linguistic cohesion (0-3), usage cohesion (0-3), data cohesion (0-2), and change cohesion (0-2). Scores of 8-10 indicate a strong subdomain candidate, 5-7 suggest reviewing boundaries, and 0-4 indicate wrong grouping needing separation.

Does this domain analysis work with any programming language or framework?

Yes, the analysis is language-agnostic and framework-independent because it focuses on business concepts and vocabulary rather than technical implementation. It works on monoliths, microservices, or hybrid architectures, and you can add framework-specific detection patterns for decorators like @Entity or @Injectable.

When should I not use domain-analysis for codebase review?

Do not use it for grouping existing components into predefined domains, which belongs to domain-identification-grouping, or for dependency and coupling analysis, which belongs to coupling-analysis. It is strategic analysis of what domains exist, not tactical implementation guidance.