/workflow-orchestration-plugin:workflow-checkpoint-refactor --init to create plan, --continue to resume, --status to check progressfrom workflow-orchestration-plugin
Multi-phase refactoring with checkpoint files that survive context limits. Use when refactoring spans 10+ files, needs phased rollout, or risks running out of context mid-session.
Ships in workflow-orchestration-plugin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Multi-phase refactoring with persistent state that survives context limits and session boundaries.
| Use this skill when... | Use direct refactoring instead when... |
|---|---|
| Refactoring spans 10+ files | Changing 1-5 files |
| Work will exceed context limits | Small, focused change |
| Need to resume across sessions | Single-session task |
| Multiple dependent phases | Independent file changes |
| Team coordination on large refactor | Solo quick fix |
git rev-parse --show-toplevelfind . -maxdepth 1 -name REFACTOR_PLAN.mdgit status --porcelaingit log --oneline --max-count=5--init: Create a new refactoring plan interactively--continue: Resume from the last completed phase--status: Show current plan progress--phase=N: Execute a specific phaseThe plan file (REFACTOR_PLAN.md) serves as persistent state. It is the loop's
compact state packet (.claude/rules/loop-integrity.md): a fresh session,
or a sub-agent with no memory of prior phases, must be able to re-enter from this
file alone. Every phase therefore carries not just what to do but what was
verified, what changed, and what must come first — and the plan names the
phase the last run chose next. Without those, resuming across a context limit
silently redoes or undoes work, or re-derives the order from the transcript.
# Refactor Plan: {description}
Created: {date}
Last updated: {date}
Base commit: {hash}
Exit condition: {the literal criterion that ends the whole refactor — e.g. "all phases done, full suite + tsc green on base"}
Next target: {the phase the last run chose to do next, and why — set before a run ends}
## Overview
{What is being refactored and why}
## Phase 1: {phase name}
- **Status**: done | in-progress | pending | needs-review
- **Files**: file1.ts, file2.ts, file3.ts
- **Description**: {what this phase does}
- **Ordering / preconditions**: {what must hold before this phase starts — e.g. "none (first phase)"; keep it to a line or two}
- **Acceptance criteria**: {how to verify success — the phase's exit condition}
- **Verifier result**: {what the independent check returned — PASS/FAIL + the criterion it judged; filled in at the phase boundary}
- **Changed since last run**: {what this phase actually touched, so a successor doesn't redo or undo it}
- **Result**: {summary of changes made, filled in after completion}
## Phase 2: {phase name}
- **Status**: pending
- **Files**: file4.ts, file5.ts
- **Description**: {what this phase does}
- **Ordering / preconditions**: {e.g. "after Phase 1 — uses its shared types"}
- **Acceptance criteria**: {how to verify success}
- **Verifier result**: {empty until verified}
- **Changed since last run**: {empty until completed}
- **Result**: {empty until completed}
...
Execute this multi-phase refactoring workflow:
If --init flag provided:
REFACTOR_PLAN.md at repo rootgit log --format='%H' -1Phase ordering: Shared utilities/types first, leaf components last, tests alongside implementation.
If --continue flag provided:
REFACTOR_PLAN.mdpending or needs-review)done); if one does not, work the unmet precondition insteadIf --status flag provided:
REFACTOR_PLAN.mdFor each phase:
needs-review with error detailsWIP: prefixdone on an independent verifier when the
acceptance criteria are a judgement (e.g. "the class is now single-purpose"),
not a purely mechanical check (a green suite / clean tsc is already
independent — a failing test does not care how hard you worked):
Task sub-agent that reads only this phase's
acceptance criteria and the resulting diff — not the worker's reasoning —
and judges whether the criteria are met. The worker is biased toward
declaring completion; the loop's stop condition must come from outside it
(.claude/rules/loop-integrity.md, Pillar 1). When the criteria are about
behaviour ("endpoint returns X", "the bug no longer reproduces"),
delegate this to agent-patterns-plugin:execution-grounded-review, which
runs the suite first and grounds each criterion in execution evidence
rather than appearance.in-progress/needs-review
and address the gap before marking done.done, fill Verifier
result, Changed since last run, and Result, set the plan's
Next target, then commit:
git add -u && git commit -m "refactor phase N: {description}"--continueFor phases with 7+ files, delegate to Task sub-agent with:
needs-review with error details| Situation | Action |
|---|---|
| Context limit hit mid-phase | Start new session, run --continue |
| Phase marked needs-review | Read plan for details, fix issues, run --phase=N |
| Tests broken after a phase | Revert phase commit, investigate, re-execute |
| Plan needs adjustment | Edit REFACTOR_PLAN.md directly, update phases |
| Base branch moved | Rebase onto new base, re-validate completed phases |
| Context | Command |
|---|---|
| Check plan exists | test -f REFACTOR_PLAN.md && echo "exists" |
| Quick typecheck | npx tsc --noEmit --pretty 2>&1 | head -20 |
| Quick test | npm test -- --bail=1 2>&1 | tail -20 |
| Phase commit | git commit -m "refactor phase N: description" |
| Verify working state | npx tsc --noEmit && npm test -- --bail=1 |
| Show plan phases | grep "^## Phase" REFACTOR_PLAN.md |
| Show phase status | grep -A1 "^## Phase" REFACTOR_PLAN.md | grep Status |
| Operation | Command |
|---|---|
| Init new refactor | /workflow:checkpoint-refactor --init |
| Check progress | /workflow:checkpoint-refactor --status |
| Resume work | /workflow:checkpoint-refactor --continue |
| Run specific phase | /workflow:checkpoint-refactor --phase=3 |
| Manual plan edit | Edit REFACTOR_PLAN.md directly |
.claude/rules/loop-integrity.md - Why the plan file is a state packet and why done is judged independentlyWhat SKILL.md sets; muted values are Claude Code's defaults
8 skills in this plugin
/workflow-bake-offWorkflow template for a bake-off — 2–5 independent attempts, lens judges, a winner computed by Borda or a metric rule, then refine. Use when comparing competing designs or running A/B arms./workflow-implement-verifyWorkflow templates that implement 2–5 units in worktrees with a fresh verifier and one repair round, or close findings on existing branches. Use when fanning out implementers or repairs./workflow-interrupted-run-recoveryRecover a Workflow run killed mid-flight: salvage killed agents' worktrees, resume without duplicating PRs already opened. Use when a run reports agents_error after a session limit, kill, or crash./workflow-preflightPre-work validation before implementation. Use when starting an issue or fix, or before fanning out agents, to check remote state, existing PRs, branch conflicts, gh auth, and merge gates./workflow-scale-budgetSize a Workflow script's agent count before running it, or tally a finished run's agents and tokens. Use when authoring or proposing a Workflow fan-out, or asking what a run used./workflow-verify-before-filingVerify accumulated bug claims at upstream HEAD and dedup against trackers before filing issues. Use when filing upstream reports from backlogs, audit docs, or git-history findings.npx claudepluginhub laurigates/claude-plugins --plugin workflow-orchestration-pluginOther plugins' skills for the same job