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.
When to Use
- When a refactor spans many files or subsystems and needs clear work partitioning.
- When you need dependency-aware planning before parallel implementation.
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
- Define scope and success criteria.
- List target paths/modules and non-goals.
- State behavior constraints (for example: preserve external behavior).
- 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.
- 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.
- 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.
- Integrate and verify.
- Review packet outputs, resolve overlaps, and run validation gates.
- Run targeted tests per packet, then broader suite for integrated scope.
- Report and close.
- Summarize packet outcomes, key refactors, conflicts resolved, and residual risks.
Work Packet Rules
- One owner per file per execution wave.
- No parallel edits on overlapping file sets.
- Keep packet goals narrow and measurable.
- Include explicit done criteria and required checks.
- Prefer behavior-preserving refactors unless user explicitly requests behavior change.
Planning Contract
Every packet must include:
- Packet ID and objective.
- Owned files.
- Dependencies (none or packet IDs).
- Risks and invariants to preserve.
- Required checks.
- Integration notes for main thread.
Use references/work-packet-template.md for the exact shape.
Agent Prompting Contract
- Use the prompt templates in
references/agent-prompt-templates.md.
- Explorer prompts focus on analysis and decomposition.
- Worker prompts focus on implementation and validation with strict ownership boundaries.
Safety Guardrails
- Do not start worker execution before plan synthesis is complete.
- Do not parallelize across unresolved dependencies.
- Do not claim completion if any required packet check fails.
- Stop and re-plan when packet boundaries cause repeated merge conflicts.
Validation Strategy
Run in this order:
- Packet-level checks (fast and scoped).
- Cross-packet integration checks.
- Full project safety checks when scope is broad.
Prefer fast feedback loops, but never skip required behavior checks.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
1---
2name: orchestrate-batch-refactor
3description: "Plan and execute large refactors with dependency-aware work packets and parallel analysis."
4version: 1.0.0
5author:
6 name: "sickn33 / Antigravity Community"
7 github: sickn33
8tags: [orchestrate, batch, refactor]
9category: uncategorized
10platforms: [macos, linux, windows]
11license: MIT
12metadata:
13 hermes:
14 source: https://skillmd.com/skills/nous-hermeshub/orchestrate-batch-refactor
15 upstream: "antigravity-awesome-skills"
16 risk: "safe"
17 date_added: "2026-03-25"
18 original_author: "Antigravity Community"
19---
20
21# Orchestrate Batch Refactor
22
23## Overview
24
25Use this skill to run high-throughput refactors safely.
26Analyze scope in parallel, synthesize a single plan, then execute independent work packets with sub-agents.
27
28## When to Use
29- When a refactor spans many files or subsystems and needs clear work partitioning.
30- When you need dependency-aware planning before parallel implementation.
31
32## Inputs
33
34- Repo path and target scope (paths, modules, or feature area)
35- Goal type: refactor, rewrite, or hybrid
36- Constraints: behavior parity, API stability, deadlines, test requirements
37
38## When to Use Parallelization
39
40- Use this skill for medium/large scope touching many files or subsystems.
41- Skip multi-agent execution for tiny edits or highly coupled single-file work.
42
43## Core Workflow
44
451. Define scope and success criteria.
46 - List target paths/modules and non-goals.
47 - State behavior constraints (for example: preserve external behavior).
482. Run parallel analysis first.
49 - Split target scope into analysis lanes.
50 - Spawn `explorer` sub-agents in parallel to analyze each lane.
51 - Ask each agent for: intent map, coupling risks, candidate work packets, required validations.
523. Build one dependency-aware plan.
53 - Merge explorer output into a single work graph.
54 - Create work packets with clear file ownership and validation commands.
55 - Sequence packets by dependency level; run only independent packets in parallel.
564. Execute with worker agents.
57 - Spawn one `worker` per independent packet.
58 - Assign explicit ownership (files/responsibility).
59 - Instruct every worker that they are not alone in the codebase and must ignore unrelated edits.
605. Integrate and verify.
61 - Review packet outputs, resolve overlaps, and run validation gates.
62 - Run targeted tests per packet, then broader suite for integrated scope.
636. Report and close.
64 - Summarize packet outcomes, key refactors, conflicts resolved, and residual risks.
65
66## Work Packet Rules
67
68- One owner per file per execution wave.
69- No parallel edits on overlapping file sets.
70- Keep packet goals narrow and measurable.
71- Include explicit done criteria and required checks.
72- Prefer behavior-preserving refactors unless user explicitly requests behavior change.
73
74## Planning Contract
75
76Every packet must include:
77
781. Packet ID and objective.
792. Owned files.
803. Dependencies (none or packet IDs).
814. Risks and invariants to preserve.
825. Required checks.
836. Integration notes for main thread.
84
85Use [`references/work-packet-template.md`](references/work-packet-template.md) for the exact shape.
86
87## Agent Prompting Contract
88
89- Use the prompt templates in [`references/agent-prompt-templates.md`](references/agent-prompt-templates.md).
90- Explorer prompts focus on analysis and decomposition.
91- Worker prompts focus on implementation and validation with strict ownership boundaries.
92
93## Safety Guardrails
94
95- Do not start worker execution before plan synthesis is complete.
96- Do not parallelize across unresolved dependencies.
97- Do not claim completion if any required packet check fails.
98- Stop and re-plan when packet boundaries cause repeated merge conflicts.
99
100## Validation Strategy
101
102Run in this order:
103
1041. Packet-level checks (fast and scoped).
1052. Cross-packet integration checks.
1063. Full project safety checks when scope is broad.
107
108Prefer fast feedback loops, but never skip required behavior checks.
109
110## Limitations
111- Use this skill only when the task clearly matches the scope described above.
112- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
113- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.