Skip to content

Recipes and Run Checklists

Randy Northrup edited this page Nov 19, 2026 · 1 revision

Recipes and run checklists

A recipe is one kind of job: "a reply run", "announce a release", "make a banner". It names the flows the job reads and a checklist of steps, each pointing at the flow or part that does it. scripts/run.py opens a run from a recipe: a checklist file where every step ends done with evidence or skipped with a reason, and which can't be closed while a step is open.

Recipes keep long jobs honest. Without a checklist an agent can quietly drop the Reddit pass or the live check; with one, run.py finish refuses, and the report lists every skip and who decided it.

The demo's recipes

$ python scripts/run.py recipes
banner         A banner, card or other art
lesson         Put a lesson into the playbook
news-share     Share a news finding in the owner's voice
onboard        Set up a new machine or a new owner
post           An original post on X and Bluesky
release        Announce a release of the owner's app
reply          Reply run: answer everyone waiting on every platform
round          Growth round: replies, one original per platform, close

(run.py recipes also prints each recipe's when line.)

Recipe fields

Recipes live in playbook/state/recipes.json, outside the store. It is a plain JSON file you edit by hand (the "never edit by hand" rule is about playbook/store/), and pb.py check validates it.

{
 "about": "...",
 "recipes": {
  "reply": {
   "title": "Reply run: answer everyone waiting on every platform",
   "when": "reply to everyone; a reply run; answer comments",
   "group": "social",
   "actions": ["reply", "comment"],
   "flows": ["ground-rules", "pacing", "qc"],
   "steps": [
    {"id": "start", "text": "Read flows ground-rules and pacing; run audit.py today against the caps", "flow": "ground-rules"},
    {"id": "x", "text": "X @acmenotes_demo: every reply from the last 2 days answered or skipped with a reason", "flow": "x-reply"},
    {"id": "report", "text": "Report: counts per platform, skips with reasons, QC warnings", "part": "part-verify-live"}
   ]
  }
 }
}
Field Required What it is
recipe id (the key) yes Lower-case words joined by hyphens, starting with a letter
title yes One line: what the job is
when yes The phrases that mean this job. The agent matches requests against these.
steps yes The checklist
flows no Flows the job reads besides the ones its steps name (ground rules, pacing, QC)
group no Groups recipes in pb.py catalog
actions no What the job sends (reply, comment, post...). pb.py catalog uses it to list the QC filters that apply.

Each step has an id (unique in the recipe), text (what done looks like, specific enough to check) and a flow or a part. A step that names neither gets the recipe-step-ref warning.

pb.py check also warns flow-no-recipe for any flow no recipe reaches, through its flows, its steps' flows, or gotos from those. Every flow should belong to some job.

pb.py catalog

python playbook/pb.py catalog            # every recipe, by group, plus what each kind of piece is for
python playbook/pb.py catalog reply      # one recipe in full
python playbook/pb.py catalog --pieces   # where a new lesson goes

catalog <recipe> prints the checklist, then everything the job uses, derived from the flows so it can't go stale:

flows to read:        ground-rules, pacing, qc, x-reply, bluesky, reddit, audit
reached by gotos:     -
parts:                part-qc-check, part-read-back, part-log, part-verify-live
scripts named:        audit.py, bsky_open.py, pb.py, qc.py, run.py, xthread.py
QC filters (sends: reply/comment): account-registry, ignore-list, already-replied, author-cap, ...

"Reached by gotos" lists flows one goto away from the recipe's flows. "Scripts named" lists every scripts/*.py, media/*.py, pb.py, audit.py and qc.py the flows' text mentions. If a filter applies only to this recipe (applies.recipes), it is listed separately.

run.py

python scripts/run.py recipes                          # the recipes: id, title, when
python scripts/run.py start --recipe reply             # open a run
python scripts/run.py start --recipe reply --note "owner: skip Reddit today"
python scripts/run.py start --recipe news-share,post   # chain recipes into one run
python scripts/run.py status                           # the open run: todo, done, skipped
python scripts/run.py done x --note "evidence"         # close a step with what shows it was done
python scripts/run.py skip reddit --reason "why"       # skip a step, with a reason
python scripts/run.py finish                           # close the run; refused while a step is todo
python scripts/run.py abandon --reason "why"           # close an unfinished run on purpose
python scripts/run.py check                            # for a Stop hook: exit 2 while steps are open
python scripts/run.py list [-n 10]                     # recent runs
  • Only one run is open at a time. start refuses while another is open: finish or abandon it first.
  • Chained recipes prefix step ids with the recipe: news-share:start, post:start.
  • done needs a --note and skip needs a --reason, with words in them (blank text exits 2). Each is cleaned to one line of at most 400 characters.
  • status marks steps [ ] todo, [x] done, [-] skipped, with the note or reason under each.

A run is saved as playbook/state/runs/<YYYYmmdd-HHMMSS>-<recipe>.json (ignored by git). It records the recipe, title, start time, note, state (open, finished or abandoned), each step with its status, note or reason and time, and the finish time or abandon reason.

What finish reports

finish closes the run and prints what the report to the owner must cover:

finished reply run (20261118-181031-reply.json)

Skipped (put these in the report):
- bluesky: owner: next run (owner's call)
- reddit: demo account: nothing to answer (agent's call: tell the owner)

Pace flags (explain each in the report):
- 2026-11-18-x-8400c4eb X @acmenotes_demo: sent 0 s after the previous reply (...); the minimum is 30 s

QC overrides (say why each went out anyway):
- 2026-11-18-x-8400c4eb X @acmenotes_demo: demo: trying the override

No QC warnings.
  • A skip whose reason starts with owner is marked as the owner's call; any other skip is the agent's call, and the agent must tell you.
  • Pace flags, QC overrides and QC warnings come from audit log entries logged since the run started (see Audit log and QC gate).

Carry-over: "owner: next run"

Skip a step with a reason starting owner: next run and the next run of the same recipe lists it before the checklist:

Left for this run by the last one (skipped with "owner: next run"): do these first
- bluesky (reply run 2026-11-18): Bluesky: bsky_open.py acmenotes.example; every thread handled

Only the last closed (finished or abandoned) run of that recipe is consulted, so a run of a different recipe in between doesn't use the leftovers up. The carried steps are a reminder printed at the start; they are recorded in the run file under carried_over, but the checklist itself is the recipe's normal steps.

A Stop hook

run.py check exists so an agent session can't end while a run has open steps. It prints nothing and exits 0 when no run is open or every step is closed. Otherwise it prints the open steps to stderr and exits 2:

agent-playbook: a reply run is open with 5 step(s) todo: x, bluesky, reddit, log, report. Do them, skip each with a reason (run.py skip STEP --reason ...), or abandon the run with a reason.

In Claude Code, a Stop hook that exits 2 stops the agent from ending its turn and shows it that message. The repository doesn't install a hook for you. To add one, put this in ~/.claude/settings.json (or a project's .claude/settings.json), with the path to your skill folder:

{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          { "type": "command", "command": "python \"$HOME/.claude/skills/agent-playbook/scripts/run.py\" check" }
        ]
      }
    ]
  }
}

If $HOME isn't expanded where your hooks run, write the full path, for example python "C:/Users/me/.claude/skills/agent-playbook/scripts/run.py" check.

The agent then has three ways to end a session with a run open: finish every step, skip the rest with reasons, or run.py abandon --reason "why". Other agents can do the same with whatever "before stopping" hook they offer, or you can add "run python scripts/run.py check before you stop" to their instructions.

Adding a recipe

  1. Add an entry to playbook/state/recipes.json: title, when, flows, actions if it sends anything, and steps that each name a flow or part.
  2. Write step texts as checkable outcomes: "Every reply logged and checked live", not "logging".
  3. python playbook/pb.py check --strict.
  4. python playbook/pb.py catalog <id> to see what it pulls in.

The demo's lesson recipe and playbook flow describe the same process for lessons the owner gives the agent.

Clone this wiki locally