.agents/skills/code-refactoring-small/SKILL.md
Refactor overly large code units into smaller, more focused components. Use when code has grown too large or complex.
npx skillsauth add aspiers/ai-config code-refactoring-smallInstall 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.
Refactor overly large code you just added or extended into smaller, more focused components.
Use this skill when:
When adding new logic to an existing function, ALWAYS check whether the function is already long. If it is, extract a new method/function for the new logic rather than inlining it. Do NOT bloat existing functions further — refactoring is not a separate step to do later; it must happen at the time of writing.
This applies even when the new code is "just" 20-30 lines. Adding 30 lines to a 100-line function makes it a 130-line function that now needs refactoring. The correct approach is to never let it get that far.
Review your recent changes (committed or uncommitted) to find:
If the bloat is not obvious, ask the user to clarify which specific code units they want refactored before proceeding.
Once the bloat is identified:
After refactoring:
Break down large, complex code units into smaller, focused components that are:
Each function, class, or file should have a clear, single purpose.
development
Run tests according to repository guidelines. Use after linting passes, before staging changes.
development
Orchestrate the complete development workflow for implementing sub-tasks from a task list. Use for end-to-end feature implementation with quality controls.
development
Implement a single sub-task from a task list. Use when working on feature development with existing task lists.
data-ai
Generate a detailed task list from a PRP. Use after a PRP is created and ready for implementation planning.