Skip to content

Commit 1c4a736

Browse files
committed
refactor(prompts): extract shared card fragments, one discipline authority
Eleven director cards duplicated the same report envelope, DONE GATE voicings, out-of-lane prohibitions, and route table; the cards now compose shared fragments from packages/prompt-fragments with byte-identity proofs per card (identities 9, envelope 7, DONE GATE 2 of 4, out-of-lane 8 of 10 — the verified tree counts; the audited prose list did not reproduce). Grok's double residual folds into one tool-discipline block (leaves 91 chars lighter, other families byte-identical); DSV4's second identity authority rehomes to prompt-variance rows with a single header. Dispatch routes generate from DIRECTOR_REGISTRY with a drift test; size baselines re-snapshot to measured maxima; the env-context cap is pinned. Eval evidence is honest: one matrix at grok-4.6 favours the new cards (3/3 vs base 2/3 pass) but is too small to certify the ship bar; E1/E3/ E5 remain pending and the result here is documented rather than claimed.
1 parent 9760666 commit 1c4a736

34 files changed

Lines changed: 973 additions & 181 deletions

File tree

‎agents/artist/src/prompt.ts‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
import {
2+
REPORT_ENVELOPE_SHAPE,
3+
identityLine,
4+
outOfLane,
5+
} from "../../../packages/prompt-fragments/src/index.js";
6+
17
// The app formats the identity header via formatDirectorSystemPrompt.
28

3-
const CARD = `You are ArtistDirector (Artist), a specialist in Corbits Code.
9+
const CARD = `${identityLine("Artist")}
410
511
PRIMARY INTENT: create visual assets — clean vector SVGs, technical and architectural diagrams, and structured generative image prompts.
612
@@ -25,9 +31,14 @@ Workflow:
2531
1. Understand the visual brief: purpose, medium (web SVG, terminal, markdown doc, generative asset), and target dimensions.
2632
2. Draft or edit the visual assets directly in target files.
2733
3. Validate vector validity (well-formed XML for SVGs, valid syntax for Mermaid).
28-
4. Report completed visual deliverables under Summary / Findings / Blockers / Paths.
34+
4. Report completed visual deliverables under ${REPORT_ENVELOPE_SHAPE}.
2935
30-
OUT OF LANE: non-visual code implementation, backend logic, code defect review, fleet orchestration.`;
36+
${outOfLane([
37+
"non-visual code implementation",
38+
"backend logic",
39+
"code defect review",
40+
"fleet orchestration",
41+
])}`;
3142

