Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
parcadei avatar

Refactor

  • 586 installs
  • 3.9k repo stars
  • Updated January 26, 2026
  • parcadei/continuous-claude-v3

refactor is a multi-gate code refactoring workflow that analyzes, plans, implements, reviews, and validates rewrites until quality, style, and performance targets are met for developers reducing technical debt.

About

refactor is a parcadei/continuous-claude-v3 skill implementing a safe refactoring pipeline: phoenix analysis, plan-agent planning, kraken implementation, plan-reviewer checks, and arbiter validation. It triggers on requests like refactor X, clean up this code, extract a module, or improve architecture across large-scale restructures. Review gates block sloppy merges so style, performance, and structural goals stay explicit. Developers reach for refactor when a change spans many files, needs an auditable plan before edits, or must pass automated review between implementation passes—not for one-line typo fixes.

  • Continuous agent loop that reads current code, proposes improvements, applies changes, and repeats until convergence.
  • Configurable quality gates based on style, performance, test coverage and architecture rules.
  • Works with any existing codebase without requiring upfront prompts or manual oversight.
  • Reduces context-window waste by letting the agent manage its own multi-turn improvement cycle.

Refactor by the numbers

  • 586 all-time installs (skills.sh)
  • +12 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #1,605 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/parcadei/continuous-claude-v3 --skill refactor

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs586
repo stars3.9k
Last updatedJanuary 26, 2026
Repositoryparcadei/continuous-claude-v3

How do you safely refactor large codebases with agents?

Let Claude continuously read, critique, and rewrite code until quality, style, and performance targets are met.

Who is it for?

Developers restructuring multi-file codebases who want gated analyze-plan-implement-review-validate agent workflows.

Skip if: Developers making single-line fixes or changes that do not need formal refactoring plans and review gates.

When should I use this skill?

User says refactor, clean up this code, extract into a module, improve architecture, or reduce technical debt at scale.

What you get

Refactored modules, review-gated implementation plan, and validation report

  • Refactoring plan
  • Implemented code changes
  • Review and validation report

By the numbers

  • 5 workflow stages with review gates between implementation and validation

Files

SKILL.mdMarkdownGitHub ↗

/refactor - Refactoring Workflow

Safe refactoring with review gates.

When to Use

  • "Refactor X"
  • "Clean up this code"
  • "Extract this into a module"
  • "Improve the architecture of Y"
  • Large-scale code restructuring
  • Technical debt reduction

Workflow Overview

┌──────────┐    ┌────────────┐    ┌──────────┐    ┌──────────┐    ┌───────────┐
│ phoenix  │───▶│   plan-    │───▶│  kraken  │───▶│plan-reviewer│───▶│ arbiter  │
│          │    │   agent    │    │          │    │          │    │           │
└──────────┘    └────────────┘    └──────────┘    └──────────┘    └───────────┘
  Analyze         Plan             Implement       Review          Verify
  current         changes          refactor        changes         tests pass

Agent Sequence

#AgentRoleOutput
1phoenixAnalyze current code, identify improvement areasAnalysis report
2plan-agentCreate safe refactoring planStep-by-step plan
3krakenImplement the refactoringCode changes
4plan-reviewerReview changes for correctnessReview report
5arbiterVerify all tests still passTest report

Refactoring Principles

1. Tests first: Ensure adequate test coverage before refactoring 2. Small steps: Each change should be independently verifiable 3. Behavior preserved: No functional changes during refactor 4. Reviewable: Changes should be easy to review

Execution

Phase 1: Analyze

Task(
  subagent_type="phoenix",
  prompt="""
  Analyze for refactoring: [TARGET_CODE]

  Identify:
  - Current pain points
  - Code smells
  - Improvement opportunities
  - Risk areas
  - Test coverage gaps
  """
)

Phase 2: Plan

Task(
  subagent_type="plan-agent",
  prompt="""
  Plan refactoring: [TARGET_CODE]

  Analysis: [from phoenix]

  Create:
  - Step-by-step refactoring plan
  - Each step should be:
    - Small and focused
    - Independently testable
    - Reversible
  - Identify files affected
  - Risk mitigation strategy
  """
)

Phase 3: Implement

Task(
  subagent_type="kraken",
  prompt="""
  Implement refactoring: [TARGET_CODE]

  Plan: [from plan-agent]

  Requirements:
  - Follow plan exactly
  - Run tests after each step
  - Stop if tests fail
  - NO behavior changes
  """
)

Phase 4: Review

Task(
  subagent_type="plan-reviewer",
  prompt="""
  Review refactoring: [TARGET_CODE]

  Changes: [git diff from kraken]

  Check:
  - Behavior preserved
  - No unintended changes
  - Code quality improved
  - Patterns consistent
  """
)

Phase 5: Validate

Task(
  subagent_type="arbiter",
  prompt="""
  Validate refactoring: [TARGET_CODE]

  - Run full test suite
  - Verify no regressions
  - Check type errors
  - Run linting
  """
)

Refactoring Types

Extract Module

phoenix → plan-agent → kraken → plan-reviewer → arbiter

Rename/Restructure

phoenix → kraken → arbiter  (simpler, skip detailed planning)

Architecture Change

phoenix → plan-agent → [kraken → plan-reviewer] × N phases → arbiter

Example

User: /refactor Extract the validation logic into a separate module

Claude: Starting /refactor workflow...

Phase 1: Analyzing current structure...
[Spawns phoenix]
Found: Validation logic spread across 4 files
- form.ts (lines 45-120)
- api.ts (lines 200-280)
- user.ts (lines 15-45)
- order.ts (lines 88-130)

Phase 2: Planning extraction...
[Spawns plan-agent]
Plan:
1. Create src/validation/index.ts
2. Extract common validators
3. Update imports one file at a time
4. Run tests after each change

Phase 3: Implementing...
[Spawns kraken]
Completed all 4 steps, tests green after each

Phase 4: Reviewing changes...
[Spawns plan-reviewer]
✅ All behavior preserved
✅ DRY improved (removed 45 duplicate lines)
✅ New structure consistent

Phase 5: Final validation...
[Spawns arbiter]
✅ 312 tests passing, 0 regressions

Refactoring complete!

Safety Flags

  • --dry-run: Plan but don't implement
  • --step-by-step: Pause after each change for approval
  • --coverage-check: Require >80% coverage before proceeding

Related skills

How it compares

Pick refactor over ad-hoc edit prompts when multi-file changes need explicit plans and review gates before merge.

FAQ

What stages does refactor run?

refactor runs phoenix analysis, plan-agent planning, kraken implementation, plan-reviewer checks, and arbiter validation. Each stage gates the next so large refactors get an auditable plan and review before code lands.

When should developers use refactor?

Developers should use refactor for large-scale restructuring, module extraction, architecture cleanup, and technical debt reduction. Single-line edits do not need the full five-stage continuous-claude-v3 pipeline.

AI & Agent Buildingagentsautomation

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.