PanCode
All tutorials

Workers and fleets5 min read

Run a playbook from plan to commit

Run the built-in sdlc playbook on one task, watch it work, and read the three commits it makes on your branch.

Written for
v0.9.0
Works in
Terminal · Desktop alpha
Basis
Documented workflow
Updated
Terminal output: playbook validate sdlc reports 8 declared steps, 6 code steps, 4 agents and 14 plan steps with the plan hash; playbook graph lists waves 1 to 14 with each step's kind, agent or command, the route and model of each agent step, and scope, then the suite and review loops.
validate runs the preflight and graph prints the compiled waves and loops, both without side effects. Terminal · v0.9.2
On this pageBefore you start Take a playbook from plan to commit Make it yours

A playbook is a sequence of workers and code steps that the fleet runs for you. The built-in sdlc playbook plans, builds, tests with a bounded fix loop, reviews with a bounded revise loop, and documents, with three commits along the way. This guide runs it on one task and reads what it committed on your branch.

Before you start

  • PanCode installed, with a connected model that supports tool calling.
  • A clean Git repository with a test command.
  • A small, specific task you could review by hand.

Take a playbook from plan to commit

  1. See what is available

    Shell

    pancode playbook list

    sdlc shows as setup until the project declares the two commands it runs, test and commit.

  2. Declare the commands it runs

    Shell

    pancode playbook commands init

    This drafts .pancode/playbooks/commands.yaml from your project's declarations, fully commented out, because uncommenting an entry confirms its exact command. Edit it to name what this project runs:

    .pancode/playbooks/commands.yaml

    version: 1
    commands:
      test:
        argv: ["npm", "run", "test"]
      commit:
        argv: ["git", "commit", "-m", "{{commitMessage}}"]
  3. Check before you run

    Shell

    pancode playbook validate sdlc --var task="Add empty-input handling to the parser"
    pancode playbook graph sdlc --var task="Add empty-input handling to the parser"

    validate runs the execution preflight and graph prints the compiled waves, loops, scopes, and write boundaries, both without side effects. It resolves agents, connections, and profiles, and checks the session budget and write boundaries. A failed preflight during a real run exits 2 before anything dispatches.

  4. Run it

    Shell

    pancode fleet run sdlc --var task="Add empty-input handling to the parser"

    The first line, on stderr, names the fleet root and plan hash. Each settled step prints one line. In another terminal, pancode fleet status shows the board and pancode fleet events <root> --follow follows the journal.

    To keep your terminal, add --detach: the command returns once the fleet is recorded and prints its root id. pancode fleet wait <root> then prints the result and exits with the fleet's code. For a script, --output-format json prints one result document.

    The steps work in your checkout, one after another, not in separate worktrees. The suite loop runs your test command inside the sandbox, rooted at the checkout, up to three times, and hands each of the first two failures back to the coder.

    The command exits 0 only when every required step succeeded, no step was skipped, and every loop resolved. Any other finished run exits 1. A failed preflight, or an error in the scheduler itself, exits 2.

  5. Read what it committed

    Shell

    git log --oneline -3
    git show --stat HEAD~2 HEAD~1 HEAD

    The three commit steps commit the plan, the code, and the docs on the branch you have checked out, so there is nothing to merge or land afterwards. If you do not want the result, reset the branch to where it was before the run.

    pancode fleet land is for something else: the task branch a worker dispatched with its own worktree keeps when its change was not merged.

Terminal output: playbook validate sdlc reports 8 declared steps, 6 code steps, 4 agents and 14 plan steps with the plan hash; playbook graph lists waves 1 to 14 with each step's kind, agent or command, the route and model of each agent step, and scope, then the suite and review loops.
validate runs the preflight and graph prints the compiled waves and loops, both without side effects. Terminal · v0.9.2

What you should see

A summary with each loop's terminal reason and any steps that need your decision, and three new commits on your branch. A finished run shows the playbook ran and its checks passed. It does not show the change is right, so read the diff.

Make it yours

Shell

pancode playbook new parser-fix --from sdlc

This copies the built-in playbook to .pancode/playbooks/parser-fix.md, where you can change steps, agents, and limits. A resumed run replays a completed prefix of the same plan: pancode fleet run <name> --resume <runId>.

Boundaries

  • Under fleet run nobody is attached, so a worker's ordinary ask is denied, not judged.
  • One lock per Git checkout keeps two fleets out of the same workspace.
  • pancode telemetry verify --run <run-id> checks the record of a run. The journals are hash-chained and unsigned, so they show consistency, not who wrote them.

By Anthony Kougkas · PanCode

Continue with the documentation