Index of every page on this site: llms.txt
All skills
dimillian avatar

/orchestrate-batch-refactor

@05ba982 official
by Thomas Ricouarddimillian/skills4k stars
208
Run it yourself

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.

Use this Skill: https://skilld.dev/gh/dimillian/skills/orchestrate-batch-refactor

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈79 tokens for metadata: the name and description. ≈802 when used: this file. ≈657 more on demand in 3 files.

Description uses 4.0% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈317 characters, or 4.0%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

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

  • 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:

  1. Packet ID and objective.
  2. Owned files.
  3. Dependencies (none or packet IDs).
  4. Risks and invariants to preserve.
  5. Required checks.
  6. 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:

  1. Packet-level checks (fast and scoped).
  2. Cross-packet integration checks.
  3. Full project safety checks when scope is broad.

Prefer fast feedback loops, but never skip required behavior checks.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts2mo4 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    This skill coordinates large-scale code refactors using a multi-agent approach. It provides structured templates for analyzing scope, planning work packets, and executing changes with clear ownership and validation gates. No malicious behavior or security risks were identified.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 05ba982. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Dormantupdated 8 months ago
  • Refactoring
  • multi-agent
  • orchestration
  • parallel-execution
  • code-analysis
  • work-planning
  • dependency-management
  • scope-management

README badge

README badge for dimillian/skills/orchestrate-batch-refactor

Orchestrates large refactors across multiple files by parallelizing code analysis, synthesizing a dependency-aware work plan, and executing independent work packets with separate sub-agents. Use when refactoring many files or subsystems where scope analysis, decomposition, and coordinated execution prevent conflicts and maintain behavior parity.

Generated from the current SKILL.md.

When should I use this skill instead of asking a single agent to refactor multiple files?
Use this skill for medium/large scope touching many files or subsystems. Skip it for tiny edits or highly coupled single-file work where parallelization adds overhead without benefit.
Does this skill preserve existing behavior during refactors?
Yes. The skill defaults to behavior-preserving refactors unless you explicitly request behavior change. Each work packet includes invariants to preserve and required validation checks.
How does this skill handle dependencies between files being refactored?
The skill builds a dependency-aware work graph, sequences packets by dependency level, and runs only independent packets in parallel. Packets explicitly declare their dependencies so the orchestrator respects them.
What happens if two work packets edit overlapping file sets?
The skill prohibits this by design — one owner per file per execution wave. If packet boundaries cause repeated merge conflicts, the skill stops and triggers re-planning.
Do I need to provide templates or can the skill generate work packets on its own?
The skill includes reference templates in `references/work-packet-template.md` and `references/agent-prompt-templates.md`. You can use these directly or adapt them for your codebase structure.

Generated from the current SKILL.md. These answers refresh after source changes.