modular-decomposition

Analyzes monolith structure through a five-pattern pipeline to group components into domain-aligned services.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Splitting a monolith without structural analysis leads to poorly bounded services, duplicated domain logic, and tangled coupling. This Skill runs a sequenced five-pattern analysis pipeline that inventories and sizes components, detects duplicated domain functionality, fixes hierarchy issues, measures coupling, and groups components into candidate domain-aligned units before any extraction begins. ## Core Features & Use Cases - Component Inventory & Sizing: Identifies leaf-node components, counts statements, and flags oversized or undersized components using percentage thresholds and standard deviation analysis. - Duplication & Coupling Analysis: Detects common domain functionality across components, assesses consolidation feasibility with afferent coupling metrics, and maps dependencies between modules. - Domain Grouping with DDD: Groups components into candidate domains and optionally applies strategic Domain-Driven Design analysis (subdomains, bounded contexts, ubiquitous language) via embedded reference guides. - Use Case: A team planning to break a large Node.js monolith into services asks the agent to run Patterns 1–5, receiving an evidence-backed report of component sizes, duplicated notification logic, coupling hotspots, and proposed service boundaries. ## Quick Start Ask the agent to run the full modular decomposition pipeline (Patterns 1 through 5) on your repository to inventory components, analyze coupling, and propose domain-aligned service groupings.

Frequently Asked Questions about modular-decomposition

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

FAQPage Schema
How do I analyze a monolith before splitting it into services?▼

Run the five-pattern pipeline in order: identify and size components, detect common domain duplication, flatten hierarchy issues, analyze coupling, then group components into domains. Each step loads a dedicated reference guide and feeds its outputs into the next step.

How do I find oversized components in a codebase?▼

Pattern 1 counts executable statements per leaf-node component and flags outliers exceeding percentage thresholds (10-30% depending on app size) or more than two standard deviations from the mean. It then suggests concrete splits with estimated sizes.

Can this skill detect duplicated domain logic across modules?▼

Yes, Pattern 2 scans namespace patterns and shared classes to find duplicated functionality like notification or audit logic. It assesses consolidation feasibility and calculates coupling impact before recommending a shared service, library, or merge.

Does modular decomposition include DDD bounded context analysis?▼

Yes, it embeds a full domain-analysis reference covering subdomain classification, ubiquitous language mapping, cohesion scoring, and bounded context suggestions. Use it alongside Pattern 5 when business language grounding is needed beyond folder structure.

When should I not use modular decomposition?▼

Avoid it for phased extraction roadmaps or migration prioritization, which belong to decomposition-planning-roadmap, and for full legacy migration strategies involving strangler-fig patterns, which belong to legacy-migration-planner. It covers structural analysis only, not planning.