Agent skill

Modular Decomposition

by tech-leads-club in tech-leads-club/agent-skills

Runs a five-step analysis of a monolith: size components, find shared domain logic, flatten hierarchy, measure coupling and group components into candidate domains.

Custom licenceAuto-check passedDevelopment

Install Modular Decomposition

skills CLI
$ npx skills add tech-leads-club/agent-skills --skill modular-decomposition -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install tech-leads-club/agent-skills modular-decomposition --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/tech-leads-club/agent-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/'packages/skills-catalog/skills/(architecture)/modular-decomposition' .claude/skills/modular-decomposition && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
modular-decomposition
GitHub stars
7k
Token cost
~1.7k tokens
SKILL.md length
557 words
Files
13 (incl. references)
Skills in repo
74
Repo updated
First seen
Licence
Custom licence

At a glance

Runs a five-step analysis of a monolith: size components, find shared domain logic, flatten hierarchy, measure coupling and group components into candidate domains.

  • Works in 6 steps: Scope: Confirm the task is structural… → Order: Run patterns 1 → 2 → 3 → 4 → 5 in… → Load references: For each pattern, open… → …
  • Deciding how to split a monolith before extracting any services
  • SKILL.md covers How to Use, Prerequisites, Ordered workflow (Patterns 1–5) and Pattern 6 — planning and…, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

The skill runs five numbered patterns in order against your repository before any service extraction: identify and size components, find common domain logic, fix flattening and hierarchy problems, analyze coupling, then group components by domain. Each pattern is a markdown file under `references/` that the agent loads for its step, and short quick-reference versions exist for most of them.

Results from earlier steps feed later ones, so the component inventory shapes the coupling and grouping analysis. For Pattern 5 it can add domain-driven design strategic analysis of subdomains and bounded contexts using `references/domain-analysis.md`. If you limit the scope, the agent states which patterns were skipped and what that does to later conclusions.

The output is a report per pattern or one combined report, tied to files, dependencies and metrics in your repo. Extraction order and phased roadmaps belong to a separate decomposition-planning-roadmap skill.

When your agent uses it

  • Deciding how to split a monolith before extracting any services
  • Sizing components to see which are good candidates for extraction
  • Finding duplicated domain logic spread across modules
  • Measuring coupling between packages or modules

