# Orchestrate Batch Refactor

Plan and execute large refactor or rewrite efforts efficiently with parallel...

- Repository: https://github.com/Dimillian/Skills (4021 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-03-29
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add Dimillian/Skills --skill orchestrate-batch-refactor -g -a claude-code -y`
Codex: `npx skills add Dimillian/Skills --skill orchestrate-batch-refactor -g -a codex -y`
Cursor: `npx skills add Dimillian/Skills --skill orchestrate-batch-refactor -g -a cursor -y`
Gemini CLI: `npx skills add Dimillian/Skills --skill orchestrate-batch-refactor -g -a gemini-cli -y`

## Description

Plan and execute large refactor or rewrite efforts efficiently with parallel multi-agent analysis and implementation. Use when a user asks to refactor many files, split workstreams, analyze a target code area, and coordinate sub-agents with clear ownership and dependency-aware execution.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Orchestrate Batch Refactor

## Overview

Use this skill to run high-throughput refactors safely.
Analyze scope in parallel, synthesize a single plan, then execute independent work packets with sub-agents.

## Inputs

- Repo path and target scope (paths, modules, or feature area)
- Goal type: refactor, rewrite, or hybrid
- Constraints: behavior parity, API stability, deadlines, test requirements

## When to Use Parallelization

- Use this skill for medium/large scope touching many files or subsystems.
- Skip multi-agent execution for tiny edits or highly coupled single-file work.

## Core Workflow

1. Define scope and success criteria.
   - List target paths/modules and non-goals.
   - State behavior constraints (for example: preserve external behavior).
2. Run parallel analysis first.
   - Split target scope into analysis lanes.
   - Spawn `explorer` sub-agents in parallel to analyze each lane.
   - Ask each agent for: intent map, coupling risks, candidate work packets, required validations.
3. Build one dependency-aware plan.
   - Merge explorer output into a single work graph.
   - Create work packets with clear file ownership and validation commands.
   - Sequence packets by dependency level; run only independent packets in parallel.
4. Execute with worker agents.
   - Spawn one `worker` per independent packet.
   - Assign explicit ownership (files/responsibility).
   - Instruct every worker that they are not alone in the codebase and must ignore unrelated edits.
5. Integrate and verify.
   - Review packet outputs, resolve overlaps, and run validation gates.
   - Run targeted tests per packet, then broader suite for integrated scope.
6. Report and close.
   - Summarize packet outcomes, key refactors, conflicts resolved, and residual risks.

## Work Packet Rules

The rest: https://github.com/Dimillian/Skills/blob/HEAD/orchestrate-batch-refactor/SKILL.md
