Skip to content
Skills Library
AI & agents · Automation

delegate-build

/delegate-build

After a design/decision discussion (e.g. via grilling or grill-me) has settled a plan, hand the implementation to sub-agents so the main session's context stays clean of implementation noise, while publishing a live status-board artifact so the user can see sub-agent progress without it costing sub-agent context. Use when the user says things like "let sub-agents build this", "have sub-agents implement it", or after a grilling session concludes and they want to move straight to implementation.

Licence
MIT
Last repository change
12.11.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
6
Scripts
1
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 12.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 1 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: helpers/build.js

What it does and when to use it

After a design/decision discussion (e.g. via grilling or grill-me) has settled a plan, hand the implementation to sub-agents so the main session's context stays clean of implementation noise, while publishing a live status-board artifact so the user can see sub-agent progress without it costing sub-agent context. Use when the user says things like "let sub-agents build this", "have sub-agents implement it", or after a grilling session concludes and they want to move straight to implementation.

Triggers from the description

let sub-agents build thishave sub-agents implement it
Original author description

After a design/decision discussion (e.g. via grilling or grill-me) has settled a plan, hand the implementation to sub-agents so the main session's context stays clean of implementation noise, while publishing a live status-board artifact so the user can see sub-agent progress without it costing sub-agent context. Use when the user says things like "let sub-agents build this", "have sub-agents implement it", or after a grilling session concludes and they want to move straight to implementation.

How it works

  1. Process
  2. PR watchdog
  3. Notes
Original SKILL.md headings · 60 lines, 2,289 words
SKILL.md preview
---
description: After a design/decision discussion (e.g. via grilling or grill-me) has settled a plan, hand the implementation to sub-agents so the main session's context stays clean of implementation noise, while publishing a live status-board artifact so the user can see sub-agent progress without it costing sub-agent context. Use when the user says things like "let sub-agents build this", "have sub-agents implement it", or after a grilling session concludes and they want to move straight to implementation.
name: delegate-build
---

# Delegate build

