large-file-splitter

Split oversized source files into folder-based modules with an index entrypoint.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/ai212983/gh-csi --skill large-file-splitter
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: large-file-splitter
Source: https://github.com/ai212983/gh-csi/tree/main/.agents/skills/large-file-splitter
Command: npx skills add https://github.com/ai212983/gh-csi --skill large-file-splitter

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Split oversized files into cohesive modules, reducing monolithic code and enabling focused maintenance.

Core Features & Use Cases

  • Identify natural boundaries within large files and organize code into a folder-based module system (e.g., file.ts -> folder/file/index.ts and related modules).
  • Create a dedicated folder named after the original file with index as the entrypoint, move sections into focused modules, and update imports/exports to maintain API compatibility.
  • Avoid circular dependencies and preserve references while enabling easier testing and incremental refactoring.

Quick Start

Split the current oversized file into a folder-based modular structure with an index entrypoint and update dependent imports.

Frequently Asked Questions about large-file-splitter

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

FAQPage Schema
How do I split a large file into a modular folder structure?

To split a large file into a modular folder structure, this tool identifies natural boundaries within the code, moving sections into focused modules under a dedicated folder named after the original file, with an index entrypoint preserving the public API surface.

When should I refactor source code into separate modules?

You should refactor source code into separate modules when a single file exceeds 500 lines or grows past that threshold in the current session, creating monolithic code that requires focused maintenance and easier incremental testing.

Does file modularization preserve existing imports and exports?

Yes, file modularization preserves existing imports and exports by updating relative paths and maintaining API compatibility, ensuring that references remain intact while avoiding circular dependencies throughout the refactoring process.

What is the best way to refactor oversized files without breaking dependencies?

The best way to refactor oversized files without breaking dependencies is using an automated folder-first layout that updates imports and exports, preserves the public API surface, and specifically avoids circular dependencies across the newly created modules.

Can I automatically split newly created large files during a session?

Yes, you can automatically split newly created large files during a session, as the tool applies to any file type that exceeds the 500-line threshold in the current session, triggering optional automatic modularization.