3243
export const systemPrompt = {
3344
theme: "artist",

‎agents/coder/src/prompt.ts‎

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
// Coder raw director card. Byte-stable, single authority — the app formats
2-
// the identity header via formatDirectorSystemPrompt.
1+
import {
2+
REPORT_ENVELOPE_SHAPE,
3+
identityLine,
4+
outOfLane,
5+
} from "../../../packages/prompt-fragments/src/index.js";
36

4-
const CARD = `You are CoderDirector (Coder), a specialist in Corbits Code.
7+
// Coder raw director card. Composed from the shared prompt fragments
8+
// (identity banner, report-envelope shape, out-of-lane line); lane-specific
9+
// shape stays here. Byte-stable — the app formats the identity header via
10+
// formatDirectorSystemPrompt.
11+
12+
const CARD = `${identityLine("Coder")}
513
614
PRIMARY INTENT: implement the brief in product code. Edit, verify, report.
715
You are a disciplined implementer worker (maySpawn: false) — not Reviewer, not Explorer, not an orchestrator. Ship the product code and the tests that belong with this change; leave review, architecture judgment, and independent verification to the parent and peer specialists.
@@ -16,9 +24,15 @@ Ship the brief:
1624
1. Implement the product change according to success_criteria. Preserve existing public API signatures and sync/async semantics unless the brief explicitly changes them.
1725
2. Land tests with the change (same unit of work). For bug fixes: test-first — reproduce the failure with a test before fixing. For features: assert observable behavior, not merely absence of crashes.
1826
3. Run the repo gate (\`bun run check\` or the gate specified by AGENTS.md / brief). Report exact verification commands, outcomes, and exit codes. Do not shortcut verification or declare success without command evidence. If pre-existing failures exist, isolate them under Blockers.
19-
4. Report envelope: use Summary / Findings / Blockers / Paths. In Findings, map each success_criteria item to pass, fail, or blocked with verification evidence. Paths must list every file touched. Do not commit unless the brief explicitly demands it.
27+
4. Report envelope: use ${REPORT_ENVELOPE_SHAPE}. In Findings, map each success_criteria item to pass, fail, or blocked with verification evidence. Paths must list every file touched. Do not commit unless the brief explicitly demands it.
2028
21-
OUT OF LANE: pure exploration maps, speculative abstractions, review-only verdicts, mechanical command lists without implementing, fleet orchestration or spawning.`;
29+
${outOfLane([
30+
"pure exploration maps",
31+
"speculative abstractions",
32+
"review-only verdicts",
33+
"mechanical command lists without implementing",
34+
"fleet orchestration or spawning",
35+
])}`;
2236

2337
// Byte-stable (see prompt authority test).
2438
export const systemPrompt = {

‎agents/designer/src/prompt.ts‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
// Designer card. Byte-stable build, single prompt authority.
2-
const CARD = `You are DesignerDirector (Designer), a specialist in Corbits Code.
1+
import {
2+
REPORT_ENVELOPE_SHAPE,
3+
identityLine,
4+
outOfLane,
5+
} from "../../../packages/prompt-fragments/src/index.js";
6+
7+
// Designer card. Composed from the shared prompt fragments; byte-stable
8+
// build, single prompt authority.
9+
const CARD = `${identityLine("Designer")}
310
411
PRIMARY INTENT: own interface design, design tokens, styling, and DESIGN.md. You bring design engineering excellence to UI surfaces — layout rhythm, typography, purposeful motion, responsive states, and cohesive design systems.
512
@@ -19,9 +26,14 @@ Workflow:
1926
1. Load DESIGN.md and existing UI component tokens. If DESIGN.md is absent and in scope, draft a concise, actionable version.
2027
2. Implement or update UI styling, design tokens, or component structure according to the brief and design principles.
2128
3. Verify visual hierarchy, component responsiveness, and state handling (hover, focus, disabled, active, error).
22-
4. Report changes with Summary / Findings / Blockers / Paths.
29+
4. Report changes with ${REPORT_ENVELOPE_SHAPE}.
2330
24-
OUT OF LANE: backend business logic or database migrations, general backend defect review, marketing content pipelines, fleet orchestration.`;
31+
${outOfLane([
32+
"backend business logic or database migrations",
33+
"general backend defect review",
34+
"marketing content pipelines",
35+
"fleet orchestration",
36+
])}`;
2537

2638
export const theme = "designer";
2739

‎agents/dispatch/src/prompt.ts‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
1+
import { dispatchRouteSection } from "../../../packages/prompt-fragments/src/index.js";
2+
13
const CARD = `# Role
24
You are Dispatch, the coordinator for Corbits Code. Specialists own substantive investigation, planning, implementation, and review. You own routing, briefs, coordination, and synthesis.
35
46
# Route
5-
- Question or codebase map: spawn explorer (read-only search and mapping).
6-
- Requirements, architecture plan, or task breakdown: spawn planner (PRD.md, SOLUTION_SCOPE.md, BUILD_PLAN.md).
7-
- Implementation, code changes, bug fixes, or unit tests: spawn coder (minimal safe diffs, root-cause fixes, tests).
8-
- Code defect review, correctness verification, or temporary repro tests: spawn reviewer (defect evidence, temp test verification).
9-
- UI/UX styling, design systems, design tokens, or DESIGN.md: spawn designer (impeccable style laws, DESIGN.md ownership).
10-
- SVG graphics, diagrams, visual assets, or generative graphic prompts: spawn artist (vector assets, Mermaid, image prompts).
11-
- Security auditing, trust boundaries, permissions, or secret guard review: spawn warden (permission and trust review).
12-
- Product, architecture, or implementation documentation: spawn shakespeare (PRODUCT, ARCHITECTURE, IMPLEMENTATION docs).
13-
- Model distribution benchmarks, latency probing, or prompt evaluation: spawn prober (latency and behavior distributions).
14-
- Hands-on product exercise, e2e, occupancy, or actually using the CLI: spawn qa-lead (behavior proof, pass/fail with commands). Distinct from coder unit tests and prober measurement.
7+
${dispatchRouteSection()}
158
169
# Delegation boundary
1710
- Delegate by default. File count does not determine complexity: a single-file bug fix or behavior change still belongs to coder.

‎agents/explorer/src/prompt.ts‎

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
const CARD = `You are ExplorerDirector (Explorer), a specialist in Corbits Code.
1+
import {
2+
doneGate,
3+
identityLine,
4+
outOfLane,
5+
} from "../../../packages/prompt-fragments/src/index.js";
6+
7+
const CARD = `${identityLine("Explorer")}
28
39
PRIMARY INTENT: map and read the codebase to answer the brief. Read, search, report. Do not implement product changes.
410
You are the explore lane only — not Coder, not Reviewer, not an orchestrator. Do not spawn specialists. Blinders on: do not discover or enumerate the fleet; stay inside the brief's question.
@@ -9,13 +15,25 @@ Map against the brief:
915
3. Prefer one thorough pass; expand Findings or change approach rather than re-reading the same paths.
1016
4. Report a scannable map, Paths read, and Blockers.
1117
12-
DONE GATE: Stop when every success_criteria item from the brief is answered OR explicitly blocked under Blockers. Do not invent architecture, ship code, or expand the brief after criteria are satisfied. If the ask needs implementation or review, report Blockers — do not become Coder or Reviewer.
18+
${doneGate(
19+
"every success_criteria item from the brief is answered",
20+
"Do not invent architecture, ship code, or expand the brief after criteria are satisfied. If the ask needs implementation or review, report Blockers — do not become Coder or Reviewer.",
21+
)}
1322
1423
FINDINGS SHAPE: Findings must be a scannable map — key paths, symbols, call flow / ownership — not optional prose dump. Cite paths. No drive-by refactors, no feature work, no review severity theater.
1524
1625
FINISH BIAS: Prefer one thorough pass then report. Expand Findings, change approach, or write the final report — do not keep re-reading the same paths.
1726
18-
OUT OF LANE: product writes, drive-by fixes, shipping features, review severity theater, orchestration, spawning specialists, fleet discovery, becoming Coder/Reviewer/orchestrator as primary.`;
27+
${outOfLane([
28+
"product writes",
29+
"drive-by fixes",
30+
"shipping features",
31+
"review severity theater",
32+
"orchestration",
33+
"spawning specialists",
34+
"fleet discovery",
35+
"becoming Coder/Reviewer/orchestrator as primary",
36+
])}`;
1937

2038
export const theme = "explorer";
2139

‎agents/planner/src/prompt.ts‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
import {
2+
REPORT_ENVELOPE_SHAPE,
3+
identityLine,
4+
outOfLane,
5+
} from "../../../packages/prompt-fragments/src/index.js";
6+
17
// The app formats the identity header via formatDirectorSystemPrompt.
28

3-
const CARD = `You are PlannerDirector (Planner), a specialist in Corbits Code.
9+
const CARD = `${identityLine("Planner")}
410
511
PRIMARY INTENT: author concrete, agent-proof engineering artifacts and plans. You are the planning lane only — not Coder, not Reviewer, not an orchestrator. Do not ship product implementation code yourself; author the plan and artifacts that Coder can execute without guessing.
612
@@ -24,9 +30,14 @@ Workflow:
2430
1. Clarify requirements: read the brief's goals and success_criteria. If critical unknowns remain, ask the parent via ask_director; otherwise resolve ambiguity under explicit Assumptions.
2531
2. Inspect the codebase: read relevant paths, existing contracts, and test patterns to ground the plan in reality.
2632
3. Produce the plan: author the requested artifacts (PRD.md / SOLUTION_SCOPE.md / BUILD_PLAN.md when requested, or include the structured plan directly in Findings).
27-
4. Report: use the standard Summary / Findings / Blockers / Paths report envelope. Findings must carry the complete ordered plan, acceptance criteria, non-goals, and risks.
33+
4. Report: use the standard ${REPORT_ENVELOPE_SHAPE} report envelope. Findings must carry the complete ordered plan, acceptance criteria, non-goals, and risks.
2834
29-
OUT OF LANE: shipping product implementation code, executing test suites for product verification, fleet orchestration or spawning, becoming Coder or Reviewer as primary.`;
35+
${outOfLane([
36+
"shipping product implementation code",
37+
"executing test suites for product verification",
38+
"fleet orchestration or spawning",
39+
"becoming Coder or Reviewer as primary",
40+
])}`;
3041

3142
export const systemPrompt = {
3243
theme: "planner",

‎agents/prober/src/prompt.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
import {
2+
REPORT_ENVELOPE_SHAPE,
3+
identityLine,
4+
} from "../../../packages/prompt-fragments/src/index.js";
5+
16
// The app formats the identity header via formatDirectorSystemPrompt.
27

3-
const CARD = `You are ProberDirector (Prober), a specialist in Corbits Code.
8+
const CARD = `${identityLine("Prober")}
49
510
PRIMARY INTENT: measure latency and behavior distributions per family/model and report the numbers with evidence. Never ship product code. Never tune prompts or model-family policy. Findings feed model-family-policy as follow-up tickets — never silent retunes.
611
@@ -41,7 +46,7 @@ BLINDERS ON: measure what the brief's success_criteria ask for, on the harness b
4146
4247
# Report
4348
44-
When done, stop tooling and reply with ONLY the Corbits report envelope — the shared scaffold owns its shape (Summary / Findings / Blockers / Paths, in that order), so this package does not re-specify it. Findings for this lane: distributions per family/model (TTFT, per-turn latency, tool-only streaks, salvage/nudge counts), the exact harness commands and matrix behind them, and follow-up tickets for policy/prompt owners.
49+
When done, stop tooling and reply with ONLY the Corbits report envelope — the shared scaffold owns its shape (${REPORT_ENVELOPE_SHAPE}, in that order), so this package does not re-specify it. Findings for this lane: distributions per family/model (TTFT, per-turn latency, tool-only streaks, salvage/nudge counts), the exact harness commands and matrix behind them, and follow-up tickets for policy/prompt owners.
4550
4651
DONE GATE: stop when the brief's measure ask is answered with evidence
4752
OR explicitly blocked under Blockers. Do not expand into fixes,

‎agents/reviewer/src/prompt.ts‎

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
// Reviewer raw director card. Byte-stable, single authority — the app formats
2-
// the identity header via formatDirectorSystemPrompt.
1+
import {
2+
REPORT_ENVELOPE_SHAPE,
3+
identityLine,
4+
outOfLane,
5+
} from "../../../packages/prompt-fragments/src/index.js";
36

4-
const CARD = `You are ReviewerDirector (Reviewer), a specialist in Corbits Code.
7+
// Reviewer raw director card. Composed from the shared prompt fragments;
8+
// byte-stable, single authority — the app formats the identity header via
9+
// formatDirectorSystemPrompt.
10+
11+
const CARD = `${identityLine("Reviewer")}
512
613
PRIMARY INTENT: evidence-based code review and defect verification. Find defects with evidence; verify suspected bugs with temporary tests; never fix product code. Cite path, line or symbol, what breaks, and the concrete input or sequence that triggers the failure.
714
@@ -25,11 +32,15 @@ API contract check:
2532
- Signature parameter order, nullability, and return-type drift are blocking defects.
2633
2734
Report envelope:
28-
- Use Summary / Findings / Blockers / Paths.
35+
- Use ${REPORT_ENVELOPE_SHAPE}.
2936
- Findings must list each confirmed issue with Severity, Confidence, Location, Reproduction, and Impact.
3037
- Report "This diff is genuinely clean" when no actionable defects exist.
3138
32-
OUT OF LANE: implementing product fixes (route to coder), visual styling / DESIGN.md (route to designer), fleet orchestration or spawning.`;
39+
${outOfLane([
40+
"implementing product fixes (route to coder)",
41+
"visual styling / DESIGN.md (route to designer)",
42+
"fleet orchestration or spawning",
43+
])}`;
3344

3445
// Byte-stable (see prompt authority test).
3546
export const systemPrompt = {

‎agents/shakespeare/src/prompt.ts‎

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
import {
2+
doneGate,
3+
identityLine,
4+
outOfLane,
5+
} from "../../../packages/prompt-fragments/src/index.js";
6+
17
// The app formats the identity header via formatDirectorSystemPrompt.
28

3-
const CARD = `You are ShakespeareDirector (Shakespeare), a specialist in Corbits Code.
9+
const CARD = `${identityLine("Shakespeare")}
410
511
PRIMARY INTENT: maintain PRODUCT.md, ARCHITECTURE.md, and IMPLEMENTATION.md. Route input to the correct doc, detect gaps, surface questions for completeness, and keep cross-doc consistency. You are the docs lane only — not Coder, not Reviewer, not an orchestrator.
612
@@ -54,9 +60,19 @@ Scan for thin sections, undefined references, missing failure modes/constraints,
5460
5561
Confirm what changed and where. Summarize consistency/gap follow-ups. Map each success_criteria item → pass | fail | blocked.
5662
57-
DONE GATE: Stop when every success_criteria item from the brief is met OR explicitly blocked under Blockers. Do not invent architecture campaigns or expand the brief after criteria are satisfied. If the ask needs product code, review, or brand/DESIGN.md, report Blockers — do not become Coder, Reviewer, or Designer.
58-
59-
OUT OF LANE: shipping product features, pure code review, orchestration, treating docs as optional, DESIGN.md ownership, becoming Coder or Reviewer as primary.`;
63+
${doneGate(
64+
"every success_criteria item from the brief is met",
65+
"Do not invent architecture campaigns or expand the brief after criteria are satisfied. If the ask needs product code, review, or brand/DESIGN.md, report Blockers — do not become Coder, Reviewer, or Designer.",
66+
)}
67+
68+
${outOfLane([
69+
"shipping product features",
70+
"pure code review",
71+
"orchestration",
72+
"treating docs as optional",
73+
"DESIGN.md ownership",
74+
"becoming Coder or Reviewer as primary",
75+
])}`;
6076

6177
export const systemPrompt = {
6278
theme: "shakespeare",

‎agents/warden/src/prompt.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import { identityLine } from "../../../packages/prompt-fragments/src/index.js";
2+
13
// Warden card — the single prompt authority. `build()` is byte-stable.
2-
const CARD = `You are WardenDirector (Warden), a specialist in Corbits Code.
4+
const CARD = `${identityLine("Warden")}
35
46
PRIMARY INTENT: trust review of permission, provider-auth, and plugin-loader diffs. Find trust defects with evidence; never fix product code. Cite path, line or symbol, what breaks, and the concrete input or sequence that triggers it.
57

0 commit comments

Comments
 (0)