⏳ This skill is pending AI review.

Scores will appear once the review pipeline completes.

v4.10.0

impeccable

@pbakaus⭐ 113.2k stars

Use when the user wants to design, redesign, shape, critique, audit, polish, simplify, harden, animate, or otherwise improve a frontend interface: websites, landing pages, dashboards, product UI, components, forms, settings, onboarding, empty states, and native iOS or Android screens. Handles UX review, hierarchy, layout, typography, color, motion, UX copy, accessibility, responsive behavior, edge cases, and capturing or documenting design systems (DESIGN.md, tokens). Also for making bland UI bolder, loud UI quieter, or ambitious visual effects. Not for backend-only or non-UI tasks.

Choose how to use this skill

You do not need every option. Choose the path your AI client supports. The stable page stays the same; versioned files are immutable.

1. Native installer

This listing has no registered native installer command. Use the complete package or source fallback below, depending on what your client supports.

Do not guess an installer command or replace an existing version without reviewing the diff.

2. Complete package recommended

Download the ZIP when available. It includes SKILL.md plus the references, security notes and version metadata.

No complete ProSkills package is published for this listing yet.

3. Prompt-only

Copy the prompt above when the agent can read the stable page or when you want to adopt the workflow without installing a skill.

Need only the instruction file?

Download SKILL.md only if your client requires a single file. The complete ZIP is safer for a full installation because it preserves the references and release context.

No path installs or executes anything by itself. Your agent still needs access to the project files. Before updating, compare the installed version and review the diff.

—/10

// RATINGS

⭐GitHub Stars
⭐⭐⭐⭐⭐ 113.2k on GitHubGitHub ↗

Very popular

🟢ProSkills Score
—
📍

Not yet listed on ClawHub or SkillsMP

// README

Impeccable

The design vocabulary for your coding agent. Steer with polish and bolder, review with critique and audit, and catch AI slop before it ships.

From your project root:

npx impeccable install

Reload your coding tool, then run /impeccable init in your agent ($impeccable init on Codex).

Works with Claude Code, Cursor, Codex CLI, GitHub Copilot, Devin, Replit Agent, Gemini CLI, Grok Build, OpenCode, Google Antigravity, Kiro, Trae, Rovo Dev, Qoder, Mistral Vibe, Pi, Hermes Agent, DeepSeek Harness, and Veto. Full docs live at impeccable.style/docs.

Without ImpeccableWith Impeccable
Villa Castagneto built without Impeccable: cream background, a thin serif headline with an italic accent, two pill buttons, and flat vector illustrations in rounded cardsVilla Castagneto built with Impeccable: a full-bleed engraved night scene of the villa on its cliff above the sea, a condensed cream and vermilion headline, and a month strip along the bottom

Same model (Fable 5.1), same brief: a fourteen-room family guesthouse on the Ligurian coast. Without Impeccable, it builds the tasteful default: cream page, thin serif, italic accent, pill buttons. With it, the page is built around one picture: the house at night, seen from the water.

For a full project, see the Neo Mirai case study: a conference site taken from mockup to shipped page.

Why

Inter for everything. Purple-to-blue gradients. Cards nested in cards, gray text on colored backgrounds, a rounded-square icon tile above every heading. Ask an agent for a page with no other guidance and these show up again and again, across models and projects.

  • Words for what you want. "Make it pop" leaves your agent to guess. /impeccable bolder the pricing cards loads a playbook written for that one move and points it at one target.
  • A reviewer. critique scores the design against usability heuristics and ranks what to fix first. audit checks accessibility, performance, theming, and responsive behavior, with findings ranked P0 (blocking) to P3 (polish).
  • A slop detector. 62 deterministic rules flag the tells above, plus quality problems like cramped padding and skipped headings. No LLM, no API key.

Impeccable is strongest on interfaces that already exist: point it at a page or a component and iterate. It builds new pages too; see Build something new for how to get the most out of that harder mode. To start, pick one component:

/impeccable critique the pricing cards

How it works

Run /impeccable init once per project. It reads your code, asks only what it can't infer (who the product is for, what it needs to do, the constraints), and writes PRODUCT.md. Every later command reads it. Run /impeccable document to capture your existing visual system in DESIGN.md, so changes stay on-brand. More on context files.

Then name a command and a target:

/impeccable critique the onboarding flow
/impeccable quieter the landing page
/impeccable polish settings
/impeccable harden checkout

Or just describe what you want: /impeccable redo this hero section. Narrow targets get better results; a single section reviewed closely beats a whole page at a glance. Pin a command you use often with /impeccable pin audit to get /audit as its own shortcut.

24 commands

Commands
Steerbolder amplifies safe designs · quieter tones down loud ones · distill removes what the page doesn't need · colorize brings color to a gray interface · typeset fixes fonts, hierarchy, and sizing · layout fixes spacing and rhythm · animate adds transitions and interaction feedback · delight adds personality · overdrive goes for shaders, spring physics, and scroll-driven effects
Reviewcritique is a scored UX review · audit is a technical quality report
Finishpolish is the final pass before shipping · harden covers errors, i18n, overflow, and edge cases · clarify rewrites unclear copy · adapt handles screen sizes and devices · optimize fixes loading and rendering performance · onboard designs first-run flows and empty states
Iterate livelive lets you pick an element in the browser and cycle through variants · generate produces variants of a named element without manual picking
Plan and set upshape plans UX before code · init writes PRODUCT.md · document writes DESIGN.md · extract pulls repeated patterns into your design system

The 24th, craft, is a deprecated alias for a plain build request. Type /impeccable alone to see the list in your agent. Each command has its own page: impeccable.style/docs.

On Codex, open /skills or type $impeccable instead of the slash command.

Live mode

/impeccable live opens your running dev server with an overlay. Select an element, pick a direction, and Impeccable hot-swaps variants in place. Accept one and it is written back to your source. It works with Vite, Next, SvelteKit, Astro, Nuxt, and plain HTML. Iterate in the browser.

Live mode edits a local checkout only; don't inject it into a deployed site or weaken a production CSP to make it work. Applying copy edits runs your package.json's optional impeccable:manual-edit-validate script with your permissions, so review it before using live mode in an unfamiliar repo.

Apply sends staged copy edits to your chat agent while a live session is polling. If none has polled in the last minute, it runs the codex CLI from your PATH instead (or claude when codex is missing), with approvals, permission checks, and sandboxing off (--dangerously-bypass-approvals-and-sandbox or --permission-mode bypassPermissions) and your environment inherited. Its prompt carries the staged edits, the edited elements' HTML and nearby text, the page URL, and candidate source paths. Set IMPECCABLE_LIVE_COPY_AGENT=chat in the environment that starts live mode to keep Apply in your chat session, or off to disable Apply. The server reads it once at startup.

Three ways to run the detector

In your agent. The design hook scans every UI file your agent edits and hands the findings back before the agent calls the work done. This is where most slop gets caught: without the hook, the detector only runs when someone remembers to run it. It's available on Claude Code, Cursor, Codex, GitHub Copilot, Grok Build, and Hermes Agent, and the installer sets it up. Say yes. Automatic design checks.

In CI or your terminal. The CLI needs no agent:

npx impeccable detect src/                   # scan a directory
npx impeccable detect https://example.com    # scan a rendered page (uses your installed Chrome or Edge)
npx impeccable detect --json .               # machine-readable output
npx impeccable detect --github src/          # GitHub Actions annotations
npx impeccable detect --sarif src/           # SARIF 2.1.0 for code scanning
npx impeccable detect --list-rules           # every rule with its id and description
npx impeccable detect --report-unused-ignores src/  # inline ignores that waive nothing

GitHub code scanning keeps these alerts on the pull request, lets reviewers dismiss them, and fails only on findings that are new in that PR. --github annotates a single Actions run; --sarif is the log you upload:

permissions:
  contents: read
  security-events: write
steps:
  - uses: actions/checkout@v4
  - run: npx impeccable detect --sarif src/ > impeccable.sarif || test $? -eq 2
  - uses: github/c

// HOW IT'S BUILT

// FILES

