Skip to content

Commit 2e8e804

Browse files
committed
Load worker skills on demand instead of baking bodies
Baked skill bodies cost roughly 38KB per worker prompt; workers now search and load only the skills the brief names.
1 parent 7991aae commit 2e8e804

16 files changed

Lines changed: 64 additions & 324 deletions

File tree

‎src/agent/directors/bake-skills.test.ts‎

Lines changed: 0 additions & 101 deletions
This file was deleted.

‎src/agent/directors/bake-skills.ts‎

Lines changed: 0 additions & 90 deletions
This file was deleted.

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,14 @@ describe("builderPackage", () => {
6464
expect(p).toContain("`/implement` does not steal planning from `/plan`");
6565
});
6666

67-
test("systemPrompt requires baked core constraints and Ponytail prerequisites", () => {
67+
test("systemPrompt requires core constraints and Ponytail prerequisites", () => {
6868
const p = builderPackage.systemPrompt;
6969
expect(p).toContain("Prerequisites");
7070
expect(p).toMatch(
7171
/style, philosophy, native-runtime, idiot-proof, and Ponytail/i,
7272
);
73-
expect(p).toMatch(/use_skill is not mounted/i);
73+
expect(p).toMatch(/load each with skill_search \+ use_skill/i);
74+
expect(p).not.toMatch(/use_skill is not mounted/i);
7475
expect(p).toMatch(
7576
/including their TypeScript conventions when TypeScript is the task surface/i,
7677
);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ You are a disciplined implementer worker (maySpawn:false) — not Critic, not Ex
3737
3838
## Prerequisites
3939
40-
Before substantial repo work: follow style, philosophy, native-runtime, idiot-proof, and Ponytail (baked; use_skill is not mounted). Follow AGENTS.md and /docs, including their TypeScript conventions when TypeScript is the task surface.
40+
Before substantial repo work: follow style, philosophy, native-runtime, idiot-proof, and Ponytail — load each with skill_search + use_skill only when the brief needs it. Follow AGENTS.md and /docs, including their TypeScript conventions when TypeScript is the task surface.
4141
4242
## Plan
4343

‎src/agent/directors/critic/package.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ describe("criticPackage", () => {
110110
test("tools.allow is review surface with product writes", () => {
111111
const allow = criticPackage.tools?.allow ?? [];
112112
expect(allow).toContain("read_file");
113-
expect(allow).not.toContain("use_skill");
113+
expect(allow).toContain("skill_search");
114+
expect(allow).toContain("use_skill");
114115
expect(allow).toContain("write_file");
115116
expect(allow).toContain("edit_file");
116117
expect(allow).toContain("delete_file");

‎src/agent/directors/critic/package.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ API contract check (blocking when brief specifies signatures):
6161
- Prefer reading tests/callers; a tiny sync call that would hang on a Promise is evidence.
6262
- Rank these as blocking, not style nits.
6363
64-
Before substantial review work: follow style, philosophy, native-integration, and idiot-proof (baked; use_skill is not mounted). Read the code under review.
64+
Before substantial review work: follow style, philosophy, native-integration, and idiot-proof — load each with skill_search + use_skill only when the brief needs it. Read the code under review.
6565
6666
OUT OF LANE → refuse or reclassify under Blockers:
6767
- implementing fixes (route to builder)

‎src/agent/directors/draper/package.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ describe("draperPackage", () => {
133133
test("tools.allow is review surface with file writes for evidence tests", () => {
134134
const allow = draperPackage.tools?.allow ?? [];
135135
expect(allow).toContain("read_file");
136-
expect(allow).not.toContain("use_skill");
136+
expect(allow).toContain("skill_search");
137+
expect(allow).toContain("use_skill");
137138
expect(allow).toContain("write_file");
138139
expect(allow).toContain("edit_file");
139140
expect(allow).toContain("delete_file");

‎src/agent/directors/emil/package.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ describe("emilPackage", () => {
7878
test("tools.allow is review surface with product writes", () => {
7979
const allow = emilPackage.tools?.allow ?? [];
8080
expect(allow).toContain("read_file");
81-
expect(allow).not.toContain("use_skill");
81+
expect(allow).toContain("skill_search");
82+
expect(allow).toContain("use_skill");
8283
expect(allow).toContain("write_file");
8384
expect(allow).toContain("edit_file");
8485
expect(allow).toContain("delete_file");

‎src/agent/directors/greybeard/package.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ PRIMARY INTENT: architecture judgment. Judge approach soundness, constraint owne
2525
2626
You are Greybeard — not a second Skywalker, not Critic (code defects with evidence), not Builder. Your value is architectural judgment, not legwork or implementation.
2727
28-
Follow style and philosophy conventions (baked into this prompt) when reviewing plans or approaches — skills are active constraints, not background docs.
28+
Follow style and philosophy conventions (load on demand with skill_search + use_skill) when reviewing plans or approaches — skills are active constraints, not background docs.
2929
3030
Your value is analysis, not delegation: reach the judgment yourself with
3131
targeted reads (read_file, grep) and pointed questions (ask_director)
@@ -44,7 +44,7 @@ Blinders: do not call search_agents to discover the fleet. Do not spawn builder,
4444
4545
Guide quality — advise what good architecture looks like for this change. Do not assert enforcement theater (fake caps, pretend runtime gates, or "must spawn N" rules the harness does not enforce).
4646
47-
Before substantial review work: follow style and philosophy conventions (baked; use_skill is not mounted on workers).
47+
Before substantial review work: follow style and philosophy conventions — load each with skill_search + use_skill only when the brief needs it.
4848
4949
OUT OF LANE: shipping product code, pedantic style-only nitpicking, being a second primary orchestrator, discovering or dispatching the full fleet.`,
5050
};

0 commit comments

Comments
 (0)