Skip to content
Back to skills

Split File

ASecurity

Break a large file into focused modules without changing behavior

  • 3 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 3, 2026
ai-agentsgorefactoring

Security analysis

A100/100

Scanned September 3, 2026

npx -y skills add black141312/ada --skill split-file --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Split File?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Split File
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/black141312-split-file/badge)](https://www.skillsdirectory.com/skills/black141312-split-file)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: split-file
description: Break a large file into focused modules without changing behavior
category: refactoring
---

# Split File

Use when a file has grown to mix several responsibilities and is hard to navigate or test. Split along seams that already exist, not arbitrary line counts.

1. Map the file's contents into groups by responsibility (types, helpers, one cohesive feature each).
2. Identify the dependency direction between groups so new modules don't create import cycles.
3. Move one group at a time into a new module, keeping names intact to minimize churn.
4. Add imports/exports; update every external reference to point at the new location.
5. Optionally keep the original file as a thin barrel that re-exports, to avoid touching many call sites at once.
6. Build and run tests after each move; commit per extracted module.

## Rules
- Split by responsibility, not by size — a 600-line file with one clear job may be fine as is.
- Watch for circular imports; if two new modules need each other, the seam is wrong — extract shared parts to a third.
- Keep public exports stable, or update all importers in the same change.
- Don't relocate code and edit its logic in the same step; move first, then refactor.
- Preserve file-level side effects (registration, init order) — moving them can change runtime behavior.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.