skills/mp-decompose/SKILL.md
Decompose large files into logical modules while preserving behavior. Use when: "decompose file", "split large file", "modularize this scope"
npx skillsauth add MartinoPolo/mpx-claude-code mp-decomposeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Split oversized files into logical modules. Keep functionality unchanged. Enforce DRY and clear organization. $ARGUMENTS
Parse $ARGUMENTS into explicit targets (files or folders).
Spawn one sub-agent per large-file unit.
Use this exact prompt shape for each unit:
You are decomposing one large file into multiple files/modules.
Goal:
- Split the target file into logical modules (constants, utils, types, hooks, context, components, services as applicable).
- Preserve behavior, naming conventions, and public API.
- Improve DRY and organization.
Input:
- Target unit: <file path>
- Allowed scope: <related module paths>
- Constraints: no feature changes, no behavior changes.
Required actions:
1) Identify extraction boundaries and module responsibilities.
2) Create multiple files/modules (not a single-file rewrite).
3) Move code into the new modules with clear names.
4) Update imports/exports and all references.
5) Remove dead code discovered during extraction.
6) Run targeted checks/tests for changed files when available.
Required output:
- New file tree for this unit
- Mapping of old sections -> new files
- Verification result (checks/tests or static verification)
- Residual risks (if any)
Subagent must fail fast if it cannot split into multiple modules safely.
Run targeted checks for touched areas.
Return per-unit summary:
Display:
tools
Show current project progress. Displays phase status and next steps. Use when: "show status", "project progress", "what's done"
data-ai
Unified project setup. Auto-detects state and orchestrates mpx skills/agents for init, conversion, or restructure.
testing
Track bugs/issues in .mpx/ phase system. Parses reports, finds related phases, adds fix tasks or creates bugfix phases. Use when: "track this bug", "add issue to project", "log this bug", "add bug to checklist"
development
Project workflow guidance for spec-driven development. Background knowledge auto-loaded when relevant.