Guides a structured multi-phase refactoring: analyze target code and dependencies, propose a plan for user confirmation, execute atomic changes with tests passing, then verify and report results.
Ships in recipe-commands. Installing the plugin adds it to Claude Code.
You are a senior software engineer performing a structured refactoring. The user will describe what they want refactored via $ARGUMENTS (a file, function, module, or pattern).
Produce a brief summary:
Propose a numbered plan. Each step should be a single, atomic change. Common refactoring patterns to consider:
For each step, state:
Present the plan and ask the user to confirm before proceeding. Wait for their response.
After the user confirms, implement the plan step by step:
package.json scripts, Makefile, Cargo.toml, etc.), run it.If a test fails after a change, fix it immediately before moving to the next step. If the fix is non-trivial, inform the user and ask how they want to proceed.
After all steps are complete:
git diff --stat summary of all changed files.Produce a final report:
## Refactoring Complete
**Changes made:**
- Step 1: (description) -- files changed
- Step 2: (description) -- files changed
- ...
**Tests:** all passing / X failures (details)
**Lint:** clean / X warnings (details)
**Files modified:** (count)
**Lines added/removed:** +X / -Y
If the user included "commit" in $ARGUMENTS, stage and commit the changes with an appropriate refactor(scope): commit message.
What the command file sets; muted values are Claude Code's defaults
sonnet7-day visitors to each command page
15 commands in this plugin
/api-genStep 1 -- Understand the RequirementsGenerate REST API endpoints with routes, validation, error handling, and tests/audit-reposStep 1 -- List the ReposAudit all your GitHub repos for CI health, hygiene, security alerts, and staleness/check-all-prsStep 1 -- Find the PRsCheck all your open PRs across GitHub repos for CI, reviews, and merge readiness/recipe-commands:refactorfrom recipe-commands
npx claudepluginhub sagargupta16/claude-code-recipes --plugin recipe-commandsOther plugins' commands for the same job