the workflow

From one idea to a merged stack.

People keep asking what Monkeypuzzle actually does. So here's the whole loop — the same one whether you're a human in a terminal or an agent driving the API. Scroll, and watch it play out.

follow along
1cut a piece

Start one small idea.

Every unit of work is a piece — a branch in its own git worktree. Cut one and Monkeypuzzle spins up the worktree, an optional tmux session, and fires your on-create hooks.

  • mp create --name auth-schema — or just mp new.
  • mp create --prompt "…" hands the brief to an agent to scaffold.
  • Your other work never moves — no stashing, no dirty tree.
acme — zsh
~/acme mp create --name auth-schema ◆ cut piece feat/auth-schema ✓ worktree ~/acme/.mp/auth-schema ✓ tmux acme/auth-schema ✓ hook on-piece-create~/acme mp
2stack it

Build features in layers.

Real features are more than one idea. Stack the next piece on top of the last with mp stack append — schema, then API, then UI — each a clean, reviewable layer rebased on the one below.

mp stack status draws the whole tree, so you always know what sits on what.

feat/auth-ui +62 −4 draft
feat/auth-api +210 −18 draft
feat/auth-schema +88 −2 draft
main trunk
3tmux plugin

Switch without losing your place.

Jump between pieces without breaking flow. The tmux plugin pops a fuzzy picker over your current layout — pick a piece, land in its worktree and session.

prefix+p Switch to any piece across every project — each row previews its git status.
prefix+P Create a piece — pick a project, name or describe it, and you're in the worktree.
switch piece
❯ acme/feat-auth-ui ◆ draft acme/feat-auth-api ◆ in review acme/feat-auth-schema ● merged ✓ web/main trunk 4/4 · ↵ switch · ⌃P new piece
4restack

Change one piece, fix the whole tree.

Edit a piece low in the stack and everything above it is now stale. mp stack sync rebases the tree onto the new base — in order — and stops cleanly the moment a conflict needs you.

  • Conflicts are surfaced, never silently dropped — fix, then mp stack continue.
  • mp stack undo restores every branch to the pre-sync snapshot.
  • Pieces that didn't change are left untouched.
acme/auth-schema
~/acme mp stack sync ● feat/auth-schema updated ◆ feat/auth-api restacked ◆ feat/auth-ui conflict in src/login.ts → fix it, then: mp stack continue~/acme mp
5submit

One idea per pull request.

Ship the stack. mp pr create pushes the piece and opens a PR based on the piece below it — so each PR is a single idea, and reviewers never wade through the whole feature at once.

  • Stacked bases wired parent-to-parent; the stack is drawn into every description.
  • mp pr ready flips a draft when it's time for eyes.
  • mp pr create --stack submits every piece in one go.
acme/auth-ui
~/acme mp pr create ✓ pushed feat/auth-ui → origin ✓ opened #483 feat/auth-ui → feat/auth-api ◆ stack drawn into the description~/acme mp
on the server

See every stack, live.

The server syncs your GitHub PRs and draws each stack as a living tree — across repos and teammates. Review state, CI, and "needs restack" flow in on their own.

monkeypuzzle.dev / acme
feat/auth · 3 pieces synced just now
feat/auth-ui #483 · @sam reviewing in review
feat/auth-api #482 · CI passing needs restack
feat/auth-schema #481 merged
main trunk
6merge down

Land it, clean up after.

When the bottom piece is approved, mp merge lands it on the trunk — fast-forward only — then restacks the rest. mp done wraps a finished piece: merge, delete the branch, tear down the worktree and session.

  • Refuses to merge when main has moved on — sync first, no surprise overwrites.
  • Worktrees and tmux sessions are cleaned up for you.
acme/auth-schema
~/acme mp done ● merged feat/auth-schema → main (fast-forward) ↻ restacked 2 pieces onto main ✓ removed worktree + tmux session~/acme mp
7humans + agents

The same workflow, for your agents.

Here's the part that surprises people: there's no separate agent mode. Every command takes flags, or JSON on stdin, and prints JSON on stdout. --schema documents the shape of each one.

So an AI agent cuts pieces, restacks, and opens PRs through the exact same mp — and the bundled MCP server hands that whole workflow to assistants like Claude, with the same safety rails you get.

agent · ci
~/acme mp create --prompt "rate-limit login" --json { "piece": "feat/rate-limit-login", "worktree": "~/acme/.mp/rate-limit-login", "status": "draft" }~/acme mp
that's the loop

Cut. Stack. Restack. Submit. Merge.

One workflow for your terminal, your team's dashboard, and your agents.