Skip to content

[Epic] Port DevSwarm into forge — swarm orchestration + 37 MCP tools #53

@justrach

Description

@justrach

Goal

Port the orchestration capabilities of justrach/devswarm into forge as a native, trackable layer on top of the existing crates. DevSwarm exposes 37 MCP tools that wrap parallel agent orchestration, task chains, review-fix loops, code-intelligence (blast-radius), and GitHub project management. The goal of this epic is to bring those capabilities into codegraff so we get the same multi-agent leverage without running a second MCP server.

Why this is worth doing

DevSwarm capabilities being ported

Tools (37 total, 7 categories)

Core patterns

  • Orchestrator/Synthesizer: Orchestrator (Opus-tier) decomposes a swarm task → workers (Sonnet-tier) execute in parallel → synthesizer (Sonnet-tier) aggregates one cohesive output.
  • Role + Mode routing: 8 roles (finder/reviewer/fixer/explorer/architect/orchestrator/synthesizer/monitor) × 4 modes (smart/rush/deep/free). Each role pins a default model tier (Sonnet for most, Opus for architect/orchestrator, Haiku for monitor).
  • Task chains: preset chains — finder_fixer, reviewer_fixer, explore_report, architect_build.
  • Review-fix loop: iterate reviewer→fixer until reviewer returns NO_ISSUES_FOUND or hits max-iter.
  • Blast radius: static analysis of what code is affected by a change — risk surface before/after.

Overlap with already-open codegraff issues (do NOT duplicate)

Existing issue DSP category Relationship
#34 graff-agent Hermes harness #55, #60 Same orchestrator/synthesizer goal; do this work inside the Hermes harness scope when applicable.
#27 P0: agents stuck in analysis-paralysis loop #55, #60 Role+mode routing + review-fix termination is the proposed cure.
#42 [P2-8] Plugin lifecycle hooks #55 Swarm workers need pre/post tool & pre/post LLM hooks for telemetry + tool-scoping.
#43 [P2-9] ExecutionEnvironment trait #55 Workers need worktree isolation (see devswarm's ADR-001 / their issue #213).
#20 Interactive multi-turn test harness #60 Needed to evaluate swarm role prompts; devswarm's open #354 has the same gap.
#28, #33 trajectory observability #60 Telemetry/observability for swarm runs lands on top of these.

Out of scope for this epic

  • Devswarm's own evolutionary self-improvement track (devswarm #148 family). We can revisit after the 7 children are landed.
  • Building a competing MCP server. We're porting the capabilities into forge tools / SDK surface, not standing up another stdio binary.

Bug-class lessons from devswarm's closed issues (apply during port)

When implementing children, watch for these patterns devswarm hit and burned days fixing:

  • Worker prompt bleed (devswarm #389): swarm workers must not embed the orchestrator preamble into the worker task text.
  • Role enforcement (devswarm #388): workers must run the role they were assigned, not default to fixer.
  • Tool scoping per role (devswarm #374): workers should not inherit all MCP tools — scope to the role.
  • MCP shutdown (devswarm #387): respect client shutdown/exit. (Applies to our MCP exposure too.)
  • Repo binding (devswarm #379): a global-mode forge MCP server must bind to the caller's cwd, not its own.
  • Config caching (devswarm #376): don't re-read config N+2 times per swarm.
  • Env inheritance (devswarm #390): nested subprocess spawns must not inherit parent desktop session vars.

Acceptance criteria for the epic as a whole

Metadata

Metadata

Assignees

No one assigned

    Labels

    severity: highSignificant impact; core functionality is impaired.type: featureBrand new functionality, features, pages, workflows, endpoints, etc.work: complexThe situation is complex, emergent practices used.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions