/Catalogue/Prompt/rohitg00/rohitg00-pro-workflow-batch-orchestration

Origin: github

batch-orchestration

Decompose large-scale changes into independent units and spawn parallel agents in isolated worktrees. Use for migrations, refactors, codemods, and any change touching 10+ files with the same pattern.

by rohitg00 · updated 1d ago · imported from GitHub

Installs0+0/7d
Security score73/100
Retention 14d0%
GitHub stars2.9K

Skill logic

Execution graph
User message
Prompt rewrites behaviour
Response

SKILL.md

View on GitHub ↗

Batch Orchestration

The /batch command pattern for large-scale parallel changes.

How It Works

/batch <instruction>
  │
  ├── 1. Research: scan repo, understand scope
  ├── 2. Decompose: split into 5-30 independent units
  ├── 3. Present plan: show units, ask for approval
  ├── 4. Execute: one background agent per unit in isolated worktree
  └── 5. Collect: each agent runs tests and opens a PR

Syntax

/batch Convert all React class components to function components
/batch Add error boundaries to every page component
/batch Migrate from moment.js to dayjs across the codebase
/batch Add OpenTelemetry tracing to all API handlers

The instruction should describe the change pattern, not individual files. The batch system finds the files.

Phase 1: Research

The orchestrator scans the repo to find every instance that matches the instruction:

grep -r "class.*extends.*Component" --include="*.tsx" -l

It builds a complete list of targets and groups them by independence.

Phase 2: Decompose

Each unit must be:

  • Independent — no shared state with other units
  • Self-contained — can be implemented and tested alone
  • Verifiable — has a clear pass/fail criteria

Good units:

Unit 1: Convert src/components/Header.tsx (class → function)
Unit 2: Convert src/components/Footer.tsx (class → function)
Unit 3: Convert src/components/Sidebar.tsx (class → function)

Bad units:

Unit 1: Convert all components in src/components/ (too broad)
Unit 2: Fix issues from Unit 1 (dependent)

Target 5-30 units. Fewer than 5 doesn't justify the overhead. More than 30 and coordination costs grow.

Phase 3: Plan Approval

The orchestrator presents:

BATCH: Convert class components to function components

Found: 18 class components across src/

Units (18):
  1. src/components/Header.tsx — class Header → function
  2. src/components/Footer.tsx — class Footer → function
  ...
  18. src/pages/Settings.tsx — class Settings → function

Per unit: convert class to function, update hooks, run component tests
Estimated: ~2 min per unit, ~5 min total (parallel)

Proceed? (y/n)

Wait for approval. Never spawn agents without explicit confirmation.

Phase 4: Execute

After approval, for each unit:

  1. Create isolated git worktree
  2. Spawn background agent in that worktree
  3. Agent implements the change
  4. Agent runs relevant tests
  5. Agent opens a PR

Agents run in parallel. Each has its own context window and worktree — no conflicts.

[Agent 1] ── worktree-1 ── Header.tsx ── tests pass ── PR #41
[Agent 2] ── worktree-2 ── Footer.tsx ── tests pass ── PR #42
[Agent 3] ── worktree-3 ── Sidebar.tsx ── tests fail ── flagged

Phase 5: Collect

After all agents complete:

  • Summary of pass/fail per unit
  • Links to opened PRs
  • Any units that failed with error details
  • Failed units can be retried individually

Best For

Use CaseWhy Batch Works
API migrationsSame pattern across many endpoints
Dependency upgradesFind/replace + fix across codebase
Codemod-style refactorsMechanical transformation, file by file
Adding instrumentationSame tracing/logging pattern everywhere
Test coverage gapsAdd tests to untested modules independently
Lint rule adoptionApply new rule fixes across all files

Anti-Patterns

Don't BatchWhy
Interdependent changesUnits can't run in parallel if they depend on each other
Shared state modificationsMultiple agents writing to the same config or state file
Architecture changesNeed holistic reasoning, not file-by-file
Schema migrationsDatabase changes must be sequential
Changes requiring human judgment per fileDefeats the purpose of automation

Relationship to Other Patterns

PatternScaleIsolation
Direct edit1-3 filesNone needed
Subagent1 focused taskForked context
Worktree1 feature branchFull repo copy
Agent teams3-5 parallel tasksShared task list
Batch5-30 identical patternFull worktree per unit

Batch is the heaviest tool. Use it when the change is mechanical, repetitive, and the units are truly independent.

Guardrails

  • Always review the decomposition before approving
  • Each agent must run tests before opening a PR
  • Failed units get flagged, not silently skipped
  • Clean up worktrees after all agents complete
  • Review PRs in batches — don't merge blindly

Discussion

No comments yet — start the thread.

Sign in to join the discussion.

/More from rohitg00/pro-workflow

rohitg00· 1d agoCommunity
skill-optimizer

Prompts · JavaScript · v0.1.0

SkillOpt-flavored offline training loop for any SKILL.md. Treats accumulated learn-rule corrections as training trajectories, proposes bounded patches via an optimizer LLM, gates each candidate against a held-out validation set built from the user's own past corrections, and ships only candidates that demonstrably improve the score. Inspired by Microsoft SkillOpt's ReflACT pipeline (rollout → reflect → aggregate → select → update → evaluate) adapted to pro-workflow's SQLite store. Use when a skill has accumulated 8+ learn-rule rows and the user wants the skill itself to get better, not just longer.

#agent-orchestration#ai-agents#ai-coding

0 2.9K
rohitg00· 1d agoCommunity
agent-teams

Prompts · JavaScript · v0.1.0

Coordinate multiple Claude Code sessions as a team — lead + teammates with shared task lists, mailbox messaging, and file-lock claiming. Patterns for team sizing, task decomposition, and when to use teams vs sub-agents vs worktrees.

#agent-orchestration#ai-agents#ai-coding

0 2.9K
rohitg00· 1d agoCommunity
auto-setup

Prompts · JavaScript · v0.1.0

Auto-configure quality gates, hooks, and settings for a new project. Detects project type and sets up appropriate tooling. Use when onboarding a new codebase.

#agent-orchestration#ai-agents#ai-coding

0 2.9K
rohitg00· 1d agoSandbox
bug-capture

Prompts · JavaScript · v0.1.0

Capture a user-reported defect as a durable GitHub issue written in the project's own domain language. Explores the codebase in parallel for context but never leaks file paths or line numbers into the issue. Use when the user reports a bug conversationally, runs a QA pass, or says "file an issue", "log this as a bug", "capture this".

#agent-orchestration#ai-agents#ai-coding

0 2.9K