implement-refactor

Coordinate end-to-end refactor implementation with characterization tests and transformation waves.

Updated Mar 22, 2026
One-click install
npx skills add https://github.com/Capataina/agent-skills --skill implement-refactor-capataina
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: implement-refactor
Source: https://github.com/Capataina/agent-skills/tree/main/implement-refactor
Command: npx skills add https://github.com/Capataina/agent-skills --skill implement-refactor-capataina

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Coordinates the full lifecycle of an architected refactor, ensuring behavior is preserved while transforming code end-to-end.

Core Features & Use Cases

  • Orchestrates characterization tests, transformation waves, reviews, and documentation.
  • Spawns specialized agents (test-writer, implementor, reviewer, fixer, documenter) to execute the plan safely.
  • Maintains a worktree-based workflow, progress tracking, and robust decision logging for auditable migrations.

Quick Start

Provide the refactor name as the argument and start the end-to-end implementation workflow.

Frequently Asked Questions about implement-refactor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely execute a large-scale code refactor without breaking existing behavior?

A safe code refactor requires an orchestrated workflow using characterization tests, isolated worktrees, and transformation waves. By validating tests and types after each wave, you preserve behavior while migrating code end-to-end.

What is a transformation wave in the context of architected refactoring?

A transformation wave is a dependency-aware scheduled phase of an architected refactor that applies code changes sequentially. Each wave is followed by test and type validation to ensure behavior is preserved during the migration.

How do I set up an isolated environment for automated code migration?

You set up an isolated environment for code migration by creating a worktree. This worktree-based workflow ensures refactors are executed safely away from the main branch while maintaining progress tracking and decision logging.

Can I automate test generation and documentation updates during a structured refactor?

Yes, you can automate test generation and documentation during a structured refactor by spawning specialized agents. A test-writer agent handles characterization tests while a documenter agent ensures key docs exist and produces a final summary.

When do I need dependency-aware scheduling for my code transformation?

You need dependency-aware scheduling for a code transformation when executing an architected refactor with multiple transformation waves. It coordinates the order of changes so behavior is preserved and validation runs successfully after each wave.

What are the limitations of orchestrating refactors with multiple agents?

Orchestrating refactors with multiple agents requires an existing plan with characterization, transformation waves, and reviews. It is limited to structured migrations where key docs exist and cannot safely handle unstructured code changes without dependency-aware scheduling.