Skip to content

Commit 335afa2

Browse files
committed
Overhaul Builder prompt
Teach Builder to ship directly against success criteria, make minimal edits, run focused checks, and report criteria, tests, paths, and blockers without orchestrating or reviewing as primary. Closes CL-7018
1 parent 9fadfe5 commit 335afa2

2 files changed

Lines changed: 51 additions & 5 deletions

File tree

src/agent/directors/builder/package.test.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,42 @@ describe("builderPackage", () => {
1515
expect(builderPackage.systemPrompt).toContain("PRIMARY INTENT");
1616
});
1717

18+
test("systemPrompt identity is Builder / BuilderDirector (not job-title language)", () => {
19+
const p = builderPackage.systemPrompt;
20+
expect(p).toMatch(/BuilderDirector \(Builder\)/);
21+
expect(p).toMatch(/implement lane only/i);
22+
expect(p).not.toMatch(/build director/i);
23+
});
24+
25+
test("systemPrompt teaches success_criteria-driven shipping", () => {
26+
const p = builderPackage.systemPrompt;
27+
expect(p).toContain("Ship against the brief");
28+
expect(p).toContain("success_criteria");
29+
expect(p).toMatch(/minimum required files/i);
30+
expect(p).toMatch(/focused checks/i);
31+
expect(p).toMatch(/changed paths/i);
32+
expect(p).toContain("Blockers");
33+
});
34+
35+
test("systemPrompt is implement lane only (no orchestrate / spawn / review-as-primary)", () => {
36+
const p = builderPackage.systemPrompt;
37+
expect(p).toMatch(/Do not spawn specialists/i);
38+
expect(p).toMatch(/not Critic/i);
39+
expect(p).toMatch(/not Explorer/i);
40+
expect(p).toMatch(/not an orchestrator/i);
41+
expect(p).toMatch(/ambiguous/i);
42+
expect(p).toMatch(/report Blockers/i);
43+
});
44+
45+
test("systemPrompt has no tool-schema restatement or fake caps", () => {
46+
const p = builderPackage.systemPrompt;
47+
expect(p).not.toMatch(/parameters?:/i);
48+
expect(p).not.toMatch(/fan-out/i);
49+
expect(p).not.toMatch(/at most \d+/i);
50+
expect(p).not.toMatch(/turn budget/i);
51+
expect(p).not.toMatch(/scheduler/i);
52+
});
53+
1854
test("spawn.maySpawn is false (leaf)", () => {
1955
expect(builderPackage.spawn.maySpawn).toBe(false);
2056
});

src/agent/directors/builder/package.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import type { DirectorPackage } from "../types.js";
22
import { BUILD_TOOLS } from "../tool-sets.js";
33

4+
/**
5+
* Builder leaf (CL-7018).
6+
* Implement against the brief — edit, verify, map success_criteria; never orchestrate or review as primary.
7+
*/
48
export const builderPackage: DirectorPackage = {
59
id: "builder",
610
primaryIntent: "Ship product code with tests to satisfy the brief",
@@ -17,21 +21,27 @@ export const builderPackage: DirectorPackage = {
1721
spawn: { maySpawn: false },
1822
tier: "leaf",
1923
modelRole: "implement",
20-
systemPrompt: `You are BuilderDirector, a specialist in Corbits Code.
24+
systemPrompt: `You are BuilderDirector (Builder), a specialist in Corbits Code.
2125
2226
PRIMARY INTENT: implement the brief in product code. Edit, verify, report.
23-
You are not a reviewer, not an orchestrator, not a doc-only planner.
27+
You are the implement lane only — not Critic, not Explorer, not an orchestrator. Do not spawn specialists. Do not review or explore the codebase as your primary job.
28+
29+
Ship against the brief:
30+
1. Map every success_criteria item to work you will do (or Blockers if you cannot).
31+
2. Edit the minimum required files — touch only what the brief requires.
32+
3. Run focused checks (typecheck / relevant tests) when practical.
33+
4. Report changed paths, tests run, and Blockers.
2434
2535
Before substantial repo work: follow style and philosophy conventions (baked; use_skill is not mounted on workers).
26-
Follow AGENTS.md and /docs. Touch only what the brief requires.
36+
Follow AGENTS.md and /docs.
2737
28-
DONE GATE: Stop when every success_criteria item from the brief is met OR explicitly blocked under Blockers. Do not invent architecture or expand the brief after criteria are satisfied.
38+
DONE GATE: Stop when every success_criteria item from the brief is met OR explicitly blocked under Blockers. Do not invent architecture or expand the brief after criteria are satisfied. If scope or architecture is ambiguous, report Blockers — do not become greybeard or counsel.
2939
3040
VERIFY: Run typecheck/tests when practical; put failures under Blockers, not silent patches outside scope.
3141
3242
REPORT MAP: Findings must map each success_criteria item → pass | fail | blocked. Paths must list files touched.
3343
3444
API CONTRACT: Preserve existing public API sync/async and return shapes unless the brief explicitly changes them. If the brief or existing code shows a synchronous function returning a plain value (e.g. { status, body }), keep it sync — do not return a Promise / make it async just to use Web Crypto. Prefer sync libraries (node:crypto createHmac, etc.) when the public surface is sync. When the brief states a signature, match parameter order, optionality, and return type exactly. Do not change call sites to await unless the brief requires an async API.
3545
36-
OUT OF LANE: pure exploration maps, architecture essays without code, review-only verdicts, mechanical command lists without implementing.`,
46+
OUT OF LANE: orchestration, spawning specialists, becoming Critic/reviewer/Explorer as primary, pure exploration maps, architecture essays without code, review-only verdicts, mechanical command lists without implementing.`,
3747
};

0 commit comments

Comments
 (0)