/refactor:refactor [files-or-directories-or-semantic-query]from Refactor
Executes automated refactoring for specific files, directories, or semantic queries. Simplifies recently changed code and cleans up dead code in a limited scope.
Ships in Refactor. 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.
Read when SKILL.md points to them.
Execute automated refactoring for $ARGUMENTS using refactor:code-simplifier agent.
Goal: Ensure scope resolution is deterministic before launching the agent.
Actions:
git rev-parse --is-inside-work-tree and continue even if false when explicit paths are providedGoal: Identify files to refactor based on arguments or session context.
Actions:
git diff --name-only to find recently modified code filesCRITICAL: Never include node_modules/, .git/, dist/, build/, lock files, or compiled artifacts in refactoring scope — use Grep --glob exclusions to enforce.
See references/scope-determination.md for search strategies and edge cases.
Goal: Execute refactor:code-simplifier agent with aggressive mode enabled.
Actions:
refactor:code-simplifier agent with target scope and aggressive mode flagrefactor:best-practices skill and applies language-specific patternsSee references/agent-configuration.md for detailed Task parameters.
Goal: Report comprehensive summary of changes.
Actions:
git restore --worktree --staged <files>)See references/output-requirements.md for detailed summary format.
/refactor-project for project-wide scopeWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
refactoring, code-simplifier, dead-code, semantic-search, git-diff
3 skills in this plugin
/best-practicesLanguage-specific best practices, code quality standards, and framework detection rules. Use when executing refactoring workflows, applying code quality rules, detecting frameworks, or checking language-specific patterns for TypeScript, Python, Go, Swift, or React./refactor-projectExecutes automated project-wide refactoring with a focus on cross-file optimization. This skill should be used when the user asks for project-wide refactoring, cross-file simplification, consistency standardization across the codebase, duplication reduction, or invokes "/refactor-project".npx claudepluginhub fradser/dotclaude --plugin refactorOther plugins' skills for the same job