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.
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.
Why magic
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.
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.
Every diff must clear typecheck + lint + test + build before it becomes a PR. The verifier is a first-class node — not a footnote.
Magic gates live at the right moments: before the plan, before the diff, before destructive ops. Everything else is autonomous.
Capabilities
Each capability maps to a node or swarm in the topology. Each is independently testable, replacable, and versioned. Each contributes to a verified outcome.
Walks the repo and emits a RepoManifest — AST, call graph, conventions, prior knowledge. The single source of truth for every downstream agent.
Reads package.json, Makefile, pyproject, Cargo, go.mod — and detects pnpm, yarn, bun — so the right commands run automatically.
On first contact, infers naming, error-handling, test style, import order — and persists them to a per-workspace knowledge base.
A notebook checklist of 3–8 steps with clear success conditions. Reviewed at an approval gate before any code is touched.
AST search + call graph for multi-file refactors. Knows what depends on what before the first keystroke lands.
Edits respect the codebase’s dialect. magic reads what the repo already does, not what a generic LLM thinks it should do.
typecheck + lint + test + build. Conservative on purpose: rejects on any failure and routes back to the swarm for a fix.
Conventional Commits, draft PR, gh pr checks. Respects git_policy — no force-push, no reset --hard, ever.
A structured markdown report — Summary, Changes, Verification, Next Steps — wired into the PR body for the human reviewer.
How it works
The agent graph runs as a single composable pipeline. You stay in control of the moments that matter; the rest is autonomous.
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.
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.
The coder swarm edits files, runs the test loop, and stays within the sandbox policy. Cross-file refactors follow the call graph, not vibes.
typecheck + lint + test + build. If any one fails, the swarm retries with the verifier’s feedback. No green-on-paper PRs.
Conventional Commits, a magic/<date>-<slug> branch, and a structured PR description with the reporter’s summary. Respects git_policy end to end.
Stack
magic picks your model provider automatically from environment variables. Switch providers without touching the graph.
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 |
In the terminal
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.
Get started
Clone, configure a model provider, and run npm run dev. UI at localhost:5173, Fastify at localhost:4317.
# 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