/dev-workflow:refactorfrom dev-workflow
Runs multi-round iterative refactoring on changed files: structural (DRY, extraction), readability (naming, nesting), and convention compliance. Generates a before/after report.
Ships in dev-workflow. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Run iterative refactoring on files changed in $ARGUMENTS (or the current branch if no arguments are provided).
CRITICAL: Refactoring is NOT a one-pass process. You MUST execute at minimum 3 separate rounds. Do NOT combine rounds or skip ahead. After completing Round 3, evaluate if more rounds are needed and continue until no improvements remain.
Round 1: Structural improvements (DRY, method extraction)
↓ run tests + lint → verify
Round 2: Readability (naming, nesting reduction)
↓ run tests + lint → verify
Round 3: Convention compliance (patterns, best practices)
↓ run tests + lint → verify
Round N: Continue if improvements remain
Detect the base branch automatically:
git remote show origin → check HEAD branchmain, master, or develop branchesgit branch --show-current
git diff --name-only {base_branch}...HEAD
git diff {base_branch}...HEAD
Important: Refactor source code and related test code together. If no related tests exist, refactor source only and note the missing test coverage.
Auto-detect the project's test and lint commands from configuration files. If undetectable, ask the user.
Read project conventions from CLAUDE.md and AGENTS.md if present.
Operationalize this round with the concrete checks automated reviewers (e.g. GitHub Copilot) flag most often — don't leave it at "follow conventions":
status.guest? not status.to_sym == :guest;
Model.column.value not "value"; reuse an enum member, not a string).See refs/patterns.md "Convention Patterns" for before/after examples.
Continue iterating until ALL of the following are satisfied:
Refactoring is behavior-preserving, so do NOT fix logic bugs here. But while reading the
code you will often notice the exact issues an automated PR reviewer would flag — a
nullable column dereferenced without Array(), a find_or_create_by! with no race
handling, a Time.current where a day boundary is meant, a half-open range missing its
upper bound, a new filter column with no index, unescaped HTML. Collect these in a
"Needs review (not refactored)" list in the report and hand them to /code-review
instead of dropping them. Catching them now is what keeps them out of the PR comments.
Each entry on that list must clear the same bar a reported finding does
(../code-review/refs/finding-bar.md): located
(file:line), confident (only what you can defend by pointing at the code — no
"might be"), and material. Do not pad the list with speculative smells; an entry with
no line and no concrete why is noise, not a hand-off.
After completion, generate a report following the format in refs/report-template.md.
/code-review for quality review/pr-summary for PR descriptionWhat SKILL.md sets; muted values are Claude Code's defaults
maxThree short reads, in order
npx claudepluginhub kzytateishi/spikeee-plugins-marketplace --plugin dev-workflow6 skills in this plugin
/code-reviewRun a comprehensive code review using available AI tools in parallel. Analyzes architecture, code quality, security, and test coverage. Dynamically detects and leverages available MCP servers for multi-perspective review. Use after implementation or refactoring, before creating a PR.
/dev-workflowRun the full development workflow end-to-end: specify → implement → refactor → code-review → pr-summary. Pauses after specify for user confirmation before proceeding. Pass a feature description to start from specification, or a feature name to resume from implementation.
/implementStart implementation based on a specification document (order.md). Processes tasks from todo.md sequentially. Supports TDD (Red-Green-Refactor) or standard implementation workflow. Auto-detects project's test framework, lint tools, and coding conventions. Use after /specify.