A coordinator turns your idea into a spec and small task cards. Workers build them in parallel, each in its own worktree, on Claude, Codex or OpenCode. You decide at four gates; in between, the agents work on their own.
Needs Node.js 18.17+, git, and Orca to run the workers. The same command works on macOS, Linux and Windows.
npm install -g mad-workflow
| System | Get Node.js and git first |
|---|---|
| macOS | brew install node git |
| Linux | Your package manager, e.g. sudo apt install nodejs npm git, or nodejs.org |
| Windows | winget install OpenJS.NodeJS.LTS and winget install Git.Git |
From source: clone github.com/gottipx/mad-workflow, then cd package and npm run install-local.
cd ~/Workspace/my-app mad init # sets up MAD in this folder
| Agent | Start MAD with |
|---|---|
| Claude Code | /mad |
| Codex | $mad, or ask "start MAD" |
| OpenCode | ask "start MAD" |
The agent you start MAD in becomes the coordinator. Start it inside Orca, so Orca can wake it when workers report, and pick a high-end model first: it stays the same for the whole run.
mad models lists the agents installed on your machine and the models each offers. mad update refreshes MAD's own files in a project and keeps all of yours.
flowchart TD idea([Your idea]) --> plan["PLAN
configure, grill product,
grill stack"] plan --> g1{{"GATE 1
spec + stack"}} g1 --> setup["SET UP
keys, toolsets,
playbooks, task cards"] setup --> g2{{"GATE 2
playbooks + cards"}} g2 --> build["BUILD, wave by wave
workers build, review,
merge, integration check"] build -. question .-> g3{{"GATE 3
you answer"}} g3 -. answer .-> build build --> g4{{"GATE 4
use the preview app"}} g4 -- changes --> setup g4 -- approved --> ship(["SHIP
PR, CI deploys, retro"]) classDef human fill:#fdba74,stroke:#c2410c,color:#1b2230 classDef lead fill:#a5b4fc,stroke:#3b5bdb,color:#1b2230 classDef worker fill:#86efac,stroke:#15803d,color:#1b2230 class idea,g1,g2,g3,g4 human class plan,setup,ship lead class build worker
SPEC.mdSTACK.mdEvery gate comes as a short summary with the 3-5 points the coordinator is least sure about, so you review the risky parts first.
| When | You decide |
|---|---|
| Start | Agent, model and effort per role, parallel workers, review policy, app folder. Saved in mad/config/mad.yaml. |
| Gate 1 | What to build and with which stack |
| Gate 2 | The rules (playbooks) and how the work is split (task cards). The most important gate. |
| Gate 3 | Worker questions the spec doesn't answer, tasks that failed review twice, and commands that failed 3 times |
| Gate 4 | Whether the app is right. Approval opens the PR; CI deploys after you merge. |
Each role can run on a different agent. MAD offers only the models mad models finds on your machine.
coordinator: { agent: claude, model: claude-opus-5-5, effort: high } # the session you started MAD in
roles:
architect: { agent: claude, model: claude-opus-5-5, effort: medium } # mistakes spread: strong model
developer: { agent: opencode, model: deepseek/deepseek-v4-pro } # most of the work: drives cost
reviewer: { agent: codex, model: gpt-6.1-sol, effort: low } # another provider: second opinion
limits:
max_parallel_workers: 3
max_fix_rounds: 2
review: risky # reviewer only for risk: high cards (contracts, login, data, deploy); or always / never
Every worker gets one message, built by a script: role + rules + playbooks + task card. Nothing else.
| Block | What it is | Where |
|---|---|---|
| Roles | The job: architect lays contracts, developer builds one card, reviewer checks high-risk cards and never fixes | mad/roles/ |
| Rules | Project-wide rules for every worker | mad/AGENTS.md |
| Agent playbooks | Rules for one area (web, backend, deploy): tools, boundaries, traps, proof of done, when to ask | mad/playbooks/ |
| Task cards | One small task for one worker: files it owns, what to read, when it's done. Status is tracked in Orca. | mad/tasks/ |
| Toolsets | The tools and MCP servers a worker actually has. Enforced by config; playbooks are only guidance. | .mcp.json, agent configs |
| Orca | Starts workers in their own worktrees, carries questions and reports, wakes the coordinator | Orca app and orca CLI |
--- id: AUTH-1 title: Login API role: developer playbooks: [backend] wave: 1 risk: high needs: [AUTH-0] owns: [app/api/auth/*, app/db/migrations/002_users.sql] --- ## Context (read only these) - app/contracts/auth.ts ## Done when - POST /login returns a session; a wrong password returns 401 - Tests pass (paste output)
.claude/skills/mad/ .agents/skills/mad/ the skill (Claude Code + OpenCode, Codex) AGENTS.md short pointer to the skill mad/ config/mad.yaml SPEC.md STACK.md AGENTS.md MAP.md RUN.md roles/ playbooks/ tasks/ dispatch/ kit/ app/ the software only
.env, never committedmad/MAP.md replaces exploring the repomain. As soon as a task is merged, its worker is closed and its worktree and branch are removed (mad clean does the same by hand).mad/RUN.md, so starting MAD again continues where it left off.