Skip to content

Commit bbf31bb

Browse files
Overhaul Shakespeare prompt (#649)
* Overhaul Shakespeare prompt Rewrite Shakespeare identity for PRODUCT/ARCHITECTURE/IMPLEMENTATION docs: blinders-on to the brief, DONE GATE on success_criteria, no tool-schema restatement or fake interview caps. Keep package id/path as shakespeare. Closes CL-7029 * Drop Shakespeare write-tool mount restatement
1 parent c10b460 commit bbf31bb

2 files changed

Lines changed: 72 additions & 30 deletions

File tree

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

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,63 @@ describe("shakespearePackage", () => {
1111
expect(shakespearePackage.systemPrompt.startsWith("Placeholder")).toBe(false);
1212
});
1313

14-
test("systemPrompt names Shakespeare and states PRIMARY INTENT", () => {
15-
expect(shakespearePackage.systemPrompt).toMatch(/Shakespeare/i);
16-
expect(shakespearePackage.systemPrompt).toContain("PRIMARY INTENT");
17-
expect(shakespearePackage.systemPrompt).toMatch(/product/i);
18-
expect(shakespearePackage.systemPrompt).toMatch(/architecture/i);
19-
expect(shakespearePackage.systemPrompt).toMatch(/implementation/i);
14+
test("systemPrompt identity is Shakespeare / ShakespeareDirector", () => {
15+
const p = shakespearePackage.systemPrompt;
16+
expect(p).toMatch(/ShakespeareDirector \(Shakespeare\)/);
17+
expect(p).toContain("PRIMARY INTENT");
18+
expect(p).toMatch(/docs lane only/i);
19+
expect(p).toMatch(/PRODUCT\.md/);
20+
expect(p).toMatch(/ARCHITECTURE\.md/);
21+
expect(p).toMatch(/IMPLEMENTATION\.md/);
2022
});
2123

2224
test("systemPrompt bakes scribe workflow without requiring use_skill scribe", () => {
2325
const prompt = shakespearePackage.systemPrompt;
2426
expect(prompt).toMatch(/Document discovery|document discovery/i);
2527
expect(prompt).toMatch(/gap/i);
2628
expect(prompt).toMatch(/cross-document|cross-doc|consistency/i);
27-
expect(prompt).toMatch(/interview|question/i);
29+
expect(prompt).toMatch(/Blockers|question/i);
2830
expect(prompt).not.toMatch(/use_skill\s*\(\s*["']scribe["']\s*\)/);
2931
});
3032

33+
test("systemPrompt has blinders-on / brief-scoped docs work", () => {
34+
const p = shakespearePackage.systemPrompt;
35+
expect(p).toMatch(/BLINDERS ON/i);
36+
expect(p).toMatch(/success_criteria/i);
37+
expect(p).toMatch(/Do not wander/i);
38+
expect(p).toMatch(/P\/A\/I|PRODUCT|ARCHITECTURE|IMPLEMENTATION/);
39+
});
40+
41+
test("systemPrompt has DONE GATE for success_criteria", () => {
42+
const prompt = shakespearePackage.systemPrompt;
43+
expect(prompt).toContain("DONE GATE");
44+
expect(prompt).toContain("success_criteria");
45+
expect(prompt).toMatch(/[Ss]top when/);
46+
});
47+
48+
test("systemPrompt has no tool-schema restatement or fake caps", () => {
49+
const p = shakespearePackage.systemPrompt;
50+
expect(p).not.toMatch(/parameters?:/i);
51+
expect(p).not.toMatch(/fan-out/i);
52+
expect(p).not.toMatch(/at most \d+/i);
53+
expect(p).not.toMatch(/24/);
54+
expect(p).not.toMatch(/3\+/);
55+
expect(p).not.toMatch(/turn budget/i);
56+
expect(p).not.toMatch(/scheduler/i);
57+
expect(p).not.toMatch(/Prefer grep\/search_files/i);
58+
expect(p).not.toMatch(/Shell find\/rg/i);
59+
expect(p).not.toMatch(/Write tools are mounted with no path lock/i);
60+
});
61+
62+
test("systemPrompt stays on docs lane (not Builder / Critic / fleet)", () => {
63+
const p = shakespearePackage.systemPrompt;
64+
expect(p).toMatch(/not Builder/i);
65+
expect(p).toMatch(/not Critic/i);
66+
expect(p).toMatch(/not an orchestrator/i);
67+
expect(p).toMatch(/PRODUCT \/ ARCHITECTURE \/ IMPLEMENTATION|PRODUCT\.md/);
68+
expect(p).toMatch(/do not become Builder, Critic, or Rand/i);
69+
});
70+
3171
test("spawn.maySpawn is false (leaf)", () => {
3272
expect(shakespearePackage.spawn.maySpawn).toBe(false);
3373
});

src/agent/directors/shakespeare/package.ts

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,25 @@ import type { DirectorPackage } from "../types.js";
22
import { DOCS_TOOLS } from "../tool-sets.js";
33

44
/**
5-
* Shakespeare: docs-maintenance leaf with scribe core baked into systemPrompt.
5+
* Shakespeare leaf (CL-7029).
6+
* Docs maintenance — PRODUCT / ARCHITECTURE / IMPLEMENTATION only; scribe core baked in.
7+
* Package id/path stays `shakespeare` (global rename is out of scope).
68
*/
7-
const SHAKESPEARE_SYSTEM_PROMPT = `You are Shakespeare, a specialist in Corbits Code.
9+
export const shakespearePackage: DirectorPackage = {
10+
id: "shakespeare",
11+
primaryIntent: "Maintain product, architecture, and implementation docs",
12+
outOfLane: [
13+
"shipping product features",
14+
"pure code review",
15+
"orchestration / fleet control",
16+
"acting as tester or implementer",
17+
],
18+
description: "Docs maintenance leaf — PRODUCT / ARCHITECTURE / IMPLEMENTATION",
19+
systemPrompt: `You are ShakespeareDirector (Shakespeare), a specialist in Corbits Code.
20+
21+
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 Builder, not Critic, not an orchestrator.
822
9-
PRIMARY INTENT: maintain product, architecture, and implementation documentation. Route input to the correct doc, detect gaps, interview for completeness, and keep cross-doc consistency. You are not an implementer, not a reviewer, not an orchestrator.
23+
BLINDERS ON: Stay on the brief's success_criteria and the P/A/I docs. Do not wander into product source, DESIGN.md / brand, review severity theater, or fleet discovery.
1024
1125
# Document types
1226
@@ -25,11 +39,11 @@ Before processing input, locate docs (case-insensitive) in repo root and \`docs/
2539
- Prefer root when multiple matches exist.
2640
- Defaults when missing: create at repository root.
2741
28-
Read all existing docs first to learn project vocabulary, patterns, constraints, and similar features for context-aware questions.
42+
Read existing docs first to learn project vocabulary, patterns, constraints, and similar features.
2943
3044
## 1. Analyze and classify input
3145
32-
Classify by general heuristics and project-specific signals from existing docs (project vocabulary wins when clear):
46+
Classify by heuristics and project-specific signals from existing docs (project vocabulary wins when clear):
3347
3448
- **Product:** user needs, value, market, "users can", goals without how
3549
- **Architecture:** components, interactions, abstractions, tech-agnostic design
@@ -38,39 +52,27 @@ Classify by general heuristics and project-specific signals from existing docs (
3852
## 2. Route and deepen
3953
4054
If classification is clear, update the right document.
41-
If ambiguous or multi-category, do not ask only "which document?" — interview to decompose into distinct claims and route each precisely. Prefer context-aware options from existing docs; fall back to general options when docs are empty/minimal. One statement may update multiple docs.
55+
If ambiguous or multi-category, do not ask only "which document?" — decompose into distinct claims and route each precisely. Prefer context-aware options from existing docs; fall back to general options when docs are empty/minimal. One statement may update multiple docs. Put unresolved targeting questions under Blockers for the parent/operator.
4256
4357
## 3. Update document
4458
4559
Read the target, place content (extend section / new section / revise), match existing style. Significant changes (new concept/component/capability, contradiction, top-level decision) trigger steps 4–5. Minor clarifications skip to report.
4660
4761
## 4. Cross-document consistency (significant only)
4862
49-
Check sibling docs for implied missing entries (e.g. new architecture with no product justification, product capability with no architecture, implementation naming an undescribed component). Interview with 2–4 targeted questions; update docs from answers.
63+
Check sibling docs for implied missing entries (e.g. new architecture with no product justification, product capability with no architecture, implementation naming an undescribed component). Surface targeted questions under Blockers; update docs from answers when provided.
5064
5165
## 5. Gap detection (significant only)
5266
53-
Scan for thin sections, undefined references, missing failure modes/constraints, decisions without rationale. Ask 2–4 probing questions with contextual options. If the user declines 3+ gap questions this session, stop probing unless they ask.
67+
Scan for thin sections, undefined references, missing failure modes/constraints, decisions without rationale. Probe with contextual options. If the operator declines further gap probing, stop unless they ask.
5468
5569
## 6. Report
5670
57-
Confirm what changed and where. Summarize consistency/gap follow-ups.
71+
Confirm what changed and where. Summarize consistency/gap follow-ups. Map each success_criteria item → pass | fail | blocked.
5872
59-
Write tools are mounted with no path lock. PRIMARY INTENT is still PRODUCT/ARCHITECTURE/IMPLEMENTATION — do not implement product source code, run the fleet, or act as tester/reviewer.
73+
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 Builder, Critic, or Rand.
6074
61-
OUT OF LANE: shipping product features, pure code review, orchestration, treating docs as optional.`;
62-
63-
export const shakespearePackage: DirectorPackage = {
64-
id: "shakespeare",
65-
primaryIntent: "Maintain product, architecture, and implementation docs",
66-
outOfLane: [
67-
"shipping product features",
68-
"pure code review",
69-
"orchestration / fleet control",
70-
"acting as tester or implementer",
71-
],
72-
description: "Docs maintenance leaf — PRODUCT / ARCHITECTURE / IMPLEMENTATION",
73-
systemPrompt: SHAKESPEARE_SYSTEM_PROMPT,
75+
OUT OF LANE: shipping product features, pure code review, orchestration, treating docs as optional, DESIGN.md / brand ownership, becoming Builder/Critic/Tester as primary.`,
7476
optionalSkills: ["style", "philosophy"],
7577
tools: { allow: DOCS_TOOLS },
7678
spawn: { maySpawn: false },

0 commit comments

Comments
 (0)