From 2df3efaf70ed46cbcf63c2e4bcab2d866967c388 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ciar=C3=A1n=20Curley?=
Date: Tue, 28 Apr 2026 15:11:37 +0100
Subject: [PATCH] update impeccable skill
---
.agents/skills/impeccable/SKILL.md | 423 +-
.agents/skills/impeccable/agents/openai.yaml | 4 +
.../reference/adapt.md} | 26 +-
.../reference/animate.md} | 47 +-
.../reference/audit.md} | 54 +-
.../reference/bolder.md} | 27 +-
.agents/skills/impeccable/reference/brand.md | 104 +
.../reference/clarify.md} | 30 +-
.../reference/cognitive-load.md | 18 +-
.../reference/color-and-contrast.md | 38 +-
.../reference/colorize.md} | 46 +-
.agents/skills/impeccable/reference/craft.md | 182 +-
.../reference/critique.md} | 115 +-
.../reference/delight.md} | 54 +-
.../reference/distill.md} | 21 +-
.../skills/impeccable/reference/document.md | 427 ++
.../skills/impeccable/reference/extract.md | 3 +-
.../reference/harden.md} | 116 +-
.../reference/heuristics-scoring.md | 36 +-
.../reference/interaction-design.md | 25 +-
.../reference/layout.md} | 37 +-
.agents/skills/impeccable/reference/live.md | 513 ++
.../impeccable/reference/motion-design.md | 40 +-
.../skills/impeccable/reference/onboard.md | 234 +
.../reference/optimize.md} | 52 +-
.../reference/overdrive.md} | 51 +-
.../reference/personas.md | 31 +-
.../reference/polish.md} | 54 +-
.../skills/impeccable/reference/product.md | 62 +
.../reference/quieter.md} | 22 +-
.../impeccable/reference/responsive-design.md | 34 +-
.agents/skills/impeccable/reference/shape.md | 151 +
.../impeccable/reference/spatial-design.md | 21 +-
.agents/skills/impeccable/reference/teach.md | 156 +
.../reference/typeset.md} | 31 +-
.../skills/impeccable/reference/typography.md | 99 +-
.../skills/impeccable/reference/ux-writing.md | 65 +-
.../impeccable/scripts/cleanup-deprecated.mjs | 151 +-
.../impeccable/scripts/command-metadata.json | 94 +
.../impeccable/scripts/design-parser.mjs | 820 +++
.../skills/impeccable/scripts/detect-csp.mjs | 198 +
.../impeccable/scripts/is-generated.mjs | 69 +
.../skills/impeccable/scripts/live-accept.mjs | 465 ++
.../skills/impeccable/scripts/live-browser.js | 4777 +++++++++++++++++
.../skills/impeccable/scripts/live-inject.mjs | 436 ++
.../skills/impeccable/scripts/live-poll.mjs | 187 +
.../skills/impeccable/scripts/live-server.mjs | 679 +++
.../skills/impeccable/scripts/live-wrap.mjs | 395 ++
.agents/skills/impeccable/scripts/live.mjs | 247 +
.../impeccable/scripts/load-context.mjs | 93 +
.../scripts/modern-screenshot.umd.js | 14 +
.agents/skills/impeccable/scripts/pin.mjs | 214 +
.agents/skills/shape/SKILL.md | 101 -
.impeccable.md => PRODUCT.md | 0
skills-lock.json | 95 -
55 files changed, 11132 insertions(+), 1352 deletions(-)
create mode 100644 .agents/skills/impeccable/agents/openai.yaml
rename .agents/skills/{adapt/SKILL.md => impeccable/reference/adapt.md} (89%)
rename .agents/skills/{animate/SKILL.md => impeccable/reference/animate.md} (80%)
rename .agents/skills/{audit/SKILL.md => impeccable/reference/audit.md} (68%)
rename .agents/skills/{bolder/SKILL.md => impeccable/reference/bolder.md} (80%)
create mode 100644 .agents/skills/impeccable/reference/brand.md
rename .agents/skills/{clarify/SKILL.md => impeccable/reference/clarify.md} (89%)
rename .agents/skills/{critique => impeccable}/reference/cognitive-load.md (97%)
rename .agents/skills/{colorize/SKILL.md => impeccable/reference/colorize.md} (72%)
rename .agents/skills/{critique/SKILL.md => impeccable/reference/critique.md} (62%)
rename .agents/skills/{delight/SKILL.md => impeccable/reference/delight.md} (90%)
rename .agents/skills/{distill/SKILL.md => impeccable/reference/distill.md} (89%)
create mode 100644 .agents/skills/impeccable/reference/document.md
rename .agents/skills/{harden/SKILL.md => impeccable/reference/harden.md} (75%)
rename .agents/skills/{critique => impeccable}/reference/heuristics-scoring.md (86%)
rename .agents/skills/{layout/SKILL.md => impeccable/reference/layout.md} (80%)
create mode 100644 .agents/skills/impeccable/reference/live.md
create mode 100644 .agents/skills/impeccable/reference/onboard.md
rename .agents/skills/{optimize/SKILL.md => impeccable/reference/optimize.md} (89%)
rename .agents/skills/{overdrive/SKILL.md => impeccable/reference/overdrive.md} (71%)
rename .agents/skills/{critique => impeccable}/reference/personas.md (88%)
rename .agents/skills/{polish/SKILL.md => impeccable/reference/polish.md} (65%)
create mode 100644 .agents/skills/impeccable/reference/product.md
rename .agents/skills/{quieter/SKILL.md => impeccable/reference/quieter.md} (83%)
create mode 100644 .agents/skills/impeccable/reference/shape.md
create mode 100644 .agents/skills/impeccable/reference/teach.md
rename .agents/skills/{typeset/SKILL.md => impeccable/reference/typeset.md} (77%)
create mode 100644 .agents/skills/impeccable/scripts/command-metadata.json
create mode 100644 .agents/skills/impeccable/scripts/design-parser.mjs
create mode 100644 .agents/skills/impeccable/scripts/detect-csp.mjs
create mode 100644 .agents/skills/impeccable/scripts/is-generated.mjs
create mode 100644 .agents/skills/impeccable/scripts/live-accept.mjs
create mode 100644 .agents/skills/impeccable/scripts/live-browser.js
create mode 100644 .agents/skills/impeccable/scripts/live-inject.mjs
create mode 100644 .agents/skills/impeccable/scripts/live-poll.mjs
create mode 100644 .agents/skills/impeccable/scripts/live-server.mjs
create mode 100644 .agents/skills/impeccable/scripts/live-wrap.mjs
create mode 100644 .agents/skills/impeccable/scripts/live.mjs
create mode 100644 .agents/skills/impeccable/scripts/load-context.mjs
create mode 100644 .agents/skills/impeccable/scripts/modern-screenshot.umd.js
create mode 100644 .agents/skills/impeccable/scripts/pin.mjs
delete mode 100644 .agents/skills/shape/SKILL.md
rename .impeccable.md => PRODUCT.md (100%)
delete mode 100644 skills-lock.json
diff --git a/.agents/skills/impeccable/SKILL.md b/.agents/skills/impeccable/SKILL.md
index 78b8201..f504565 100644
--- a/.agents/skills/impeccable/SKILL.md
+++ b/.agents/skills/impeccable/SKILL.md
@@ -1,370 +1,173 @@
---
name: impeccable
-description: "Create distinctive, production-grade frontend interfaces with high design quality. Generates creative, polished code that avoids generic AI aesthetics. Use when the user asks to build web components, pages, artifacts, posters, or applications, or when any design skill requires project context. Call with 'craft' for shape-then-build, 'teach' for design context setup, or 'extract' to pull reusable components and tokens into the design system."
-version: 2.1.1
-user-invocable: true
-argument-hint: "[craft|teach|extract]"
-license: Apache 2.0. Based on Anthropic's frontend-design skill. See NOTICE.md for attribution.
+description: Use when the user wants to design, redesign, shape, critique, audit, polish, clarify, distill, harden, optimize, adapt, animate, colorize, extract, or otherwise improve a frontend interface. Covers websites, landing pages, dashboards, product UI, app shells, components, forms, settings, onboarding, and empty states. Handles UX review, visual hierarchy, information architecture, cognitive load, accessibility, performance, responsive behavior, theming, anti-patterns, typography, fonts, spacing, layout, alignment, color, motion, micro-interactions, UX copy, error states, edge cases, i18n, and reusable design systems or tokens. Also use for bland designs that need to become bolder or more delightful, loud designs that should become quieter, live browser iteration on UI elements, or ambitious visual effects that should feel technically extraordinary. Not for backend-only or non-UI tasks.
---
-This skill guides creation of distinctive, production-grade frontend interfaces that avoid generic "AI slop" aesthetics. Implement real working code with exceptional attention to aesthetic details and creative choices.
+Designs and iterates production-grade frontend interfaces. Real working code, committed design choices, exceptional craft.
-## Context Gathering Protocol
+## Setup (non-optional)
-Design skills produce generic output without project context. You MUST have confirmed design context before doing any design work.
+Before any design work or file edits, pass these gates. Skipping them produces generic output that ignores the project.
-**Required context** (every design skill needs at minimum):
+| Gate | Required check | If fail |
+|---|---|---|
+| Context | The PRODUCT.md / DESIGN.md loader result is known from `node .agents/skills/impeccable/scripts/load-context.mjs`. | Run the loader before continuing. |
+| Product | PRODUCT.md exists and is not empty or placeholder (`[TODO]` markers, <200 chars). | Run `$impeccable teach`, refresh context, then resume. Never synthesize PRODUCT.md from the user's original prompt alone. |
+| Command | The matching command reference is loaded when a sub-command is used. | Load the reference before continuing. |
+| Craft | `$impeccable craft` has a user-confirmed shape brief for this task. `teach` / PRODUCT.md never counts as shape. | Run `$impeccable shape` and wait for explicit brief confirmation. |
+| Image | Required visual probes / mocks are generated or skipped with a reason. | Resolve the image-generation gate in `shape.md` or `craft.md` before code. |
+| Mutation | All active gates above pass. | Do not edit project files yet. |
-- **Target audience**: Who uses this product and in what context?
-- **Use cases**: What jobs are they trying to get done?
-- **Brand personality/tone**: How should the interface feel?
+Codex-style agents must state this before editing files:
-Individual skills may require additional context. Check the skill's preparation section for specifics.
-
-**CRITICAL**: You cannot infer this context by reading the codebase. Code tells you what was built, not who it's for or what it should feel like. Only the creator can provide this context.
-
-**Gathering order:**
-
-1. **Check current instructions (instant)**: If your loaded instructions already contain a **Design Context** section, proceed immediately.
-2. **Check .impeccable.md (fast)**: If not in instructions, read `.impeccable.md` from the project root. If it exists and contains the required context, proceed.
-3. **Run impeccable teach (REQUIRED)**: If neither source has context, you MUST run /impeccable teach NOW before doing anything else. Do NOT skip this step. Do NOT attempt to infer context from the codebase instead.
-
----
-
-## Design Direction
-
-Commit to a BOLD aesthetic direction:
-
-- **Purpose**: What problem does this interface solve? Who uses it?
-- **Tone**: Pick an extreme: brutally minimal, maximalist chaos, retro-futuristic, organic/natural, luxury/refined, playful/toy-like, editorial/magazine, brutalist/raw, art deco/geometric, soft/pastel, industrial/utilitarian, etc. There are so many flavors to choose from. Use these for inspiration but design one that is true to the aesthetic direction.
-- **Constraints**: Technical requirements (framework, performance, accessibility).
-- **Differentiation**: What makes this UNFORGETTABLE? What's the one thing someone will remember?
-
-**CRITICAL**: Choose a clear conceptual direction and execute it with precision. Bold maximalism and refined minimalism both work. The key is intentionality, not intensity.
-
-Then implement working code that is:
-
-- Production-grade and functional
-- Visually striking and memorable
-- Cohesive with a clear aesthetic point-of-view
-- Meticulously refined in every detail
-
-## Frontend Aesthetics Guidelines
-
-### Typography
-
-→ _Consult [typography reference](reference/typography.md) for OpenType features, web font loading, and the deeper material on scales._
-
-Choose fonts that are beautiful, unique, and interesting. Pair a distinctive display font with a refined body font.
-
-
-Always apply these — do not consult a reference, just do them:
-
-- Use a modular type scale with fluid sizing (clamp) for headings on marketing/content pages. Use fixed `rem` scales for app UIs and dashboards (no major design system uses fluid type in product UI).
-- Use fewer sizes with more contrast. A 5-step scale with at least a 1.25 ratio between steps creates clearer hierarchy than 8 sizes that are 1.1× apart.
-- Line-height scales inversely with line length. Narrow columns want tighter leading, wide columns want more. For light text on dark backgrounds, ADD 0.05-0.1 to your normal line-height — light type reads as lighter weight and needs more breathing room.
-- Cap line length at ~65-75ch. Body text wider than that is fatiguing.
-
-
-
-DO THIS BEFORE TYPING ANY FONT NAME.
-
-The model's natural failure mode is "I was told not to use Inter, so I will pick my next favorite font, which becomes the new monoculture." Avoid this by performing the following procedure on every project, in order:
-
-Step 1. Read the brief once. Write down 3 concrete words for the brand voice (e.g., "warm and mechanical and opinionated", "calm and clinical and careful", "fast and dense and unimpressed", "handmade and a little weird"). NOT "modern" or "elegant" — those are dead categories.
-
-Step 2. List the 3 fonts you would normally reach for given those words. Write them down. They are most likely from this list:
-
-
-Fraunces
-Newsreader
-Lora
-Crimson
-Crimson Pro
-Crimson Text
-Playfair Display
-Cormorant
-Cormorant Garamond
-Syne
-IBM Plex Mono
-IBM Plex Sans
-IBM Plex Serif
-Space Mono
-Space Grotesk
-Inter
-DM Sans
-DM Serif Display
-DM Serif Text
-Outfit
-Plus Jakarta Sans
-Instrument Sans
-Instrument Serif
-
-
-Reject every font that appears in the reflex_fonts_to_reject list. They are your training-data defaults and they create monoculture across projects.
-
-Step 3. Browse a font catalog with the 3 brand words in mind. Sources: Google Fonts, Pangram Pangram, Future Fonts, Adobe Fonts, ABC Dinamo, Klim Type Foundry, Velvetyne. Look for something that fits the brand as a _physical object_ — a museum exhibit caption, a hand-painted shop sign, a 1970s mainframe terminal manual, a fabric label on the inside of a coat, a children's book printed on cheap newsprint. Reject the first thing that "looks designy" — that's the trained reflex too. Keep looking.
-
-Step 4. Cross-check the result. The right font for an "elegant" brief is NOT necessarily a serif. The right font for a "technical" brief is NOT necessarily a sans-serif. The right font for a "warm" brief is NOT Fraunces. If your final pick lines up with your reflex pattern, go back to Step 3.
-
-
-
-DO use a modular type scale with fluid sizing (clamp) on headings.
-DO vary font weights and sizes to create clear visual hierarchy.
-DO vary your font choices across projects. If you used a serif display font on the last project, look for a sans, monospace, or display face on this one.
-
-DO NOT use overused fonts like Inter, Roboto, Arial, Open Sans, or system defaults — but also do not simply switch to your second-favorite. Every font in the reflex_fonts_to_reject list above is banned. Look further.
-DO NOT use monospace typography as lazy shorthand for "technical/developer" vibes.
-DO NOT put large icons with rounded corners above every heading. They rarely add value and make sites look templated.
-DO NOT use only one font family for the entire page. Pair a distinctive display font with a refined body font.
-DO NOT use a flat type hierarchy where sizes are too close together. Aim for at least a 1.25 ratio between steps.
-DO NOT set long body passages in uppercase. Reserve all-caps for short labels and headings.
-
-
-### Color & Theme
-
-→ _Consult [color reference](reference/color-and-contrast.md) for the deeper material on contrast, accessibility, and palette construction._
-
-Commit to a cohesive palette. Dominant colors with sharp accents outperform timid, evenly-distributed palettes.
-
-
-Always apply these — do not consult a reference, just do them:
-
-- Use OKLCH, not HSL. OKLCH is perceptually uniform: equal steps in lightness _look_ equal, which HSL does not deliver. As you move toward white or black, REDUCE chroma — high chroma at extreme lightness looks garish. A light blue at 85% lightness wants ~0.08 chroma, not the 0.15 of your base color.
-- Tint your neutrals toward your brand hue. Even a chroma of 0.005-0.01 is perceptible and creates subconscious cohesion between brand color and UI surfaces. The hue you tint toward should come from THIS brand, not from a "warm = friendly" or "cool = tech" formula. Pick the brand's actual hue first, then tint everything toward it.
-- The 60-30-10 rule is about visual _weight_, not pixel count. 60% neutral / surface, 30% secondary text and borders, 10% accent. Accents work BECAUSE they're rare. Overuse kills their power.
-
-
-
-Theme (light vs dark) should be DERIVED from audience and viewing context, not picked from a default. Read the brief and ask: when is this product used, by whom, in what physical setting?
-
-- A perp DEX consumed during fast trading sessions → dark
-- A hospital portal consumed by anxious patients on phones late at night → light
-- A children's reading app → light
-- A vintage motorcycle forum where users sit in their garage at 9pm → dark
-- An observability dashboard for SREs in a dark office → dark
-- A wedding planning checklist for couples on a Sunday morning → light
-- A music player app for headphone listening at night → dark
-- A food magazine homepage browsed during a coffee break → light
-
-Do not default everything to light "to play it safe." Do not default everything to dark "to look cool." Both defaults are the lazy reflex. The correct theme is the one the actual user wants in their actual context.
-
-
-
-DO use modern CSS color functions (oklch, color-mix, light-dark) for perceptually uniform, maintainable palettes.
-DO tint your neutrals toward your brand hue. Even a subtle hint creates subconscious cohesion.
-
-DO NOT use gray text on colored backgrounds; it looks washed out. Use a shade of the background color instead.
-DO NOT use pure black (#000) or pure white (#fff). Always tint; pure black/white never appears in nature.
-DO NOT use the AI color palette: cyan-on-dark, purple-to-blue gradients, neon accents on dark backgrounds.
-DO NOT use gradient text for impact — see below for the strict definition. Solid colors only for text.
-DO NOT default to dark mode with glowing accents. It looks "cool" without requiring actual design decisions.
-DO NOT default to light mode "to be safe" either. The point is to choose, not to retreat to a safe option.
-
-
-### Layout & Space
-
-→ _Consult [spatial reference](reference/spatial-design.md) for the deeper material on grids, container queries, and optical adjustments._
-
-Create visual rhythm through varied spacing, not the same padding everywhere. Embrace asymmetry and unexpected compositions. Break the grid intentionally for emphasis.
-
-
-Always apply these — do not consult a reference, just do them:
-
-- Use a 4pt spacing scale with semantic token names (`--space-sm`, `--space-md`), not pixel-named (`--spacing-8`). Scale: 4, 8, 12, 16, 24, 32, 48, 64, 96. 8pt is too coarse — you'll often want 12px between two values.
-- Use `gap` instead of margins for sibling spacing. It eliminates margin collapse and the cleanup hacks that come with it.
-- Vary spacing for hierarchy. A heading with extra space above it reads as more important — make use of that. Don't apply the same padding everywhere.
-- Self-adjusting grid pattern: `grid-template-columns: repeat(auto-fit, minmax(280px, 1fr))` is the breakpoint-free responsive grid for card-style content.
-- Container queries are for components, viewport queries are for page layout. A card in a sidebar should adapt to the sidebar's width, not the viewport's.
-
-
-
-DO create visual rhythm through varied spacing: tight groupings, generous separations.
-DO use fluid spacing with clamp() that breathes on larger screens.
-DO use asymmetry and unexpected compositions; break the grid intentionally for emphasis.
-
-DO NOT wrap everything in cards. Not everything needs a container.
-DO NOT nest cards inside cards. Visual noise; flatten the hierarchy.
-DO NOT use identical card grids (same-sized cards with icon + heading + text, repeated endlessly).
-DO NOT use the hero metric layout template (big number, small label, supporting stats, gradient accent).
-DO NOT center everything. Left-aligned text with asymmetric layouts feels more designed.
-DO NOT use the same spacing everywhere. Without rhythm, layouts feel monotonous.
-DO NOT let body text wrap beyond ~80 characters per line. Add a max-width like 65–75ch so the eye can track easily.
-
-
-### Visual Details
-
-
-These CSS patterns are NEVER acceptable. They are the most recognizable AI design tells. Match-and-refuse: if you find yourself about to write any of these, stop and rewrite the element with a different structure entirely.
-
-BAN 1: Side-stripe borders on cards/list items/callouts/alerts
-
-- PATTERN: `border-left:` or `border-right:` with width greater than 1px
-- INCLUDES: hard-coded colors AND CSS variables
-- FORBIDDEN: `border-left: 3px solid red`, `border-left: 4px solid #ff0000`, `border-left: 4px solid var(--color-warning)`, `border-left: 5px solid oklch(...)`, etc.
-- WHY: this is the single most overused "design touch" in admin, dashboard, and medical UIs. It never looks intentional regardless of color, radius, opacity, or whether the variable name is "primary" or "warning" or "accent."
-- REWRITE: use a different element structure entirely. Do not just swap to box-shadow inset. Reach for full borders, background tints, leading numbers/icons, or no visual indicator at all.
-
-BAN 2: Gradient text
-
-- PATTERN: `background-clip: text` (or `-webkit-background-clip: text`) combined with a gradient background
-- FORBIDDEN: any combination that makes text fill come from a `linear-gradient`, `radial-gradient`, or `conic-gradient`
-- WHY: gradient text is decorative rather than meaningful and is one of the top three AI design tells
-- REWRITE: use a single solid color for text. If you want emphasis, use weight or size, not gradient fill.
-
-
-DO: Use intentional, purposeful decorative elements that reinforce brand.
-DO NOT: Use border-left or border-right greater than 1px as a colored accent stripe on cards, list items, callouts, or alerts. See above for the strict CSS pattern.
-DO NOT: Use glassmorphism everywhere (blur effects, glass cards, glow borders used decoratively rather than purposefully).
-DO NOT: Use sparklines as decoration. Tiny charts that look sophisticated but convey nothing meaningful.
-DO NOT: Use rounded rectangles with generic drop shadows. Safe, forgettable, could be any AI output.
-DO NOT: Use modals unless there's truly no better alternative. Modals are lazy.
-
-### Motion
-
-→ _Consult [motion reference](reference/motion-design.md) for timing, easing, and reduced motion._
-
-Focus on high-impact moments: one well-orchestrated page load with staggered reveals creates more delight than scattered micro-interactions.
-
-**DO**: Use motion to convey state changes: entrances, exits, feedback
-**DO**: Use exponential easing (ease-out-quart/quint/expo) for natural deceleration
-**DO**: For height animations, use grid-template-rows transitions instead of animating height directly
-**DON'T**: Animate layout properties (width, height, padding, margin). Use transform and opacity only
-**DON'T**: Use bounce or elastic easing. They feel dated and tacky; real objects decelerate smoothly
-
-### Interaction
-
-→ _Consult [interaction reference](reference/interaction-design.md) for forms, focus, and loading patterns._
+```text
+IMPECCABLE_PREFLIGHT: context=pass product=pass command_reference=pass shape=pass|not_required image_gate=pass|skipped: mutation=open
+```
-Make interactions feel fast. Use optimistic UI: update immediately, sync later.
+For `$impeccable craft`, `shape=pass` is only valid after a separate user response approving the shape design brief, or when the user provided an already-confirmed brief in the request. Do not mark `shape=pass` after writing PRODUCT.md, summarizing assumptions, or drafting an unconfirmed brief yourself.
-**DO**: Use progressive disclosure. Start simple, reveal sophistication through interaction (basic options first, advanced behind expandable sections; hover states that reveal secondary actions)
-**DO**: Design empty states that teach the interface, not just say "nothing here"
-**DO**: Make every interactive surface feel intentional and responsive
-**DON'T**: Repeat the same information (redundant headers, intros that restate the heading)
-**DON'T**: Make every button primary. Use ghost buttons, text links, secondary styles; hierarchy matters
+Other harnesses should follow the same checklist when they can expose this state.
-### Responsive
+### 1. Context gathering
-→ _Consult [responsive reference](reference/responsive-design.md) for mobile-first, fluid design, and container queries._
+Two files at the project root, case-insensitive:
-**DO**: Use container queries (@container) for component-level responsiveness
-**DO**: Adapt the interface for different contexts, not just shrink it
-**DON'T**: Hide critical functionality on mobile. Adapt the interface, don't amputate it
+- **PRODUCT.md** — required. Users, brand, tone, anti-references, strategic principles.
+- **DESIGN.md** — optional, strongly recommended. Colors, typography, elevation, components.
-### UX Writing
+Load both in one call:
-→ _Consult [ux-writing reference](reference/ux-writing.md) for labels, errors, and empty states._
+```bash
+node .agents/skills/impeccable/scripts/load-context.mjs
+```
-**DO**: Make every word earn its place
-**DON'T**: Repeat information users can already see
+Consume the full JSON output. Never pipe through `head`, `tail`, `grep`, or `jq`.
----
+If the output is already in this session's conversation history, don't re-run. Exceptions requiring a fresh load: you just ran `$impeccable teach` or `$impeccable document` (they rewrite the files), or the user manually edited one.
-## The AI Slop Test
+`$impeccable live` already warms context via `live.mjs` — if you've run `live.mjs`, don't also run `load-context.mjs` this session.
-**Critical quality check**: If you showed this interface to someone and said "AI made this," would they believe you immediately? If yes, that's the problem.
+If PRODUCT.md is missing, empty, or placeholder (`[TODO]` markers, <200 chars): run `$impeccable teach`, then resume the user's original task with the fresh context. If the original task was `$impeccable craft`, resume into `$impeccable shape` before any implementation work.
-A distinctive interface should make someone ask "how was this made?" not "which AI made this?"
+If DESIGN.md is missing: nudge once per session (*"Run `$impeccable document` for more on-brand output"*), then proceed.
-Review the DON'T guidelines above. They are the fingerprints of AI-generated work from 2024-2025.
+### 2. Register
----
+Every design task is **brand** (marketing, landing, campaign, long-form content, portfolio — design IS the product) or **product** (app UI, admin, dashboard, tool — design SERVES the product).
-## Implementation Principles
+Identify before designing. Priority: (1) cue in the task itself ("landing page" vs "dashboard"); (2) the surface in focus (the page, file, or route being worked on); (3) `register` field in PRODUCT.md. First match wins.
-Match implementation complexity to the aesthetic vision. Maximalist designs need elaborate code with extensive animations and effects. Minimalist or refined designs need restraint, precision, and careful attention to spacing, typography, and subtle details.
+If PRODUCT.md lacks the `register` field (legacy), infer it once from its "Users" and "Product Purpose" sections, then cache the inferred value for the session. Suggest the user run `$impeccable teach` to add the field explicitly.
-Interpret creatively and make unexpected choices that feel genuinely designed for the context. No design should be the same. Vary between light and dark themes, different fonts, different aesthetics. NEVER converge on common choices across generations.
+Load the matching reference: [reference/brand.md](reference/brand.md) or [reference/product.md](reference/product.md). The shared design laws below apply to both.
-Remember: the model is capable of extraordinary creative work. Don't hold back. Show what can truly be created when thinking outside the box and committing fully to a distinctive vision.
+## Shared design laws
----
+Apply to every design, both registers. Match implementation complexity to the aesthetic vision — maximalism needs elaborate code, minimalism needs precision. Interpret creatively. Vary across projects; never converge on the same choices. GPT is capable of extraordinary work — don't hold back.
-## Craft Mode
+### Color
-If this skill is invoked with the argument "craft" (e.g., `/impeccable craft [feature description]`), follow the [craft flow](reference/craft.md). Pass any additional arguments as the feature description.
+- Use OKLCH. Reduce chroma as lightness approaches 0 or 100 — high chroma at extremes looks garish.
+- Never use `#000` or `#fff`. Tint every neutral toward the brand hue (chroma 0.005–0.01 is enough).
+- Pick a **color strategy** before picking colors. Four steps on the commitment axis:
+ - **Restrained** — tinted neutrals + one accent ≤10%. Product default; brand minimalism.
+ - **Committed** — one saturated color carries 30–60% of the surface. Brand default for identity-driven pages.
+ - **Full palette** — 3–4 named roles, each used deliberately. Brand campaigns; product data viz.
+ - **Drenched** — the surface IS the color. Brand heroes, campaign pages.
+- The "one accent ≤10%" rule is Restrained only. Committed / Full palette / Drenched exceed it on purpose. Don't collapse every design to Restrained by reflex.
----
+### Theme
-## Teach Mode
+Dark vs. light is never a default. Not dark "because tools look cool dark." Not light "to be safe."
-If this skill is invoked with the argument "teach" (e.g., `/impeccable teach`), skip all design work above and instead run the teach flow below. This is a one-time setup that gathers design context for the project.
+Before choosing, write one sentence of physical scene: who uses this, where, under what ambient light, in what mood. If the sentence doesn't force the answer, it's not concrete enough — add detail until it does.
-### Step 1: Explore the Codebase
+"Observability dashboard" does not force an answer. "SRE glancing at incident severity on a 27-inch monitor at 2am in a dim room" does. Run the sentence, not the category.
-Before asking questions, thoroughly scan the project to discover what you can:
-
-- **README and docs**: Project purpose, target audience, any stated goals
-- **Package.json / config files**: Tech stack, dependencies, existing design libraries
-- **Existing components**: Current design patterns, spacing, typography in use
-- **Brand assets**: Logos, favicons, color values already defined
-- **Design tokens / CSS variables**: Existing color palettes, font stacks, spacing scales
-- **Any style guides or brand documentation**
+### Typography
-Note what you've learned and what remains unclear.
+- Cap body line length at 65–75ch.
+- Hierarchy through scale + weight contrast (≥1.25 ratio between steps). Avoid flat scales.
-### Step 2: Ask UX-Focused Questions
+### Layout
-ask the user directly to clarify what you cannot infer. Focus only on what you couldn't infer from the codebase:
+- Vary spacing for rhythm. Same padding everywhere is monotony.
+- Cards are the lazy answer. Use them only when they're truly the best affordance. Nested cards are always wrong.
+- Don't wrap everything in a container. Most things don't need one.
-#### Users & Purpose
+### Motion
-- Who uses this? What's their context when using it?
-- What job are they trying to get done?
-- What emotions should the interface evoke? (confidence, delight, calm, urgency, etc.)
+- Don't animate CSS layout properties.
+- Ease out with exponential curves (ease-out-quart / quint / expo). No bounce, no elastic.
-#### Brand & Personality
+### Absolute bans
-- How would you describe the brand personality in 3 words?
-- Any reference sites or apps that capture the right feel? What specifically about them?
-- What should this explicitly NOT look like? Any anti-references?
+Match-and-refuse. If you're about to write any of these, rewrite the element with different structure.
-#### Aesthetic Preferences
+- **Side-stripe borders.** `border-left` or `border-right` greater than 1px as a colored accent on cards, list items, callouts, or alerts. Never intentional. Rewrite with full borders, background tints, leading numbers/icons, or nothing.
+- **Gradient text.** `background-clip: text` combined with a gradient background. Decorative, never meaningful. Use a single solid color. Emphasis via weight or size.
+- **Glassmorphism as default.** Blurs and glass cards used decoratively. Rare and purposeful, or nothing.
+- **The hero-metric template.** Big number, small label, supporting stats, gradient accent. SaaS cliché.
+- **Identical card grids.** Same-sized cards with icon + heading + text, repeated endlessly.
+- **Modal as first thought.** Modals are usually laziness. Exhaust inline / progressive alternatives first.
-- Any strong preferences for visual direction? (minimal, bold, elegant, playful, technical, organic, etc.)
-- Light mode, dark mode, or both?
-- Any colors that must be used or avoided?
+### Copy
-#### Accessibility & Inclusion
+- Every word earns its place. No restated headings, no intros that repeat the title.
+- **No em dashes.** Use commas, colons, semicolons, periods, or parentheses. Also not `--`.
-- Specific accessibility requirements? (WCAG level, known user needs)
-- Considerations for reduced motion, color blindness, or other accommodations?
+### The AI slop test
-Skip questions where the answer is already clear from the codebase exploration.
+If someone could look at this interface and say "AI made that" without doubt, it's failed. Cross-register failures are the absolute bans above. Register-specific failures live in each reference.
-### Step 3: Write Design Context
+**Category-reflex check.** If someone could guess the theme and palette from the category name alone — "observability → dark blue", "healthcare → white + teal", "finance → navy + gold", "crypto → neon on black" — it's the training-data reflex. Rework the scene sentence and color strategy until the answer is no longer obvious from the domain.
-Synthesize your findings and the user's answers into a `## Design Context` section:
+## Commands
-```markdown
-## Design Context
+| Command | Category | Description | Reference |
+|---|---|---|---|
+| `craft [feature]` | Build | Shape, then build a feature end-to-end | [reference/craft.md](reference/craft.md) |
+| `shape [feature]` | Build | Plan UX/UI before writing code | [reference/shape.md](reference/shape.md) |
+| `teach` | Build | Set up PRODUCT.md and DESIGN.md context | [reference/teach.md](reference/teach.md) |
+| `document` | Build | Generate DESIGN.md from existing project code | [reference/document.md](reference/document.md) |
+| `extract [target]` | Build | Pull reusable tokens and components into design system | [reference/extract.md](reference/extract.md) |
+| `critique [target]` | Evaluate | UX design review with heuristic scoring | [reference/critique.md](reference/critique.md) |
+| `audit [target]` | Evaluate | Technical quality checks (a11y, perf, responsive) | [reference/audit.md](reference/audit.md) |
+| `polish [target]` | Refine | Final quality pass before shipping | [reference/polish.md](reference/polish.md) |
+| `bolder [target]` | Refine | Amplify safe or bland designs | [reference/bolder.md](reference/bolder.md) |
+| `quieter [target]` | Refine | Tone down aggressive or overstimulating designs | [reference/quieter.md](reference/quieter.md) |
+| `distill [target]` | Refine | Strip to essence, remove complexity | [reference/distill.md](reference/distill.md) |
+| `harden [target]` | Refine | Production-ready: errors, i18n, edge cases | [reference/harden.md](reference/harden.md) |
+| `onboard [target]` | Refine | Design first-run flows, empty states, activation | [reference/onboard.md](reference/onboard.md) |
+| `animate [target]` | Enhance | Add purposeful animations and motion | [reference/animate.md](reference/animate.md) |
+| `colorize [target]` | Enhance | Add strategic color to monochromatic UIs | [reference/colorize.md](reference/colorize.md) |
+| `typeset [target]` | Enhance | Improve typography hierarchy and fonts | [reference/typeset.md](reference/typeset.md) |
+| `layout [target]` | Enhance | Fix spacing, rhythm, and visual hierarchy | [reference/layout.md](reference/layout.md) |
+| `delight [target]` | Enhance | Add personality and memorable touches | [reference/delight.md](reference/delight.md) |
+| `overdrive [target]` | Enhance | Push past conventional limits | [reference/overdrive.md](reference/overdrive.md) |
+| `clarify [target]` | Fix | Improve UX copy, labels, and error messages | [reference/clarify.md](reference/clarify.md) |
+| `adapt [target]` | Fix | Adapt for different devices and screen sizes | [reference/adapt.md](reference/adapt.md) |
+| `optimize [target]` | Fix | Diagnose and fix UI performance | [reference/optimize.md](reference/optimize.md) |
+| `live` | Iterate | Visual variant mode: pick elements in the browser, generate alternatives | [reference/live.md](reference/live.md) |
-### Users
+Plus two management commands — `pin ` and `unpin `, detailed below.
-[Who they are, their context, the job to be done]
+### Routing rules
-### Brand Personality
+1. **No argument** — render the table above as the user-facing command menu, grouped by category. Ask what they'd like to do.
+2. **First word matches a command** — load its reference file and follow its instructions. Everything after the command name is the target.
+3. **First word doesn't match** — general design invocation. Apply the setup steps, shared design laws, and the loaded register reference, using the full argument as context.
-[Voice, tone, 3-word personality, emotional goals]
+Setup (context gathering, register) is already loaded by then; sub-commands don't re-invoke `$impeccable`.
-### Aesthetic Direction
+If the first word is `craft`, setup still runs first, but [reference/craft.md](reference/craft.md) owns the rest of the flow. If setup invokes `teach` as a blocker, finish teach, refresh context, then resume the original command and target.
-[Visual tone, references, anti-references, theme]
+## Pin / Unpin
-### Design Principles
+**Pin** creates a standalone shortcut so `$` invokes `$impeccable ` directly. **Unpin** removes it. The script writes to every harness directory present in the project.
-[3-5 principles derived from the conversation that should guide all design decisions]
+```bash
+node .agents/skills/impeccable/scripts/pin.mjs
```
-Write this section to `.impeccable.md` in the project root. If the file already exists, update the Design Context section in place.
-
-Then ask the user directly to clarify what you cannot infer. whether they'd also like the Design Context appended to .github/copilot-instructions.md. If yes, append or update the section there as well.
-
-Confirm completion and summarize the key design principles that will now guide all future work.
-
----
-
-## Extract Mode
-
-If this skill is invoked with the argument "extract" (e.g., `/impeccable extract [target]`), follow the [extract flow](reference/extract.md). Pass any additional arguments as the extraction target.
+Valid `` is any command from the table above. Report the script's result concisely — confirm the new shortcut on success, relay stderr verbatim on error.
\ No newline at end of file
diff --git a/.agents/skills/impeccable/agents/openai.yaml b/.agents/skills/impeccable/agents/openai.yaml
new file mode 100644
index 0000000..ee6cae7
--- /dev/null
+++ b/.agents/skills/impeccable/agents/openai.yaml
@@ -0,0 +1,4 @@
+interface:
+ display_name: Impeccable
+ short_description: Use when the user wants to design, redesign, shape, critique, audit, polish, clarify,...
+ default_prompt: Use Impeccable to redesign, critique, audit, or polish this frontend.
\ No newline at end of file
diff --git a/.agents/skills/adapt/SKILL.md b/.agents/skills/impeccable/reference/adapt.md
similarity index 89%
rename from .agents/skills/adapt/SKILL.md
rename to .agents/skills/impeccable/reference/adapt.md
index a3b676d..249653d 100644
--- a/.agents/skills/adapt/SKILL.md
+++ b/.agents/skills/impeccable/reference/adapt.md
@@ -1,16 +1,7 @@
----
-name: adapt
-description: "Adapt designs to work across different screen sizes, devices, contexts, or platforms. Implements breakpoints, fluid layouts, and touch targets. Use when the user mentions responsive design, mobile layouts, breakpoints, viewport adaptation, or cross-device compatibility."
-version: 2.1.1
-user-invocable: true
-argument-hint: "[target] [context (mobile, tablet, print...)]"
----
+> **Additional context needed**: target platforms/devices and usage contexts.
Adapt existing designs to work effectively across different contexts - different screen sizes, devices, platforms, or use cases.
-## MANDATORY PREPARATION
-
-Invoke /impeccable — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run /impeccable teach first. Additionally gather: target platforms/devices and usage contexts.
---
@@ -45,14 +36,12 @@ Create context-appropriate strategy:
### Mobile Adaptation (Desktop → Mobile)
**Layout Strategy**:
-
- Single column instead of multi-column
- Vertical stacking instead of side-by-side
- Full-width components instead of fixed widths
- Bottom navigation instead of top/side navigation
**Interaction Strategy**:
-
- Touch targets 44x44px minimum (not hover-dependent)
- Swipe gestures where appropriate (lists, carousels)
- Bottom sheets instead of dropdowns
@@ -60,14 +49,12 @@ Create context-appropriate strategy:
- Larger tap areas with more spacing
**Content Strategy**:
-
- Progressive disclosure (don't show everything at once)
- Prioritize primary content (secondary content in tabs/accordions)
- Shorter text (more concise)
- Larger text (16px minimum)
**Navigation Strategy**:
-
- Hamburger menu or bottom navigation
- Reduce navigation complexity
- Sticky headers for context
@@ -76,14 +63,12 @@ Create context-appropriate strategy:
### Tablet Adaptation (Hybrid Approach)
**Layout Strategy**:
-
- Two-column layouts (not single or three-column)
- Side panels for secondary content
- Master-detail views (list + detail)
- Adaptive based on orientation (portrait vs landscape)
**Interaction Strategy**:
-
- Support both touch and pointer
- Touch targets 44x44px but allow denser layouts than phone
- Side navigation drawers
@@ -92,14 +77,12 @@ Create context-appropriate strategy:
### Desktop Adaptation (Mobile → Desktop)
**Layout Strategy**:
-
- Multi-column layouts (use horizontal space)
- Side navigation always visible
- Multiple information panels simultaneously
- Fixed widths with max-width constraints (don't stretch to 4K)
**Interaction Strategy**:
-
- Hover states for additional information
- Keyboard shortcuts
- Right-click context menus
@@ -107,7 +90,6 @@ Create context-appropriate strategy:
- Multi-select with Shift/Cmd
**Content Strategy**:
-
- Show more information upfront (less progressive disclosure)
- Data tables with many columns
- Richer visualizations
@@ -116,14 +98,12 @@ Create context-appropriate strategy:
### Print Adaptation (Screen → Print)
**Layout Strategy**:
-
- Page breaks at logical points
- Remove navigation, footer, interactive elements
- Black and white (or limited color)
- Proper margins for binding
**Content Strategy**:
-
- Expand shortened content (show full URLs, hidden sections)
- Add page numbers, headers, footers
- Include metadata (print date, page title)
@@ -132,14 +112,12 @@ Create context-appropriate strategy:
### Email Adaptation (Web → Email)
**Layout Strategy**:
-
- Narrow width (600px max)
- Single column only
- Inline CSS (no external stylesheets)
- Table-based layouts (for email client compatibility)
**Interaction Strategy**:
-
- Large, obvious CTAs (buttons not text links)
- No hover states (not reliable)
- Deep links to web app for complex interactions
@@ -151,7 +129,6 @@ Apply changes systematically:
### Responsive Breakpoints
Choose appropriate breakpoints:
-
- Mobile: 320px-767px
- Tablet: 768px-1023px
- Desktop: 1024px+
@@ -190,7 +167,6 @@ Choose appropriate breakpoints:
**IMPORTANT**: Test on real devices, not just browser DevTools. Device emulation is helpful but not perfect.
**NEVER**:
-
- Hide core functionality on mobile (if it matters, make it work)
- Assume desktop = powerful device (consider accessibility, older machines)
- Use different information architecture across contexts (confusing)
diff --git a/.agents/skills/animate/SKILL.md b/.agents/skills/impeccable/reference/animate.md
similarity index 80%
rename from .agents/skills/animate/SKILL.md
rename to .agents/skills/impeccable/reference/animate.md
index 5c0a168..b38e140 100644
--- a/.agents/skills/animate/SKILL.md
+++ b/.agents/skills/impeccable/reference/animate.md
@@ -1,16 +1,14 @@
----
-name: animate
-description: "Review a feature and enhance it with purposeful animations, micro-interactions, and motion effects that improve usability and delight. Use when the user mentions adding animation, transitions, micro-interactions, motion design, hover effects, or making the UI feel more alive."
-version: 2.1.1
-user-invocable: true
-argument-hint: "[target]"
----
+> **Additional context needed**: performance constraints.
Analyze a feature and strategically add animations and micro-interactions that enhance understanding, provide feedback, and create delight.
-## MANDATORY PREPARATION
+---
+
+## Register
+
+Brand: orchestrated page-load sequences, staggered reveals, scroll-driven animation. Motion is part of the voice; one well-rehearsed entrance beats scattered micro-interactions.
-Invoke /impeccable — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run /impeccable teach first. Additionally gather: performance constraints.
+Product: 150–250 ms on most transitions. Motion conveys state — feedback, reveal, loading, transitions between views. No page-load choreography; users are in a task and won't wait for it.
---
@@ -31,7 +29,7 @@ Analyze where motion would improve the experience:
- Who's the audience? (Motion-sensitive users? Power users who want speed?)
- What matters most? (One hero animation vs many micro-interactions?)
-If any of these are unclear from the codebase, ask the user directly to clarify what you cannot infer.
+If any of these are unclear from the codebase, STOP and use Codex's structured user-input/question tool when available; if unavailable, ask directly in chat to clarify what you cannot infer.
**CRITICAL**: Respect `prefers-reduced-motion`. Always provide non-animated alternatives for users who need them.
@@ -51,14 +49,12 @@ Create a purposeful animation plan:
Add motion systematically across these categories:
### Entrance Animations
-
- **Page load choreography**: Stagger element reveals (100-150ms delays), fade + slide combinations
- **Hero section**: Dramatic entrance for primary content (scale, parallax, or creative effects)
- **Content reveals**: Scroll-triggered animations using intersection observer
- **Modal/drawer entry**: Smooth slide + fade, backdrop fade, focus management
### Micro-interactions
-
- **Button feedback**:
- Hover: Subtle scale (1.02-1.05), color shift, shadow increase
- Click: Quick scale down then up (0.95 → 1), ripple effect
@@ -71,7 +67,6 @@ Add motion systematically across these categories:
- **Like/favorite**: Scale + rotation, particle effects, color transition
### State Transitions
-
- **Show/hide**: Fade + slide (not instant), appropriate timing (200-300ms)
- **Expand/collapse**: Height transition with overflow handling, icon rotation
- **Loading states**: Skeleton screen fades, spinner animations, progress bars
@@ -79,21 +74,18 @@ Add motion systematically across these categories:
- **Enable/disable**: Opacity transitions, cursor changes
### Navigation & Flow
-
- **Page transitions**: Crossfade between routes, shared element transitions
- **Tab switching**: Slide indicator, content fade/slide
- **Carousel/slider**: Smooth transforms, snap points, momentum
- **Scroll effects**: Parallax layers, sticky headers with state changes, scroll progress indicators
### Feedback & Guidance
-
- **Hover hints**: Tooltip fade-ins, cursor changes, element highlights
- **Drag & drop**: Lift effect (shadow + scale), drop zone highlights, smooth repositioning
- **Copy/paste**: Brief highlight flash on paste, "copied" confirmation
- **Focus flow**: Highlight path through form or workflow
### Delight Moments
-
- **Empty states**: Subtle floating animations on illustrations
- **Completed actions**: Confetti, check mark flourish, success celebrations
- **Easter eggs**: Hidden interactions for discovery
@@ -106,19 +98,17 @@ Use appropriate techniques for each animation:
### Timing & Easing
**Durations by purpose:**
-
- **100-150ms**: Instant feedback (button press, toggle)
- **200-300ms**: State changes (hover, menu open)
- **300-500ms**: Layout changes (accordion, modal)
- **500-800ms**: Entrance animations (page load)
**Easing curves (use these, not CSS defaults):**
-
```css
/* Recommended - natural deceleration */
---ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1); /* Smooth, refined */
---ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1); /* Slightly snappier */
---ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1); /* Confident, decisive */
+--ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1); /* Smooth, refined */
+--ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1); /* Slightly snappier */
+--ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1); /* Confident, decisive */
/* AVOID - feel dated and tacky */
/* bounce: cubic-bezier(0.34, 1.56, 0.64, 1); */
@@ -128,16 +118,15 @@ Use appropriate techniques for each animation:
**Exit animations are faster than entrances.** Use ~75% of enter duration.
### CSS Animations
-
```css
/* Prefer for simple, declarative animations */
- transitions for state changes
- @keyframes for complex sequences
-- transform + opacity only (GPU-accelerated)
+- transform and opacity for reliable movement
+- blur, filters, masks, clip paths, shadows, and color shifts for premium atmospheric effects when verified smooth
```
### JavaScript Animation
-
```javascript
/* Use for complex, interactive animations */
- Web Animations API for programmatic control
@@ -146,14 +135,13 @@ Use appropriate techniques for each animation:
```
### Performance
-
-- **GPU acceleration**: Use `transform` and `opacity`, avoid layout properties
+- **Motion materials**: Use transform/opacity for reliable movement, but use blur, filters, masks, shadows, and color shifts when they materially improve the effect
+- **Layout safety**: Avoid casual animation of layout-driving properties (`width`, `height`, `top`, `left`, margins)
- **will-change**: Add sparingly for known expensive animations
-- **Reduce paint**: Minimize repaints, use `contain` where appropriate
+- **Bound expensive effects**: Keep blur/filter/shadow areas small or isolated, use `contain` where appropriate
- **Monitor FPS**: Ensure 60fps on target devices
### Accessibility
-
```css
@media (prefers-reduced-motion: reduce) {
* {
@@ -165,9 +153,8 @@ Use appropriate techniques for each animation:
```
**NEVER**:
-
- Use bounce or elastic easing curves—they feel dated and draw attention to the animation itself
-- Animate layout properties (width, height, top, left)—use transform instead
+- Animate layout properties casually (`width`, `height`, `top`, `left`, margins) when transform, FLIP, or grid-based techniques would work
- Use durations over 500ms for feedback—it feels laggy
- Animate without purpose—every animation needs a reason
- Ignore `prefers-reduced-motion`—this is an accessibility violation
diff --git a/.agents/skills/audit/SKILL.md b/.agents/skills/impeccable/reference/audit.md
similarity index 68%
rename from .agents/skills/audit/SKILL.md
rename to .agents/skills/impeccable/reference/audit.md
index ada0944..00ac34b 100644
--- a/.agents/skills/audit/SKILL.md
+++ b/.agents/skills/impeccable/reference/audit.md
@@ -1,17 +1,3 @@
----
-name: audit
-description: "Run technical quality checks across accessibility, performance, theming, responsive design, and anti-patterns. Generates a scored report with P0-P3 severity ratings and actionable plan. Use when the user wants an accessibility check, performance audit, or technical quality review."
-version: 2.1.1
-user-invocable: true
-argument-hint: "[area (feature, page, component...)]"
----
-
-## MANDATORY PREPARATION
-
-Invoke /impeccable — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run /impeccable teach first.
-
----
-
Run systematic **technical** quality checks and generate a comprehensive report. Don't fix issues — document them for other commands to address.
This is a code-level audit, not a design critique. Check what's measurable and verifiable in the implementation.
@@ -23,7 +9,6 @@ Run comprehensive checks across 5 dimensions. Score each dimension 0-4 using the
### 1. Accessibility (A11y)
**Check for**:
-
- **Contrast issues**: Text contrast ratios < 4.5:1 (or 7:1 for AAA)
- **Missing ARIA**: Interactive elements without proper roles, labels, or states
- **Keyboard navigation**: Missing focus indicators, illogical tab order, keyboard traps
@@ -36,9 +21,8 @@ Run comprehensive checks across 5 dimensions. Score each dimension 0-4 using the
### 2. Performance
**Check for**:
-
- **Layout thrashing**: Reading/writing layout properties in loops
-- **Expensive animations**: Animating layout properties (width, height, top, left) instead of transform/opacity
+- **Expensive animations**: Casual layout-property animation, unbounded blur/filter/shadow effects, or effects that visibly drop frames
- **Missing optimization**: Images without lazy loading, unoptimized assets, missing will-change
- **Bundle size**: Unnecessary imports, unused dependencies
- **Render performance**: Unnecessary re-renders, missing memoization
@@ -48,7 +32,6 @@ Run comprehensive checks across 5 dimensions. Score each dimension 0-4 using the
### 3. Theming
**Check for**:
-
- **Hard-coded colors**: Colors not using design tokens
- **Broken dark mode**: Missing dark mode variants, poor contrast in dark theme
- **Inconsistent tokens**: Using wrong tokens, mixing token types
@@ -59,7 +42,6 @@ Run comprehensive checks across 5 dimensions. Score each dimension 0-4 using the
### 4. Responsive Design
**Check for**:
-
- **Fixed widths**: Hard-coded widths that break on mobile
- **Touch targets**: Interactive elements < 44x44px
- **Horizontal scroll**: Content overflow on narrow viewports
@@ -70,7 +52,7 @@ Run comprehensive checks across 5 dimensions. Score each dimension 0-4 using the
### 5. Anti-Patterns (CRITICAL)
-Check against ALL the **DON'T** guidelines in the impeccable skill. Look for AI slop tells (AI color palette, gradient text, glassmorphism, hero metrics, card grids, generic fonts) and general design anti-patterns (gray on color, nested cards, bounce easing, redundant copy).
+Check against ALL the **DON'T** guidelines from the parent impeccable skill (already loaded in this context). Look for AI slop tells (AI color palette, gradient text, glassmorphism, hero metrics, card grids, generic fonts) and general design anti-patterns (gray on color, nested cards, bounce easing, redundant copy).
**Score 0-4**: 0=AI slop gallery (5+ tells), 1=Heavy AI aesthetic (3-4 tells), 2=Some tells (1-2 noticeable), 3=Mostly clean (subtle issues only), 4=No AI tells (distinctive, intentional design)
@@ -78,23 +60,21 @@ Check against ALL the **DON'T** guidelines in the impeccable skill. Look for AI
### Audit Health Score
-| # | Dimension | Score | Key Finding |
-| --------- | ----------------- | --------- | ---------------------------------- |
-| 1 | Accessibility | ? | [most critical a11y issue or "--"] |
-| 2 | Performance | ? | |
-| 3 | Responsive Design | ? | |
-| 4 | Theming | ? | |
-| 5 | Anti-Patterns | ? | |
-| **Total** | | **??/20** | **[Rating band]** |
+| # | Dimension | Score | Key Finding |
+|---|-----------|-------|-------------|
+| 1 | Accessibility | ? | [most critical a11y issue or "--"] |
+| 2 | Performance | ? | |
+| 3 | Responsive Design | ? | |
+| 4 | Theming | ? | |
+| 5 | Anti-Patterns | ? | |
+| **Total** | | **??/20** | **[Rating band]** |
**Rating bands**: 18-20 Excellent (minor polish), 14-17 Good (address weak dimensions), 10-13 Acceptable (significant work needed), 6-9 Poor (major overhaul), 0-5 Critical (fundamental issues)
### Anti-Patterns Verdict
-
**Start here.** Pass/fail: Does this look AI-generated? List specific tells. Be brutally honest.
### Executive Summary
-
- Audit Health Score: **??/20** ([rating band])
- Total issues found (count by severity: P0/P1/P2/P3)
- Top 3-5 critical issues
@@ -103,26 +83,23 @@ Check against ALL the **DON'T** guidelines in the impeccable skill. Look for AI
### Detailed Findings by Severity
Tag every issue with **P0-P3 severity**:
-
- **P0 Blocking**: Prevents task completion — fix immediately
- **P1 Major**: Significant difficulty or WCAG AA violation — fix before release
- **P2 Minor**: Annoyance, workaround exists — fix in next pass
- **P3 Polish**: Nice-to-fix, no real user impact — fix if time permits
For each issue, document:
-
- **[P?] Issue name**
- **Location**: Component, file, line
- **Category**: Accessibility / Performance / Theming / Responsive / Anti-Pattern
- **Impact**: How it affects users
- **WCAG/Standard**: Which standard it violates (if applicable)
- **Recommendation**: How to fix it
-- **Suggested command**: Which command to use (prefer: /polish, /typeset, /colorize, /quieter, /critique, /overdrive, /clarify, /bolder, /audit, /distill, /harden, /layout, /shape, /animate, /optimize, /adapt, /delight)
+- **Suggested command**: Which command to use (prefer: $impeccable adapt, $impeccable animate, $impeccable audit, $impeccable bolder, $impeccable clarify, $impeccable colorize, $impeccable critique, $impeccable delight, $impeccable distill, $impeccable document, $impeccable harden, $impeccable layout, $impeccable onboard, $impeccable optimize, $impeccable overdrive, $impeccable polish, $impeccable quieter, $impeccable shape, $impeccable typeset)
### Patterns & Systemic Issues
Identify recurring problems that indicate systemic gaps rather than one-off mistakes:
-
- "Hard-coded colors appear in 15+ components, should use design tokens"
- "Touch targets consistently too small (<44px) throughout mobile experience"
@@ -134,21 +111,20 @@ Note what's working well — good practices to maintain and replicate.
List recommended commands in priority order (P0 first, then P1, then P2):
-1. **[P?] `/command-name`** — Brief description (specific context from audit findings)
-2. **[P?] `/command-name`** — Brief description (specific context)
+1. **[P?] `$command-name`** — Brief description (specific context from audit findings)
+2. **[P?] `$command-name`** — Brief description (specific context)
-**Rules**: Only recommend commands from: /polish, /typeset, /colorize, /quieter, /critique, /overdrive, /clarify, /bolder, /audit, /distill, /harden, /layout, /shape, /animate, /optimize, /adapt, /delight. Map findings to the most appropriate command. End with `/polish` as the final step if any fixes were recommended.
+**Rules**: Only recommend commands from: $impeccable adapt, $impeccable animate, $impeccable audit, $impeccable bolder, $impeccable clarify, $impeccable colorize, $impeccable critique, $impeccable delight, $impeccable distill, $impeccable document, $impeccable harden, $impeccable layout, $impeccable onboard, $impeccable optimize, $impeccable overdrive, $impeccable polish, $impeccable quieter, $impeccable shape, $impeccable typeset. Map findings to the most appropriate command. End with `$impeccable polish` as the final step if any fixes were recommended.
After presenting the summary, tell the user:
> You can ask me to run these one at a time, all at once, or in any order you prefer.
>
-> Re-run `/audit` after fixes to see your score improve.
+> Re-run `$impeccable audit` after fixes to see your score improve.
**IMPORTANT**: Be thorough but actionable. Too many P3 issues creates noise. Focus on what actually matters.
**NEVER**:
-
- Report issues without explaining impact (why does this matter?)
- Provide generic recommendations (be specific and actionable)
- Skip positive findings (celebrate what works)
diff --git a/.agents/skills/bolder/SKILL.md b/.agents/skills/impeccable/reference/bolder.md
similarity index 80%
rename from .agents/skills/bolder/SKILL.md
rename to .agents/skills/impeccable/reference/bolder.md
index 873e4a9..e374312 100644
--- a/.agents/skills/bolder/SKILL.md
+++ b/.agents/skills/impeccable/reference/bolder.md
@@ -1,16 +1,12 @@
----
-name: bolder
-description: "Amplify safe or boring designs to make them more visually interesting and stimulating. Increases impact while maintaining usability. Use when the user says the design looks bland, generic, too safe, lacks personality, or wants more visual impact and character."
-version: 2.1.1
-user-invocable: true
-argument-hint: "[target]"
+Increase visual impact and personality in designs that are too safe, generic, or visually underwhelming, creating more engaging and memorable experiences.
+
---
-Increase visual impact and personality in designs that are too safe, generic, or visually underwhelming, creating more engaging and memorable experiences.
+## Register
-## MANDATORY PREPARATION
+Brand: "bolder" means distinctive. Extreme scale, unexpected color, typographic risk, committed POV.
-Invoke /impeccable — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run /impeccable teach first.
+Product: "bolder" rarely means theatrics — those undermine trust. It means stronger hierarchy, clearer weight contrast, one sharper accent, more committed density. The amplification is in clarity, not drama.
---
@@ -32,11 +28,11 @@ Analyze what makes the design feel too safe or boring:
- Who's the audience? (What will resonate?)
- What are the constraints? (Brand guidelines, accessibility, performance)
-If any of these are unclear from the codebase, ask the user directly to clarify what you cannot infer.
+If any of these are unclear from the codebase, STOP and use Codex's structured user-input/question tool when available; if unavailable, ask directly in chat to clarify what you cannot infer.
**CRITICAL**: "Bolder" doesn't mean chaotic or garish. It means distinctive, memorable, and confident. Think intentional drama, not random chaos.
-**WARNING - AI SLOP TRAP**: When making things "bolder," AI defaults to the same tired tricks: cyan/purple gradients, glassmorphism, neon accents on dark backgrounds, gradient text on metrics. These are the OPPOSITE of bold—they're generic. Review ALL the DON'T guidelines in the impeccable skill before proceeding. Bold means distinctive, not "more effects."
+**WARNING - AI SLOP TRAP**: When making things "bolder," AI defaults to the same tired tricks: cyan/purple gradients, glassmorphism, neon accents on dark backgrounds, gradient text on metrics. These are the OPPOSITE of bold. They're generic. Review ALL the DON'T guidelines from the parent impeccable skill (already loaded in this context) before proceeding. Bold means distinctive, not "more effects."
## Plan Amplification
@@ -54,14 +50,12 @@ Create a strategy to increase impact while maintaining coherence:
Systematically increase impact across these dimensions:
### Typography Amplification
-
-- **Replace generic fonts**: Swap system fonts for distinctive choices (see impeccable skill for inspiration)
+- **Replace generic fonts**: Swap system fonts for distinctive choices (see the parent skill's typography guidelines and [typography.md](typography.md) for inspiration)
- **Extreme scale**: Create dramatic size jumps (3x-5x differences, not 1.5x)
- **Weight contrast**: Pair 900 weights with 200 weights, not 600 with 400
- **Unexpected choices**: Variable fonts, display fonts for headlines, condensed/extended widths, monospace as intentional accent (not as lazy "dev tool" default)
### Color Intensification
-
- **Increase saturation**: Shift to more vibrant, energetic colors (but not neon)
- **Bold palette**: Introduce unexpected color combinations—avoid the purple-blue gradient AI slop
- **Dominant color strategy**: Let one bold color own 60% of the design
@@ -70,7 +64,6 @@ Systematically increase impact across these dimensions:
- **Rich gradients**: Intentional multi-stop gradients (not generic purple-to-blue)
### Spatial Drama
-
- **Extreme scale jumps**: Make important elements 3-5x larger than surroundings
- **Break the grid**: Let hero elements escape containers and cross boundaries
- **Asymmetric layouts**: Replace centered, balanced layouts with tension-filled asymmetry
@@ -78,7 +71,6 @@ Systematically increase impact across these dimensions:
- **Overlap**: Layer elements intentionally for depth
### Visual Effects
-
- **Dramatic shadows**: Large, soft shadows for elevation (but not generic drop shadows on rounded rectangles)
- **Background treatments**: Mesh patterns, noise textures, geometric patterns, intentional gradients (not purple-to-blue)
- **Texture & depth**: Grain, halftone, duotone, layered elements—NOT glassmorphism (it's overused AI slop)
@@ -86,21 +78,18 @@ Systematically increase impact across these dimensions:
- **Custom elements**: Illustrative elements, custom icons, decorative details that reinforce brand
### Motion & Animation
-
- **Entrance choreography**: Staggered, dramatic page load animations with 50-100ms delays
- **Scroll effects**: Parallax, reveal animations, scroll-triggered sequences
- **Micro-interactions**: Satisfying hover effects, click feedback, state changes
- **Transitions**: Smooth, noticeable transitions using ease-out-quart/quint/expo (not bounce or elastic—they cheapen the effect)
### Composition Boldness
-
- **Hero moments**: Create clear focal points with dramatic treatment
- **Diagonal flows**: Escape horizontal/vertical rigidity with diagonal arrangements
- **Full-bleed elements**: Use full viewport width/height for impact
- **Unexpected proportions**: Golden ratio? Throw it out. Try 70/30, 80/20 splits
**NEVER**:
-
- Add effects randomly without purpose (chaos ≠ bold)
- Sacrifice readability for aesthetics (body text must be readable)
- Make everything bold (then nothing is bold - need contrast)
diff --git a/.agents/skills/impeccable/reference/brand.md b/.agents/skills/impeccable/reference/brand.md
new file mode 100644
index 0000000..2f615ac
--- /dev/null
+++ b/.agents/skills/impeccable/reference/brand.md
@@ -0,0 +1,104 @@
+# Brand register
+
+When design IS the product: brand sites, landing pages, marketing surfaces, campaign pages, portfolios, long-form content, about pages. The deliverable is the design itself — a visitor's impression is the thing being made.
+
+The register spans every genre. A tech brand (Stripe, Linear, Vercel). A luxury brand (a hotel, a fashion house). A consumer product (a restaurant, a travel site, a CPG packaging page). A creative studio, an agency portfolio, a band's album page. They all share the stance — *communicate, not transact* — and diverge wildly in aesthetic. Don't collapse them into a single look.
+
+## The brand slop test
+
+If someone could look at this and say "AI made that" without hesitation, it's failed. The bar is distinctiveness — a visitor should ask "how was this made?", not "which AI made this?"
+
+Brand isn't a neutral register. AI-generated landing pages have flooded the internet, and average is no longer findable. Restraint without intent now reads as mediocre, not refined. Brand surfaces need a POV, a specific audience, a willingness to risk strangeness. Go big or go home.
+
+**The second slop test: aesthetic lane.** Before committing to moves, name the reference. A Klim-style specimen page is one lane; Stripe-minimal is another; Liquid-Death-acid-maximalism is another. Don't drift into editorial-magazine aesthetics on a brief that isn't editorial. A hiking brand with Cormorant italic drop caps has the wrong register within the register.
+
+## Typography
+
+### Font selection procedure
+
+Every project. Never skip.
+
+1. Read the brief. Write three concrete brand-voice words — not "modern" or "elegant," but "warm and mechanical and opinionated" or "calm and clinical and careful." Physical-object words.
+2. List the three fonts you'd reach for by reflex. If any appear in the reflex-reject list below, reject them — they are training-data defaults and they create monoculture.
+3. Browse a real catalog (Google Fonts, Pangram Pangram, Future Fonts, Adobe Fonts, ABC Dinamo, Klim, Velvetyne) with the three words in mind. Find the font for the brand as a *physical object* — a museum caption, a 1970s terminal manual, a fabric label, a cheap-newsprint children's book, a concert poster, a receipt from a mid-century diner. Reject the first thing that "looks designy."
+4. Cross-check. "Elegant" is not necessarily serif. "Technical" is not necessarily sans. "Warm" is not Fraunces. If the final pick lines up with the original reflex, start over.
+
+### Reflex-reject list
+
+Training-data defaults. Ban list — look further:
+
+Fraunces · Newsreader · Lora · Crimson · Crimson Pro · Crimson Text · Playfair Display · Cormorant · Cormorant Garamond · Syne · IBM Plex Mono · IBM Plex Sans · IBM Plex Serif · Space Mono · Space Grotesk · Inter · DM Sans · DM Serif Display · DM Serif Text · Outfit · Plus Jakarta Sans · Instrument Sans · Instrument Serif
+
+### Pairing and voice
+
+Distinctive + refined is the goal — the specific shape depends on the brand:
+
+- **Editorial / long-form / luxury**: display serif + sans body (a magazine shape).
+- **Tech / dev tools / fintech**: one committed sans, usually; custom-tight tracking, strong weight contrast inside a single family.
+- **Consumer / food / travel**: warmer pairings, often a humanist sans plus a script or display serif.
+- **Creative studios / agencies**: rule-breaking welcome — mono-only, or display-only, or custom-drawn type as voice.
+
+Two families minimum is the rule *only* when the voice needs it. A single well-chosen family with committed weight/size contrast is stronger than a timid display+body pair.
+
+Vary across projects. If the last brief was a serif-display landing page, this one isn't.
+
+### Scale
+
+Modular scale, fluid `clamp()` for headings, ≥1.25 ratio between steps. Flat scales (1.1× apart) read as uncommitted.
+
+Light text on dark backgrounds: add 0.05–0.1 to line-height. Light type reads as lighter weight and needs more breathing room.
+
+## Color
+
+Brand surfaces have permission for Committed, Full palette, and Drenched strategies. Use them. A single saturated color spread across a hero is not excess — it's voice. A beige-and-muted-slate landing page ignores the register.
+
+- Name a real reference before picking a strategy. "Klim Type Foundry #ff4500 orange drench", "Stripe purple-on-white restraint", "Liquid Death acid-green full palette", "Mailchimp yellow full palette", "Condé Nast Traveler muted navy restraint", "Vercel pure black monochrome". Unnamed ambition becomes beige.
+- Palette IS voice. A calm brand and a restless brand should not share palette mechanics.
+- When the strategy is Committed or Drenched, the color is load-bearing. Don't hedge with neutrals around the edges — commit.
+- Don't converge across projects. If the last brand surface was restrained-on-cream, this one is not.
+
+## Layout
+
+- Asymmetric compositions are one option. Break the grid intentionally for emphasis.
+- Fluid spacing with `clamp()` that breathes on larger viewports. Vary for rhythm — generous separations, tight groupings.
+- Alternative: a strict, visible grid as the voice (brutalist / Swiss / tech-spec aesthetics). Either asymmetric or rigorously-gridded can be "designed" — the failure mode is splitting the difference into a generic centered stack.
+- Don't default to centering everything. Left-aligned with asymmetric layouts feels more designed; a strict grid reads as confident structure. A centered-stack hero with icon-title-subtitle cards reads as template.
+- When cards ARE the right affordance, use `grid-template-columns: repeat(auto-fit, minmax(280px, 1fr))` — breakpoint-free responsiveness.
+
+## Imagery
+
+Brand surfaces lean on imagery. A restaurant, hotel, magazine, or product landing page without any imagery reads as incomplete, not as restrained. A solid-color rectangle where a hero image should go is worse than a representative stock photo.
+
+**When the brief implies imagery (restaurants, hotels, magazines, photography, hobbyist communities, food, travel, fashion, product), you must ship imagery.** Zero images is a bug, not a design choice. "Restraint" is not an excuse.
+
+- **For greenfield work without local assets, use stock imagery** — Unsplash is the default. The URL shape is `https://images.unsplash.com/photo-{id}?auto=format&fit=crop&w=1600&q=80`. Pick real Unsplash photo IDs you're confident exist (`photo-1559339352-11d035aa65de`, `photo-1590490360182-c33d57733427`, etc.); if unsure, pick fewer photos but don't substitute colored `
` placeholders.
+- **Search for the brand's physical object**, not the generic category: "handmade pasta on a scratched wooden table" beats "Italian food"; "cypress trees above a limestone hotel facade at dusk" beats "luxury hotel".
+- **One decisive photo beats five mediocre ones.** Hero imagery should commit to a mood; padding with more stock doesn't rescue an indecisive one.
+- **Alt text is part of the voice.** "Coastal fettuccine, hand-cut, served on the terrace" beats "pasta dish".
+
+Tech / dev-tool brands are the exception where zero imagery can be correct — a developer landing page often carries its voice through typography, code samples, diagrams. Know which kind of brand you're working on.
+
+## Motion
+
+- One well-orchestrated page-load with staggered reveals beats scattered micro-interactions — when the brand invites it. Tech-minimal brands often skip entrance motion entirely; the restraint is the voice.
+- For collapsing/expanding sections, transition `grid-template-rows` rather than `height`.
+
+## Brand bans (on top of the shared absolute bans)
+
+- Monospace as lazy shorthand for "technical / developer." If the brand isn't technical, mono reads as costume.
+- Large rounded-corner icons above every heading. Screams template.
+- Single-family pages that picked the family by reflex, not voice. (A single family chosen deliberately is fine.)
+- All-caps body copy. Reserve caps for short labels and headings.
+- Timid palettes and average layouts. Safe = invisible.
+- Zero imagery on a brief that implies imagery (restaurant, hotel, food, travel, fashion, photography, hobbyist). Colored blocks where a hero photo belongs.
+- Defaulting to editorial-magazine aesthetics (display serif + italic + drop caps + broadsheet grid) on briefs that aren't magazine-shaped. Editorial is ONE aesthetic lane, not the default brand aesthetic.
+
+## Brand permissions
+
+Brand can afford things product can't. Take them.
+
+- Ambitious first-load motion. Reveals, scroll-triggered transitions, typographic choreography.
+- Single-purpose viewports. One dominant idea per fold, long scroll, deliberate pacing.
+- Typographic risk. Enormous display type, unexpected italic cuts, mixed cases, hand-drawn headlines, a single oversize word as a hero.
+- Unexpected color strategies. Palette IS voice — a calm brand and a restless brand should not share palette mechanics.
+- Art direction per section. Different sections can have different visual worlds if the narrative demands it. Consistency of voice beats consistency of treatment.
diff --git a/.agents/skills/clarify/SKILL.md b/.agents/skills/impeccable/reference/clarify.md
similarity index 89%
rename from .agents/skills/clarify/SKILL.md
rename to .agents/skills/impeccable/reference/clarify.md
index 1bbbce5..dc116e7 100644
--- a/.agents/skills/clarify/SKILL.md
+++ b/.agents/skills/impeccable/reference/clarify.md
@@ -1,16 +1,7 @@
----
-name: clarify
-description: "Improve unclear UX copy, error messages, microcopy, labels, and instructions to make interfaces easier to understand. Use when the user mentions confusing text, unclear labels, bad error messages, hard-to-follow instructions, or wanting better UX writing."
-version: 2.1.1
-user-invocable: true
-argument-hint: "[target]"
----
+> **Additional context needed**: audience technical level and users' mental state in context.
Identify and improve unclear, confusing, or poorly written interface text to make the product easier to understand and use.
-## MANDATORY PREPARATION
-
-Invoke /impeccable — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run /impeccable teach first. Additionally gather: audience technical level and users' mental state in context.
---
@@ -51,7 +42,6 @@ Create a strategy for clearer communication:
Refine text across these common areas:
### Error Messages
-
**Bad**: "Error 403: Forbidden"
**Good**: "You don't have permission to view this page. Contact your admin for access."
@@ -59,7 +49,6 @@ Refine text across these common areas:
**Good**: "Email addresses need an @ symbol. Try: name@example.com"
**Principles**:
-
- Explain what went wrong in plain language
- Suggest how to fix it
- Don't blame the user
@@ -67,7 +56,6 @@ Refine text across these common areas:
- Link to help/support if applicable
### Form Labels & Instructions
-
**Bad**: "DOB (MM/DD/YYYY)"
**Good**: "Date of birth" (with placeholder showing format)
@@ -75,7 +63,6 @@ Refine text across these common areas:
**Good**: "Your email address" or "Company name"
**Principles**:
-
- Use clear, specific labels (not generic placeholders)
- Show format expectations with examples
- Explain why you're asking (when not obvious)
@@ -83,83 +70,69 @@ Refine text across these common areas:
- Keep required field indicators clear
### Button & CTA Text
-
**Bad**: "Click here" | "Submit" | "OK"
**Good**: "Create account" | "Save changes" | "Got it, thanks"
**Principles**:
-
- Describe the action specifically
- Use active voice (verb + noun)
- Match user's mental model
- Be specific ("Save" is better than "OK")
### Help Text & Tooltips
-
**Bad**: "This is the username field"
**Good**: "Choose a username. You can change this later in Settings."
**Principles**:
-
- Add value (don't just repeat the label)
- Answer the implicit question ("What is this?" or "Why do you need this?")
- Keep it brief but complete
- Link to detailed docs if needed
### Empty States
-
**Bad**: "No items"
**Good**: "No projects yet. Create your first project to get started."
**Principles**:
-
- Explain why it's empty (if not obvious)
- Show next action clearly
- Make it welcoming, not dead-end
### Success Messages
-
**Bad**: "Success"
**Good**: "Settings saved! Your changes will take effect immediately."
**Principles**:
-
- Confirm what happened
- Explain what happens next (if relevant)
- Be brief but complete
- Match the user's emotional moment (celebrate big wins)
### Loading States
-
**Bad**: "Loading..." (for 30+ seconds)
**Good**: "Analyzing your data... this usually takes 30-60 seconds"
**Principles**:
-
- Set expectations (how long?)
- Explain what's happening (when it's not obvious)
- Show progress when possible
- Offer escape hatch if appropriate ("Cancel")
### Confirmation Dialogs
-
**Bad**: "Are you sure?"
**Good**: "Delete 'Project Alpha'? This can't be undone."
**Principles**:
-
- State the specific action
- Explain consequences (especially for destructive actions)
- Use clear button labels ("Delete project" not "Yes")
- Don't overuse confirmations (only for risky actions)
### Navigation & Wayfinding
-
**Bad**: Generic labels like "Items" | "Things" | "Stuff"
**Good**: Specific labels like "Your projects" | "Team members" | "Settings"
**Principles**:
-
- Be specific and descriptive
- Use language users understand (not internal jargon)
- Make hierarchy clear
@@ -177,7 +150,6 @@ Every piece of copy should follow these rules:
6. **Be consistent**: Use same terms throughout (don't vary for variety)
**NEVER**:
-
- Use jargon without explanation
- Blame users ("You made an error" → "This field is required")
- Be vague ("Something went wrong" without explanation)
diff --git a/.agents/skills/critique/reference/cognitive-load.md b/.agents/skills/impeccable/reference/cognitive-load.md
similarity index 97%
rename from .agents/skills/critique/reference/cognitive-load.md
rename to .agents/skills/impeccable/reference/cognitive-load.md
index 4f5dbbd..313df16 100644
--- a/.agents/skills/critique/reference/cognitive-load.md
+++ b/.agents/skills/impeccable/reference/cognitive-load.md
@@ -7,22 +7,18 @@ Cognitive load is the total mental effort required to use an interface. Overload
## Three Types of Cognitive Load
### Intrinsic Load — The Task Itself
-
Complexity inherent to what the user is trying to do. You can't eliminate this, but you can structure it.
**Manage it by**:
-
- Breaking complex tasks into discrete steps
- Providing scaffolding (templates, defaults, examples)
- Progressive disclosure — show what's needed now, hide the rest
- Grouping related decisions together
### Extraneous Load — Bad Design
-
Mental effort caused by poor design choices. **Eliminate this ruthlessly** — it's pure waste.
**Common sources**:
-
- Confusing navigation that requires mental mapping
- Unclear labels that force users to guess meaning
- Visual clutter competing for attention
@@ -30,11 +26,9 @@ Mental effort caused by poor design choices. **Eliminate this ruthlessly** — i
- Unnecessary steps between user intent and result
### Germane Load — Learning Effort
-
-Mental effort spent building understanding. This is _good_ cognitive load — it leads to mastery.
+Mental effort spent building understanding. This is *good* cognitive load — it leads to mastery.
**Support it by**:
-
- Progressive disclosure that reveals complexity gradually
- Consistent patterns that reward learning
- Feedback that confirms correct understanding
@@ -64,13 +58,11 @@ Evaluate the interface against these 8 items:
**Humans can hold ≤4 items in working memory at once** (Miller's Law revised by Cowan, 2001).
At any decision point, count the number of distinct options, actions, or pieces of information a user must simultaneously consider:
-
- **≤4 items**: Within working memory limits — manageable
- **5–7 items**: Pushing the boundary — consider grouping or progressive disclosure
- **8+ items**: Overloaded — users will skip, misclick, or abandon
**Practical applications**:
-
- Navigation menus: ≤5 top-level items (group the rest under clear categories)
- Form sections: ≤4 fields visible per group before a visual break
- Action buttons: 1 primary, 1–2 secondary, group the rest in a menu
@@ -82,41 +74,33 @@ At any decision point, count the number of distinct options, actions, or pieces
## Common Cognitive Load Violations
### 1. The Wall of Options
-
**Problem**: Presenting 10+ choices at once with no hierarchy.
**Fix**: Group into categories, highlight recommended, use progressive disclosure.
### 2. The Memory Bridge
-
**Problem**: User must remember info from step 1 to complete step 3.
**Fix**: Keep relevant context visible, or repeat it where it's needed.
### 3. The Hidden Navigation
-
**Problem**: User must build a mental map of where things are.
**Fix**: Always show current location (breadcrumbs, active states, progress indicators).
### 4. The Jargon Barrier
-
**Problem**: Technical or domain language forces translation effort.
**Fix**: Use plain language. If domain terms are unavoidable, define them inline.
### 5. The Visual Noise Floor
-
**Problem**: Every element has the same visual weight — nothing stands out.
**Fix**: Establish clear hierarchy: one primary element, 2–3 secondary, everything else muted.
### 6. The Inconsistent Pattern
-
**Problem**: Similar actions work differently in different places.
**Fix**: Standardize interaction patterns. Same type of action = same type of UI.
### 7. The Multi-Task Demand
-
**Problem**: Interface requires processing multiple simultaneous inputs (reading + deciding + navigating).
**Fix**: Sequence the steps. Let the user do one thing at a time.
### 8. The Context Switch
-
**Problem**: User must jump between screens/tabs/modals to gather info for a single decision.
**Fix**: Co-locate the information needed for each decision. Reduce back-and-forth.
diff --git a/.agents/skills/impeccable/reference/color-and-contrast.md b/.agents/skills/impeccable/reference/color-and-contrast.md
index 1808172..88a15cc 100644
--- a/.agents/skills/impeccable/reference/color-and-contrast.md
+++ b/.agents/skills/impeccable/reference/color-and-contrast.md
@@ -2,7 +2,7 @@
## Color Spaces: Use OKLCH
-**Stop using HSL.** Use OKLCH (or LCH) instead. It's perceptually uniform, meaning equal steps in lightness _look_ equal—unlike HSL where 50% lightness in yellow looks bright while 50% in blue looks dark.
+**Stop using HSL.** Use OKLCH (or LCH) instead. It's perceptually uniform, meaning equal steps in lightness *look* equal—unlike HSL where 50% lightness in yellow looks bright while 50% in blue looks dark.
The OKLCH function takes three components: `oklch(lightness chroma hue)` where lightness is 0-100%, chroma is roughly 0-0.4, and hue is 0-360. To build a primary color and its lighter / darker variants, hold the chroma+hue roughly constant and vary the lightness — but **reduce chroma as you approach white or black**, because high chroma at extreme lightness looks garish.
@@ -22,12 +22,12 @@ The hue you tint toward should come from THIS project's brand, not from a "warm
A complete system needs:
-| Role | Purpose | Example |
-| ------------ | ----------------------------- | ------------------------- |
-| **Primary** | Brand, CTAs, key actions | 1 color, 3-5 shades |
-| **Neutral** | Text, backgrounds, borders | 9-11 shade scale |
+| Role | Purpose | Example |
+|------|---------|---------|
+| **Primary** | Brand, CTAs, key actions | 1 color, 3-5 shades |
+| **Neutral** | Text, backgrounds, borders | 9-11 shade scale |
| **Semantic** | Success, error, warning, info | 4 colors, 2-3 shades each |
-| **Surface** | Cards, modals, overlays | 2-3 elevation levels |
+| **Surface** | Cards, modals, overlays | 2-3 elevation levels |
**Skip secondary/tertiary unless you need them.** Most apps work fine with one accent color. Adding more creates decision fatigue and visual noise.
@@ -39,18 +39,18 @@ This rule is about **visual weight**, not pixel count:
- **30%**: Secondary colors—text, borders, inactive states
- **10%**: Accent—CTAs, highlights, focus states
-The common mistake: using the accent color everywhere because it's "the brand color." Accent colors work _because_ they're rare. Overuse kills their power.
+The common mistake: using the accent color everywhere because it's "the brand color." Accent colors work *because* they're rare. Overuse kills their power.
## Contrast & Accessibility
### WCAG Requirements
-| Content Type | AA Minimum | AAA Target |
-| ------------------------------- | ---------- | ---------- |
-| Body text | 4.5:1 | 7:1 |
-| Large text (18px+ or 14px bold) | 3:1 | 4.5:1 |
-| UI components, icons | 3:1 | 4.5:1 |
-| Non-essential decorations | None | None |
+| Content Type | AA Minimum | AAA Target |
+|--------------|------------|------------|
+| Body text | 4.5:1 | 7:1 |
+| Large text (18px+ or 14px bold) | 3:1 | 4.5:1 |
+| UI components, icons | 3:1 | 4.5:1 |
+| Non-essential decorations | None | None |
**The gotcha**: Placeholder text still needs 4.5:1. That light gray placeholder you see everywhere? Usually fails WCAG.
@@ -83,12 +83,12 @@ Don't trust your eyes. Use tools:
You can't just swap colors. Dark mode requires different design decisions:
-| Light Mode | Dark Mode |
-| ------------------ | --------------------------------------------- |
-| Shadows for depth | Lighter surfaces for depth (no shadows) |
-| Dark text on light | Light text on dark (reduce font weight) |
-| Vibrant accents | Desaturate accents slightly |
-| White backgrounds | Never pure black—use dark gray (oklch 12-18%) |
+| Light Mode | Dark Mode |
+|------------|-----------|
+| Shadows for depth | Lighter surfaces for depth (no shadows) |
+| Dark text on light | Light text on dark (reduce font weight) |
+| Vibrant accents | Desaturate accents slightly |
+| White backgrounds | Never pure black—use dark gray (oklch 12-18%) |
In dark mode, depth comes from surface lightness, not shadow. Build a 3-step surface scale where higher elevations are lighter (e.g. 15% / 20% / 25% lightness). Use the SAME hue and chroma as your brand color (whatever it is for THIS project — do not reach for blue) and only vary the lightness. Reduce body text weight slightly (e.g. 350 instead of 400) because light text on dark reads as heavier than dark text on light.
diff --git a/.agents/skills/colorize/SKILL.md b/.agents/skills/impeccable/reference/colorize.md
similarity index 72%
rename from .agents/skills/colorize/SKILL.md
rename to .agents/skills/impeccable/reference/colorize.md
index 955eadb..3acc1a5 100644
--- a/.agents/skills/colorize/SKILL.md
+++ b/.agents/skills/impeccable/reference/colorize.md
@@ -1,16 +1,14 @@
----
-name: colorize
-description: "Add strategic color to features that are too monochromatic or lack visual interest, making interfaces more engaging and expressive. Use when the user mentions the design looking gray, dull, lacking warmth, needing more color, or wanting a more vibrant or expressive palette."
-version: 2.1.1
-user-invocable: true
-argument-hint: "[target]"
----
+> **Additional context needed**: existing brand colors.
Strategically introduce color to designs that are too monochromatic, gray, or lacking in visual warmth and personality.
-## MANDATORY PREPARATION
+---
+
+## Register
+
+Brand: palette IS voice. Pick a color strategy first per SKILL.md (Restrained / Committed / Full palette / Drenched) and follow its dosage. Committed, Full palette, and Drenched deliberately exceed the ≤10% rule — that rule is Restrained only. Unexpected combinations are allowed; a dominant color can own the page when the chosen strategy calls for it.
-Invoke /impeccable — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run /impeccable teach first. Additionally gather: existing brand colors.
+Product: semantic-first and almost always Restrained. Accent color is reserved for primary action, current selection, and state indicators — not decoration. Every color has a consistent meaning across every screen.
---
@@ -32,7 +30,7 @@ Analyze the current state and identify opportunities:
- **Wayfinding**: Helping users navigate and understand structure
- **Delight**: Moments of visual interest and personality
-If any of these are unclear from the codebase, ask the user directly to clarify what you cannot infer.
+If any of these are unclear from the codebase, STOP and use Codex's structured user-input/question tool when available; if unavailable, ask directly in chat to clarify what you cannot infer.
**CRITICAL**: More color ≠ better. Strategic color beats rainbow vomit every time. Every color should have a purpose.
@@ -52,7 +50,6 @@ Create a purposeful color introduction plan:
Add color systematically across these dimensions:
### Semantic Color
-
- **State indicators**:
- Success: Green tones (emerald, forest, mint)
- Error: Red/pink tones (rose, crimson, coral)
@@ -64,7 +61,6 @@ Add color systematically across these dimensions:
- **Progress indicators**: Colored bars, rings, or charts showing completion or health
### Accent Color Application
-
- **Primary actions**: Color the most important buttons/CTAs
- **Links**: Add color to clickable text (maintain accessibility)
- **Icons**: Colorize key icons for recognition and personality
@@ -72,35 +68,33 @@ Add color systematically across these dimensions:
- **Hover states**: Introduce color on interaction
### Background & Surfaces
-
- **Tinted backgrounds**: Replace pure gray (`#f5f5f5`) with warm neutrals (`oklch(97% 0.01 60)`) or cool tints (`oklch(97% 0.01 250)`)
- **Colored sections**: Use subtle background colors to separate areas
- **Gradient backgrounds**: Add depth with subtle, intentional gradients (not generic purple-blue)
- **Cards & surfaces**: Tint cards or surfaces slightly for warmth
-**Use OKLCH for color**: It's perceptually uniform, meaning equal steps in lightness _look_ equal. Great for generating harmonious scales.
+**Use OKLCH for color**: It's perceptually uniform, meaning equal steps in lightness *look* equal. Great for generating harmonious scales.
### Data Visualization
-
- **Charts & graphs**: Use color to encode categories or values
- **Heatmaps**: Color intensity shows density or importance
- **Comparison**: Color coding for different datasets or timeframes
### Borders & Accents
-
-- **Accent borders**: Add colored left/top borders to cards or sections
+- **Hairline borders**: 1px colored borders on full perimeter (not side-stripes — see the absolute ban on `border-left/right > 1px`)
- **Underlines**: Color underlines for emphasis or active states
- **Dividers**: Subtle colored dividers instead of gray lines
- **Focus rings**: Colored focus indicators matching brand
+- **Surface tints**: A 4-8% background wash of the accent color instead of a stripe
-### Typography Color
+**NEVER**: `border-left` or `border-right` greater than 1px as a colored accent stripe. This is one of the three absolute bans in the parent skill. If you want to mark a card as "active" or "warning", use a full hairline border, a background tint, a leading glyph, or a numbered prefix — not a side stripe.
+### Typography Color
- **Colored headings**: Use brand colors for section headings (maintain contrast)
- **Highlight text**: Color for emphasis or categories
- **Labels & tags**: Small colored labels for metadata or categories
### Decorative Elements
-
- **Illustrations**: Add colored illustrations or icons
- **Shapes**: Geometric shapes in brand colors as background elements
- **Gradients**: Colorful gradient overlays or mesh backgrounds
@@ -111,26 +105,22 @@ Add color systematically across these dimensions:
Ensure color addition improves rather than overwhelms:
### Maintain Hierarchy
-
- **Dominant color** (60%): Primary brand color or most used accent
- **Secondary color** (30%): Supporting color for variety
- **Accent color** (10%): High contrast for key moments
- **Neutrals** (remaining): Gray/black/white for structure
### Accessibility
-
- **Contrast ratios**: Ensure WCAG compliance (4.5:1 for text, 3:1 for UI components)
- **Don't rely on color alone**: Use icons, labels, or patterns alongside color
- **Test for color blindness**: Verify red/green combinations work for all users
### Cohesion
-
- **Consistent palette**: Use colors from defined palette, not arbitrary choices
- **Systematic application**: Same color meanings throughout (green always = success)
- **Temperature consistency**: Warm palette stays warm, cool stays cool
**NEVER**:
-
- Use every color in the rainbow (choose 2-4 colors beyond neutrals)
- Apply color randomly without semantic meaning
- Put gray text on colored backgrounds—it looks washed out; use a darker shade of the background color or transparency instead
@@ -152,3 +142,13 @@ Test that colorization improves the experience:
- **Not overwhelming**: Is color balanced and purposeful?
Remember: Color is emotional and powerful. Use it to create warmth, guide attention, communicate meaning, and express personality. But restraint and strategy matter more than saturation and variety. Be colorful, but be intentional.
+
+## Live-mode signature params
+
+When invoked from live mode, each variant MUST declare a `color-amount` param so the user can dial between a restrained accent and a drenched surface without regeneration. Author the variant's CSS against `var(--p-color-amount, 0.5)` — typically as the alpha multiplier on backgrounds, or as a scaling factor on the chroma axis in an OKLCH expression. 0 = neutral/monochrome, 1 = full saturation / dominant coverage.
+
+```json
+{"id":"color-amount","kind":"range","min":0,"max":1,"step":0.05,"default":0.5,"label":"Color amount"}
+```
+
+Layer 1-2 variant-specific params on top: palette selection (`steps` with named options), temperature warmth, or tint vs. true color. See `reference/live.md` for the full params contract.
diff --git a/.agents/skills/impeccable/reference/craft.md b/.agents/skills/impeccable/reference/craft.md
index 5484209..337b5c9 100644
--- a/.agents/skills/impeccable/reference/craft.md
+++ b/.agents/skills/impeccable/reference/craft.md
@@ -1,14 +1,43 @@
# Craft Flow
-Build a feature with impeccable UX and UI quality through a structured process: shape the design, load the right references, then build and iterate visually until the result is delightful.
+Build a feature with impeccable UX and UI quality through a structured process: shape the design, land the visual direction, build real production code, then inspect and improve in-browser until the result meets a high-end studio bar.
+
+## Build Gate
+
+Craft cannot build until all of these are true:
+
+1. PRODUCT context is valid and current.
+2. The shape design brief is explicitly confirmed by the user for this task, unless the user already provided a confirmed brief.
+3. Implementation references from the brief are loaded.
+4. The shape visual probe decision is recorded: generated, skipped with reason, or already resolved.
+5. The north-star mock decision is recorded: generated, skipped with reason, or not applicable.
+
+PRODUCT.md and `teach` answers do **not** satisfy the shape gate. They are project context only. A compact self-authored brief does not satisfy the shape gate either. `shape=pass` requires a separate user response approving the shape brief or an already-confirmed brief supplied by the user.
+
+Invalid image-skip reasons include: "the final implementation will be semantic HTML/CSS/SVG", "the diagram should stay editable", "a raster mock would not be used directly", or "the product is fictional." Generated probes and mocks are direction artifacts; they are not implementation assets.
+
+## Craft Contract
+
+Craft is not a first pass. It is a loop with these required artifacts:
+
+1. Confirmed design brief from `shape`.
+2. Approved visual direction, from generated probes / mocks when image generation is available.
+3. Mock fidelity inventory: the visible ingredients from the approved direction that must survive into code.
+4. Semantic, functional implementation using the project's real stack and conventions.
+5. Browser evidence across relevant viewports.
+6. At least one critique-and-fix pass after the first browser inspection, unless the first pass has no material defects.
+
+Do not let generated mockups replace interface structure, copy, accessibility, responsive behavior, or state design. But do treat the approved mock as a concrete visual contract for composition, hierarchy, density, atmosphere, signature motifs, image needs, and distinctive visual moves. "North star" means "preserve the important visible ingredients in semantic code," not "use it as loose mood."
## Step 1: Shape the Design
-Run /shape, passing along whatever feature description the user provided.
+Run $impeccable shape, passing along whatever feature description the user provided.
-Wait for the design brief to be fully confirmed before proceeding. The brief is your blueprint, and every implementation decision should trace back to it.
+Wait for the design brief to be fully confirmed by the user before proceeding. The brief is your blueprint, and every implementation decision should trace back to it.
-If the user has already run /shape and has a confirmed design brief, skip this step and use the existing brief.
+If this craft run resumed after `teach` created PRODUCT.md, run shape now. Do not treat the teach interview, PRODUCT.md, or a summary of project context as a substitute for shape. Shape is task-specific and must cover scope, content/states, visual direction, constraints, anti-goals, probes when applicable, and explicit brief confirmation.
+
+If the user has already run $impeccable shape and has a confirmed design brief, skip this step and use the existing brief.
## Step 2: Load References
@@ -18,56 +47,147 @@ Based on the design brief's "Recommended References" section, consult the releva
- [typography.md](typography.md) for type hierarchy
Then add references based on the brief's needs:
-
- Complex interactions or forms? Consult [interaction-design.md](interaction-design.md)
- Animation or transitions? Consult [motion-design.md](motion-design.md)
- Color-heavy or themed? Consult [color-and-contrast.md](color-and-contrast.md)
- Responsive requirements? Consult [responsive-design.md](responsive-design.md)
- Heavy on copy, labels, or errors? Consult [ux-writing.md](ux-writing.md)
-## Step 3: Build
+## Step 3: Land the Visual Direction (Capability-Gated)
+
+Before implementation, generate high-fidelity visual comps when all of these are true:
+
+- The work is **net-new** or visually open-ended enough that composition exploration will improve the build.
+- The brief's scope is **mid-fi, high-fi, or production-ready**.
+- The current harness has **built-in image generation capability** (for example, Codex with a native image tool). Do **not** ask the user to set up external APIs, shell scripts, or one-off tooling just to do this.
+
+When those conditions are met, this step is mandatory for **both brand and product work** in Codex and any harness with built-in image generation. Use native image generation; in Codex, use the built-in `image_gen` tool via the imagegen skill. If image generation is unavailable, do not ask the user to install APIs or tooling. State in one line that the image step is skipped because the harness lacks native image generation, then proceed.
+
+Do not skip this step because the eventual UI should be semantic, editable, code-native, responsive, or accessible. Those are implementation requirements, not reasons to avoid visual exploration.
+
+### Purpose
+
+Use the mock step to find a stronger visual lane than code-first generation would reliably discover on its own. The brief remains authoritative on user, purpose, content, constraints, states, and anti-goals. The mock clarifies composition, hierarchy, density, typography, and visual tone.
+
+### What to generate
+
+Generate **1 to 3** high-fidelity north-star comps based on the confirmed brief. If shape already produced direction probes, use those results as input and generate a more resolved mock from the winning lane, not another unrelated exploration.
+
+- For brand work, push visual identity, composition, and mood aggressively.
+- For product work, still push hierarchy, topology, density, and tone, but keep the comps grounded in realistic product structure and states.
+- For landing pages and long-form brand surfaces, show enough of the next section or second fold to establish the system beyond the hero.
+
+The comps must be genuinely different in primary visual direction, not just color variants.
+
+### Approval loop
+
+Show the comps and ask what should carry forward. If the user asks for changes or the best direction is still weak, generate a focused revision before implementation. Continue until one direction is approved, or until the user explicitly delegates the choice.
-Implement the feature following the design brief. Work in this order:
+If the user delegates, pick the strongest direction and explain the decision using the brief, not personal taste.
-1. **Structure first**: HTML/semantic structure for the primary state. No styling yet.
-2. **Layout and spacing**: Establish the spatial rhythm and visual hierarchy.
-3. **Typography and color**: Apply the type scale and color system.
-4. **Interactive states**: Hover, focus, active, disabled.
-5. **Edge case states**: Empty, loading, error, overflow, first-run.
-6. **Motion**: Purposeful transitions and animations (if appropriate).
-7. **Responsive**: Adapt for different viewports. Don't just shrink; redesign for the context.
+Before moving to implementation, summarize:
-### During Build
+- What to carry into code
+- What **not** to literalize from the mock
-- Test with real (or realistic) data at every step, not placeholder text
-- Check each state as you build it, not all at the end
-- If you discover a design question, stop and ask rather than guessing
-- Every visual choice should trace back to something in the design brief
+This summary is required before Step 4. It is the handoff between visual exploration and semantic implementation.
-## Step 4: Visual Iteration
+### Mock fidelity inventory
+
+Before building, inventory the approved mock's major visible ingredients:
+
+- Hero silhouette and dominant composition.
+- Signature motifs: planets, devices, portraits, charts, route lines, insets, badges, or other memorable objects.
+- Nav and primary CTA treatment.
+- Section sequence visible in the mock, especially the second fold.
+- Image-native content the concept depends on.
+- Typography, density, color/material treatment, and motion cues.
+
+For each ingredient, decide how it will be implemented: semantic HTML/CSS/SVG, generated asset, sourced project asset, icon library, canvas/WebGL, or an explicitly accepted omission. Do not substitute a different hero composition or new visual driver after approval unless the user approves the change.
+
+Treat the mock as a **north star**, not a screenshot to trace. Do **not** rasterize core UI text or let the mock override the confirmed brief. But if the live result lacks the mock's major visible ingredients, the implementation is wrong.
+
+## Step 4: Asset Extraction (Need-Gated)
+
+If the chosen direction includes image-native visual ingredients that would materially improve the implementation, generate them as separate assets before building.
+
+Good candidates:
+
+- stickers
+- badges
+- seals
+- tickets
+- graphic labels
+- textures
+- abstract objects
+- decorative marks
+- non-semantic scene elements
+
+For travel, editorial, portfolio, venue, product showcase, entertainment, education, or any other image-led brand surface, visual assets are usually core content, not decoration. Do not ship abstract CSS panels where the approved mock or subject matter calls for real imagery, generated plates, illustrations, maps, product/object renders, or destination scenes.
+
+Do **not** export assets for core UI text, navigation, body copy, or any structure that should stay semantic and editable in code.
+
+Usually **1 to 5** extracted assets is enough. If the design can be built cleanly in HTML/CSS/SVG, prefer that over raster assets. If the mock contains major visual content that cannot be built credibly in code, asset extraction is not optional.
+
+## Step 5: Build to Production Quality
+
+Implement the feature following the design brief. Build in passes so structure, visual system, states, motion/media, and responsive behavior each get deliberate attention. The list below is the definition of done, not inspiration.
+
+### Production bar
+
+- Use real or realistic content. Remove placeholder copy, placeholder images, dead links, fake controls, and unused scaffold before presenting.
+- Preserve the approved mock's major ingredients. Missing hero objects, missing world/product imagery, different section structure, downgraded CTA/nav treatment, or generic replacements for distinctive motifs are blocking defects unless the user accepted the change.
+- Build semantically first: real headings, landmarks, labels, form associations, button/link semantics, accessible names, and state announcements where needed.
+- Calibrate spacing, alignment, grid placement, and vertical rhythm deliberately. Do not accept default gaps, arbitrary margins, unbalanced whitespace, or accidental optical misalignment.
+- Make typography intentional: chosen font loading strategy, clear hierarchy, readable measure, stable line breaks, tuned wrapping, and no overflow at mobile or large desktop sizes.
+- Design realistic state coverage: default, hover where supported, focus-visible, active, disabled, loading, error, success, empty, overflow, long text, short text, and first-run states where relevant.
+- Make interaction quality feel finished: keyboard paths, touch targets, feedback timing, scroll behavior, transitions between states, and no hover-only functionality.
+- Use icons from the project's established icon set when available. If no set exists, choose a coherent library or use accessible text controls; do not mix unrelated icon styles.
+- Optimize imagery and media: correct dimensions, useful alt text, lazy loading below the fold, modern formats when practical, responsive `srcset` / `picture` for raster assets, and no project-referenced asset left outside the workspace.
+- Make motion feel premium: use atmospheric blur, filter, mask, shadow, or reveal effects when they improve the experience; avoid casual layout-property animation, bound expensive effects, verify smoothness in-browser, respect reduced motion, and avoid choreography that blocks task completion.
+- Preserve maintainability: reusable local patterns, clear component boundaries, project conventions, no rasterized UI text, and no hard-coded one-off hacks when a better local pattern exists.
+- Fit the technical context: production build passes, no obvious console errors, no avoidable layout shift, no needless dependency, and no broken asset path.
+- If you discover a design question that materially changes the brief or approved direction, stop and ask rather than guessing.
+
+## Step 6: Browser-Based Iteration
**This step is critical.** Do not stop after the first implementation pass.
-Open the result in a browser window. If browser automation tools are available, use them to navigate to the page and visually inspect the result. If not, ask the user to open it and provide feedback.
+Open the result in a browser. In Codex, use browser-use or equivalent browser automation when available; otherwise use Playwright or ask the user for screenshots. Inspect screenshots, not just DOM or terminal output.
+
+### Required viewport pass
-Iterate through these checks visually:
+Check the experience at the viewports that matter for the brief. Default minimum:
+
+- Mobile narrow
+- Tablet or small laptop
+- Desktop wide
+
+For each viewport, capture or inspect the rendered state and look for visual defects: overlap, clipping, weak hierarchy, off-grid alignment, awkward whitespace, cramped controls, unreadable type, broken imagery, hover-only functionality, layout shift, and text overflow.
+
+### Critique and fix loop
+
+After the first browser pass, write a short critique for yourself and patch the implementation. Repeat browser inspection after fixes. Continue until no material issues remain against this checklist:
1. **Does it match the brief?** Compare the live result against every section of the design brief. Fix discrepancies.
-2. **Does it pass the AI slop test?** If someone saw this and said "AI made this," would they believe it immediately? If yes, it needs more design intention.
-3. **Check against impeccable's DON'T guidelines.** Fix any anti-pattern violations.
-4. **Check every state.** Navigate through empty, error, loading, and edge case states. Each one should feel intentional, not like an afterthought.
-5. **Check responsive.** Resize the viewport. Does it adapt well or just shrink?
-6. **Check the details.** Spacing consistency, type hierarchy clarity, color contrast, interactive feedback, motion timing.
+2. **Does it match the approved mock?** Compare screenshots against the mock fidelity inventory: hero silhouette, major motifs, imagery, nav/CTA, section sequence, density, color/materials, and second-fold substance. Missing major ingredients are P0 defects.
+3. **Does it pass the AI slop test?** If someone saw this and said "AI made this," would they believe it immediately? If yes, it needs more design intention.
+4. **Check against impeccable's DON'T guidelines.** Fix any anti-pattern violations.
+5. **Check every state.** Navigate through empty, error, loading, and edge case states. Each one should feel intentional, not like an afterthought.
+6. **Check responsive behavior.** The design should adapt compositionally, not merely shrink.
+7. **Check craft details.** Spacing consistency, optical alignment, type hierarchy, color contrast, image quality, icon coherence, interactive feedback, motion timing, and focus treatment.
+8. **Check performance basics.** No obviously oversized images, avoidable layout thrash, blocking animations, or heavy assets without a reason.
-After each round of fixes, visually verify again. **Repeat until you would be proud to show this to the user.** The bar is not "it works"; the bar is "this delights."
+The exit bar is not "it works." It is: the rendered result looks intentional at all checked viewports, all expected states are handled, no placeholders remain unless explicitly accepted, and the implementation quality would be defensible in a high-end studio review.
-## Step 5: Present
+## Step 7: Present
Present the result to the user:
-
- Show the feature in its primary state
+- Summarize the browser/viewports checked and the most important fixes made after inspection
- Walk through the key states (empty, error, responsive)
-- Explain design decisions that connect back to the design brief
+- Explain design decisions that connect back to the design brief and, when used, the chosen north-star mock. Include any accepted deviations from the mock; do not hide unimplemented mock ingredients.
+- Note any remaining limitations or follow-up risks honestly
- Ask: "What's working? What isn't?"
Iterate based on feedback. Good design is rarely right on the first pass.
diff --git a/.agents/skills/critique/SKILL.md b/.agents/skills/impeccable/reference/critique.md
similarity index 62%
rename from .agents/skills/critique/SKILL.md
rename to .agents/skills/impeccable/reference/critique.md
index 50d0017..82aeb3e 100644
--- a/.agents/skills/critique/SKILL.md
+++ b/.agents/skills/impeccable/reference/critique.md
@@ -1,54 +1,38 @@
----
-name: critique
-description: "Evaluate design from a UX perspective, assessing visual hierarchy, information architecture, emotional resonance, cognitive load, and overall quality with quantitative scoring, persona-based testing, automated anti-pattern detection, and actionable feedback. Use when the user asks to review, critique, evaluate, or give feedback on a design or component."
-version: 2.1.1
-user-invocable: true
-argument-hint: "[area (feature, page, component...)]"
----
+> **Additional context needed**: what the interface is trying to accomplish.
-## STEPS
+### Gather Assessments
-### Step 1: Preparation
+Launch two independent assessments. **Neither may see the other's output** — this isolation is what makes the combined score honest. Running both in one head silently anchors them to each other; do not shortcut it for cost, speed, or context-size reasons.
-Invoke /impeccable, which contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding. If no design context exists yet, you MUST run /impeccable teach first. Additionally gather: what the interface is trying to accomplish.
+Delegate each assessment to a separate sub-agent (Claude Code's `Agent` tool, Codex's subagent spawning, etc.). Each returns structured findings as text. Do NOT output findings to the user yet.
-### Step 2: Gather Assessments
-
-Launch two independent assessments. **Neither must see the other's output** to avoid bias.
-
-You SHOULD delegate each assessment to a separate sub-agent for independence. Use your environment's agent spawning mechanism (e.g., Claude Code's `Agent` tool, or Codex's subagent spawning). Sub-agents should return their findings as structured text. Do NOT output findings to the user yet.
-
-If sub-agents are not available in the current environment, complete each assessment sequentially, writing findings to internal notes before proceeding.
+Fall back to sequential in-head work only if the environment genuinely cannot spawn sub-agents.
**Tab isolation**: When browser automation is available, each assessment MUST create its own new tab. Never reuse an existing tab, even if one is already open at the correct URL. This prevents the two assessments from interfering with each other's page state.
#### Assessment A: LLM Design Review
Read the relevant source files (HTML, CSS, JS/TS) and, if browser automation is available, visually inspect the live page. **Create a new tab** for this; do not reuse existing tabs. After navigation, label the tab by setting the document title:
-
```javascript
-document.title = "[LLM] " + document.title;
+document.title = '[LLM] ' + document.title;
```
-
Think like a design director. Evaluate:
-**AI Slop Detection (CRITICAL)**: Does this look like every other AI-generated interface? Review against ALL **DON'T** guidelines in the impeccable skill. Check for AI color palette, gradient text, dark glows, glassmorphism, hero metric layouts, identical card grids, generic fonts, and all other tells. **The test**: If someone said "AI made this," would you believe them immediately?
+**AI Slop Detection (CRITICAL)**: Does this look like every other AI-generated interface? Review against ALL **DON'T** guidelines from the parent impeccable skill (already loaded in this context). Check for AI color palette, gradient text, dark glows, glassmorphism, hero metric layouts, identical card grids, generic fonts, and all other tells. **The test**: If someone said "AI made this," would you believe them immediately?
**Holistic Design Review**: visual hierarchy (eye flow, primary action clarity), information architecture (structure, grouping, cognitive load), emotional resonance (does it match brand and audience?), discoverability (are interactive elements obvious?), composition (balance, whitespace, rhythm), typography (hierarchy, readability, font choices), color (purposeful use, cohesion, accessibility), states & edge cases (empty, loading, error, success), microcopy (clarity, tone, helpfulness).
-**Cognitive Load** (consult [cognitive-load](reference/cognitive-load.md)):
-
+**Cognitive Load** (consult [cognitive-load](cognitive-load.md)):
- Run the 8-item cognitive load checklist. Report failure count: 0-1 = low (good), 2-3 = moderate, 4+ = critical.
- Count visible options at each decision point. If >4, flag it.
- Check for progressive disclosure: is complexity revealed only when needed?
**Emotional Journey**:
-
- What emotion does this interface evoke? Is that intentional?
- **Peak-end rule**: Is the most intense moment positive? Does the experience end well?
- **Emotional valleys**: Check for anxiety spikes at high-stakes moments (payment, delete, commit). Are there design interventions (progress indicators, reassurance copy, undo options)?
-**Nielsen's Heuristics** (consult [heuristics-scoring](reference/heuristics-scoring.md)):
+**Nielsen's Heuristics** (consult [heuristics-scoring](heuristics-scoring.md)):
Score each of the 10 heuristics 0-4. This scoring will be presented in the report.
Return structured findings covering: AI slop verdict, heuristic scores, cognitive load assessment, what's working (2-3 items), priority issues (3-5 with what/why/fix), minor observations, and provocative questions.
@@ -58,7 +42,6 @@ Return structured findings covering: AI slop verdict, heuristic scores, cognitiv
Run the bundled deterministic detector, which flags 25 specific patterns (AI slop tells + general design quality).
**CLI scan**:
-
```bash
npx impeccable --json [--fast] [target]
```
@@ -69,7 +52,7 @@ npx impeccable --json [--fast] [target]
- For 500+ files, narrow scope or ask the user
- Exit code 0 = clean, 2 = findings
-**Browser visualization** (when browser automation tools are available AND the target is a viewable page):
+**Browser visualization** — **required** when browser automation tools are available AND the target is a viewable page. The `[Human]` overlay tab is the user-facing deliverable; the critique is incomplete without it. Skip only if the target is not a viewable page (CSS-only file, non-browser target).
The overlay is a **visual aid for the user**. It highlights issues directly in their browser. Do NOT scroll through the page to screenshot overlays. Instead, read the console output to get the results programmatically.
@@ -81,14 +64,12 @@ The overlay is a **visual aid for the user**. It highlights issues directly in t
2. **Create a new tab** and navigate to the page (use dev server URL for local files, or direct URL). Do not reuse existing tabs.
3. **Label the tab** via `javascript_tool` so the user can distinguish it:
```javascript
- document.title = "[Human] " + document.title;
+ document.title = '[Human] ' + document.title;
```
4. **Scroll to top** to ensure the page is scrolled to the very top before injection
5. **Inject** via `javascript_tool` (replace PORT with the port from step 1):
```javascript
- const s = document.createElement("script");
- s.src = "http://localhost:PORT/detect.js";
- document.head.appendChild(s);
+ const s = document.createElement('script'); s.src = 'http://localhost:PORT/detect.js'; document.head.appendChild(s);
```
6. Wait 2-3 seconds for the detector to render overlays
7. **Read results from console** using `read_console_messages` with pattern `impeccable`. The detector logs all findings with the `[impeccable]` prefix. Do NOT scroll through the page to take screenshots of the overlays.
@@ -101,31 +82,30 @@ For multi-view targets, inject on 3-5 representative pages. If injection fails,
Return: CLI findings (JSON), browser console findings (if applicable), and any false positives noted.
-### Step 3: Generate Combined Critique Report
+### Generate Combined Critique Report
Synthesize both assessments into a single report. Do NOT simply concatenate. Weave the findings together, noting where the LLM review and detector agree, where the detector caught issues the LLM missed, and where detector findings are false positives.
Structure your feedback as a design director would:
#### Design Health Score
-
-> _Consult [heuristics-scoring](reference/heuristics-scoring.md)_
+> *Consult [heuristics-scoring](heuristics-scoring.md)*
Present the Nielsen's 10 heuristics scores as a table:
-| # | Heuristic | Score | Key Issue |
-| --------- | ------------------------------- | --------- | ------------------------------------ |
-| 1 | Visibility of System Status | ? | [specific finding or "n/a" if solid] |
-| 2 | Match System / Real World | ? | |
-| 3 | User Control and Freedom | ? | |
-| 4 | Consistency and Standards | ? | |
-| 5 | Error Prevention | ? | |
-| 6 | Recognition Rather Than Recall | ? | |
-| 7 | Flexibility and Efficiency | ? | |
-| 8 | Aesthetic and Minimalist Design | ? | |
-| 9 | Error Recovery | ? | |
-| 10 | Help and Documentation | ? | |
-| **Total** | | **??/40** | **[Rating band]** |
+| # | Heuristic | Score | Key Issue |
+|---|-----------|-------|-----------|
+| 1 | Visibility of System Status | ? | [specific finding or "n/a" if solid] |
+| 2 | Match System / Real World | ? | |
+| 3 | User Control and Freedom | ? | |
+| 4 | Consistency and Standards | ? | |
+| 5 | Error Prevention | ? | |
+| 6 | Recognition Rather Than Recall | ? | |
+| 7 | Flexibility and Efficiency | ? | |
+| 8 | Aesthetic and Minimalist Design | ? | |
+| 9 | Error Recovery | ? | |
+| 10 | Help and Documentation | ? | |
+| **Total** | | **??/40** | **[Rating band]** |
Be honest with scores. A 4 means genuinely excellent. Most real interfaces score 20-32.
@@ -140,29 +120,24 @@ Be honest with scores. A 4 means genuinely excellent. Most real interfaces score
**Visual overlays** (if browser was used): Tell the user that overlays are now visible in the **[Human]** tab in their browser, highlighting the detected issues. Summarize what the console output reported.
#### Overall Impression
-
A brief gut reaction: what works, what doesn't, and the single biggest opportunity.
#### What's Working
-
Highlight 2-3 things done well. Be specific about why they work.
#### Priority Issues
-
The 3-5 most impactful design problems, ordered by importance.
-For each issue, tag with **P0-P3 severity** (consult [heuristics-scoring](reference/heuristics-scoring.md) for severity definitions):
-
+For each issue, tag with **P0-P3 severity** (consult [heuristics-scoring](heuristics-scoring.md) for severity definitions):
- **[P?] What**: Name the problem clearly
- **Why it matters**: How this hurts users or undermines goals
- **Fix**: What to do about it (be concrete)
-- **Suggested command**: Which command could address this (from: /polish, /typeset, /colorize, /quieter, /critique, /overdrive, /clarify, /bolder, /audit, /distill, /harden, /layout, /shape, /animate, /optimize, /adapt, /delight)
+- **Suggested command**: Which command could address this (from: $impeccable adapt, $impeccable animate, $impeccable audit, $impeccable bolder, $impeccable clarify, $impeccable colorize, $impeccable critique, $impeccable delight, $impeccable distill, $impeccable document, $impeccable harden, $impeccable layout, $impeccable onboard, $impeccable optimize, $impeccable overdrive, $impeccable polish, $impeccable quieter, $impeccable shape, $impeccable typeset)
#### Persona Red Flags
+> *Consult [personas](personas.md)*
-> _Consult [personas](reference/personas.md)_
-
-Auto-select 2-3 personas most relevant to this interface type (use the selection table in the reference). If `.github/copilot-instructions.md` contains a `## Design Context` section from `impeccable teach`, also generate 1-2 project-specific personas from the audience/brand info.
+Auto-select 2-3 personas most relevant to this interface type (use the selection table in the reference). If `AGENTS.md` contains a `## Design Context` section from `impeccable teach`, also generate 1-2 project-specific personas from the audience/brand info.
For each selected persona, walk through the primary user action and list specific red flags found:
@@ -173,19 +148,15 @@ For each selected persona, walk through the primary user action and list specifi
Be specific. Name the exact elements and interactions that fail each persona. Don't write generic persona descriptions; write what broke for them.
#### Minor Observations
-
Quick notes on smaller issues worth addressing.
#### Questions to Consider
-
Provocative questions that might unlock better solutions:
-
- "What if the primary action were more prominent?"
- "Does this need to feel this complex?"
- "What would a confident version of this look like?"
**Remember**:
-
- Be direct. Vague feedback wastes everyone's time.
- Be specific. "The submit button," not "some elements."
- Say what's wrong AND why it matters to users.
@@ -193,9 +164,9 @@ Provocative questions that might unlock better solutions:
- Prioritize ruthlessly. If everything is important, nothing is.
- Don't soften criticism. Developers need honest feedback to ship great design.
-### Step 4: Ask the User
+### Ask the User
-**After presenting findings**, use targeted questions based on what was actually found. ask the user directly to clarify what you cannot infer. These answers will shape the action plan.
+**After presenting findings**, use targeted questions based on what was actually found. STOP and use Codex's structured user-input/question tool when available; if unavailable, ask directly in chat to clarify what you cannot infer. These answers will shape the action plan.
Ask questions along these lines (adapt to the specific findings; do NOT ask generic questions):
@@ -208,37 +179,35 @@ Ask questions along these lines (adapt to the specific findings; do NOT ask gene
4. **Constraints** (optional; only ask if relevant): If the findings touch many areas, ask if anything is off-limits. For example: "Should any sections stay as-is?" This prevents the plan from touching things the user considers done.
**Rules for questions**:
-
- Every question must reference specific findings from the report. Never ask generic "who is your audience?" questions.
- Keep it to 2-4 questions maximum. Respect the user's time.
- Offer concrete options, not open-ended prompts.
-- If findings are straightforward (e.g., only 1-2 clear issues), skip questions and go directly to Step 5.
+- If findings are straightforward (e.g., only 1-2 clear issues), skip questions and go directly to Recommended Actions.
-### Step 5: Recommended Actions
+### Recommended Actions
-**After receiving the user's answers**, present a prioritized action summary reflecting the user's priorities and scope from Step 4.
+**After receiving the user's answers**, present a prioritized action summary reflecting the user's priorities and scope from Ask the User.
#### Action Summary
List recommended commands in priority order, based on the user's answers:
-1. **`/command-name`**: Brief description of what to fix (specific context from critique findings)
-2. **`/command-name`**: Brief description (specific context)
- ...
+1. **`$command-name`**: Brief description of what to fix (specific context from critique findings)
+2. **`$command-name`**: Brief description (specific context)
+...
**Rules for recommendations**:
-
-- Only recommend commands from: /polish, /typeset, /colorize, /quieter, /critique, /overdrive, /clarify, /bolder, /audit, /distill, /harden, /layout, /shape, /animate, /optimize, /adapt, /delight
+- Only recommend commands from: $impeccable adapt, $impeccable animate, $impeccable audit, $impeccable bolder, $impeccable clarify, $impeccable colorize, $impeccable critique, $impeccable delight, $impeccable distill, $impeccable document, $impeccable harden, $impeccable layout, $impeccable onboard, $impeccable optimize, $impeccable overdrive, $impeccable polish, $impeccable quieter, $impeccable shape, $impeccable typeset
- Order by the user's stated priorities first, then by impact
- Each item's description should carry enough context that the command knows what to focus on
- Map each Priority Issue to the appropriate command
- Skip commands that would address zero issues
- If the user chose a limited scope, only include items within that scope
- If the user marked areas as off-limits, exclude commands that would touch those areas
-- End with `/polish` as the final step if any fixes were recommended
+- End with `$impeccable polish` as the final step if any fixes were recommended
After presenting the summary, tell the user:
> You can ask me to run these one at a time, all at once, or in any order you prefer.
>
-> Re-run `/critique` after fixes to see your score improve.
+> Re-run `$impeccable critique` after fixes to see your score improve.
diff --git a/.agents/skills/delight/SKILL.md b/.agents/skills/impeccable/reference/delight.md
similarity index 90%
rename from .agents/skills/delight/SKILL.md
rename to .agents/skills/impeccable/reference/delight.md
index 819c8bb..21fcd56 100644
--- a/.agents/skills/delight/SKILL.md
+++ b/.agents/skills/impeccable/reference/delight.md
@@ -1,16 +1,14 @@
----
-name: delight
-description: "Add moments of joy, personality, and unexpected touches that make interfaces memorable and enjoyable to use. Elevates functional to delightful. Use when the user asks to add polish, personality, animations, micro-interactions, delight, or make an interface feel fun or memorable."
-version: 2.1.1
-user-invocable: true
-argument-hint: "[target]"
----
+> **Additional context needed**: what's appropriate for the domain (playful vs professional vs quirky vs elegant).
Identify opportunities to add moments of joy, personality, and unexpected polish that transform functional interfaces into delightful experiences.
-## MANDATORY PREPARATION
+---
+
+## Register
+
+Brand: delight can be distributed — copy voice, section transitions, discovery rewards, seasonal touches, personality across the whole surface.
-Invoke /impeccable — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run /impeccable teach first. Additionally gather: what's appropriate for the domain (playful vs professional vs quirky vs elegant).
+Product: delight at specific moments, not pages. Completion, first-time actions, error recovery, milestone crossings. Reliability and consistency carry the rest of the experience; delight pushed everywhere reads as noise.
---
@@ -39,7 +37,7 @@ Identify where delight would enhance (not distract from) the experience:
- **Helpful surprises**: Anticipating needs before users ask (productivity tools)
- **Sensory richness**: Satisfying sounds, smooth animations (creative tools)
-If any of these are unclear from the codebase, ask the user directly to clarify what you cannot infer.
+If any of these are unclear from the codebase, STOP and use Codex's structured user-input/question tool when available; if unavailable, ask directly in chat to clarify what you cannot infer.
**CRITICAL**: Delight should enhance usability, never obscure it. If users notice the delight more than accomplishing their goal, you've gone too far.
@@ -48,28 +46,24 @@ If any of these are unclear from the codebase, ask the user directly to clarify
Follow these guidelines:
### Delight Amplifies, Never Blocks
-
- Delight moments should be quick (< 1 second)
- Never delay core functionality for delight
- Make delight skippable or subtle
- Respect user's time and task focus
### Surprise and Discovery
-
- Hide delightful details for users to discover
- Reward exploration and curiosity
- Don't announce every delight moment
- Let users share discoveries with others
### Appropriate to Context
-
- Match delight to emotional moment (celebrate success, empathize with errors)
- Respect the user's state (don't be playful during critical errors)
- Match brand personality and audience expectations
- Cultural sensitivity (what's delightful varies by culture)
### Compound Over Time
-
- Delight should remain fresh with repeated use
- Vary responses (not same animation every time)
- Reveal deeper layers with continued use
@@ -82,17 +76,14 @@ Add personality and joy through these methods:
### Micro-interactions & Animation
**Button delight**:
-
```css
/* Satisfying button press */
.button {
- transition:
- transform 0.1s,
- box-shadow 0.1s;
+ transition: transform 0.1s, box-shadow 0.1s;
}
.button:active {
transform: translateY(2px);
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
+ box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
/* Ripple effect on click */
@@ -104,21 +95,18 @@ Add personality and joy through these methods:
```
**Loading delight**:
-
- Playful loading animations (not just spinners)
- Personality in loading messages (write product-specific ones, not generic AI filler)
- Progress indication with encouraging messages
- Skeleton screens with subtle animations
**Success animations**:
-
- Checkmark draw animation
- Confetti burst for major achievements
- Gentle scale + fade for confirmation
- Satisfying sound effects (subtle)
**Hover surprises**:
-
- Icons that animate on hover
- Color shifts or glow effects
- Tooltip reveals with personality
@@ -127,7 +115,6 @@ Add personality and joy through these methods:
### Personality in Copy
**Playful error messages**:
-
```
"Error 404"
"This page is playing hide and seek. (And winning)"
@@ -137,7 +124,6 @@ Add personality and joy through these methods:
```
**Encouraging empty states**:
-
```
"No projects"
"Your canvas awaits. Create something amazing."
@@ -147,7 +133,6 @@ Add personality and joy through these methods:
```
**Playful labels & tooltips**:
-
```
"Delete"
"Send to void" (for playful brand)
@@ -161,21 +146,18 @@ Add personality and joy through these methods:
### Illustrations & Visual Personality
**Custom illustrations**:
-
- Empty state illustrations (not stock icons)
- Error state illustrations (friendly monsters, quirky characters)
- Loading state illustrations (animated characters)
- Success state illustrations (celebrations)
**Icon personality**:
-
- Custom icon set matching brand personality
- Animated icons (subtle motion on hover/click)
- Illustrative icons (more detailed than generic)
- Consistent style across all icons
**Background effects**:
-
- Subtle particle effects
- Gradient mesh backgrounds
- Geometric patterns
@@ -185,28 +167,24 @@ Add personality and joy through these methods:
### Satisfying Interactions
**Drag and drop delight**:
-
- Lift effect on drag (shadow, scale)
- Snap animation when dropped
- Satisfying placement sound
- Undo toast ("Dropped in wrong place? [Undo]")
**Toggle switches**:
-
- Smooth slide with spring physics
- Color transition
- Haptic feedback on mobile
- Optional sound effect
**Progress & achievements**:
-
- Streak counters with celebratory milestones
- Progress bars that "celebrate" at 100%
- Badge unlocks with animation
- Playful stats ("You're on fire! 5 days in a row")
**Form interactions**:
-
- Input fields that animate on focus
- Checkboxes with a satisfying scale pulse when checked
- Success state that celebrates valid input
@@ -215,7 +193,6 @@ Add personality and joy through these methods:
### Sound Design
**Subtle audio cues** (when appropriate):
-
- Notification sounds (distinctive but not annoying)
- Success sounds (satisfying "ding")
- Error sounds (empathetic, not harsh)
@@ -223,7 +200,6 @@ Add personality and joy through these methods:
- Ambient background audio (very subtle)
**IMPORTANT**:
-
- Respect system sound settings
- Provide mute option
- Keep volumes quiet (subtle cues, not alarms)
@@ -232,7 +208,6 @@ Add personality and joy through these methods:
### Easter Eggs & Hidden Delights
**Discovery rewards**:
-
- Konami code unlocks special theme
- Hidden keyboard shortcuts (Cmd+K for special features)
- Hover reveals on logos or illustrations
@@ -240,14 +215,12 @@ Add personality and joy through these methods:
- Console messages for developers ("Like what you see? We're hiring!")
**Seasonal touches**:
-
- Holiday themes (subtle, tasteful)
- Seasonal color shifts
- Weather-based variations
- Time-based changes (dark at night, light during day)
**Contextual personality**:
-
- Different messages based on time of day
- Responses to specific user actions
- Randomized variations (not same every time)
@@ -256,7 +229,6 @@ Add personality and joy through these methods:
### Loading & Waiting States
**Make waiting engaging**:
-
- Interesting loading messages that rotate
- Progress bars with personality
- Mini-games during long loads
@@ -276,7 +248,6 @@ Loading messages — write ones specific to your product, not generic AI filler:
### Celebration Moments
**Success celebrations**:
-
- Confetti for major milestones
- Animated checkmarks for completions
- Progress bar celebrations at 100%
@@ -284,7 +255,6 @@ Loading messages — write ones specific to your product, not generic AI filler:
- Personalized messages ("You published your 10th article!")
**Milestone recognition**:
-
- First-time actions get special treatment
- Streak tracking and celebration
- Progress toward goals
@@ -293,26 +263,22 @@ Loading messages — write ones specific to your product, not generic AI filler:
## Implementation Patterns
**Animation libraries**:
-
- Framer Motion (React)
- GSAP (universal)
- Lottie (After Effects animations)
- Canvas confetti (party effects)
**Sound libraries**:
-
- Howler.js (audio management)
- Use-sound (React hook)
**Physics libraries**:
-
- React Spring (spring physics)
- Popmotion (animation primitives)
**IMPORTANT**: File size matters. Compress images, optimize animations, lazy load delight features.
**NEVER**:
-
- Delay core functionality for delight
- Force users through delightful moments (make skippable)
- Use delight to hide poor UX
diff --git a/.agents/skills/distill/SKILL.md b/.agents/skills/impeccable/reference/distill.md
similarity index 89%
rename from .agents/skills/distill/SKILL.md
rename to .agents/skills/impeccable/reference/distill.md
index 9b0f7ab..2779b84 100644
--- a/.agents/skills/distill/SKILL.md
+++ b/.agents/skills/impeccable/reference/distill.md
@@ -1,16 +1,5 @@
----
-name: distill
-description: "Strip designs to their essence by removing unnecessary complexity. Great design is simple, powerful, and clean. Use when the user asks to simplify, declutter, reduce noise, remove elements, or make a UI cleaner and more focused."
-version: 2.1.1
-user-invocable: true
-argument-hint: "[target]"
----
-
Remove unnecessary complexity from designs, revealing the essential elements and creating clarity through ruthless simplification.
-## MANDATORY PREPARATION
-
-Invoke /impeccable — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run /impeccable teach first.
---
@@ -32,7 +21,7 @@ Analyze what makes the design feel complex or cluttered:
- What can be removed, hidden, or combined?
- What's the 20% that delivers 80% of value?
-If any of these are unclear from the codebase, ask the user directly to clarify what you cannot infer.
+If any of these are unclear from the codebase, STOP and use Codex's structured user-input/question tool when available; if unavailable, ask directly in chat to clarify what you cannot infer.
**CRITICAL**: Simplicity is not about removing features - it's about removing obstacles between users and their goals. Every element should justify its existence.
@@ -52,7 +41,6 @@ Create a ruthless editing strategy:
Systematically remove complexity across these dimensions:
### Information Architecture
-
- **Reduce scope**: Remove secondary actions, optional features, redundant information
- **Progressive disclosure**: Hide complexity behind clear entry points (accordions, modals, step-through flows)
- **Combine related actions**: Merge similar buttons, consolidate forms, group related content
@@ -60,7 +48,6 @@ Systematically remove complexity across these dimensions:
- **Remove redundancy**: If it's said elsewhere, don't repeat it here
### Visual Simplification
-
- **Reduce color palette**: Use 1-2 colors plus neutrals, not 5-7 colors
- **Limit typography**: One font family, 3-4 sizes maximum, 2-3 weights
- **Remove decorations**: Eliminate borders, shadows, backgrounds that don't serve hierarchy or function
@@ -69,7 +56,6 @@ Systematically remove complexity across these dimensions:
- **Consistent spacing**: Use one spacing scale, remove arbitrary gaps
### Layout Simplification
-
- **Linear flow**: Replace complex grids with simple vertical flow where possible
- **Remove sidebars**: Move secondary content inline or hide it
- **Full-width**: Use available space generously instead of complex multi-column layouts
@@ -77,7 +63,6 @@ Systematically remove complexity across these dimensions:
- **Generous white space**: Let content breathe, don't pack everything tight
### Interaction Simplification
-
- **Reduce choices**: Fewer buttons, fewer options, clearer path forward (paradox of choice is real)
- **Smart defaults**: Make common choices automatic, only ask when necessary
- **Inline actions**: Replace modal flows with inline editing where possible
@@ -85,7 +70,6 @@ Systematically remove complexity across these dimensions:
- **Clear CTAs**: ONE obvious next step, not five competing actions
### Content Simplification
-
- **Shorter copy**: Cut every sentence in half, then do it again
- **Active voice**: "Save changes" not "Changes will be saved"
- **Remove jargon**: Plain language always wins
@@ -94,14 +78,12 @@ Systematically remove complexity across these dimensions:
- **Remove redundant copy**: No headers restating intros, no repeated explanations, say it once
### Code Simplification
-
- **Remove unused code**: Dead CSS, unused components, orphaned files
- **Flatten component trees**: Reduce nesting depth
- **Consolidate styles**: Merge similar styles, use utilities consistently
- **Reduce variants**: Does that component need 12 variations, or can 3 cover 90% of cases?
**NEVER**:
-
- Remove necessary functionality (simplicity ≠ feature-less)
- Sacrifice accessibility for simplicity (clear labels and ARIA still required)
- Make things so simple they're unclear (mystery ≠ minimalism)
@@ -122,7 +104,6 @@ Ensure simplification improves usability:
## Document Removed Complexity
If you removed features or options:
-
- Document why they were removed
- Consider if they need alternative access points
- Note any user feedback to monitor
diff --git a/.agents/skills/impeccable/reference/document.md b/.agents/skills/impeccable/reference/document.md
new file mode 100644
index 0000000..9aba932
--- /dev/null
+++ b/.agents/skills/impeccable/reference/document.md
@@ -0,0 +1,427 @@
+Generate a `DESIGN.md` file at the project root that captures the current visual design system, so AI agents generating new screens stay on-brand.
+
+DESIGN.md follows the [official Google Stitch DESIGN.md format](https://stitch.withgoogle.com/docs/design-md/format/): YAML frontmatter carrying machine-readable design tokens, followed by a markdown body with exactly six sections in a fixed order. **Tokens are normative; prose provides context for how to apply them.** Sections may be omitted when not relevant, but **do not reorder them and do not rename them**. Section headers must match the spec character-for-character so the file stays parseable by other DESIGN.md-aware tools (Stitch itself, awesome-design-md, skill-rest, etc.).
+
+## The frontmatter: token schema
+
+The YAML frontmatter is the machine-readable layer. It's what Stitch's linter validates and what the live panel renders tiles from. Keep it tight; every entry should correspond to a token the project actually uses.
+
+```yaml
+---
+name:
+description:
+colors:
+ primary: "#b8422e"
+ neutral-bg: "#faf7f2"
+ # ...one entry per extracted color; key = descriptive slug
+typography:
+ display:
+ fontFamily: "Cormorant Garamond, Georgia, serif"
+ fontSize: "clamp(2.5rem, 7vw, 4.5rem)"
+ fontWeight: 300
+ lineHeight: 1
+ letterSpacing: "normal"
+ body:
+ # ...
+rounded:
+ sm: "4px"
+ md: "8px"
+spacing:
+ sm: "8px"
+ md: "16px"
+components:
+ button-primary:
+ backgroundColor: "{colors.primary}"
+ textColor: "{colors.neutral-bg}"
+ rounded: "{rounded.sm}"
+ padding: "16px 48px"
+ button-primary-hover:
+ backgroundColor: "{colors.primary-deep}"
+---
+```
+
+Rules that matter:
+
+- **Token refs** use `{path.to.token}` (e.g. `{colors.primary}`, `{rounded.md}`). Components may reference primitives; primitives may not reference each other.
+- **Stitch validates colors as hex sRGB only** (`#RGB` / `#RGBA` / `#RRGGBB` / `#RRGGBBAA`); OKLCH/HSL/P3 trigger a linter warning, not a hard error. YAML accepts the string either way and our own parser is format-agnostic. Choose based on project posture: (a) if the project has an "OKLCH-only" doctrine or uses Display-P3 values that don't round-trip through sRGB, put OKLCH directly in the frontmatter and accept the Stitch linter warning; (b) if the project wants strict Stitch compliance or plans to use their Tailwind/DTCG export pipeline, put hex in the frontmatter and keep OKLCH in prose as the canonical reference. Never split the source of truth without explicit reason.
+- **Component sub-tokens** are limited to 8 props: `backgroundColor`, `textColor`, `typography`, `rounded`, `padding`, `size`, `height`, `width`. Shadows, motion, focus rings, backdrop-filter — none of those fit. Carry them in the sidecar (Step 4b).
+- **Scale keys are open-ended.** Use whatever names the project already uses (`warm-ash-cream`, `surface-container-low`). Don't rename to Material defaults.
+- **Variants are naming convention, not schema.** `button-primary` / `button-primary-hover` / `button-primary-active` as sibling keys.
+
+## The markdown body: six sections (exact order)
+
+1. `## Overview`
+2. `## Colors`
+3. `## Typography`
+4. `## Elevation`
+5. `## Components`
+6. `## Do's and Don'ts`
+
+Optional evocative subtitles are allowed in the form `## 2. Colors: The [Name] Palette` — Stitch's own outputs do this — but the literal word in each header (Overview, Colors, Typography, Elevation, Components, Do's and Don'ts) must be present. Do NOT add extra top-level sections (Layout Principles, Responsive Behavior, Motion, Agent Prompt Guide). Fold that content into the six spec sections where it naturally belongs.
+
+## When to run
+
+- The user just ran `$impeccable teach` and needs the visual side documented.
+- The skill noticed no `DESIGN.md` exists and nudged the user to create one.
+- An existing `DESIGN.md` is stale (the design has drifted).
+- Before a large redesign, to capture the current state as a reference.
+
+If a `DESIGN.md` already exists, **do not silently overwrite it**. Show the user the existing file and STOP and use Codex's structured user-input/question tool when available; if unavailable, ask directly in chat to clarify what you cannot infer. whether to refresh, overwrite, or merge.
+
+## Two paths
+
+- **Scan mode** (default): the project has design tokens, components, or rendered output. Extract, then confirm descriptive language. Use when there's code to analyze.
+- **Seed mode**: the project is pre-implementation (fresh teach, nothing built yet). Interview for five high-level answers, write a minimal DESIGN.md marked ``. Re-run in scan mode once there's code.
+
+Decide by scanning first (Scan mode Step 1). If the scan finds no tokens, no component files, and no rendered site, offer seed mode — don't silently switch. `$impeccable document --seed` forces seed mode regardless of code presence.
+
+## Scan mode (approach C: auto-extract, then confirm descriptive language)
+
+### Step 1: Find the design assets
+
+Search the codebase in priority order:
+
+1. **CSS custom properties** — grep for `--color-`, `--font-`, `--spacing-`, `--radius-`, `--shadow-`, `--ease-`, `--duration-` declarations in CSS files (usually `src/styles/`, `public/css/`, `app/globals.css`, etc.). Record name, value, and the file it's defined in.
+2. **Tailwind config** — if `tailwind.config.{js,ts,mjs}` exists, read the `theme.extend` block for colors, fontFamily, spacing, borderRadius, boxShadow.
+3. **CSS-in-JS theme files** — styled-components, emotion, vanilla-extract, stitches: look for `theme.ts`, `tokens.ts`, or equivalent.
+4. **Design token files** — `tokens.json`, `design-tokens.json`, Style Dictionary output, W3C token community group format.
+5. **Component library** — scan the main button, card, input, navigation, dialog components. Note their variant APIs and default styles.
+6. **Global stylesheet** — the root CSS file usually has the base typography and color assignments.
+7. **Visible rendered output** — if browser automation tools are available, load the live site and sample computed styles from key elements (body, h1, a, button, .card). This catches values that tokens miss.
+
+### Step 2: Auto-extract what can be auto-extracted
+
+Build a structured draft from the discovered tokens. For each token class:
+
+- **Colors**: Group into Primary / Secondary / Tertiary / Neutral (the Material-derived roles Stitch uses). If the project only has one accent, express it as Primary + Neutral — omit Secondary and Tertiary rather than inventing them.
+- **Typography**: Map observed sizes and weights to the Material hierarchy (display / headline / title / body / label). Note font-family stacks and the scale ratio.
+- **Elevation**: Catalogue the shadow vocabulary. If the project is flat and uses tonal layering instead, that's a valid answer — state it explicitly.
+- **Components**: For each common component (button, card, input, chip, list item, tooltip, nav), extract shape (radius), color assignment, hover/focus treatment, internal padding.
+- **Spacing + layout**: Fold into Overview or relevant Components. The spec does NOT have a Layout section.
+
+### Step 2b: Stage the frontmatter
+
+From the auto-extracted tokens, draft the YAML frontmatter now (you'll write it at the top of DESIGN.md in Step 4). This is the machine-readable layer — what the live panel and Stitch's linter consume.
+
+- **Colors**: one entry per extracted color. Key = descriptive slug (`warm-ash-cream`, `editorial-magenta`, not `blue-800`). Value = whichever format the project treats as canonical (OKLCH or hex — see the frontmatter rules above). Don't split the source of truth: one format in the frontmatter, don't redefine the same token in prose with a different value.
+- **Typography**: one entry per role (`display`, `headline`, `title`, `body`, `label`). Typography is an object; include only the props that are real for the project (`fontFamily`, `fontSize`, `fontWeight`, `lineHeight`, `letterSpacing`, `fontFeature`, `fontVariation`).
+- **Rounded / Spacing**: whatever scale steps the project actually uses, keyed by whatever scale name the project uses (`sm` / `md` / `lg`, or `surface-sm`, or numeric steps).
+- **Components**: one entry per variant (`button-primary`, `button-primary-hover`, `button-ghost`). Reference primitives via `{colors.X}`, `{rounded.Y}`. If a variant needs a property Stitch's 8-prop set doesn't cover (shadow, focus ring, backdrop-filter), carry the full snippet in the sidecar instead.
+
+Skip anything the project doesn't have. Empty scale keys or fabricated tokens pollute the spec.
+
+### Step 3: Ask the user for qualitative language
+
+The following require creative input that cannot be auto-extracted. Group them into one `AskUserQuestion` interaction:
+
+- **Creative North Star**: a single named metaphor for the whole system ("The Editorial Sanctuary", "The Golden State Curator", "The Lab Notebook"). Offer 2-3 options that honor PRODUCT.md's brand personality.
+- **Overview voice**: mood adjectives, aesthetic philosophy in 2-3 sentences, anti-references (what the system should not feel like).
+- **Color character** (for auto-extracted colors): descriptive names ("Deep Muted Teal-Navy", not "blue-800"). Suggest 2-3 options per key color based on hue/saturation.
+- **Elevation philosophy**: flat/layered/lifted. If shadows exist, is their role ambient or structural?
+- **Component philosophy**: the feel of buttons, cards, inputs in one phrase ("tactile and confident" vs. "refined and restrained").
+
+Quote a line from PRODUCT.md when possible so the user sees their own strategic language carry forward.
+
+### Step 4: Write DESIGN.md
+
+The file opens with the YAML frontmatter staged in Step 2b (schema documented at the top of this reference), then the markdown body using the structure below. Headers must match character-for-character. Optional evocative subtitles (e.g. `## 2. Colors: The Coastal Palette`) are allowed.
+
+```markdown
+---
+name: [Project Title]
+description: [one-line tagline]
+colors:
+ # ... staged frontmatter from Step 2b
+---
+
+# Design System: [Project Title]
+
+## 1. Overview
+
+**Creative North Star: "[Named metaphor in quotes]"**
+
+[2-3 paragraph holistic description: personality, density, aesthetic philosophy. Start from the North Star and work outward. State what this system explicitly rejects (pulled from PRODUCT.md's anti-references). End with a short **Key Characteristics:** bullet list.]
+
+## 2. Colors
+
+[Describe the palette character in one sentence.]
+
+### Primary
+- **[Descriptive Name]** (#HEX / oklch(...)): [Where and why this color is used. Be specific about context, not just role.]
+
+### Secondary (optional — omit if the project has only one accent)
+- **[Descriptive Name]** (#HEX): [Role.]
+
+### Tertiary (optional)
+- **[Descriptive Name]** (#HEX): [Role.]
+
+### Neutral
+- **[Descriptive Name]** (#HEX): [Text / background / border / divider role.]
+- [...]
+
+### Named Rules (optional, powerful)
+**The [Rule Name] Rule.** [Short, forceful prohibition or doctrine — e.g. "The One Voice Rule. The primary accent is used on ≤10% of any given screen. Its rarity is the point."]
+
+## 3. Typography
+
+**Display Font:** [Family] (with [fallback])
+**Body Font:** [Family] (with [fallback])
+**Label/Mono Font:** [Family, if distinct]
+
+**Character:** [1-2 sentence personality description of the pairing.]
+
+### Hierarchy
+- **Display** ([weight], [size/clamp], [line-height]): [Purpose — where it appears.]
+- **Headline** ([weight], [size], [line-height]): [Purpose.]
+- **Title** ([weight], [size], [line-height]): [Purpose.]
+- **Body** ([weight], [size], [line-height]): [Purpose. Include max line length like 65–75ch if relevant.]
+- **Label** ([weight], [size], [letter-spacing], [case if uppercase]): [Purpose.]
+
+### Named Rules (optional)
+**The [Rule Name] Rule.** [Short doctrine about type use.]
+
+## 4. Elevation
+
+[One paragraph: does this system use shadows, tonal layering, or a hybrid? If "no shadows", say so explicitly and describe how depth is conveyed instead.]
+
+### Shadow Vocabulary (if applicable)
+- **[Role name]** (`box-shadow: [exact value]`): [When to use it.]
+- [...]
+
+### Named Rules (optional)
+**The [Rule Name] Rule.** [e.g. "The Flat-By-Default Rule. Surfaces are flat at rest. Shadows appear only as a response to state (hover, elevation, focus)."]
+
+## 5. Components
+
+For each component, lead with a short character line, then specify shape, color assignment, states, and any distinctive behavior.
+
+### Buttons
+- **Shape:** [radius described, exact value in parens]
+- **Primary:** [color assignment + padding, in semantic + exact terms]
+- **Hover / Focus:** [transitions, treatments]
+- **Secondary / Ghost / Tertiary (if applicable):** [brief description]
+
+### Chips (if used)
+- **Style:** [background, text color, border treatment]
+- **State:** [selected / unselected, filter / action variants]
+
+### Cards / Containers
+- **Corner Style:** [radius]
+- **Background:** [colors used]
+- **Shadow Strategy:** [reference Elevation section]
+- **Border:** [if any]
+- **Internal Padding:** [scale]
+
+### Inputs / Fields
+- **Style:** [stroke, background, radius]
+- **Focus:** [treatment — glow, border shift, etc.]
+- **Error / Disabled:** [if applicable]
+
+### Navigation
+- **Style, typography, default/hover/active states, mobile treatment.**
+
+### [Signature Component] (optional — if the project has a distinctive custom component worth documenting)
+[Description.]
+
+## 6. Do's and Don'ts
+
+Concrete, forceful guardrails. Lead each with "Do" or "Don't". Be specific — include exact colors, pixel values, and named anti-patterns the user mentioned in PRODUCT.md. **Every anti-reference in PRODUCT.md should show up here as a "Don't" with the same language**, so the visual spec carries the strategic line through. Quote PRODUCT.md directly where possible: if PRODUCT.md says *"avoid dark mode with purple gradients, neon accents, glassmorphism"*, the Don'ts here should repeat that by name.
+
+### Do:
+- **Do** [specific prescription with exact values / named rule].
+- **Do** [...]
+
+### Don't:
+- **Don't** [specific prohibition — e.g. "use border-left greater than 1px as a colored stripe"].
+- **Don't** [...]
+- **Don't** [...]
+```
+
+### Step 4b: Write DESIGN.json sidecar (extensions only)
+
+The frontmatter owns token primitives (colors, typography, rounded, spacing, components). The sidecar at `DESIGN.json` carries **what Stitch's schema can't hold**: tonal ramps per color, shadow/elevation tokens, motion tokens, breakpoints, full component HTML/CSS snippets (the panel renders these into a shadow DOM), and narrative (north star, rules, do's/don'ts). It extends the frontmatter, it doesn't duplicate it.
+
+Regenerate the sidecar whenever you regenerate DESIGN.md. If the user only asks to refresh the sidecar (e.g., from the live panel's stale-hint), preserve DESIGN.md and write only DESIGN.json.
+
+#### Schema
+
+```json
+{
+ "schemaVersion": 2,
+ "generatedAt": "ISO-8601 string",
+ "title": "Design System: [Project Title]",
+ "extensions": {
+ "colorMeta": {
+ "primary": { "role": "primary", "displayName": "Editorial Magenta", "canonical": "oklch(60% 0.25 350)", "tonalRamp": ["...", "...", "..."] },
+ "warm-ash-cream": { "role": "neutral", "displayName": "Warm Ash Cream", "canonical": "oklch(96% 0.005 350)", "tonalRamp": ["...", "...", "..."] }
+ },
+ "typographyMeta": {
+ "display": { "displayName": "Display", "purpose": "Hero headlines only." }
+ },
+ "shadows": [
+ { "name": "ambient-low", "value": "0 4px 24px rgba(0,0,0,0.12)", "purpose": "Diffuse hover glow under accent elements." }
+ ],
+ "motion": [
+ { "name": "ease-standard", "value": "cubic-bezier(0.4, 0, 0.2, 1)", "purpose": "Default easing for state transitions." }
+ ],
+ "breakpoints": [
+ { "name": "sm", "value": "640px" }
+ ]
+ },
+ "components": [
+ {
+ "name": "Primary Button",
+ "kind": "button | input | nav | chip | card | custom",
+ "refersTo": "button-primary",
+ "description": "One-line what and when.",
+ "html": "",
+ "css": ".ds-btn-primary { background: #191c1d; color: #fff; padding: 16px 48px; letter-spacing: 0.05em; text-transform: uppercase; font-weight: 500; border: none; border-radius: 0; transition: background 0.2s, transform 0.2s; } .ds-btn-primary:hover { background: oklch(60% 0.25 350); transform: translateY(-2px); }"
+ }
+ ],
+ "narrative": {
+ "northStar": "The Editorial Sanctuary",
+ "overview": "2-3 paragraphs of the philosophy — pulled from DESIGN.md Overview section.",
+ "keyCharacteristics": ["...", "..."],
+ "rules": [{ "name": "The One Voice Rule", "body": "...", "section": "colors|typography|elevation" }],
+ "dos": ["Do use ..."],
+ "donts": ["Don't use ..."]
+ }
+}
+```
+
+**What changed from schemaVersion 1.** The old sidecar carried token primitive arrays (`tokens.colors[]`, `tokens.typography[]`, etc.). Those values now live in the frontmatter. The sidecar only carries metadata that can't live in the frontmatter — tonal ramps, canonical OKLCH when the hex is an approximation, display names, role hints — keyed by the frontmatter token name (`colorMeta.`, `typographyMeta.`). Components still carry full HTML/CSS because Stitch's 8-prop set can't hold them.
+
+#### Component translation rules
+
+The `html` and `css` fields must be **self-contained, drop-in snippets** that render correctly when injected into a shadow DOM. The panel applies them directly — no post-processing, no framework runtime.
+
+1. **Tailwind expansion.** If the source uses Tailwind (className="bg-primary text-white rounded-lg px-6 py-3"), expand every utility to literal CSS properties in the `css` string. Do **not** reference Tailwind classes; do **not** assume a Tailwind CSS bundle is loaded. Each component is self-contained.
+2. **Token resolution.** If the project exposes tokens as CSS custom properties on `:root` (e.g. `--color-primary`, `--radius-md`), reference them via `var(--color-primary)` — they inherit through the shadow DOM and stay live-bound. If tokens live only in JS theme objects (styled-components, CSS-in-JS), resolve to literal values at generation time.
+3. **Icons.** Inline as SVG. Do not reference Lucide/Heroicons packages, icon fonts, or ``. A typical icon is 16-24px; copy the SVG path data directly.
+4. **States.** Include `:hover`, `:focus-visible`, and (if meaningful) `:active` rules inline. A static default-only snapshot makes the panel feel dead. Hover + focus rules in the CSS make it feel alive.
+5. **Reset bloat.** Extract only the component's *distinctive* CSS (background, color, padding, border-radius, typography, transition). Skip universal resets (`box-sizing: border-box`, `line-height: inherit`, `-webkit-font-smoothing`). The panel already has a neutral canvas; don't re-ship resets.
+6. **Scoped class names.** Prefix every class with `ds-` (e.g. `ds-btn-primary`, `ds-input-search`) so component CSS doesn't collide with other components' CSS in the same shadow DOM.
+
+#### What to include
+
+Aim for a tight set of **5-10 components** that best represent the visual system:
+
+- **Canonical primitives (always include if the project has them):** button (each variant as a separate component entry), input/text field, navigation, chip/tag, card.
+- **Signature components (include if distinctive):** hero CTA, featured card, filter pill, any custom pattern the user mentioned as important in PRODUCT.md.
+- **Skip the rest.** Utility components, form building blocks, wrapper layouts — not worth documenting unless visually distinctive.
+
+If the project has **no component library yet** (bare landing page, new project), synthesize canonical primitives from the tokens using best-practice defaults consistent with the DESIGN.md's rules. Every DESIGN.json has *something* to render, even on day zero.
+
+#### Tonal ramps
+
+For each color token, generate an 8-step `tonalRamp` array — dark to light, same hue and chroma, stepped lightness from ~15% to ~95%. The panel renders this as a strip under the swatch. If the project already defines a tonal scale (Material `surface-container-low` family, Tailwind-style `blue-50..blue-900`), use those values. Otherwise synthesize in OKLCH.
+
+#### Narrative mapping
+
+Pull directly from the DESIGN.md you just wrote:
+
+- `narrative.northStar` → the `**Creative North Star: "..."**` line from Overview
+- `narrative.overview` → the philosophy paragraphs from Overview
+- `narrative.keyCharacteristics` → the bulleted `**Key Characteristics:**` list
+- `narrative.rules` → every `**The [Name] Rule.** [body]` across all sections, tagged with `section`
+- `narrative.dos` / `narrative.donts` → the bullet lists from Do's and Don'ts verbatim
+
+Do not reword. The panel shows these as secondary collapsible context; the same voice that's in the Markdown carries through.
+
+### Step 5: Confirm, refine, and refresh session cache
+
+1. Show the user the full DESIGN.md you wrote. Briefly highlight the non-obvious creative choices (descriptive color names, atmosphere language, named rules).
+2. Mention that `DESIGN.json` was also written alongside — the live panel will now render this project's actual button/input/nav primitives instead of generic approximations.
+3. Offer to refine any section: "Want me to revise a section, add component patterns I missed, or adjust the atmosphere language?"
+4. **Refresh the session cache.** Run `node .agents/skills/impeccable/scripts/load-context.mjs` one final time so the newly-written DESIGN.md lands in conversation. Subsequent commands in this session will use the fresh version automatically without re-reading.
+
+## Seed mode
+
+For projects with no visual system to extract yet. Produces a minimal scaffold, not a full spec.
+
+### Step 1: Confirm seed mode
+
+Before interviewing: "There's no existing visual system to scan. I'll ask five quick questions to seed a starter DESIGN.md. You can re-run `$impeccable document` once there's code, to capture the real tokens and components. OK?"
+
+If the user prefers to skip, stop. No file.
+
+### Step 2: Five questions
+
+Group into one `AskUserQuestion` interaction. Options must be concrete.
+
+1. **Color strategy.** Pick one:
+ - Restrained — tinted neutrals + one accent ≤10%
+ - Committed — one saturated color carries 30–60% of the surface
+ - Full palette — 3–4 named color roles, each deliberate
+ - Drenched — the surface IS the color
+
+ Then: one hue family or anchor reference ("deep teal", "mustard", "Klim #ff4500 orange").
+
+2. **Typography direction.** Pick one (specific fonts come later):
+ - Serif display + sans body
+ - Single sans (warm / technical / geometric / humanist — pick a feel)
+ - Display + mono
+ - Mono-forward
+ - Editorial script + sans
+
+3. **Motion energy.** Pick one:
+ - Restrained — state changes only
+ - Responsive — feedback + transitions, no choreography
+ - Choreographed — orchestrated entrances, scroll-driven sequences
+
+4. **Three named references.** Brands, products, printed objects. Not adjectives.
+
+5. **One anti-reference.** What it should NOT feel like. Also named.
+
+### Step 3: Write seed DESIGN.md
+
+Use the six-section spec from Scan mode. Populate what the interview answers; leave the rest as honest placeholders. The seed is a scaffold, not a fabricated spec.
+
+Lead the file with:
+
+```markdown
+
+```
+
+Per-section guidance in seed mode:
+
+- **Overview**: Creative North Star and philosophy phrased from the answers (color strategy + motion energy + references). Reference the user's anti-reference directly.
+- **Colors**: Color strategy as a Named Rule (e.g. *"The Drenched Rule. The surface IS the color."*). Hue family or anchor reference. No hex values — mark as `[to be resolved during implementation]`.
+- **Typography**: the direction the user picked (e.g. "Serif display + sans body"). No font names yet — `[font pairing to be chosen at implementation]`.
+- **Elevation**: inferred from motion energy. Restrained/Responsive → flat by default; Choreographed → layered. One sentence.
+- **Components**: omit entirely — no components exist yet.
+- **Do's and Don'ts**: carry PRODUCT.md's anti-references directly plus the anti-reference named in Q5.
+
+Seed mode writes a minimal frontmatter with `name` and `description` only — no colors, typography, rounded, spacing, or components yet. Real tokens land on the next Scan-mode run. Skip the `DESIGN.json` sidecar in seed mode for the same reason: nothing to render.
+
+### Step 4: Confirm and refresh session cache
+
+1. Show the seed DESIGN.md. Call out that it is a seed (the marker is the literal commitment).
+2. Tell the user: "Re-run `$impeccable document` once you have some code. That pass will extract real tokens and generate the sidecar."
+3. Run `node .agents/skills/impeccable/scripts/load-context.mjs` once so the seed lands in conversation for the rest of the session.
+
+## Style guidelines
+
+- **Frontmatter first, prose second.** Tokens go in the YAML frontmatter; prose contextualizes them. Don't redefine a token value in two places — the frontmatter is normative.
+- **Cite PRODUCT.md anti-references by name** in the Do's and Don'ts section. If PRODUCT.md lists "SaaS landing-page clichés" or "generic AI tool marketing" as anti-references, the DESIGN.md Don'ts should repeat those phrases verbatim so the visual spec enforces the strategic line.
+- **Match the spec, don't invent new sections.** The six section names are fixed. If you have Layout/Motion/Responsive content to document, fold it into Overview (philosophy-level rules) or Components (per-component behavior).
+- **Descriptive > technical**: "Gently curved edges (8px radius)" > "rounded-lg". Include the technical value in parens, lead with the description.
+- **Functional > decorative**: for each token, explain WHERE and WHY it's used, not just WHAT it is.
+- **Exact values in parens**: hex codes, px/rem values, font weights — always the number in parens alongside the description.
+- **Use Named Rules**: `**The [Name] Rule.** [short doctrine]`. These are memorable, citable, and much stickier for AI consumers than bullet lists. Stitch's own outputs use them heavily ("The No-Line Rule", "The Ghost Border Fallback"). Aim for 1-3 per section.
+- **Be forceful**. The voice of a design director. "Prohibited", "forbidden", "never", "always" — not "consider", "might", "prefer". Match PRODUCT.md's tone.
+- **Concrete anti-pattern tests**. Stitch writes things like *"If it looks like a 2014 app, the shadow is too dark and the blur is too small."* A one-sentence audit test beats a paragraph of principle.
+- **Reference PRODUCT.md**. The anti-references section of PRODUCT.md should directly inform the Do's and Don'ts section here. Quote or paraphrase.
+- **Group colors by role**, not by hex-order or hue-order. Primary / Secondary / Tertiary / Neutral is the spec ordering.
+
+## Pitfalls
+
+- Don't paste raw CSS class names. Translate to descriptive language.
+- Don't extract every token. Stop at what's actually reused — one-offs pollute the system.
+- Don't invent components that don't exist. If the project only has buttons and cards, only document those.
+- Don't overwrite an existing DESIGN.md without asking.
+- Don't duplicate content from PRODUCT.md. DESIGN.md is strictly visual.
+- Don't add a "Layout Principles" or "Motion" or "Responsive Behavior" top-level section. The spec has six, not nine. Fold that content where it belongs.
+- Don't rename sections even slightly. "Colors" not "Color Palette & Roles". "Typography" not "Typography Rules". Tooling parsing depends on exact headers.
+- Don't duplicate token values between frontmatter and prose. If a color is in `colors.primary` as hex, the prose can name it and describe its role but should not reassert a different hex. The frontmatter is normative.
+- Don't invent frontmatter token groups outside Stitch's schema (no `motion:`, `breakpoints:`, `shadows:` at the top level). Stitch's Zod schema only accepts `colors`, `typography`, `rounded`, `spacing`, `components`. Anything else belongs in the sidecar's `extensions`.
diff --git a/.agents/skills/impeccable/reference/extract.md b/.agents/skills/impeccable/reference/extract.md
index 5324c50..5c573e0 100644
--- a/.agents/skills/impeccable/reference/extract.md
+++ b/.agents/skills/impeccable/reference/extract.md
@@ -6,7 +6,7 @@ Identify reusable patterns, components, and design tokens, then extract and cons
Find the design system, component library, or shared UI directory. Understand its structure: component organization, naming conventions, design token structure, import/export conventions.
-**CRITICAL**: If no design system exists, ask the user directly to clarify what you cannot infer. before creating one. Understand the preferred location and structure first.
+**CRITICAL**: If no design system exists, STOP and use Codex's structured user-input/question tool when available; if unavailable, ask directly in chat to clarify what you cannot infer. before creating one. Understand the preferred location and structure first.
## Step 2: Identify Patterns
@@ -60,7 +60,6 @@ Update design system documentation:
- Update any Storybook or component catalog
**NEVER**:
-
- Extract one-off, context-specific implementations without generalization
- Create components so generic they are useless
- Extract without considering existing design system conventions
diff --git a/.agents/skills/harden/SKILL.md b/.agents/skills/impeccable/reference/harden.md
similarity index 75%
rename from .agents/skills/harden/SKILL.md
rename to .agents/skills/impeccable/reference/harden.md
index f901306..a27c669 100644
--- a/.agents/skills/harden/SKILL.md
+++ b/.agents/skills/impeccable/reference/harden.md
@@ -1,11 +1,3 @@
----
-name: harden
-description: "Make interfaces production-ready: error handling, empty states, onboarding flows, i18n, text overflow, and edge case management. Use when the user asks to harden, make production-ready, handle edge cases, add error states, design empty states, improve onboarding, or fix overflow and i18n issues."
-version: 2.1.1
-user-invocable: true
-argument-hint: "[target]"
----
-
Strengthen interfaces against edge cases, errors, internationalization issues, and real-world usage scenarios that break idealized designs.
## Assess Hardening Needs
@@ -45,7 +37,6 @@ Systematically improve resilience:
### Text Overflow & Wrapping
**Long text handling**:
-
```css
/* Single line with ellipsis */
.truncate {
@@ -71,7 +62,6 @@ Systematically improve resilience:
```
**Flex/Grid overflow**:
-
```css
/* Prevent flex items from overflowing */
.flex-item {
@@ -87,7 +77,6 @@ Systematically improve resilience:
```
**Responsive text sizing**:
-
- Use `clamp()` for fluid typography
- Set minimum readable sizes (14px on mobile)
- Test text scaling (zoom to 200%)
@@ -96,7 +85,6 @@ Systematically improve resilience:
### Internationalization (i18n)
**Text expansion**:
-
- Add 30-40% space budget for translations
- Use flexbox/grid that adapts to content
- Test with longest language (usually German)
@@ -111,7 +99,6 @@ Systematically improve resilience:
```
**RTL (Right-to-Left) support**:
-
```css
/* Use logical properties */
margin-inline-start: 1rem; /* Not margin-left */
@@ -119,45 +106,39 @@ padding-inline: 1rem; /* Not padding-left/right */
border-inline-end: 1px solid; /* Not border-right */
/* Or use dir attribute */
-[dir="rtl"] .arrow {
- transform: scaleX(-1);
-}
+[dir="rtl"] .arrow { transform: scaleX(-1); }
```
**Character set support**:
-
- Use UTF-8 encoding everywhere
- Test with Chinese/Japanese/Korean (CJK) characters
- Test with emoji (they can be 2-4 bytes)
- Handle different scripts (Latin, Cyrillic, Arabic, etc.)
**Date/Time formatting**:
-
```javascript
// ✅ Use Intl API for proper formatting
-new Intl.DateTimeFormat("en-US").format(date); // 1/15/2024
-new Intl.DateTimeFormat("de-DE").format(date); // 15.1.2024
+new Intl.DateTimeFormat('en-US').format(date); // 1/15/2024
+new Intl.DateTimeFormat('de-DE').format(date); // 15.1.2024
-new Intl.NumberFormat("en-US", {
- style: "currency",
- currency: "USD",
+new Intl.NumberFormat('en-US', {
+ style: 'currency',
+ currency: 'USD'
}).format(1234.56); // $1,234.56
```
**Pluralization**:
-
```javascript
// ❌ Bad: Assumes English pluralization
-`${count} item${count !== 1 ? "s" : ""}`;
+`${count} item${count !== 1 ? 's' : ''}`
// ✅ Good: Use proper i18n library
-t("items", { count }); // Handles complex plural rules
+t('items', { count }) // Handles complex plural rules
```
### Error Handling
**Network errors**:
-
- Show clear error messages
- Provide retry button
- Explain what happened
@@ -166,18 +147,15 @@ t("items", { count }); // Handles complex plural rules
```jsx
// Error states with recovery
-{
- error && (
-
-
Failed to load data. {error.message}
-
-
- );
-}
+{error && (
+
+
Failed to load data. {error.message}
+
+
+)}
```
**Form validation errors**:
-
- Inline errors near fields
- Clear, specific messages
- Suggest corrections
@@ -185,7 +163,6 @@ t("items", { count }); // Handles complex plural rules
- Preserve user input on error
**API errors**:
-
- Handle each status code appropriately
- 400: Show validation errors
- 401: Redirect to login
@@ -195,7 +172,6 @@ t("items", { count }); // Handles complex plural rules
- 500: Show generic error, offer support
**Graceful degradation**:
-
- Core functionality works without JavaScript
- Images have alt text
- Progressive enhancement
@@ -204,7 +180,6 @@ t("items", { count }); // Handles complex plural rules
### Edge Cases & Boundary Conditions
**Empty states**:
-
- No items in list
- No search results
- No notifications
@@ -212,7 +187,6 @@ t("items", { count }); // Handles complex plural rules
- Provide clear next action
**Loading states**:
-
- Initial load
- Pagination load
- Refresh
@@ -220,76 +194,32 @@ t("items", { count }); // Handles complex plural rules
- Time estimates for long operations
**Large datasets**:
-
- Pagination or virtual scrolling
- Search/filter capabilities
- Performance optimization
- Don't load all 10,000 items at once
**Concurrent operations**:
-
- Prevent double-submission (disable button while loading)
- Handle race conditions
- Optimistic updates with rollback
- Conflict resolution
**Permission states**:
-
- No permission to view
- No permission to edit
- Read-only mode
- Clear explanation of why
**Browser compatibility**:
-
- Polyfills for modern features
- Fallbacks for unsupported CSS
- Feature detection (not browser detection)
- Test in target browsers
-### Onboarding & First-Run Experience
-
-Production-ready features work for first-time users, not just power users. Design the paths that get new users to value:
-
-**Empty states**: Every zero-data screen needs:
-
-- What will appear here (description or illustration)
-- Why it matters to the user
-- Clear CTA to create the first item or start from a template
-- Visual interest (not just blank space with "No items yet")
-
-Empty state types to handle:
-
-- **First use**: emphasize value, provide templates
-- **User cleared**: light touch, easy to recreate
-- **No results**: suggest a different query, offer to clear filters
-- **No permissions**: explain why, how to get access
-
-**First-run experience**: Get users to their "aha moment" as quickly as possible.
-
-- Show, don't tell -- working examples over descriptions
-- Progressive disclosure -- teach one thing at a time, not everything upfront
-- Make onboarding optional -- let experienced users skip
-- Provide smart defaults so required setup is minimal
-
-**Feature discovery**: Teach features when users need them, not upfront.
-
-- Contextual tooltips at point of use (brief, dismissable, one-time)
-- Badges or indicators on new or unused features
-- Celebrate activation events quietly (a toast, not a modal)
-
-**NEVER**:
-
-- Force long onboarding before users can touch the product
-- Show the same tooltip repeatedly (track and respect dismissals)
-- Block the entire UI during a guided tour
-- Create separate tutorial modes disconnected from the real product
-- Design empty states that just say "No items" with no next action
-
### Input Validation & Sanitization
**Client-side validation**:
-
- Required fields
- Format validation (email, phone, URL)
- Length limits
@@ -297,44 +227,41 @@ Empty state types to handle:
- Custom validation rules
**Server-side validation** (always):
-
- Never trust client-side only
- Validate and sanitize all inputs
- Protect against injection attacks
- Rate limiting
**Constraint handling**:
-
```html
-
- Letters and numbers only, up to 100 characters
+
+ Letters and numbers only, up to 100 characters
+
```
### Accessibility Resilience
**Keyboard navigation**:
-
- All functionality accessible via keyboard
- Logical tab order
- Focus management in modals
- Skip links for long content
**Screen reader support**:
-
- Proper ARIA labels
- Announce dynamic changes (live regions)
- Descriptive alt text
- Semantic HTML
**Motion sensitivity**:
-
```css
@media (prefers-reduced-motion: reduce) {
* {
@@ -346,7 +273,6 @@ Empty state types to handle:
```
**High contrast mode**:
-
- Test in Windows high contrast mode
- Don't rely only on color
- Provide alternative visual cues
@@ -354,21 +280,18 @@ Empty state types to handle:
### Performance Resilience
**Slow connections**:
-
- Progressive image loading
- Skeleton screens
- Optimistic UI updates
- Offline support (service workers)
**Memory leaks**:
-
- Clean up event listeners
- Cancel subscriptions
- Clear timers/intervals
- Abort pending requests on unmount
**Throttling & Debouncing**:
-
```javascript
// Debounce search input
const debouncedSearch = debounce(handleSearch, 300);
@@ -380,7 +303,6 @@ const throttledScroll = throttle(handleScroll, 100);
## Testing Strategies
**Manual testing**:
-
- Test with extreme data (very long, very short, empty)
- Test in different languages
- Test offline
@@ -390,7 +312,6 @@ const throttledScroll = throttle(handleScroll, 100);
- Test on old browsers
**Automated testing**:
-
- Unit tests for edge cases
- Integration tests for error scenarios
- E2E tests for critical paths
@@ -400,7 +321,6 @@ const throttledScroll = throttle(handleScroll, 100);
**IMPORTANT**: Hardening is about expecting the unexpected. Real users will do things you never imagined.
**NEVER**:
-
- Assume perfect input (validate everything)
- Ignore internationalization (design for global)
- Leave error messages generic ("Error occurred")
diff --git a/.agents/skills/critique/reference/heuristics-scoring.md b/.agents/skills/impeccable/reference/heuristics-scoring.md
similarity index 86%
rename from .agents/skills/critique/reference/heuristics-scoring.md
rename to .agents/skills/impeccable/reference/heuristics-scoring.md
index 3623470..fd5b1b0 100644
--- a/.agents/skills/critique/reference/heuristics-scoring.md
+++ b/.agents/skills/impeccable/reference/heuristics-scoring.md
@@ -9,7 +9,6 @@ Score each of Nielsen's 10 Usability Heuristics on a 0–4 scale. Be honest —
Keep users informed about what's happening through timely, appropriate feedback.
**Check for**:
-
- Loading indicators during async operations
- Confirmation of user actions (save, submit, delete)
- Progress indicators for multi-step processes
@@ -30,7 +29,6 @@ Keep users informed about what's happening through timely, appropriate feedback.
Speak the user's language. Follow real-world conventions. Information appears in natural, logical order.
**Check for**:
-
- Familiar terminology (no unexplained jargon)
- Logical information order matching user expectations
- Recognizable icons and metaphors
@@ -51,7 +49,6 @@ Speak the user's language. Follow real-world conventions. Information appears in
Users need a clear "emergency exit" from unwanted states without extended dialogue.
**Check for**:
-
- Undo/redo functionality
- Cancel buttons on forms and modals
- Clear navigation back to safety (home, previous)
@@ -72,7 +69,6 @@ Users need a clear "emergency exit" from unwanted states without extended dialog
Users shouldn't wonder whether different words, situations, or actions mean the same thing.
**Check for**:
-
- Consistent terminology throughout the interface
- Same actions produce same results everywhere
- Platform conventions followed (standard UI patterns)
@@ -93,7 +89,6 @@ Users shouldn't wonder whether different words, situations, or actions mean the
Better than good error messages is a design that prevents problems in the first place.
**Check for**:
-
- Confirmation before destructive actions (delete, overwrite)
- Constraints preventing invalid input (date pickers, dropdowns)
- Smart defaults that reduce errors
@@ -114,7 +109,6 @@ Better than good error messages is a design that prevents problems in the first
Minimize memory load. Make objects, actions, and options visible or easily retrievable.
**Check for**:
-
- Visible options (not buried in hidden menus)
- Contextual help when needed (tooltips, inline hints)
- Recent items and history
@@ -135,7 +129,6 @@ Minimize memory load. Make objects, actions, and options visible or easily retri
Accelerators — invisible to novices — speed up expert interaction.
**Check for**:
-
- Keyboard shortcuts for common actions
- Customizable interface elements
- Recent items and favorites
@@ -156,7 +149,6 @@ Accelerators — invisible to novices — speed up expert interaction.
Interfaces should not contain irrelevant or rarely needed information. Every element should serve a purpose.
**Check for**:
-
- Only necessary information visible at each step
- Clear visual hierarchy directing attention
- Purposeful use of color and emphasis
@@ -177,7 +169,6 @@ Interfaces should not contain irrelevant or rarely needed information. Every ele
Error messages should use plain language, precisely indicate the problem, and constructively suggest a solution.
**Check for**:
-
- Plain language error messages (no error codes for users)
- Specific problem identification ("Email is missing @" not "Invalid input")
- Actionable recovery suggestions
@@ -198,7 +189,6 @@ Error messages should use plain language, precisely indicate the problem, and co
Even if the system is usable without docs, help should be easy to find, task-focused, and concise.
**Check for**:
-
- Searchable help or documentation
- Contextual help (tooltips, inline hints, guided tours)
- Task-focused organization (not feature-organized)
@@ -220,13 +210,13 @@ Even if the system is usable without docs, help should be easy to find, task-foc
**Total possible**: 40 points (10 heuristics × 4 max)
-| Score Range | Rating | What It Means |
-| ----------- | ---------- | ------------------------------------------------------ |
-| 36–40 | Excellent | Minor polish only — ship it |
-| 28–35 | Good | Address weak areas, solid foundation |
-| 20–27 | Acceptable | Significant improvements needed before users are happy |
-| 12–19 | Poor | Major UX overhaul required — core experience broken |
-| 0–11 | Critical | Redesign needed — unusable in current state |
+| Score Range | Rating | What It Means |
+|-------------|--------|---------------|
+| 36–40 | Excellent | Minor polish only — ship it |
+| 28–35 | Good | Address weak areas, solid foundation |
+| 20–27 | Acceptable | Significant improvements needed before users are happy |
+| 12–19 | Poor | Major UX overhaul required — core experience broken |
+| 0–11 | Critical | Redesign needed — unusable in current state |
---
@@ -234,11 +224,11 @@ Even if the system is usable without docs, help should be easy to find, task-foc
Tag each individual issue found during scoring with a priority level:
-| Priority | Name | Description | Action |
-| -------- | -------- | ------------------------------------------ | --------------------------------------- |
-| **P0** | Blocking | Prevents task completion entirely | Fix immediately — this is a showstopper |
-| **P1** | Major | Causes significant difficulty or confusion | Fix before release |
-| **P2** | Minor | Annoyance, but workaround exists | Fix in next pass |
-| **P3** | Polish | Nice-to-fix, no real user impact | Fix if time permits |
+| Priority | Name | Description | Action |
+|----------|------|-------------|--------|
+| **P0** | Blocking | Prevents task completion entirely | Fix immediately — this is a showstopper |
+| **P1** | Major | Causes significant difficulty or confusion | Fix before release |
+| **P2** | Minor | Annoyance, but workaround exists | Fix in next pass |
+| **P3** | Polish | Nice-to-fix, no real user impact | Fix if time permits |
**Tip**: If you're unsure between two levels, ask: "Would a user contact support about this?" If yes, it's at least P1.
diff --git a/.agents/skills/impeccable/reference/interaction-design.md b/.agents/skills/impeccable/reference/interaction-design.md
index 4e7a74b..19d6809 100644
--- a/.agents/skills/impeccable/reference/interaction-design.md
+++ b/.agents/skills/impeccable/reference/interaction-design.md
@@ -4,16 +4,16 @@
Every interactive element needs these states designed:
-| State | When | Visual Treatment |
-| ------------ | --------------------------- | --------------------------- |
-| **Default** | At rest | Base styling |
-| **Hover** | Pointer over (not touch) | Subtle lift, color shift |
-| **Focus** | Keyboard/programmatic focus | Visible ring (see below) |
-| **Active** | Being pressed | Pressed in, darker |
-| **Disabled** | Not interactive | Reduced opacity, no pointer |
-| **Loading** | Processing | Spinner, skeleton |
-| **Error** | Invalid state | Red border, icon, message |
-| **Success** | Completed | Green check, confirmation |
+| State | When | Visual Treatment |
+|-------|------|------------------|
+| **Default** | At rest | Base styling |
+| **Hover** | Pointer over (not touch) | Subtle lift, color shift |
+| **Focus** | Keyboard/programmatic focus | Visible ring (see below) |
+| **Active** | Being pressed | Pressed in, darker |
+| **Disabled** | Not interactive | Reduced opacity, no pointer |
+| **Loading** | Processing | Spinner, skeleton |
+| **Error** | Invalid state | Red border, icon, message |
+| **Success** | Completed | Green check, confirmation |
**The common miss**: Designing hover without focus, or vice versa. They're different. Keyboard users never see hover states.
@@ -35,7 +35,6 @@ button:focus-visible {
```
**Focus ring design**:
-
- High contrast (3:1 minimum against adjacent colors)
- 2-3px thick
- Offset from element (not inside it)
@@ -67,8 +66,8 @@ Focus trapping in modals used to require complex JavaScript. Now use the `inert`
Or use the native `
` open near the top of the document.
+ const idx = content.indexOf(config.insertAfter);
+ if (idx === -1) return content;
+ const after = idx + config.insertAfter.length;
+ // Preserve a single trailing newline if the anchor didn't end with one
+ const prefix = content[after] === '\n' ? content.slice(0, after + 1) : content.slice(0, after) + '\n';
+ return prefix + block + content.slice(prefix.length);
+}
+
+/**
+ * Remove the live script block. Matches either HTML or JSX comment markers
+ * regardless of config (so stale tags from a wrong config can still be cleaned).
+ *
+ * Indent-preserving: captures any whitespace immediately preceding the opener
+ * marker and re-emits it in place of the removed block. `insertTag` inserted
+ * the block *after* the original line's indent and *before* the anchor (e.g.
+ * `
` naturally
+ // belong at the end, and the same literal can appear earlier in code blocks
+ // within rendered documentation pages.
+ if (config.insertBefore) {
+ const idx = content.lastIndexOf(config.insertBefore);
+ if (idx === -1) return content;
+ return content.slice(0, idx) + block + content.slice(idx);
+ }
+ // insertAfter: match the FIRST occurrence — typical anchors like `
` or
+ // `
`), which moved the indent onto the opener line and left the anchor
+ * unindented. Replacing the whole block (plus its trailing newline) with just
+ * the captured indent hands the indent back to the anchor that follows.
+ */
+function removeTag(content, _syntax) {
+ const patterns = [
+ /([ \t]*)[\s\S]*?[ \t]*\n/,
+ /([ \t]*)\{\/\*\s*impeccable-live-start\s*\*\/\}[\s\S]*?\{\/\*\s*impeccable-live-end\s*\*\/\}[ \t]*\n/,
+ ];
+ for (const pat of patterns) {
+ const next = content.replace(pat, '$1');
+ if (next !== content) return next;
+ }
+ return content;
+}
+
+// ---------------------------------------------------------------------------
+// Content-Security-Policy meta-tag patcher
+//
+// When the user's HTML carries ``,
+// the cross-origin load of /live.js (and the SSE/POST connection back to
+// localhost:PORT) is blocked unless the CSP explicitly allows that origin.
+//
+// On insert: append `http://localhost:PORT` to `script-src` and `connect-src`,
+// and stash the original `content` value in a `data-impeccable-csp-original`
+// attribute (base64) so revert is exact.
+//
+// On remove: detect the marker attribute, decode it, restore the original
+// content value verbatim, drop the marker.
+//
+// Header-based CSP (Next.js headers, Nuxt routeRules, SvelteKit kit.csp,
+// shared helpers) is NOT patched here — those need framework-specific config
+// edits and are handled via the existing detect-csp.mjs reference output.
+// Only the in-source meta-tag form gets the auto-patch.
+// ---------------------------------------------------------------------------
+
+const CSP_MARKER_ATTR = 'data-impeccable-csp-original';
+
+function findCspMetaTags(content) {
+ const out = [];
+ const tagRe = /]*?)\/?>/gis;
+ let m;
+ while ((m = tagRe.exec(content)) !== null) {
+ const attrs = m[1];
+ if (!/(http-equiv|httpEquiv)\s*=\s*(['"])Content-Security-Policy\2/i.test(attrs)) continue;
+ out.push({ start: m.index, end: m.index + m[0].length, full: m[0], attrs });
+ }
+ return out;
+}
+
+function getAttr(attrs, name) {
+ const re = new RegExp(`\\b${name}\\s*=\\s*(['"])([\\s\\S]*?)\\1`, 'i');
+ const m = attrs.match(re);
+ return m ? { quote: m[1], value: m[2], full: m[0] } : null;
+}
+
+function appendOriginToDirective(csp, directive, origin) {
+ const re = new RegExp(`(^|;)(\\s*)(${directive})\\s+([^;]*)`, 'i');
+ const m = csp.match(re);
+ if (m) {
+ const tokens = m[4].trim().split(/\s+/);
+ if (tokens.includes(origin)) return csp;
+ return csp.replace(re, `${m[1]}${m[2]}${m[3]} ${[...tokens, origin].join(' ')}`);
+ }
+ // Directive missing — add it. Use 'self' + origin so we don't inadvertently
+ // narrow the policy compared to the default-src fallback (most users with
+ // an explicit CSP have 'self' there).
+ return csp.trim().replace(/;?\s*$/, '') + `; ${directive} 'self' ${origin}`;
+}
+
+export function patchCspMeta(content, port) {
+ const tags = findCspMetaTags(content);
+ if (tags.length === 0) return content;
+ const origin = `http://localhost:${port}`;
+
+ // Walk last-to-first so prior splices don't invalidate later indices.
+ let result = content;
+ for (let i = tags.length - 1; i >= 0; i--) {
+ const tag = tags[i];
+ const attrs = tag.attrs;
+ if (getAttr(attrs, CSP_MARKER_ATTR)) continue; // already patched
+ const contentAttr = getAttr(attrs, 'content');
+ if (!contentAttr) continue;
+
+ const original = contentAttr.value;
+ let patched = original;
+ patched = appendOriginToDirective(patched, 'script-src', origin);
+ patched = appendOriginToDirective(patched, 'connect-src', origin);
+ // The shader overlay during 'generating' creates a screenshot via
+ // URL.createObjectURL, producing a `blob:` URL — img-src 'self' rejects
+ // those. Add `blob:` so the overlay doesn't throw a CSP violation.
+ patched = appendOriginToDirective(patched, 'img-src', 'blob:');
+ if (patched === original) continue;
+
+ const newContentAttr = `content=${contentAttr.quote}${patched}${contentAttr.quote}`;
+ const marker = `${CSP_MARKER_ATTR}="${Buffer.from(original, 'utf-8').toString('base64')}"`;
+ const newAttrs = attrs.replace(contentAttr.full, newContentAttr) + ' ' + marker;
+ const newTag = tag.full.replace(attrs, newAttrs);
+
+ result = result.slice(0, tag.start) + newTag + result.slice(tag.end);
+ }
+ return result;
+}
+
+export function revertCspMeta(content) {
+ const tags = findCspMetaTags(content);
+ if (tags.length === 0) return content;
+
+ let result = content;
+ for (let i = tags.length - 1; i >= 0; i--) {
+ const tag = tags[i];
+ const origAttr = getAttr(tag.attrs, CSP_MARKER_ATTR);
+ if (!origAttr) continue;
+ const contentAttr = getAttr(tag.attrs, 'content');
+ if (!contentAttr) continue;
+
+ let originalValue;
+ try { originalValue = Buffer.from(origAttr.value, 'base64').toString('utf-8'); }
+ catch { continue; }
+
+ const newContentAttr = `content=${contentAttr.quote}${originalValue}${contentAttr.quote}`;
+ let newAttrs = tag.attrs.replace(contentAttr.full, newContentAttr);
+ // Drop the marker attribute and any single space immediately preceding it.
+ newAttrs = newAttrs.replace(new RegExp(`\\s*${origAttr.full}`), '');
+ const newTag = tag.full.replace(tag.attrs, newAttrs);
+
+ result = result.slice(0, tag.start) + newTag + result.slice(tag.end);
+ }
+ return result;
+}
+
+// ---------------------------------------------------------------------------
+// Auto-execute
+// ---------------------------------------------------------------------------
+
+const _running = process.argv[1];
+if (_running?.endsWith('live-inject.mjs') || _running?.endsWith('live-inject.mjs/')) {
+ injectCli();
+}
+
+export { insertTag, removeTag, validateConfig, buildTagBlock };
+// patchCspMeta + revertCspMeta are exported above where they're defined.
diff --git a/.agents/skills/impeccable/scripts/live-poll.mjs b/.agents/skills/impeccable/scripts/live-poll.mjs
new file mode 100644
index 0000000..5cece1a
--- /dev/null
+++ b/.agents/skills/impeccable/scripts/live-poll.mjs
@@ -0,0 +1,187 @@
+/**
+ * CLI client for the live variant mode poll/reply protocol.
+ *
+ * Usage:
+ * npx impeccable poll # Block until browser event, print JSON
+ * npx impeccable poll --timeout=600000 # Custom timeout (ms); default is long-poll friendly
+ * npx impeccable poll --reply done # Reply "done" to event
+ * npx impeccable poll --reply error "msg" # Reply with error
+ */
+
+import { execSync } from 'node:child_process';
+import fs from 'node:fs';
+import path from 'node:path';
+import os from 'node:os';
+import { fileURLToPath } from 'node:url';
+
+// Node's built-in fetch (undici under the hood) enforces a 300s headers
+// timeout that can't be lowered per-request. We cap each request below
+// that ceiling and loop in `pollOnce` to synthesize a long poll without
+// depending on the standalone undici package.
+const PER_REQUEST_TIMEOUT_MS = 270_000;
+
+const LIVE_PID_FILE = path.join(process.cwd(), '.impeccable-live.json');
+
+function readServerInfo() {
+ try {
+ return JSON.parse(fs.readFileSync(LIVE_PID_FILE, 'utf-8'));
+ } catch {
+ console.error('No running live server found. Start one with: npx impeccable live');
+ process.exit(1);
+ }
+}
+
+export async function pollCli() {
+ const args = process.argv.slice(2);
+
+ if (args.includes('--help') || args.includes('-h')) {
+ console.log(`Usage: impeccable poll [options]
+
+Wait for a browser event from the live variant server, or reply to one.
+
+Modes:
+ poll Block until a browser event arrives, print JSON
+ poll --reply done Reply "done" to event
+ poll --reply error "msg" Reply with an error message
+
+Options:
+ --timeout=MS Long-poll timeout in ms (default: 600000). Use the default unless the user asked to pause live; never use a short timeout to end the chat turn
+ --help Show this help message`);
+ process.exit(0);
+ }
+
+ const info = readServerInfo();
+ const base = `http://localhost:${info.port}`;
+
+ // Reply mode: npx impeccable poll --reply [--file path] [message]
+ const replyIdx = args.indexOf('--reply');
+ if (replyIdx !== -1) {
+ const id = args[replyIdx + 1];
+ const status = args[replyIdx + 2] || 'done';
+ const fileIdx = args.indexOf('--file');
+ const filePath = fileIdx !== -1 && fileIdx + 1 < args.length ? args[fileIdx + 1] : undefined;
+ // Message is any remaining positional arg that isn't a flag
+ const message = args.find((a, i) => i > replyIdx + 2 && !a.startsWith('--') && i !== fileIdx + 1) || undefined;
+
+ if (!id) {
+ console.error('Usage: npx impeccable poll --reply [--file path] [message]');
+ process.exit(1);
+ }
+
+ try {
+ const res = await fetch(`${base}/poll`, {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify({
+ token: info.token,
+ id,
+ type: status,
+ message,
+ file: filePath,
+ }),
+ });
+
+ if (!res.ok) {
+ const body = await res.json().catch(() => ({}));
+ console.error(`Reply failed (${res.status}):`, body.error || res.statusText);
+ process.exit(1);
+ }
+
+ // Success — silent exit (agent doesn't need output for replies)
+ } catch (err) {
+ if (err.cause?.code === 'ECONNREFUSED') {
+ console.error('Live server not running. Start one with: npx impeccable live');
+ } else {
+ console.error('Reply failed:', err.message);
+ }
+ process.exit(1);
+ }
+ return;
+ }
+
+ // Poll mode: block until browser event. Default 10 min. Node's built-in
+ // fetch enforces a 300s headers timeout, so we loop in slices under that
+ // ceiling and keep re-polling until we get a real event or the user's
+ // total timeout runs out.
+ const timeoutArg = args.find(a => a.startsWith('--timeout='));
+ const totalTimeout = timeoutArg ? parseInt(timeoutArg.split('=')[1], 10) : 600000;
+
+ const deadline = Date.now() + totalTimeout;
+ let event;
+ try {
+ while (true) {
+ const remaining = deadline - Date.now();
+ if (remaining <= 0) {
+ event = { type: 'timeout' };
+ break;
+ }
+ const slice = Math.min(remaining, PER_REQUEST_TIMEOUT_MS);
+ const res = await fetch(`${base}/poll?token=${info.token}&timeout=${slice}`);
+
+ if (res.status === 401) {
+ console.error('Authentication failed. The server token may have changed.');
+ console.error('Try restarting: npx impeccable live stop && npx impeccable live');
+ process.exit(1);
+ }
+
+ if (!res.ok) {
+ console.error(`Poll failed: ${res.status} ${res.statusText}`);
+ process.exit(1);
+ }
+
+ const next = await res.json();
+ // Server-side timeout means no browser event arrived in this slice.
+ // Loop and re-poll until we get a real event or we hit the user's
+ // total deadline.
+ if (next?.type === 'timeout' && Date.now() < deadline) continue;
+ event = next;
+ break;
+ }
+
+ // Auto-handle accept/discard via deterministic script
+ if (event.type === 'accept' || event.type === 'discard') {
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
+ const acceptScript = path.join(__dirname, 'live-accept.mjs');
+ const scriptArgs = event.type === 'discard'
+ ? ['--id', event.id, '--discard']
+ : ['--id', event.id, '--variant', event.variantId];
+ if (event.type === 'accept' && event.paramValues && Object.keys(event.paramValues).length > 0) {
+ // Pass through a JSON blob; the shell-safe wrap uses single quotes because
+ // values are finite {id, number|string|boolean} pairs from a validated payload.
+ scriptArgs.push('--param-values', `'${JSON.stringify(event.paramValues).replace(/'/g, "'\\''")}'`);
+ }
+ try {
+ const out = execSync(
+ `node "${acceptScript}" ${scriptArgs.join(' ')}`,
+ { encoding: 'utf-8', cwd: process.cwd(), timeout: 30_000 }
+ );
+ event._acceptResult = JSON.parse(out.trim());
+ } catch (err) {
+ event._acceptResult = { handled: false, error: err.message };
+ }
+ }
+
+ // Second signal path: stderr banner in case the agent parses stdout
+ // JSON but skips nested fields. One line is enough — the full checklist
+ // is in reference/live.md.
+ if (event._acceptResult?.carbonize === true) {
+ process.stderr.write('\n⚠ Carbonize cleanup REQUIRED before next poll. See reference/live.md "Required after accept".\n\n');
+ }
+
+ // Print the event as JSON — the agent reads this from stdout
+ console.log(JSON.stringify(event));
+ } catch (err) {
+ if (err.cause?.code === 'ECONNREFUSED') {
+ console.error('Live server not running. Start one with: npx impeccable live');
+ } else {
+ console.error('Poll failed:', err.message);
+ }
+ process.exit(1);
+ }
+}
+
+// Auto-execute when run directly
+const _running = process.argv[1];
+if (_running?.endsWith('live-poll.mjs') || _running?.endsWith('live-poll.mjs/')) {
+ pollCli();
+}
diff --git a/.agents/skills/impeccable/scripts/live-server.mjs b/.agents/skills/impeccable/scripts/live-server.mjs
new file mode 100644
index 0000000..3d608e3
--- /dev/null
+++ b/.agents/skills/impeccable/scripts/live-server.mjs
@@ -0,0 +1,679 @@
+#!/usr/bin/env node
+/**
+ * Live variant mode server (self-contained, zero dependencies).
+ *
+ * Serves the browser script (/live.js), the detection overlay (/detect.js),
+ * uses Server-Sent Events (SSE) for server→browser push, and HTTP POST for
+ * browser→server events. Agent communicates via HTTP long-poll (/poll).
+ *
+ * Usage:
+ * node /live-server.mjs # start
+ * node /live-server.mjs stop # stop + remove injected live.js tag
+ * node /live-server.mjs stop --keep-inject # stop only
+ * node /live-server.mjs --help
+ */
+
+import http from 'node:http';
+import { randomUUID } from 'node:crypto';
+import { spawn, execFileSync } from 'node:child_process';
+import fs from 'node:fs';
+import path from 'node:path';
+import net from 'node:net';
+import { fileURLToPath } from 'node:url';
+import { parseDesignMd } from './design-parser.mjs';
+
+const __dirname = path.dirname(fileURLToPath(import.meta.url));
+// PID file in the project root so both the server and agent can find it
+// predictably (os.tmpdir() varies across platforms).
+const LIVE_PID_FILE = path.join(process.cwd(), '.impeccable-live.json');
+const DEFAULT_POLL_TIMEOUT = 600_000; // 10 min — agent re-polls on timeout anyway
+const SSE_HEARTBEAT_INTERVAL = 30_000; // keepalive ping every 30s
+
+// ---------------------------------------------------------------------------
+// Port detection
+// ---------------------------------------------------------------------------
+
+async function findOpenPort(start = 8400) {
+ return new Promise((resolve) => {
+ const srv = net.createServer();
+ srv.listen(start, '127.0.0.1', () => {
+ const port = srv.address().port;
+ srv.close(() => resolve(port));
+ });
+ srv.on('error', () => resolve(findOpenPort(start + 1)));
+ });
+}
+
+// ---------------------------------------------------------------------------
+// Session state
+// ---------------------------------------------------------------------------
+
+const state = {
+ token: null,
+ port: null,
+ sseClients: new Set(), // SSE response objects (server→browser push)
+ pendingEvents: [], // browser events waiting for agent poll
+ pendingPolls: [], // agent poll callbacks waiting for browser events
+ exitTimer: null,
+ sessionDir: null, // per-session tmp dir for annotation screenshots
+};
+
+// Cap per-annotation upload size. A full 1920×1080 PNG is typically <1 MB;
+// cap at 10 MB to guard against runaway writes from a misbehaving client.
+const MAX_ANNOTATION_BYTES = 10 * 1024 * 1024;
+
+function enqueueEvent(event) {
+ if (state.pendingPolls.length > 0) {
+ state.pendingPolls.shift()(event);
+ } else {
+ state.pendingEvents.push(event);
+ }
+}
+
+/** Push a message to all connected SSE clients. */
+function broadcast(msg) {
+ const data = 'data: ' + JSON.stringify(msg) + '\n\n';
+ for (const res of state.sseClients) {
+ try { res.write(data); } catch { /* client gone */ }
+ }
+}
+
+// ---------------------------------------------------------------------------
+// Load scripts
+// ---------------------------------------------------------------------------
+
+function loadBrowserScripts() {
+ // Detection script: look relative to the skill scripts dir, then fall back
+ // to the npm package location (src/detect-antipatterns-browser.js).
+ // This one IS cached — detect.js rarely changes during a session.
+ const detectPaths = [
+ path.join(__dirname, '..', '..', '..', '..', 'src', 'detect-antipatterns-browser.js'),
+ path.join(process.cwd(), 'node_modules', 'impeccable', 'src', 'detect-antipatterns-browser.js'),
+ ];
+ let detectScript = '';
+ for (const p of detectPaths) {
+ try { detectScript = fs.readFileSync(p, 'utf-8'); break; } catch { /* try next */ }
+ }
+
+ // live-browser.js: DO NOT cache. Return the path so the /live.js handler
+ // can re-read on every request. Editing the browser script during iteration
+ // should land on the next tab reload, not require a server restart.
+ const livePath = path.join(__dirname, 'live-browser.js');
+ if (!fs.existsSync(livePath)) {
+ process.stderr.write('Error: live-browser.js not found at ' + livePath + '\n');
+ process.exit(1);
+ }
+
+ return { detectScript, livePath };
+}
+
+function hasProjectContext() {
+ // PRODUCT.md carries brand voice / anti-references — that's what determines
+ // whether variants are brand-aware. DESIGN.md (visual tokens) is a separate
+ // concern, surfaced by the design panel's own empty state. Legacy
+ // .impeccable.md is auto-migrated to PRODUCT.md by load-context.mjs.
+ try {
+ fs.accessSync(path.join(process.cwd(), 'PRODUCT.md'), fs.constants.R_OK);
+ return true;
+ } catch { return false; }
+}
+
+function statOrNull(filePath) {
+ try { return fs.statSync(filePath); } catch { return null; }
+}
+
+// ---------------------------------------------------------------------------
+// Validation (inline — no external import needed for self-contained script)
+// ---------------------------------------------------------------------------
+
+const VISUAL_ACTIONS = [
+ 'impeccable', 'bolder', 'quieter', 'distill', 'polish', 'typeset',
+ 'colorize', 'layout', 'adapt', 'animate', 'delight', 'overdrive',
+];
+
+function validateEvent(msg) {
+ if (!msg || typeof msg !== 'object' || !msg.type) return 'Missing or invalid message';
+ switch (msg.type) {
+ case 'generate':
+ if (!msg.id || typeof msg.id !== 'string') return 'generate: missing id';
+ if (!msg.action || !VISUAL_ACTIONS.includes(msg.action)) return 'generate: invalid action';
+ if (!Number.isInteger(msg.count) || msg.count < 1 || msg.count > 8) return 'generate: count must be 1-8';
+ if (!msg.element || !msg.element.outerHTML) return 'generate: missing element context';
+ // Optional annotation fields (all-or-nothing: if any present, all must be well-formed).
+ if (msg.screenshotPath !== undefined && typeof msg.screenshotPath !== 'string') return 'generate: screenshotPath must be string';
+ if (msg.comments !== undefined && !Array.isArray(msg.comments)) return 'generate: comments must be array';
+ if (msg.strokes !== undefined && !Array.isArray(msg.strokes)) return 'generate: strokes must be array';
+ return null;
+ case 'accept':
+ if (!msg.id) return 'accept: missing id';
+ if (!msg.variantId) return 'accept: missing variantId';
+ if (msg.paramValues !== undefined) {
+ if (typeof msg.paramValues !== 'object' || msg.paramValues === null || Array.isArray(msg.paramValues)) {
+ return 'accept: paramValues must be an object';
+ }
+ }
+ return null;
+ case 'discard':
+ return msg.id ? null : 'discard: missing id';
+ case 'exit':
+ return null;
+ case 'prefetch':
+ if (!msg.pageUrl || typeof msg.pageUrl !== 'string') return 'prefetch: missing pageUrl';
+ return null;
+ default:
+ return 'Unknown event type: ' + msg.type;
+ }
+}
+
+// ---------------------------------------------------------------------------
+// HTTP request handler
+// ---------------------------------------------------------------------------
+
+function createRequestHandler({ detectScript, livePath }) {
+ return (req, res) => {
+ const url = new URL(req.url, `http://localhost:${state.port}`);
+ res.setHeader('Access-Control-Allow-Origin', '*');
+ res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS');
+ res.setHeader('Access-Control-Allow-Headers', 'Content-Type');
+ if (req.method === 'OPTIONS') { res.writeHead(204); res.end(); return; }
+
+ const p = url.pathname;
+
+ // --- Scripts ---
+ if (p === '/live.js') {
+ // Re-read from disk each request so edits to live-browser.js land on
+ // the next tab reload. No-store headers prevent browser caching across
+ // sessions — during iteration, a cached old script silently breaks
+ // every subsequent session.
+ let liveScript;
+ try {
+ liveScript = fs.readFileSync(livePath, 'utf-8');
+ } catch (err) {
+ res.writeHead(500, { 'Content-Type': 'text/plain' });
+ res.end('Error reading live-browser.js: ' + err.message);
+ return;
+ }
+ const body =
+ `window.__IMPECCABLE_TOKEN__ = '${state.token}';\n` +
+ `window.__IMPECCABLE_PORT__ = ${state.port};\n` +
+ liveScript;
+ res.writeHead(200, {
+ 'Content-Type': 'application/javascript',
+ 'Cache-Control': 'no-store, no-cache, must-revalidate, max-age=0',
+ 'Pragma': 'no-cache',
+ });
+ res.end(body);
+ return;
+ }
+ if (p === '/detect.js' || p === '/') {
+ if (!detectScript) { res.writeHead(404); res.end('Not available'); return; }
+ res.writeHead(200, { 'Content-Type': 'application/javascript' });
+ res.end(detectScript);
+ return;
+ }
+
+ // --- Vendored modern-screenshot (UMD build) ---
+ // Lazy-loaded by live.js when the user clicks Go; exposes
+ // window.modernScreenshot.domToBlob(...) for capture.
+ if (p === '/modern-screenshot.js') {
+ const vendorPath = path.join(__dirname, 'modern-screenshot.umd.js');
+ try {
+ res.writeHead(200, {
+ 'Content-Type': 'application/javascript',
+ 'Cache-Control': 'public, max-age=31536000, immutable',
+ });
+ res.end(fs.readFileSync(vendorPath));
+ } catch {
+ res.writeHead(404); res.end('Vendor script not found');
+ }
+ return;
+ }
+
+ // --- Annotation upload (browser → server, raw PNG body) ---
+ // Client generates the eventId, POSTs the PNG, then POSTs the generate
+ // event with screenshotPath already set. Keeps bytes out of the SSE/poll
+ // bridge and preserves the "one shot from the user's POV" UX.
+ if (p === '/annotation' && req.method === 'POST') {
+ const token = url.searchParams.get('token');
+ if (token !== state.token) { res.writeHead(401); res.end('Unauthorized'); return; }
+ const eventId = url.searchParams.get('eventId');
+ if (!eventId || !/^[A-Za-z0-9_-]{1,64}$/.test(eventId)) {
+ res.writeHead(400, { 'Content-Type': 'application/json' });
+ res.end(JSON.stringify({ error: 'Invalid eventId' }));
+ return;
+ }
+ if ((req.headers['content-type'] || '').toLowerCase() !== 'image/png') {
+ res.writeHead(415, { 'Content-Type': 'application/json' });
+ res.end(JSON.stringify({ error: 'Content-Type must be image/png' }));
+ return;
+ }
+ if (!state.sessionDir) {
+ res.writeHead(500, { 'Content-Type': 'application/json' });
+ res.end(JSON.stringify({ error: 'Session dir unavailable' }));
+ return;
+ }
+ const chunks = [];
+ let total = 0;
+ let aborted = false;
+ req.on('data', (c) => {
+ if (aborted) return;
+ total += c.length;
+ if (total > MAX_ANNOTATION_BYTES) {
+ aborted = true;
+ res.writeHead(413, { 'Content-Type': 'application/json' });
+ res.end(JSON.stringify({ error: 'Payload too large' }));
+ req.destroy();
+ return;
+ }
+ chunks.push(c);
+ });
+ req.on('end', () => {
+ if (aborted) return;
+ const absPath = path.join(state.sessionDir, eventId + '.png');
+ try {
+ fs.writeFileSync(absPath, Buffer.concat(chunks));
+ } catch (err) {
+ res.writeHead(500, { 'Content-Type': 'application/json' });
+ res.end(JSON.stringify({ error: 'Write failed: ' + err.message }));
+ return;
+ }
+ res.writeHead(200, { 'Content-Type': 'application/json' });
+ res.end(JSON.stringify({ ok: true, path: absPath }));
+ });
+ req.on('error', () => {
+ if (!aborted) {
+ res.writeHead(500, { 'Content-Type': 'application/json' });
+ res.end(JSON.stringify({ error: 'Upload failed' }));
+ }
+ });
+ return;
+ }
+
+ // --- Health ---
+ if (p === '/health') {
+ res.writeHead(200, { 'Content-Type': 'application/json' });
+ res.end(JSON.stringify({
+ status: 'ok', port: state.port, mode: 'variant',
+ hasProjectContext: hasProjectContext(),
+ connectedClients: state.sseClients.size,
+ }));
+ return;
+ }
+
+ // --- Design system (unified v2 response) + raw ---
+ // /design-system.json returns both parsed DESIGN.md and DESIGN.json
+ // sidecar when present. Panel merges them:
+ // { present, parsed, sidecar, hasMd, hasSidecar,
+ // mdNewerThanJson, parseError?, sidecarError? }
+ // - parsed: output of parseDesignMd (frontmatter
+ // + six canonical sections) when DESIGN.md exists.
+ // - sidecar: DESIGN.json contents when present.
+ // Expected shape: schemaVersion 2, carrying
+ // extensions + components + narrative.
+ // /design-system/raw returns DESIGN.md markdown verbatim
+ if (p === '/design-system.json' || p === '/design-system/raw') {
+ const token = url.searchParams.get('token');
+ if (token !== state.token) { res.writeHead(401); res.end('Unauthorized'); return; }
+
+ const mdPath = path.join(process.cwd(), 'DESIGN.md');
+ const jsonPath = path.join(process.cwd(), 'DESIGN.json');
+ const mdStat = statOrNull(mdPath);
+ const jsonStat = statOrNull(jsonPath);
+
+ if (p === '/design-system/raw') {
+ if (!mdStat) { res.writeHead(404); res.end('Not found'); return; }
+ res.writeHead(200, { 'Content-Type': 'text/markdown; charset=utf-8' });
+ res.end(fs.readFileSync(mdPath, 'utf-8'));
+ return;
+ }
+
+ if (!mdStat && !jsonStat) {
+ res.writeHead(404, { 'Content-Type': 'application/json' });
+ res.end(JSON.stringify({ present: false }));
+ return;
+ }
+
+ const response = {
+ present: true,
+ hasMd: !!mdStat,
+ hasSidecar: !!jsonStat,
+ mdNewerThanJson: !!(mdStat && jsonStat && mdStat.mtimeMs > jsonStat.mtimeMs + 1000),
+ };
+
+ if (mdStat) {
+ try {
+ response.parsed = parseDesignMd(fs.readFileSync(mdPath, 'utf-8'));
+ } catch (err) {
+ response.parseError = err.message;
+ }
+ }
+
+ if (jsonStat) {
+ try {
+ response.sidecar = JSON.parse(fs.readFileSync(jsonPath, 'utf-8'));
+ } catch (err) {
+ response.sidecarError = 'Failed to parse DESIGN.json: ' + err.message;
+ }
+ }
+
+ res.writeHead(200, { 'Content-Type': 'application/json' });
+ res.end(JSON.stringify(response));
+ return;
+ }
+
+ // --- Source file (no-HMR fallback) ---
+ if (p === '/source') {
+ const token = url.searchParams.get('token');
+ if (token !== state.token) { res.writeHead(401); res.end('Unauthorized'); return; }
+ const filePath = url.searchParams.get('path');
+ if (!filePath || filePath.includes('..')) { res.writeHead(400); res.end('Bad path'); return; }
+ const absPath = path.resolve(process.cwd(), filePath);
+ if (!absPath.startsWith(process.cwd())) { res.writeHead(403); res.end('Forbidden'); return; }
+ let content;
+ try { content = fs.readFileSync(absPath, 'utf-8'); }
+ catch { res.writeHead(404); res.end('File not found'); return; }
+ res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });
+ res.end(content);
+ return;
+ }
+
+ // --- SSE: server→browser push (replaces WebSocket) ---
+ if (p === '/events' && req.method === 'GET') {
+ const token = url.searchParams.get('token');
+ if (token !== state.token) { res.writeHead(401); res.end('Unauthorized'); return; }
+ res.writeHead(200, {
+ 'Content-Type': 'text/event-stream',
+ 'Cache-Control': 'no-cache',
+ 'Connection': 'keep-alive',
+ });
+ res.write('data: ' + JSON.stringify({
+ type: 'connected',
+ hasProjectContext: hasProjectContext(),
+ }) + '\n\n');
+
+ state.sseClients.add(res);
+ clearTimeout(state.exitTimer);
+
+ // Keepalive: SSE comment every 30s prevents silent connection drops.
+ const heartbeat = setInterval(() => {
+ try { res.write(': keepalive\n\n'); } catch { clearInterval(heartbeat); }
+ }, SSE_HEARTBEAT_INTERVAL);
+
+ req.on('close', () => {
+ clearInterval(heartbeat);
+ state.sseClients.delete(res);
+ if (state.sseClients.size === 0) {
+ clearTimeout(state.exitTimer);
+ state.exitTimer = setTimeout(() => {
+ if (state.sseClients.size === 0) enqueueEvent({ type: 'exit' });
+ }, 8000);
+ }
+ });
+ return;
+ }
+
+ // --- Browser→server events (replaces WebSocket messages) ---
+ if (p === '/events' && req.method === 'POST') {
+ let body = '';
+ req.on('data', (c) => { body += c; });
+ req.on('end', () => {
+ let msg;
+ try { msg = JSON.parse(body); } catch {
+ res.writeHead(400, { 'Content-Type': 'application/json' });
+ res.end(JSON.stringify({ error: 'Invalid JSON' }));
+ return;
+ }
+ if (msg.token !== state.token) {
+ res.writeHead(401, { 'Content-Type': 'application/json' });
+ res.end(JSON.stringify({ error: 'Unauthorized' }));
+ return;
+ }
+ const error = validateEvent(msg);
+ if (error) {
+ res.writeHead(400, { 'Content-Type': 'application/json' });
+ res.end(JSON.stringify({ error }));
+ return;
+ }
+ enqueueEvent(msg);
+ res.writeHead(200, { 'Content-Type': 'application/json' });
+ res.end(JSON.stringify({ ok: true }));
+ });
+ return;
+ }
+
+ // --- Stop ---
+ if (p === '/stop') {
+ const token = url.searchParams.get('token');
+ if (token !== state.token) { res.writeHead(401); res.end('Unauthorized'); return; }
+ res.writeHead(200, { 'Content-Type': 'text/plain' });
+ res.end('stopping');
+ shutdown();
+ return;
+ }
+
+ // --- Agent poll ---
+ if (p === '/poll' && req.method === 'GET') {
+ handlePollGet(req, res, url);
+ return;
+ }
+ if (p === '/poll' && req.method === 'POST') {
+ handlePollPost(req, res);
+ return;
+ }
+
+ res.writeHead(404); res.end('Not found');
+ };
+}
+
+// ---------------------------------------------------------------------------
+// Agent poll endpoints (unchanged from WS version)
+// ---------------------------------------------------------------------------
+
+function handlePollGet(req, res, url) {
+ const token = url.searchParams.get('token');
+ if (token !== state.token) {
+ res.writeHead(401, { 'Content-Type': 'application/json' });
+ res.end(JSON.stringify({ error: 'Unauthorized' }));
+ return;
+ }
+ const timeout = parseInt(url.searchParams.get('timeout') || DEFAULT_POLL_TIMEOUT, 10);
+ if (state.pendingEvents.length > 0) {
+ res.writeHead(200, { 'Content-Type': 'application/json' });
+ res.end(JSON.stringify(state.pendingEvents.shift()));
+ return;
+ }
+ const timer = setTimeout(() => {
+ const idx = state.pendingPolls.indexOf(resolve);
+ if (idx !== -1) state.pendingPolls.splice(idx, 1);
+ res.writeHead(200, { 'Content-Type': 'application/json' });
+ res.end(JSON.stringify({ type: 'timeout' }));
+ }, timeout);
+ function resolve(event) {
+ clearTimeout(timer);
+ res.writeHead(200, { 'Content-Type': 'application/json' });
+ res.end(JSON.stringify(event));
+ }
+ state.pendingPolls.push(resolve);
+ req.on('close', () => {
+ clearTimeout(timer);
+ const idx = state.pendingPolls.indexOf(resolve);
+ if (idx !== -1) state.pendingPolls.splice(idx, 1);
+ });
+}
+
+function handlePollPost(req, res) {
+ let body = '';
+ req.on('data', (c) => { body += c; });
+ req.on('end', () => {
+ let msg;
+ try { msg = JSON.parse(body); } catch {
+ res.writeHead(400, { 'Content-Type': 'application/json' });
+ res.end(JSON.stringify({ error: 'Invalid JSON' }));
+ return;
+ }
+ if (msg.token !== state.token) {
+ res.writeHead(401, { 'Content-Type': 'application/json' });
+ res.end(JSON.stringify({ error: 'Unauthorized' }));
+ return;
+ }
+ // Forward the reply to the browser via SSE
+ broadcast({ type: msg.type || 'done', id: msg.id, message: msg.message, file: msg.file, data: msg.data });
+ res.writeHead(200, { 'Content-Type': 'application/json' });
+ res.end(JSON.stringify({ ok: true }));
+ });
+}
+
+// ---------------------------------------------------------------------------
+// Lifecycle
+// ---------------------------------------------------------------------------
+
+let httpServer = null;
+
+function shutdown() {
+ try { fs.unlinkSync(LIVE_PID_FILE); } catch {}
+ if (state.sessionDir) {
+ try { fs.rmSync(state.sessionDir, { recursive: true, force: true }); } catch {}
+ }
+ for (const res of state.sseClients) { try { res.end(); } catch {} }
+ state.sseClients.clear();
+ for (const resolve of state.pendingPolls) resolve({ type: 'exit' });
+ state.pendingPolls.length = 0;
+ if (httpServer) httpServer.close();
+ process.exit(0);
+}
+
+// ---------------------------------------------------------------------------
+// Main
+// ---------------------------------------------------------------------------
+
+const args = process.argv.slice(2);
+
+if (args.includes('--help') || args.includes('-h')) {
+ console.log(`Usage: node live-server.mjs [options]
+
+Start the live variant mode server (zero dependencies).
+
+Commands:
+ (default) Start the server (foreground)
+ stop Stop the server and remove the injected live.js script tag
+ stop --keep-inject Stop the server only (leave the script tag in the HTML entry)
+
+Options:
+ --background Start detached, print connection JSON to stdout, then exit
+ --port=PORT Use a specific port (default: auto-detect starting at 8400)
+ --keep-inject Only with stop: skip live-inject.mjs --remove
+ --help Show this help
+
+Endpoints:
+ /live.js Browser script (element picker + variant cycling)
+ /detect.js Detection overlay (backwards compatible)
+ /modern-screenshot.js Vendored modern-screenshot UMD build (lazy-loaded by live.js)
+ /annotation POST raw image/png to stage a variant screenshot
+ /events SSE stream (server→browser) + POST (browser→server)
+ /poll Long-poll for agent CLI
+ /source Raw source file reader (no-HMR fallback)
+ /health Health check`);
+ process.exit(0);
+}
+
+if (args.includes('stop')) {
+ const keepInject = args.includes('--keep-inject');
+ try {
+ const info = JSON.parse(fs.readFileSync(LIVE_PID_FILE, 'utf-8'));
+ const res = await fetch(`http://localhost:${info.port}/stop?token=${info.token}`);
+ if (res.ok) console.log(`Stopped live server on port ${info.port}.`);
+ } catch {
+ console.log('No running live server found.');
+ }
+ if (!keepInject) {
+ const injectPath = path.join(__dirname, 'live-inject.mjs');
+ try {
+ const out = execFileSync(process.execPath, [injectPath, '--remove'], {
+ encoding: 'utf-8',
+ cwd: process.cwd(),
+ });
+ const line = out.trim().split('\n').filter(Boolean).pop();
+ if (line) {
+ try {
+ const j = JSON.parse(line);
+ if (j.removed === true) {
+ console.log(`Removed live script tag from ${j.file}.`);
+ }
+ } catch {
+ /* ignore non-JSON lines */
+ }
+ }
+ } catch (err) {
+ const detail = err.stderr?.toString?.().trim?.()
+ || err.stdout?.toString?.().trim?.()
+ || err.message
+ || String(err);
+ console.warn(`Note: could not remove live script tag (${detail.split('\n')[0]})`);
+ }
+ }
+ process.exit(0);
+}
+
+// --background: spawn a detached child server, wait for it to be ready,
+// print the connection JSON, then exit. This keeps the startup command
+// simple (no shell backgrounding or chained commands).
+if (args.includes('--background')) {
+ const childArgs = args.filter(a => a !== '--background');
+ const child = spawn(process.execPath, [fileURLToPath(import.meta.url), ...childArgs], {
+ detached: true,
+ stdio: 'ignore',
+ cwd: process.cwd(),
+ });
+ child.unref();
+
+ // Poll for the PID file (the child writes it once the HTTP server is listening).
+ const deadline = Date.now() + 10_000;
+ while (Date.now() < deadline) {
+ try {
+ const info = JSON.parse(fs.readFileSync(LIVE_PID_FILE, 'utf-8'));
+ if (info.pid !== process.pid) {
+ // Output JSON so the agent can read port + token from stdout.
+ console.log(JSON.stringify(info));
+ process.exit(0);
+ }
+ } catch { /* not ready yet */ }
+ await new Promise(r => setTimeout(r, 200));
+ }
+ console.error('Timed out waiting for live server to start.');
+ process.exit(1);
+}
+
+// Check for existing session
+try {
+ const existing = JSON.parse(fs.readFileSync(LIVE_PID_FILE, 'utf-8'));
+ try { process.kill(existing.pid, 0);
+ console.error(`Live server already running on port ${existing.port} (pid ${existing.pid}).`);
+ console.error('Stop it first with: node ' + path.basename(fileURLToPath(import.meta.url)) + ' stop');
+ process.exit(1);
+ } catch { fs.unlinkSync(LIVE_PID_FILE); }
+} catch {}
+
+state.token = randomUUID();
+const portArg = args.find(a => a.startsWith('--port='));
+state.port = portArg ? parseInt(portArg.split('=')[1], 10) : await findOpenPort();
+// Annotation screenshots live in the project root so the agent's Read tool
+// doesn't trip a per-file permission prompt. Sessioned by token so concurrent
+// projects (or quick restarts) don't collide.
+const annotRoot = path.join(process.cwd(), '.impeccable-live', 'annotations');
+fs.mkdirSync(annotRoot, { recursive: true });
+state.sessionDir = fs.mkdtempSync(path.join(annotRoot, 'session-'));
+
+const { detectScript, livePath } = loadBrowserScripts();
+httpServer = http.createServer(createRequestHandler({ detectScript, livePath }));
+
+httpServer.listen(state.port, '127.0.0.1', () => {
+ fs.writeFileSync(LIVE_PID_FILE, JSON.stringify({ pid: process.pid, port: state.port, token: state.token }));
+ const url = `http://localhost:${state.port}`;
+ console.log(`\nImpeccable live server running on ${url}`);
+ console.log(`Token: ${state.token}\n`);
+ console.log(`Inject: