Skip to content

feat: add /batch skill for parallel worktree fan-out #80

Description

@iheitlager

Description

The swarm infrastructure (swarm-job, launch-agents, worktrees) supports parallel agents, and /trio handles sequential issue processing with review gates. But there's no single-command entry point for the compound pattern: plan a batch of changes interactively, then fan out N parallel agents in isolated worktrees, each making changes, testing, and opening a PR independently.

Inspired by: Boris Cherny's Part 5 tip — /batch migrate src/ from Solid to React — interactive planning followed by parallel execution across dozens of agents.

Complexity

Estimate: large
Reasoning: New skill + integration with existing swarm infra (swarm-job, launch-agents, worktrees)

Context

The infrastructure exists but there's no orchestration layer that ties planning to parallel fan-out. Currently you either work sequentially (/trio) or manually set up parallel agents via launch-agents.

How It Would Work

  1. /batch <description> — User describes the batch operation
  2. Plan phase (interactive): Claude identifies affected files, groups them into independent work units
  3. Fan-out phase: For each work unit, spawn an agent in a worktree via launch-agents, injecting the plan + specific file scope
  4. Each agent independently: implements changes, runs tests, opens a PR
  5. Report phase: Summarize results — which PRs succeeded, which need human attention

Existing Infrastructure to Leverage

  • launch-agents — worktree creation and tmux session management
  • swarm-job — job queue with atomic claiming
  • swarm-daemon — monitoring and event tracking
  • /pr — PR creation per agent
  • Agent definitions (code-reviewer etc.) for post-change review

Acceptance Criteria

  • /batch <description> enters interactive planning mode
  • Plan shows work units and affected files per unit
  • User approves before fan-out begins
  • Each work unit runs in an isolated worktree
  • Each agent tests and opens a PR independently
  • Summary report shows success/failure per work unit
  • Integrates with swarm-job for tracking

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions