The Problem

Coordinating multiple AI agents to ship production-grade code is usually ad-hoc: prompts scattered across scripts, no shared state, no defined roles, and no way to scale from a single PR to a multi-repo effort. SWE-AF replaces that with a single API call that spins up a structured engineering team—product manager, architect, coders, QA—that plans, implements, and verifies changes end to end.

What This Does

SWE-AF is a Python 3.12+ runtime that orchestrates autonomous software engineering fleets. The core logic lives in swe_af/ (45 files): app.py and fast/app.py expose the HTTP API, execution/dag_executor.py runs the workflow as a DAG, and reasoners/execution_agents.py dispatches work to model-backed agents. prompts/ holds role-specific prompt templates for architect, coder, QA, and merger agents.

The examples/agent-comparison/ directory contains four complete runs—Claude Code Haiku, Claude Code Sonnet, Codex, and SWE-AF itself—each producing a working CLI todo app with tests and coverage reports. examples/diagrams/ contains a full trace of a diagram-generator project built by the fleet, including per-agent JSONL logs in .artifacts/logs/.

How It Is Wired

Execution starts at the HTTP layer: swe_af/app.py receives a POST to /api/v1/execute/async/swe-planner.build, which routes through swe_af/fast/executor.py into the DAG executor. The module graph shows swe_af/execution/schemas.py as the central hub—43 modules import it, making it the highest-blast-radius file. swe_af/app.py (18 importers) and swe_af/prompts/_utils.py (19 importers) are secondary hubs.

The main entry point is run in examples/agent-comparison/codex/src/cli.js, which reaches 11 functions. The shortest path to a filesystem effect is run → addTodo → loadTodos, which calls fs.readFileSync—three hops from entry to disk I/O. The call graph shows createSVG and addTitle each called from 14 places, making them the most change-sensitive functions in the example code.

How To Use It

git clone https://github.com/moses-y/SWE-AF
cd SWE-AF
make install   # or: pip install -e .
make check     # run tests
docker compose up --build   # start the API on :8080

Configuration lives in .env.example—copy to .env and set your model provider keys. The API accepts a JSON payload with goal, repo_url or repo_path, and a config block specifying runtime and per-role models. The README documents both single-repo and multi-repo modes via the config.repos array.

Real-World Use

A team maintaining a monorepo with a shared auth library can submit one goal: "Add JWT auth across API and shared-lib." SWE-AF spawns separate agents for each repository, coordinates the dependency order, runs tests in its own CI, and opens a PR with the merged result—no human orchestrating prompts or merging branches.

Code Health & Issues

Static analysis found 89 issues (20 high, 68 medium, 1 low) across 7 kinds. The main concerns:

  • High – Oversized files: swe_af/execution/schemas.py, swe_af/app.py, swe_af/execution/dag_executor.py exceed 676 lines each, making changes ripple widely.
  • High – Deep nesting: max indentation depth of 9 in swe_af/app.py and swe_af/fast/app.py; control flow is hard to follow.
  • High – Hub modules: swe_af/execution/schemas.py has 43 dependents; churn there is high-blast-radius.
  • High – Duplicated code: 994 repeated 6-line blocks across 141 test files in examples/agent-comparison/swe-af-haiku/tests/.
  • Medium – Broad exception handling in swe_af/app.py and dag_executor.py swallows errors indiscriminately.
  • Medium – File handle leak: open(...) without context manager in swe_af/prompts/merger.py.

The audit also flags missing lockfile for pyproject.toml, no least-privilege GITHUB_TOKEN in CI, mutable Docker base image, and no dependency vulnerability scan. Tests and CI are present and passing.

The Bottom Line

SWE-AF is a serious attempt at autonomous multi-agent engineering, with a clean API surface and real evidence of working end-to-end runs. The core orchestration code needs refactoring—the hub modules and deep nesting will hurt maintainability as the fleet scales. Use it if you need a programmable engineering team, not if you want a polished library.