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.
JavaScript agentic-codingai-agentsai-governanceautonomous-agentsclaude-codeclicode-reviewcodexcoding-agentsdeveloper-toolsgit-hooksllmlocal-firstmulti-agentsoftware-factoryspec-driven-developmentverificationvibe-coding
feat(cli): worktree prints a subagent's opening lines [I7]
Corey Olson12f3640f8630
diff --git a/src/cli.js b/src/cli.jsindex 55a18301..8cad69d8 100644--- a/src/cli.js+++ b/src/cli.js@@ -554,6 +554,11 @@ function worktreeFor(io, lane, route) {if (existsSync(join(root, 'package.json'))) io.say(` ${cdTo(root)} npm install (its own install, so its tests run its own code)`);io.say(` ${cdTo(root)} pullboard inbox`);io.say(` ${cdTo(root)} pullboard next`);+ // A subagent inherits the instructions of the session that launched it, often another repo's (I7).+ const folder = /[\s'"$]/.test(root) ? JSON.stringify(root) : root;+ io.say('For a subagent working here, begin its prompt with:');+ io.say(` You are ${id}, in the ${lane} lane. Work only in ${folder}, and start every command with ${cdTo(root)}`);+ io.say(` Read ${folder.replace(/"?$/, '/AGENTS.md$&')} first. Its rules govern this work, over any other repo's instructions you were given.`);return 0;}diff --git a/test/e2e.test.js b/test/e2e.test.jsindex 97450f0c..aebcc004 100644--- a/test/e2e.test.js+++ b/test/e2e.test.js@@ -850,3 +850,20 @@ test('submit names the item and the way out when a cited row was retired after tassert.match(refused.err, /CRITERIA_CHANGED\] the spec rows #1 cites changed after it was claimed \(G1 is retired\), so no verifier could judge it; the coordinator either restores the row and runs pullboard refreeze 1, or withdraws #1/);assert.equal(JSON.parse(box.run(box.repo, 'show', '1', '--json').out).item_status, 'claimed');});++test('worktree prints the opening lines of a subagent\'s prompt, with its folder and identity [I7]', () => {+ const box = sandbox();+ const repo = join(box.dir, 'my app');+ mkdirSync(repo);+ box.git(repo, 'init', '-q', '-b', 'main');+ box.run(repo, 'init');+ writeFileSync(join(repo, 'pullboard.json'), JSON.stringify(CONFIG, null, 2));+ writeFileSync(join(repo, 'SPEC.md'), SPEC);+ box.git(repo, 'add', '-A');+ box.git(repo, 'commit', '-q', '-m', 'chore: set up pullboard');+ const made = box.run(repo, 'worktree', 'web').out;+ const folder = join(box.dir, 'my app-web-1');+ assert.match(made, /For a subagent working here, begin its prompt with:\n/);+ assert.ok(made.includes(` You are web-1, in the web lane. Work only in "${folder}", and start every command with cd "${folder}" &&\n`), made);+ assert.ok(made.includes(` Read "${folder}/AGENTS.md" first. Its rules govern this work, over any other repo's instructions you were given.\n`), made);+});