Skip to content

Commit 459a30b

Browse files
committed
feat(designer): ship designer as a workspace agent package
Extract src/agent/directors/designer/package.ts into the @corbits/agent-designer workspace package with a byte-identical system prompt and a self-contained tool allowlist. The registry imports the workspace copy; drift against the app build surface fails src/agent/directors/designer/package.test.ts. Fixes CL-9798.
1 parent 081c161 commit 459a30b

7 files changed

Lines changed: 95 additions & 9 deletions

File tree

‎agents/designer/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-designer",
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+
}
Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,49 @@
1-
import type { DirectorPackage } from "../types.js";
2-
import { BUILD_TOOLS } from "../tool-sets.js";
3-
41
/**
52
* Designer worker: UI/UX design engineering specialist.
63
* Owns DESIGN.md creation and updates, impeccable.style design laws,
74
* design tokens, typography, spatial layout, and micro-interaction polish.
5+
*
6+
* Ships as the @corbits/agent-designer 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/designer/package.test.ts.
89
*/
9-
export const designerPackage: DirectorPackage = {
10+
export type AgentPackage = {
11+
readonly id: "designer";
12+
readonly primaryIntent: string;
13+
readonly outOfLane: readonly string[];
14+
readonly description: string;
15+
readonly systemPrompt: string;
16+
/** Unset — designer never attaches skill bodies at spawn. */
17+
readonly attachedSkills?: readonly string[];
18+
/** Unset — designer 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: "implement";
27+
readonly tier: "leaf";
28+
};
29+
30+
const DESIGNER_TOOLS = [
31+
"read_file",
32+
"grep",
33+
"search_files",
34+
"list_dir",
35+
"lsp",
36+
"run_shell",
37+
"web_fetch",
38+
"web_search",
39+
"skill_search",
40+
"use_skill",
41+
"write_file",
42+
"edit_file",
43+
"delete_file",
44+
] as const;
45+
46+
export const designerPackage: AgentPackage = {
1047
id: "designer",
1148
primaryIntent:
1249
"Own DESIGN.md create/use, design tokens, UI styling, and impeccable.style design engineering",
@@ -18,10 +55,6 @@ export const designerPackage: DirectorPackage = {
1855
],
1956
description:
2057
"UI/UX designer — owns DESIGN.md, impeccable style design laws, tokens, and interface polish",
21-
tools: { allow: BUILD_TOOLS },
22-
spawn: { maySpawn: false },
23-
tier: "leaf",
24-
modelRole: "implement",
2558
systemPrompt: `You are DesignerDirector (Designer), a specialist in Corbits Code.
2659
2760
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.
@@ -45,4 +78,8 @@ Workflow:
4578
4. Report changes with Summary / Findings / Blockers / Paths.
4679
4780
OUT OF LANE: backend business logic or database migrations, general backend defect review, marketing content pipelines, fleet orchestration.`,
81+
tools: { allow: [...DESIGNER_TOOLS] },
82+
spawn: { maySpawn: false },
83+
tier: "leaf",
84+
modelRole: "implement",
4885
};

‎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-designer": "workspace:*",
8990
"@corbits/codex-provider": "0.1.1",
9091
"@corbits/oauth-core": "0.2.0",
9192
"@corbits/openai-responses": "0.2.1",
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { describe, expect, test } from "bun:test";
2+
3+
import { designerPackage } from "@corbits/agent-designer";
4+
import { BUILD_TOOLS } from "../tool-sets.js";
5+
import { DIRECTOR_REGISTRY } from "../registry.js";
6+
import type { DirectorPackage } from "../types.js";
7+
8+
describe("designerPackage", () => {
9+
test("workspace package satisfies the director contract and feeds the registry", () => {
10+
const asDirector: DirectorPackage = designerPackage;
11+
expect(asDirector.id).toBe("designer");
12+
expect(DIRECTOR_REGISTRY.designer).toBe(designerPackage);
13+
expect([...designerPackage.tools.allow]).toEqual([...BUILD_TOOLS]);
14+
});
15+
16+
test("extracted copy stays build-scoped and non-spawning", () => {
17+
expect(designerPackage.tools.allow).toContain("write_file");
18+
expect(designerPackage.tools.allow).toContain("edit_file");
19+
expect(designerPackage.tools.allow).toContain("delete_file");
20+
expect(designerPackage.tools.allow).not.toContain("spawn_agent");
21+
expect(designerPackage.tools.allow).not.toContain("ask_operator");
22+
expect(designerPackage.spawn.maySpawn).toBe(false);
23+
expect(designerPackage.tier).toBe("leaf");
24+
expect(designerPackage.modelRole).toBe("implement");
25+
});
26+
});

‎src/agent/directors/registry.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
import { designerPackage } from "@corbits/agent-designer";
12
import type { AgentProfile, CapabilityFilter } from "../profile-types.js";
23
import { artistPackage } from "./artist/package.js";
34
import { coderPackage } from "./coder/package.js";
4-
import { designerPackage } from "./designer/package.js";
55
import { dispatchPackage } from "./dispatch/package.js";
66
import { explorerPackage } from "./explorer/package.js";
77
import { plannerPackage } from "./planner/package.js";

‎tsconfig.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"composite": false,
66
"baseUrl": ".",
77
"paths": {
8+
"@corbits/agent-designer": ["./agents/designer/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"
@@ -17,6 +18,7 @@
1718
"src/**/*.ts",
1819
"testkit/**/*.ts",
1920
"packages/**/*.ts",
21+
"agents/**/*.ts",
2022
"e2e/**/*.ts",
2123
"evals/**/*.ts",
2224
"scripts/**/*.ts"

0 commit comments

Comments
 (0)