mcpbeat Sign in

Modular Decomposition Agent Skill

Runs a sequenced monolith-to-modular pipeline that sizes and inventories components, finds shared domain duplication, addresses flattening and hierarchy issues, analyzes coupling, then groups components into candidate domain-aligned units, with optional embedded DDD strategic analysis for bounded contexts. Use when asking how to split a monolith, size components before extraction, find duplicated domain logic, clean up module hierarchy, measure coupling between modules, or group components into services. Do NOT use for phased extraction roadmaps or prioritization without the prior analysis steps (use decomposition-planning-roadmap after this pipeline), end-to-end legacy migration strategy writeups (use legacy-migration-planner), pure infrastructure capacity sizing, or when you only need DDD without the structural pipeline (install domain-analysis standalone).

35k tokens
context cost
the whole folder, loaded on every use
13
files
instructions only
0
copies elsewhere
how many repositories repackaged it
4978
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/tech-leads-club/agent-skills --skill modular-decomposition

The instruction itself

9 sections, as written by the author

Modular Decomposition

This skill runs the Patterns 1–5 analysis pipeline before service extraction. Each pattern is plain markdown under references/; load the file for that step and execute it against the user’s codebase.

How to Use

Quick start (what users can say)

  • Full pipeline: “Run modular decomposition Patterns 1 through 5 on this repo,” “Analyze this monolith for splitting—inventory, coupling, and domain grouping.”
  • Single early step: “Identify and size components here,” “Find duplicated domain logic across modules,” “Analyze coupling between our packages.”
  • With DDD lens: “Group components into domains and check bounded contexts,” “Use DDD strategic design on this codebase before we group services.”

If the user only wants extraction order, phases, or migration roadmap after analysis exists, use decomposition-planning-roadmap instead. If they need a full legacy migration plan (strangler fig, research, multi-stack), use legacy-migration-planner as well or instead of this skill when that is the primary ask.

How the agent should run it

  • Scope: Confirm the task is structural analysis (inventory → coupling → grouping), not roadmap authoring. If unclear, ask once whether they want the full ordered pipeline or a subset.
  • Order: Run patterns 1 → 2 → 3 → 4 → 5 in that order. Do not skip a step unless the user explicitly limits scope; if they do, state which patterns were skipped and how that limits later conclusions.
  • Load references: For each pattern, open the matching references/pattern-NN-*.md file and follow its instructions. Use the optional *-quick-reference.md for the same number when a short checklist is enough.
  • Carry context forward: Reuse outputs from earlier patterns in later ones (e.g. component inventory from Pattern 1 informs coupling in 4 and grouping in 5). Reference concrete paths, modules, or tables from previous steps.
  • Domain language (Pattern 5): If subdomains or bounded contexts need grounding beyond structure, read references/domain-analysis.md before or alongside Pattern 5. Optionally open references/domain-analysis-quick-reference.md or references/domain-analysis-examples.md for condensed rules or illustrations.
  • Deliver: Produce clear, actionable findings per pattern or one consolidated report—always tied to evidence from the repository (files, dependencies, metrics), not generic advice.

Usage examples

Example 1 — Full pipeline

User: "We're going to split this monolith—run the full decomposition analysis (Patterns 1–5)."

Agent: Execute patterns 1→5 in order, loading each references/pattern-NN-*.md, preserving outputs between steps, then summarize cross-cutting recommendations.

Example 2 — Coupling after inventory

User: "We already have a rough module list—focus on coupling (Pattern 4) and then domain grouping (Pattern 5)."

Agent: If no prior inventory exists in the thread, either run Pattern 1 briefly or derive an explicit module list from the repo before 4 and 5. State any assumptions.

Example 3 — DDD before grouping

User: "Map bounded contexts and language, then group components into domains."

Agent: Read references/domain-analysis.md (and optional quick reference/examples) in parallel with or immediately before Pattern 5; align Pattern 5 groupings with linguistic boundaries where evidence supports it.

Prerequisites

  • Complete Pattern N before starting Pattern N+1 unless the user explicitly narrows scope. Later patterns depend on earlier results (for example, inventory and structure inform coupling and grouping).
  • If business vocabulary, subdomains, or bounded contexts are uncertain, use references/domain-analysis.md before or alongside Pattern 5 (see Bounded contexts below).

