- Home
- Skills
- Agents & Orchestration
- Module Decomposition Planner — Split, Don't Break Callers
Works with the AI Agents you already use
Module Decomposition Planner — Split, Don't Break Callers
Generate safe, data-driven plans to split god modules and monoliths without breaking existing callers.
$12
Module Decomposition Planner — Split, Don't Break Callers
Example session with this skill installed
I need to split the services/user-management module. It has become a god module. Plan a decomposition that won't break the existing API for other teams.
- Read your context and instructions
- Compiled the module decomposition planner
I have analyzed the services/user-management module using git ls-files and agent-context. I have identified three distinct seams and a re-export strategy to preserve the existing API.
Module Decomposition Plan: user-management
| Component | Files | Exports | Consumer Count | Seam |
|---|---|---|---|---|
| Auth Logic | auth.ts, session.ts | login, verify | 14 modules | user-auth |
| Profile Mgmt | profile.ts, avatar.ts | updateProfile | 3 modules | user-profile |
| Internal Helpers | utils.ts, db-map.ts | None (Internal) | 0 (External) | user-core |
Proposed Seams
- user-auth: Focuses on credential validation and session handling. This is the most heavily used seam.
- user-profile: Handles metadata and social features. Low coupling with the rest of the system.
- user-core: Contains private database mapping logic that should not be exported.
Compatibility Strategy
To avoid breaking the 14 dependent modules, we will use a
Re-export strategy. The original services/user-management/index.ts will remain as a barrel file, importing and re-exporting symbols from the new locations. This allows teams to migrate their imports at their own pace.
Migration Order
- Safety Net: Verify existing test coverage for
loginandupdateProfilein the current module. - Extract user-profile: Move profile files to
services/user-profile/. Add re-exports to the old path. - Extract user-auth: Move auth files to
services/user-auth/. Add re-exports to the old path. - Cleanup: Refactor
user-coreinternal utilities to remove redundant exports.
Next steps
- Review the
user-authseam to ensure it meets the security layering rules indocs/architecture.md. - Run the provided
git grepcommands to verify no dynamic imports are missed. - Approve the plan to begin manual file migration.
Connects securely to your tools. The creator never sees your data.
About this skill
Monolithic modules and "god files" create technical debt that slows down every PR. Moving symbols blindly breaks imports across the entire repository. This skill provides a data-driven approach to modularization, turning architectural intuition into a verifiable execution plan.
What it does
- Inventory analysis catalogs every exported and internal symbol with its declaring file.
- Consumer mapping counts how many files depend on specific exports to identify load-bearing symbols.
- Seam identification clusters files into coherent sub-modules based on domain vocabulary and actual usage patterns.
- Compatibility planning designs re-export strategies to ensure the split doesn't break existing callers.
- Step-by-step sequencing generates an independently verifiable order of operations for merging changes safely.
How it works
- Repository discovery identifies the stack, workspace layout, and existing architectural constraints.
- Surface inspection uses
gitand optionalai-agent-contextCLI to map the module's public API and internal dependencies. - Design synthesis clusters files into new seams and validates them against repository layering rules.
- Strategy generation produces a detailed report covering inventory, consumer counts, and a phased migration order.
Frameworks & tools
Works with any language via git and standard file inspection. Enhanced analysis is available if ai-agent-context is present in the environment.
Why this beats prompting it yourself
Standard prompts often guess at boundaries and ignore the blast radius of moving exported symbols. This skill enforces a strict analysis phase using git grep and dependency mapping, ensuring your plan is based on hard evidence rather than LLM hallucinations about code structure.
Use cases
- Extracting a specific subsystem, like a scheduler, from a bloated billing module.
- Planning the migration of shared utilities into a dedicated workspace package.
- Decomposing a god module while maintaining backwards compatibility for all current importers.
- Validating a proposed architectural split against existing repository layering rules.
Known limitations
The skill performs planning only and never edits, moves, or renames files. It requires a manual design decision for final seams, as it treats grouping suggestions as hints rather than facts.
Planning only. Does not edit code or move files. Grouping suggestions are heuristics and require human design verification. CLI fallback reduces analysis depth for transitive impacts.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 28 days ago
Requires