No slash command · from refactoring-agent
Guides when to delegate refactoring analysis to the plan-refactor subagent vs. handle inline. Covers scope, prompt crafting, and anti-patterns.
Ships in refactoring-agent. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Delegate to the plan-refactor subagent (Agent tool, subagent_type: plan-refactor) when the user wants analysis of refactoring opportunities -- not execution. The subagent scans for code smells (duplication, long methods, complex conditionals, poor naming, magic values, dead code, tight coupling, data clumps) and returns a prioritized list under a strict 400-word budget.
For executing a specific refactoring, use refactor instead -- see how-to-refactor.
Delegate when:
Handle inline (do not delegate) when:
State the scope. The subagent's defaults handle priority and reporting format -- don't reproduce them.
Examples:
refactor subagent for execution.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub xdg/xdg-claude --plugin refactoring-agent4 skills in this plugin
/how-to-refactorWhen the user asks to refactor, restructure, extract, rename, simplify, or clean up code without changing behavior, consult this skill to decide whether to delegate to the refactor subagent and how to craft the prompt./plan-refactorAnalyze code and recommend refactoring opportunities/refactorImprove code quality without changing behavior via surgical refactoringOther plugins' skills for the same job