v1 · Agent graph for software engineering

Software engineering, actually engineered.

magic is an explicit agent graph that plans, edits, verifies and ships code on any repository. Every change must clear typecheck + lint + test + build before it can become a PR.

Verification gates
4
Built-in agents
10
Model providers
6+
Approval gates
3
magic · session · af-91c4
live
indexer runs first harness detector planner 3–8 steps security auditor router classifies coder swarm explain · refactor · ship verifier
RUN session af-91c4 · task #14
  • indexer · manifest emitted
  • planner · 5 steps
  • security · 0 findings
  • router → coder swarm
  • verifier · running typecheck
Cost so far
$0.014 / 1.2k tok

Why magic

Most AI tools ship suggestions.
magic ships pull requests.

Today’s coding assistants plan, edit, and ship without verification gates. Reviews catch what they ship; tests catch what reviews miss. magic inverts that: nothing ships until it has cleared every gate.

01

A graph, not a chat.

magic is an explicit topology of agents. Every step has a job, a tool surface, and an exit condition. No prompt soup. No copy-paste from autocomplete.

Learn more
02

Verification is the product.

Every diff must clear typecheck + lint + test + build before it becomes a PR. The verifier is a first-class node — not a footnote.

Learn more
03

Approvals where they matter.

Magic gates live at the right moments: before the plan, before the diff, before destructive ops. Everything else is autonomous.

Learn more

Capabilities

Ten capabilities. One graph.

Each capability maps to a node or swarm in the topology. Each is independently testable, replacable, and versioned. Each contributes to a verified outcome.

Understand

Semantic indexer

Walks the repo and emits a RepoManifest — AST, call graph, conventions, prior knowledge. The single source of truth for every downstream agent.

Harness detection

Reads package.json, Makefile, pyproject, Cargo, go.mod — and detects pnpm, yarn, bun — so the right commands run automatically.

Convention learner

On first contact, infers naming, error-handling, test style, import order — and persists them to a per-workspace knowledge base.

Plan & Edit

Explicit planner

A notebook checklist of 3–8 steps with clear success conditions. Reviewed at an approval gate before any code is touched.

Impact analysis

AST search + call graph for multi-file refactors. Knows what depends on what before the first keystroke lands.

Semantic edits

Edits respect the codebase’s dialect. magic reads what the repo already does, not what a generic LLM thinks it should do.

Verify & Ship

Four-gate verifier

typecheck + lint + test + build. Conservative on purpose: rejects on any failure and routes back to the swarm for a fix.

Branch, commit, PR

Conventional Commits, draft PR, gh pr checks. Respects git_policy — no force-push, no reset --hard, ever.

Reporter

A structured markdown report — Summary, Changes, Verification, Next Steps — wired into the PR body for the human reviewer.

How it works

From a sentence to a draft PR.

The agent graph runs as a single composable pipeline. You stay in control of the moments that matter; the rest is autonomous.

  1. 01
    01 · Read the repo like a senior engineer would seconds

    The indexer walks the tree, builds a RepoManifest, and detects the harness. The convention learner fills in the missing context: how this team writes code.

    Index
  2. 02
    02 · A checkpointed plan you can approve or reject review

    The planner produces 3–8 steps with success conditions. Impact analysis and a security scan run in parallel. Nothing is edited until you sign off.

    Plan
  3. 03
    03 · Semantic edits in the codebase’s dialect iterate

    The coder swarm edits files, runs the test loop, and stays within the sandbox policy. Cross-file refactors follow the call graph, not vibes.

    Edit
  4. 04
    04 · Four gates before anything is a PR strict

    typecheck + lint + test + build. If any one fails, the swarm retries with the verifier’s feedback. No green-on-paper PRs.

    Verify
  5. 05
    05 · Branch, commit, draft PR — all wired draft

    Conventional Commits, a magic/<date>-<slug> branch, and a structured PR description with the reporter’s summary. Respects git_policy end to end.

    Ship

Stack

Bring any model.
Local or hosted.

magic picks your model provider automatically from environment variables. Switch providers without touching the graph.

B
Bedrock
AWS
A
Anthropic
Claude
O
OpenAI
GPT
G
Google
Gemini
L
Ollama
Local
L
llama.cpp
Local
M
MiniMax
Coding Plan
Built for safety

Sandbox policy by preset.

Every shell, file editor, and file read honors a shared SandboxPolicy. Switching presets fans out one event to all three tools.

Preset Mode Approvals
read-only read-only destructive
workspace-write workspace-write destructive
danger-full-access full never
  • Auto-detect — magic picks the provider in priority order from env vars.
  • Bring your own — Any OpenAI-compatible endpoint (Ollama, llama.cpp, vLLM, LiteLLM).
  • Sandbox — CWD-locked + destructive denylist + resource limits, per preset.
  • Network policy — localhost-only mode for tools; model calls always allowed.

In the terminal

A CLI that fits your existing workflow.

magic is a web app with a Fastify backend, but the same agent graph is reachable from a single CLI. Bring your model, point it at a repo, and let it run.

Node 20+ TypeScript 5.7 Fastify Vite Playwright SQLite / JSONL WS streaming
~/code/magic · magic run
80 × 24
$ nvm use && npm install
magic · session af-91c4 · task #14
> indexer walking repo · 1,284 files
> harness: package.json · pnpm · vitest
> planner: 5 steps · 3 conditional
! awaiting approval · plan + diff
approved · coder swarm dispatching
> verifier · typecheck 1.4s · lint 0.7s · tests 12.3s · build 8.1s
all gates passed · opening draft PR
$ gh pr checks · all green
awaiting next instruction

Get started

One repo. One command.

Clone, configure a model provider, and run npm run dev. UI at localhost:5173, Fastify at localhost:4317.

~/magic bash
# 1. Install
git clone https://github.com/sachncs/magic.git
cd magic
nvm use              # picks up Node 20

# 2. Configure
cp .env.example .env
$EDITOR .env        # any model provider

# 3. Run
npm run dev
 UI at http://localhost:5173
 Fastify at http://localhost:4317
Fastify
React 19
Vite
TanStack Query
Zustand
Playwright
SQLite · FTS5
WebSocket