Skip to content

feat: Swarm Mode v2 - Agent Team-Based Epic Execution#619

Open
acreeger wants to merge 35 commits intomainfrom
epic/610
Open

feat: Swarm Mode v2 - Agent Team-Based Epic Execution#619
acreeger wants to merge 35 commits intomainfrom
epic/610

Conversation

@acreeger
Copy link
Collaborator

@acreeger acreeger commented Feb 18, 2026

Summary

Implements Swarm Mode v2 (#610) — when il start detects an issue with child issues (an "epic"), iloom orchestrates a team of Claude Code agents to work on all children in parallel using Claude's experimental agent team infrastructure.

Key changes:

  • Epic detection in il start: Detects child issues, prompts for epic mode, writes issueType: 'epic' with childIssueNumbers and dependency data to metadata
  • Swarm orchestration in il spin: Creates child worktrees, renders swarm agents/skills, fetches dependency map, launches Claude orchestrator with CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
  • Recap MCP worktreePath: All recap tools accept optional worktreePath parameter for multi-loom scoping in swarm mode
  • Metadata schema extensions: issueType: 'epic', childIssues, dependencyMap, childIssueNumbers fields
  • Kanban visibility: il list --json surfaces swarmIssues with enriched state and worktreePath for epic looms
  • Templates: Swarm orchestrator prompt, swarm workflow skill, swarm-mode agent conditionals

Child issues resolved:

Closes #610, closes #611, closes #612, closes #614, closes #616, closes #620, closes #621, closes #622, closes #624, closes #625, closes #628, closes #629

Test plan

  • Run pnpm build && pnpm test — all 3984+ tests pass
  • Verify il start <epic-issue> detects children and prompts for epic mode
  • Verify il start <epic-issue> --epic creates loom with issueType: 'epic' in metadata
  • Verify il start <epic-issue> --no-epic creates normal loom
  • Verify il spin from epic worktree enters swarm mode
  • Verify il list --json includes swarmIssues and dependencyMap for epic looms
  • Verify recap MCP tools work with worktreePath parameter

…nt epic state

- MetadataManager.updateMetadata: re-throw errors after logging per project guidelines
- start.ts: replace dynamic imports of prompt.js with static import
- start.ts: revert parsed.type to 'issue' when epic child data fetch fails
- start.ts: replace process.exit(1) with throw for testability
- ignite.ts: remove unnecessary `as string` cast on issueType
- Update tests to match new behavior
…er abstraction

Replace hardcoded per-provider switch statement in fetchChildIssues() with
delegation to IssueTracker.getChildIssues() interface method. Each provider
(GitHub, Linear, Jira) now implements getChildIssues(), enabling Jira child
issue support and ensuring future providers get child issue fetching for free.

- Add getChildIssues() to IssueTracker interface
- Implement in GitHubService, LinearService, JiraIssueTracker
- Add JQL key format validation to prevent injection
- Simplify fetchChildIssues error handling (try/catch vs Promise.allSettled)
- Update all callers to pass IssueTracker instead of settings
- Rewrite list-children tests to use mock IssueTracker
- Add provider-specific getChildIssues tests (13 new tests)

Fixes #631
…pt.txt with SWARM_MODE

Replace the static SKILL.md template (167 lines) with dynamic rendering of
issue-prompt.txt using SWARM_MODE=true. This eliminates the maintenance burden
of keeping two diverging copies of the workflow in sync.

Changes:
- Add 12+ {{#if SWARM_MODE}} conditionals to issue-prompt.txt covering:
  autonomous preamble, swarm-specific todo list, state transitions,
  simplified Step 0, all AskUserQuestion blocks, commit/push logic,
  and orchestrator reporting
- Refactor SwarmSetupService.renderSwarmSkill() to call
  PromptTemplateManager.getPrompt('issue', variables) with SWARM_MODE=true,
  ONE_SHOT_MODE=true, and review config from settings
- Inject PromptTemplateManager into SwarmSetupService via constructor DI
- Delete static templates/skills/iloom-swarm-workflow/SKILL.md
- Remove dead findSkillTemplate() method and fileURLToPath import
- Add 5 new tests for renderSwarmSkill() (13 total, all passing)
- README.md: add prominent Swarm Mode section under Advanced Features,
  update command reference table, add to navigation links
- docs/iloom-commands.md: document --epic/--no-epic flags on il start,
  swarm mode behavior in il spin, swarmIssues/dependencyMap in il list,
  add CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS env var, add full Swarm Mode
  reference section with lifecycle states, dependency map, failure handling
…estrator

Child branches have a single commit, so rebase is trivial and
fast-forward merge keeps the epic branch history clean and linear.
Updated orchestrator prompt, README, and command reference docs.
# Conflicts:
#	src/utils/list-children.ts
…ssues

Previously --epic with no children logged a warning. Now both flags are
silently ignored, matching --child-loom behavior. Updated CLI help text
and docs to document this.
…n metadata commands

- Added mcp__recap__set_loom_state and mcp__recap__get_loom_state to all
  three allowed tools lists in ignite.ts (issue/PR, regular, swarm)
- Added both tools to iloom-issue-implementer agent template
- Replaced broken jq commands in swarm orchestrator that targeted
  non-existent iloom-metadata.json with mcp__recap__set_loom_state calls
  using worktreePath parameter
…pt authority

Swarm children were spawned as general-purpose agents told to invoke a
skill, so workflow instructions arrived as a user message (low priority).
Now the rendered issue-prompt.txt is written as an agent file at
.claude/agents/iloom-swarm-worker.md, making workflow steps part of the
system prompt. This improves consistency of comment posting, recaps,
artifacts, and state transitions.

Also removed the "No comments" rule from swarm mode so children post
implementation comments like the normal workflow.
…swarm orchestrator

Standardize v0.9.3 migration comment to match other migrations and broaden
skill pattern from iloom-swarm-* to iloom-*. Fix swarm orchestrator to rebase
from child worktree (where the branch is checked out) instead of the epic
worktree, which git refuses.
Add provider-agnostic issue lifecycle tools to the issue management MCP
server with implementations across GitHub, Linear, and Jira providers.

- Add closeIssue, reopenIssue, editIssue to IssueManagementProvider interface
- Implement across all 3 providers (GitHub CLI, Linear SDK, Jira API)
- Register close_issue, reopen_issue, edit_issue MCP tools
- Add to swarm orchestrator and issue/PR workflow allowed tools
- Update swarm orchestrator prompt to close child issues on merge (Step 3.3)
- Add comprehensive tests (25 new test cases across 4 test files)

Closes #640
Set ILOOM_SWARM=1 env var when launching the swarm orchestrator and
skip the hook's comment-restriction guidance for swarm sessions where
agents need to freely post artifacts as issue comments.
Add ENABLE_TOOL_SEARCH=auto:30 to swarm orchestrator env so
sub-agents can discover and use MCP tools via ToolSearch.
Add explicit instruction for child agents to cd to their worktree
path before doing any work, preventing agents from accidentally
operating in the wrong worktree.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Comments