Ordered workflow (Patterns 1–5)

| Step | Pattern | Primary reference |

| ---- | ---------------------------------- | ---------------------------------------------------------------------------------------------------------- |

| 1 | Identify and size components | references/pattern-01-identify-and-size.md (optional: pattern-01-identify-and-size-quick-reference.md) |

| 2 | Common domain detection | references/pattern-02-common-domain.md (optional: pattern-02-common-domain-quick-reference.md) |

| 3 | Flattening / hierarchy | references/pattern-03-flattening.md (optional: pattern-03-flattening-quick-reference.md) |

| 4 | Coupling analysis | references/pattern-04-coupling.md |

| 5 | Domain identification and grouping | references/pattern-05-domain-grouping.md (optional: pattern-05-domain-grouping-quick-reference.md) |

Pattern 6 — planning and extraction

Pattern 6 (_create domain services / extraction_) is not duplicated here. After Pattern 5, switch to decomposition-planning-roadmap for phased extraction order, milestones, and migration-style planning. For full legacy migration strategy (strangler-fig, cross-stack rewrites, research-heavy plans), optionally use legacy-migration-planner in addition.

Bounded contexts and DDD strategic design

  • Patterns 1–4 focus on structural inventory, duplication, hierarchy, and coupling between parts of the codebase.
  • Pattern 5 produces candidate groupings aligned with solution-space boundaries (which components belong together as services).
  • Strategic DDD (subdomains, bounded contexts, ubiquitous language) is covered in references/domain-analysis.md, with optional domain-analysis-quick-reference.md and domain-analysis-examples.md. Use it when you need to validate or refine boundaries against business language, not only folder structure.

Other skills for the same job

different authors, same section of the catalogue
Workflow Automation
by ComeOnOliver
×3

Workflow automation is the infrastructure that makes AI agents reliable. Without durable execution, a network hiccup during a 10-step payment flow means lost money and angry customers. With it, workflows resume exactly where they left off. This skill covers the platforms (n8n, Temporal, Inngest) and patterns (sequential, parallel, orchestrator-worker) that turn brittle scripts into production-grade automation. Key insight: The platforms make different tradeoffs. n8n optimizes for accessibility

3k tokens
Cloudinary Automation
by christophacham
×2

Automate Cloudinary media management including folder organization, upload presets, asset lookup, transformations, and usage monitoring through natural language commands

2k tokens needs MCP
Cicd Automation Workflow Automate
by ComeOnOliver
×2

You are a workflow automation expert specializing in creating efficient CI/CD pipelines, GitHub Actions workflows, and automated development processes. Design automation that reduces manual work, improves consistency, and accelerates delivery while maintaining quality and security.

13k tokens
Server Management
by ComeOnOliver
×2

Server management principles and decision-making. Process management, monitoring strategy, and scaling decisions. Teaches thinking, not commands.

3k tokens
Create Github Action Workflow Specification
by github
vendor ×1

Create a formal specification for an existing GitHub Actions CI/CD workflow, optimized for AI consumption and workflow maintenance.

2k tokens
Dnanexus Integration
by K-Dense-AI
×1

Build and operate reproducible genomics workloads on DNAnexus with the dx CLI, dxpy, apps/applets, native workflows, dxCompiler, and Nextflow. Use for DNAnexus data transfers, dxapp.json development, execution monitoring, workflow import, and project automation.

37k tokens scripts
Search Company Knowledge
by openai
vendor ×1

Search across company knowledge bases (Confluence, Jira, internal docs) to find and explain internal concepts, processes, and technical details. When an agent needs to: (1) Find or search for information about systems, terminology, processes, deployment, authentication, infrastructure, architecture, or technical concepts, (2) Search internal documentation, knowledge base, company docs, or our docs, (3) Explain what something is, how it works, or look up information, or (4) Synthesize information from multiple sources. Searches in parallel and provides cited answers.

4k tokens
Deployment Procedures
by lingxling
×1

Production deployment principles and decision-making. Safe deployment workflows, rollback strategies, and verification. Teaches thinking, not scripts.

2k tokens

How to use it

Copy the folder

Take tech-leads-club/modular-decomposition from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.