64 files shipped with this skill. Inline text is the catalog copy. The upstream link is the source repository.

  • .agent/skills/impeccable/SKILL.md13 KBd60e06e2e624upstream ↗
    ---
    name: impeccable
    description: "Use when the user wants to design, redesign, shape, critique, audit, polish, simplify, harden, animate, or otherwise improve a frontend interface: websites, landing pages, dashboards, product UI, components, forms, settings, onboarding, empty states, and native iOS or Android screens. Handles UX review, hierarchy, layout, typography, color, motion, UX copy, accessibility, responsive behavior, edge cases, and capturing or documenting design systems (DESIGN.md, tokens). Also for making bland UI bolder, loud UI quieter, or ambitious visual effects. Not for backend-only or non-UI tasks."
    version: 4.10.0
    license: Apache 2.0
    allowed-tools:
      - Bash(npx impeccable *)
      - Bash(.agent/skills/impeccable/scripts/impeccable *)
    ---
    
    This skill gives you the tools and permission to make design that earns the name out-of-distribution craft. Work as an award-winning design director would: production-grade code, a clear POV, a deep grasp of what the client and its users need, and exceptional craft.
    
    Core principles:
    - Finish the job. No hedging, no shortcuts: the deliverable is complete, except assets the user must provide.
    - Scale ambition to the surface's mode (see Modes). Persuade and Experience get full commitment: bold, distinct work with a point of view. On Operate and Read, ambition shows as precision and restraint, and patterns the visitor already knows earn their place.
    - Verify by looking at the rendered result at the sizes it ships at (web: `.agent/skills/impeccable/scripts/impeccable shot <page>`), and batch the checks: fix what one look shows before looking again.
    
    ## Setup
    
    1. Run `<skill-base-dir>/scripts/impeccable context` once per session, where `<skill-base-dir>` is the directory that contains this SKILL.md (the skill folder, not a plugin root two levels above it); keep cwd at the user's project. That base directory resolves every `.agent/skills/impeccable/scripts/impeccable <verb>` command in this skill and its references, and `.agent/skills/impeccable/scripts` is the fallback only when the runtime reports no base directory. On a Windows shell without `sh`, call `.agent/skills/impeccable/scripts/impeccable.cmd` instead. The launcher runs a self-contained binary that ships next to it or is downloaded once on first run; no Node or other runtime is required. Pass a named source file or route as `--target <path>`. It loads PRODUCT.md and DESIGN.md (long ones as a map: read the sections your task needs), the matching surface brief, and native-platform guidance when applicable; follow its directives and do not rerun it.
    2. Load the request's playbook: its Commands-table reference for an explicit/implied sub-command, or [reference/new-work.md](reference/new-work.md) for a new surface, a replacement visual world, or a build from an approved comp. Some playbooks come in parts; read the part this request needs in the same step: [reference/new-work-world.md](reference/new-work-world.md) when a visual world is created or replaced (a redesign, a new look, or no established world), [reference/new-work-comp.md](reference/new-work-comp.md) for a build from an approved comp or on a comp-led build path, and [reference/critique-rubric.md](reference/critique-rubric.md) for a critique whose Assessment A runs in this context (a native platform, or no sub-agent tool); a delegated Assessment A gets the rubric's path in its prompt instead. Inspect target and incumbent visual truth before editing. When the app cannot run, start with committed visual-regression goldens or screenshot fixtures; verify target and freshness against current tokens, CSS, components, or assets, resolve conflicts, and compare theme/variant captures.
    3. After resolving analysis and direction, read [reference/craft-floor.md](reference/craft-floor.md) immediately before any UI edit, including small refinements. It carries the quality floor, the absolute bans, and the reflexes no detector catches. Do not load it for planning-only work.
    
    **Launcher unavailable:** On the first refusal or failure, don’t retry; send a separate message **before the next tool call**: “Context loading did not run; I’ll read the existing project context directly.” Then read existing PRODUCT.md and DESIGN.md without inventing missing context, follow applicable steps 2–3, including reading [reference/craft-floor.md](reference/craft-floor.md) immediately before any UI edit, and continue through permitted tools. This applies to planning and editing; launcher failure alone does not block either.
    
    ## How to design
    
    - **The brief wins.** Honor pinned aesthetics, eras, materials, fonts, and palettes even when they conflict with a saturated-pattern warning. Redirecting a clear brief toward your taste is failure.
    - **Refinement preserves; redesign replaces.** Refinement keeps the incumbent identity, behavior, copy, and everything outside scope. Ask before replacing factual copy or adding claims. Redesign keeps product truth, content, function, native affordances, and constraints, but treats the old look as evidence and anti-reference; choose a replacement world in new-work and replace DESIGN.md. Never split the difference into polish on the discarded look.
    - **Loaded symbols stay out of the decoration.** A subject's world does not license emblems tied to militarism, supremacy, or hate movements as motifs, badges, or ornament, such as the Rising Sun flag's rays, the Confederate battle flag, or Nazi-era insignia and their stylised variants; reach for that world's neutral forms instead. Content that documents such a symbol as fact stays as it is.
    - **Visual authority is evidence, not a filename.** Missing DESIGN.md alone does not make a project greenfield; new-work decides whether to preserve, expand, or replace the incumbent world.
    
    ## Modes
    
    The mode names what the visitor's success looks like on this surface.
    
    - **Persuade:** the visitor decides and acts; design is the product. Landing pages, marketing, campaigns, pricing. Earn attention and action. Ship real imagery when the brief needs it; follow the committed world, not category habit.
    - **Operate:** the visitor completes a task. App UI, dashboards, editors, admin, settings, tools. Scanability, consistency, native expectations, and the real usage scene outrank expression. Brand lives in precise details.
    - **Read:** the visitor understands something. Docs, articles, guides, help, changelogs. Structure for comprehension, then make the reading experience worth staying in.
    - **Experience:** the visitor is inside the work itself. Portfolios, galleries, showcases. Let the artifact lead from the first viewport; the interface recedes.
    
    Choose the mode from the requested surface, not the product, and persist it only in that surface brief. A tool's landing page is still Persuade; a fashion house's documentation is still Read; a docs index is Read, not Persuade. See [new-work.md](reference/new-work.md) for new surfaces and [operate.md](reference/operate.md) for deeper Operate/Read guidance.
    
    ## Commands
    
    | Command | Category | Description | Reference |
    |---|---|---|---|
    | `craft [feature]` | Build | Deprecated alias for an ordinary new-work request | [reference/craft.md](reference/craft.md) |
    | `shape [feature]` | Build | Plan UX/UI before writing code | [reference/shape.md](reference/shape.md) |
    | `init` | Build | Capture durable product context in PRODUCT.md | [reference/init.md](reference/init.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) · native: [reference/audit.native.md](reference/audit.native.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) · native: [reference/adapt.native.md](reference/adapt.native.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, iterate on alternatives | [reference/live.md](reference/live.md) |
    | `generate [n] [action] [element]` | Iterate | Variants, versions, or alternatives of a named element to choose from in the live browser; no manual picking | [reference/generate.md](reference/generate.md) |
    
    Routing:
    
    - **No argument:** read [routing.md](reference/routing.md) and present its context-aware menu; never auto-run a command.
    - **Explicit or clearly implied request to run a command:** load its reference (native variant on native platforms) and follow it. Ask once if two commands fit.
    - **Workflow or command-selection question:** read [Workflow questions](reference/routing.md#workflow-questions).
    - **Otherwise:** treat the request as general design work. Missing PRODUCT.md routes a new surface or replacement world through init, then new-work; a narrow refinement of existing code proceeds on the incumbent implementation as `impeccable context` directs, offering init afterward rather than blocking on it.
    - `teach` aliases `init`. `craft` is a deprecated alias for ordinary new-work and adds nothing. `shape` owns task discovery, then enters new-work only for visual-world and surface-concept decisions.
    
    After init writes PRODUCT.md, resume without rerunning `impeccable context`; init loads the native platform reference itself when the platform it recorded is `ios`, `android`, or `adaptive`.
    
    **Pin / Unpin:** `.agent/skills/impeccable/scripts/impeccable pin <pin|unpin> <command>` creates or removes a standalone `/<command>` shortcut. Report the script's result concisely; relay stderr verbatim on error.
    
    **Hooks:** `/impeccable hooks <on|off|status|ignore-rule|ignore-file|ignore-value|reset>` manages the design detector hook for this project (auto-runs the detector after UI file edits and surfaces findings). Load [reference/hooks.md](reference/hooks.md) when the user invokes it with any argument.
    
    **Doctor:** `/impeccable doctor` reports and repairs drift between this project's Impeccable artifacts (PRODUCT.md, DESIGN.md and its sidecar, config, surface briefs, the hook) and what this version reads. Load [reference/doctor.md](reference/doctor.md) when the user invokes it, or when they ask what is out of date, stale, or needs refreshing. A `CONTEXT_STALE` directive in Setup's output is the cheap subset of the same report; act on it there per its own instructions rather than running doctor unasked.
    
    **Foundations:** `/impeccable foundations` runs `.agent/skills/impeccable/scripts/impeccable foundations` and walks the user through the product-foundations roadmap (secrets, 404 page, icons, CI and more); `/impeccable foundations <id>` fixes that one item. Load [reference/foundations.md](reference/foundations.md) when the user invokes it.
    
    **Never repair drift as a side effect of a design task.** A `CONTEXT_STALE` finding is reported, not acted on, unless the user asks. The one exception is a finding marked `auto`, which the next write to that file performs anyway.
  • .agent/skills/impeccable/scripts/command-metadata.json8.1 KB4686bb6deea6upstream ↗
    {
      "craft": {
        "description": "Deprecated compatibility alias for an ordinary Impeccable new-work request. It adds no behavior; natural build and redesign requests use the same flow.",
        "argumentHint": "[feature description]"
      },
      "init": {
        "description": "Sets up a project for impeccable. Runs a multi-round discovery interview when context is missing and writes PRODUCT.md (strategic: users, brand, principles); pre-configures live mode; then recommends the best commands to run next. Every other command reads these files before doing work. Use once per project.",
        "argumentHint": ""
      },
      "document": {
        "description": "Generate a DESIGN.md file that captures the current visual design system. Auto-extracts colors, typography, spacing, radii, and component patterns from the codebase, then asks the user to confirm descriptive language for atmosphere and color character. Follows the Google Stitch DESIGN.md format so the file is tool-compatible. Use when you need a visual design spec an AI agent can follow to stay on-brand.",
        "argumentHint": ""
      },
      "extract": {
        "description": "Pull reusable patterns, components, and design tokens into the design system. Identifies repeated patterns and consolidates them. Use when you have drift across the codebase and want to bring things back to a consistent system.",
        "argumentHint": "[target]"
      },
      "live": {
        "description": "Interactive live variant mode. Select elements in the browser, pick a design action, and get AI-generated HTML+CSS variants hot-swapped via HMR. Requires a running dev server. Use when you want to visually experiment with design alternatives in real time.",
        "argumentHint": ""
      },
      "generate": {
        "description": "Agent-driven live variant generation. Boots live mode, finds the named element on the open page, scrolls the browser to it, and delivers N variants in the requested direction for the user to cycle and accept. Use for requests that name an element and a direction, like 'generate 3 bold variants of the pricing cards', skipping manual element picking.",
        "argumentHint": "[count] [direction] variants of [element]"
      },
      "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.",
        "argumentHint": "[target] [context (mobile, tablet, print...)]"
      },
      "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.",
        "argumentHint": "[target]"
      },
      "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.",
        "argumentHint": "[area (feature, page, component...)]"
      },
      "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.",
        "argumentHint": "[target]"
      },
      "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.",
        "argumentHint": "[target]"
      },
      "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.",
        "argumentHint": "[target]"
      },
      "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.",
        "argumentHint": "[area (feature, page, component...)]"
      },
      "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.",
        "argumentHint": "[target]"
      },
      "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.",
        "argumentHint": "[target]"
      },
      "harden": {
        "description": "Make interfaces production-ready: error handling, i18n, text overflow, edge case management, and resilience under real-world data. Use when the user asks to harden, make production-ready, handle edge cases, add error states, or fix overflow and i18n issues.",
        "argumentHint": "[target]"
      },
      "onboard": {
        "description": "Design onboarding flows, first-run experiences, and empty states that guide new users to value. Covers welcome screens, account setup, progressive disclosure, contextual tooltips, feature announcements, and activation moments. Use when the user mentions onboarding, first-time users, empty states, activation, getting started, new user flows, or the aha moment.",
        "argumentHint": "[target]"
      },
      "layout": {
        "description": "Improve layout, spacing, and visual rhythm. Fixes monotonous grids, inconsistent spacing, and weak visual hierarchy. Use when the user mentions layout feeling off, spacing issues, visual hierarchy, crowded UI, alignment problems, or wanting better composition.",
        "argumentHint": "[target]"
      },
      "optimize": {
        "description": "Diagnoses and fixes UI performance across loading speed, rendering, animations, images, and bundle size. Use when the user mentions slow, laggy, janky, performance, bundle size, load time, or wants a faster, smoother experience.",
        "argumentHint": "[target]"
      },
      "overdrive": {
        "description": "Pushes interfaces past conventional limits with technically ambitious implementations — shaders, spring physics, scroll-driven reveals, 60fps animations. Use when the user wants to wow, impress, go all-out, or make something that feels extraordinary.",
        "argumentHint": "[target]"
      },
      "polish": {
        "description": "Performs a final quality pass fixing alignment, spacing, consistency, and micro-detail issues before shipping. Use when the user mentions polish, finishing touches, pre-launch review, something looks off, or wants to go from good to great.",
        "argumentHint": "[target]"
      },
      "quieter": {
        "description": "Tones down visually aggressive or overstimulating designs, reducing intensity while preserving quality. Use when the user mentions too bold, too loud, overwhelming, aggressive, garish, or wants a calmer, more refined aesthetic.",
        "argumentHint": "[target]"
      },
      "shape": {
        "description": "Plan UX and UI before code. Runs a discovery interview (one round by default), uses visual probes when available, and produces a user-confirmed design brief for implementation.",
        "argumentHint": "[feature to shape]"
      },
      "typeset": {
        "description": "Improves typography by fixing font choices, hierarchy, sizing, weight, and readability so text feels intentional. Use when the user mentions fonts, type, readability, text hierarchy, sizing looks off, or wants more polished, intentional typography.",
        "argumentHint": "[target]"
      }
    }
    
  • .agent/skills/impeccable/scripts/data/font-index-failures.json2.4 KB1aca67220413upstream ↗
    [
     {
      "family": "Betania Patmos GDL",
      "weight": 400,
      "category": "handwriting",
      "variable": false,
      "reason": "not loaded or no lettering"
     },
     {
      "family": "Betania Patmos In GDL",
      "weight": 400,
      "category": "handwriting",
      "variable": false,
      "reason": "not loaded or no lettering"
     },
     {
      "family": "Doto",
      "weight": 300,
      "category": "sans",
      "variable": true,
      "reason": "not loaded or no lettering"
     },
     {
      "family": "Doto",
      "weight": 700,
      "category": "sans",
      "variable": true,
      "reason": "not loaded or no lettering"
     },
     {
      "family": "Jacquard 12 Charted",
      "weight": 400,
      "category": "display",
      "variable": false,
      "reason": "not loaded or no lettering"
     },
     {
      "family": "Jacquard 24 Charted",
      "weight": 400,
      "category": "display",
      "variable": false,
      "reason": "not loaded or no lettering"
     },
     {
      "family": "Jacquarda Bastarda 9 Charted",
      "weight": 400,
      "category": "display",
      "variable": false,
      "reason": "not loaded or no lettering"
     },
     {
      "family": "Jersey 10 Charted",
      "weight": 400,
      "category": "display",
      "variable": false,
      "reason": "not loaded or no lettering"
     },
     {
      "family": "Jersey 15 Charted",
      "weight": 400,
      "category": "display",
      "variable": false,
      "reason": "not loaded or no lettering"
     },
     {
      "family": "Jersey 20 Charted",
      "weight": 400,
      "category": "display",
      "variable": false,
      "reason": "not loaded or no lettering"
     },
     {
      "family": "Jersey 25 Charted",
      "weight": 400,
      "category": "display",
      "variable": false,
      "reason": "not loaded or no lettering"
     },
     {
      "family": "Micro 5 Charted",
      "weight": 400,
      "category": "display",
      "variable": false,
      "reason": "not loaded or no lettering"
     },
     {
      "family": "Montserrat Underline",
      "weight": 400,
      "category": "sans",
      "variable": true,
      "reason": "not loaded or no lettering"
     },
     {
      "family": "Montserrat Underline",
      "weight": 700,
      "category": "sans",
      "variable": true,
      "reason": "not loaded or no lettering"
     },
     {
      "family": "Redacted",
      "weight": 400,
      "category": "display",
      "variable": false,
      "reason": "not loaded or no lettering"
     },
     {
      "family": "Yarndings 12 Charted",
      "weight": 400,
      "category": "display",
      "variable": false,
      "reason": "not loaded or no lettering"
     },
     {
      "family": "Yarndings 20 Charted",
      "weight": 400,
      "category": "display",
      "variable": false,
      "reason": "not loaded or no lettering"
     }
    ]
  • .agent/skills/impeccable/scripts/data/font-index.json1.0 MB9d2029971df2upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/scripts/engine-checksums.txt787 B3b4802ad2975upstream ↗
    # Engine binary digests for the pinned ENGINE_VERSION: <engine-version> <asset> <sha256>.
    # The launchers, the npm shim, `impeccable install` and scripts/fetch-engine.mjs verify
    # every engine download against this file. Written by
    # `node scripts/check-engine-release.mjs --record` after each engine release.
    0.1.27 impeccable-darwin-arm64 e33578341212fe6ebeed273850b3af0a7f54bbdc5e9fdf03e760aae23482975b
    0.1.27 impeccable-darwin-x64 3ecf11185ad7ea05cfc693ef969eb75ee7aef63f45472bf884e9b9f896a8d052
    0.1.27 impeccable-linux-x64 41d66e945bcdfc560005b61ad0b6b2312b124890039262f2e63322ef2709ccfd
    0.1.27 impeccable-linux-arm64 6ceb6188c80adb4b4fcc0721e677e2124d795b8e243599ad0d7bea33369b2c9c
    0.1.27 impeccable-windows-x64.exe ba9627d4552bca5666020624d8e994aea8b8b44c46b995e18b5babad0f431fc8
    
  • .agent/skills/impeccable/scripts/impeccable13 KB502652747b67upstream ↗
    #!/bin/sh
    # Impeccable launcher. Runs the platform binary shipped next to this script:
    #   <this dir>/bin/<os>-<arch>/impeccable
    # Order: $IMPECCABLE_BIN, the sibling binary, ~/.impeccable/bin/impeccable,
    # the version-pinned cache, then `impeccable` on PATH. Never needs Node.
    # The unversioned home binary and the PATH candidate are validated with the
    # engine-probe handshake first: the retired 3.x npm CLI also installed a bin
    # named `impeccable`, and exec'ing it would fail every verb with
    # "Unknown command". The sibling binary must also report the version in
    # VERSION: it is gitignored, so a skill upgrade that copies files over this
    # directory leaves the old engine in place. A local build of the same version
    # passes, which is why it is not hashed. IMPECCABLE_BIN is the operator's
    # explicit choice and is exec'd without a probe. The version-pinned cache and
    # the download are verified against engine-checksums.txt (next to this
    # script), never against anything published beside the binary; a
    # <binary>.verified stamp holding the manifest digest and the binary's size
    # skips rehashing until either changes or the binary is newer than the stamp.
    # No path hashes on every run: hooks run this launcher on every edit.
    set -eu
    
    # True when the candidate answers the engine handshake (prints
    # "impeccable-engine <version>", exit 0). Quiet and fast (<100ms).
    # IMPECCABLE_LAUNCHER_PROBE marks the child as a probe: a copy of this
    # launcher reached recursively (e.g. symlinked onto PATH as `impeccable`)
    # then skips its own probes and refuses to download, so probing stays cheap
    # and can never loop.
    probe_ok() {
      probe_out=$(IMPECCABLE_LAUNCHER_PROBE=1 "$1" engine-probe 2>/dev/null) || return 1
      case "$probe_out" in
        impeccable-engine*) probe_version=${probe_out#impeccable-engine }; return 0 ;;
      esac
      return 1
    }
    probing=${IMPECCABLE_LAUNCHER_PROBE:-}
    # Space, tab and CR, made once: hooks run this launcher on every edit and turn
    # end, and every process it starts before the engine costs real time on a busy
    # Windows machine (#1237), so the hot path below sticks to shell builtins.
    ws=$(printf ' \t\r')
    
    # Sets $digest_out to the digest engine-checksums.txt records for engine
    # version $1 and asset $2 (lines are "<version> <asset> <sha256>"), empty when
    # there is none.
    # A CR is a separator too (CRLF checkouts), and a last line with no newline
    # still counts.
    manifest_digest() {
      digest_out=""
      [ -f "$manifest" ] || return 0
      while IFS="$ws" read -r m_version m_asset m_sum _ || [ -n "$m_version" ]; do
        case "$m_version" in ''|'#'*) continue ;; esac
        if [ "$m_version" = "$1" ] && [ "$m_asset" = "$2" ]; then
          digest_out=$m_sum
          return 0
        fi
      done < "$manifest"
      return 0
    }
    # Sets $expected (and, on Windows on ARM, which runs x64 binaries,
    # $expected_x64) from engine-checksums.txt.
    read_expected() {
      manifest_digest "$version" "$asset"
      expected=$digest_out
      expected_x64=""
      if [ "$os" = windows ] && [ "$arch" = arm64 ]; then
        manifest_digest "$version" impeccable-windows-x64.exe
        expected_x64=$digest_out
      fi
    }
    # Sets $size to the byte count of the cached binary (BSD wc pads it).
    cached_size() {
      size=$(wc -c < "$cached") || size=""
      size=${size##* }
    }
    # Sets $actual to the sha256 of $1, empty when no hash tool works.
    hash_file() {
      actual=""
      if command -v shasum >/dev/null 2>&1; then
        if digest=$(shasum -a 256 "$1" 2>/dev/null); then actual=${digest%% *}; fi
      elif command -v sha256sum >/dev/null 2>&1; then
        if digest=$(sha256sum "$1" 2>/dev/null); then actual=${digest%% *}; fi
      fi
    }
    
    # This script's directory without dirname or a subshell: what dirname "$0"
    # gives, made absolute by a cd there and back.
    case $0 in
      */*) dir=${0%/*} ;;
      *) dir=. ;;
    esac
    [ -n "$dir" ] || dir=/
    caller_pwd=$PWD
    CDPATH= cd -- "$dir" || { echo "impeccable: cannot enter the launcher directory $dir" >&2; exit 127; }
    dir=$PWD
    skill_dir=${dir%/*}
    [ -n "$skill_dir" ] || skill_dir=/
    cd -- "$caller_pwd" || { echo "impeccable: cannot return to $caller_pwd" >&2; exit 127; }
    # VS Code syncs a plugin without the executable bit. Its hooks run this through
    # sh, so restore the bit for the commands the skill runs directly (#1249).
    [ -x "$0" ] || chmod +x "$0" 2>/dev/null || :
    manifest="$dir/engine-checksums.txt"
    
    # What the binary needs to know about its home: the skill directory (for
    # reference/*.md and command-metadata.json) and how to name itself in the
    # commands it prints. Exported BEFORE any exec below, including the
    # IMPECCABLE_BIN override: an engine binary reached with no IMPECCABLE_SKILL_DIR
    # cannot find reference/*.md (so native platform refs never inline) or read its
    # own version (so UPDATE_AVAILABLE never fires). Setting it here covers every
    # candidate the launcher can exec.
    : "${IMPECCABLE_SKILL_DIR:=$skill_dir}"
    : "${IMPECCABLE_SELF:=$0}"
    export IMPECCABLE_SKILL_DIR IMPECCABLE_SELF
    
    if [ -n "${IMPECCABLE_BIN:-}" ] && [ -x "${IMPECCABLE_BIN}" ]; then
      exec "${IMPECCABLE_BIN}" "$@"
    fi
    
    # Windows names itself in the environment, which saves a process there; one
    # uname covers the rest. PROCESSOR_ARCHITECTURE is what impeccable.cmd reads,
    # so both launchers pick the same cached engine (AMD64 under x64 Git Bash on
    # ARM64, as uname -m reported before).
    if [ "${OS:-}" = Windows_NT ]; then
      sys="Windows_NT ${PROCESSOR_ARCHITECTURE:-unknown}"
    else
      sys=$(uname -sm 2>/dev/null) || sys="unknown unknown"
    fi
    case "${sys%% *}" in
      Darwin) os=darwin ;;
      Linux) os=linux ;;
      MINGW*|MSYS*|CYGWIN*|Windows_NT) os=windows ;;
      *) os=unknown ;;
    esac
    case "${sys##* }" in
      arm64|aarch64|ARM64) arch=arm64 ;;
      x86_64|amd64|AMD64) arch=x64 ;;
      *) arch=unknown ;;
    esac
    
    version=""
    [ -f "$dir/VERSION" ] && { IFS="$ws" read -r version _ < "$dir/VERSION" || :; }
    bin="$dir/bin/$os-$arch/impeccable"
    [ "$os" = windows ] && bin="$bin.exe"
    
    # Lost the executable bit in transit (zip extraction, some copiers).
    if [ -f "$bin" ] && { [ -x "$bin" ] || chmod +x "$bin" 2>/dev/null; }; then
      if [ -n "$probing" ] || [ -z "$version" ] || { probe_ok "$bin" && [ "$probe_version" = "$version" ]; }; then
        exec "$bin" "$@"
      fi
      echo "impeccable: skipping $bin: it reports engine ${probe_version:-unknown} but this skill pins $version; delete it to stop this warning" >&2
    fi
    # On Windows (an MSYS/Git Bash shell) the cached names carry .exe so this
    # launcher and impeccable.cmd share one cache.
    exe=""
    [ "$os" = windows ] && exe=".exe"
    home_bin="${HOME:-/nonexistent}/.impeccable/bin/impeccable$exe"
    if [ -z "$probing" ] && [ -x "$home_bin" ] && probe_ok "$home_bin"; then
      exec "$home_bin" "$@"
    fi
    # Version-pinned user cache, filled by the download below or by `impeccable update`.
    cache_root="${IMPECCABLE_HOME:-${HOME:-/nonexistent}/.impeccable}"
    cached="$cache_root/bin/$version/impeccable$exe"
    asset="impeccable-$os-$arch"
    [ "$os" = windows ] && asset="$asset.exe"
    if [ -n "$version" ] && [ -x "$cached" ]; then
      read_expected
      cached_size
      stamp=""
      stamp_size=""
      { IFS="$ws" read -r stamp stamp_size _ < "$cached.verified"; } 2>/dev/null || :
      if [ -n "$stamp" ] && [ "$stamp_size" = "$size" ] && { [ "$stamp" = "$expected" ] || [ "$stamp" = "$expected_x64" ]; } && [ ! "$cached" -nt "$cached.verified" ]; then
        exec "$cached" "$@"
      fi
      hash_file "$cached"
      if [ -n "$actual" ] && { [ "$actual" = "$expected" ] || [ "$actual" = "$expected_x64" ]; }; then
        { echo "$actual $size" > "$cached.verified"; } 2>/dev/null || :
        exec "$cached" "$@"
      fi
      echo "impeccable: cannot verify the cached engine $cached against $manifest; not using it" >&2
    fi
    if [ -z "$probing" ] && command -v impeccable >/dev/null 2>&1 && probe_ok impeccable; then
      exec impeccable "$@"
    fi
    
    # Last resort: fetch this version's binary for the current platform from the
    # public release channel into the user cache. Needs network; sandboxes without
    # egress preinstall the binary on PATH instead.
    setup_help() {
      echo "Engine $version setup needs network access and write permission to $cache_root/bin/$version." >&2
      echo "Run this launcher ($0) with engine-probe in a terminal that has those permissions, then retry the original command." >&2
      echo "Alternatively, set IMPECCABLE_HOME to a writable cache location, or IMPECCABLE_BIN to a preinstalled engine binary." >&2
    }
    fetch_url() {
      http_status=""
      download_host=""
      if command -v curl >/dev/null 2>&1; then
        fetch_result=0
        metadata=$(curl -fsSL --retry 2 -w '%{http_code} %{url_effective}' -o "$tmp" "$1" 2>/dev/null) || fetch_result=$?
        http_status=${metadata%% *}
        effective_url=${metadata#* }
        # Only the authority is needed, never the signed storage URL's query.
        download_host=${effective_url#*://}
        download_host=${download_host%%/*}
        download_host=${download_host##*@}
        case "$download_host" in
          \[*) download_host=${download_host%%]*}] ;;
          *) download_host=${download_host%%:*} ;;
        esac
        download_host=$(printf '%s' "$download_host" | tr '[:upper:]' '[:lower:]')
        return "$fetch_result"
      elif command -v wget >/dev/null 2>&1; then
        wget -q -O "$tmp" "$1" 2>/dev/null
      else
        return 1
      fi
    }
    check_download() {
      download_file=${1:-$tmp}
      if [ ! -f "$download_file" ]; then
        echo "impeccable: download completed but the file was removed before execution: $url; check your antivirus quarantine or logs. Refusing to continue; do not disable protection." >&2
        exit 127
      fi
      if [ ! -s "$download_file" ]; then
        rm -f "$download_file"
        echo "impeccable: downloaded file is empty: $url; refusing the unverified download" >&2
        exit 127
      fi
    }
    if [ -n "$probing" ]; then
      # Inside another launcher's probe: no download, fail fast and quiet.
      exit 127
    fi
    if [ -n "$version" ] && [ "$os" != unknown ] && [ "$arch" != unknown ]; then
      base="${IMPECCABLE_DOWNLOAD_BASE:-https://github.com/pbakaus/impeccable/releases/download}"
      url="$base/engine-v$version/$asset"
      read_expected
      # Fail closed before any network traffic or cache write.
      if [ -z "$expected" ] && [ -z "$expected_x64" ]; then
        echo "impeccable: no checksum for engine $version ($asset) in $manifest; refusing the unverified download" >&2
        exit 127
      fi
      tmp="$cache_root/bin/$version/.impeccable.part.$$"
      # An interrupted download (Ctrl-C, a hook timeout) would otherwise leave the
      # PID-named staging file behind for good. The handlers must exit explicitly.
      cleanup() { rm -f "$tmp" 2>/dev/null || :; }
      trap 'cleanup; exit 129' HUP
      trap 'cleanup; exit 130' INT
      trap 'cleanup; exit 143' TERM
      if ! mkdir -p "$cache_root/bin/$version" 2>/dev/null; then
        echo "impeccable: engine $version is not installed; cannot create cache directory: $cache_root/bin/$version" >&2
        setup_help
        exit 127
      fi
      # Check the actual staging file, not just directory existence: a cache from
      # an earlier run can be readable but no longer writable inside a sandbox.
      if ! (umask 077; : > "$tmp") 2>/dev/null; then
        echo "impeccable: engine $version is not installed; cannot write to cache directory: $cache_root/bin/$version" >&2
        setup_help
        exit 127
      fi
      fetched=0
      if [ -n "$expected" ] && fetch_url "$url"; then
        fetched=1
      elif [ -n "$expected_x64" ]; then
        # Windows on ARM runs x64 binaries; fall back when no arm64 asset exists.
        url="$base/engine-v$version/impeccable-windows-x64.exe"
        expected=$expected_x64
        fetch_url "$url" && fetched=1
      fi
      if [ "$fetched" = 1 ]; then
        check_download
        # No sha256 tool refuses the download too.
        hash_file "$tmp"
        check_download
        if [ -z "$actual" ]; then
          rm -f "$tmp"
          echo "impeccable: cannot verify $url (no sha256 tool, or hashing failed); refusing the unverified download" >&2
          exit 127
        fi
        if [ "$actual" != "$expected" ]; then
          rm -f "$tmp"
          echo "impeccable: checksum mismatch downloading $url" >&2
          exit 127
        fi
        check_download
        if ! chmod +x "$tmp" 2>/dev/null; then
          check_download
          rm -f "$tmp"
          echo "impeccable: could not make the verified download executable: $url" >&2
          exit 127
        fi
        check_download
        if ! mv -f "$tmp" "$cached" 2>/dev/null; then
          check_download
          rm -f "$tmp"
          echo "impeccable: could not cache the verified download: $url" >&2
          exit 127
        fi
        check_download "$cached"
        cached_size
        { echo "$actual $size" > "$cached.verified"; } 2>/dev/null || :
        exec "$cached" "$@"
      fi
      rm -f "$tmp" 2>/dev/null
      case "$http_status" in
        5[0-9][0-9])
          case "$download_host" in
            github.com|*.github.com|githubusercontent.com|*.githubusercontent.com)
              echo "impeccable: could not download engine $version: GitHub's downloads are failing right now (HTTP $http_status from $download_host). This is an outage on GitHub's side, not a problem with your setup or the CLI, so updating won't help. Check https://www.githubstatus.com and run the same command again once GitHub has recovered." >&2 ;;
            *)
              echo "impeccable: could not download engine $version: $download_host is failing right now (HTTP $http_status), a server error on $download_host's side. Try again later." >&2 ;;
          esac
          exit 127 ;;
      esac
      echo "impeccable: could not download engine $version from $url; check network access, the release URL, and curl or wget availability." >&2
      setup_help
      exit 127
    fi
    
    echo "impeccable: no engine binary for $os-$arch found (looked in $bin, $cached, PATH)." >&2
    echo "Download impeccable-$os-$arch from https://github.com/pbakaus/impeccable/releases (tag engine-v$version) into $cache_root/bin/$version/impeccable$exe (then chmod +x), or set IMPECCABLE_BIN to a preinstalled engine binary. Docs: https://impeccable.style" >&2
    exit 127
    
  • .agent/skills/impeccable/scripts/impeccable.cmd15 KBab90ace70ee4upstream ↗
    @echo off
    setlocal
    rem Impeccable launcher (Windows). Runs bin\windows-<arch>\impeccable.exe next
    rem to this file, else a cached or freshly downloaded engine binary.
    rem
    rem Structure notes (this file is exercised by dry parsing and string-level
    rem tests, not yet on a real Windows machine):
    rem - No multi-line parenthesized blocks: cmd expands %var% at block parse
    rem   time, which made the old download path read back empty %url%/%cached%.
    rem   Linear goto flow keeps every expansion on its own line, and avoids
    rem   delayed expansion eating ! characters in user arguments.
    rem - The unversioned user binary and the PATH candidate are validated with
    rem   the engine-probe handshake (see :probe) so the retired 3.x npm CLI,
    rem   whose bin is also named impeccable, is never exec'd. The sibling binary
    rem   must also report the version in VERSION: it is not tracked, so a skill
    rem   upgrade can leave an old engine in place. IMPECCABLE_BIN stays trusted.
    rem - Downloads and the version-pinned cache are verified via certutil
    rem   against engine-checksums.txt next to this file, and fail closed; a
    rem   .verified stamp lets later runs skip hashing the cache while it holds
    rem   the manifest digest and the binary's size and is not older than the
    rem   binary. On ARM64 the arm64 asset is tried first and the x64 asset is the
    rem   fallback (Windows on ARM runs x64 binaries), each only when the manifest
    rem   has a line for it.
    if not defined IMPECCABLE_SKILL_DIR set "IMPECCABLE_SKILL_DIR=%~dp0.."
    if not defined IMPECCABLE_SELF set "IMPECCABLE_SELF=%~f0"
    set "arch=x64"
    if /I "%PROCESSOR_ARCHITECTURE%"=="ARM64" set "arch=arm64"
    
    if not defined IMPECCABLE_BIN goto no_env_bin
    if not exist "%IMPECCABLE_BIN%" goto no_env_bin
    set "run=%IMPECCABLE_BIN%"
    goto run
    :no_env_bin
    
    set "version="
    if exist "%~dp0VERSION" set /p version=<"%~dp0VERSION"
    set "bin=%~dp0bin\windows-%arch%\impeccable.exe"
    if not exist "%bin%" goto no_sibling
    if defined IMPECCABLE_LAUNCHER_PROBE goto sibling_ok
    if not defined version goto sibling_ok
    call :probe "%bin%"
    if "%probe_version%"=="%version%" goto sibling_ok
    if not defined probe_version set "probe_version=unknown"
    echo impeccable: skipping "%bin%": it reports engine %probe_version% but this skill pins %version%; delete it to stop this warning 1>&2
    goto no_sibling
    :sibling_ok
    set "run=%bin%"
    goto run
    :no_sibling
    
    set "home_bin=%USERPROFILE%\.impeccable\bin\impeccable.exe"
    if not exist "%home_bin%" goto no_home_bin
    if defined IMPECCABLE_LAUNCHER_PROBE goto no_home_bin
    call :probe "%home_bin%"
    if not "%probe_ok%"=="1" goto no_home_bin
    set "run=%home_bin%"
    goto run
    :no_home_bin
    
    if not defined IMPECCABLE_HOME set "IMPECCABLE_HOME=%USERPROFILE%\.impeccable"
    set "cached=%IMPECCABLE_HOME%\bin\%version%\impeccable.exe"
    set "asset=impeccable-windows-%arch%.exe"
    set "manifest=%~dp0engine-checksums.txt"
    if not defined version goto no_cache
    if not exist "%cached%" goto no_cache
    call :read_expected
    for %%f in ("%cached%") do set "size=%%~zf"
    set "stamp="
    if exist "%cached%.verified" for /f "usebackq tokens=1,2" %%s in ("%cached%.verified") do set "stamp=%%s"& set "stamp_size=%%t"
    if not defined stamp goto cache_hash
    if not "%stamp_size%"=="%size%" goto cache_hash
    if /I "%stamp%"=="%expected%" goto cache_stamp_matches
    if /I "%stamp%"=="%expected_x64%" goto cache_stamp_matches
    goto cache_hash
    :cache_stamp_matches
    rem Newest first: the stamp must be listed before the binary it vouches for.
    set "newest="
    for /f "delims=" %%f in ('dir /b /a:-d /o:-d "%cached%*" 2^>nul') do if not defined newest set "newest=%%f"
    if /I "%newest%"=="impeccable.exe.verified" goto cache_trusted
    :cache_hash
    call :sha256 "%cached%" "%TEMP%\impeccable-hash-%RANDOM%%RANDOM%.txt"
    if not defined actual goto cache_unverified
    if /I "%actual%"=="%expected%" goto cache_verified
    if /I "%actual%"=="%expected_x64%" goto cache_verified
    :cache_unverified
    echo impeccable: cannot verify the cached engine "%cached%" against "%manifest%"; not using it 1>&2
    goto no_cache
    :cache_verified
    (>"%cached%.verified" echo %actual% %size%) 2>nul
    :cache_trusted
    set "run=%cached%"
    goto run
    :no_cache
    
    if defined IMPECCABLE_LAUNCHER_PROBE goto download
    rem The first impeccable on PATH, resolved once so the probe and the run see
    rem the same file. A batch shim (npm writes impeccable.cmd) must run under
    rem call to return here (#1240), and call expands % in the arguments a second
    rem time; a real binary runs directly so a target such as a%20b reaches it intact.
    set "path_bin="
    rem where also lists npm's extensionless POSIX shim, which cmd cannot run:
    rem take the first match with a runnable extension.
    rem Loop letters c and k are not path modifiers, so %%~xc reads as the
    rem extension of c and never as a loop variable followed by text.
    for /f "delims=" %%c in ('where impeccable 2^>nul') do if not defined path_bin for %%k in (.exe .com .cmd .bat) do if /I "%%~xc"=="%%k" set "path_bin=%%c"
    if not defined path_bin goto download
    call :probe "%path_bin%"
    if not "%probe_ok%"=="1" goto download
    for %%k in ("%path_bin%") do set "path_ext=%%~xk"
    if /I "%path_ext%"==".cmd" goto path_shim
    if /I "%path_ext%"==".bat" goto path_shim
    "%path_bin%" %*
    exit /b %errorlevel%
    :path_shim
    call "%path_bin%" %*
    exit /b %errorlevel%
    
    :download
    rem Last resort: fetch this version's binary from the release channel into
    rem the version-pinned user cache, verify it, then run it. Never inside
    rem another launcher's probe: fail fast and quiet instead.
    if defined IMPECCABLE_LAUNCHER_PROBE exit /b 127
    if not defined version goto fail
    call :read_expected
    if not defined expected if not defined expected_x64 goto no_checksum
    where curl.exe >nul 2>nul
    if errorlevel 1 goto curl_missing
    if not defined IMPECCABLE_DOWNLOAD_BASE set "IMPECCABLE_DOWNLOAD_BASE=https://github.com/pbakaus/impeccable/releases/download"
    if exist "%IMPECCABLE_HOME%\bin\%version%\" goto cache_ready
    mkdir "%IMPECCABLE_HOME%\bin\%version%" >nul 2>nul
    if errorlevel 1 goto cache_directory_failed
    :cache_ready
    rem Stage the download in a directory only this run owns, as the sh launcher
    rem does with .impeccable.part.$$: concurrent first runs (parallel hooks, two
    rem agents) must never write, hash or move each other's files. mkdir fails
    rem when the name exists, so it claims the name atomically. RANDOM alone is
    rem not enough because cmd seeds it from the clock in whole seconds; the
    rem timestamp and the retry on collision keep same-second runs apart. A cache
    rem directory that refuses every mkdir is reported as unwritable.
    set "attempt=0"
    :claim_staging
    set /a attempt+=1
    if %attempt% GTR 20 goto cache_write_failed
    set "stamp=%TIME: =0%"
    set "stamp=%stamp::=%"
    set "stamp=%stamp:.=%"
    set "stamp=%stamp:,=%"
    set "staging=%IMPECCABLE_HOME%\bin\%version%\.impeccable.part.%stamp%-%RANDOM%%RANDOM%"
    mkdir "%staging%" >nul 2>nul
    if errorlevel 1 goto claim_staging
    set "part=%staging%\impeccable.exe"
    rem Redirection failures do not reliably update ERRORLEVEL in cmd.exe;
    rem branch on the command's failure directly.
    (type nul >"%part%") 2>nul || goto staging_write_failed
    set "url=%IMPECCABLE_DOWNLOAD_BASE%/engine-v%version%/%asset%"
    if not defined expected goto fetch_x64
    call :fetch_url
    if not errorlevel 1 goto verify
    :fetch_x64
    if not defined expected_x64 goto download_failed
    set "asset=impeccable-windows-x64.exe"
    set "expected=%expected_x64%"
    set "url=%IMPECCABLE_DOWNLOAD_BASE%/engine-v%version%/%asset%"
    call :fetch_url
    if errorlevel 1 goto download_failed
    
    :verify
    call :check_download
    if errorlevel 1 exit /b 127
    rem Mirrors the sh launcher and fails closed: a freshly downloaded binary
    rem runs only after its hash matches the digest read from engine-checksums.txt.
    rem An empty certutil result refuses the download instead of running an
    rem unverified binary.
    call :sha256 "%part%" "%staging%\hash.txt"
    call :check_download
    if errorlevel 1 exit /b 127
    if not defined actual goto verify_refuse
    if /I "%actual%"=="%expected%" goto place
    call :discard_staging
    echo impeccable: checksum mismatch downloading %url% 1>&2
    exit /b 127
    
    :verify_refuse
    call :check_download
    if errorlevel 1 exit /b 127
    call :discard_staging
    echo impeccable: cannot verify %url% (certutil could not hash it); refusing the unverified download 1>&2
    exit /b 127
    
    :fetch_url
    set "http_status="
    set "effective_url="
    set "download_host="
    curl.exe -fsSL --retry 2 -w "%%{http_code} %%{url_effective}" -o "%part%" "%url%" >"%staging%\http.txt" 2>nul
    set "fetch_result=%errorlevel%"
    for /f "usebackq tokens=1" %%a in ("%staging%\http.txt") do set "http_status=%%a"
    for /f "usebackq tokens=2" %%a in ("%staging%\http.txt") do set "effective_url=%%a"
    rem Token 2 is the authority after scheme://. Drop userinfo and the port.
    for /f "tokens=2 delims=/" %%h in ("%effective_url%") do set "download_host=%%h"
    for /f "tokens=1,* delims=@" %%h in ("%download_host%") do if not "%%i"=="" set "download_host=%%i"
    rem Bracketed IPv6 hosts contain colons that are not port separators.
    if "%download_host:~0,1%"=="[" goto fetch_ipv6
    for /f "tokens=1 delims=:" %%h in ("%download_host%") do set "download_host=%%h"
    exit /b %fetch_result%
    :fetch_ipv6
    for /f "tokens=1 delims=]" %%h in ("%download_host%") do set "download_host=%%h]"
    exit /b %fetch_result%
    
    :read_expected
    rem Sets expected (and, on ARM64, expected_x64: Windows on ARM runs x64
    rem binaries) from engine-checksums.txt.
    call :manifest_digest "%asset%" expected
    set "expected_x64="
    if "%arch%"=="arm64" call :manifest_digest impeccable-windows-x64.exe expected_x64
    exit /b 0
    
    :manifest_digest
    rem Sets the variable named %2 to the digest the first engine-checksums.txt
    rem line for this version and asset %1 records, empty when there is none.
    set "%~2="
    if not exist "%manifest%" exit /b 0
    for /f "usebackq tokens=1-3" %%a in ("%manifest%") do if "%%a"=="%version%" if /I "%%b"=="%~1" if not defined %~2 set "%~2=%%c"
    exit /b 0
    
    :sha256
    rem Sets actual to the sha256 of %~1, empty when certutil fails. %~2 is the
    rem scratch file for its output. Check certutil's status before parsing: its
    rem error text on stdout is not a digest.
    set "actual="
    certutil -hashfile "%~1" SHA256 >"%~2" 2>nul
    if errorlevel 1 goto sha256_done
    for /f "usebackq skip=1 delims=" %%h in ("%~2") do if not defined actual set "actual=%%h"
    if not defined actual goto sha256_done
    set "actual=%actual: =%"
    :sha256_done
    del "%~2" >nul 2>nul
    exit /b 0
    
    :check_download
    set "download_file=%~1"
    if not defined download_file set "download_file=%part%"
    if not exist "%download_file%" goto download_missing
    for %%f in ("%download_file%") do if %%~zf==0 goto download_empty
    exit /b 0
    
    :download_missing
    call :discard_staging
    echo impeccable: download completed but the file was removed before execution: %url%; check your antivirus quarantine or logs. Refusing to continue; do not disable protection. 1>&2
    exit /b 127
    
    :download_empty
    del "%download_file%" >nul 2>nul
    call :discard_staging
    echo impeccable: downloaded file is empty: %url%; refusing the unverified download 1>&2
    exit /b 127
    
    :discard_staging
    rem Removes this run's staging directory and whatever is left in it. Never
    rem touches another run's staging directory or the cached binary.
    if defined staging rd /s /q "%staging%" >nul 2>nul
    exit /b 0
    
    :place
    call :check_download
    if errorlevel 1 exit /b 127
    move /y "%part%" "%cached%" >nul 2>nul
    if errorlevel 1 goto place_failed
    call :discard_staging
    call :check_download "%cached%"
    if errorlevel 1 exit /b 127
    for %%f in ("%cached%") do set "size=%%~zf"
    (>"%cached%.verified" echo %actual% %size%) 2>nul
    set "run=%cached%"
    goto run
    
    :place_failed
    call :check_download
    if errorlevel 1 exit /b 127
    call :discard_staging
    echo impeccable: could not cache the verified download: %url% 1>&2
    exit /b 127
    
    :run
    "%run%" %*
    exit /b %errorlevel%
    
    :probe
    rem Sets probe_ok=1 when %1 answers the engine handshake: prints
    rem "impeccable-engine <version>" and exits 0, and probe_version to that
    rem version. The 3.x npm CLI answers any unknown verb with "Unknown command",
    rem exit 1, so it never passes.
    rem The candidate runs under call: an npm .cmd shim run without it takes
    rem over this script and never returns (#1240).
    set "probe_ok="
    set "probe_version="
    set "probe_tmp=%TEMP%\impeccable-probe-%RANDOM%%RANDOM%.txt"
    set "IMPECCABLE_LAUNCHER_PROBE=1"
    call "%~1" engine-probe >"%probe_tmp%" 2>nul
    set "probe_err=%ERRORLEVEL%"
    set "IMPECCABLE_LAUNCHER_PROBE="
    if not "%probe_err%"=="0" goto probe_done
    findstr /b /c:"impeccable-engine" "%probe_tmp%" >nul 2>nul
    if errorlevel 1 goto probe_done
    set "probe_ok=1"
    for /f "usebackq tokens=2" %%v in ("%probe_tmp%") do if not defined probe_version set "probe_version=%%v"
    :probe_done
    del "%probe_tmp%" >nul 2>nul
    exit /b 0
    
    :no_checksum
    echo impeccable: no checksum for engine %version% (%asset%) in "%manifest%"; refusing the unverified download 1>&2
    exit /b 127
    
    :cache_directory_failed
    echo impeccable: engine %version% is not installed; cannot create cache directory: "%IMPECCABLE_HOME%\bin\%version%" 1>&2
    goto setup_failed
    
    :staging_write_failed
    call :discard_staging
    
    :cache_write_failed
    echo impeccable: engine %version% is not installed; cannot write to cache directory: "%IMPECCABLE_HOME%\bin\%version%" 1>&2
    goto setup_failed
    
    :curl_missing
    echo impeccable: cannot download engine %version%; curl.exe is unavailable. 1>&2
    goto setup_failed
    
    :download_failed
    call :discard_staging
    if not "%http_status:~0,1%"=="5" goto download_generic
    if "%http_status:~2,1%"=="" goto download_generic
    if /I "%download_host%"=="github.com" goto download_github
    if /I "%download_host:~-11%"==".github.com" goto download_github
    if /I "%download_host%"=="githubusercontent.com" goto download_github
    if /I "%download_host:~-22%"==".githubusercontent.com" goto download_github
    echo impeccable: could not download engine %version%: %download_host% is failing right now (HTTP %http_status%), a server error on %download_host%'s side. Try again later. 1>&2
    exit /b 127
    :download_github
    echo impeccable: could not download engine %version%: GitHub's downloads are failing right now (HTTP %http_status% from %download_host%). This is an outage on GitHub's side, not a problem with your setup or the CLI, so updating won't help. Check https://www.githubstatus.com and run the same command again once GitHub has recovered. 1>&2
    exit /b 127
    :download_generic
    echo impeccable: could not download engine %version% from %url%; check network access and the release URL. 1>&2
    
    :setup_failed
    echo Engine %version% setup needs network access and write permission to "%IMPECCABLE_HOME%\bin\%version%". 1>&2
    echo Run this launcher ("%~f0") with engine-probe in a terminal that has those permissions, then retry the original command. 1>&2
    echo Alternatively, set IMPECCABLE_HOME to a writable cache location, or IMPECCABLE_BIN to a preinstalled engine binary. 1>&2
    exit /b 127
    
    :fail
    echo impeccable: no engine binary found (looked in %bin%, %cached%, PATH). 1>&2
    echo Download impeccable-windows-%arch%.exe from https://github.com/pbakaus/impeccable/releases (tag engine-v%version%) and save it as %cached%, or set IMPECCABLE_BIN to a preinstalled engine binary. Docs: https://impeccable.style 1>&2
    exit /b 127
    
  • .agent/skills/impeccable/scripts/live-browser-dom.js12 KBef1ca8928111upstream ↗
    /**
     * Browser-side DOM helpers for Impeccable live mode.
     *
     * Kept separate from live-browser.js so future browser script parts can share
     * chrome mounting, lookup, focus, and picker helpers without depending on the
     * full overlay UI bundle.
     */
    (function (root) {
      'use strict';
      if (!root) return;
    
      function createLiveBrowserDomHelpers({
        prefix,
        skipTags,
        document: doc = root.document,
        css = root.CSS,
        crypto = root.crypto,
      } = {}) {
        if (!prefix) throw new Error('prefix required');
        if (!doc) throw new Error('document required');
        const tagsToSkip = skipTags || new Set();
    
        function own(el) {
          return el && (el.id?.startsWith(prefix) || el.closest?.('[id^="' + prefix + '"]'));
        }
    
        function pickable(el) {
          if (!el || el.nodeType !== 1) return false;
          if (tagsToSkip.has(String(el.tagName || '').toLowerCase())) return false;
          if (own(el)) return false;
          const r = el.getBoundingClientRect();
          return r.width >= 20 && r.height >= 20;
        }
    
        function desc(el) {
          if (!el) return '';
          let s = el.tagName.toLowerCase();
          if (el.id) s += '#' + el.id;
          else if (el.classList.length) s += '.' + [...el.classList].slice(0, 2).join('.');
          return s;
        }
    
        function rectIsUsableAnchor(rect) {
          return !!rect && rect.width > 0.5 && rect.height > 0.5;
        }
    
        function makeFrozenAnchor(el) {
          if (!el || !el.getBoundingClientRect) return null;
          const r = el.getBoundingClientRect();
          if (!rectIsUsableAnchor(r)) return null;
          const rect = {
            x: r.x, y: r.y,
            top: r.top, left: r.left,
            right: r.right, bottom: r.bottom,
            width: r.width, height: r.height,
          };
          return {
            __impeccableFrozenAnchor: true,
            tagName: el.tagName || 'DIV',
            id: el.id || '',
            classList: el.classList ? [...el.classList] : [],
            hasAttribute: () => false,
            getBoundingClientRect: () => rect,
          };
        }
    
        function hasFrameworkHmrOwnership(el) {
          for (let node = el; node; node = node.parentElement) {
            let keys = [];
            try { keys = Object.getOwnPropertyNames(node); } catch {}
            if (keys.some((key) => (
              key.startsWith('__reactFiber$')
              || key.startsWith('__reactProps$')
              || key.startsWith('__reactContainer$')
              || key === '_reactRootContainer'
              || key === '__vueParentComponent'
              || key === '__vue_app__'
              || key === '__vnode'
              || key === '__svelte_meta'
            ))) {
              return true;
            }
          }
          return false;
        }
    
        function id8() {
          // randomUUID is secure-context only (issue #1055); getRandomValues is not.
          try {
            if (typeof crypto?.randomUUID === 'function') return crypto.randomUUID().replace(/-/g, '').slice(0, 8);
          } catch { /* fall through */ }
          try {
            if (typeof crypto?.getRandomValues === 'function') {
              const bytes = crypto.getRandomValues(new Uint8Array(4));
              return Array.from(bytes, (b) => b.toString(16).padStart(2, '0')).join('');
            }
          } catch { /* fall through */ }
          return (Math.random().toString(16).slice(2) + Date.now().toString(16)).slice(0, 8);
        }
    
        function cssId(id) {
          if (css?.escape) return css.escape(id);
          return String(id).replace(/([ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, '\\$1');
        }
    
        function liveUiRoot() {
          const uiRoot = root.__IMPECCABLE_LIVE_UI_ROOT__;
          if (uiRoot && typeof uiRoot.appendChild === 'function') return uiRoot;
          return doc.body;
        }
    
        // A modal <dialog> (showModal) paints in the top layer and makes every
        // node outside its subtree inert, so chrome on <body> can be neither seen
        // nor clicked while one is open, and no z-index reaches it (issue #879).
        // While a modal is open the chrome parks inside the topmost one, in one
        // popover: inside the dialog it is not inert, and a popover shown after
        // the dialog paints above it. One popover for all of it, because
        // top-layer entries stack by show order, which would drop the z-index
        // order between the roots. The detect overlay (browser-bundle/
        // 40-overlay.js) mounts its outlines here too: it finds the host by this
        // id and places its outlines again on the event of the same name, fired
        // on every move.
        const topLayerHost = doc.createElement('div');
        topLayerHost.id = prefix + '-top-layer';
        // Same box as the SvelteKit shadow host: 0x0, fixed, chrome overflows it.
        // `all: initial` also clears the popover UA box.
        for (const [name, value] of Object.entries({
          all: 'initial', position: 'fixed', top: '0', left: '0', width: '0', height: '0', overflow: 'visible',
        })) topLayerHost.style.setProperty(name, value, 'important');
        const pageRoots = new WeakSet(); // chrome nodes mounted on the page itself
        const openModals = [];           // in the order they opened; last is topmost
    
        // Modals that were open before watching began have no readable top-layer
        // order, but the topmost one's backdrop covers the viewport, so a hit
        // test lands in it. Raise that one to the top of the stack.
        function raiseHitModal() {
          const i = openModals.indexOf(doc.elementFromPoint(0, 0)?.closest('dialog:modal'));
          if (i !== -1) openModals.push(...openModals.splice(i, 1));
        }
    
        function syncTopLayerHost(records = []) {
          for (const { type, target, oldValue } of records) {
            if (type !== 'attributes' || oldValue !== null || !target.matches('dialog:modal')) continue;
            // Opened, or closed and reopened in one task (the observer sees only
            // the end state): either way it is back on top of the top layer, so
            // a host shown inside it earlier has to be shown again. A write to an
            // `open` that was already set (oldValue not null) moved nothing.
            const i = openModals.indexOf(target);
            if (i !== -1) openModals.splice(i, 1);
            openModals.push(target);
            if (topLayerHost.parentNode === target) topLayerHost.remove();
          }
          // A closed dialog, or one removed from the document while open, stops
          // matching :modal. Whichever is now on top may predate the watch.
          const before = openModals.length;
          for (let i = openModals.length - 1; i >= 0; i--) {
            if (!openModals[i].matches('dialog:modal')) openModals.splice(i, 1);
          }
          if (openModals.length < before && openModals.length > 1) raiseHitModal();
          const modal = openModals[openModals.length - 1] || null;
          if (topLayerHost.parentNode === modal) return;
          if (modal) {
            modal.appendChild(topLayerHost);
            for (const el of [...doc.body.children]) if (pageRoots.has(el)) topLayerHost.appendChild(el);
            topLayerHost.showPopover();
          } else {
            doc.body.append(...topLayerHost.childNodes);
            topLayerHost.remove();
          }
          doc.dispatchEvent(new Event(topLayerHost.id));
        }
    
        // Returns the function that stops watching and puts the chrome back.
        function watchModalDialogs() {
          if (typeof topLayerHost.showPopover !== 'function') return () => {};
          topLayerHost.popover = 'manual';
          // Parked in the page's dialog, chrome clicks would bubble into its own
          // handlers, such as a click-outside-the-box close. Live listens in capture.
          topLayerHost.addEventListener('click', (e) => e.stopPropagation());
          openModals.push(...doc.querySelectorAll('dialog:modal'));
          raiseHitModal();
          const observer = new MutationObserver(syncTopLayerHost);
          observer.observe(doc, { subtree: true, childList: true, attributes: true, attributeOldValue: true, attributeFilter: ['open'] });
          syncTopLayerHost();
          return () => {
            observer.disconnect();
            openModals.length = 0;
            syncTopLayerHost();
          };
        }
    
        // A copy of a page element without the chrome parked inside it, which a
        // picked modal dialog contains.
        function cloneWithoutChrome(el) {
          const clone = el.cloneNode(true);
          if (el.contains(topLayerHost)) clone.querySelector('#' + cssId(topLayerHost.id)).remove();
          return clone;
        }
    
        // Mount a chrome node on the page itself: <body>, or the top-layer host
        // while the chrome is parked in a modal.
        function uiAppendToPage(el) {
          pageRoots.add(el);
          (topLayerHost.parentNode ? topLayerHost : doc.body).appendChild(el);
          return el;
        }
    
        // Copy text through a selected textarea and execCommand, for origins where
        // navigator.clipboard is missing or refused (plain HTTP, issue #1055).
        // The textarea mounts like any page-level chrome, so while a modal
        // <dialog> is open it sits in that dialog's top-layer host: on <body> it
        // would be inert, and inert text cannot be selected or copied.
        function copyTextViaSelection(text) {
          let ta = null;
          const previous = activeElementDeep();
          try {
            ta = doc.createElement('textarea');
            ta.id = prefix + '-clipboard';
            ta.value = text;
            ta.setAttribute('readonly', '');
            ta.setAttribute('aria-hidden', 'true');
            ta.tabIndex = -1;
            ta.style.cssText = 'position:fixed;top:0;left:0;width:1px;height:1px;opacity:0;pointer-events:none;';
            uiAppendToPage(ta);
            ta.select();
            return doc.execCommand('copy');
          } catch {
            return false;
          } finally {
            ta?.remove();
            if (previous && previous !== activeElementDeep() && typeof previous.focus === 'function') {
              try { previous.focus({ preventScroll: true }); } catch { /* best effort */ }
            }
          }
        }
    
        function uiAppend(el) {
          const uiRoot = liveUiRoot();
          if (uiRoot === doc.body) return uiAppendToPage(el);
          // An adapter shadow root: its host is the node that sits on the page.
          if (uiRoot.host) pageRoots.add(uiRoot.host);
          uiRoot.appendChild(el);
          return el;
        }
    
        function uiAppendStyle(styleEl) {
          const uiRoot = liveUiRoot();
          if (uiRoot && uiRoot !== doc.body) uiRoot.appendChild(styleEl);
          else doc.head.appendChild(styleEl);
          return styleEl;
        }
    
        function uiGetById(id) {
          const uiRoot = liveUiRoot();
          if (uiRoot?.getElementById) {
            const found = uiRoot.getElementById(id);
            if (found) return found;
          }
          if (uiRoot?.querySelector) {
            const found = uiRoot.querySelector('#' + cssId(id));
            if (found) return found;
          }
          return doc.getElementById(id);
        }
    
        function activeElementDeep() {
          let active = doc.activeElement;
          while (active?.shadowRoot?.activeElement) active = active.shadowRoot.activeElement;
          return active;
        }
    
        function defangOutsideHandlers(rootEl, { setPointerEvents = true } = {}) {
          if (!rootEl) return;
          if (setPointerEvents) {
            rootEl.style.setProperty('pointer-events', 'auto', 'important');
          }
          const stop = (e) => e.stopPropagation();
          rootEl.addEventListener('pointerdown', stop);
          rootEl.addEventListener('mousedown', stop);
          rootEl.addEventListener('focusin', stop);
        }
    
        // The half of the defang that cannot sit on the chrome: a focus trap (Radix /
        // Reka FocusScope) also hears the page's own focusout as focus leaves its
        // modal for our chrome, and pulls it back. Register on the document in
        // capture, ahead of the trap. The page's own focusout handlers miss that
        // one transition too; blur still fires.
        function stopFocusOutIntoChrome(e) {
          if (own(e.relatedTarget)) e.stopPropagation();
        }
    
        return {
          own,
          pickable,
          desc,
          rectIsUsableAnchor,
          makeFrozenAnchor,
          hasFrameworkHmrOwnership,
          id8,
          cssId,
          liveUiRoot,
          uiAppend,
          uiAppendToPage,
          copyTextViaSelection,
          topLayerHost,
          watchModalDialogs,
          cloneWithoutChrome,
          uiAppendStyle,
          uiGetById,
          activeElementDeep,
          defangOutsideHandlers,
          stopFocusOutIntoChrome,
        };
      }
    
      root.__IMPECCABLE_LIVE_DOM__ = {
        version: 1,
        createLiveBrowserDomHelpers,
      };
    })(typeof window !== 'undefined' ? window : globalThis);
    
  • .agent/skills/impeccable/scripts/live-browser-ignores.js10 KB1a2912e57a3bupstream ↗
    /**
     * Browser-side resolution of project detector waivers for Impeccable live mode.
     *
     * The live server serializes `.impeccable/config.json` + `config.local.json`
     * detector ignores (plus the served-root prefixes from the inject config's
     * `files` globs) into `window.__IMPECCABLE_PROJECT_IGNORES__`. This part
     * resolves that config against the current page's URL path when a detect scan
     * starts, so the overlay suppresses the same findings the CLI and the edit
     * hook do (issue #639).
     *
     * Mirrors filterDetectionFindings in cli/lib/impeccable-config.mjs:
     *   1. `ignoreRules` suppress a rule project-wide.
     *   2. `ignoreValues` entries with `value: "*"` suppress their rule in the
     *      files their globs name. The CLI never applies an unscoped wildcard
     *      (isIgnoredFindingValue returns false for it), so neither does this.
     *   3. Remaining `ignoreValues` entries match on the finding's own value;
     *      those are forwarded as `disabledValues` for the detector bundle to
     *      apply where the findings are assembled.
     *   4. `ignoreFiles` globs that name the page waive it wholesale: the
     *      resolver reports `skipScan: true` and the detector answers the scan
     *      with zero findings, mirroring shouldIgnoreDetectionFile in the CLI
     *      and the edit hook's own ignoreFiles gate.
     *
     * `pageFiles`, when the server could resolve it, lists the real project
     * files the inject config serves. A URL that suffix-matches exactly one of
     * them takes that file as its only project identity; an ambiguous or absent
     * match falls back to the served-root common ancestor below.
     *
     * Known gap, unchanged from PR #645: framework apps inject into source files
     * (src/routes/about/+page.svelte) while scans see route URLs (/about), so
     * entries scoped to source or asset paths never match a page candidate and
     * are dropped. That shows the finding, which is the conservative direction.
     *
     * Kept separate from live-browser.js so the glob and page-scope logic can be
     * unit tested in Node (tests/live-browser-ignores.test.mjs) without the full
     * overlay UI bundle.
     */
    (function (root) {
      'use strict';
      if (!root) return;
    
      // Keep in step with normalizeIgnoreRule / normalizeIgnoreValue in
      // cli/lib/impeccable-config.mjs.
      function normalizeIgnoreRule(rule) {
        return String(rule || '').trim().toLowerCase();
      }
    
      function normalizeIgnoreValue(value) {
        return String(value || '')
          .trim()
          .replace(/^["']|["']$/g, '')
          .replace(/\+/g, ' ')
          .replace(/\s+/g, ' ')
          .toLowerCase();
      }
    
      // Glob -> RegExp. Supports `**`, `*`, `?`, and `{a,b}` alternation.
      // Keep in step with globToRegex in cli/lib/impeccable-config.mjs.
      function globToRegex(glob) {
        let re = '^';
        let i = 0;
        while (i < glob.length) {
          const c = glob[i];
          if (c === '*') {
            if (glob[i + 1] === '*') {
              i += 2;
              if (glob[i] === '/') {
                re += '(?:.*/)?';
                i += 1;
              } else {
                re += '.*';
              }
            } else {
              re += '[^/]*';
              i += 1;
            }
          } else if (c === '?') {
            re += '[^/]';
            i += 1;
          } else if (c === '{') {
            const end = glob.indexOf('}', i);
            if (end === -1) { re += '\\{'; i += 1; continue; }
            const parts = glob.slice(i + 1, end).split(',').map((p) => p.replace(/[.+^$()|[\]\\]/g, '\\$&'));
            re += `(?:${parts.join('|')})`;
            i = end + 1;
          } else if (/[.+^$()|[\]\\]/.test(c)) {
            re += `\\${c}`;
            i += 1;
          } else {
            re += c;
            i += 1;
          }
        }
        re += '$';
        return new RegExp(re);
      }
    
      // The project-relative paths this page could be known as. Ignore globs are
      // project-relative (prototype/foo.html) and the URL is site-relative
      // (/foo.html), because a static server's root usually sits inside the
      // project; `roots` carries that prefix. The server reads it from the inject
      // config's own `files` globs, which already state where the served pages
      // are. Do not derive it from the ignore globs: a single entry scoped to
      // prototype/library/** would then lend prototype/library/ as a candidate
      // prefix to every page, and that rule would suppress site-wide.
      //
      // Each prefixed path also contributes its slash suffixes, mirroring
      // findingMatchesScopedIgnoreFile in cli/lib/impeccable-config.mjs (which
      // matches globs against every path suffix of the finding's file).
      //
      // One live session is served by one server, so a single document root must
      // sit at or above every configured page. The only prefix that can safely
      // be asserted is therefore the deepest common ancestor of the glob roots.
      // Treating each glob's own prefix as an identity goes wrong in both
      // directions: disjoint roots (src/ and public/) invent simultaneous
      // identities for one URL, so a waiver scoped to src/foo.html hides a
      // finding on a page served from public/foo.html; nested roots (prototype/
      // and prototype/library/, from globs at two depths in one tree) are not
      // alternatives at all, and demanding a waiver match under both stops
      // prototype/index.html from applying anywhere. When the globs share no
      // common root, no prefix is asserted and only the URL path itself matches.
      function pageCandidates(pathname, roots, pageFiles) {
        let pagePath = String(pathname || '');
        try {
          pagePath = decodeURIComponent(pagePath);
        } catch {
          // Malformed percent-escape: match on the raw path rather than throwing.
        }
        pagePath = pagePath.replace(/^\/+/, '');
        // A directory URL serves that directory's index, and the ignore globs
        // name files. Without this, /news/ never matches prototype/news/index.html.
        if (pagePath === '' || pagePath.endsWith('/')) pagePath += 'index.html';
    
        const candidates = new Set();
        const addSuffixes = (fullPath) => {
          const parts = fullPath.split('/').filter(Boolean);
          for (let i = 0; i < parts.length; i++) {
            candidates.add(parts.slice(i).join('/'));
          }
        };
        addSuffixes(pagePath);
    
        // The served page list names the real files the inject config serves.
        // A URL that suffix-matches exactly one of them has an unambiguous
        // project identity; assert that identity and stop guessing from roots
        // (PR #645 review: with src/ and public/ both served, /foo.html must not
        // borrow src/foo.html's waivers while actually serving public/foo.html).
        // Zero matches or several fall through to the common-ancestor fallback:
        // ambiguity resolves toward showing the finding.
        const knownPages = [];
        for (const entry of Array.isArray(pageFiles) ? pageFiles : []) {
          if (typeof entry !== 'string' || !entry) continue;
          if (entry === pagePath || entry.endsWith('/' + pagePath)) knownPages.push(entry);
        }
        if (knownPages.length === 1) {
          addSuffixes(knownPages[0]);
          return [...candidates];
        }
    
        const prefixes = [];
        for (const entry of Array.isArray(roots) ? roots : []) {
          if (typeof entry !== 'string') continue;
          prefixes.push(entry.split('/').filter(Boolean));
        }
        let common = prefixes.length > 0 ? prefixes[0] : [];
        for (const segments of prefixes.slice(1)) {
          let i = 0;
          while (i < common.length && i < segments.length && common[i] === segments[i]) i += 1;
          common = common.slice(0, i);
        }
    
        if (common.length > 0) addSuffixes(common.join('/') + '/' + pagePath);
        return [...candidates];
      }
    
      function matchesScope(globs, candidates) {
        return globs.some((glob) => {
          let re;
          try {
            re = globToRegex(String(glob));
          } catch {
            // Malformed glob: skip it, as matchesAnyGlob does in the CLI.
            return false;
          }
          return candidates.some((candidate) => re.test(candidate));
        });
      }
    
      /**
       * Resolve the serialized project ignores for one page.
       *
       * @param {object} options
       * @param {object} options.ignores  window.__IMPECCABLE_PROJECT_IGNORES__,
       *   in whatever state it arrived: absent, null, or hand-edited into the
       *   wrong shape. Every read tolerates that and degrades to no filtering.
       * @param {string} options.pathname  location.pathname of the scanned page.
       * @returns {{ disabledRules: string[], disabledValues: Array<{rule: string, value: string}>, skipScan: boolean }}
       */
      function resolveDetectIgnores({ ignores, pathname } = {}) {
        const config = ignores && typeof ignores === 'object' ? ignores : {};
        const asArray = (value) => (Array.isArray(value) ? value : []);
        const candidates = pageCandidates(pathname, config.roots, config.pageFiles);
    
        // detector.ignoreFiles waives whole files. When any glob names this
        // page, the scan itself is skipped; rule and value lists are returned
        // empty because nothing will run.
        const ignoreFileGlobs = asArray(config.ignoreFiles)
          .filter((glob) => typeof glob === 'string' && glob.trim());
        if (ignoreFileGlobs.length > 0 && matchesScope(ignoreFileGlobs, candidates)) {
          return { disabledRules: [], disabledValues: [], skipScan: true };
        }
    
        const disabledRules = new Set(
          asArray(config.ignoreRules)
            .filter((rule) => typeof rule === 'string')
            .map(normalizeIgnoreRule)
            .filter(Boolean),
        );
        const disabledValues = [];
    
        for (const entry of asArray(config.ignoreValues)) {
          if (!entry || typeof entry !== 'object') continue;
          const rule = normalizeIgnoreRule(entry.rule);
          const value = normalizeIgnoreValue(entry.value);
          if (!rule || !value) continue;
          const files = [
            ...(typeof entry.file === 'string' && entry.file.trim() ? [entry.file.trim()] : []),
            ...asArray(entry.files).filter((glob) => typeof glob === 'string' && glob.trim()),
          ];
          if (value === '*') {
            // Wildcards suppress their rule only inside the files they name.
            if (files.length > 0 && matchesScope(files, candidates)) disabledRules.add(rule);
            continue;
          }
          if (files.length > 0 && !matchesScope(files, candidates)) continue;
          disabledValues.push({ rule, value });
        }
    
        return { disabledRules: [...disabledRules], disabledValues, skipScan: false };
      }
    
      root.__IMPECCABLE_LIVE_IGNORES__ = {
        version: 1,
        resolveDetectIgnores,
      };
    })(typeof window !== 'undefined' ? window : globalThis);
    
  • .agent/skills/impeccable/scripts/live-browser-session.js5.7 KB6871770720d3upstream ↗
    /**
     * Browser-side durable session helpers for Impeccable live mode.
     *
     * Kept separate from live-browser.js so recovery state can be tested without
     * booting the full overlay UI. Served before live-browser.js and attached to
     * window.__IMPECCABLE_LIVE_SESSION__.
     */
    (function (root) {
      'use strict';
    
      // crypto.randomUUID() exists only in secure contexts (HTTPS, localhost), so a
      // dev site on a LAN IP, a Tailscale address, or a custom hostname over plain
      // HTTP has no randomUUID at all (issue #1055). getRandomValues() is available
      // in every context; Math.random() covers runtimes with no crypto. Live ids
      // only have to be unique per session, not unguessable.
      function randomUUID(cryptoImpl) {
        const c = cryptoImpl === undefined ? root.crypto : cryptoImpl;
        try {
          if (c && typeof c.randomUUID === 'function') return c.randomUUID();
        } catch { /* fall through to getRandomValues */ }
        const bytes = new Uint8Array(16);
        let filled = false;
        try {
          if (c && typeof c.getRandomValues === 'function') {
            c.getRandomValues(bytes);
            filled = true;
          }
        } catch { /* fall through to Math.random */ }
        if (!filled) {
          for (let i = 0; i < 16; i++) bytes[i] = Math.floor(Math.random() * 256);
        }
        bytes[6] = (bytes[6] & 0x0f) | 0x40; // version 4
        bytes[8] = (bytes[8] & 0x3f) | 0x80; // RFC 4122 variant
        const hex = Array.from(bytes, (b) => b.toString(16).padStart(2, '0')).join('');
        return hex.slice(0, 8) + '-' + hex.slice(8, 12) + '-' + hex.slice(12, 16)
          + '-' + hex.slice(16, 20) + '-' + hex.slice(20);
      }
    
      function randomId8(cryptoImpl) {
        return randomUUID(cryptoImpl).replace(/-/g, '').slice(0, 8);
      }
    
      function createLiveBrowserSessionState({ prefix, storage, idFactory }) {
        if (!prefix) throw new Error('prefix required');
        let store = storage;
        if (!store) {
          try { store = root.localStorage; } catch { store = null; /* storage denied */ }
        }
        const makeId = idFactory || function () { return randomId8(); };
        const sessionKey = prefix + '-session';
        const handledKey = sessionKey + '-handled';
        const scrollKey = sessionKey + '-scroll';
        let checkpointRevision = 0;
        const owner = makeId();
    
        function safeRead(key) {
          try { return store.getItem(key); } catch { return null; }
        }
    
        function safeWrite(key, value) {
          try { store.setItem(key, value); } catch { /* quota exceeded or private mode */ }
        }
    
        function safeRemove(key) {
          try { store.removeItem(key); } catch { /* unavailable storage */ }
        }
    
        function loadSession() {
          try {
            const raw = safeRead(sessionKey);
            if (!raw) return null;
            const parsed = JSON.parse(raw);
            if (Number.isInteger(parsed.checkpointRevision)) {
              checkpointRevision = Math.max(checkpointRevision, parsed.checkpointRevision);
            }
            return parsed;
          } catch { return null; }
        }
    
        function saveSession(session) {
          if (!session || !session.id) return;
          // Adopt a revision another tab stored so this write does not lower it.
          // localStorage has no compare-and-set, so a save from another tab that
          // lands between this read and the write below can still be overwritten.
          loadSession();
          const payload = {
            ...session,
            checkpointRevision,
          };
          safeWrite(sessionKey, JSON.stringify(payload));
        }
    
        function clearSession() {
          safeRemove(sessionKey);
        }
    
        function nextCheckpointRevision() {
          const existing = loadSession();
          checkpointRevision += 1;
          if (existing?.id) saveSession(existing);
          return checkpointRevision;
        }
    
        function seedCheckpointRevision(value) {
          if (Number.isInteger(value)) checkpointRevision = Math.max(checkpointRevision, value);
          return checkpointRevision;
        }
    
        function currentCheckpointRevision() {
          return checkpointRevision;
        }
    
        function readHandledIds() {
          const raw = safeRead(handledKey);
          if (!raw) return [];
          try {
            const parsed = JSON.parse(raw);
            if (Array.isArray(parsed)) {
              return parsed.filter(id => typeof id === 'string' && id);
            }
            if (typeof parsed === 'string' && parsed) return [parsed];
          } catch { /* legacy values were stored as a plain session id */ }
          return [raw];
        }
    
        function markHandled(id) {
          if (!id) return;
          const ids = readHandledIds().filter(existing => existing !== id);
          ids.push(id);
          safeWrite(handledKey, JSON.stringify(ids.slice(-8)));
        }
    
        function isHandled(id) {
          return !!id && readHandledIds().includes(id);
        }
    
        function clearHandled(id) {
          if (!id) {
            safeRemove(handledKey);
            return;
          }
          const remaining = readHandledIds().filter(existing => existing !== id);
          if (remaining.length > 0) safeWrite(handledKey, JSON.stringify(remaining));
          else safeRemove(handledKey);
        }
    
        function writeScrollY(y) {
          safeWrite(scrollKey, String(y));
        }
    
        function readScrollY() {
          const raw = safeRead(scrollKey);
          if (raw == null) return null;
          const n = parseFloat(raw);
          return isFinite(n) ? n : null;
        }
    
        function clearScrollY() {
          safeRemove(scrollKey);
        }
    
        return {
          owner,
          sessionKey,
          handledKey,
          scrollKey,
          saveSession,
          loadSession,
          clearSession,
          nextCheckpointRevision,
          seedCheckpointRevision,
          currentCheckpointRevision,
          markHandled,
          isHandled,
          clearHandled,
          writeScrollY,
          readScrollY,
          clearScrollY,
        };
      }
    
      root.__IMPECCABLE_LIVE_SESSION__ = { createLiveBrowserSessionState, randomUUID, randomId8 };
    })(typeof window !== 'undefined' ? window : globalThis);
    
  • .agent/skills/impeccable/scripts/live-browser.js553 KBaf2e4a6e10daupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/scripts/modern-screenshot.umd.js29 KBa9c5208f6b14upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/scripts/VERSION7 Ba2e1aa9d9378upstream ↗
    0.1.27
    
  • .agent/skills/impeccable/reference/adapt.md11 KB6b1a6d06c895upstream ↗
    > **Additional context needed**: target platforms/devices and usage contexts.
    
    Adapt an existing design to a different context: another screen size, device, platform, or use case. The trap is treating adaptation as scaling. The job is rethinking the experience for the new context.
    
    **Web only** (mobile web included). Native platforms (`ios` / `android` / `adaptive`) route to [adapt.native.md](adapt.native.md) instead; if the project is native, switch to it now.
    
    ---
    
    ## Assess Adaptation Challenge
    
    Understand what needs adaptation and why:
    
    1. **Identify the source context**:
       - What was it designed for originally? (Desktop web? Mobile app?)
       - What assumptions were made? (Large screen? Mouse input? Fast connection?)
       - What works well in current context?
    
    2. **Understand target context**:
       - **Device**: Mobile, tablet, desktop, TV, watch, print?
       - **Input method**: Touch, mouse, keyboard, voice, gamepad?
       - **Screen constraints**: Size, resolution, orientation?
       - **Connection**: Fast wifi, slow 3G, offline?
       - **Usage context**: On-the-go vs desk, quick glance vs focused reading?
       - **User expectations**: What do users expect on this platform?
    
    3. **Identify adaptation challenges**:
       - What won't fit? (Content, navigation, features)
       - What won't work? (Hover states on touch, tiny touch targets)
       - What's inappropriate? (Desktop patterns on mobile, mobile patterns on desktop)
    
    Adaptation is rethinking the experience for the new context, not scaling pixels.
    
    ## Plan Adaptation Strategy
    
    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
    - Thumbs-first design (controls within thumb reach)
    - 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
    - Back button in navigation flow
    
    ### 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
    - Multi-column forms where appropriate
    
    ### 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
    - Drag and drop where helpful
    - Multi-select with Shift/Cmd
    
    **Content Strategy**:
    - Show more information upfront (less progressive disclosure)
    - Data tables with many columns
    - Richer visualizations
    - More detailed descriptions
    
    ### 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)
    - Convert charts to print-friendly versions
    
    ### 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
    
    ## Implement Adaptations
    
    Apply changes systematically:
    
    ### Responsive Breakpoints
    
    Choose appropriate breakpoints:
    - Mobile: 320px-767px
    - Tablet: 768px-1023px
    - Desktop: 1024px+
    - Or content-driven breakpoints (where design breaks)
    
    ### Layout Adaptation Techniques
    
    - **CSS Grid/Flexbox**: Reflow layouts automatically
    - **Container Queries**: Adapt based on container, not viewport
    - **`clamp()`**: Fluid sizing between min and max
    - **Media queries**: Different styles for different contexts
    - **Display properties**: Show/hide elements per context
    
    ### Touch Adaptation
    
    - Increase touch target sizes (44x44px minimum)
    - Add more spacing between interactive elements
    - Remove hover-dependent interactions
    - Add touch feedback (ripples, highlights)
    - Consider thumb zones (easier to reach bottom than top)
    
    ### Content Adaptation
    
    - Use `display: none` sparingly (still downloads)
    - Progressive enhancement (core content first, enhancements on larger screens)
    - Lazy loading for off-screen content
    - Responsive images (`srcset`, `picture` element)
    
    ### Navigation Adaptation
    
    - Transform complex nav to hamburger/drawer on mobile
    - Bottom nav bar for mobile web
    - Persistent side navigation on desktop
    - Breadcrumbs on smaller screens for context
    
    Test on real devices. DevTools emulation is a useful first pass but misses real touch, performance, and browser chrome.
    
    **Avoid**:
    - 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)
    - Break user expectations for platform (mobile users expect mobile patterns)
    - Forget landscape orientation on mobile/tablet
    - Use generic breakpoints blindly (use content-driven breakpoints)
    - Ignore touch on desktop (many desktop devices have touch)
    
    ## Verify Adaptations
    
    Test thoroughly across contexts:
    
    - **Real devices**: Test on actual phones, tablets, desktops
    - **Different orientations**: Portrait and landscape
    - **Different browsers**: Safari, Chrome, Firefox, Edge
    - **Different OS**: iOS, Android, Windows, macOS
    - **Different input methods**: Touch, mouse, keyboard
    - **Edge cases**: Very small screens (320px), very large screens (4K)
    - **Slow connections**: Test on throttled network
    
    **Custom controls** (sliders, drag surfaces, scrollable control strips): a before/after slider can pass every width check above and still refuse to drag on iOS, so exercise each one in scope in the same batched round as the checks above:
    
    - **Primary gesture**: Tap it and confirm it responds as designed, then drag it with the target input method; the drag must complete, not just start
    - **Scroll across it**: A swipe along the page's scroll axis across the control scrolls the page or container without activating it; a drag that starts on the control along its axis moves the control, not the page. Neither failure throws an error, so try both
    - **Evidence**: Say what produced the evidence: an emulated viewport, synthesized touch input through a browser tool, which engine ran it (Chromium is not Safari), or a physical device. Screenshots and resized viewports verify layout, never a gesture. Name what stayed untested and move on; unreachable hardware is a reported gap, not a blocker
    
    When the adaptation feels native to each context, hand off to `/impeccable polish` for the final pass.
    
    ---
    
    ## Reference Material
    
    The sections below were previously `responsive-design.md` and live inline now so the adapt flow has its deep responsive reference in one place.
    
    ### Responsive Design
    
    #### Mobile-First: Write It Right
    
    Start with base styles for mobile, use `min-width` queries to layer complexity. Desktop-first (`max-width`) means mobile loads unnecessary styles first.
    
    #### Breakpoints: Content-Driven
    
    Don't chase device sizes; let content tell you where to break. Start narrow, stretch until design breaks, add breakpoint there. Three breakpoints usually suffice (640, 768, 1024px). Use `clamp()` for fluid values without breakpoints.
    
    #### Detect Input Method, Not Just Screen Size
    
    **Screen size doesn't tell you input method.** A laptop with touchscreen, a tablet with keyboard. Use pointer and hover queries:
    
    ```css
    /* Fine pointer (mouse, trackpad) */
    @media (pointer: fine) {
      .button { padding: 8px 16px; }
    }
    
    /* Coarse pointer (touch, stylus) */
    @media (pointer: coarse) {
      .button { padding: 12px 20px; }  /* Larger touch target */
    }
    
    /* Device supports hover */
    @media (hover: hover) {
      .card:hover .card-surface { transform: translateY(-2px); }  /* Lift a child; the card stays the hit area */
    }
    
    /* Device doesn't support hover (touch) */
    @media (hover: none) {
      .card { /* No hover state - use active instead */ }
    }
    ```
    
    **Critical**: Don't rely on hover for functionality. Touch users can't hover.
    
    #### Safe Areas: Handle the Notch
    
    Modern phones have notches, rounded corners, and home indicators. Use `env()`:
    
    ```css
    body {
      padding-top: env(safe-area-inset-top);
      padding-bottom: env(safe-area-inset-bottom);
      padding-left: env(safe-area-inset-left);
      padding-right: env(safe-area-inset-right);
    }
    
    /* With fallback */
    .footer {
      padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
    ```
    
    **Enable viewport-fit** in your meta tag:
    ```html
    <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
    ```
    
    #### Responsive Images: Get It Right
    
    ##### srcset with Width Descriptors
    
    ```html
    <img
      src="hero-800.jpg"
      srcset="
        hero-400.jpg 400w,
        hero-800.jpg 800w,
        hero-1200.jpg 1200w
      "
      sizes="(max-width: 768px) 100vw, 50vw"
      alt="Hero image"
    >
    ```
    
    **How it works**:
    - `srcset` lists available images with their actual widths (`w` descriptors)
    - `sizes` tells the browser how wide the image will display
    - Browser picks the best file based on viewport width AND device pixel ratio
    
    ##### Picture Element for Art Direction
    
    When you need different crops/compositions (not just resolutions):
    
    ```html
    <picture>
      <source media="(min-width: 768px)" srcset="wide.jpg">
      <source media="(max-width: 767px)" srcset="tall.jpg">
      <img src="fallback.jpg" alt="...">
    </picture>
    ```
    
    #### Layout Adaptation Patterns
    
    **Navigation**: Three stages: hamburger + drawer on mobile, horizontal compact on tablet, full with labels on desktop. **Tables**: Transform to cards on mobile using `display: block` and `data-label` attributes. **Progressive disclosure**: Use `<details>/<summary>` for content that can collapse on mobile.
    
    #### Testing: Don't Trust DevTools Alone
    
    DevTools device emulation is useful for layout but misses:
    
    - Actual touch interactions
    - Real CPU/memory constraints
    - Network latency patterns
    - Font rendering differences
    - Browser chrome/keyboard appearances
    
    **Test on at least**: One real iPhone, one real Android, a tablet if relevant. Cheap Android phones reveal performance issues you'll never see on simulators.
    
    ---
    
    **Avoid**: Desktop-first design. Device detection instead of feature detection. Separate mobile/desktop codebases. Ignoring tablet and landscape. Assuming all mobile devices are powerful.
    
  • .agent/skills/impeccable/reference/adapt.native.md3.8 KB877871aa0314upstream ↗
    > **Additional context needed**: target platforms/devices and usage contexts.
    
    Adapt an existing **native** design (`ios` / `android` / `adaptive`) to a different context: another device class, orientation, platform, or origin. The trap is treating adaptation as scaling. The job is rethinking the experience for the new context, inside the platform conventions of [ios.md](ios.md) / [android.md](android.md); read the target platform's reference before planning if Setup hasn't already.
    
    ## Assess Adaptation Challenge
    
    1. **Source context**: what was it designed for, and what assumptions did it make? (Phone-only? Portrait-only? One platform's idioms? A website?)
    2. **Target context**: which device class (phone, tablet, foldable), orientation, platform, and usage posture (one-handed on the go vs two-handed at rest)?
    3. **What breaks**: navigation that doesn't fit the target, layouts that stretch instead of restructure, gestures or controls that don't exist there?
    
    ## Adaptation Strategies
    
    ### Phone → Tablet (iPad / large screens)
    
    - **Restructure, don't stretch.** A scaled-up phone UI on a tablet is the failure mode. Use size classes (iOS) / window size classes (Android) to switch structure.
    - **Navigation changes shape**: tab bar stays or becomes a sidebar on iPad; Android navigation bar becomes a rail or drawer on expanded width.
    - **Use the width**: split view / master-detail (list + detail side by side), multi-column grids, popovers where phones used sheets.
    - **Multitasking is a size, not an edge case**: iPad Split View and Android multi-window can hand you a phone-width window on a tablet; size-class-driven layout handles both for free.
    
    ### Orientation & foldables
    
    - Landscape restructures (side-by-side panes, repositioned controls); never clip or letterbox. Lock orientation only when the task truly demands it.
    - Foldables (Android): react to posture and hinge via window size classes; test folded, unfolded, and tabletop.
    
    ### Platform → platform (iOS ↔ Android)
    
    Translate idioms; never transplant them:
    
    | iOS | Android |
    |---|---|
    | Tab bar | Navigation bar / rail / drawer |
    | Edge-swipe back, back chevron | Predictive Back gesture / button |
    | Switch, segmented control, system pickers | Material switch, chips, Material pickers |
    | Action sheet | Bottom sheet / Material dialog |
    | SF Symbols, SF Pro, Dynamic Type | Material Symbols, Roboto, sp scaling |
    | Semantic system colors, materials | Material color roles, tonal elevation |
    | System push/sheet transitions | Container transform, shared-axis, fade-through |
    
    Rebuild navigation and controls in the target's vocabulary; carry over the brand's expressive layer (palette intent, type accent, motion personality) through the target's theming system.
    
    ### Web → native (porting a website or web app)
    
    Reconform, don't reflow. Replace web navigation with the platform's model, HTML-shaped controls with platform controls, hover affordances with touch-first ones, and px-based type with Dynamic Type / sp. Then treat the result to the full platform reference; the slop test there is the acceptance bar.
    
    ## Implement & Verify
    
    - Drive structure from **size classes / window size classes**, never from device-model checks.
    - Respect safe areas and window insets in every new configuration (notch, hinge, status bar, keyboard).
    - Test on simulators for breadth, then real hardware for truth: at least one phone and one tablet per shipped platform, both orientations, split-screen where supported.
    
    When the adaptation feels native to each context, hand off to `/impeccable polish` for the final pass.
    
    **Avoid**:
    - Ship a stretched phone layout on a tablet
    - Port one platform's controls or navigation onto the other
    - Hide core functionality on smaller devices (if it matters, make it work)
    - Lock orientation to dodge a layout bug
    - Trust simulators alone (posture, gestures, and performance need hardware)
    
  • .agent/skills/impeccable/reference/android.md4.1 KB32a5cf7ccfd7upstream ↗
    # Android platform
    
    For native Android apps: Jetpack Compose, Android Views, React Native, Expo, Flutter shipping to Android hardware.
    
    On native, the visitor mode narrows what expression may override. Material Design 3 governs structure, navigation, and interaction in every mode; brand expresses through Material's theming (color roles, type scale, shape, motion). A Material-everywhere cross-platform app that also ships to iPhone still owes iOS its OS guarantees on that hardware: safe-area insets, Reduce Motion, edge-swipe back.
    
    ## The Android slop test
    
    Would a fluent Android user trust this app, or trip on off-spec components? The most common tell is an iOS app wearing Android's skin: a bottom-only navigation copied from iPhone, a back arrow that ignores the system Back gesture, Cupertino-shaped switches and dialogs. Material 3 is the rulebook; follow its components and theme the brand through it.
    
    ## Layout & structure
    
    - **Material navigation, matched to size.** Navigation bar (bottom, 3–5 destinations) on compact width; navigation rail or drawer on expanded width. Never ship a phone bottom-bar untouched on a tablet.
    - **System Back always works.** Honor the predictive Back gesture and Back button; never trap the user or hijack the gesture.
    - **Edge-to-edge with window insets.** Apply the status bar, navigation bar, display cutout, and IME insets so content never hides behind system bars or the keyboard.
    - **Top app bar for screen context**; pair with a FAB when the screen has a single primary action.
    
    ## Touch targets
    
    - **48×48 dp minimum** for every touch target, with at least 8 dp between them.
    
    ## Typography
    
    - **Material type scale.** Display, Headline, Title, Body, Label roles (large/medium/small each). Map text to roles; never hand-pick sizes per screen.
    - **Roboto is the system face**; theme a brand face in through the type scale, keeping body, labels, and controls legible and consistent.
    - **sp units, never fixed px**, so type follows the system font-size setting.
    
    ## Color & theming
    
    - **Material color roles** (primary, on-primary, surface, surface-variant, secondary-container, outline, error). Role tokens resolve light/dark and contrast variants automatically; raw hex breaks there.
    - **Dynamic Color (Material You)** where it fits: derive the scheme from the user's wallpaper on Android 12+, with a static fallback.
    - **Dark theme is a first-class scheme.** Design and test it; never a quick invert.
    - **Tonal elevation.** Convey elevation through the standard surface tonal levels (plus shadow where appropriate); no arbitrary drop shadows.
    
    ## Components & motion
    
    - **Material components.** Buttons (filled / tonal / outlined / text), FAB, switches, chips, snackbars, bottom sheets, Material dialogs, navigation bar/rail/drawer. Never port iOS controls or invent equivalents.
    - **One FAB, one primary action.** Never stack FABs or spend one on a secondary task.
    - **Snackbars for transient feedback** (actionable when useful, never a toast for that); dialogs only for decisions that must interrupt.
    - **Material motion patterns.** Container transform, shared-axis, fade-through, with standard easing and durations; honor the system Remove animations setting with a crossfade or instant cut.
    
    ## Verifying the build
    
    - **Screenshots come from the emulator or a connected device, never a browser.** Build and install, then capture with `adb exec-out screencap -p > <path>` (pick a device with `adb -s <serial>` when several are attached). Capture every device class the app ships to, at least one phone and, when tablets are a target, one tablet, and write the files where the review flow expects them.
    - **Dark theme and font scale belong in the pass.** `adb shell cmd uimode night yes` flips the theme; `adb shell settings put system font_scale 1.3` (read both settings first with `adb shell cmd uimode night` and `adb shell settings get system font_scale`, and restore them after) catches the clipped labels a fixed layout hides; with several targets attached, the capture's `-s <serial>` goes on these commands too.
    - **Emulators give breadth; gestures, refresh rates, and performance need hardware.** Say which one produced the evidence.
    
  • .agent/skills/impeccable/reference/animate.md8.5 KB01170d71849bupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/audit.md12 KB970edc43da0fupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/audit.native.md8.9 KB91a27804496cupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/bolder.md3.4 KB78ceb8dfd8c8upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/clarify.md4.5 KB3047a9d82b9cupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/colorize.md4.4 KBdc45f88c5f81upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/component-review.md7.8 KBbd65e393b40cupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/craft-floor.md4.6 KB9ed26491b5eeupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/craft.md555 Bdbbc9402c07cupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/critique-rubric.md19 KB525c60a3ba8bupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/critique.md27 KBe2b6e03bbec3upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/degraded/asset-producer.md8.3 KB6c6a301eec7bupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/degraded/documenter.md3.7 KB2090bd8b11bdupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/degraded/finish-reviewer.md16 KBebe8cd18263eupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/degraded/manual-edit-applier.md7.5 KB7f2bdb65d1c7upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/degraded/motion-reviewer.md6.5 KB422b5c0b7effupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/delight.md3.6 KB798c43a5b735upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/distill.md5.5 KB2729124ccfe5upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/doctor.md5.9 KBf5def0bcd309upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/document.md28 KB36af4ea623d5upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/extract.md3.2 KB24718bc6f665upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/foundations.md7.4 KB3ea3c5aa11b2upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/generate.md13 KB6a438bdc816bupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/harden.md10 KBe7183cfab285upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/hooks.md17 KB86103f84c2d5upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/init.md12 KBbbf9d5e2e032upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/ios.md3.7 KBc6244dfe3217upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/layout.md5.0 KB0ecd6de7252fupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/live-setup.md8.2 KB7858ee98b1f7upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/live.md41 KB6906f2ed1fa0upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/mode-operate.md4.6 KB833775ba85f0upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/mode-persuade.md3.6 KB9c152d67064fupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/mode-read.md4.3 KBb30c4c9139e3upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/new-work-comp.md14 KB68cb511f00feupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/new-work-world.md19 KBdc72b76ebf67upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/new-work.md34 KBc49c7582a5c3upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/onboard.md7.8 KBc4df3b6bfc72upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/operate.md4.0 KB524f2c3ae9faupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/optimize.md7.4 KB3f3fc7c33e21upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/overdrive.md9.0 KB941ac23f397aupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/polish.md6.6 KBd3328a840c30upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/quieter.md4.9 KBbfbcdcd42551upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/region-map.md3.3 KB230a8aa82d61upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/routing.md3.3 KBad58fd5077adupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/shape.md3.5 KB90a74ae81333upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/typeset.md6.9 KBb6e690fd7a8aupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • .agent/skills/impeccable/reference/visualize.md14 KB4fa37f06c732upstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

  • README.mdupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

Plain-text copy, no login: /skill-bundles/pbakaus-impeccable-agent-skills-impeccable.md

// REPO STATS

113.2k stars