Skip to content

Minimal worktree-only start path for swarm agents #560

@acreeger

Description

@acreeger

Summary

Add a lightweight code path in LoomManager that creates the minimum infrastructure needed for a swarm agent: worktree, branch, env file, metadata, and port — skipping IDE, terminal, dev server, and Claude launch.

Context

Part of the Autonomous Swarm Mode epic (#557). Swarm agents need isolated worktrees but don't need interactive tooling. This path must be fast since it's called once per child issue in the swarm.

Scope

New Lightweight Create Path

Add a new option to CreateLoomInput or a new method on LoomManager:

interface CreateLoomInput {
  // ... existing fields
  options?: {
    // ... existing fields
    swarmMode?: boolean  // New: minimal setup for swarm agents
  }
}

When swarmMode: true:

  • Creates: worktree, branch (off epic branch, not main), env file copy, metadata, port assignment
  • Skips: IDE launch, terminal launch, dev server, Claude launch, dependency installation (agent handles this)
  • Returns: structured data { id, path, branch, port, identifier } for supervisor consumption

Key Implementation Details

  • Branch should be created off the epic branch (passed as baseBranch in CreateLoomInput)
  • The loom should be marked as a child loom with parentLoom metadata pointing to the epic loom
  • Port assignment follows existing logic (3000 + issue number)
  • Metadata should include { swarmAgent: true } for identification
  • Environment file copying follows existing EnvironmentManager logic

Integration with Existing Code

  • This should work through the existing LoomManager.createIloom() method with the swarmMode flag
  • The existing enableClaude: false, enableCode: false, enableDevServer: false, enableTerminal: false flags already skip most interactive tooling
  • The main addition is: ensuring the branch is off the epic branch (not main) and skipping dependency install

Acceptance Criteria

  • createIloom() with swarmMode: true creates worktree + env + metadata in minimal time
  • Branch is created off the specified baseBranch (epic branch)
  • Loom is correctly linked as child loom to the epic loom
  • No IDE, terminal, dev server, or Claude launched
  • Returns structured data needed by supervisor
  • Unit tests verify minimal path with mocked git operations

Scope Boundaries

  • Does NOT launch agents (supervisor does that)
  • Does NOT handle agent lifecycle or monitoring

Dependencies

None — this is an independent infrastructure change to LoomManager.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions