Plan Refactor — Code Quality skill for Claude Code
Plan a behavior-preserving refactor in small, always-green steps.
How to install Plan Refactor
Installs to ~/.claude/commands/polewskm-project-template-plan-refactor.md
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/polewskm/project-template/HEAD/.claude/commands/plan-refactor.md -o ~/.claude/commands/polewskm-project-template-plan-refactor.md Restart Claude Code, or start a new session, for it to be picked up.
What Plan Refactor does
description: "Plan a behavior-preserving refactor in small, always-green steps" argument-hint: "[What to restructure and the target shape]" model: opus effort: high disable-model-invocation: true
Plan in a worktree of its own
Each plan lives in its own git worktree, so several Claude Code sessions can plan and execute different plans on this machine at once. Executing, re-planning and reviewing this plan later happen in the same worktree. Set it up before you read any code, so your r
Alternatives in Code Quality
- Refactor — We are about to refactor code 1.6k ★
- Refactor Claude Md — Refactor CLAUDE.md by extracting sections to dedicated docs with path-scoped rules 1.6k ★
- Repren — Power rename/refactor tool (now with Claude Code skill support 371 ★
Full documentation available on GitHub
View Source RepositoryRelated Skills
Cmd Refactor
Refactor phase (ACT loop): analyze, plan, baseline, execute, verify, and sync a behavior-preserving restructur
Agent Refactor Code
A strict brief that makes a coding agent refactor code without changing behavior, verifying nothing broke.
Symfony TDD Pest
Start a TDD workflow using Pest PHP for Symfony with RED-GREEN-REFACTOR cycle
Symfony TDD Phpunit
Start a TDD workflow using PHPUnit for Symfony with RED-GREEN-REFACTOR cycle
TDD Loop
Implement a feature using TDD (Red-Green-Refactor) for GarraRUST.
Refactor TDD
REFACTOR phase - Improve code quality while keeping tests green with automatic metrics tracking in sprintdag d
Related Agents
Sdlc Coder
Drives strict TDD (Red→Green→Refactor) implementation of one story file, in the target repository. Always load
Refactor Engineer
Behavior-preserving refactoring specialist. Hotspot repayment,
Code Quality Author
Use to FIX/refactor code to meet the quality standards — resolve clean-code, DRY, KISS violations with the sma