Example prompts

  • “Inventory and size the components under src/ and tell me which could be extracted.”
  • “Find duplicated domain logic across our billing and orders modules.”
  • “Group these modules into domains and check the bounded contexts with DDD.”

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Scope: Confirm the task is structural analysis (inventory → coupling → grouping), not roadmap authoring. If unclear, ask once whether they…
  2. 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…
  3. Load references: For each pattern, open the matching references/pattern-NN-*.md file and follow its instructions. Use the optional…
  4. Carry context forward: Reuse outputs from earlier patterns in later ones (e.g. component inventory from Pattern 1 informs coupling in 4…
  5. Domain language (Pattern 5): If subdomains or bounded contexts need grounding beyond structure, read references/domain-analysis.md before…
  6. Deliver: Produce clear, actionable findings per pattern or one consolidated report—always tied to evidence from the repository (files…

What it can do on your machine

Read from SKILL.md and the folder at commit 6df68d5. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Modular Decomposition loads about 1.7k tokens when it runs, and up to ~35k if it reads all its reference files. Until then it costs about 223 tokens; SKILL.md has 557 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~223
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~35k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

Its licence (Custom licence) doesn't allow us to republish the file, so here is its outline and opening line. It has 557 words (~1,731 tokens).

“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.”

— opening of SKILL.md by tech-leads-club, Custom licence
name
modular-decomposition

Read the full SKILL.md on GitHub

Files

SKILL.md and 12 other files (references) in packages/skills-catalog/skills/(architecture)/modular-decomposition of tech-leads-club/agent-skills.

  • SKILL.md
  • references/domain-analysis-examples.md
  • references/domain-analysis-quick-reference.md
  • references/domain-analysis.md
  • references/pattern-01-identify-and-size-quick-reference.md
  • references/pattern-01-identify-and-size.md
  • references/pattern-02-common-domain-quick-reference.md
  • references/pattern-02-common-domain.md
  • references/pattern-03-flattening-quick-reference.md
  • references/pattern-03-flattening.md
  • references/pattern-04-coupling.md
  • references/pattern-05-domain-grouping-quick-reference.md
  • references/pattern-05-domain-grouping.md

Open the folder on GitHubat commit 6df68d5

Compare with similar skills

Modular Decomposition next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Modular Decomposition compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Modular Decomposition this skilltech-leads-club/agent-skills7k—~1.7kAutomated safety check: PassCustom licence
Architecture Patternssecondsky/claude-skills22711 repos~2.4kAutomated safety check: PassMIT
Architecture PatternsKartikLabhshetwar/better-shot2.4k2 repos~1.4kAutomated safety check: PassCustom licence
Brooks Audithyhmrright/brooks-lint1.5k1 repos~537Automated safety check: PassMIT
Birdview ReviewQiuner/birdview727—~580Automated safety check: PassMIT
Py Rigmudrii/hermesd118—~6.3kAutomated safety check: PassMIT

Similar skills

  • Architecture Patterns

    secondsky/claude-skills

    Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design.

    227 GitHub starsUsed in 11 repos~2.4k tokens
    DevelopmentAuto-check passed
  • Architecture Patterns

    KartikLabhshetwar/better-shot

    Deep dive into software architecture for macOS. An agent skill from KartikLabhshetwar/better-shot.

    2.4k GitHub starsUsed in 2 repos~1.4k tokens
    DevelopmentAuto-check passed
  • Brooks Audit

    hyhmrright/brooks-lint

    Architecture audit that maps module dependencies, checks layering integrity, and flags structural decay across a codebase, drawing on twelve classic engineering books.

    1.5k GitHub starsUsed in 1 repo~537 tokens
    DevelopmentAuto-check passed
  • Birdview Review

    Qiuner/birdview

    Review and improve codebase architecture with source-backed current/proposed diagrams, tradeoffs and verification.

    727 GitHub stars~580 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Py Rig

    mudrii/hermesd

    A skill your agent uses when building, reviewing, or refactoring Python code that requires strong maintainability discipline: SRP, DRY, OCP, explicit dependency injection, TDD/ATDD workflow, strict…

    118 GitHub stars~6.3k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Brooks Review

    hyhmrright/brooks-lint

    PR code review that surfaces decay risks, design smells, and maintainability issues with concrete Symptom → Source → Consequence → Remedy findings, drawing on twelve classic engineering books.

    1.5k GitHub starsUsed in 1 repo~430 tokens
    DevelopmentAuto-check passed

More from tech-leads-club/agent-skills

All 74 skills in this repo
  • Evolutionary Modular Architecture

    tech-leads-club/agent-skills

    Guides design of modular-monolith platforms with DDD, flat-by-aggregate modules, anti-corruption layers, outbox events and resilience, plus an architecture document with SVG diagrams.

    7k GitHub stars~3.7k tokensUpdated yesterday
    Auto-check passed
  • Excalidraw Diagram Studio

    tech-leads-club/agent-skills

    Generates Excalidraw diagram files from plain descriptions, choosing among flowcharts, mind maps, architecture, swimlane, class, sequence and ER diagrams.

    7k GitHub stars~3.6k tokensUpdated yesterday
    Auto-check passed
  • Mermaid Studio

    tech-leads-club/agent-skills

    Creates, validates and renders Mermaid diagrams to SVG, PNG or ASCII, including C4 and AWS architecture-beta, flowcharts, sequence diagrams and ERDs.

    7k GitHub stars~4.6k tokensUpdated yesterday
    Auto-check passed
  • AWS Cloud Advisor

    tech-leads-club/agent-skills

    Answers AWS architecture, security and service-selection questions by searching AWS documentation through MCP tools first, then adapting advice to your stack and team.

    7k GitHub stars~2.1k tokensUpdated yesterday
    Auto-check passed
  • Harness Eval

    tech-leads-club/agent-skills

    Evaluates a repository's agent harness (AGENTS.md, rules, skills) for broken paths, redundant instructions and usefulness, and stops at reports.

    7k GitHub stars~3.9k tokensUpdated yesterday
    Auto-check passed
  • NestJS Modular Monolith Architect

    tech-leads-club/agent-skills

    Designs scalable NestJS modular monoliths with domain-driven design, Clean Architecture layers and optional CQRS, defining bounded contexts and strict module boundaries.

    7k GitHub stars~3.9k tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Modular Decomposition

What does Modular Decomposition do?

Runs a five-step analysis of a monolith: size components, find shared domain logic, flatten hierarchy, measure coupling and group components into candidate domains. The skill runs five numbered patterns in order against your repository before any service extraction: identify and size components, find common domain logic, fix flattening and hierarchy problems, analyze coupling, then group components by domain. Each pattern is a markdown file under `references/` that the agent loads for its step, and short quick-reference versions exist for most of them.

When should I use Modular Decomposition?

Modular Decomposition fits situations like: deciding how to split a monolith before extracting any services; sizing components to see which are good candidates for extraction; finding duplicated domain logic spread across modules; measuring coupling between packages or modules.

How do I install Modular Decomposition in Claude Code?

Run `npx skills add tech-leads-club/agent-skills --skill modular-decomposition -a claude-code`. Or copy the skill folder (packages/skills-catalog/skills/(architecture)/modular-decomposition in tech-leads-club/agent-skills) into .claude/skills/modular-decomposition in your project. Claude Code loads it when a task matches its description.

How do I install Modular Decomposition in Codex?

Run `npx skills add tech-leads-club/agent-skills --skill modular-decomposition -a codex`. Or copy the skill folder (packages/skills-catalog/skills/(architecture)/modular-decomposition in tech-leads-club/agent-skills) into .agents/skills/modular-decomposition in your project. Codex loads it when a task matches its description.

Can I use Modular Decomposition in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add tech-leads-club/agent-skills --skill modular-decomposition -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/modular-decomposition, .gemini/skills/modular-decomposition, .github/skills/modular-decomposition and .opencode/skills/modular-decomposition in your project.

What does Modular Decomposition need to run?

SKILL.md names no scripts, command-line tools or credentials: Modular Decomposition is instructions for the agent only.

Does Modular Decomposition access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Modular Decomposition safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Modular Decomposition use?

Modular Decomposition has a licence file (the repository's licence) that doesn't match a standard licence. Read it on GitHub before reusing the skill.

How many tokens does Modular Decomposition use?

About 1.7k tokens (SKILL.md is roughly 6.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 33k tokens, read only when the agent opens those files.

What are the alternatives to Modular Decomposition?

Skills that share tags, products or a category with Modular Decomposition: Architecture Patterns (secondsky/claude-skills, 227 stars), Architecture Patterns (KartikLabhshetwar/better-shot, 2.4k stars), Brooks Audit (hyhmrright/brooks-lint, 1.5k stars) and Birdview Review (Qiuner/birdview, 727 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Modular Decomposition?

tech-leads-club (a GitHub organization) maintains it in tech-leads-club/agent-skills, which has 7,043 GitHub stars. The repository holds 74 skills in this directory. The repository was last updated on October 8, 2026.

Source: tech-leads-club/agent-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.