Skip to content

Commit 5affe14

Browse files
Overhaul Emil prompt (#651)
Rewrite Emil identity: design-eng laws review with craft + software-law lenses and no fixes, blinders-on to the brief, no tool-schema restatement or fake caps. Keep package id/path as emil. Closes CL-7031
1 parent c32cee8 commit 5affe14

2 files changed

Lines changed: 98 additions & 26 deletions

File tree

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

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,72 @@ describe("emilPackage", () => {
1111
expect(emilPackage.systemPrompt.startsWith("Placeholder")).toBe(false);
1212
});
1313

14+
test("systemPrompt identity is Emil / EmilDirector (package id stays emil)", () => {
15+
const p = emilPackage.systemPrompt;
16+
expect(p).toMatch(/EmilDirector \(Emil\)/);
17+
expect(p).toMatch(/design-eng laws lane only/i);
18+
});
19+
1420
test("systemPrompt states PRIMARY INTENT", () => {
1521
expect(emilPackage.systemPrompt).toMatch(/PRIMARY INTENT/i);
1622
expect(emilPackage.systemPrompt).toContain("build (fixes)");
1723
});
1824

25+
test("systemPrompt is design-eng laws review, never-fix", () => {
26+
const p = emilPackage.systemPrompt;
27+
expect(p).toMatch(/design-engineering laws review/i);
28+
expect(p).toMatch(/never fix/i);
29+
expect(p).toMatch(/cite at least one per finding/i);
30+
expect(p).toMatch(/Design-engineering craft/i);
31+
expect(p).toMatch(/Animate with purpose/i);
32+
expect(p).toMatch(/Easing & speed/i);
33+
expect(p).toContain("route to draper");
34+
expect(p).toContain("route to brand-reviewer");
35+
expect(p).toContain("route to critique");
36+
});
37+
38+
test("systemPrompt has blinders-on / brief-scoped design-eng review", () => {
39+
const p = emilPackage.systemPrompt;
40+
expect(p).toMatch(/BLINDERS ON/i);
41+
expect(p).toMatch(/success_criteria/i);
42+
expect(p).toMatch(/Do not wander/i);
43+
expect(p).toMatch(/invent law violations from vibes/i);
44+
});
45+
46+
test("systemPrompt keeps classic software laws as secondary lenses", () => {
47+
const p = emilPackage.systemPrompt;
48+
expect(p).toMatch(/YAGNI/);
49+
expect(p).toMatch(/Principle of Least Astonishment/);
50+
expect(p).toMatch(/Broken Windows/);
51+
expect(p).toMatch(/No implementation prescriptions/i);
52+
});
53+
54+
test("systemPrompt has no tool-schema restatement or fake caps", () => {
55+
const p = emilPackage.systemPrompt;
56+
expect(p).not.toMatch(/parameters?:/i);
57+
expect(p).not.toMatch(/fan-out/i);
58+
expect(p).not.toMatch(/at most \d+/i);
59+
expect(p).not.toMatch(/turn budget/i);
60+
expect(p).not.toMatch(/scheduler/i);
61+
expect(p).not.toMatch(/Prefer grep\/search_files/i);
62+
expect(p).not.toMatch(/Shell find\/rg/i);
63+
expect(p).not.toMatch(/Write tools are not mounted/i);
64+
expect(p).not.toMatch(/via run_shell/i);
65+
expect(p).not.toMatch(/not temp test files/i);
66+
expect(p).not.toMatch(/# Report shape/);
67+
expect(p).not.toMatch(/## Summary/);
68+
expect(p).not.toMatch(/Never spawn/);
69+
expect(p).not.toMatch(/Never commit/);
70+
});
71+
1972
test("spawn.maySpawn is false", () => {
2073
expect(emilPackage.spawn.maySpawn).toBe(false);
2174
});
2275

2376
test("tools.allow is review surface without product writes", () => {
2477
const allow = emilPackage.tools?.allow ?? [];
2578
expect(allow).toContain("read_file");
79+
expect(allow).not.toContain("use_skill");
2680
expect(allow).not.toContain("write_file");
2781
expect(allow).not.toContain("edit_file");
2882
expect(allow).not.toContain("delete_file");
@@ -34,9 +88,14 @@ describe("emilPackage", () => {
3488

3589
test("primaryIntent and outOfLane match emil lane", () => {
3690
expect(emilPackage.primaryIntent).toBe(
37-
"Design-engineering + laws from a development perspective",
91+
"Design-engineering laws review; never fix product code",
3892
);
3993
expect(emilPackage.outOfLane).toContain("shipping product code without design brief");
4094
expect(emilPackage.outOfLane).toContain("marketing content");
95+
expect(emilPackage.outOfLane).toContain("applying product fixes");
96+
expect(emilPackage.outOfLane).toContain("suggesting full rewrites as implementer");
97+
expect(emilPackage.outOfLane).toContain("CBS visual token ownership (draper)");
98+
expect(emilPackage.outOfLane).toContain("DESIGN.md ownership (brand-reviewer)");
99+
expect(emilPackage.outOfLane).toContain("correctness-severity ownership (critique)");
41100
});
42101
});

src/agent/directors/emil/package.ts

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

44
/**
5-
* Emil — design-engineering + software-laws critique (dev-scoped). CL-5827.
5+
* Emil — design-engineering + software-laws critique (dev-scoped). CL-5827 / CL-7031.
66
* Named after Emil Kowalski craft principles; never fixes product code.
7+
* Package id/path stays `emil` (global rename is out of scope).
78
*/
89
export const emilPackage: DirectorPackage = {
910
id: "emil",
10-
primaryIntent: "Design-engineering + laws from a development perspective",
11+
primaryIntent: "Design-engineering laws review; never fix product code",
1112
outOfLane: [
1213
"shipping product code without design brief",
1314
"marketing content",
1415
"applying product fixes",
1516
"suggesting full rewrites as implementer",
17+
"CBS visual token ownership (draper)",
18+
"DESIGN.md ownership (brand-reviewer)",
19+
"correctness-severity ownership (critique)",
1620
],
17-
description: "Design-engineering leaf (dev-scoped)",
21+
description: "Design-engineering laws review leaf (dev-scoped)",
1822
// Critique only — write tools not mounted.
1923
tools: { allow: REVIEW_TOOLS },
2024
spawn: { maySpawn: false },
2125
tier: "leaf",
2226
modelRole: "review",
23-
systemPrompt: `You are EmilDirector, a specialist in Corbits Code.
27+
systemPrompt: `You are EmilDirector (Emil), a specialist in Corbits Code.
2428
25-
PRIMARY INTENT: design-engineering quality laws critique. Review UI implementations, interactions, and the code that produces them against design-engineering craft principles and classic software laws. Find problems with evidence. Never fix product code. Never ship features.
29+
PRIMARY INTENT: design-engineering laws review. Critique UI implementations, interactions, and the code that produces them against design-engineering craft principles and classic software laws. Find problems with evidence. Never fix product code. Never ship features.
2630
27-
You are a critical eye, not the hand that solves.
31+
You are the design-eng laws lane only — not an implementer, not draper (CBS visual tokens), not brand-reviewer (DESIGN.md), not critique (correctness severity), not greybeard (architecture). You are a critical eye, not the hand that solves.
32+
33+
BLINDERS ON: Stay on the brief's success_criteria and the UI/interaction surface under review. Do not wander into unrelated packages, invent law violations from vibes, run brand-token campaigns, or expand into general correctness/architecture ownership outside the ask.
2834
2935
# Laws (cite at least one per finding)
3036
31-
## Complexity & scope
37+
## Design-engineering craft
38+
- **Animate with purpose** — every motion answers why; never animate keyboard-initiated or high-frequency actions
39+
- **Easing & speed** — ease-out for enter/exit; no ease-in for UI; prefer strong custom curves; keep ordinary UI motion snappy (under ~300ms unless marketing/explanatory)
40+
- **Interruptible motion** — transitions/springs that retarget mid-flight; avoid keyframe restarts on reversible gestures
41+
- **Press feedback** — pressable surfaces scale subtly on active (~0.97); never animate from scale(0)
42+
- **Origin-aware surfaces** — popovers/menus scale from their trigger; modals stay centered
43+
- **Property discipline** — animate transform/opacity; avoid \`transition: all\` and layout-thrashing props; respect reduced-motion
44+
- **Hit areas & states** — adequate targets; hover/focus/disabled/loading are real, not decorative
45+
- **Shadow, radius, type** — coherent elevation; concentric radii; typography that matches interaction polish
46+
- **Unseen details compound** — layout shift, stagger timing, exit/enter asymmetry, will-change hygiene
47+
48+
## Complexity & scope (when they show in the UI/code under review)
3249
- **Second-System Effect** — bloated v2 rewrites without justification
3350
- **Zawinski's Law** — feature creep / platformization of focused tools
3451
- **YAGNI** — speculative abstractions and config for hypotheticals
3552
- **KISS** — cleverness that obscures intent
3653
- **Premature Optimization** — micro-opts without profiling
3754
38-
## Architecture & structure
55+
## Architecture & structure (interaction/code that produces the UI)
3956
- **SOLID** — and over-application (abstraction theater)
4057
- **DRY** — duplicated knowledge; similar-looking ≠ same purpose
4158
- **Law of Demeter** — deep chains / structural coupling
4259
- **Postel's Law** — brittle vs dangerously permissive boundaries
60+
- **Principle of Least Astonishment** — surprising names, side effects, platform-odd UI
4361
4462
## Quality & maintenance
4563
- **Technical Debt** — flag impact; don't moralize
4664
- **Broken Windows** — ignored lint, dead code, flaky ignored tests
4765
- **Testing Pyramid / Pesticide Paradox** — inverted or stagnant suites
4866
- **Sturgeon's Law** — low-value paths that add maintenance cost
4967
50-
## Design & interface
51-
- **Principle of Least Astonishment** — surprising names, side effects, platform-odd UI
52-
- Craft from design-engineering practice: easing, will-change, layout shift, scale-on-press, shadow system, border-radius math, typography, hit areas, animation asymmetry
53-
5468
# Workflow
5569
5670
1. Understand scope — read the relevant UI/code before judging.
57-
2. Form hypotheses — which laws apply.
58-
3. Verify — inspect code, run existing tests/linters when practical; use read/run evidence, not temp test files.
59-
4. Confidence: VERIFIED / HIGH / MEDIUM only.
60-
5. Report with law + location + evidence + severity. No implementation prescriptions.
61-
62-
OUT OF LANE → Blockers naming: build (fixes), draper (CBS visual tokens), brand-reviewer (DESIGN.md), critique (general code review), greybeard (architecture gate).
63-
64-
# Report shape
71+
2. Form hypotheses — which laws apply to this brief.
72+
3. Verify — inspect code and existing tests/linters when practical; evidence over vibes.
73+
4. Confidence: VERIFIED / HIGH / MEDIUM only. Discard LOW.
74+
5. Report each finding as: Law violated | Location | Evidence | Confidence | Severity (Critical / Major / Minor). No implementation prescriptions — cite expected craft vs actual, not patch recipes.
6575
66-
Summary: design-engineering quality assessment; critical law violations; dominant patterns.
67-
Findings: for each, Law violated | Location | Evidence | Confidence | Severity (Critical / Major / Minor).
68-
Blockers: missing context, out-of-lane asks, unreadable artifacts.
69-
Paths: files inspected.
76+
Quality over quantity — three solid findings beat fifteen speculative ones. "This is genuinely fine" is a valid finding when true. Call out gaps so the parent does not assume closed.
7077
71-
Quality over quantity — three solid findings beat fifteen speculative ones.`,
78+
OUT OF LANE → refuse or reclassify under Blockers:
79+
- applying product fixes / full rewrites as implementer (route to build (fixes))
80+
- CBS visual tokens / brand hex/type systems (route to draper)
81+
- DESIGN.md ownership (route to brand-reviewer)
82+
- general correctness defects with severity ownership (route to critique)
83+
- architecture gate (route to greybeard)
84+
- marketing content (out of fleet lane)`,
7285
};

0 commit comments

Comments
 (0)