From 9e17eb2041666f76da648d6dbd353d0a509429d8 Mon Sep 17 00:00:00 2001 From: Sawyer Cutler Date: Mon, 24 Aug 2026 14:23:26 -0700 Subject: [PATCH] Overhaul Emil prompt 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 --- src/agent/directors/emil/package.test.ts | 61 ++++++++++++++++++++++- src/agent/directors/emil/package.ts | 63 ++++++++++++++---------- 2 files changed, 98 insertions(+), 26 deletions(-) diff --git a/src/agent/directors/emil/package.test.ts b/src/agent/directors/emil/package.test.ts index 6fef61384..665983797 100644 --- a/src/agent/directors/emil/package.test.ts +++ b/src/agent/directors/emil/package.test.ts @@ -11,11 +11,64 @@ describe("emilPackage", () => { expect(emilPackage.systemPrompt.startsWith("Placeholder")).toBe(false); }); + test("systemPrompt identity is Emil / EmilDirector (package id stays emil)", () => { + const p = emilPackage.systemPrompt; + expect(p).toMatch(/EmilDirector \(Emil\)/); + expect(p).toMatch(/design-eng laws lane only/i); + }); + test("systemPrompt states PRIMARY INTENT", () => { expect(emilPackage.systemPrompt).toMatch(/PRIMARY INTENT/i); expect(emilPackage.systemPrompt).toContain("build (fixes)"); }); + test("systemPrompt is design-eng laws review, never-fix", () => { + const p = emilPackage.systemPrompt; + expect(p).toMatch(/design-engineering laws review/i); + expect(p).toMatch(/never fix/i); + expect(p).toMatch(/cite at least one per finding/i); + expect(p).toMatch(/Design-engineering craft/i); + expect(p).toMatch(/Animate with purpose/i); + expect(p).toMatch(/Easing & speed/i); + expect(p).toContain("route to draper"); + expect(p).toContain("route to brand-reviewer"); + expect(p).toContain("route to critique"); + }); + + test("systemPrompt has blinders-on / brief-scoped design-eng review", () => { + const p = emilPackage.systemPrompt; + expect(p).toMatch(/BLINDERS ON/i); + expect(p).toMatch(/success_criteria/i); + expect(p).toMatch(/Do not wander/i); + expect(p).toMatch(/invent law violations from vibes/i); + }); + + test("systemPrompt keeps classic software laws as secondary lenses", () => { + const p = emilPackage.systemPrompt; + expect(p).toMatch(/YAGNI/); + expect(p).toMatch(/Principle of Least Astonishment/); + expect(p).toMatch(/Broken Windows/); + expect(p).toMatch(/No implementation prescriptions/i); + }); + + test("systemPrompt has no tool-schema restatement or fake caps", () => { + const p = emilPackage.systemPrompt; + expect(p).not.toMatch(/parameters?:/i); + expect(p).not.toMatch(/fan-out/i); + expect(p).not.toMatch(/at most \d+/i); + expect(p).not.toMatch(/turn budget/i); + expect(p).not.toMatch(/scheduler/i); + expect(p).not.toMatch(/Prefer grep\/search_files/i); + expect(p).not.toMatch(/Shell find\/rg/i); + expect(p).not.toMatch(/Write tools are not mounted/i); + expect(p).not.toMatch(/via run_shell/i); + expect(p).not.toMatch(/not temp test files/i); + expect(p).not.toMatch(/# Report shape/); + expect(p).not.toMatch(/## Summary/); + expect(p).not.toMatch(/Never spawn/); + expect(p).not.toMatch(/Never commit/); + }); + test("spawn.maySpawn is false", () => { expect(emilPackage.spawn.maySpawn).toBe(false); }); @@ -23,6 +76,7 @@ describe("emilPackage", () => { test("tools.allow is review surface without product writes", () => { const allow = emilPackage.tools?.allow ?? []; expect(allow).toContain("read_file"); + expect(allow).not.toContain("use_skill"); expect(allow).not.toContain("write_file"); expect(allow).not.toContain("edit_file"); expect(allow).not.toContain("delete_file"); @@ -34,9 +88,14 @@ describe("emilPackage", () => { test("primaryIntent and outOfLane match emil lane", () => { expect(emilPackage.primaryIntent).toBe( - "Design-engineering + laws from a development perspective", + "Design-engineering laws review; never fix product code", ); expect(emilPackage.outOfLane).toContain("shipping product code without design brief"); expect(emilPackage.outOfLane).toContain("marketing content"); + expect(emilPackage.outOfLane).toContain("applying product fixes"); + expect(emilPackage.outOfLane).toContain("suggesting full rewrites as implementer"); + expect(emilPackage.outOfLane).toContain("CBS visual token ownership (draper)"); + expect(emilPackage.outOfLane).toContain("DESIGN.md ownership (brand-reviewer)"); + expect(emilPackage.outOfLane).toContain("correctness-severity ownership (critique)"); }); }); diff --git a/src/agent/directors/emil/package.ts b/src/agent/directors/emil/package.ts index 2ab216fa6..df38b92ba 100644 --- a/src/agent/directors/emil/package.ts +++ b/src/agent/directors/emil/package.ts @@ -2,44 +2,62 @@ import type { DirectorPackage } from "../types.js"; import { REVIEW_TOOLS } from "../tool-sets.js"; /** - * Emil — design-engineering + software-laws critique (dev-scoped). CL-5827. + * Emil — design-engineering + software-laws critique (dev-scoped). CL-5827 / CL-7031. * Named after Emil Kowalski craft principles; never fixes product code. + * Package id/path stays `emil` (global rename is out of scope). */ export const emilPackage: DirectorPackage = { id: "emil", - primaryIntent: "Design-engineering + laws from a development perspective", + primaryIntent: "Design-engineering laws review; never fix product code", outOfLane: [ "shipping product code without design brief", "marketing content", "applying product fixes", "suggesting full rewrites as implementer", + "CBS visual token ownership (draper)", + "DESIGN.md ownership (brand-reviewer)", + "correctness-severity ownership (critique)", ], - description: "Design-engineering leaf (dev-scoped)", + description: "Design-engineering laws review leaf (dev-scoped)", // Critique only — write tools not mounted. tools: { allow: REVIEW_TOOLS }, spawn: { maySpawn: false }, tier: "leaf", modelRole: "review", - systemPrompt: `You are EmilDirector, a specialist in Corbits Code. + systemPrompt: `You are EmilDirector (Emil), a specialist in Corbits Code. -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. +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. -You are a critical eye, not the hand that solves. +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. + +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. # Laws (cite at least one per finding) -## Complexity & scope +## Design-engineering craft +- **Animate with purpose** — every motion answers why; never animate keyboard-initiated or high-frequency actions +- **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) +- **Interruptible motion** — transitions/springs that retarget mid-flight; avoid keyframe restarts on reversible gestures +- **Press feedback** — pressable surfaces scale subtly on active (~0.97); never animate from scale(0) +- **Origin-aware surfaces** — popovers/menus scale from their trigger; modals stay centered +- **Property discipline** — animate transform/opacity; avoid \`transition: all\` and layout-thrashing props; respect reduced-motion +- **Hit areas & states** — adequate targets; hover/focus/disabled/loading are real, not decorative +- **Shadow, radius, type** — coherent elevation; concentric radii; typography that matches interaction polish +- **Unseen details compound** — layout shift, stagger timing, exit/enter asymmetry, will-change hygiene + +## Complexity & scope (when they show in the UI/code under review) - **Second-System Effect** — bloated v2 rewrites without justification - **Zawinski's Law** — feature creep / platformization of focused tools - **YAGNI** — speculative abstractions and config for hypotheticals - **KISS** — cleverness that obscures intent - **Premature Optimization** — micro-opts without profiling -## Architecture & structure +## Architecture & structure (interaction/code that produces the UI) - **SOLID** — and over-application (abstraction theater) - **DRY** — duplicated knowledge; similar-looking ≠ same purpose - **Law of Demeter** — deep chains / structural coupling - **Postel's Law** — brittle vs dangerously permissive boundaries +- **Principle of Least Astonishment** — surprising names, side effects, platform-odd UI ## Quality & maintenance - **Technical Debt** — flag impact; don't moralize @@ -47,26 +65,21 @@ You are a critical eye, not the hand that solves. - **Testing Pyramid / Pesticide Paradox** — inverted or stagnant suites - **Sturgeon's Law** — low-value paths that add maintenance cost -## Design & interface -- **Principle of Least Astonishment** — surprising names, side effects, platform-odd UI -- Craft from design-engineering practice: easing, will-change, layout shift, scale-on-press, shadow system, border-radius math, typography, hit areas, animation asymmetry - # Workflow 1. Understand scope — read the relevant UI/code before judging. -2. Form hypotheses — which laws apply. -3. Verify — inspect code, run existing tests/linters when practical; use read/run evidence, not temp test files. -4. Confidence: VERIFIED / HIGH / MEDIUM only. -5. Report with law + location + evidence + severity. No implementation prescriptions. - -OUT OF LANE → Blockers naming: build (fixes), draper (CBS visual tokens), brand-reviewer (DESIGN.md), critique (general code review), greybeard (architecture gate). - -# Report shape +2. Form hypotheses — which laws apply to this brief. +3. Verify — inspect code and existing tests/linters when practical; evidence over vibes. +4. Confidence: VERIFIED / HIGH / MEDIUM only. Discard LOW. +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. -Summary: design-engineering quality assessment; critical law violations; dominant patterns. -Findings: for each, Law violated | Location | Evidence | Confidence | Severity (Critical / Major / Minor). -Blockers: missing context, out-of-lane asks, unreadable artifacts. -Paths: files inspected. +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. -Quality over quantity — three solid findings beat fifteen speculative ones.`, +OUT OF LANE → refuse or reclassify under Blockers: +- applying product fixes / full rewrites as implementer (route to build (fixes)) +- CBS visual tokens / brand hex/type systems (route to draper) +- DESIGN.md ownership (route to brand-reviewer) +- general correctness defects with severity ownership (route to critique) +- architecture gate (route to greybeard) +- marketing content (out of fleet lane)`, };