# Repository: pbakaus/impeccable # Stars: 20203 ## CLAUDE.md # Project Instructions for Claude ## CSS Plain hand-written CSS, no Tailwind, no build step. Bun's HTML loader resolves `` and inlines `@import` chains automatically for both `bun run dev` and `bun run build`. The CSS architecture: - `public/css/main.css` - Main entry point, imports the partials and defines tokens/reset - `public/css/workflow.css` - Commands section, glass terminal, case studies styles - `public/css/gallery.css`, `skill-demos.css`, `problem-section.css` - section partials Edit any of these directly and reload — no rebuild needed. ## Development Server ```bash bun run dev # Bun dev server at http://localhost:3000 bun run preview # Build + Cloudflare Pages local preview ``` ## Deployment Hosted on Cloudflare Pages. Static assets served from `build/`, API routes handled via `_redirects` rewrites (JSON) and Pages Functions (downloads). ```bash bun run deploy # Build + deploy to Cloudflare Pages ``` ## Build System The build system compiles skills and commands from `source/` to provider-specific formats in `dist/`: ```bash bun run build # Build all providers bun run rebuild # Clean and rebuild ``` Source files use placeholders that get replaced per-provider: - `{{model}}` - Model name (Claude, Gemini, GPT, etc.) - `{{config_file}}` - Config file name (CLAUDE.md, .cursorrules, etc.) - `{{ask_instruction}}` - How to ask user questions ## Testing ```bash bun run test # Run all tests ``` Unit tests (build, detector logic) run via `bun test`. Fixture tests (jsdom-based HTML detection) run via `node --test` because bun is too slow with jsdom. The `test` script handles this split automatically. ## CLI The CLI lives in this repo under `bin/` and `src/`. Published to npm as `impeccable`. ```bash npx impeccable detect [file-or-dir-or-url...] # detect anti-patterns npx impeccable detect --fast --json src/ # regex-only, JSON output npx impeccable live # start browser overlay server npx impeccable skills install # install skills npx impeccable --help # show help ``` The browser detector (`src/detect-antipatterns-browser.js`) is generated from the main engine. After changing `src/detect-antipatterns.mjs`, rebuild it: ```bash bun run build:browser ``` **IMPORTANT**: Always use `node` (not `bun`) to run the detect CLI. Bun's jsdom implementation is extremely slow and will cause scans with HTML files to hang for minutes. ## Versioning There are three independently versioned components. Only bump the one(s) that actually changed: **CLI** (npm package): - `package.json` → `version` - Bump when: CLI code changes (`bin/`, `src/detect-antipatterns.mjs`, etc.) **Skills** (Claude Code plugin / skill definitions): - `.claude-plugin/plugin.json` → `version` - `.claude-plugin/marketplace.json` → `plugins[0].version` - Bump when: skill content changes (`source/skills/`, skill count changes, etc.) **Chrome extension**: - `extension/manifest.json` → `version` - Bump when: extension code changes (`extension/`) **Website changelog** (`public/index.html`): - Hero version link text + new changelog entry - Update for user-facing changes only, not internal build/tooling details - Use the most prominent version that changed (e.g. skills version for skill consolidation) ## Adding New Skills When adding a new user-invocable skill, update the command count in **all** of these locations: - `public/index.html` → meta descriptions, hero box, section lead - `public/cheatsheet.html` → meta description, subtitle, `commandCategories`, `commandRelationships` - `public/js/data.js` → `commandProcessSteps`, `commandCategories`, `commandRelationships` - `public/js/components/framework-viz.js` → `commandSymbols`, `commandNumbers` - `public/js/demos/commands/` → new demo file + import in `index.js` - `README.md` → intro, command count, commands table - `NOTICE.md` → steering commands count - `AGENTS.md` → intro command count - `.claude-plugin/plugin.json` → description - `.claude-plugin/marketplace.json` → metadata description + plugin description ## Evals Framework (private, gitignored) There is a controlled eval framework at `evals/` that measures whether the `/impeccable` skill improves or harms AI-generated frontend design. It runs the same brief through a model with and without the skill loaded, fingerprints every generation, and aggregates the results into a bias report. The whole `evals/` directory is gitignored — it's intended to stay private (commercial). **If you're picking up eval work in a new session, read `evals/AGENT.md` first.** It captures everything we've learned: model choices, sample size policy, lessons learned, common workflows, and gotchas. Don't try to reinvent the workflow from scratch — there's significant prior context. ### Quick orientation - **Primary baseline model**: `gpt-5.4` with `--reasoning-effort medium`. Frontier intelligence at ~5-10× lower cost than high reasoning. **Do NOT use `--reasoning-effort high`** unless you specifically need it — reasoning tokens count against `max_completion_tokens` and burn ~$1-2/file with no quality benefit for our use case. - **Secondary validation model**: `qwen/qwen3.6-plus` via OpenRouter. Cheap-ish, decent design quality, no reasoning controls. - **Do NOT use Haiku as a primary eval target.** It ignores most negative rules in the skill. We learned this the hard way — it sent us down many wrong paths early on. - **Sample size policy**: n=10 per niche for scratch iteration, **n=20 for sweep validation (the standard)**, n=50 reserved for the final published baseline. n=20 is the smallest sample where rare detector findings stabilize and A/B comparisons are statistically meaningful. ### Quick commands ```bash # Always start the local server first — the gallery/viewer can't load via file:// (CORS) bun run evals/runner/serve.ts # Standard workflow: generate → detect → aggregate → snapshot bun run evals/runner/run.ts --with-refs --model gpt-5.4 --reasoning-effort medium bun run evals/runner/detect.ts bun run evals/runner/aggregate.ts bun run evals/runner/snapshot.ts --title "..." --note "..." # Cheap targeted iteration (does not pollute current/) bun run evals/runner/run.ts --with-refs --scratch my-test \ --niches 06 --n 10 --condition skill-on --model qwen/qwen3.6-plus # View results in browser open http://localhost:8723/viewer.html ``` ### Critical rules - **Always run a small smoke test (n=2-5 on one niche) before any sweep.** Rate degrades over long runs and time estimates can be off by 10-20×. We once burned 11+ hours on a sweep estimated to take 40 minutes. - **Background long runs.** Use `run_in_background: true` for any sweep over ~50 generations. The runner is resumable so killing and restarting is safe. - **Don't mix prompt versions in the same dataset.** The variant.json safety check enforces this for `current/` (must pass `--rebuild-skill-on` after a prompt edit). Scratch dirs auto-wipe on prompt change. - **Snapshot first, change second.** Always have a known reference point in `evals/output/snapshots/` before editing the skill, so you can compare before/after. - **The user is the source of truth on aesthetic quality.** The fingerprinter and detector are useful signals but do not measure "is this design good?" Have the user spot-check the gallery for any meaningful change. See `evals/AGENT.md` for the full reference: detailed model comparison table, complete lessons learned, all common workflows, and the list of gotchas. ## README.md # Impeccable The vocabulary you didn't know you needed. 1 skill, 18 commands, and curated anti-patterns for impeccable frontend design. > **Quick start:** Visit [impeccable.style](https://impeccable.style) to download ready-to-use bundles. ## Why Impeccable? Anthropic created [frontend-design](https://github.com/anthropics/skills/tree/main/skills/frontend-design), a skill that guides Claude toward better UI design. Impeccable builds on that foundation with deeper expertise and more control. Every LLM learned from the same generic templates. Without guidance, you get the same predictable mistakes: Inter font, purple gradients, cards nested in cards, gray text on colored backgrounds. Impeccable fights that bias with: - **An expanded skill** with 7 domain-specific reference files ([view source](source/skills/impeccable/)) - **18 steering commands** to audit, review, polish, distill, animate, and more - **Curated anti-patterns** that explicitly tell the AI what NOT to do ## What's Included ### The Skill: impeccable A comprehensive design skill with 7 domain-specific references ([view skill](source/skills/impeccable/SKILL.md)): | Reference | Covers | |-----------|--------| | [typography](source/skills/impeccable/reference/typography.md) | Type systems, font pairing, modular scales, OpenType | | [color-and-contrast](source/skills/impeccable/reference/color-and-contrast.md) | OKLCH, tinted neutrals, dark mode, accessibility | | [spatial-design](source/skills/impeccable/reference/spatial-design.md) | Spacing systems, grids, visual hierarchy | | [motion-design](source/skills/impeccable/reference/motion-design.md) | Easing curves, staggering, reduced motion | | [interaction-design](source/skills/impeccable/reference/interaction-design.md) | Forms, focus states, loading patterns | | [responsive-design](source/skills/impeccable/reference/responsive-design.md) | Mobile-first, fluid design, container queries | | [ux-writing](source/skills/impeccable/reference/ux-writing.md) | Button labels, error messages, empty states | ### 18 Commands | Command | What it does | |---------|--------------| | `/impeccable teach` | One-time setup: gather design context, save to config | | `/impeccable craft` | Full shape-then-build flow with visual iteration | | `/impeccable extract` | Pull reusable components and tokens into the design system | | `/audit` | Run technical quality checks (a11y, performance, responsive) | | `/critique` | UX design review: hierarchy, clarity, emotional resonance | | `/polish` | Final pass, design system alignment, and shipping readiness | | `/distill` | Strip to essence | | `/clarify` | Improve unclear UX copy | | `/optimize` | Performance improvements | | `/harden` | Error handling, onboarding, i18n, edge cases | | `/animate` | Add purposeful motion | | `/colorize` | Introduce strategic color | | `/bolder` | Amplify boring designs | | `/quieter` | Tone down overly bold designs | | `/delight` | Add moments of joy | | `/adapt` | Adapt for different devices | | `/typeset` | Fix font choices, hierarchy, sizing | | `/layout` | Fix layout, spacing, visual rhythm | | `/overdrive` | Add technically extraordinary effects | #### Usage Examples **`/audit`** - Run quality checks, get a report (no edits) ``` /audit blog # Audit blog hub + post pages /audit dashboard # Check dashboard components /audit checkout flow # Focus on checkout UX ``` *When to use:* Before making changes, to understand what needs fixing. **`/normalize`** - Align with design system ``` /normalize blog # Apply design tokens, fix spacing /normalize buttons # Standardize button styles ``` *When to use:* After audit, to fix inconsistencies. **`/critique`** - UX design review ``` /critique landing page # Review landing page UX /critique onboarding # Check onboarding flow ``` *When to use:* When you want design feedback, not technical fixes. **`/polish`** - Final pass before shipping ``` /polish feature modal # Clean up modal before release /polish settings page # Final review of settings UI ``` *When to use:* Last step before deploying to production. **Combining commands:** ``` /audit /normalize /polish blog # Full workflow: audit → fix → polish /critique /harden checkout # UX review + add error handling ``` ### Anti-Patterns The skill includes explicit guidance on what to avoid: - Don't use overused fonts (Arial, Inter, system defaults) - Don't use gray text on colored backgrounds - Don't use pure black/gray (always tint) - Don't wrap everything in cards or nest cards inside cards - Don't use bounce/elastic easing (feels dated) ## See It In Action Visit [impeccable.style](https://impeccable.style#casestudies) to see before/after case studies of real projects transformed with Impeccable commands. ## Installation ### Option 1: Download from Website (Recommended) Visit [impeccable.style](https://impeccable.style), download the ZIP for your tool, and extract to your project. ### Option 2: Copy from Repository **Cursor:** ```bash cp -r dist/cursor/.cursor your-project/ ``` > **Note:** Cursor skills require setup: > 1. Switch to Nightly channel in Cursor Settings → Beta > 2. Enable Agent Skills in Cursor Settings → Rules > > [Learn more about Cursor skills](https://cursor.com/docs/context/skills) **Claude Code:** ```bash # Project-specific cp -r dist/claude-code/.claude your-project/ # Or global (applies to all projects) cp -r dist/claude-code/.claude/* ~/.claude/ ``` **OpenCode:** ```bash cp -r dist/opencode/.opencode your-project/ ``` **Pi:** ```bash cp -r dist/pi/.pi your-project/ ``` **Gemini CLI:** ```bash cp -r dist/gemini/.gemini your-project/ ``` > **Note:** Gemini CLI skills require setup: > 1. Install preview version: `npm i -g @google/gemini-cli@preview` > 2. Run `/settings` and enable "Skills" > 3. Run `/skills list` to verify installation > > [Learn more about Gemini CLI skills](https://geminicli.com/docs/cli/skills/) **Codex CLI:** ```bash cp -r dist/codex/.codex/* ~/.codex/ ``` **Trae:** ```bash # Trae China (domestic version) cp -r dist/trae/.trae-cn/skills/* ~/.trae-cn/skills/ # Trae International cp -r dist/trae/.trae/skills/* ~/.trae/skills/ ``` > **Note:** Trae has two versions with different config directories: > - **Trae China**: `~/.trae-cn/skills/` > - **Trae International**: `~/.trae/skills/` > > After copying, restart Trae IDE to activate the skills. **Rovo Dev:** ```bash # Project-specific cp -r dist/rovo-dev/.rovodev your-project/ # Or global (applies to all projects) cp -r dist/rovo-dev/.rovodev/skills/* ~/.rovodev/skills/ ``` ## Usage Once installed, use commands in your AI harness: ``` /audit # Find issues /normalize # Fix inconsistencies /polish # Final cleanup /distill # Remove complexity ``` Most commands accept an optional argument to focus on a specific area: ``` /audit header /polish checkout-form ``` **Note:** Codex CLI uses a different syntax: `/prompts:audit`, `/prompts:polish`, etc. ## CLI Impeccable includes a standalone CLI for detecting anti-patterns without an AI harness: ```bash npx impeccable detect src/ # scan a directory npx impeccable detect index.html # scan an HTML file npx impeccable detect https://example.com # scan a URL (Puppeteer) npx impeccable detect --fast --json . # regex-only, JSON output ``` The detector catches 24 issues across AI slop (side-tab borders, purple gradients, bounce easing, dark glows) and general design quality (line length, cramped padding, small touch targets, skipped headings, and more). ## Supported Tools - [Cursor](https://cursor.com) - [Claude Code](https://claude.ai/code) - [OpenCode](https://opencode.ai) - [Pi](https://pi.dev) - [Gemini CLI](https://github.com/google-gemini/gemini-cli) - [Codex CLI](https://github.com/openai/codex) - [VS Code Copilot](https://code.visualstudio.com) - [Kiro](https://kiro.dev) - [Trae](https://trae.ai) - [Rovo Dev](https://www.atlassian.com/software/rovo) ## Contributing See [DEVELOP.md](DEVELOP.md) for contributor guidelines and build instructions. ## License Apache 2.0. See [LICENSE](LICENSE). The impeccable skill builds on [Anthropic's original frontend-design skill](https://github.com/anthropics/skills/tree/main/skills/frontend-design). See [NOTICE.md](NOTICE.md) for attribution. --- Created by [Paul Bakaus](https://www.paulbakaus.com)