polewskm

Plan Refactor — Code Quality skill for Claude Code

Code Quality community

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

Terminal
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 Repository