Find god files and separate mixed responsibilities into cohesive, independently understandable units. Use when reviewing oversized files, tangled modules, smart and dumb component boundaries, logic mixed with rendering, or code that changes for unrelated reasons.
87%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Split code when one unit owns several jobs that change for different reasons. Do not split merely to reduce a line count.
A good boundary leaves both sides understandable on their own.
A god file is defined by mixed responsibilities and tangled change paths, not size alone. A cohesive 300-line module can be healthier than five 60-line files that must all be opened together.
Look for files or components that combine several of these:
Other signals include imports from unrelated layers, several clusters of state that never interact, distant sections that change for different features, and tests that require unrelated setup.
Before splitting, describe each proposed unit in one concrete sentence. Vague descriptions such as “helpers” or “miscellaneous logic” expose a weak boundary.
Separate presentation when it has a clear contract: data and callbacks in, rendered output out, with no knowledge of fetching, storage, or workflow state. This creates a dumb component that can be understood, tested, and reused independently.
Keep logic and rendering together when each is meaningless without the other. A render file with a large prop surface shaped entirely by a neighboring controller is not dumb; it is half a component with extra navigation.
Good separations often look like:
Avoid moving code into files without reducing what a reader must understand. Relocation is not decomposition.
Group code that shares invariants and usually changes together. Separate code that has a stable interface and changes independently. Keep locally owned types, constants, and tests beside their owner; move them outward only when several units genuinely share them.
Prefer direct imports for internal modules. Use a barrel only when it defines a real public package boundary.
Identify responsibilities and their dependencies before moving anything. Extract the clearest self-contained unit first, preserve its behavior behind a narrow interface, then reassess the remainder. Stop when another split would create fragments that require cross-reading.
If asked to look or review, report boundaries without editing. If asked to refactor or fix, preserve behavior and run the relevant checks after each coherent extraction.
Report each mixed-responsibility unit, the responsibilities it contains, the proposed boundary, and why each resulting piece stands alone. Note large files deliberately left intact because they remain cohesive.
mcclowes/skills
bb3f5f1
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.