Skip to content
OpenSmartRoute
Skillv1.0.0

orchestrate-batch-refactor

Plan and execute large refactor efforts with parallel multi-agent analysis. Use when: refactoring many files, splitting workstreams, or coordinating sub-agents for batch code changes.

by terminalskills(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from terminalskills/skills (skills/orchestrate-batch-refactor/SKILL.md). Install upstream with npx skills add terminalskills/skills --skill orchestrate-batch-refactor. Copyright stays with the author (MIT).

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.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/terminalskills-skills-orchestrate-batch-refactor/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

terminalskills-skills-orchestrate-batch-refactor.ocm.jsonjson
{
  "ocm": "1",
  "id": "terminalskills-skills-orchestrate-batch-refactor",
  "kind": "skill",
  "name": "orchestrate-batch-refactor",
  "description": "Plan and execute large refactor efforts with parallel multi-agent analysis. Use when: refactoring many files, splitting workstreams, or coordinating sub-agents for batch code changes.",
  "publisher": "terminalskills",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding"
    ],
    "tags": [
      "skill-md",
      "refactoring",
      "multi-agent",
      "batch",
      "code-quality",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Plan and execute large refactor efforts with parallel multi-agent analysis. Use when: refactoring many files, splitting workstreams, or coordinating sub-agents for batch code changes."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/terminalskills/skills",
      "path": "skills/orchestrate-batch-refactor/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/terminalskills/skills/blob/HEAD/skills/orchestrate-batch-refactor/SKILL.md",
      "key": "terminalskills/skills/skills/orchestrate-batch-refactor/SKILL.md"
    },
    "compatibility": "Any codebase",
    "license": "MIT"
  },
  "instructions": "# Orchestrate Batch Refactor\n\n## Overview\n\nUse this skill to run high-throughput refactors safely.\nAnalyze scope in parallel, synthesize a single plan, then execute independent work packets with sub-agents.\n\n## Inputs\n\n- Repo path and target scope (paths, modules, or feature area)\n- Goal type: refactor, rewrite, or hybrid\n- Constraints: behavior parity, API stability, deadlines, test requirements\n\n## When to Use Parallelization\n\n- Use this skill for medium/large scope touching many files or subsystems.\n- Skip multi-agent execution for tiny edits or highly coupled single-file work.\n\n## Core Wor",
  "cost": {
    "context_tokens": 801
  }
}

Fetch it by URL: GET /api/v1/registry/terminalskills-skills-orchestrate-batch-refactor/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.