About

What is Swarm and why does it exist?

- - - - - - - - - - - - - - - - - - - - -

What is Swarm?

Swarm is a CLI tool that orchestrates a team of AI agents to process GitHub issues through the full software delivery pipeline. It takes an issue from assignment to a review-ready pull request — autonomously.

No manual coding. No copy-pasting prompts. No babysitting. Assign the issue, and Swarm handles the rest.

How It Works

Stage 1: Scope

The Scope Agent analyses the issue, explores the codebase, and produces a detailed implementation plan. It identifies affected files, proposes specific changes, and assesses risk — all without writing a single line of code.

Stage 2: Dev

The Dev Agent takes the scope plan and implements it. It creates a feature branch in an isolated git worktree, writes the code, runs tests, commits, pushes, and opens a pull request via the GitHub CLI.

Stage 3: Review

The Review Agent checks the PR diff against your project's coding paradigms. It looks for correctness, style compliance, edge cases, and security issues. It returns a verdict: PASS or REWORK.

Stage 4: Rework

If the review verdict is REWORK, the Rework Agent reads the feedback and fixes the issues. It commits, pushes, and the review cycle repeats — up to a configurable maximum (default: 3 cycles).

Key Features

Architecture

bin/
  swarm               # CLI entry point
lib/core/
  agent.sh            # Agent execution engine
  github.sh           # GitHub API via gh CLI
  repo.sh             # Repository detection
  prompt.sh           # Interactive prompts
  worktree.sh         # Worktree utilities
lib/commands/
  process.sh          # Full issue pipeline
  review.sh           # PR review pipeline
  worktrees.sh        # Worktree dashboard
  init.sh             # Project initialisation
  setup-ci.sh         # CI trigger setup
.swarm/prompts/
  scope-agent.md      # Scope agent prompt
  dev-agent.md        # Dev agent prompt
  review-agent.md     # Review agent prompt
  rework-agent.md     # Rework agent prompt
.swarm/paradigms/
  php-standards.md    # Coding paradigms

Design Philosophy

Minimal & Composable

Pure bash. No frameworks, no package managers, no build step. Each file is a focused module that sources its dependencies explicitly. If you can read bash, you can understand and extend Swarm.

Trust but Verify

Agents do the work, but a human makes the final call. Every pipeline ends with a PR labelled FOR-ASSESSMENT — never an auto-merge. The review/rework loop catches the obvious issues so humans can focus on the subtle ones.