From refactor
Refactors files, directories, or code via semantic query. Defaults to recent git changes if no args. Launches agent for simplifications and reports changes with rollback info.
How this command is triggered — by the user, by Claude, or both
Slash command
/refactor:SKILL files-or-directories-or-semantic-queryrefactor/This command is limited to the following tools:
The summary Claude sees in its command listing — used to decide when to auto-load this command
# Refactor Command Execute automated refactoring for $ARGUMENTS using `refactor:code-simplifier` agent. ## Pre-operation Checks **Goal**: Ensure scope resolution is deterministic before launching the agent. **Actions**: 1. Run `git rev-parse --is-inside-work-tree` and continue even if false when explicit paths are provided 2. Normalize arguments by trimming whitespace and preserving quoted path segments 3. Treat an empty argument list as "recent changes" mode ## Phase 1: Determine Target Scope **Goal**: Identify files to refactor based on arguments or session context. **Actions**: 1. I...
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 filesSee 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 scopenpx claudepluginhub fradser/dotclaude --plugin refactor/sc-refactorPlans refactoring opportunities in code or executes specific behavior-preserving refactors like extract/rename/simplify, verifying with tests before/after.
/refactor-guidedPerforms safe incremental refactoring on target files directories or descriptions verifying tests at each step with git commits and reverts.
/SKILLResolves GitHub issue via isolated worktree, TDD workflow, and auto-closing PR creation.
/SKILLCreates conventional git commit from conversation intent using git-agent and pushes to remote. Accepts optional Claude model name for co-author.
/SKILLSurfaces current session task from state file, evaluates clarity (prompts for clarification if needed), assesses completion, and verifies if fully done.