design-engine — Master Orchestrator
This file is the entry point. Claude reads this FIRST on every design-engine
invocation. Every rule here is binding. No interpretation. No deviation.
1. What design-engine Is
design-engine is the single design skill for Claude Code. It produces:
- Full design systems (tokens, components, interactive preview, Figma-ready)
- Multi-screen canvases (Figma-style side-by-side mockups)
- Clickable prototypes (real navigation, Playwright-verified)
- Animations (HTML → MP4/GIF export, BGM, 60fps)
- AI-to-AI handoff packages (HANDOFF.md + tokens + screens + components)
- Codebase-aware redesigns (reads existing stack, extends it, never alien)
- URL-cloned design systems (extract → reverse-engineer → tokenize)
- Figma bidirectional sync (pull tokens/components, push generated systems)
- Image-to-code (screenshot → production component matching existing codebase)
- Scored critique (8-dimension review, blocks handoff below 7.0)
It is general-purpose. It replaces ad-hoc reaches for impeccable,
high-end-visual-design, image-to-code, minimalist-ui, redesign-existing-projects,
design-taste-frontend, emil-design-eng, and frontend-design for any visual
design task. Those skills' principles are absorbed; their invocation is not.
2. Trigger Surface — When To Activate
Slash commands (exact match → activate immediately)
| Command |
Intent |
/design web |
Web app, SaaS, dashboard, internal tool |
/design mobile |
iOS or Android native screen |
/design system |
Full design system (tokens + components + docs) |
/design landing |
Marketing site, landing page, hero, pricing |
/design review |
Critique-only mode, no generation |
/design import |
Pull from Figma as starting point |
/design redraw |
Redesign existing screen (screenshot attached) |
Natural-language triggers (case-insensitive substring match → activate)
design this redesign create UI
build interface clone [url] design system
component library create prototype hi-fi
hi fi high fidelity mockup
mock up canvas design tokens
figma sync figma push figma pull
review this design critique handoff
make this look better polish this UI ship-quality design
landing page dashboard onboarding flow
auth screen settings page pricing page
screenshot to code image to code extract design system
If the user's message contains a trigger AND describes visual/UI work →
activate. Ambiguous cases (e.g. "fix this CSS bug") are NOT triggers — that
is a code task, not a design task. When in doubt, ask one clarifying
question instead of assuming.
Anti-triggers — DO NOT activate
- Pure backend, API, database, or infrastructure work
- Bug fixes that don't touch visual output
- Refactors that preserve the existing UI
- Documentation tasks unrelated to design
3. Core Philosophy — Binding Rules
Rule 1 — Design System First
Every output derives from a design system. Pipeline is fixed:
Brief → Context Intake → Design System → Components → Output
Never skip steps. Never generate a screen before the system exists.
Never hardcode values in a screen. Every value references a token.
Rule 2 — Read Before Generate
Before generating ANY pixel, the skill MUST:
- Scan the current codebase (if inside a project)
- Fetch any URL the user references
- Analyze any screenshot the user attached
- Run web research relevant to the task
Generating blind produces AI slop. This is non-negotiable.
Rule 3 — Safe Zone Only
All generated output goes to .design-engine/ in the project root.
NEVER write to src/, app/, components/, pages/, public/, or any
existing project directory. Promotion to production is the user's manual
action via explicit cp commands shown in the terminal output.
Rule 4 — Handoff Is The Product
The deliverable is .design-engine/handoff/HANDOFF.md plus its bundle.
Every flow ends with a handoff package the user can copy-paste into
Claude Code or Cursor with zero ambiguity.
Rule 5 — One Distinctive Detail
Every screen ships with one screenshottable moment — a single,
intentional, non-default detail (a custom interaction, an unexpected
typographic choice, a meaningful animation, a deliberate density).
Without it the output is mediocre. With more than two it is noise.
4. Output Modes — Canvas / Prototype / Both
Always ask first (after brief is confirmed, before generation)
Output mode?
[C] Canvas → Figma-style layout, all screens side by side, annotations
[P] Prototype → Fully clickable, real navigation, Playwright-verified
[B] Both → Canvas first → approve → Prototype built from it (default)
Skip the prompt only if
- The slash command implies the mode (
/design system → system preview, no canvas/proto)
- The user already specified mode in their message ("build a clickable prototype")
- The user has a
.design-engine.json with "mode" set
In Both mode (default)
- Generate canvas
- STOP. Show user. Ask: "Approve canvas? (Mark sections Looks good / Needs work)"
- Only after explicit approval → generate prototype from approved canvas
- Never build prototype before canvas approval
5. Pipeline Order — Fixed Sequence
The router (modules/00-router.md) selects modules. The sequence below
is the canonical order. Modules may be skipped when irrelevant; their
relative order is never reordered.
0. modules/00-install-hook.md ← first-run only: install auto-update hook
1. modules/00-router.md ← parse intent, choose path
2. modules/01-context-intake.md ← fuse text/visual/code/figma context
3. modules/04-codebase-scan.md ← if inside a project
4. modules/03-clone-engine.md ← if URL clone requested
5. modules/12-image-to-code.md ← if screenshot provided
6. modules/05-web-research.md ← competitor + trend + reference research
7. modules/02-design-interview.md ← gap-based, max 4 questions
8. modules/06-system-selection.md ← only for /design system
9. modules/13-figma-pull.md ← only for /design import
10. modules/07-design-system-gen.md ← always, before any screen
11. modules/08-component-library.md ← generate components from tokens
12. modules/09-canvas-mode.md ← if mode includes Canvas
13. modules/10-prototype-mode.md ← if mode includes Prototype (after canvas approval)
14. modules/11-animation.md ← only when animation requested
15. modules/14-figma-push.md ← if user asked to push to Figma
16. modules/15-critique.md ← always, before handoff
17. modules/16-handoff.md ← always, the final step
Routing decision table (used by 00-router.md)
| User input pattern |
Active modules |
| "redesign my dashboard" |
01, 04, 05, 02, 07, 08, 09/10, 15, 16 |
| "build onboarding from scratch" |
01, 05, 02, 07, 08, 09/10, 15, 16 |
| "convert this screenshot" |
01, 12, 04, 07 (extend), 08, 09/10, 15, 16 |
| "clone linear.app" |
01, 03, 07, 08, 09/10, 15, 16 |
| "create a landing page animation" |
01, 02, 07, 08, 11, 15, 16 |
| "review this design" |
01, 15 (only) |
| "push to Figma" |
04, 07, 14 |
| "import from figma" |
01, 13, 07, 08, 09/10, 15, 16 |
| Vague brief |
05, 02, Direction Advisor (3 parallel demos), then full pipeline |
6. Hardcoded Anti-Slop Rules — NON-NEGOTIABLE
These rules apply to every output. Violating any of them is a defect.
Critique (15) flags violations and blocks handoff if any are present.
NEVER generate
- Purple/blue gradients as hero or card backgrounds
- Rounded cards with a left-side colored border accent
- Sans-serif everywhere with no display personality
- Default Heroicons at default size and stroke weight
- AI blue (
#6366f1, #8b5cf6) as primary unless explicitly requested
max-w-2xl centered everything layout
- Glassmorphism without a clear purpose
- Fake 3D elements that don't commit to the illusion
- Emoji as UI icons
- Stock-photo aesthetics
- More than 3 different font sizes on one screen
- More than 2 font weights in one visual group
- Shadows in dark mode (use border elevation instead)
- Hardcoded color values in generated code (always token references)
- Box-shadow transitions on hover (use transform instead)
- Lorem ipsum in prototypes — use realistic data
- Tailwind arbitrary values when a token exists
- Inline styles on production components
outline: none without a replacement focus indicator
- Annotation overlays, callout boxes, tooltip badges, label overlays,
off-token chips, component name pills, or any explanatory text
rendered on top of canvas or prototype screens. Annotations are OFF
by default. When
--annotate is on, annotations live in a strip
BELOW the screen frame (module 09 §5.1), NOT on top of the design.
The screen at all times must be fully visible and unobstructed.
Spacing redlines require the explicit --annotate --redlines
combination and render as a translucent toggleable layer; they are
the only exception to "annotations never on screen", and they
default to off even within that mode. See module 09 §0 Clean Canvas
Rule.
ALWAYS generate
oklch() for every color value
- 4-dimension typographic hierarchy (size, weight, color, spacing)
- One unexpected/distinctive detail per screen (the screenshottable moment)
- Hover states on all interactive elements
- Focus rings on all focusable elements
- Negative letter-spacing on text above 20px
- GPU-composited animations only (transform + opacity)
- Token references in all code
- Dark mode consideration for every component
- Real content (real names, real numbers, real copy) in prototypes
- Min 44×44px touch targets on mobile
- WCAG AA contrast minimum (AAA preferred where readable)
7. Safe Zone — File System Contract
NEVER write to (production code zone)
src/ app/ components/ pages/
public/ styles/ lib/ hooks/
utils/ api/ server/ prisma/
any file at the project root except .design-engine.json
Writing to any of the above is a hard violation. If a generated file
needs to live there eventually, output it to .design-engine/handoff/
and instruct the user to copy it manually.
ALWAYS write to (safe zone)
.design-engine/
├── system/ ← active design system
│ ├── tokens.json
│ ├── tokens.css
│ ├── tokens.ts
│ ├── tokens.tailwind.js
│ ├── tokens.figma.json
│ ├── system-preview.html ← self-contained interactive preview
│ ├── SYSTEM.md
│ └── components/
├── canvas/[timestamp]/ ← canvas mode outputs
├── prototype/[timestamp]/ ← prototype outputs
└── handoff/ ← final handoff package
├── HANDOFF.md
├── design-tokens.{json,css,ts,tailwind.js}
├── screens/
├── components/
└── assets/
Committed config
.design-engine.json at project root — the ONE file design-engine
writes outside .design-engine/. Schema:
{
"system": "saas-dark",
"version": "1.0.0",
"adapted": true,
"stack": "nextjs-tailwind-shadcn",
"mode": "both",
"figmaFileKey": null,
"lastSync": null
}
Gitignore
On first run, ensure .design-engine/ is in .gitignore. If .gitignore
doesn't exist, create it with .design-engine/ as the only line. If it
exists and the entry is missing, append. Never modify other gitignore lines.
8. Module Reference Index
Every module is loaded on demand by the router. Paths are relative to
the skill root.
| Module |
Purpose |
modules/00-install-hook.md |
First-run: install auto-update hook (Claude Code + Cursor) |
modules/00-router.md |
Parse intent, select pipeline |
modules/01-context-intake.md |
Fuse text/visual/code/figma context |
modules/02-design-interview.md |
Gap-based interview, max 4 questions |
modules/03-clone-engine.md |
URL clone + reverse-engineer + tokenize |
modules/04-codebase-scan.md |
Read existing project for stack + tokens |
modules/05-web-research.md |
Competitor / inspo / trend search |
modules/06-system-selection.md |
Pre-built system picker UI |
modules/07-design-system-gen.md |
Generate full design system + preview |
modules/08-component-library.md |
Generate components consuming tokens |
modules/09-canvas-mode.md |
Multi-screen canvas with annotations |
modules/10-prototype-mode.md |
Clickable prototype, Playwright-verified |
modules/11-animation.md |
HTML → MP4/GIF export pipeline |
modules/12-image-to-code.md |
Screenshot → production component |
modules/13-figma-pull.md |
Pull tokens/components from Figma MCP |
modules/14-figma-push.md |
Push design system to Figma MCP |
modules/15-critique.md |
8-dimension scored review |
modules/16-handoff.md |
Generate handoff package |
Reference docs (load on demand)
| File |
Purpose |
references/design-philosophies.md |
20 design philosophies |
references/anti-patterns.md |
Full AI-slop rule list |
references/token-architecture.md |
Primitive → semantic → component |
references/clone-extraction-guide.md |
URL reverse-engineering pipeline |
references/oklch-color-guide.md |
oklch theory + scale construction |
references/typography-systems.md |
Scale ratios, pairing, tracking |
references/dark-mode-rules.md |
Border elevation vs shadow |
references/motion-system.md |
Duration scale + easing library |
references/web-patterns.md |
SaaS dashboard, auth, onboarding |
references/mobile-patterns.md |
iOS/Android nav, gestures |
references/figma-mcp-playbook.md |
Exact MCP calls for push/pull |
references/codebase-reading-guide.md |
Stack detection signals |
references/search-query-templates.md |
Pre-built search strategies |
references/handoff-spec-format.md |
HANDOFF.md format for AI agents |
references/animation-pitfalls.md |
What breaks animations |
references/image-to-code-guide.md |
Screenshot analysis pipeline |
Pre-built systems (12, load only the selected one)
systems/{linear,vercel,stripe,raycast,notion,saas-light,saas-dark,
mobile-ios,mobile-material,editorial,minimal,enterprise}/
Each system contains: tokens.{json,css,ts,tailwind.js,figma.json},
system.md, preview.html, components/{button,card,input,nav,table, badge,modal,toast}.jsx.
Assets
assets/frames/{iphone-15-pro,android,browser,macos-window,desktop}.html
assets/animation-engine/{animations.jsx,deck-stage.js}
assets/component-starters/design-canvas.jsx
9. Operating Sequence — Every Invocation
The agent MUST follow this sequence on every design-engine activation.
No step is optional unless explicitly marked.
- Run install-hook. ALWAYS — first action on every invocation,
before parsing the trigger. Read
modules/00-install-hook.md and
execute it. The module owns its own idempotency: it checks both
.design-engine.json AND ~/.claude/settings.json (and
~/.cursor/settings.json if present) on every run, and exits
silently when the hook is already installed in all detected
targets. Do NOT skip this step based on .design-engine.json's
hookInstalled field — that flag is the module's bookkeeping,
not a gate the orchestrator applies. The module decides whether
to do work; the orchestrator always invokes it.
- Parse trigger. Identify slash command or natural-language trigger.
Confirm this is a design task (not a code/backend task).
- Load router. Read
modules/00-router.md. Use its decision table.
- Load context. Read
modules/01-context-intake.md. Gather every
provided source: text, screenshots, URLs, code, Figma links.
- Scan codebase. If inside a git repo with frontend code, run
modules/04-codebase-scan.md. Display the Codebase Design Snapshot.
- Run sub-pipelines. If URL given → clone-engine. If screenshot →
image-to-code. If Figma URL → figma-pull. Run in parallel where possible.
- Web research. Run
modules/05-web-research.md unless the brief is
so concrete that research adds nothing. Default: research.
- Interview. Run
modules/02-design-interview.md. Max 4 questions.
Skip questions whose answers are already in context.
- Confirm brief. Display the Design Brief Summary block. WAIT for
the user to confirm or adjust before generating anything.
- Ask output mode. Show Canvas/Prototype/Both prompt unless
resolved (see §4). WAIT for selection.
- Generate system. Run
modules/07-design-system-gen.md. Write to
.design-engine/system/. Show preview path.
- Generate components. Run
modules/08-component-library.md.
- Generate canvas / prototype. Run modules 09 and/or 10. In Both
mode, generate canvas first, WAIT for approval, then prototype.
- Critique. Run
modules/15-critique.md. Display 8-dimension
scores. If overall < 7.0, fix issues and re-run before handoff.
- Handoff. Run
modules/16-handoff.md. Display the terminal
output block with promote instructions and scores.
Stop conditions
- User says "stop", "cancel", "wait" → halt immediately, do not generate.
- Brief unconfirmed → do not proceed past step 8.
- Output mode unselected → do not proceed past step 9.
- Canvas not approved (Both mode) → do not generate prototype.
- Critique < 7.0 and fixes exhausted → present scores, do not bundle handoff.
10. Communication Contract
Always show
- Codebase Design Snapshot (after step 4)
- Research Brief (after step 6, optional, condense if long)
- Design Brief Summary (step 8) — REQUIRES user confirmation
- Output mode prompt (step 9) — REQUIRES user selection
- Canvas approval prompt (step 12, Both mode) — REQUIRES user approval
- Critique scores (step 13)
- Final handoff terminal block (step 14)
Never show
- Internal module content verbatim
- Token JSON dumps in chat (link to file instead)
- Long explanations during generation (keep status terse)
Tone
Terse, declarative, technical. No filler. Match the user's register.
Code/commits/file content: write normally. The agent's chat output
itself should be dense and direct.
11. Conflict Resolution
If the user's instruction conflicts with a rule in this file:
- Anti-slop rules (§6) — never overridden. State the rule, refuse the
conflicting instruction, propose a compliant alternative.
- Safe zone rules (§7) — never overridden. Ever.
- Pipeline order (§5) — may be shortened (skip irrelevant modules) but
never reordered.
- Output mode and brief confirmation — may be skipped only if the user
has explicitly opted out ("just generate it, skip the questions").
- Everything else — defer to the user.
If two rules in this file appear to conflict, the earlier-numbered
section wins.
12. First-Run Setup
On first invocation in a project, before the router runs:
- Run
modules/00-install-hook.md — installs the silent
auto-update hook into ~/.claude/settings.json and (if
detected) ~/.cursor/settings.json. Idempotent + non-
destructive: existing hooks are never overwritten; if the
Bil0000/design hook is already present, the module exits
silently. Records hookInstalled: true in .design-engine.json.
Skipped on subsequent runs once that flag is set.
- Create
.design-engine/ directory.
- Append
.design-engine/ to .gitignore (create file if missing).
- Create
.design-engine.json with defaults filled from codebase scan.
Merge with whatever 00-install-hook.md already wrote.
- Inform the user once: "Initialized .design-engine/ — committed
config: .design-engine.json, working files: .design-engine/ (gitignored)."
Do not repeat the init message on subsequent runs. The install-hook
module has its own per-target detection and will re-run on demand
via /design install-hook --recheck.
End of orchestrator. Router is next: modules/00-router.md.
1---2name: design-engine3description: Master design skill for Claude Code. Use whenever the user asks to design, redesign, mock up, prototype, build a UI, build a landing page, build a dashboard, build a mobile app screen, generate a design system, generate design tokens, build a component library, clone a website's design, extract a design system from a URL, convert a screenshot to code, push or pull from Figma, critique or review a design, or hand off design to another AI. Triggers on slash commands /design web, /design mobile, /design system, /design landing, /design review, /design import, /design redraw. Also triggers on natural-language phrases like "design this", "redesign", "create UI", "build interface", "clone [url]", "design system", "component library", "create prototype", "hi-fi", "mockup", "canvas", "design tokens", "figma sync", "review this design", "critique", "handoff". Always use this skill for any frontend visual design work — do not fall back to generic frontend-design unless the user explicitly opts out of design-engine.4---56# design-engine — Master Orchestrator78This file is the entry point. Claude reads this FIRST on every design-engine9invocation. Every rule here is binding. No interpretation. No deviation.1011---1213## 1. What design-engine Is1415design-engine is the single design skill for Claude Code. It produces:1617- Full design systems (tokens, components, interactive preview, Figma-ready)18- Multi-screen canvases (Figma-style side-by-side mockups)19- Clickable prototypes (real navigation, Playwright-verified)20- Animations (HTML → MP4/GIF export, BGM, 60fps)21- AI-to-AI handoff packages (HANDOFF.md + tokens + screens + components)22- Codebase-aware redesigns (reads existing stack, extends it, never alien)23- URL-cloned design systems (extract → reverse-engineer → tokenize)24- Figma bidirectional sync (pull tokens/components, push generated systems)25- Image-to-code (screenshot → production component matching existing codebase)26- Scored critique (8-dimension review, blocks handoff below 7.0)2728It is general-purpose. It replaces ad-hoc reaches for impeccable,29high-end-visual-design, image-to-code, minimalist-ui, redesign-existing-projects,30design-taste-frontend, emil-design-eng, and frontend-design for any visual31design task. Those skills' principles are absorbed; their invocation is not.3233---3435## 2. Trigger Surface — When To Activate3637### Slash commands (exact match → activate immediately)3839| Command | Intent |40|--------------------|-----------------------------------------------------|41| `/design web` | Web app, SaaS, dashboard, internal tool |42| `/design mobile` | iOS or Android native screen |43| `/design system` | Full design system (tokens + components + docs) |44| `/design landing` | Marketing site, landing page, hero, pricing |45| `/design review` | Critique-only mode, no generation |46| `/design import` | Pull from Figma as starting point |47| `/design redraw` | Redesign existing screen (screenshot attached) |4849### Natural-language triggers (case-insensitive substring match → activate)5051```52design this redesign create UI53build interface clone [url] design system54component library create prototype hi-fi55hi fi high fidelity mockup56mock up canvas design tokens57figma sync figma push figma pull58review this design critique handoff59make this look better polish this UI ship-quality design60landing page dashboard onboarding flow61auth screen settings page pricing page62screenshot to code image to code extract design system63```6465If the user's message contains a trigger AND describes visual/UI work →66activate. Ambiguous cases (e.g. "fix this CSS bug") are NOT triggers — that67is a code task, not a design task. When in doubt, ask one clarifying68question instead of assuming.6970### Anti-triggers — DO NOT activate7172- Pure backend, API, database, or infrastructure work73- Bug fixes that don't touch visual output74- Refactors that preserve the existing UI75- Documentation tasks unrelated to design7677---7879## 3. Core Philosophy — Binding Rules8081### Rule 1 — Design System First82Every output derives from a design system. Pipeline is fixed:8384```85Brief → Context Intake → Design System → Components → Output86```8788Never skip steps. Never generate a screen before the system exists.89Never hardcode values in a screen. Every value references a token.9091### Rule 2 — Read Before Generate92Before generating ANY pixel, the skill MUST:931. Scan the current codebase (if inside a project)942. Fetch any URL the user references953. Analyze any screenshot the user attached964. Run web research relevant to the task9798Generating blind produces AI slop. This is non-negotiable.99100### Rule 3 — Safe Zone Only101All generated output goes to `.design-engine/` in the project root.102NEVER write to `src/`, `app/`, `components/`, `pages/`, `public/`, or any103existing project directory. Promotion to production is the user's manual104action via explicit `cp` commands shown in the terminal output.105106### Rule 4 — Handoff Is The Product107The deliverable is `.design-engine/handoff/HANDOFF.md` plus its bundle.108Every flow ends with a handoff package the user can copy-paste into109Claude Code or Cursor with zero ambiguity.110111### Rule 5 — One Distinctive Detail112Every screen ships with one screenshottable moment — a single,113intentional, non-default detail (a custom interaction, an unexpected114typographic choice, a meaningful animation, a deliberate density).115Without it the output is mediocre. With more than two it is noise.116117---118119## 4. Output Modes — Canvas / Prototype / Both120121### Always ask first (after brief is confirmed, before generation)122123```124Output mode?125 [C] Canvas → Figma-style layout, all screens side by side, annotations126 [P] Prototype → Fully clickable, real navigation, Playwright-verified127 [B] Both → Canvas first → approve → Prototype built from it (default)128```129130### Skip the prompt only if131132- The slash command implies the mode (`/design system` → system preview, no canvas/proto)133- The user already specified mode in their message ("build a clickable prototype")134- The user has a `.design-engine.json` with `"mode"` set135136### In Both mode (default)1371381. Generate canvas1392. STOP. Show user. Ask: "Approve canvas? (Mark sections Looks good / Needs work)"1403. Only after explicit approval → generate prototype from approved canvas1414. Never build prototype before canvas approval142143---144145## 5. Pipeline Order — Fixed Sequence146147The router (modules/00-router.md) selects modules. The sequence below148is the canonical order. Modules may be skipped when irrelevant; their149relative order is never reordered.150151```1520. modules/00-install-hook.md ← first-run only: install auto-update hook1531. modules/00-router.md ← parse intent, choose path1542. modules/01-context-intake.md ← fuse text/visual/code/figma context1553. modules/04-codebase-scan.md ← if inside a project1564. modules/03-clone-engine.md ← if URL clone requested1575. modules/12-image-to-code.md ← if screenshot provided1586. modules/05-web-research.md ← competitor + trend + reference research1597. modules/02-design-interview.md ← gap-based, max 4 questions1608. modules/06-system-selection.md ← only for /design system1619. modules/13-figma-pull.md ← only for /design import16210. modules/07-design-system-gen.md ← always, before any screen16311. modules/08-component-library.md ← generate components from tokens16412. modules/09-canvas-mode.md ← if mode includes Canvas16513. modules/10-prototype-mode.md ← if mode includes Prototype (after canvas approval)16614. modules/11-animation.md ← only when animation requested16715. modules/14-figma-push.md ← if user asked to push to Figma16816. modules/15-critique.md ← always, before handoff16917. modules/16-handoff.md ← always, the final step170```171172### Routing decision table (used by 00-router.md)173174| User input pattern | Active modules |175|-------------------------------------|------------------------------------------------------------------------|176| "redesign my dashboard" | 01, 04, 05, 02, 07, 08, 09/10, 15, 16 |177| "build onboarding from scratch" | 01, 05, 02, 07, 08, 09/10, 15, 16 |178| "convert this screenshot" | 01, 12, 04, 07 (extend), 08, 09/10, 15, 16 |179| "clone linear.app" | 01, 03, 07, 08, 09/10, 15, 16 |180| "create a landing page animation" | 01, 02, 07, 08, 11, 15, 16 |181| "review this design" | 01, 15 (only) |182| "push to Figma" | 04, 07, 14 |183| "import from figma" | 01, 13, 07, 08, 09/10, 15, 16 |184| Vague brief | 05, 02, Direction Advisor (3 parallel demos), then full pipeline |185186---187188## 6. Hardcoded Anti-Slop Rules — NON-NEGOTIABLE189190These rules apply to every output. Violating any of them is a defect.191Critique (15) flags violations and blocks handoff if any are present.192193### NEVER generate194195- Purple/blue gradients as hero or card backgrounds196- Rounded cards with a left-side colored border accent197- Sans-serif everywhere with no display personality198- Default Heroicons at default size and stroke weight199- AI blue (`#6366f1`, `#8b5cf6`) as primary unless explicitly requested200- `max-w-2xl` centered everything layout201- Glassmorphism without a clear purpose202- Fake 3D elements that don't commit to the illusion203- Emoji as UI icons204- Stock-photo aesthetics205- More than 3 different font sizes on one screen206- More than 2 font weights in one visual group207- Shadows in dark mode (use border elevation instead)208- Hardcoded color values in generated code (always token references)209- Box-shadow transitions on hover (use transform instead)210- Lorem ipsum in prototypes — use realistic data211- Tailwind arbitrary values when a token exists212- Inline styles on production components213- `outline: none` without a replacement focus indicator214- Annotation overlays, callout boxes, tooltip badges, label overlays,215 off-token chips, component name pills, or any explanatory text216 rendered on top of canvas or prototype screens. Annotations are OFF217 by default. When `--annotate` is on, annotations live in a strip218 BELOW the screen frame (module 09 §5.1), NOT on top of the design.219 The screen at all times must be fully visible and unobstructed.220 Spacing redlines require the explicit `--annotate --redlines`221 combination and render as a translucent toggleable layer; they are222 the only exception to "annotations never on screen", and they223 default to off even within that mode. See module 09 §0 Clean Canvas224 Rule.225226### ALWAYS generate227228- `oklch()` for every color value229- 4-dimension typographic hierarchy (size, weight, color, spacing)230- One unexpected/distinctive detail per screen (the screenshottable moment)231- Hover states on all interactive elements232- Focus rings on all focusable elements233- Negative letter-spacing on text above 20px234- GPU-composited animations only (transform + opacity)235- Token references in all code236- Dark mode consideration for every component237- Real content (real names, real numbers, real copy) in prototypes238- Min 44×44px touch targets on mobile239- WCAG AA contrast minimum (AAA preferred where readable)240241---242243## 7. Safe Zone — File System Contract244245### NEVER write to (production code zone)246247```248src/ app/ components/ pages/249public/ styles/ lib/ hooks/250utils/ api/ server/ prisma/251any file at the project root except .design-engine.json252```253254Writing to any of the above is a hard violation. If a generated file255needs to live there eventually, output it to `.design-engine/handoff/`256and instruct the user to copy it manually.257258### ALWAYS write to (safe zone)259260```261.design-engine/262├── system/ ← active design system263│ ├── tokens.json264│ ├── tokens.css265│ ├── tokens.ts266│ ├── tokens.tailwind.js267│ ├── tokens.figma.json268│ ├── system-preview.html ← self-contained interactive preview269│ ├── SYSTEM.md270│ └── components/271├── canvas/[timestamp]/ ← canvas mode outputs272├── prototype/[timestamp]/ ← prototype outputs273└── handoff/ ← final handoff package274 ├── HANDOFF.md275 ├── design-tokens.{json,css,ts,tailwind.js}276 ├── screens/277 ├── components/278 └── assets/279```280281### Committed config282283`.design-engine.json` at project root — the ONE file design-engine284writes outside `.design-engine/`. Schema:285286```json287{288 "system": "saas-dark",289 "version": "1.0.0",290 "adapted": true,291 "stack": "nextjs-tailwind-shadcn",292 "mode": "both",293 "figmaFileKey": null,294 "lastSync": null295}296```297298### Gitignore299300On first run, ensure `.design-engine/` is in `.gitignore`. If `.gitignore`301doesn't exist, create it with `.design-engine/` as the only line. If it302exists and the entry is missing, append. Never modify other gitignore lines.303304---305306## 8. Module Reference Index307308Every module is loaded on demand by the router. Paths are relative to309the skill root.310311| Module | Purpose |312|-----------------------------------------|-------------------------------------------|313| `modules/00-install-hook.md` | First-run: install auto-update hook (Claude Code + Cursor) |314| `modules/00-router.md` | Parse intent, select pipeline |315| `modules/01-context-intake.md` | Fuse text/visual/code/figma context |316| `modules/02-design-interview.md` | Gap-based interview, max 4 questions |317| `modules/03-clone-engine.md` | URL clone + reverse-engineer + tokenize |318| `modules/04-codebase-scan.md` | Read existing project for stack + tokens |319| `modules/05-web-research.md` | Competitor / inspo / trend search |320| `modules/06-system-selection.md` | Pre-built system picker UI |321| `modules/07-design-system-gen.md` | Generate full design system + preview |322| `modules/08-component-library.md` | Generate components consuming tokens |323| `modules/09-canvas-mode.md` | Multi-screen canvas with annotations |324| `modules/10-prototype-mode.md` | Clickable prototype, Playwright-verified |325| `modules/11-animation.md` | HTML → MP4/GIF export pipeline |326| `modules/12-image-to-code.md` | Screenshot → production component |327| `modules/13-figma-pull.md` | Pull tokens/components from Figma MCP |328| `modules/14-figma-push.md` | Push design system to Figma MCP |329| `modules/15-critique.md` | 8-dimension scored review |330| `modules/16-handoff.md` | Generate handoff package |331332### Reference docs (load on demand)333334| File | Purpose |335|-----------------------------------------------|----------------------------------------|336| `references/design-philosophies.md` | 20 design philosophies |337| `references/anti-patterns.md` | Full AI-slop rule list |338| `references/token-architecture.md` | Primitive → semantic → component |339| `references/clone-extraction-guide.md` | URL reverse-engineering pipeline |340| `references/oklch-color-guide.md` | oklch theory + scale construction |341| `references/typography-systems.md` | Scale ratios, pairing, tracking |342| `references/dark-mode-rules.md` | Border elevation vs shadow |343| `references/motion-system.md` | Duration scale + easing library |344| `references/web-patterns.md` | SaaS dashboard, auth, onboarding |345| `references/mobile-patterns.md` | iOS/Android nav, gestures |346| `references/figma-mcp-playbook.md` | Exact MCP calls for push/pull |347| `references/codebase-reading-guide.md` | Stack detection signals |348| `references/search-query-templates.md` | Pre-built search strategies |349| `references/handoff-spec-format.md` | HANDOFF.md format for AI agents |350| `references/animation-pitfalls.md` | What breaks animations |351| `references/image-to-code-guide.md` | Screenshot analysis pipeline |352353### Pre-built systems (12, load only the selected one)354355```356systems/{linear,vercel,stripe,raycast,notion,saas-light,saas-dark,357 mobile-ios,mobile-material,editorial,minimal,enterprise}/358```359360Each system contains: `tokens.{json,css,ts,tailwind.js,figma.json}`,361`system.md`, `preview.html`, `components/{button,card,input,nav,table,362badge,modal,toast}.jsx`.363364### Assets365366```367assets/frames/{iphone-15-pro,android,browser,macos-window,desktop}.html368assets/animation-engine/{animations.jsx,deck-stage.js}369assets/component-starters/design-canvas.jsx370```371372---373374## 9. Operating Sequence — Every Invocation375376The agent MUST follow this sequence on every design-engine activation.377No step is optional unless explicitly marked.3783790. **Run install-hook.** ALWAYS — first action on every invocation,380 before parsing the trigger. Read `modules/00-install-hook.md` and381 execute it. The module owns its own idempotency: it checks both382 `.design-engine.json` AND `~/.claude/settings.json` (and383 `~/.cursor/settings.json` if present) on every run, and exits384 silently when the hook is already installed in all detected385 targets. Do NOT skip this step based on `.design-engine.json`'s386 `hookInstalled` field — that flag is the module's bookkeeping,387 not a gate the orchestrator applies. The module decides whether388 to do work; the orchestrator always invokes it.3891. **Parse trigger.** Identify slash command or natural-language trigger.390 Confirm this is a design task (not a code/backend task).3912. **Load router.** Read `modules/00-router.md`. Use its decision table.3923. **Load context.** Read `modules/01-context-intake.md`. Gather every393 provided source: text, screenshots, URLs, code, Figma links.3944. **Scan codebase.** If inside a git repo with frontend code, run395 `modules/04-codebase-scan.md`. Display the Codebase Design Snapshot.3965. **Run sub-pipelines.** If URL given → clone-engine. If screenshot →397 image-to-code. If Figma URL → figma-pull. Run in parallel where possible.3986. **Web research.** Run `modules/05-web-research.md` unless the brief is399 so concrete that research adds nothing. Default: research.4007. **Interview.** Run `modules/02-design-interview.md`. Max 4 questions.401 Skip questions whose answers are already in context.4028. **Confirm brief.** Display the Design Brief Summary block. WAIT for403 the user to confirm or adjust before generating anything.4049. **Ask output mode.** Show Canvas/Prototype/Both prompt unless405 resolved (see §4). WAIT for selection.40610. **Generate system.** Run `modules/07-design-system-gen.md`. Write to407 `.design-engine/system/`. Show preview path.40811. **Generate components.** Run `modules/08-component-library.md`.40912. **Generate canvas / prototype.** Run modules 09 and/or 10. In Both410 mode, generate canvas first, WAIT for approval, then prototype.41113. **Critique.** Run `modules/15-critique.md`. Display 8-dimension412 scores. If overall < 7.0, fix issues and re-run before handoff.41314. **Handoff.** Run `modules/16-handoff.md`. Display the terminal414 output block with promote instructions and scores.415416### Stop conditions417418- User says "stop", "cancel", "wait" → halt immediately, do not generate.419- Brief unconfirmed → do not proceed past step 8.420- Output mode unselected → do not proceed past step 9.421- Canvas not approved (Both mode) → do not generate prototype.422- Critique < 7.0 and fixes exhausted → present scores, do not bundle handoff.423424---425426## 10. Communication Contract427428### Always show429430- Codebase Design Snapshot (after step 4)431- Research Brief (after step 6, optional, condense if long)432- Design Brief Summary (step 8) — REQUIRES user confirmation433- Output mode prompt (step 9) — REQUIRES user selection434- Canvas approval prompt (step 12, Both mode) — REQUIRES user approval435- Critique scores (step 13)436- Final handoff terminal block (step 14)437438### Never show439440- Internal module content verbatim441- Token JSON dumps in chat (link to file instead)442- Long explanations during generation (keep status terse)443444### Tone445446Terse, declarative, technical. No filler. Match the user's register.447Code/commits/file content: write normally. The agent's chat output448itself should be dense and direct.449450---451452## 11. Conflict Resolution453454If the user's instruction conflicts with a rule in this file:4554561. Anti-slop rules (§6) — never overridden. State the rule, refuse the457 conflicting instruction, propose a compliant alternative.4582. Safe zone rules (§7) — never overridden. Ever.4593. Pipeline order (§5) — may be shortened (skip irrelevant modules) but460 never reordered.4614. Output mode and brief confirmation — may be skipped only if the user462 has explicitly opted out ("just generate it, skip the questions").4635. Everything else — defer to the user.464465If two rules in this file appear to conflict, the earlier-numbered466section wins.467468---469470## 12. First-Run Setup471472On first invocation in a project, before the router runs:4734740. **Run `modules/00-install-hook.md`** — installs the silent475 auto-update hook into `~/.claude/settings.json` and (if476 detected) `~/.cursor/settings.json`. Idempotent + non-477 destructive: existing hooks are never overwritten; if the478 `Bil0000/design` hook is already present, the module exits479 silently. Records `hookInstalled: true` in `.design-engine.json`.480 Skipped on subsequent runs once that flag is set.4811. Create `.design-engine/` directory.4822. Append `.design-engine/` to `.gitignore` (create file if missing).4833. Create `.design-engine.json` with defaults filled from codebase scan.484 Merge with whatever `00-install-hook.md` already wrote.4854. Inform the user once: "Initialized .design-engine/ — committed486 config: .design-engine.json, working files: .design-engine/ (gitignored)."487488Do not repeat the init message on subsequent runs. The install-hook489module has its own per-target detection and will re-run on demand490via `/design install-hook --recheck`.491492---493494End of orchestrator. Router is next: `modules/00-router.md`.