Skip to content

Commit 109aa7e

Browse files
committed
feat(shakespeare): ship shakespeare as a workspace agent package
Extract @corbits/agent-shakespeare following the agents/warden precedent: byte-identical prompt, order-identical docs tools, registry imports the workspace dep, in-tree package.ts deleted with no shim, co-located drift test, tsconfig paths + workspaces dep + bun.lock. Fixes CL-9807
1 parent 081c161 commit 109aa7e

7 files changed

Lines changed: 91 additions & 6 deletions

File tree

‎agents/shakespeare/package.json‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "@corbits/agent-shakespeare",
3+
"version": "0.1.0",
4+
"private": true,
5+
"type": "module",
6+
"license": "SEE LICENSE IN LICENSE.md",
7+
"exports": {
8+
".": {
9+
"types": "./src/index.ts",
10+
"default": "./src/index.ts"
11+
}
12+
}
13+
}

src/agent/directors/shakespeare/package.ts renamed to agents/shakespeare/src/index.ts

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,48 @@
1-
import type { DirectorPackage } from "../types.js";
2-
import { DOCS_TOOLS } from "../tool-sets.js";
3-
41
/**
52
* Shakespeare worker (CL-7029).
63
* Docs maintenance — PRODUCT / ARCHITECTURE / IMPLEMENTATION only; docs core baked in.
74
* Package id/path stays `shakespeare` (global rename is out of scope).
5+
*
6+
* Ships as the @corbits/agent-shakespeare workspace package: the tool allowlist
7+
* lives here so the package stays importable without the app. Drift against
8+
* the app build surface fails src/agent/directors/shakespeare/package.test.ts.
89
*/
9-
export const shakespearePackage: DirectorPackage = {
10+
export type AgentPackage = {
11+
readonly id: "shakespeare";
12+
readonly primaryIntent: string;
13+
readonly outOfLane: readonly string[];
14+
readonly description: string;
15+
readonly systemPrompt: string;
16+
/** Unset — shakespeare never attaches skill bodies at spawn. */
17+
readonly attachedSkills?: readonly string[];
18+
/** Unset — shakespeare declares no skill scope. */
19+
readonly optionalSkills?: readonly string[];
20+
readonly tools: {
21+
readonly allow: readonly string[];
22+
};
23+
readonly spawn: {
24+
readonly maySpawn: false;
25+
};
26+
readonly modelRole: "docs";
27+
readonly tier: "leaf";
28+
};
29+
30+
const SHAKESPEARE_TOOLS = [
31+
"read_file",
32+
"grep",
33+
"search_files",
34+
"list_dir",
35+
"lsp",
36+
"web_fetch",
37+
"web_search",
38+
"skill_search",
39+
"use_skill",
40+
"write_file",
41+
"edit_file",
42+
"delete_file",
43+
] as const;
44+
45+
export const shakespearePackage: AgentPackage = {
1046
id: "shakespeare",
1147
primaryIntent: "Maintain product, architecture, and implementation docs",
1248
outOfLane: [
@@ -73,7 +109,7 @@ Confirm what changed and where. Summarize consistency/gap follow-ups. Map each s
73109
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.
74110
75111
OUT OF LANE: shipping product features, pure code review, orchestration, treating docs as optional, DESIGN.md ownership, becoming Coder or Reviewer as primary.`,
76-
tools: { allow: DOCS_TOOLS },
112+
tools: { allow: [...SHAKESPEARE_TOOLS] },
77113
spawn: { maySpawn: false },
78114
tier: "leaf",
79115
modelRole: "docs",

‎bun.lock‎

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"tar": "^7.5.1"
8787
},
8888
"dependencies": {
89+
"@corbits/agent-shakespeare": "workspace:*",
8990
"@corbits/codex-provider": "0.1.1",
9091
"@corbits/oauth-core": "0.2.0",
9192
"@corbits/openai-responses": "0.2.1",

‎src/agent/directors/registry.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { shakespearePackage } from "@corbits/agent-shakespeare";
12
import type { AgentProfile, CapabilityFilter } from "../profile-types.js";
23
import { artistPackage } from "./artist/package.js";
34
import { coderPackage } from "./coder/package.js";
@@ -8,7 +9,6 @@ import { plannerPackage } from "./planner/package.js";
89
import { proberPackage } from "./prober/package.js";
910
import { qaLeadPackage } from "./qa-lead/package.js";
1011
import { reviewerPackage } from "./reviewer/package.js";
11-
import { shakespearePackage } from "./shakespeare/package.js";
1212
import { wardenPackage } from "./warden/package.js";
1313
import { formatDirectorSystemPrompt } from "./identity.js";
1414
import {
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { describe, expect, test } from "bun:test";
2+
3+
import { shakespearePackage } from "@corbits/agent-shakespeare";
4+
import { DOCS_TOOLS } from "../tool-sets.js";
5+
import { DIRECTOR_REGISTRY } from "../registry.js";
6+
import type { DirectorPackage } from "../types.js";
7+
8+
describe("shakespearePackage", () => {
9+
test("workspace package satisfies the director contract and feeds the registry", () => {
10+
const asDirector: DirectorPackage = shakespearePackage;
11+
expect(asDirector.id).toBe("shakespeare");
12+
expect(DIRECTOR_REGISTRY.shakespeare).toBe(shakespearePackage);
13+
expect([...shakespearePackage.tools.allow]).toEqual([...DOCS_TOOLS]);
14+
});
15+
16+
test("extracted copy stays docs-scoped and non-spawning", () => {
17+
expect(shakespearePackage.tools.allow).toContain("write_file");
18+
expect(shakespearePackage.tools.allow).toContain("edit_file");
19+
expect(shakespearePackage.tools.allow).toContain("delete_file");
20+
expect(shakespearePackage.tools.allow).not.toContain("run_shell");
21+
expect(shakespearePackage.tools.allow).not.toContain("spawn_agent");
22+
expect(shakespearePackage.tools.allow).not.toContain("ask_operator");
23+
expect(shakespearePackage.spawn.maySpawn).toBe(false);
24+
expect(shakespearePackage.tier).toBe("leaf");
25+
expect(shakespearePackage.modelRole).toBe("docs");
26+
});
27+
});

‎tsconfig.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"composite": false,
66
"baseUrl": ".",
77
"paths": {
8+
"@corbits/agent-shakespeare": ["./agents/shakespeare/src/index.ts"],
89
"@corbits/provider-opencode-go": ["./packages/opencode-go/src/index.ts"],
910
"@corbits/first-class-providers": [
1011
"./packages/first-class-providers/src/index.ts"

0 commit comments

Comments
 (0)