modularize

Analyze monolithic codebases and produce prioritized refactoring plans.

2|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/jscott3201/ai-agent-skills --skill modularize
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: modularize
Source: https://github.com/jscott3201/ai-agent-skills/tree/main/skills/modularize
Command: npx skills add https://github.com/jscott3201/ai-agent-skills --skill modularize

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Large, monolithic files and tangled module boundaries make code hard to maintain, reason about, and scale. This Skill analyzes structural issues, identifies splitting candidates, detects circular dependencies, and produces a stepwise, verifiable plan to reorganize a codebase into clear modules or packages while minimizing disruption.

Core Features & Use Cases

  • Structural analysis: Detects file size violations, complexity hotspots, god classes, coupling patterns, and circular dependency chains across Rust, Python, and JS/TS projects.
  • Prioritized triage and planning: Filters findings by aggressiveness, ranks P1–P3 issues, collects user decisions, and produces incremental refactoring steps that compile and pass verification at each commit.
  • Execution guidance and verification: Provides language-specific patterns, verification commands (cargo check, tsc --noEmit, ruff, pytest), and checks public API stability after changes.
  • Uses: Split a 1000-line module into focused packages, remove barrel files and import cycles in a TypeScript app, or extract crates and compose structs in a Rust workspace.

Quick Start

Ask the modularize skill to analyze the src directory with moderate aggressiveness and produce a prioritized, verifiable refactoring plan.

Frequently Asked Questions about modularize

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

FAQPage Schema
How do I refactor a monolithic codebase into maintainable modules?

To refactor a monolithic codebase into maintainable modules, structural analysis detects file size violations, complexity hotspots, and circular dependencies, then produces prioritized, incremental refactoring steps that pass verification at each commit.

What is the best way to resolve circular dependencies in a TypeScript application?

Resolving circular dependencies in a TypeScript application involves detecting import cycles and barrel files during structural analysis, then applying incremental refactoring steps to reorganize module boundaries and verify changes using tsc --noEmit.

Can I split a large Rust module into separate crates and packages?

Yes, you can split a large Rust module into separate crates by applying structural analysis to identify extraction candidates, composing structs, and verifying public API stability using cargo check after each incremental refactoring step.

Does this modularization approach work with Python projects?

This modularization approach works with Python projects by analyzing structural issues, detecting coupling patterns, and providing verification commands like ruff and pytest to ensure incremental refactoring steps compile and pass tests.

How do I plan codebase refactoring without breaking existing functionality?

Planning codebase refactoring without breaking functionality requires generating prioritized, incremental refactoring steps that execute sequentially, checking public API stability and running language-specific verification commands after each change.

Why does my monolithic codebase need structural analysis before refactoring?

Monolithic codebases need structural analysis before refactoring to identify complexity hotspots, god classes, and coupling patterns, ensuring that file splitting and visibility tightening are prioritized effectively to minimize disruption.