optimize_codebase

Identify monolithic source files and propose modularization plans with per-file directories.

41|10|Updated Jan 24, 2026
One-click install
npx skills add https://github.com/krishnakanthb13/antigravity_global_skills --skill optimize-codebase-krishnakanthb13
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: optimize_codebase
Source: https://github.com/krishnakanthb13/antigravity_global_skills/tree/main/optimize_codebase
Command: npx skills add https://github.com/krishnakanthb13/antigravity_global_skills --skill optimize-codebase-krishnakanthb13

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Identifies and refactors monolithic files (>2k lines) into modular, performance-safe component structures to improve maintainability and scalability.

Core Features & Use Cases

  • Detect oversized source files across languages (HTML, Python, JavaScript, etc.) that exceed the 2000-line threshold.
  • Propose a reusable modular plan (new directory per monolithic file, index entry points, and clear module boundaries) while preserving existing behavior.
  • Provide a step-by-step refactor workflow including analysis, plan, execution, and verification to mitigate risks.

Quick Start

Analyze a target codebase to identify monolithic files and generate a modular split plan for each.

Frequently Asked Questions about optimize_codebase

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

FAQPage Schema
How do I refactor a monolithic file into modular components?

To refactor monolithic files, you analyze the codebase to identify oversized source files and generate a modular split plan that creates new directories, index entry points, and clear module boundaries. This workflow preserves existing behavior while improving maintainability.

How do I split large codebase files without breaking existing behavior?

Splitting large codebase files safely requires a step-by-step refactor workflow including analysis, plan generation, execution, and verification. This approach creates per-file directories and index entry points to modularize code while strictly preserving existing behavior.

What is the threshold for identifying monolithic source files that need modularization?

The threshold for identifying monolithic source files is any source file exceeding 2000 lines. Files surpassing this limit are targeted for modularization to improve codebase maintainability and establish a scalable architecture.

Does this modularization approach work with both HTML and Python codebases?

Yes, this modularization approach works across multiple languages including HTML, Python, and JavaScript. It detects oversized source files regardless of language and proposes a reusable modular plan with index entry points to improve maintainability.

What is the best way to improve maintainability in a monolithic codebase?

The best way to improve maintainability in a monolithic codebase is to refactor oversized files into modular component structures. By generating per-file directories and clear module boundaries, the codebase achieves better maintainability and a scalable architecture.

When should I avoid breaking down big files into modular components?

You should avoid breaking down big files if they do not exceed the 2000-line threshold or if the codebase lacks proper verification steps. Modularization is designed for oversized files where preserving behavior can be guaranteed through a structured refactor workflow.