The user decides in the main session (often via a grilling skill, such as `grilling` from github.com/mattpocock/skills); sub-agents build, review and integrate. The main session **orchestrates**: it breaks down the plan, seeds the board, runs `helpers/build.js` (a Workflow script that launches, reviews and integrates), relays blocked questions and talks to the user. The main session stays **thin**: every command on the implementation (tests, lint, git surgery, a smoke test) and every read of it (fact-finding, checking the plan against the code, answering the user's questions after the run) runs inside a sub-agent, a read-only one for reads, because its output is the context this skill keeps out of the main session. A status-board artifact shows the user progress live, fed by the sub-agents' own `ArtifactData` writes.

Use it for any settled plan, down to one small feature. A single behavior change of a few commits takes the **light path**: one task, no `integrationChecks`, no integrator row; the script builds and reviews it, and its reviewed branch is the result.

## Process

1. **Break the plan into tasks.** Each task is self-contained: a sub-agent finishes it without asking the main session anything. Size each task to land in well under 150 tool calls; past that a builder's context runs to 300-500k and the brief's rules stop holding. Estimate in behavior changes and commits, not files: generated output (locales, the API client, `schema.rb`) is one command, and a task is a few behavior changes landing as a few new commits. Building a tool or client and using it to produce N outputs are separate tasks. Rewriting history is its own kind of task: folding into, splitting or replaying existing commits costs a verification per commit touched, so give each such task one or two target commits, and re-verify only the commit that received a change (plus later commits touching the same files). Recreating a branch on a new base is building, not rewriting: group the old commits by what they touch, whatever their place in the old log. Give each task a kebab-case id, a title and its **prerequisites**: the tasks whose code or interface it calls. Prerequisites are code dependencies only; shared files and the final commit order are the integrator's to handle (step 6). For a plan spanning several PRs, state the cheapest alternative that meets the issue first, and ask the user when the discussion never weighed it. Write the plan's decisions down as a numbered list; step 5 puts it where every agent reads it. Prefer vertical tasks, each a reviewer can verify end to end. Done when every decision maps to at least one task and every task lists its prerequisites, most of them none.

2. **Get the board.** The board belongs to the Quartermaster work item, so sessions on one item share it.
   - Linked session: `qm board <slug>` prints the board URL, or exits non-zero when there is none. With a URL, reuse the board as it is.
   - No URL, or no work item: load `artifact-capabilities` if this session hasn't, publish the output of `realpath helpers/status-board.html` (a symlinked path forces the full consent dialog) via `Artifact` with `capabilities: {db: {}}` and an `icon`, then record it with `qm board <slug> <url>` when linked.
   - Republish the page only when the template changed; publishing to the same `url` keeps the rows.

3. **Seed the batch's rows.** Batch id: the output of `date -u +%Y-%m-%dT%H:%M`. Batch label: a few words ("auth provider tasks"). Send one `ArtifactData` call, `action: "batch"`, with one `writes` entry per task: `{op: "set", collection: "tasks", doc_id: "<task-id>", data: {status: "queued", title, note: "", order: <index>, dependsOn: [<prerequisite ids>], batch, batchLabel, updatedAt: <output of `date -u +%Y-%m-%dT%H:%M:%SZ`>}}` (the trailing `Z` matters: without it the board reads the UTC time as local and shows it hours off; every later write by the orchestrator uses a fresh one of these, never a typed time) and no `if_version`, since each write creates its row. Unless the light path applies, add one more entry for the integrator: doc_id `integrate-<batch id>` (passed as `integrateId` in step 6), title "Integrate", `dependsOn` every task id, last `order`. When the run will `explore` (step 6), add one more for the explorer: doc_id `explore-<batch id>` (passed as `exploreId`), title "Explore", `order: -1`, no `dependsOn`; the tasks' `dependsOn` stays as it is. A batch refused because a row already exists means an earlier batch used that task id; prefix the new ids and resend. Done when the batch succeeded, before any launch.

4. **Check the model.** On a non-Opus main session, ask the user (`AskUserQuestion`) whether sub-agents run on the main session's model or on Opus, and pass the answer as `model` on every `Agent` call of this build.

5. **Write the plan file.** Make a run directory, `<scratchpad>/delegate-build/<batch id>/`, with an empty `answers/` in it. In a linked session, register that folder so qm's side panel shows an answer box under a blocked row: `qm board <slug> <board url> --answers-dir <run dir>/answers`. Write `plan.md` there: the numbered decisions from step 1, restated in full, since every agent starts with none of the discussion. Copy the real data the tasks rest on (API responses, discovery output, fixtures from earlier sessions) into the run directory and cite those paths in `plan.md`, rather than restating field names from memory. Each task's `brief` (below) restates the task and the decisions it rests on in a few sentences; it may cite decisions by number, and it names the docs, sections and functions the task needs rather than "read the area pages".

6. **Run the build.** Run `git fetch origin` once. Then call `Workflow` with `scriptPath: <this skill>/helpers/build.js` and `args`:
   - `helpersDir` (absolute), `planFile`, `boardUrl`, `answersDir`, `integrateId` from step 3;
   - `tasks`: `[{id, title, brief, dependsOn}]`, ids and prerequisites as on the board;
   - `base`: the output of `git rev-parse origin/main` (or of the branch the run builds on); `model` from step 4; `maxSpawns` to change the gap cap (below, default 2);
   - `explore: "<what to map>"` when several tasks work in the same unfamiliar area: one read-only explorer first maps it into the run directory's `exploration.md` for every later agent, reporting on its `exploreId` row from step 3;
   - `queueFile` for a mid-run queue (below);
   - `integration`: the project's convention for landing the branches, and `integrationChecks`: the cross-task checks the plan calls for (the full suite, a smoke test).

   Launch from inside the repo and keep the session's working directory there until the run ends: every agent's worktree is created from it, so a `cd` elsewhere in the main session (a scratchpad, home) makes the next agent fail with `WorktreeIsolationError` and kills the run. Use absolute paths instead of `cd` meanwhile; after such a failure, `cd` back into the repo and resume.

   In the script, every task launches the moment its prerequisites are reviewed (in a worktree, starting from their reviewed branches), each builder gets a fresh reviewer, a builder that hands back at its budget gets up to two continuation builders, one integrator lands the reviewed tasks in dependency order, re-verifying as it goes, and, off the light path, two read-only agents then read the green integrated branch side by side: one checks it against every plan decision (proposer `spec`), one reviews the whole diff with the repo's review skills for what per-task reviewers could not see, such as logic duplicated across tasks or code reworked by a later commit (proposer `review`). Both report findings as follow-ups. Agents read `BRIEF_RULES.md` and `STATUS_ADDENDUM.md` themselves. In a linked session, `qm note` the run id.

   **Follow-ups and gaps.** Builders, reviewers and the integrator may propose follow-up tasks (`followUps`; the integration-gap definition is in `BRIEF_RULES.md`). Only a reviewer's and the integrator's lists count. A proposal labelled gap gets a cheap checker; a confirmed gap is built automatically, at most `maxSpawns` per run: mid-run as `<proposer>-gap-<n>` after its proposer, integrated with the rest; from the integrator, on its branch, then reviewed and appended. Its agents create its board row. A spawned task's own gaps are never built (depth 1). Everything else comes back as a follow-up.

   **Adding a task mid-run** needs a queue, which costs a queue-reading agent per settle, so set one up only when the user signals they may add work mid-run; otherwise new work is a follow-up run. The queue: `queue.json` holding `[]` in the run directory, passed as `queueFile`. To add a task, seed its board row (step 3's shape, same batch), append any new decisions to `plan.md`, and append the task (`{id, title, brief, dependsOn}`) to `queue.json`, keeping the earlier entries: rewrite the whole array. It joins at the next settle and is integrated with the rest. An entry naming an unknown prerequisite is rejected once (the run log says so); fix it under a new id. Once the integrator has started, the queue is closed.

   While it runs, answer blocked questions. An agent that needs a decision sends a message starting `BLOCKED <id>:` and waits for its answer file. Every such question goes to the user, git plumbing included. In a linked session they answer on the blocked row in qm's side panel, which writes `<answersDir>/<id>.md` itself: tell them in one line which row waits and its question, without `AskUserQuestion`; if they answer in chat instead, Write that answer to the file. In an unlinked session, ask them (`AskUserQuestion`) and Write their answer to `<answersDir>/<id>.md`. `STOP` as the answer makes the agent hand back what it has. Tasks that depend on a blocked one stay queued, and the rest keep going.

7. **Read the result.** It arrives inline in the notification; from the Workflow output file (`{summary, agentCount, logs, result}`), `jq '.result | {green, notGreen, conflicts, integration: .integration | {finalBranch, finalTip, layers, keep}}' <file>` pulls the essentials. `result.tasks` lists every task, spawned ones included, as `reviewed` (branch, verdict, findings, conflicts, removed guards), `failed`, `incomplete` or `skipped` (a prerequisite didn't make it); `integration` adds the integrator's branch and verdict, its `finalTip` taken after any appended gaps; `spawned` and `followUps` close it. Top-level `green` is true only when every task reviewed and the integration is green, with `notGreen` saying why not; fast-forward or call the run done only when it is true. Bring every `conflicts` entry (a plan decision against the repo's standards) to the user. Set each row that didn't reach `done` to `blocked` with the reason in `note`, and bring those to them too. A follow-up run for them takes the integrated branch as `base`.
   - **Named branches**: create or move each requested branch with `git branch -f <name> <sha>`: `finalTip` for one branch, each `layers` sha for a stack (the top layer takes `finalTip` when gaps were appended). In a linked session, `qm link-branch <slug> <branch>` for each.
   - **Worktrees**: every agent's worktree stays behind once it committed something. First regenerate or copy out each `keep` output, then remove the run's worktrees with `git worktree remove .claude/worktrees/<run id>-<n>`, one per path that `git worktree list` shows for this run. Their branches stay.
   - A log line `explorer died` means its row never finished: set it to `blocked` with that line as `note`.
   - If the run itself died, resume it: `Workflow({scriptPath, resumeFromRunId})`.

8. **Summarize from the result.** The board feeds itself and the user watches it live, so leave it unread. Open a diff only when the result looks off or a task didn't reach `reviewed`. Give the user one or two sentences on what shipped, plus the board URL. In a linked session, keep the plan: copy `plan.md` to `~/.claude/quartermaster/plans/<slug>/<batch id>.md` (any `exploration.md` beside it, as `<batch id>-exploration.md`), record that path in a `qm note`, and point the PR body and the watchdog's prompt at it. When `followUps` is non-empty, list them as numbered one-liners (title, decision, proposer's reason) and ask "run these?", the `spec` and `review` findings included: they are never built automatically; in a linked session record them as one `open` qm note. On a yes, they become a follow-up run with the final branch as `base`. Every change after the run (the user's review comments, Copilot findings, any fix) is a light-path run with `base` = the run's branch, its named branch then moved as in step 7.

9. **Launch one PR watchdog** once any branch of this build is a live PR.

## PR watchdog

Launch one fresh `Agent` (not a fork: a fork inherits the orchestration transcript, which misleads its judgment). Its prompt: the PRs and branches it owns; a distilled summary of the decisions, rejected alternatives included, so it can tell a deliberate choice from a miss; and "read and follow `<helpers>/WATCHDOG.md` and `<helpers>/BRIEF_RULES.md`". For each later PR, `SendMessage` the same watchdog. Relay each question and each pending push it sends to the user (`AskUserQuestion`), and their answer back. When it dies (sleep, an API error), `SendMessage` it to resume; after a second death, tell the user and, in a linked session, record an `open` qm note. When it hands back at its budget, launch a fresh one with that handback in its prompt.

## Notes

- A decision only the user can make is a `blocked` row; surface it to them the same way.
- A check no sub-agent can run from its worktree (a UI change needing a real browser) goes to a sub-agent with the right tools, such as Chrome. Run it in the main session only when that costs less, and tell the user you did. For screenshots of a UI change, brief that sub-agent to follow the project's screenshot skill, if it has one, one fresh agent per capture run; the main session attaches the PNGs to the PR.
- An unlinked session gets a throwaway board that nothing records; a board is never shared across work items.
Files in this package (6)
  • SKILL.md 14 KB
  • helpers/BRIEF_RULES.md 5 KB
  • helpers/STATUS_ADDENDUM.md 2 KB
  • helpers/WATCHDOG.md 2 KB
  • helpers/build.js 31 KB
  • helpers/status-board.html 13 KB

Versions

The database has no other skills named delegate-build.

Database snapshot: 13.11.2026 · package version e69d9c6c59e9 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100sub-agent-delegation
    Delegate work to subagents in the Claude Agent SDK: define them with the agents option (AgentDefinition), restrict their tools, pass the right context in the Agent tool prompt, detect subagent messages, resume subagents, and cap depth, concurrency, and spend. Use this skill when…
  • 100delegate
    Delegate mode. The main session judges, scouts read and search, executors write and run; saves the expensive model's quota. Use for "/shipright:delegate", "delegate mode", or when about to do large read or write work by hand.
  • 90delegate
    Delegate a bounded task with /delegate and a self-contained brief. Use when work is independent, parallel, or needs a fresh context, and the parent must keep the scope, the diff review, and the checks.
  • 90delegated-review-loop
    Run a delegated build-review-improve loop when the user explicitly invokes this skill or explicitly asks to have sub-agents build and iteratively review the work. A worker sub-agent produces the artifact (with an optional scout sub-agent gathering context first), a task-matched…
  • 100agent-mode
    Working mode with subagents. The main session stays free for the conversation, the actual work is done by subagents in the background. Load as soon as the user asks for agents or subagents to be used, e.g. "nutze Agenten", "arbeite mit Subagenten", "mach das über Agenten",…
  • 90subagent-prompt
    Produce a comprehensive prompt that hands off the current session's work to a fresh session for sub-agent-orchestrated execution. Use when the user wants to execute discussed/planned work in a new session, run a job to completion via sub-agents, or generate a portable handoff…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.