Skip to content

Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.

feat(cli): one sentence to an agent starts the team [N31,N32,I9]

Corey Olson6d37c6d3957b
diff --git a/docs/proof/run-mutants.mjs b/docs/proof/run-mutants.mjs
new file mode 100644
index 00000000..f7c064a3
--- /dev/null
+++ b/docs/proof/run-mutants.mjs
@@ -0,0 +1,26 @@
+/**
+ * The proof that one sentence to an agent starts the team (item #66): the run guide (N31), the
+ * coordinator's resume (N32) and init's word to an agent (I9). Each change below removes one of
+ * them, and its test must go red. The harness works on a temporary copy, never a real checkout.
+ *
+ * Run it from the repo root: node docs/proof/run-mutants.mjs
+ */
+import { audit } from './harness.mjs';
+
+const GUIDE = ['test/practice.test.js', 'the run guide takes one agent through the whole team'];
+const STAGES = ['test/e2e.test.js', "the coordinator's resume names its next step"];
+
+/** Row, the change, its edits as [file, from, to], the test that judges it, and the outcome expected. */
+const MUTANTS = [
+ ['N31', 'init and prompt know no run guide', [['src/skills.js', " run: 'pullboard-run',\n", '']], GUIDE, 'red'],
+ ['N31', 'AGENTS.md does not name the run guide', [['src/templates.js', ' The agent in the main checkout runs the whole team by the run guide (the pullboard-run skill).', '']], GUIDE, 'red'],
+ ['N31', 'the guide drops the rule against merging unverified history', [['skills/pullboard-run/SKILL.md', ' Never merge a commit whose history holds another item\'s commit that is not yet verified.', ' Merge in any order.']], GUIDE, 'red'],
+ ['N32', 'an empty spec is not sent to the person', [['src/cli.js', " if (!live.length) return \"turn what the person wants into spec rows with them: the pullboard-decompose skill (pullboard prompt decompose)\";\n", '']], STAGES, 'red'],
+ ['N32', 'draft rows are planned before the person approves them', [['src/cli.js', " if (!approved.length) return 'the person approves rows in SPEC.md; then plan them: the pullboard-plan skill';\n", '']], STAGES, 'red'],
+ ['N32', 'verified work is never named for merging', [['src/cli.js', ' if (card.toMerge.length) {', ' if (false) {']], STAGES, 'red'],
+ ['N32', 'open items get no builders', [['src/cli.js', ' if (card.open.length) {\n const lanes', ' if (false) {\n const lanes']], STAGES, 'red'],
+ ['N32', 'approved rows no item cites are never planned', [['src/cli.js', ' if (unplanned.length) {', ' if (false) {']], STAGES, 'red'],
+ ['I9', 'init says nothing to an agent', [['src/cli.js', " io.say('with an agent: start a new Claude Code session here, which loads the pullboard skills, then tell it what to build; the pullboard-run skill runs the team');\n", '']], STAGES, 'red'],
+];
+
+audit(MUTANTS);
diff --git a/skills/pullboard-run/SKILL.md b/skills/pullboard-run/SKILL.md
new file mode 100644
index 00000000..8781cc5d
--- /dev/null
+++ b/skills/pullboard-run/SKILL.md
@@ -0,0 +1,36 @@
+---
+name: pullboard-run
+description: Run the whole build as the coordinator. Take the spec with the person, plan it, then build and verify it through subagents in their own worktrees, and merge what is verified. Use when the person asks you to build something in a repo that runs on pullboard, says "use pullboard", "run the team" or "build this", or when pullboard resume names a step for the coordinator.
+---
+
+# Run the team
+
+You are the coordinator: the agent in the repo's main checkout. You talk with the person, keep the board moving and merge verified work. Lane items are built by builder agents in their own worktrees, never by you. You never verify work you built.
+
+**Start in the repo.** Subagents inherit the session that starts them, and pullboard's session hook runs only for a session started here. Begin each session with `pullboard resume`, which reads the board and SPEC.md and names your next step.
+
+1. **Spec, with the person.** If SPEC.md has no rows for what they want, follow the pullboard-decompose skill: one question at a time, rows as drafts. Only the person approves a row. A yes relayed by another agent is not theirs.
+2. **Lanes.** Builders can only commit inside their lane's folders. If `pullboard lanes` shows nothing that fits the work, propose lanes in pullboard.json to the person, plus a `review` lane that owns no folders. Commit them once agreed.
+3. **Plan.** Follow the pullboard-plan skill, or give it to a subagent: one item per verifiable piece, in the lane that owns its files. Each has a criterion a stranger could check, and `--after` where one waits on another.
+4. **Build: one builder subagent per lane.** For each lane with open items, run `pullboard worktree <lane>` here in the main checkout. It makes the lane's worktree and prints the opening lines for its builder. Start a subagent with those lines and this task: "Run pullboard next. Build the item inside your lane's folders, commit citing its rows, and run pullboard submit. Repeat until pullboard next finds nothing. Report every refusal word for word." Lanes run side by side. A builder waiting on another lane takes other work, or waits with `pullboard next --wait 9`.
+5. **Verify: a subagent that built nothing.** Run `pullboard worktree review` once and start a subagent with its opening lines and this task: "Follow the pullboard-verify skill. Run pullboard next --verify, check out the commit it names, and prove or disprove the frozen criterion. Record the verdict. Repeat until nothing is left to verify." If another model family is available, such as Codex, let it verify: different families miss different things.
+6. **Merge what is verified.** For each verified item, in the order verified:
+ - run `git merge --no-edit <its commit>` here;
+ - run the gate;
+ - record it with `pullboard merged <id> <merge commit>`.
+ Never merge a commit whose history holds another item's commit that is not yet verified. A builder who stacked work on a rejected commit waits for that commit's fix.
+7. **Sent back.** A rejected item reopens in its lane. Keep its builder running until the lane's items are verified, not just submitted.
+8. **Ask, never guess.** Anything only the person can decide goes to them: a row, a cut, a lane, a trade-off. Ask in this conversation. A builder that needs a decision shouts it with `--decision`, and `pullboard decisions` lists what is still open.
+9. **Report.** When `pullboard status` shows nothing open, claimed or awaiting a verdict, tell the person what was built, which rows it meets, and what verifiers sent back on the way.
+
+```
+pullboard resume
+pullboard worktree web # prints the web builder's opening lines
+pullboard worktree review # prints the verifier's opening lines
+git merge --no-edit <commit> && pullboard gate && pullboard merged 3 $(git rev-parse HEAD)
+pullboard status
+```
+
+## Done
+
+Every approved row is cited by an item that is verified and merged, or the person has decided it needs none. `pullboard status` shows nothing open, claimed or awaiting a verdict.
diff --git a/src/cli.js b/src/cli.js
index f6084b85..5b0352d9 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -475,6 +475,37 @@ const firstLine = (text) => {
return line.length > 100 ? `${line.slice(0, 99)}…` : line;
};
+/**
+ * The coordinator's next step, from the board and the spec (N32): the spec with the person first,
+ * then the plan, then verdicts, merges and builders, so an agent that runs the team by the run guide
+ * always knows where it is.
+ *
+ * @param {any} card
+ * @param {{ id: string, status: string }[]} rows
+ * @returns {string}
+ */
+function coordinatorNext(card, rows) {
+ const live = rows.filter((row) => !['wont', 'retired'].includes(row.status));
+ if (!live.length) return "turn what the person wants into spec rows with them: the pullboard-decompose skill (pullboard prompt decompose)";
+ const approved = live.filter((row) => row.status === 'approved');
+ if (!approved.length) return 'the person approves rows in SPEC.md; then plan them: the pullboard-plan skill';
+ if (card.toVerify.length) return 'pullboard next --verify --as coordinator, or a verifier that built nothing: pullboard worktree review';
+ if (card.toMerge.length) {
+ const [first] = card.toMerge;
+ return `merge #${first.item_id}: git merge --no-edit ${first.item_commit.slice(0, 12)}, run the gate, then pullboard merged ${first.item_id} <merge commit>`;
+ }
+ if (card.open.length) {
+ const lanes = [...new Set(card.open.map((item) => item.item_lane))];
+ return `start a builder for each lane with open items (${lanes.join(', ')}): pullboard worktree <lane>, then the pullboard-run skill`;
+ }
+ const cited = new Set(card.all.flatMap((item) => (item.item_spec_ids ?? '').split(',').filter(Boolean)));
+ const unplanned = approved.filter((row) => !cited.has(row.id));
+ if (unplanned.length) {
+ return `plan the approved rows no item cites (${unplanned.slice(0, 4).map((row) => row.id).join(', ')}${unplanned.length > 4 ? ', ...' : ''}): the pullboard-plan skill`;
+ }
+ return 'nothing open: report what was built to the person, or curate the queue: pullboard add, edit, hold';
+}
+
/**
* `pullboard resume` (N19): one short card that puts an agent back to work after a fresh start,
* a restart or a compaction, from the board rather than from a summary.
@@ -545,7 +576,7 @@ function resumeHere(io) {
let next;
if (card.holding.length) next = `build #${card.holding[0].item_id}, commit, then pullboard submit ${card.holding[0].item_id}`;
else if (card.sentBack.length) next = `pullboard claim ${card.sentBack[0].item.item_id}, fix what the verifier found, and submit again`;
- else if (isMain) next = card.toVerify.length ? 'pullboard next --verify --as coordinator' : 'curate the queue: pullboard add, edit, hold';
+ else if (isMain) next = coordinatorNext(card, loadSpec(root, ctx.config).rows);
else if (card.hold) next = 'wait for the hold to lift: pullboard next --wait 9 (minutes)';
else if (ready) next = `pullboard next (${ready} ready in your lane)`;
else if (inLane.length) next = `pullboard next --wait 9 (minutes); ${inLane.length} in your lane ${inLane.length === 1 ? 'waits' : 'wait'} on other work`;
@@ -607,6 +638,7 @@ function setupCommands(io, { first, values }) {
notes.forEach((note) => io.say(note));
if (registerProject(info.root)) io.say('registered this project on this machine, so pullboard view lists it');
io.say('next: write SPEC.md rows, declare lanes in pullboard.json, then: pullboard add <lane> <title>');
+ io.say('with an agent: start a new Claude Code session here, which loads the pullboard skills, then tell it what to build; the pullboard-run skill runs the team');
return 0;
},
hooks: () => {
diff --git a/src/skills.js b/src/skills.js
index c162ec5e..f98e24fb 100644
--- a/src/skills.js
+++ b/src/skills.js
@@ -20,6 +20,7 @@ export const ROLES = {
signoff: 'pullboard-signoff',
review: 'pullboard-spec-review',
verify: 'pullboard-verify',
+ run: 'pullboard-run',
};
/**
diff --git a/src/templates.js b/src/templates.js
index 081e4b3c..f5ff5710 100644
--- a/src/templates.js
+++ b/src/templates.js
@@ -123,7 +123,7 @@ This repo runs on pullboard: a work board, lanes and a spec that live in git. No
**House rules.** \`PRACTICE.md\` holds how this project is built, in the same row format. Its approved rows are in force; follow them as you would the spec.
-**Role guides.** \`pullboard prompt decompose\`, \`signoff\`, \`review\` and \`verify\` print the guide for each role. Claude Code also has them as skills.
+**Role guides.** \`pullboard prompt run\`, \`decompose\`, \`plan\`, \`signoff\`, \`review\` and \`verify\` print the guide for each role. Claude Code also has them as skills. The agent in the main checkout runs the whole team by the run guide (the pullboard-run skill).
**Who you are.** An agent is its worktree. The main checkout is the coordinator. Every other agent gets its own worktree, already joined to one lane, from the main checkout:
diff --git a/test/e2e.test.js b/test/e2e.test.js
index ab92a395..abfabd7a 100644
--- a/test/e2e.test.js
+++ b/test/e2e.test.js
@@ -153,6 +153,36 @@ test("init's spec has its sections and no rows, and the README's example fits un
assert.match(check.out, new RegExp(`SPEC.md: ${rows.length} rows, 0 errors`));
});
+test("the coordinator's resume names its next step from the spec and the board, stage by stage [N32, I9]", () => {
+ const next = (box, cwd) => /^next: (.*)$/m.exec(box.run(cwd, 'resume').out)?.[1] ?? '';
+ const fresh = sandbox();
+ const repo = join(fresh.dir, 'fresh');
+ mkdirSync(repo);
+ fresh.git(repo, 'init', '-q', '-b', 'main');
+ const initialized = fresh.run(repo, 'init');
+ assert.match(initialized.out, /with an agent: start a new Claude Code session here, which loads the pullboard skills, then tell it what to build/, 'init tells an agent to start a new session [I9]');
+ assert.match(next(fresh, repo), /^turn what the person wants into spec rows with them: the pullboard-decompose skill/);
+ writeFileSync(join(repo, 'SPEC.md'), '# Fresh\n\n## G · Goals\n- G1 [draft, must] It works. | gate: test\n');
+ assert.match(next(fresh, repo), /^the person approves rows in SPEC.md; then plan them/);
+
+ const box = project();
+ assert.match(next(box, box.repo), /^plan the approved rows no item cites \(G1, G2\): the pullboard-plan skill/);
+ box.run(box.repo, 'add', 'web', 'Page', '--specs', 'G1');
+ assert.match(next(box, box.repo), /^start a builder for each lane with open items \(web\): pullboard worktree <lane>/);
+ assert.equal(box.run(box.web, 'claim', '1').code, 0);
+ assert.equal(commitFile(box, box.web, 'web/index.html', '<h1>hi</h1>', 'feat(web): page [G1]').status, 0);
+ assert.equal(box.run(box.web, 'submit', '1').code, 0);
+ assert.match(next(box, box.repo), /^pullboard next --verify --as coordinator, or a verifier that built nothing: pullboard worktree review/);
+ const commit = box.git(box.web, 'rev-parse', 'HEAD');
+ box.git(box.repo, 'switch', '-q', '--detach', commit);
+ assert.equal(box.run(box.repo, 'verify', '1', 'accept', '--note', 'the page renders hi', '--as', 'coordinator').code, 0);
+ box.git(box.repo, 'switch', '-q', 'main');
+ assert.match(next(box, box.repo), new RegExp(`^merge #1: git merge --no-edit ${commit.slice(0, 12)}, run the gate, then pullboard merged 1 <merge commit>`));
+ box.git(box.repo, 'merge', '-q', '--no-edit', commit);
+ assert.equal(box.run(box.repo, 'merged', '1', box.git(box.repo, 'rev-parse', 'HEAD')).code, 0);
+ assert.match(next(box, box.repo), /^plan the approved rows no item cites \(G2\)/);
+});
+
test('spec check lints both files; spec view writes one page into the git dir [S6, S7]', () => {
const box = project();
writeFileSync(join(box.repo, 'PRACTICE.md'), '# Practice\n\n## C · Code\n- C1 [approved, must] Functions under 60 lines.\n');
diff --git a/test/practice.test.js b/test/practice.test.js
index 5ff2299f..e0e5d614 100644
--- a/test/practice.test.js
+++ b/test/practice.test.js
@@ -3,13 +3,13 @@
* and every role guide prints, with a repo's own override taking precedence.
*/
import assert from 'node:assert/strict';
-import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
+import { existsSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { test } from 'node:test';
import { ROLES, installSkills, promptFor, withoutFrontMatter } from '../src/skills.js';
import { lintSpec, parseSpec } from '../src/spec.js';
-import { practiceTemplate } from '../src/templates.js';
+import { agentsBlock, practiceTemplate } from '../src/templates.js';
test('the standard practice lints clean, and every approved must-row names its enforcer [S6]', () => {
const practice = parseSpec(practiceTemplate());
@@ -20,6 +20,36 @@ test('the standard practice lints clean, and every approved must-row names its e
assert.ok(approvedMusts.every((row) => row.gate));
});
+test('the run guide takes one agent through the whole team, and init installs it beside the others [N31]', () => {
+ const root = mkdtempSync(join(tmpdir(), 'pullboard-run-'));
+ try {
+ const guide = promptFor(root, 'run');
+ assert.ok(guide.startsWith('# Run the team'));
+ for (const step of [
+ 'pullboard resume',
+ 'pullboard-decompose',
+ 'Only the person approves a row',
+ 'pullboard-plan',
+ 'pullboard worktree <lane>',
+ 'pullboard worktree review',
+ 'pullboard-verify',
+ 'git merge --no-edit',
+ 'pullboard merged',
+ 'not yet verified',
+ 'never by you',
+ 'Ask, never guess',
+ ]) {
+ assert.ok(guide.includes(step), `the run guide says: ${step}`);
+ }
+ assert.match(installSkills(root)[0], /pullboard-run/);
+ assert.ok(existsSync(join(root, '.claude', 'skills', 'pullboard-run', 'SKILL.md')), 'init installs it as a skill');
+ assert.match(agentsBlock(), /pullboard prompt run/, 'AGENTS.md names it');
+ assert.match(agentsBlock(), /pullboard-run skill/);
+ } finally {
+ rmSync(root, { recursive: true, force: true });
+ }
+});
+
test('every role prints its guide without front matter [N6]', () => {
const root = mkdtempSync(join(tmpdir(), 'pullboard-prompt-'));
try {