One gate. Then no questions until the pull request.
Most agent workflows interrupt you a dozen times between the ticket and the diff. magic moves every decision to the front: a spec that names the requirements, the exact files to touch, the proof for each, and the one command that decides done.
Once that spec passes the check, the agent runs to completion. Open questions are resolved inside the plan's scope and logged, never asked.
- 1checkPlan must be READY_TO_EXECUTE with a blocks table and no open questions. The only human gate.
- 2buildEach block implemented and proved in turn, in a fresh git worktree on the plan's branch.
- 3testThe spec's unit tests written and run. Application code fixed until the Done-when command is green.
- 4docsOnly the existing docs the diff made stale. Nothing new.
- 5confirmA yes-or-no pass against every requirement. Two DONE in a row end it.
- 6commitA conventional commit with the plan's type and title. Local only.
- 7reviewA second, fresh session reviews the diff against the repo's own standards and fixes what it finds.
- 8pull requestWith --pr and a clean review: push, open a draft, title carries the review status.
Build, test, docs, and confirm share one agent conversation so context carries forward. Review starts cold on purpose, so it reads the diff the way a colleague would. Reruns skip any step already recorded in changes.md.
What the check demands
- StatusREADY_TO_EXECUTE. The /spec skill ends there after you have nodded the requirements and the block list.
- QuestionsNone open. Anything unresolved is written to questions.md and the run refuses to start.
- BlocksA table of file, change, precedent, proof command, and the requirement each block serves.
- TestsUnit specs only. Integration and end-to-end checks belong in the Done-when command, run once.
๐ magic check ๐ plan .claude/plans/2026-10-02-webhook-retries/plan.md ๐ง status BLOCKS_PENDING ๐ง questions 2 open โ blocks yes โ tests unit only ๐ open questions Q1 Should retries back off exponentially or at a fixed interval? Q2 Does the dead-letter table already exist in staging? stored in .claude/plans/2026-10-02-webhook-retries/questions.md โ magic: not executable; fix with /spec plan.md, then rerun
The agent works inside a fence
It can
- Read, edit, and create files in the worktree
- Run yarn, npm, and npx scripts
- Inspect git diff, status, and log
- Decide open questions inside the plan's scope, and log each one under Assumptions
It cannot
- Commit, push, or touch branches. magic does that itself
- Call gh or reach the network
- Invent a migration, env var, config key, or external contract the plan does not name
- Fix failures in files the plan does not touch. Those are noted and left alone
Reference
Install
npm install -g @anupam-io/magic # the /spec skill runs inside Claude Code; link it once ln -s "$(npm root -g)/@anupam-io/magic/skills/spec" ~/.claude/skills/spec
Requires git, jq, python3, gh for --pr, and one engine: the claude CLI (default) or codex. macOS and Linux.
Usage
magic <plan dir | plan.md> [--claude|--codex] [--pr] [--dev] [--force] [--branch <name>] [--no-beep]
| Flag | Effect |
|---|---|
| --claude, --codex | Engine. magic-claude and magic-codex are shorthands. |
| --pr | After a clean review: push and open a draft PR, plus a two-line "Contributed with Magic" comment. |
| --dev | Everything runs, including local commits, but nothing leaves the machine. No push, no gh. |
| --force | Rerun steps already recorded in changes.md. |
| --branch <name> | Branch when the plan has no Branch line. Default is type/slug, type inferred from the plan title. |
| --no-beep | Silence the finish sound. |
Environment
| Variable | Default | Meaning |
|---|---|---|
| MAGIC_ENGINE | claude | claude or codex |
| MAGIC_MODEL | claude-fable-5-1 | Claude model. Falls back to claude-opus-5-5 when unavailable. |
| MAGIC_CODEX_MODEL | codex default | Codex model |
| MAGIC_MAX_ROUNDS | 15 | Confirm passes before the run gives up |
| MAGIC_CTX_LIMIT | 180000 | Context tokens after which a Claude session is rotated |
| MAGIC_HOME | ~/.magic | Where per-repo, per-branch timings accumulate across runs |
| MAGIC_DEV | 0 | 1 is the same as --dev |
What a run leaves behind
In the worktree's plan directory: changes.md with every step, assumption, verify entry, and the review; magic-run.md with the timing and cost table; rows.tsv. The PR body draft is at debug/pr.md. The plan directory must live inside the target repo at .claude/plans/<name>/.