decompose-file

Decompose large source files into smaller modules with dependency mapping.

175|26|Updated Aug 14, 2025
One-click install
npx skills add https://github.com/jmagly/aiwg --skill decompose-file-jmagly
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: decompose-file
Source: https://github.com/jmagly/aiwg/tree/main/agentic/code/frameworks/sdlc-complete/skills/decompose-file
Command: npx skills add https://github.com/jmagly/aiwg --skill decompose-file-jmagly

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the challenge of overly large source code files that hinder maintainability, readability, and developer productivity by providing a structured approach to breaking them down.

Core Features & Use Cases

  • Automated Code Decomposition: Analyzes source files, identifies logical sections, and proposes a plan to split them into smaller, more manageable modules.
  • Dependency Mapping & Verification: Maps internal dependencies between proposed modules and verifies that no circular dependencies are introduced.
  • Automated Refactoring: Optionally executes the decomposition plan, creates new files, updates import statements across the codebase, and runs tests to ensure integrity.
  • Use Case: When a single TypeScript file in your project grows to over 800 lines, this skill can automatically split it into several smaller files, each focusing on a specific responsibility, and update all references accordingly.

Quick Start

Decompose the file src/extensions/registry.ts into smaller modules.

Frequently Asked Questions about decompose-file

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

FAQPage Schema
How do I split a large source code file into smaller modules?

Code decomposition analyzes large source files using language-specific parsing strategies to identify logical sections, maps internal dependencies, proposes a split plan, and optionally executes the refactoring with import updates.

What programming languages are supported for automated code decomposition?

Automated code decomposition handles TypeScript, JavaScript, Python, Go, Rust, and Java by using AST parsing strategies or fallback heuristics to analyze and split large files.

When should I refactor a large file into manageable modules?

You should refactor a large file into manageable modules when it hinders maintainability, readability, and developer productivity, such as when a single TypeScript file grows to over 800 lines.

Does code decomposition verify dependencies and run tests after splitting?

Yes, code decomposition maps internal dependencies between proposed modules, verifies that no circular dependencies are introduced, updates import statements across the codebase, and runs tests to ensure integrity.

What is the best way to break down a large TypeScript file without breaking imports?

The best way to break down a large TypeScript file is to use automated refactoring that proposes a split plan, creates new files focusing on specific responsibilities, and automatically updates all import references accordingly.

Are there limitations when using AST parsing for codebase maintenance?

Code decomposition relies on AST parsing for supported languages but uses fallback strategies when AST parsing is unavailable, meaning complex or unsupported syntax might not decompose as precisely as standard code.