Skip to content

Epic detection and setup in il start #559

@acreeger

Description

@acreeger

Summary

Add epic detection logic to the il start command: detect the iloom-epic label, confirm swarm mode with the user, create an epic loom with its own integration branch, and handle the --swarm and --max-agents CLI flags.

Context

Part of the Autonomous Swarm Mode epic (#557). This issue handles the entry point UX — detecting that a user is starting an epic (not a regular issue) and setting up the epic-level infrastructure before the supervisor takes over.

Scope

Epic Detection

In StartCommand (after fetching the issue), check:

  1. Issue has iloom-epic label
  2. Issue has child issues (via getChildIssues())
  3. Child issues have dependencies (via getDependencies())

If all conditions met → epic mode. If label present but no children → warn and proceed as normal issue.

Confirmation Prompt

Show interactive confirmation:

Issue #42 is an epic with 8 child issues (5 ready, 3 blocked).
Start swarm mode? Max 3 concurrent agents. [Y/n]
  • Interactive: show prompt, respect answer
  • Non-interactive (no TTY): skip (require --swarm flag)
  • --swarm flag: bypass confirmation, start swarm immediately
  • --swarm on non-epic: silently ignored, proceed as normal il start

CLI Flags

Add to il start in cli.ts:

  • --swarm — bypass epic confirmation, auto-confirm swarm mode
  • --max-agents <n> — override swarm.maxConcurrent setting for this run

Epic Loom Creation

When entering swarm mode, create an epic-level loom:

  • Branch name: standard naming (e.g., issue-42-swarm-mode)
  • This branch serves as the integration branch — all child PRs target it
  • Uses standard LoomManager.createIloom() with enableClaude: false, enableCode: false, enableDevServer: false, enableTerminal: false
  • Epic loom metadata should include { isEpic: true, swarmStatus: 'pending' }

Edge Cases

  • Epic with 0 child issues → warn, skip swarm, proceed as normal issue
  • Epic with children but no dependencies → warn that all tasks will run in parallel
  • Issue without iloom-epic label but with child issues → normal issue (no auto-swarm)
  • Already have an active epic loom for this issue → offer to resume

Acceptance Criteria

  • il start <epic-number> correctly detects iloom-epic label
  • Interactive confirmation prompt shows child issue summary
  • --swarm flag bypasses confirmation
  • --swarm on non-epic is silently ignored
  • --max-agents override works
  • Epic loom created with integration branch
  • Edge cases handled gracefully (0 children, no deps, existing loom)
  • Unit tests cover detection logic and CLI flag handling

Scope Boundaries

  • Does NOT launch the supervisor loop (that's wired in Claude CLI Integration #12/wire issue)
  • Does NOT create child worktrees (supervisor handles that)

Dependencies

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