agentleFS
creedantscreedants/pstack-t3/skills/brigade/SKILL.md

brigade

Skill3 starsChanged 57 days agoMITView on GitHub

Give a project or a focus area its own standing head chef: one long-lived T3 thread that holds a purpose, takes incoming work, delegates it to pstack playbooks, reviews every result against the purpose with another model family, and reports what landed. Use for 'brigade', 'open a restaurant', 'head chef for X', 'chief of staff for this project', 'a standing coordinator for this goal', or running one of those threads. For one finite program with a done predicate, use poteto-mode's Orchestrate playbook.

The file

Show its rules and text

We split this skill into the rules it gives an agent

21 rules. About 0 are common, 10 are distinctive, and 11 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 11

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Read the pstack-t3 runtime before spawning workers, choosing models, scheduling, or isolating work.

    line 8
  2. Distinctive:

    Every mechanism here comes from pstack.

    line 12
  3. Distinctive:

    Run to the next real blocker.

    line 32
  4. Very specific:

    Delete only what this restaurant created: its dish branches, its worktrees, and the queue's landing/e<n> branches, including a leftover …

    line 35
  5. Distinctive:

    Never write code yourself.

    line 36
  6. Very specific:

    Every command takes --help.

    line 76
  7. Distinctive:

    Run from any thread.

    line 88
  8. Distinctive:

    Ask the user two things with the host's question tool, unless they already said each one.

    line 92
  9. Very specific:

    Call orchestrator_capabilities and resolve roles per the runtime's Roles section.

    line 113
  10. Very specific:

    Every wake runs this: a user message, a worker's report-back, a verifier's completion, a schedule, or a watch_pull_request wake.

    line 126
  11. Very specific:

    Call t3_thread_interrupt on its worker thread.

    line 143
  12. Very specific:

    Call t3_thread_wait on the run id it returned, or on the thread when it returned none.

    line 144
  13. Very specific:

    When the wait reports a terminal state, run $B dish <id> --state dropped --stopped <run id>, or --stopped idle when the wait reported an …

    line 145
  14. Distinctive:

    After a dish merges, is dropped, or is sent back, clean up per Git and PR housekeeping.

    line 146
  15. Distinctive:

    Fix the recipe: When two dishes repeat the same mistake, fire a dish that runs the correct skill to make it impossible (lint, type, test, …

    line 148
  16. Very specific:

    Leave out dish, ticket, and decision IDs (D<n>, T<n>, Q<n>), SHAs, file paths, branch names, review-round counts, verdicts, and tool or …

    line 165
  17. Very specific:

    Put commits, IDs, and other engineering detail in the store, not the message.

    line 168
  18. Very specific:

    Write each PR's title and body through submit, and link every PR with link_pull_request.

    line 183
  19. Distinctive:

    After a landing, when the user's checkout at the project root is clean and on trunk, fast-forward it with git merge --ff-only.

    line 186
  20. Distinctive:

    Never force-push trunk, rewrite published history, change branch protection, or delete a branch this restaurant did not create.

    line 188
  21. Distinctive:

    Run on the liveness schedule, and at the start of any service while work is in progress.

    line 192

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Brigade

Read the pstack-t3 runtime before spawning workers, choosing models, scheduling, or isolating work. It maps those steps onto T3's orchestrator tools.

Brigade copies the setup Lauren Tan runs with Cursor Projects. The user is the executive chef. Each restaurant is one project, or one focus area inside a project. Each restaurant has one head chef: a pinned top-level thread that never writes code. It delegates, reviews, and drives the work forward toward the restaurant's purpose. The user moves between restaurants and reviews what landed.

Every mechanism here comes from pstack. Delegation, roles, isolation, scheduling, and history follow the runtime. Workers run poteto-mode playbooks.

Terms

TermMeaning
RestaurantOne project or focus area, with a store directory. A project may hold several.
Head chefThe restaurant's coordinator thread.
Menumenu.md: purpose, what good looks like, what is off the menu, budget.
House ruleshouse-rules.md: numbered standing orders pasted into every brief.
TicketOne incoming request on the rail (rail.tsv).
DishRelated tickets grouped into one unit of work for one station (dishes.tsv).
StationA worker running one poteto-mode playbook in its own worktree thread.
PassThe review of a dish against its tickets and the menu (pass.tsv).
86A decision only the user can make (86.tsv).

These words name files, commands, and steps. They never appear in speech. Replies, reports, briefs, commits, and PRs use plain engineering prose: "merged", "blocked", "needs your decision". Never "plated", "86'd", "heard", or "chef".

Operating stance

  • Run to the next real blocker. "Should I continue" is never a question. Reply as Run a service step 9 says for this restaurant's reporting level.
  • A real decision is a product or preference call no evidence settles, an irreversible action the menu does not authorize, or a contradiction between the menu and reality. Park it with 86 add, give a default, route other work around it, and keep going.
  • Raise a decision once, in the reply where you park it. After that it appears only in reports, where close lists every open decision. Never repeat it as "still open" in other replies.
  • Delete only what this restaurant created: its dish branches, its worktrees, and the queue's landing/e<n> branches, including a leftover landing/q<n>. Ask before deleting any other branch, even one fully merged.
  • Never write code yourself. Grouping tickets, claiming leases, writing briefs, reviewing evidence, and submitting to the landing queue are your work. Code changes and conflict fixes are dishes.
  • Work lands only through the repository's landing queue, per the landing skill. Several restaurants can share one repository. The queue and its leases keep them off each other.

The script

<skills>/brigade/scripts/brigade.py, where <skills> is the directory holding this skill. Every command but open and walk takes --at <restaurant dir> or BRIGADE_DIR. It prints one line or a short block, in plain prose.

B="python3 <skills>/brigade/scripts/brigade.py --at <restaurant dir> --owner <thread>@<generation>"   # the token from status
$B status                                    # reporting level, landing mode, then counts, then owner <thread>@<generation>
$B set --thread <id> [--replace] --schedule <name>=<id>
$B set --reporting every-turn|milestones|digest
$B set --schedule <name>= drops that name from restaurant.json. A name that is not recorded is already absent, and the command still succeeds. Other names stay.
$B set --intake github,<feed>                # the intake sources this restaurant owns. Replaces the list. --intake "" clears it
$B set --workers <n>                         # dishes in progress or in review at once. A missing value reads as 2
$B ticket add --summary "<request>" --source user|github|<feed> [--ref <url>]   # prints T<n>
$B ticket list [--state waiting|assigned|moved|done|dropped]
$B ticket set T3 --state dropped
$B ticket move T3 --to <sibling>             # hands a waiting ticket to a sibling. Prints the thread to tell
$B ticket take                               # files every ticket a sibling handed to this restaurant
$B fire --tickets T1,T3 --station bug-fix --summary "<outcome>" --paths src/a,src/b [--timebox 60]   # claims the lease, prints D<n>
$B brief D2 --fields <path>                 # JSON file, or --fields - for stdin. Writes briefs/D2.md
$B brief D2 --goal '...' --acceptance '...' [--acceptance ...] --verify '...' --base main [--context ...]   # same brief. Single-quote every field
$B watch                                     # a line for every open dish; renews each live lease
$B hang D1 --provider <provider> --minutes <n> [--attempt <n>]   # one open run after report-back, once per attempt
$B dish D2 --state dropped [--stopped <run id>|idle]   # releases the dish's lease, returns its tickets to waiting
$B dish D2 --state in-progress|in-review|queued|merged [--thread <id>] [--task <id>] [--pr <url>] [--sha <head>] [--timebox <m>] [--reported] [--lease <id>] [--paths <paths>] [--branch <name>]
$B pass record D2 --sha <head> --verdict pass|send-back|blocked --author <provider/model> --verifier <provider/model> [--pr <url>] [--note "..."] [--same-family]
$B pass check D2 --sha <head>                # exits 1 unless that SHA passed
$B 86 add --question "..." --options "a, b" --default "a" [--dish D2]   # prints Q<n>
$B 86 answer Q1 --answer "..." ; $B 86 list
$B close [--dry-run | --to-file]             # report of what changed since the last one. --to-file prints only the written file's path
python3 <skills>/brigade/scripts/brigade.py walk [--repo <project root>]
L="python3 <skills>/landing/scripts/land.py --repo <project root>"   # leases and the landing queue. Writes pass --owner <restaurant>/@<generation>

Pass brief fields with --fields <path>, or with --fields - and the JSON on stdin. The object has goal, acceptance, verify, and base. acceptance is a list of strings. Optional context is a list of strings. Optional paths and lease fall back to the row from fire when omitted. The flag form prints the same brief. Use the file, or put every flag value in single quotes. A double-quoted value lets the shell run backticks and expand $ before brigade.py starts, so the brief can contain command output. An unquoted heredoc expands backticks and $ the same way. Write the file with a file tool, or with a heredoc whose delimiter is single-quoted, such as <<'EOF'.

Each intake source has one owner. open --intake records the list when it creates a restaurant. On an existing one it changes nothing. set --intake, and open --intake when it creates a restaurant, refuse a source a sibling already lists, with brigade: <sibling> already owns intake from <source>; move tickets to it instead. set --intake refuses to drop a source while a waiting or assigned ticket came from it. ticket add --source <s> for any source but user needs <s> in this restaurant's intake and in no sibling's. Its refusal names the owner. ticket add --ref refuses a ref that is already live here or in a sibling, with brigade: <ref> is already T1 (waiting); nothing added. A waiting, assigned, or moved ticket is live until the ticket it was handed to is done or dropped. Compare refs as the exact URL gh prints. A table line that does not parse stops every command that takes --at with brigade: <table> line <n> is malformed; fix or remove it. Fix or remove that line by hand.

Every command takes --help. Workers write their reports to <restaurant dir>/reports/<dish>.md, and verifiers write findings to <restaurant dir>/reports/<dish>-review.md.

open --workers records the cap when it creates the restaurant. set --workers changes it. A missing workers field reads as 2. The cap counts dishes in progress or in review. fire refuses before it claims a lease when the count is already there, and dish --state in-progress or in-review refuses when that dish is not already one of those states. Moving between those states, or replacing the worker, does not. A refused fire leaves the tickets waiting and logs why. watch rechecks the worker count and then the lease, in fire's order, so both name the same reason when both caps hold. ticket list and walk run the same recheck, so ticket list appends blocked: workers, blocked: lease, or blocked: repository and walk counts the ticket blocked only while that block still holds. watch prints waiting on L<n> (<holder>), waiting for room in the repository (<n> of <n> changes in flight), waiting for a worker (<running> of <cap> running), or unblocked with a shell-quoted fire command. Run that command as printed. A refused fire logs the paths and --branch it was given. watch adds changes/<branch>.md for the branch the next fire would use when it rechecks the lease, and the command includes --branch when one was recorded. When the branch is known, fire --paths also leases changes/<branch>.md, with % written as %25 and / written as %2F. A lease check that fails prints the landing queue's diagnostic. dish --lease and dish --paths record a lease claimed again, and refuse a merged or dropped dish. dish --branch records the branch and claims or releases nothing. The landing queue cannot add paths to a lease. When the dish's active lease does not cover the new changes/<branch>.md, dish --branch prints the three commands that do: $L lease claim on the old paths plus the new fragment, $B dish --lease <new lease> --paths, and $L lease release of the old lease. Run them in that order. When the lease is submitted, it prints that the submitted commit lands as it is, and to run the same dish --branch again if the entry bounces. When fire cannot release a lease it claimed and then could not keep, it warns with the lease id and the landing queue's diagnostic. open warns when workers is at or above the repository cap and a sibling exists.

Every store write checks its owner. restaurant.json holds the recorded thread and a generation. set --thread sets the generation to 1 when it records a first thread, and --replace adds 1. status prints owner <thread>@<generation>. Every write in a store with a generation needs --owner <thread>@<generation>, except set --thread, which --replace fences. The check runs under the store lock, and the lock is held through the write. A token that does not match exits 1 with brigade: owner <token> is stale; this store is owned by <thread>@<generation> and changes nothing. set --thread --replace first raises the landing floor for <restaurant>/ with land.py owner, so land.py also refuses the replaced thread's --owner <restaurant>/@<old generation>. brigade.py passes --owner <restaurant>/@<generation> from its own token on every land.py write it makes. A store opened before generations has no generation and needs no --owner. Run $B set --thread <its recorded thread> once to record generation 1. From then on every write needs the token.

dish --state dropped releases the dish's active lease, including a queued dish whose entry bounced. On a dish that holds a lease and records a worker thread it refuses without --stopped, with brigade: D3 holds L4 and its worker may still be running; wait for its run with t3_thread_wait, then pass --stopped <run id>. The lease stays active, so no sibling claims its paths early. --stopped records the run id in log.tsv as evidence. The script cannot check it. The dish's assigned tickets go back to waiting, each with a log row naming the dropped dish, and the command prints D3 dropped; T2 waiting again. Fire them again, or drop them with ticket set.

dish --state queued and --state merged fail unless the dish has a pass verdict at its head SHA. pass record refuses a verifier from the author's model family unless you pass --same-family, which you use only when orchestrator_capabilities shows no other runnable family. $B dish <id> --reported records that this attempt's report-back arrived. A new attempt clears that mark. The attempt is new when the dish enters in progress, and when $B dish <id> --thread <id> records a different worker while the dish stays in progress. That command logs a new start. $B watch compares the report file to that start. Recording the same thread again leaves the attempt alone. When that report-back is recorded and the report file is more than 10 minutes old, $B watch prints reported, run still open Nm. The number is minutes since the report file was written. The script has not read the thread.

Open a restaurant

Run from any thread.

  1. Name the target project and focus. List projects with t3_project_list. A restaurant lives in exactly one T3 project, because a head chef can only read and steer threads in its own project.
  2. Draft the menu from evidence: the repo's README and AGENTS.md, open issues (gh issue list), and recent threads via the recall skill. Ask the user only for what the evidence cannot settle, normally the purpose itself. Use the grilling skill when the purpose is vague.
  3. Ask the user two things with the host's question tool, unless they already said each one. Ask both in one call.
    • Who lands work. This decides whether the user stays a gate on PRs and git. Offer:
      • merge (recommended for a repository with a remote): every change still gets a PR as its record, and the queue merges it once the checks pass. The user reviews what landed afterward and does no PR or git work.
      • human: every change gets a PR, and the user merges it.
      • push: no PRs. The queue pushes trunk after the checks pass.
      • local: nothing leaves the machine. Changes land on a lane ref the user merges. Say that merge and push put reviewed changes on trunk with no human gate. When the repository already has a landing contract ($L status), its mode applies to every restaurant on that repository. Say so before changing it, and name the siblings walk --repo <root> lists.
    • How often the coordinator replies. Recommend milestones. Send the scheduled evening report at every level. The 09:00 morning service is not a report. A message from the user gets at least a one-line acknowledgment at every level. A direct question gets an answer. Each level below adds the replies it names. It does not drop the evening report, the user message, or the direct question.
      • every-turn. Send a short reply after every wake.
      • milestones. Reply when work merges, when a review sends work back or blocks it, when a decision needs the user, when something fails or the queue pauses, or when the user sends a message. A routine wake ends with no reply, or with a single line when the host requires text. A liveness check with nothing new, a liveness check while a review is pending, a review starting, and a worker launching are routine wakes.
      • digest. Reply only for a decision the user must make, a failure or a paused queue the coordinator cannot fix itself, one summary when a batch drains, the scheduled evening report, and a message from the user. Every other wake ends with no reply text at all. Each reply is a few plain sentences for a person, not an engineer.
  4. Run python3 <skills>/brigade/scripts/brigade.py open --project-root <root> --name "<restaurant>" --reporting <level> [--workers <n>]. It prints opened <dir> or exists <dir>, then one block per sibling coordinator on the same project root. Each block names that coordinator, its store directory, its thread, its purpose, and what it does not take. Fill menu.md. Keep this purpose clear of every sibling open printed. Under ## Off the menu, list each sibling's purpose as that sibling's work. Append house rules. The list is forbidden paths, the verification bar, intake sources, --workers, and the repository's hot shared files, and where their changes go instead. Run $B set --intake <sources> with each intake source the house rules name, except a source a sibling's restaurant.json already lists. That sibling owns it and moves you the tickets that are yours. Hot shared files are CHANGELOG.md, README.md, and docs/guide.md. A change adds its one changelog bullet as a file under changes/ and does not edit CHANGELOG.md. It edits README.md or docs/guide.md only when its ticket is about them, or when it removes or renames something they name. Otherwise the worker lists that doc edit under follow-ups in its report, and the coordinator batches those follow-ups into one docs item. The lease orders the batches. The default level is milestones when --reporting is omitted. Opening an existing restaurant does not change its level. Change it later with $B set --reporting <level>.
  5. Set the repository's landing contract to the choice. When $L status shows no contract, run $L init --mode <choice> per the landing skill, with the repository's own test and type-check commands as checks. When it shows another mode, run $L mode <choice>. It names the holders of unreleased leases. Then tell each sibling the new mode with t3_thread_send, to the threads walk --repo <root> prints. The landing contract is the only record of the mode. House rules do not restate it. A restaurant whose house rules already state the mode deletes that rule on its next service.
  6. Launch the head chef only when open printed opened. That word goes to the one caller that created the directory. When open printed exists, do not launch. When the output includes thread <id> already recorded, that thread is the coordinator. An exists coordinator with no recorded thread is the user's call. Two threads never write one store. $B set --thread refuses to replace a recorded thread unless you pass --replace. When open printed opened, launch with t3_thread_launch: projectId of the target, workspaceStrategy: {"type": "root"}, title Head chef: <restaurant>, and a message that says "Use the brigade skill. You are the head chef for the restaurant at <restaurant dir>. Run your first service." Record the returned threadId with $B set --thread <id>.
  7. Tell the user where the thread is and which landing mode the repository uses. If it is in another project, you cannot read or message it after launch. That is expected.

Opening a restaurant is the user's request for top-level threads: the head chef, and one worktree thread per worker.

First service

  1. t3_thread_organize with action: "pin" and no threadId.
  2. Call orchestrator_capabilities and resolve roles per the runtime's Roles section. Apply the menu's budget.
  3. Create three schedules with schedule_task, bound to this thread, each with a self-contained prompt: "Use the brigade skill. You are the head chef for the restaurant at <restaurant dir>. Reporting level: <level>. Follow Run a service step 9. Run a service." Read <level> from restaurant.json (every-turn, milestones, or digest). A missing reporting field is milestones. Add the purpose of the run to each. A later $B set --reporting changes the level, and the next service reads restaurant.json rather than the level copied into an older prompt.
    • Morning service: {"type": "fixed_time", "timeOfDay": "09:00"}. The prompt carries the reporting level.
    • Intake: an interval matched to the sources in the house rules, at least 3600000. Skip it when the menu names no source. The prompt carries the reporting level.
    • Evening report: {"type": "fixed_time", "timeOfDay": "18:00"}, prompt adds "Write the report." The prompt carries the reporting level.
    • While this restaurant has dishes queued, keep a landing drain schedule per the landing skill, and delete it when none are. Name the reporting level in that prompt, and say to follow Run a service step 9. After the queue opens a PR, that section has this thread call watch_pull_request and run land on each wake. Other restaurants' drains on the same repository are harmless. The queue lock runs one at a time. When you delete that schedule, run $B set --schedule drain=.
    • While $B watch prints anything other than "no work in progress", and on the first refused fire, keep a liveness schedule. watch renews every live lease, so this schedule is what keeps a lease from expiring. At every-turn and milestones use {"type": "interval", "everyMs": 600000}, every 10 minutes. At digest use {"type": "interval", "everyMs": 1800000}, every 30 minutes, because worker report-backs and pull request watches are the primary wakes. The prompt is "Use the brigade skill. You are the head chef for the restaurant at <restaurant dir>. Reporting level: <level>. Follow Run a service step 9. Run the liveness check." Delete it when $B watch prints "no work in progress". When you delete that schedule, run $B set --schedule liveness=. After $B set --reporting moves the level to or from digest, delete the running liveness schedule, create it again at the new interval, and record the new id with $B set --schedule liveness=<id>.
    • Record each ID with $B set --schedule <name>=<id>. When the landing drain schedule is recreated, record the new id with $B set --schedule drain=<id>. Report schedules only in a reply Run a service step 9 already allows. At digest, creating, recreating, or deleting a schedule is not a reply occasion. The IDs stay in restaurant.json, and list_scheduled_tasks shows each cadence and nextRunAt. A first service started by opening the restaurant, and a reply to a user's level change, may name the schedules within Digest messages. This overrides the runtime's "Report the returned cadence and nextRunAt" for a head chef at digest.
  4. Rerun python3 <skills>/brigade/scripts/brigade.py open with the same project root, name, and reporting level. Two coordinators opened at the same moment both see template purposes, so this step runs once those menus can be filled. Compare each sibling purpose it prints with this coordinator's menu.md. Keep this purpose clear of those siblings. Add any missing sibling purpose under ## Off the menu as that sibling's work. A sibling that prints purpose: not written yet has not filled its menu. Leave that sibling out of this menu until a later open prints a purpose.
  5. Run a service.

Run a service

Every wake runs this: a user message, a worker's report-back, a verifier's completion, a schedule, or a watch_pull_request wake.

  1. Read. menu.md, house-rules.md, $B status, $B 86 list. Re-read the menu every service. It is the purpose every decision answers to. $B status prints owner <thread>@<generation>. When it names another thread, end the turn with no further command. Otherwise set $B to brigade.py --at <restaurant dir> --owner <thread>@<generation>, and pass --owner <restaurant>/@<generation> on every $L lease claim, lease renew, lease release, and submit. When status prints no owner line and restaurant.json records this thread, run $B set --thread <this thread> once and read status again. A write refused with is stale means another thread replaced this one. End the service with no further command.
  2. Take tickets. Start with $B ticket take. It files each ticket a sibling handed to this restaurant. Each user request or supplier finding becomes $B ticket add. Fetch only the sources in this restaurant's intake. A ticket that is a sibling's work goes to it with $B ticket move <id> --to <sibling>. Then call t3_thread_send to the thread it prints, with mode "auto" and the line ticket <sibling>: run ticket take. A refused ticket add is not an error to work around. It means the ref is already filed, or another restaurant owns the source. Fetch supplier sources (gh issue list, gh pr list, notifications) only when the house rules name them and this restaurant owns them. Drop a ticket that is off the menu with $B ticket set <id> --state dropped and say why in the next report. At digest a dropped ticket is not a reply occasion.
  3. Group before firing. Read the waiting tickets together. Several reports of one cause are one dish. Fire a ticket alone only when it is urgent or unrelated to the rest. A ticket that is a whole program with a done predicate runs as one dish whose station is poteto-mode's Orchestrate playbook.
  4. Fire. Pick the station: the poteto-mode playbook that matches (bug fix, feature, refactoring, perf issue, investigation). Then:
    1. $B fire --tickets ... --station <playbook> --summary "<outcome>" --timebox <minutes> --paths <files and directories the dish will change> [--branch <name>]. It claims a landing lease on those paths for holder <restaurant>/<dish> before it records anything. fire refuses when this restaurant's running workers are already at --workers. A refused claim names the holder and fires nothing. A refused fire leaves the tickets waiting. On the first refusal, create the liveness schedule from First service step 3 if restaurant.json has no liveness id. Fold the tickets into the holder's dish when it is this restaurant's, or leave them waiting until that lease is released. Never pass . for a dish that touches a few files. Size the timebox to the work, 30 to 90 minutes.
    2. $B brief <dish> --fields <path>. The file is the JSON object described after the command block. --fields - reads it from stdin. The flag form single-quotes every value. Use the file or those single quotes. A double-quoted value lets the shell run backticks and expand $ before brigade.py starts. It assembles the brief from the menu, the tickets, the house rules, and the landing rules, names the dish branch, adds the exclusive-slot rule for measuring stations, and writes briefs/<dish>.md. The report section tells the worker to call t3_thread_send on the coordinator thread after the report file is written. It refuses when a field is missing, and when no coordinator thread is recorded. Run $B set --thread first. Fix the field. Never hand-write a brief.
    3. Launch the worker with t3_thread_launch: title <restaurant> <dish>: <summary>, workspaceStrategy: {"type": "worktree", "baseRef": "<trunk>", "branch": "<dish branch from the brief>", "startFromOrigin": true} (local landing mode: baseRef refs/landing/<trunk> and startFromOrigin false), a modelSelection from the station's role per the runtime's Roles section (omit it for an inherit seat), and the brief file's contents as message.
    4. $B dish <dish> --thread <threadId>.
  5. End the turn while dishes run. A worker's report-back message wakes the coordinator, which marks the dish reported with $B dish <id> --reported and reviews it per step 6. The liveness schedule, every 10 minutes or every 30 at digest, stays as the backstop for a worker that hangs or never sends the message.
  6. Review. When a worker is done, read its report and diff yourself. A worker's "done" is a claim. t3_thread_read on the worker thread returns its worktreePath and branch. Run $B dish <id> --state in-review --sha <head>. Spawn one verifier with delegate_task, mode: "async", from the verifiers role on a model family other than the author's. Its read-only brief: the tickets, the menu, the worktree path and the diff at that SHA, two questions (does it work on the real surface, and does it serve the menu without scope the tickets did not ask for), and "write your findings to <restaurant dir>/reports/<dish>-review.md". Record the verdict with $B pass record.
  7. Act on the verdict.
    • pass: write the PR title and body (what changed, the measured effect, how it was verified) to <restaurant dir>/prs/<dish>.md, then $L submit --holder <restaurant>/<dish> --branch <b> --sha <head> --lease L<n> --reviewer <provider/model> --title "..." --body-file <restaurant dir>/prs/<dish>.md, then $B dish <id> --state queued, then $L land. When it lands, $B dish <id> --state merged. In merge and human mode it opens a PR first. Record it with $B dish <id> --pr <url>, link it with link_pull_request, and call watch_pull_request on it per Pull request watching. This head chef thread owns the PR. On each wake, run $L land. Keep the watch while the dish is queued or awaiting merge. A reply, or a wake with no reply, keeps the watch. Call unwatch_pull_request only when this thread stops driving that PR. Driving stops when the dish is dropped, when its PR closes, when the queue bounces it and leaves the PR open, or when the restaurant closes. If this thread is settled, call t3_thread_organize with action: "unsettle" before the next watch_pull_request. This thread is pinned, so a merge does not auto-settle it. Mark the dish merged when a later land reports it landed.
    • Bounced by the queue: the lease is active again. Call unwatch_pull_request on the PR the bounce left open. Run $B dish <id> --state in-progress, because brief refuses a queued dish. Launch a fresh worker thread with $B brief rerun, --context naming the bounce reason, and current trunk. A conflict or a changed rebase needs a new review.
    • send-back: $B dish <id> --state in-progress, rerun $B brief (it adds the verifier's findings file), and launch a fresh worker thread on a new branch from the old branch's head. Never message the old worker to fix its own work.
    • Drop a dish in three steps. A requested interrupt is not a stop. t3_thread_interrupt can return status: "interrupt_requested" while the worker's run goes on.
      1. Call t3_thread_interrupt on its worker thread.
      2. Call t3_thread_wait on the run id it returned, or on the thread when it returned none. When the wait returns timedOut: true, leave the dish in its state. watch keeps its lease renewing. Wait again on the next service.
      3. When the wait reports a terminal state, run $B dish <id> --state dropped --stopped <run id>, or --stopped idle when the wait reported an idle thread. That releases its lease.
    • After a dish merges, is dropped, or is sent back, clean up per Git and PR housekeeping.
    • blocked: 86 add if only the user can unblock it. Otherwise fix the environment and run the pass again.
  8. Fix the recipe. When two dishes repeat the same mistake, fire a dish that runs the correct skill to make it impossible (lint, type, test, or skill). Run the reflect skill over this restaurant's threads once a week.
  9. Report. Read reporting from restaurant.json. A missing field means milestones. Send the scheduled evening report at every level. The 09:00 morning service is not a report. A batch has drained when $B status omits in progress, in review, passed review, and waiting to land. Status omits a count of zero, so a missing label is a count of zero. waiting to land is work queued to land, including a pull request that awaits merge. Send the drain summary on the wake that first finds the batch drained. A later wake that still sees the batch drained does not send that summary again. A service the user started is a turn begun by a user message. A worker report, a verifier completion, a schedule, or a pull-request wake is not a service the user started. A message from the user gets at least a one-line acknowledgment at every level. A direct question gets an answer. Each level below adds the replies it names. It does not drop the evening report, the user message, or the direct question.
    • every-turn. Send a short reply after every wake. Run $B close on the scheduled evening report, a reply that raises a decision for the user, the end of a service the user started, and closing the restaurant.
    • milestones. Reply when work merges, when a review sends work back or blocks it, when a decision needs the user, when something fails or the queue pauses, or when the user sends a message. A routine wake ends with no reply, or with a single line when the host requires text. A liveness check with nothing new, a liveness check while a review is pending, a review starting, and a worker launching are routine wakes. Run $B close on the scheduled evening report, a reply that raises a decision for the user, the end of a service the user started, and closing the restaurant.
    • digest. Reply only on these five wakes:
      1. A decision the user must make. A blocked verdict that needs the user is a decision.
      2. A failure, or a paused queue, that this thread cannot fix itself. A send-back is not a failure. A queue bounce this thread hands to a fresh worker is not a failure.
      3. One summary when a batch drains.
      4. The scheduled evening report.
      5. A message from the user. Every other wake ends the turn with no reply text at all. Those wakes include a worker's report-back, a verifier's completion, a send-back, a queue bounce, a worker launching or being replaced, a timebox raised, a review starting, a merge that does not drain the batch, a watch_pull_request wake, a landing drain run that neither drains the batch nor pauses the queue, a liveness check, intake with nothing new or only dropped tickets, a fix dish fired by step 8 or the liveness check, logging a hang for a run left open after its report-back, and creating, recreating, or deleting a schedule. A status line is still a reply. Do not send one on those wakes, even a single line. Every digest reply runs $B close --to-file once, including a failure reply and closing the restaurant. Write each reply per Digest messages below. Run $B close only on the replies named for that level above, including closing the restaurant. At digest that command is $B close --to-file. When one wake qualifies for more than one of those replies, send one reply and run $B close once. Close runs once per reply. On a reply that runs $B close, answer a direct question first. That answer sits outside the three-sentence cap. At every-turn and milestones, keep the rest to at most three sentences on what the changes mean for the menu, then the close output verbatim. It lists each ticket and dish once, under its latest state since the last report, with PR links. Write no other report file. At those two levels every other reply is plain and does not run $B close.

Digest messages

At digest, write every reply for a person who has not followed the work. Use a few plain sentences: what got done and what it means for the menu, what is next, and anything the user must decide with its default. Describe each change by what it does for the user, not by how it was built.

  • Leave out dish, ticket, and decision IDs (D<n>, T<n>, Q<n>), SHAs, file paths, branch names, review-round counts, verdicts, and tool or command names.
  • Merged pull requests may follow as a short list, one line each, a plain title linked to its PR URL.
  • $B close --to-file writes the full report under <restaurant dir>/closeouts/ and prints its path. End the message with one line that names that path, such as "Full report: <path>". That line is the only path in the message. Never paste the close output.
  • Put commits, IDs, and other engineering detail in the store, not the message. A paused queue's two commits, which the landing skill asks for, go in the $B 86 add --question text, and the full report carries them.

A drain summary reads like this:

Startup is about twice as fast, and the settings page no longer freezes when it opens. Both changes are merged. Next I start on the slow search results you reported this morning. Nothing needs your decision.

Full report: ~/.local/state/pstack-t3/brigade/app/perf/closeouts/2026-10-06T230012.481207.md

Git and PR housekeeping

The head chef owns every git and PR chore its work creates. In merge and push mode the user has no step. In human mode the user merges each PR. In local mode the user merges refs/landing/<trunk> into a branch.

  • Write each PR's title and body through submit, and link every PR with link_pull_request.
  • Keep the landing drain schedule while anything is queued or awaiting merge, per the landing skill. After the queue opens a PR, also watch it as that section says. Keep that watch across reports while the entry is queued or awaiting merge. When you delete the schedule, run $B set --schedule drain=. Call unwatch_pull_request only when this thread stops driving that PR.
  • After a dish merges, is dropped, or is sent back, read its worker thread with t3_thread_read before you archive it. If its run is still open after the report-back, call t3_thread_interrupt, then $B hang <id> --provider <provider> --minutes <n> with the provider and the minutes that read showed, then archive. A worker that an earlier attempt launched counts too. Check each attempt's thread, and for a run a replaced attempt left open, add --attempt <n>, counting attempts from 1 in launch order. If the run has already closed, archive it. Then remove its worktree, delete its branch locally and on the remote, and delete the queue's landing/e<n> branch, including a leftover landing/q<n>, once its PR merged or closed. At digest this is a routine wake with no reply.
  • After a landing, when the user's checkout at the project root is clean and on trunk, fast-forward it with git merge --ff-only. Otherwise leave it alone.
  • A bounce or a conflict is a dish for a fresh worker, never a manual rebase.
  • Never force-push trunk, rewrite published history, change branch protection, or delete a branch this restaurant did not create.

Liveness check

Run on the liveness schedule, and at the start of any service while work is in progress.

  1. $B watch. It prints one line per dish in progress, one line for each other dish not merged or dropped, one line per ticket moved to a sibling that has not filed it yet, and handed to you: <n>; run ticket take while siblings' handoffs wait in this restaurant's inbox. On handed to you, run $B ticket take. On not delivered, run the ticket move command the line prints, then message the sibling per Run a service step 2. waiting for ticket take needs nothing until the sibling's next service. For a waiting ticket whose latest log row is blocked, it prints waiting for a worker (<running> of <cap> running), waiting on L<n> (<holder>), or waiting for room in the repository (<n> of <n> changes in flight), the first that holds now. An unblocked line names a shell-quoted fire command. Run it as printed. That is the fire in steps 3 and 4 of Run a service for those tickets. watch renews the lease of every dish in progress, in review, passed, sent back, or parked, and prints nothing for a live one. It updates lastActivityAt after a pass that renewed every live lease, so walk marks a restaurant whose leases stopped renewing. A submitted lease is the queue's. Act on these lines.
    • D3: lease L4 expired; stop its worker, then run lease renew L4. Call t3_thread_interrupt on the worker thread, then t3_thread_wait on the run id it returned. When the wait returns timedOut: true, leave the lease expired and the dish as it is, run no lease renew, and wait again on the next service. Only after the wait reports a terminal state, run $L lease renew L4 --owner <restaurant>/@<generation>. It admits the lease again, or refuses with the overlap or cap message. On a refusal, park the dish with 86 add when only the user can unblock it, and run the renew again on a later service.
    • D3: lease L4 was released; claim again before submitting. Claim the paths with $L lease claim and record it with $B dish D3 --lease <id> --paths <paths> before any submit.
    • D3: could not renew L4: <error>. The landing store did not answer. Fix that cause. lastActivityAt does not move until a pass renews every live lease.
    • D2: in review, D3: passed, not submitted, D4: parked, and D5: sent back keep the liveness schedule alive. Act on them per Run a service steps 6 and 7.
    • For a passed or queued dish, watch reads land.py status --holder <restaurant>/<dish> --sha <dish sha> and takes the highest entry at exactly the dish's SHA. D1: landed as E1 (<commit>); mark it merged: run $B dish D1 --state merged. D2: E3 awaiting merge <pr url>; watch that PR: call watch_pull_request on that PR, because this thread owns it even when a sibling's land opened it. D4: E4 bounced: <reason>: follow the bounce step in Run a service step 7. D5: E6 already submitted; mark it queued: run $B dish D5 --state queued. That recovers a crash between submit and dish --state queued. D6: E7 queued needs nothing until the queue moves.
  2. "report written, no report-back" is a defect. The report file exists and the dish is not marked reported. Read the worker thread with t3_thread_read and view set to "activity". Find why the message never arrived. The brief lacked the send step, the worker skipped it, t3_thread_send failed or went to the wrong thread, or the timebox ran out. Fire a fix at that cause, in the brief template, the skill text the worker followed, or brigade.py, using the correct skill.
  3. A "report written" line that does not say "no report-back", and a line reported, run still open Nm, mean the worker reported back. The number is minutes since the report file was written. The script has not read the thread. Read the worker thread with t3_thread_read. If its run is still open, call t3_thread_interrupt, then $B hang <id> --provider <provider> --minutes <n> with the provider and the minutes that read showed. Then review per Run a service step 6. At digest this is a routine wake with no reply.
  4. "over its timebox": t3_thread_read the thread with view: "activity" and afterPosition. When it made progress in the last 10 minutes, raise the timebox once with $B dish <id> --timebox <m>. Otherwise interrupt it and launch a fresh worker with a smaller scope, or park the dish with 86 add when only the user can unblock it. Recording the fresh worker's thread with $B dish <id> --thread <thread id> starts its attempt while the dish stays in progress. The previous report and report-back mark belong to the worker you replaced. $B watch compares the report file to this new start.
  5. "running": nothing new. Reply per Run a service step 9. At milestones this is a routine wake, so end with no reply, or with a single line when the host requires text. At digest, end the turn with no reply text at all. At every-turn, send a short reply. A dish in in-review or passed is not this line.
  6. When $B watch prints "no work in progress", delete the liveness schedule with delete_scheduled_task, then run $B set --schedule liveness=. Delete it only on that line. A blocked ticket is not that line, so the schedule stays while one is waiting. Do not treat that line as a drained batch. A batch has drained when step 9 says it has. The drain summary is sent on the wake that first finds the batch drained. A review still pending means the batch has not drained. Do not send the drain summary while a review is pending. Reply per step 9.

Executive chef's view

python3 <skills>/brigade/scripts/brigade.py walk groups every restaurant under its repository. Each repository gets one header with its landing queue's status line, or no landing contract. Under it, each restaurant gets its reporting level and counts, with the waiting tickets whose block still holds counted as blocked. A second line names its thread ID and the unreleased leases its dishes hold. Open decisions follow. walk --repo <root> prints one repository. A restaurant idle past 24 hours is marked, so a stalled head chef shows. $B status prints the reporting level, the landing mode as lands by <mode> or no landing contract, then the counts. A restaurant.json with no reporting field reads as milestones.

Close a restaurant

First, for every dish that still holds an active lease, run the three drop steps in Run a service step 7: t3_thread_interrupt, then t3_thread_wait, then $B dish <id> --state dropped --stopped <run id> only after a terminal state. $B close writes reports and releases nothing. When any wait returns timedOut: true, stop here. Keep every schedule, so watch keeps that lease renewing, and continue closing on a later service once every wait has reported a terminal state. Then call unwatch_pull_request on each PR this thread is still watching. Delete its schedules with delete_scheduled_task, then clear each recorded name with $B set --schedule <name>=. Run $B close one last time, or $B close --to-file at digest. That close is the closing reply step 9 names. Unpin the thread with t3_thread_organize. Leave the store. It is the record.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.