Discovers large source files (1000+ LOC, 2000+ for tests) and proposes split plans based on cohesion, coupling, and change risk. Runs a Python helper script to generate a candidate report, then drafts refactor plans for the largest files.
Ships in paulrberg-agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
This skill is coordination-exempt: skip the ai-coord gate for its declared work.
If a slash or dollar invocation already added these instructions to the conversation, follow them directly. In that case, do not invoke this skill again through a skill tool.
Use LOC thresholds to discover candidates, then decide whether a split is justified by cohesion, coupling, ownership, and change risk. Source files match above 1000 LOC. 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 the target repository:
uv run "<skill-dir>/scripts/large-file-refactor.py" [path] [--include-generated]
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. When Serena is installed, prefer it:
This workflow defaults to a report and plan. Implement only when the user's request already authorizes execution or the user subsequently approves it. Do not require a separate request for an unchanged, already authorized outcome.
For each selected file, include:
Lead each plan with one explicit verdict: ### ✂ Split justified, ### 🧱 Keep intact, or
### ⚠️ Generated — change the generator. Use a compact evidence table for repeated criteria. When proposing a split,
show the source and target modules as a tree only when it clarifies ownership.
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. Lead with ### 🔎 Large-file scan — <candidate count>, state when a large file should remain
intact and why, and surface the portable-LOC fallback as ⚠️ Approximate counts when used. Keep the helper's exhaustive
table, paths, LOC values, and commands exact and undecorated.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/paulrberg-agent-skills:large-file-refactor [path] [--include-generated]from paulrberg-agent-skills
paulrberg-agent-skills@cascade-code-general-misc-1 is listed by joshuarweaver/cascade-code-general-misc-1 — review the source before installing
npx claudepluginhub joshuarweaver/cascade-code-general-misc-1 --plugin paulrberg-agent-skills45 skills in this plugin
/agents-brainMaintain README.md, AGENTS.md/CLAUDE.md, skills, and repo context. Create, scaffold, or initialize AGENTS.md files and project-local agent skills. Use task evidence to delete obsolete skills, merge overlapping skills, and capture recurring workflows./agents-docsUse for current official documentation about Codex, Codex CLI, or Claude Code behavior, configuration, prompting, skills, permissions, tools, surfaces, capabilities, troubleshooting, hooks, app-server, or hook trust. Consult the relevant official source before answering./agents-introspectionUse local Codex/Claude Code transcripts to assess recurrence risk for agent behavior. Recommend durable fixes to AGENTS.md or skills from that evidence. Not for routine post-success skill-evolution or agent self-improvement reviews./ai-prunePrune agent scratch directories on macOS. Move clearly outdated `.ai/` files into `.ai/archive/YYYY-MM-DD/` and trash clearly outdated `.cache/` entries. Leave `.ai/todos` untouched./apple-device-integrationUse for device or simulator UI verification through Apple's Xcode MCP after UI changes or an explicit device check. Inspect screenshots and UI hierarchies, exercise controls, and report functional or visual defects./brainstorm-with-meBrainstorm with the user to generate, combine, and refine non-obvious ideas into a promising concept. Use when the user wants to brainstorm, ideate, explore possibilities, escape obvious approaches, or find a creative solution.Other plugins' skills for the same job