skills/large-file-refactor/SKILL.md
Discover large source-file refactor candidates and propose cohesion- and risk-driven split plans using available semantic tooling.
npx skillsauth add paulrberg/agent-skills large-file-refactorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use LOC thresholds to discover candidates, then decide whether a split is justified by cohesion, coupling, ownership, and change risk. Test files use a relaxed 2000 LOC discovery threshold.
path: Optional file or directory to scan. Default: current working directory.--include-generated: Include generated, vendored, dependency, and build-output paths that are skipped by default.Resolve the skill directory, then run the helper from that directory:
uv run scripts/large-file-refactor.py "$ARGUMENTS"
If no arguments were provided, run the default scan:
uv run scripts/large-file-refactor.py
Preserve the helper's Markdown table as the exhaustive report. Do not omit matching rows, even when the refactor plan only covers a subset.
If the helper reports no threshold matches, stop after the report. A match is a candidate, not proof that the file should be split.
Draft a refactor plan for the 3 largest files only, unless the user explicitly requested another count.
For each candidate, rank split value by mixed responsibilities, change frequency/risk, coupling, and testability. Use whichever semantic symbol/reference tooling is available; prefer Serena when installed:
Do not implement the refactor unless the user separately asks for execution.
For each selected file, include:
If a selected file is generated or vendored because --include-generated was used, plan against the generator, schema,
or upstream source instead of hand-splitting generated output.
tokei.Complete with the exhaustive threshold report plus evidence-ranked plans only for candidates whose cohesion or change risk justifies a split. State when a large file should remain intact and why.
development
Use when creating or substantially redesigning web interfaces, landing pages, dashboards, components, or other frontend UI where visual direction and implementation quality matter. Produces subject-specific art direction, accessible responsive code, and rendered visual verification.
development
Orchestrate one to five Sonnet subagents to implement an approved Claude Code plan.
tools
Open the CoinGecko historical-data page for a coin/date in Chromium via Chrome DevTools MCP.
tools
Orchestrate one to five Codex CLI agents to implement an approved Claude Code plan.