jioogen 0.2.7 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/authoring-pack/agent/core.md +574 -0
- package/authoring-pack/agent/discovery.md +21 -0
- package/authoring-pack/agent/prd.md +37 -0
- package/authoring-pack/agent/specs.md +47 -0
- package/authoring-pack/agent/tasks.md +59 -0
- package/authoring-pack/knowledge/catalog.generated.json +1428 -0
- package/authoring-pack/knowledge/library/_TEMPLATE.md +30 -0
- package/authoring-pack/knowledge/library/discovery/discovery-standard.md +157 -0
- package/authoring-pack/knowledge/library/discovery/progressive-understanding.md +64 -0
- package/authoring-pack/knowledge/library/gamedev/K-GAME-001-discovery-game.md +60 -0
- package/authoring-pack/knowledge/library/gamedev/K-GAME-101-prd-game.md +62 -0
- package/authoring-pack/knowledge/library/gamedev/disciplines/game-ai.md +33 -0
- package/authoring-pack/knowledge/library/gamedev/disciplines/game-feel.md +32 -0
- package/authoring-pack/knowledge/library/gamedev/disciplines/game-ui-ux.md +32 -0
- package/authoring-pack/knowledge/library/gamedev/disciplines/level-design.md +31 -0
- package/authoring-pack/knowledge/library/gamedev/disciplines/procedural-gen.md +33 -0
- package/authoring-pack/knowledge/library/gamedev/disciplines/save-systems.md +32 -0
- package/authoring-pack/knowledge/library/gamedev/genres/card-game.md +33 -0
- package/authoring-pack/knowledge/library/gamedev/genres/fps-shooter.md +34 -0
- package/authoring-pack/knowledge/library/gamedev/genres/platformer.md +37 -0
- package/authoring-pack/knowledge/library/gamedev/genres/puzzle.md +32 -0
- package/authoring-pack/knowledge/library/gamedev/genres/roguelike.md +34 -0
- package/authoring-pack/knowledge/library/gamedev/genres/rpg.md +33 -0
- package/authoring-pack/knowledge/library/gamedev/genres/survival-crafting.md +34 -0
- package/authoring-pack/knowledge/library/gamedev/genres/tower-defense.md +33 -0
- package/authoring-pack/knowledge/library/gamedev/genres/visual-novel.md +32 -0
- package/authoring-pack/knowledge/library/prd/acceptance.md +54 -0
- package/authoring-pack/knowledge/library/prd/capability-coverage.md +37 -0
- package/authoring-pack/knowledge/library/prd/decomposition.md +80 -0
- package/authoring-pack/knowledge/library/prd/enterprise-checklist.md +53 -0
- package/authoring-pack/knowledge/library/prd/feature-hierarchy.md +105 -0
- package/authoring-pack/knowledge/library/prd/prd-standard.md +175 -0
- package/authoring-pack/knowledge/library/prd/self-check.md +129 -0
- package/authoring-pack/knowledge/library/prd/writing-style.md +74 -0
- package/authoring-pack/knowledge/library/qa/gate-reference.md +119 -0
- package/authoring-pack/knowledge/library/specs/specs-standard.md +87 -0
- package/authoring-pack/knowledge/library/tasks/conditional-coverage-a.md +34 -0
- package/authoring-pack/knowledge/library/tasks/conditional-coverage-b.md +63 -0
- package/authoring-pack/knowledge/library/tasks/tasks-standard.md +98 -0
- package/authoring-pack/knowledge/library/ui/K-UIX-001-universal-uiux-principles.md +66 -0
- package/authoring-pack/knowledge/library/ui/K-UIX-002-visual-ux-qa-rubric.md +65 -0
- package/authoring-pack/knowledge/library/ui/K-UIX-003-adaptive-ui-authoring.md +66 -0
- package/authoring-pack/manifest.json +230 -0
- package/authoring-pack/skills/business-discovery/SKILL.md +147 -0
- package/authoring-pack/skills/business-discovery/skill.yaml +22 -0
- package/authoring-pack/skills/creative-discovery/SKILL.md +122 -0
- package/authoring-pack/skills/creative-discovery/skill.yaml +22 -0
- package/authoring-pack/skills/karpathy-guidelines/SKILL.md +96 -0
- package/authoring-pack/skills/karpathy-guidelines/skill.yaml +19 -0
- package/authoring-pack/skills/prd-authoring/SKILL.md +384 -0
- package/authoring-pack/skills/prd-authoring/skill.yaml +33 -0
- package/authoring-pack/skills/product-discovery/SKILL.md +258 -0
- package/authoring-pack/skills/product-discovery/skill.yaml +25 -0
- package/authoring-pack/skills/specs-authoring/SKILL.md +250 -0
- package/authoring-pack/skills/specs-authoring/skill.yaml +32 -0
- package/authoring-pack/skills/tasks-authoring/SKILL.md +278 -0
- package/authoring-pack/skills/tasks-authoring/skill.yaml +32 -0
- package/dist/index.js +4255 -1542
- package/dist/index.js.map +4 -4
- package/package.json +7 -4
- package/skills-pack/baseline/karpathy-guidelines/SKILL.md +96 -0
- package/skills-pack/baseline/karpathy-guidelines/skill.yaml +19 -0
- package/skills-pack/ui-quality/THIRD-PARTY-NOTICE.md +32 -0
- package/skills-pack/ui-quality/impeccable/LICENSE +191 -0
- package/skills-pack/ui-quality/impeccable/SKILL.md +93 -0
- package/skills-pack/ui-quality/impeccable/reference/adapt.md +318 -0
- package/skills-pack/ui-quality/impeccable/reference/adapt.native.md +58 -0
- package/skills-pack/ui-quality/impeccable/reference/android.md +46 -0
- package/skills-pack/ui-quality/impeccable/reference/animate.md +106 -0
- package/skills-pack/ui-quality/impeccable/reference/audit.md +150 -0
- package/skills-pack/ui-quality/impeccable/reference/audit.native.md +143 -0
- package/skills-pack/ui-quality/impeccable/reference/bolder.md +33 -0
- package/skills-pack/ui-quality/impeccable/reference/clarify.md +94 -0
- package/skills-pack/ui-quality/impeccable/reference/colorize.md +86 -0
- package/skills-pack/ui-quality/impeccable/reference/component-review.md +63 -0
- package/skills-pack/ui-quality/impeccable/reference/craft-floor.md +44 -0
- package/skills-pack/ui-quality/impeccable/reference/craft.md +5 -0
- package/skills-pack/ui-quality/impeccable/reference/critique-rubric.md +496 -0
- package/skills-pack/ui-quality/impeccable/reference/critique.md +327 -0
- package/skills-pack/ui-quality/impeccable/reference/degraded/asset-producer.md +42 -0
- package/skills-pack/ui-quality/impeccable/reference/degraded/documenter.md +24 -0
- package/skills-pack/ui-quality/impeccable/reference/degraded/finish-reviewer.md +38 -0
- package/skills-pack/ui-quality/impeccable/reference/degraded/manual-edit-applier.md +93 -0
- package/skills-pack/ui-quality/impeccable/reference/degraded/motion-reviewer.md +29 -0
- package/skills-pack/ui-quality/impeccable/reference/delight.md +70 -0
- package/skills-pack/ui-quality/impeccable/reference/distill.md +111 -0
- package/skills-pack/ui-quality/impeccable/reference/doctor.md +54 -0
- package/skills-pack/ui-quality/impeccable/reference/document.md +418 -0
- package/skills-pack/ui-quality/impeccable/reference/extract.md +69 -0
- package/skills-pack/ui-quality/impeccable/reference/foundations.md +44 -0
- package/skills-pack/ui-quality/impeccable/reference/generate.md +101 -0
- package/skills-pack/ui-quality/impeccable/reference/harden.md +362 -0
- package/skills-pack/ui-quality/impeccable/reference/hooks.md +120 -0
- package/skills-pack/ui-quality/impeccable/reference/init.md +133 -0
- package/skills-pack/ui-quality/impeccable/reference/ios.md +51 -0
- package/skills-pack/ui-quality/impeccable/reference/layout.md +84 -0
- package/skills-pack/ui-quality/impeccable/reference/live-setup.md +104 -0
- package/skills-pack/ui-quality/impeccable/reference/live.md +341 -0
- package/skills-pack/ui-quality/impeccable/reference/mode-operate.md +21 -0
- package/skills-pack/ui-quality/impeccable/reference/mode-persuade.md +19 -0
- package/skills-pack/ui-quality/impeccable/reference/mode-read.md +21 -0
- package/skills-pack/ui-quality/impeccable/reference/new-work-comp.md +24 -0
- package/skills-pack/ui-quality/impeccable/reference/new-work-world.md +20 -0
- package/skills-pack/ui-quality/impeccable/reference/new-work.md +124 -0
- package/skills-pack/ui-quality/impeccable/reference/onboard.md +235 -0
- package/skills-pack/ui-quality/impeccable/reference/operate.md +61 -0
- package/skills-pack/ui-quality/impeccable/reference/optimize.md +257 -0
- package/skills-pack/ui-quality/impeccable/reference/overdrive.md +127 -0
- package/skills-pack/ui-quality/impeccable/reference/polish.md +105 -0
- package/skills-pack/ui-quality/impeccable/reference/quieter.md +99 -0
- package/skills-pack/ui-quality/impeccable/reference/region-map.md +26 -0
- package/skills-pack/ui-quality/impeccable/reference/routing.md +24 -0
- package/skills-pack/ui-quality/impeccable/reference/shape.md +59 -0
- package/skills-pack/ui-quality/impeccable/reference/typeset.md +96 -0
- package/skills-pack/ui-quality/impeccable/reference/visualize.md +47 -0
- package/skills-pack/ui-quality/impeccable/scripts/VERSION +1 -0
- package/skills-pack/ui-quality/impeccable/scripts/command-metadata.json +98 -0
- package/skills-pack/ui-quality/impeccable/scripts/data/font-index-failures.json +121 -0
- package/skills-pack/ui-quality/impeccable/scripts/data/font-index.json +1 -0
- package/skills-pack/ui-quality/impeccable/scripts/engine-checksums.txt +9 -0
- package/skills-pack/ui-quality/impeccable/scripts/impeccable +319 -0
- package/skills-pack/ui-quality/impeccable/scripts/impeccable.cmd +354 -0
- package/skills-pack/ui-quality/impeccable/scripts/live-browser-dom.js +320 -0
- package/skills-pack/ui-quality/impeccable/scripts/live-browser-ignores.js +246 -0
- package/skills-pack/ui-quality/impeccable/scripts/live-browser-session.js +183 -0
- package/skills-pack/ui-quality/impeccable/scripts/live-browser.js +13901 -0
- package/skills-pack/ui-quality/impeccable/scripts/modern-screenshot.umd.js +14 -0
- package/skills-pack/ui-quality/impeccable/skill.yaml +25 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/LICENSE +21 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/SKILL.md +217 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/app-interface.csv +33 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/catalog-summary.json +78 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/charts.csv +26 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/colors.csv +193 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/data-provenance.json +1396 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/google-font-licenses.json +20185 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/google-fonts.csv +1935 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/icons.csv +106 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/landing.csv +35 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/motion.csv +18 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/phosphor-icons-upstream.json +32582 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/products.csv +193 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/angular.csv +51 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/astro.csv +54 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/avalonia.csv +57 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/html-tailwind.csv +60 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/javafx.csv +76 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/laravel.csv +51 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/nextjs.csv +62 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/nuxt-ui.csv +84 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/nuxtjs.csv +68 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/react.csv +67 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/shadcn.csv +69 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/svelte.csv +56 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/threejs.csv +54 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/uno.csv +60 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/uwp.csv +56 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/winui.csv +60 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/wpf.csv +57 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/styles.csv +90 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/typography.csv +75 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/ui-reasoning.csv +193 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/data/ux-guidelines.csv +121 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/references/pro-rules.md +117 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/references/quick-reference.md +257 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/scripts/core.py +1053 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/scripts/design_system.py +1668 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/scripts/reasoning_contract.py +123 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/scripts/search.py +201 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/scripts/validate_data.py +1095 -0
- package/skills-pack/ui-quality/ui-ux-pro-max/skill.yaml +25 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
> **Additional context needed**: only the target element, when the request does not name one that resolves uniquely on the page.
|
|
2
|
+
|
|
3
|
+
Generate is the fast lane into live mode: the user names an element, a direction, and a count in one sentence, and within a minute they are cycling through variants in their browser. One command boots the helper, hands the element to the overlay in the page your harness already shows (it scrolls to it, selects it, and fires the same Go a click fires) and returns the generate event; one edit writes the variants; one call replies and waits for the user's choice, which the helper bakes into source itself. This file owns the lane's plumbing; from the event onward the design work is [live.md](live.md)'s, unchanged, so read it in full now if you have not this session.
|
|
4
|
+
|
|
5
|
+
**Web only.** Live mode's browser overlay has no native equivalent; on `ios` / `android` / `adaptive` projects, decline this command and offer `bolder` or `quieter` on the source instead.
|
|
6
|
+
|
|
7
|
+
The plumbing is where the lane saves time: one command starts the session around the page your harness already shows, one call replies and waits, and nothing here is a browser you have to babysit. The design work is not where it saves time. Setup runs as for any command (`impeccable context`, this reference, craft-floor.md before the edit), and the variants are planned, written, and accepted exactly the way a live session plans, writes, and accepts them.
|
|
8
|
+
|
|
9
|
+
Three prohibitions cover the known ways this command goes wrong:
|
|
10
|
+
|
|
11
|
+
- **Never run init or document, and never ask for PRODUCT.md or DESIGN.md.** When they exist, the start command prints them under `boot` and you use them. When they do not, it says so (`contextMissing`, `contextNote`) and you extract the identity from the event (Step 3). A missing file is never a reason to interview the user inside this command; offer `init` in one line after the session ends.
|
|
12
|
+
- **Never hand-write a variants wrapper or invent a session id.** Only the browser mints session ids (8 hex characters, at Go). A missing event is fixed by rerunning Step 2, never with a direct source edit.
|
|
13
|
+
- **Do not act on hook findings while live markers are in the file**, and do not restyle variants to appease them; the accept verifies the file once the variant is permanent.
|
|
14
|
+
|
|
15
|
+
## Step 1: Parse the request
|
|
16
|
+
|
|
17
|
+
Three parts, all from the user's sentence:
|
|
18
|
+
|
|
19
|
+
- **A number in the request**: that is the count. **No number**: 3. The protocol caps count at 8.
|
|
20
|
+
- **The direction wording** maps onto the live action vocabulary; never invent a new action value:
|
|
21
|
+
- **bold, bolder, stronger, punchier**: `bolder`
|
|
22
|
+
- **quiet, calmer, softer, toned down**: `quieter`
|
|
23
|
+
- **simpler, minimal, stripped**: `distill`
|
|
24
|
+
- **refined, tightened, polished**: `polish`
|
|
25
|
+
- **font and type words**: `typeset`
|
|
26
|
+
- **color words**: `colorize`
|
|
27
|
+
- **arrangement and spacing words**: `layout`
|
|
28
|
+
- **device and breakpoint words**: `adapt`
|
|
29
|
+
- **motion words**: `animate`
|
|
30
|
+
- **playful words**: `delight`
|
|
31
|
+
- **rule-breaking words**: `overdrive`
|
|
32
|
+
- **Wording that carries intent but no vocabulary word** ("make it feel like a bank", "warmer", "more premium"): `impeccable`, with the user's wording passed as the prompt.
|
|
33
|
+
- **An action fits AND extra intent rides along** ("bolder, but keep it monochrome"): that action, with the rest as the prompt.
|
|
34
|
+
- **The wording names no direction at all** ("better", "improve", "nicer", "different", "fresh", "new", "redesign", "fix", "some options", "ideas", "alternatives", or just "variants" with nothing else): Ask with the `question` tool and wait for the answer before continuing. Ask one question, offering the vocabulary: *"Which direction should the variants take? bolder, quieter, simpler (distill), polished, typography (typeset), color (colorize), layout, motion (animate), playful (delight), or rule-breaking (overdrive)."* Map the answer with this list; an answer that is still open ("surprise me", "you pick") is `impeccable` with the user's original wording as the prompt, and Step 2 starts on that answer.
|
|
35
|
+
- **The element description** ("the pricing cards", "the hero heading"): Step 2 resolves it to a selector.
|
|
36
|
+
|
|
37
|
+
Done when you hold an action from the vocabulary (asked for, when the request named no direction), a count from 1 to 8, and the element description.
|
|
38
|
+
|
|
39
|
+
## Step 2: Reuse the page, then start
|
|
40
|
+
|
|
41
|
+
**Reuse** the dev server already running and the tab your harness already shows it in; a second server or a second browser window is the failure this step prevents.
|
|
42
|
+
|
|
43
|
+
1. **Find the dev server**, cheapest source first, and stop at the first hit: the user's message, a browser tab already on the app (Claude Code: an origin in `tabs_context`), a server your harness started (Claude Code: `preview_list`), a terminal that printed its URL. Its origin is your `--dev-url`. **No hit**: leave `--dev-url` off and run the start command with no wait; the boot probes for a running server and its verdict names the move. `browser_needed` carries the `devUrl` it found: open it as in 2, then rerun with `--dev-url <devUrl> --wait-for-browser 60000`. `no_dev_server` means nothing serves the app: start the dev script the way the verdict says (Claude Code: `preview_start`; Cursor: a background terminal; Codex: an exec you yield from), wait for its URL, then rerun with `--dev-url <url>`.
|
|
44
|
+
2. **Open the page that renders the element in your browser, then start.** The route the request names, else the one `--target` serves; `--dev-url` takes only the origin.
|
|
45
|
+
- **Cursor** (`browser_navigate`) and **Claude Code** (`navigate`, which opens the Browser pane when it is closed and takes the `tabId` from `tabs_context` when a tab is already on that origin): open the URL, then run the start command with `--dev-url <url> --wait-for-browser 60000`. The boot injects the overlay and the page reloads into it while the command waits. Your browser tool is the only opener on these harnesses; the engine ignores `--open` there.
|
|
46
|
+
- **No browser tool** (Codex, others): run the start command with `--open --wait-for-browser 120000`; it opens the system browser, and the longer wait covers the user finding the tab. **`browser_open_failed` back**: tell the user the `url` in one line and rerun with `--wait-for-browser 120000`.
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
.opencode/skills/impeccable/scripts/impeccable live-generate --target src/App.jsx --dev-url http://127.0.0.1:5173/ --selector ".pricing-grid" --action bolder --count 3 --boot --wait-for-browser 60000
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Run it in the foreground in Cursor and Claude Code (it returns within the wait); on Codex, in an exec you yield from, the way Step 3 runs the poll.
|
|
53
|
+
|
|
54
|
+
- `--target`: the file that renders the element when the request or the project makes it obvious; skip it otherwise.
|
|
55
|
+
- `--dev-url`: the origin from 1; omit it and the boot probes.
|
|
56
|
+
- `--selector`: a unique class first, then a landmark tag plus class, an id last (every variant mounts a copy of the element, so an id repeats in the DOM). **The request names a repeated component in plural** ("the pricing cards"): target the container that holds the set, so one scoped stylesheet restyles every instance. One read of the source file that renders the element is allowed when the selector is not obvious; `--dry-run` resolves and reports without starting anything when it is not certain.
|
|
57
|
+
- `--boot`: runs the lane's boot (PRODUCT.md and DESIGN.md loaded again for the helper, missing files tolerated, dev URL found, bottom bar hidden for the helper's lifetime) and reuses a helper that is already running. Its result rides along as `boot`.
|
|
58
|
+
- Also available: `--prompt`, `--text` (keep only matches whose visible text contains a snippet), `--index` (1-based pick among matches).
|
|
59
|
+
|
|
60
|
+
Read the output in this order: `boot` (or `boot.contextMissing` with `boot.contextNote`: the page is the source of truth, per the note), then `event`, the generate event for `sessionId`, with the same `_instructions` a user's Go gets. Every verdict carries `_instructions`, and they win over your recollection of this file; the ones whose move is a decision of yours:
|
|
61
|
+
|
|
62
|
+
- **`ambiguous`**: the candidates are listed; target their common container, or rerun with `--text "<visible text>"` or `--index <n>`.
|
|
63
|
+
- **`dev_server_gone`**: the dev server stopped answering while the command waited for the page (on Cursor, a server another chat started dies with that chat). Start it the way the verdict says, then rerun with `--dev-url <url>`.
|
|
64
|
+
- **`no_match`**: the tab is on a route that does not render the element (navigate to the right route, rerun), or the selector is wrong (derive a better one from the source, or add `--text`).
|
|
65
|
+
- **`config_missing` / `config_invalid`** under `bootError`: follow [live-setup.md](live-setup.md) first, then rerun.
|
|
66
|
+
- **`event: null`** with `ok: true`: the event was slower than the wait; run `.opencode/skills/impeccable/scripts/impeccable live-poll` once to collect it, then continue.
|
|
67
|
+
|
|
68
|
+
Done when the output shows `ok: true`, a `sessionId`, and an `event`, reached with at most one server started and one tab opened by you.
|
|
69
|
+
|
|
70
|
+
## Step 3: Generate
|
|
71
|
+
|
|
72
|
+
The event is a standard `generate` event: the picked element's context, a preflighted scaffold, and `_instructions` naming the action's reference, the planning section, and the exact splice. Handle it exactly per live.md's **Handle generate**, which owns everything from the identity lock to the done reply: read the action's reference and craft-floor.md as it says, plan per section 4 (identity first, then mode, then three different primary axes, then the squint test), declare knobs per section 7, and deliver per section 6 (a complete replacement of the element per variant, the preview CSS plus every variant in one edit at the scaffold's splice). The lane changes nothing about what a variant may be: the moves a live session would make on this element (a promoted tier, a restructured set, a reordered card, a different surface) are open here too. Never screenshot the page; the overlay preview is the review channel until accept.
|
|
73
|
+
|
|
74
|
+
**Reply and wait in one call**, with the file you wrote:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
.opencode/skills/impeccable/scripts/impeccable live-poll --reply EVENT_ID done --file src/App.jsx --then-poll
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
This replies done (the browser mounts the variants) and then blocks until the user's choice arrives, so run it the way your harness runs a long wait: **Claude Code** in the foreground with your tool's longest timeout (600000 ms), so you are paused until the choice arrives; **Codex** in a yielded foreground exec; **Cursor** in a background terminal with notify on `"type":"(accept|discard|variant_mount_failed|exit)"`. Never pass a short `--timeout=`. While it runs there is nothing else to do: never sleep and never poll its output on a timer; a harness that backgrounds it wakes you when it returns. `{"type":"timeout"}` means the user has not chosen yet: run `live-poll` again and keep waiting. If the edit fails after the browser flipped to GENERATING, `--reply EVENT_ID error "Short reason"` (without `--then-poll`) so the bar resets.
|
|
81
|
+
|
|
82
|
+
Then tell the user, in one line, where their variants are: *"Three [bolder] variants are live on [the pricing cards]: cycle with the floating bar's arrows, adjust the Tune knobs, and Accept the keeper."*
|
|
83
|
+
|
|
84
|
+
Outside the replace path, read the matching live.md section before acting: `scaffold.previewMode: "svelte-component"` (Svelte previews are edited as components, and their accept is mechanical), `mode: "insert"`, `variant_mount_failed`, `steer`, `manual_edit_apply`, and any `fallback: "agent-driven"` wrap error.
|
|
85
|
+
|
|
86
|
+
## Step 4: Accept and close
|
|
87
|
+
|
|
88
|
+
The call from Step 3 returns the user's choice. **`discard`**: nothing to do. **`accept`**: `_acceptResult.carbonize: true` is the normal case, and the cleanup is live.md's **Required after accept**, unchanged: move the accepted variant's rules into the stylesheet that already owns the element with real selectors, bake the chosen knob values in, unwrap the element and drop every `data-impeccable-*` attribute, delete the inline `<style>` block and both `impeccable-carbonize` markers, then `.opencode/skills/impeccable/scripts/impeccable live-complete --id SESSION_ID` and confirm `phase: "completed"`. (`baked: true` appears only when the accept was run with `--bake`; then the helper already made the variant permanent and no `live-complete` is owed.)
|
|
89
|
+
|
|
90
|
+
Close without being asked, the moment the choice is handled:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
.opencode/skills/impeccable/scripts/impeccable live-server stop
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Stopping removes the injected script and reloads the page once: the user sees the accepted design with no overlay chrome, still served by their dev server. **Never kill or restart the dev server**, including one you started in Step 2.
|
|
97
|
+
|
|
98
|
+
- **The user asks for more variants before you closed**: skip the close, run Step 2 again for the next element (the helper is reused), and close after the last choice.
|
|
99
|
+
- **Interrupted or unsure of the state**: `.opencode/skills/impeccable/scripts/impeccable live-status`, then `live-resume`; the journal under `.impeccable/live/sessions/` is canonical.
|
|
100
|
+
|
|
101
|
+
Done when the helper is stopped and the dev site still answers with the accepted design.
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
Designs that only work with perfect data aren't production-ready. Harden the interface against the inputs, errors, languages, and network conditions that real users will throw at it.
|
|
2
|
+
|
|
3
|
+
## Assess Hardening Needs
|
|
4
|
+
|
|
5
|
+
Identify weaknesses and edge cases:
|
|
6
|
+
|
|
7
|
+
1. **Test with extreme inputs**:
|
|
8
|
+
- Very long text (names, descriptions, titles)
|
|
9
|
+
- Very short text (empty, single character)
|
|
10
|
+
- Special characters (emoji, RTL text, accents)
|
|
11
|
+
- Large numbers (millions, billions)
|
|
12
|
+
- Many items (1000+ list items, 50+ options)
|
|
13
|
+
- No data (empty states)
|
|
14
|
+
|
|
15
|
+
2. **Test error scenarios**:
|
|
16
|
+
- Network failures (offline, slow, timeout)
|
|
17
|
+
- API errors (400, 401, 403, 404, 500)
|
|
18
|
+
- Validation errors
|
|
19
|
+
- Permission errors
|
|
20
|
+
- Rate limiting
|
|
21
|
+
- Concurrent operations
|
|
22
|
+
|
|
23
|
+
3. **Test internationalization**:
|
|
24
|
+
- Long translations (German is often 30% longer than English)
|
|
25
|
+
- RTL languages (Arabic, Hebrew)
|
|
26
|
+
- Character sets (Chinese, Japanese, Korean, emoji)
|
|
27
|
+
- Date/time formats
|
|
28
|
+
- Number formats (1,000 vs 1.000)
|
|
29
|
+
- Currency symbols
|
|
30
|
+
|
|
31
|
+
Designs that only work with perfect data aren't production-ready.
|
|
32
|
+
|
|
33
|
+
## Hardening Dimensions
|
|
34
|
+
|
|
35
|
+
Systematically improve resilience:
|
|
36
|
+
|
|
37
|
+
### Text Overflow & Wrapping
|
|
38
|
+
|
|
39
|
+
**Long text handling**:
|
|
40
|
+
```css
|
|
41
|
+
/* Single line with ellipsis */
|
|
42
|
+
.truncate {
|
|
43
|
+
overflow: hidden;
|
|
44
|
+
text-overflow: ellipsis;
|
|
45
|
+
white-space: nowrap;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* Multi-line with clamp */
|
|
49
|
+
.line-clamp {
|
|
50
|
+
display: -webkit-box;
|
|
51
|
+
-webkit-line-clamp: 3;
|
|
52
|
+
-webkit-box-orient: vertical;
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* Allow wrapping */
|
|
57
|
+
.wrap {
|
|
58
|
+
word-wrap: break-word;
|
|
59
|
+
overflow-wrap: break-word;
|
|
60
|
+
hyphens: auto;
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**Flex/Grid overflow**:
|
|
65
|
+
```css
|
|
66
|
+
/* Prevent flex items from overflowing */
|
|
67
|
+
.flex-item {
|
|
68
|
+
min-width: 0; /* Allow shrinking below content size */
|
|
69
|
+
overflow: hidden;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* Prevent grid items from overflowing */
|
|
73
|
+
.grid-item {
|
|
74
|
+
min-width: 0;
|
|
75
|
+
min-height: 0;
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Responsive text sizing**:
|
|
80
|
+
- Use `clamp()` for fluid typography
|
|
81
|
+
- Set minimum readable sizes (16px body on mobile, the same floor the typography guidance sets; 14px only for genuinely secondary text. iOS Safari force-zooms focused inputs under 16px, which breaks form layouts)
|
|
82
|
+
- Test text scaling (zoom to 200%)
|
|
83
|
+
- Ensure containers expand with text
|
|
84
|
+
|
|
85
|
+
### Internationalization (i18n)
|
|
86
|
+
|
|
87
|
+
**Text expansion**:
|
|
88
|
+
- Add 30-40% space budget for translations
|
|
89
|
+
- Use flexbox/grid that adapts to content
|
|
90
|
+
- Test with longest language (usually German)
|
|
91
|
+
- Avoid fixed widths on text containers
|
|
92
|
+
|
|
93
|
+
```jsx
|
|
94
|
+
// ❌ Bad: Assumes short English text
|
|
95
|
+
<button className="w-24">Submit</button>
|
|
96
|
+
|
|
97
|
+
// ✅ Good: Adapts to content
|
|
98
|
+
<button className="px-4 py-2">Submit</button>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**RTL (Right-to-Left) support**:
|
|
102
|
+
```css
|
|
103
|
+
/* Use logical properties */
|
|
104
|
+
margin-inline-start: 1rem; /* Not margin-left */
|
|
105
|
+
padding-inline: 1rem; /* Not padding-left/right */
|
|
106
|
+
border-inline-end: 1px solid; /* Not border-right */
|
|
107
|
+
|
|
108
|
+
/* Or use dir attribute */
|
|
109
|
+
[dir="rtl"] .arrow { transform: scaleX(-1); }
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**Arabic-script specifics** (Arabic, Persian, Urdu, Pashto, Kurdish):
|
|
113
|
+
- Preserve Zero-Width Non-Joiner (U+200C). Persian and Kurdish use ZWNJ between compound-word parts to break cursive joining while keeping the word together. A filter or sanitizer that strips it changes meaning. Never normalize it away.
|
|
114
|
+
- Handle Yeh and Kaf variants. Persian uses ی (U+06CC) and ک (U+06A9), while Arabic uses ي (U+064A) and ك (U+0643). Preserve the original form in storage. For search and validation, treat the corresponding letters as equivalent so that Arabic-keyboard input matches Persian text. Rejecting one variant locks out users whose keyboard sends the other.
|
|
115
|
+
- Support locale-aware digits. Persian (`fa-IR`) and Arabic locales use Eastern Arabic-Indic numerals (۰-۹ and ٠-٩). Use `Intl.NumberFormat` with the correct locale rather than hardcoding Western digits.
|
|
116
|
+
|
|
117
|
+
```javascript
|
|
118
|
+
// ✅ Locale-aware digit formatting
|
|
119
|
+
new Intl.NumberFormat('fa-IR').format(1234); // ۱٬۲۳۴
|
|
120
|
+
new Intl.NumberFormat('ar-SA').format(1234); // ١٬٢٣٤
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
- Respect calendar systems. Persian users expect the Solar Hijri (Jalali) calendar; many Arabic-speaking users expect the Hijri (Islamic) calendar. Use `Intl.DateTimeFormat` with the appropriate locale or calendar parameter.
|
|
124
|
+
|
|
125
|
+
```javascript
|
|
126
|
+
// ✅ Locale-appropriate calendar
|
|
127
|
+
new Intl.DateTimeFormat('fa-IR').format(new Date());
|
|
128
|
+
new Intl.DateTimeFormat('ar-SA-u-ca-islamic').format(new Date());
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**Character set support**:
|
|
132
|
+
- Use UTF-8 encoding everywhere
|
|
133
|
+
- Test with Chinese/Japanese/Korean (CJK) characters
|
|
134
|
+
- Test with emoji (they can be 2-4 bytes)
|
|
135
|
+
- Handle different scripts (Latin, Cyrillic, Arabic, etc.)
|
|
136
|
+
|
|
137
|
+
**Date/Time formatting**:
|
|
138
|
+
```javascript
|
|
139
|
+
// ✅ Use Intl API for proper formatting
|
|
140
|
+
new Intl.DateTimeFormat('en-US').format(date); // 1/15/2024
|
|
141
|
+
new Intl.DateTimeFormat('de-DE').format(date); // 15.1.2024
|
|
142
|
+
|
|
143
|
+
new Intl.NumberFormat('en-US', {
|
|
144
|
+
style: 'currency',
|
|
145
|
+
currency: 'USD'
|
|
146
|
+
}).format(1234.56); // $1,234.56
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**Pluralization**:
|
|
150
|
+
```javascript
|
|
151
|
+
// ❌ Bad: Assumes English pluralization
|
|
152
|
+
`${count} item${count !== 1 ? 's' : ''}`
|
|
153
|
+
|
|
154
|
+
// ✅ Good: Use proper i18n library
|
|
155
|
+
t('items', { count }) // Handles complex plural rules
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Error Handling
|
|
159
|
+
|
|
160
|
+
**Network errors**:
|
|
161
|
+
- Show clear error messages
|
|
162
|
+
- Provide retry button
|
|
163
|
+
- Explain what happened
|
|
164
|
+
- Offer offline mode (if applicable)
|
|
165
|
+
- Handle timeout scenarios
|
|
166
|
+
|
|
167
|
+
```jsx
|
|
168
|
+
// Error states with recovery
|
|
169
|
+
{error && (
|
|
170
|
+
<ErrorMessage>
|
|
171
|
+
<p>Failed to load data. {error.message}</p>
|
|
172
|
+
<button onClick={retry}>Try again</button>
|
|
173
|
+
</ErrorMessage>
|
|
174
|
+
)}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
**Form validation errors**:
|
|
178
|
+
- Inline errors near fields
|
|
179
|
+
- Clear, specific messages
|
|
180
|
+
- Suggest corrections
|
|
181
|
+
- Don't block submission unnecessarily
|
|
182
|
+
- Preserve user input on error
|
|
183
|
+
|
|
184
|
+
**API errors**:
|
|
185
|
+
- Handle each status code appropriately
|
|
186
|
+
- 400: Show validation errors
|
|
187
|
+
- 401: Redirect to login
|
|
188
|
+
- 403: Show permission error
|
|
189
|
+
- 404: Show not found state
|
|
190
|
+
- 429: Show rate limit message
|
|
191
|
+
- 500: Show generic error, offer support
|
|
192
|
+
|
|
193
|
+
**Graceful degradation**:
|
|
194
|
+
- Core functionality works without JavaScript
|
|
195
|
+
- Images have alt text
|
|
196
|
+
- Progressive enhancement
|
|
197
|
+
- Fallbacks for unsupported features
|
|
198
|
+
|
|
199
|
+
### Edge Cases & Boundary Conditions
|
|
200
|
+
|
|
201
|
+
**Empty states**:
|
|
202
|
+
- No items in list
|
|
203
|
+
- No search results
|
|
204
|
+
- No notifications
|
|
205
|
+
- No data to display
|
|
206
|
+
- Provide clear next action
|
|
207
|
+
|
|
208
|
+
**Loading states**:
|
|
209
|
+
- Initial load
|
|
210
|
+
- Pagination load
|
|
211
|
+
- Refresh
|
|
212
|
+
- Show what's loading ("Loading your projects...")
|
|
213
|
+
- Time estimates for long operations
|
|
214
|
+
|
|
215
|
+
**Large datasets**:
|
|
216
|
+
- Pagination or virtual scrolling
|
|
217
|
+
- Search/filter capabilities
|
|
218
|
+
- Performance optimization
|
|
219
|
+
- Don't load all 10,000 items at once
|
|
220
|
+
|
|
221
|
+
**Concurrent operations**:
|
|
222
|
+
- Prevent double-submission (disable button while loading)
|
|
223
|
+
- Handle race conditions
|
|
224
|
+
- Optimistic updates with rollback
|
|
225
|
+
- Conflict resolution
|
|
226
|
+
|
|
227
|
+
**Interrupted gestures** (custom sliders, drag surfaces, scrollable control strips):
|
|
228
|
+
- A second finger or pointer lands mid-drag: the first drag keeps its pointer or ends cleanly, never jumps to the new one
|
|
229
|
+
- The browser cancels the gesture to scroll (`pointercancel`), capture is lost (`lostpointercapture`), the pointer is released outside the control, or the window loses focus (`blur`) mid-drag: clear the dragging state and release capture
|
|
230
|
+
- After each of these, the next tap or drag works without a reload
|
|
231
|
+
|
|
232
|
+
**Permission states**:
|
|
233
|
+
- No permission to view
|
|
234
|
+
- No permission to edit
|
|
235
|
+
- Read-only mode
|
|
236
|
+
- Clear explanation of why
|
|
237
|
+
|
|
238
|
+
**Browser compatibility**:
|
|
239
|
+
- Polyfills for modern features
|
|
240
|
+
- Fallbacks for unsupported CSS
|
|
241
|
+
- Feature detection (not browser detection)
|
|
242
|
+
- Test in target browsers
|
|
243
|
+
|
|
244
|
+
### Input Validation & Sanitization
|
|
245
|
+
|
|
246
|
+
**Client-side validation**:
|
|
247
|
+
- Required fields
|
|
248
|
+
- Format validation (email, phone, URL)
|
|
249
|
+
- Length limits
|
|
250
|
+
- Pattern matching
|
|
251
|
+
- Custom validation rules
|
|
252
|
+
|
|
253
|
+
**Server-side validation** (always):
|
|
254
|
+
- Never trust client-side only
|
|
255
|
+
- Validate and sanitize all inputs
|
|
256
|
+
- Protect against injection attacks
|
|
257
|
+
- Rate limiting
|
|
258
|
+
|
|
259
|
+
**Constraint handling**:
|
|
260
|
+
```html
|
|
261
|
+
<!-- Set clear constraints -->
|
|
262
|
+
<input
|
|
263
|
+
type="text"
|
|
264
|
+
maxlength="100"
|
|
265
|
+
pattern="[A-Za-z0-9]+"
|
|
266
|
+
required
|
|
267
|
+
aria-describedby="username-hint"
|
|
268
|
+
/>
|
|
269
|
+
<small id="username-hint">
|
|
270
|
+
Letters and numbers only, up to 100 characters
|
|
271
|
+
</small>
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### Accessibility Resilience
|
|
275
|
+
|
|
276
|
+
**Keyboard navigation**:
|
|
277
|
+
- All functionality accessible via keyboard
|
|
278
|
+
- Logical tab order
|
|
279
|
+
- Focus management in modals
|
|
280
|
+
- Skip links for long content
|
|
281
|
+
|
|
282
|
+
**Screen reader support**:
|
|
283
|
+
- Proper ARIA labels
|
|
284
|
+
- Announce dynamic changes (live regions)
|
|
285
|
+
- Descriptive alt text
|
|
286
|
+
- Semantic HTML
|
|
287
|
+
|
|
288
|
+
**High contrast mode**:
|
|
289
|
+
- Test in Windows high contrast mode
|
|
290
|
+
- Don't rely only on color
|
|
291
|
+
- Provide alternative visual cues
|
|
292
|
+
|
|
293
|
+
### Performance Resilience
|
|
294
|
+
|
|
295
|
+
**Slow connections**:
|
|
296
|
+
- Progressive image loading
|
|
297
|
+
- Skeleton screens
|
|
298
|
+
- Optimistic UI updates
|
|
299
|
+
- Offline support (service workers)
|
|
300
|
+
|
|
301
|
+
**Memory leaks**:
|
|
302
|
+
- Clean up event listeners
|
|
303
|
+
- Cancel subscriptions
|
|
304
|
+
- Clear timers/intervals
|
|
305
|
+
- Abort pending requests on unmount
|
|
306
|
+
|
|
307
|
+
**Throttling & Debouncing**:
|
|
308
|
+
```javascript
|
|
309
|
+
// Debounce search input
|
|
310
|
+
const debouncedSearch = debounce(handleSearch, 300);
|
|
311
|
+
|
|
312
|
+
// Throttle scroll handler
|
|
313
|
+
const throttledScroll = throttle(handleScroll, 100);
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
## Testing Strategies
|
|
317
|
+
|
|
318
|
+
**Manual testing**:
|
|
319
|
+
- Test with extreme data (very long, very short, empty)
|
|
320
|
+
- Test in different languages
|
|
321
|
+
- Test offline
|
|
322
|
+
- Test slow connection (throttle to 3G)
|
|
323
|
+
- Test with screen reader
|
|
324
|
+
- Test keyboard-only navigation
|
|
325
|
+
- Test on old browsers
|
|
326
|
+
|
|
327
|
+
**Automated testing**:
|
|
328
|
+
- Unit tests for edge cases
|
|
329
|
+
- Integration tests for error scenarios
|
|
330
|
+
- E2E tests for critical paths
|
|
331
|
+
- A behavioral regression for each confirmed gesture fix, when the project's test runner can drive input
|
|
332
|
+
- Visual regression tests
|
|
333
|
+
- Accessibility tests (axe, WAVE)
|
|
334
|
+
|
|
335
|
+
**Avoid**:
|
|
336
|
+
- Assume perfect input (validate everything)
|
|
337
|
+
- Ignore internationalization (design for global)
|
|
338
|
+
- Leave error messages generic ("Error occurred")
|
|
339
|
+
- Forget offline scenarios
|
|
340
|
+
- Trust client-side validation alone
|
|
341
|
+
- Use fixed widths for text
|
|
342
|
+
- Assume English-length text
|
|
343
|
+
- Block entire interface when one component errors
|
|
344
|
+
|
|
345
|
+
## Verify Hardening
|
|
346
|
+
|
|
347
|
+
Test thoroughly with edge cases:
|
|
348
|
+
|
|
349
|
+
- **Long text**: Try names with 100+ characters
|
|
350
|
+
- **Emoji**: Use emoji in all text fields
|
|
351
|
+
- **RTL**: Test with Arabic or Hebrew
|
|
352
|
+
- **CJK**: Test with Chinese/Japanese/Korean
|
|
353
|
+
- **Network issues**: Disable internet, throttle connection
|
|
354
|
+
- **Large datasets**: Test with 1000+ items
|
|
355
|
+
- **Concurrent actions**: Click submit 10 times rapidly
|
|
356
|
+
- **Interrupted gestures**: Add a second finger mid-drag, scroll across the control, release outside it, switch windows mid-drag; then drag again
|
|
357
|
+
- **Errors**: Force API errors, test all error states
|
|
358
|
+
- **Empty**: Remove all data, test empty states
|
|
359
|
+
|
|
360
|
+
For gestures, say what produced the evidence (emulated viewport, synthesized touch, which engine, physical device) and name what stayed untested.
|
|
361
|
+
|
|
362
|
+
When edge cases are covered, hand off to `/impeccable polish` for the final pass.
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# /impeccable hooks
|
|
2
|
+
|
|
3
|
+
Manage the **design detector hook** for the current project.
|
|
4
|
+
|
|
5
|
+
The hook runs the impeccable design detector on direct file edits to design-relevant files (`.tsx`, `.jsx`, `.html`, `.vue`, `.svelte`, `.astro`, `.css`, `.scss`, `.sass`, `.less`, and plain `.ts` and `.js` in a project with a PRODUCT.md, DESIGN.md or `.impeccable` folder). Claude Code, Codex, Cursor, and GitHub Copilot use a post-tool-use hook and push a short system reminder into the agent's context after the edit; findings get a correction prompt, pending issues get a re-nudge, and clean UI-ish files get a short ack unless quiet mode is on (`hook.quiet` in config). Plain `.ts` and `.js` files are still scanned, but stay quiet unless the detector finds something. Grok Build fires the same PostToolUse scan to mark touched files, then surfaces findings on Stop `additionalContext`. Do not expect a Grok per-edit reminder: Grok discards that stdout. On Hermes Agent the per-edit findings arrive inside the `write_file` or `patch` tool result itself, as its `impeccable` field.
|
|
6
|
+
|
|
7
|
+
The detector rules run in two tiers. The per-edit hook surfaces only the immediate tier: mechanical, unambiguous problems worth interrupting an edit for, such as broken images, overflowing content, contrast and legibility failures, gradient text, glow shadows, and design-system drift. Everything else (copy cadence, palette and typography taste, layout rhythm) is deferred to a deep pass on the `Stop` hook event, which runs the full rule set over every UI file touched in the session and surfaces the remaining findings once, deduplicated against what the per-edit pass already reported. A session with nothing left to report stops silently. Set `hook.perEditRules` to `"all"` in `.impeccable/config.json` to restore the full rule set on every edit. The Stop deep pass is wired for Claude Code, Codex, and Grok Build, which dispatch a native `Stop` hook event, and for Hermes Agent, whose plugin sends it from `pre_verify`. Cursor does not get one (its `stop` hook can only answer with a follow-up user message), and GitHub Copilot's stop-style events do not feed context back to the model, so they keep the full detector per edit. Grok also fires an observe-only Stop with `reason: "shutdown"` after `end_turn`; skip that one, scan only `end_turn`.
|
|
8
|
+
|
|
9
|
+
Every hook is a mechanical pass. The reflexes no scanner catches live in [craft-floor.md](craft-floor.md), which the skill loads before it edits UI, so they apply whether or not a hook is wired. A session with no automatic hook gets one `MANUAL_DETECTOR_REQUIRED` directive from `impeccable context` asking for a single detector run at the end.
|
|
10
|
+
|
|
11
|
+
This command toggles the hook **per project** by editing `.impeccable/config.json` (the unified Impeccable config; hook runtime settings live under its `hook` key, and shared detector ignores live under `detector`). Per-developer overrides, including the install consent decision (`hook.consent`) the CLI records, live in the gitignored `.impeccable/config.local.json`. Set `hook.enabled: false` to turn the hook off, `hook.quiet: true` to silence the clean/pending acks, or `hook.auditLog` to a file path for an NDJSON log. The legacy `IMPECCABLE_HOOK_DISABLED`, `IMPECCABLE_HOOK_QUIET`, and `IMPECCABLE_HOOK_LOG` env vars are still honored and override these config values when set.
|
|
12
|
+
|
|
13
|
+
Declare server-side template extensions under **`detector.extensions`** when the project uses Blade, Twig, ERB, or Handlebars files; the hook skips them otherwise because they sit outside the built-in extension list. One entry per extension, `{ "ext": ".blade.php", "engine": "html" }`. `engine` picks the analyzer (`html` for markup templates, `text` for JS/TS/CSS-like files) and defaults to `html`. Match against the end of the filename, so double extensions like `.blade.php` and `.html.erb` work. Config only adds extensions; the built-in list always applies.
|
|
14
|
+
|
|
15
|
+
Manual `.opencode/skills/impeccable/scripts/impeccable detect` scans use the same project filter config by default: `detector.ignoreRules`, `detector.ignoreFiles`, `detector.ignoreValues`, and `detector.designSystem.enabled`. `hook.enabled` only controls automatic hook execution, not manual CLI scans. Use `.opencode/skills/impeccable/scripts/impeccable detect --no-config ...` for a raw detector run that ignores project config/context. Use `.opencode/skills/impeccable/scripts/impeccable ignores ...` for direct CLI CRUD on the same detector ignores.
|
|
16
|
+
|
|
17
|
+
Supported harnesses: Claude Code (`.claude/settings.local.json` for a project-scope install; `$CLAUDE_CONFIG_DIR/settings.json` for a user-scope install, defaulting to `~/.claude/settings.json`; a project hook moved into shared `.claude/settings.json` is honored in place too), Codex (`.codex/hooks.json` in the project; `$CODEX_HOME/hooks.json`, default `~/.codex/hooks.json`, for a user-scope install), Cursor (`.cursor/hooks.json` in the project; `~/.cursor/hooks.json` for a user-scope install), Grok Build (`.grok/hooks/impeccable.json` in the project, which requires `/hooks-trust` or `--trust`; the personal `~/.grok/hooks/impeccable.json` for a user-scope install), GitHub Copilot (`.github/hooks/impeccable.json` in the project, a team-shared committed file that both the Copilot CLI and the cloud agent read), and Hermes Agent (the `impeccable-design-hook` plugin in `~/.hermes/plugins/`; the user enables it once with `hermes plugins enable impeccable-design-hook`; a project install's launcher runs only in a project Hermes trusts, via `hermes skills trust`). For the Copilot CLI, repo-level hooks fire once `.github/hooks/impeccable.json` is committed to the repository's default branch.
|
|
18
|
+
|
|
19
|
+
On **Cursor**, the hook runs on `postToolUse` for the `Write` tool (every agent file edit) and returns its reminder as `additional_context`, which Cursor adds after the tool result. Projects set up before this ran a `preToolUse` gate (`hook-before-edit`) that blocked bad writes before they landed; that gate still works until `hooks on`, `impeccable update`, or `impeccable doctor --fix` moves the entry to `postToolUse`.
|
|
20
|
+
|
|
21
|
+
Gemini installs session and completion hooks in `.gemini/settings.json`, merged into the settings already there (comments are tolerated; a commented file is backed up to `settings.json.bak` before the rewrite, and a file that is not valid JSON is left alone). It does not install a per-edit detector hook. The `BeforeTool` hook only rewrites shell commands that run `build-phase`, and only on macOS and Linux; on Windows (where Gemini runs hooks through PowerShell) no session id reaches the shell, so a comp build is not tied to the session and the completion reminder stays silent.
|
|
22
|
+
|
|
23
|
+
When there is no project Claude skill, `hooks on` looks for `skills/impeccable/scripts/impeccable` inside `CLAUDE_CONFIG_DIR` (default `~/.claude`) and writes the hook into that account's `settings.json`, using the installed launcher's absolute path. Relative account directories resolve against the caller's working directory. An explicit account directory is exclusive: another account's default skill and settings are never substituted. Status and context read the same account settings. If no design harness can be wired, `hooks on` says so, reports skipped invalid settings or the missing skill lookup paths, and gives the next step.
|
|
24
|
+
|
|
25
|
+
Status checks the current event entries and matchers in each manifest, including the Stop pass where supported. Claude Code counts as wired when either project settings file (or its user settings file) contains the current entries. A legacy command, partial manifest, or missing file is reported as not wired. If enabled in config but no design harness is wired, status says so and gives `impeccable hooks on` as the repair command. An installed and enabled Hermes design-hook plugin also counts as wired; `on` acknowledges it without changing the plugin configuration. Wiring confirms the manifest entries; harness trust requirements and session reloads still apply.
|
|
26
|
+
|
|
27
|
+
When `hook.consent` is `"accepted"` in the project's `config.local.json` and the hook is enabled, `impeccable context` restores missing or stale entries for installed harness skills and reports repairs in one line. Shared config consent does not authorize this write. Automatic repair preserves unrelated settings and hooks and leaves malformed manifests alone. Without local consent, context writes no manifests and keeps `MANUAL_DETECTOR_REQUIRED`, naming the missing or stale harness wiring. Explicitly disabled hooks stay disabled.
|
|
28
|
+
|
|
29
|
+
## Routing
|
|
30
|
+
|
|
31
|
+
The first argument is the action. Defaults to `status`.
|
|
32
|
+
|
|
33
|
+
| Action | What it does |
|
|
34
|
+
|---|---|
|
|
35
|
+
| `status` | Print current state, shared/local config paths, ignored rules / files / values, env override, and actual manifest wiring for each harness. |
|
|
36
|
+
| `on` | Set `enabled: true` in `.impeccable/config.json`, record local hook consent as accepted, and install/repair provider hook manifests when the skill is installed. |
|
|
37
|
+
| `off` | Set `enabled: false` in `.impeccable/config.json`. |
|
|
38
|
+
| `ignore-rule <id>` | Append `<id>` to `detector.ignoreRules`; for `overused-font`, requires `--all-values`. Suppresses the rule across the whole project. |
|
|
39
|
+
| `ignore-file <glob>` | Append `<glob>` to `detector.ignoreFiles`. Suppresses **every** rule for matching files. |
|
|
40
|
+
| `ignore-value <id> <value> [--shared] [--reason "..."]` | Append a rule/value suppression to shared `.impeccable/config.json`. |
|
|
41
|
+
| `ignore-value <id> <value> --local [--reason "..."]` | Append a private rule/value suppression to `.impeccable/config.local.json`. |
|
|
42
|
+
| `ignore-value <id> "*" --file <glob> [--file <glob>...]` | Turn one rule off in matching files only, leaving it active everywhere else. Repeat `--file`, or use `--file=<glob>` / `--files=<glob>`. A bare `"*"` with no `--file` is refused: use `ignore-rule <id>` if you really mean project-wide. |
|
|
43
|
+
| `reset` | Delete the project config, dedup cache, and Cursor pending queue, and remove the hook's entries from every provider manifest `on` installs, the committed Copilot file included (a team-shared `settings.json` that `on` never writes is never touched). |
|
|
44
|
+
|
|
45
|
+
## Flow
|
|
46
|
+
|
|
47
|
+
1. Resolve the action from the user's argument. If no action was given, default to `status`.
|
|
48
|
+
2. Invoke the admin script and pass the user's output through verbatim:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
.opencode/skills/impeccable/scripts/impeccable hooks <action> [args...]
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
3. If `<action>` is `off`, follow up with a one-line note: "Done. New edits will not trigger the design hook in this project until you run `/impeccable hooks on`."
|
|
55
|
+
4. If `<action>` is `on`, report what the command installed or repaired. If no installed skill folders were found or settings were skipped, surface that result and do not claim the hook will run. Otherwise note that the harness must load the updated settings (and satisfy any trust requirements) before it runs. On Hermes Agent, `on` cannot install or enable the plugin: if `impeccable context` reported `MANUAL_DETECTOR_REQUIRED`, tell the user to run `npx impeccable install` and then `hermes plugins enable impeccable-design-hook` instead.
|
|
56
|
+
5. If `<action>` is `ignore-value`, `ignore-file`, or `ignore-rule`, just print the script output. The default scope is shared `.impeccable/config.json`; add `--local` only when the user explicitly asks for a private exception.
|
|
57
|
+
6. If `<action>` is `status`, just print the script output. Do not add commentary unless the user asked a follow-up question.
|
|
58
|
+
|
|
59
|
+
## Triage findings
|
|
60
|
+
|
|
61
|
+
The hook itself never writes ignore config; every exception goes through `impeccable hooks`. Triage each finding into one of three outcomes:
|
|
62
|
+
|
|
63
|
+
- **Real design problem**: fix it. Never add an ignore to skip a fix or to push a blocked write through.
|
|
64
|
+
- **Confident false positive or sanctioned exception**: persist the narrowest ignore yourself and disclose it in your reply. The bar is evidence you can name: an intentional demo or fixture, documentation of bad design, literal or domain-appropriate motion (a ball that bounces), or a choice the user already confirmed. Put that evidence in `--reason` as `"<who decided: evidence>"`; write "user confirmed" only when the user actually did.
|
|
65
|
+
- **Unsure**: leave the finding standing and give the reason in one line. Ask the user only when you genuinely cannot decide.
|
|
66
|
+
|
|
67
|
+
Self-serve stops at `ignore-value`. `ignore-file` and `ignore-rule` silence too much to add on your own judgment; ask the user first.
|
|
68
|
+
|
|
69
|
+
Prefer the narrowest exception:
|
|
70
|
+
|
|
71
|
+
- If the finding line shows an `ignore-value <rule> <value>` pair, pass it to `impeccable hooks ignore-value` with your `--reason`. This writes shared `.impeccable/config.json` by default.
|
|
72
|
+
- For value-specific findings such as `overused-font` and `bounce-easing`, use `ignore-value` for the specific value. Do not use `ignore-rule overused-font` for a specific font.
|
|
73
|
+
- If the finding has no value-specific command, such as `side-tab`, scope that one rule to the file: `ignore-value <id> "*" --file <path>`. Run `.opencode/skills/impeccable/scripts/impeccable detect <path>` first to see what actually fires there.
|
|
74
|
+
- Reach for `ignore-file <path>` only when the whole file is out of scope for design review: a fixture, a generated artifact, a deliberate slop demo. It silences every rule for that file permanently, including rules that have not been written yet. A real UI surface with one noisy rule wants the file-scoped value ignore above.
|
|
75
|
+
- Use `ignore-rule <id>` only when the user asks to suppress that whole rule across the project. For broad overused-font suppression, use `ignore-rule overused-font --all-values` only when the user asks to ignore overused fonts generally.
|
|
76
|
+
- Prefer config ignores (the commands above) by default; they keep suppressions in one reviewable place. Reach for an inline comment only when the waiver must travel with a single file that leaves the repo (a generated/exported standalone document, an emailed HTML file). The supported marker is `impeccable-disable <rule>` (whole file) or `impeccable-disable-line` / `impeccable-disable-next-line` (one line), in any comment syntax, with an optional reason after `:` or `--`. The detector honors it by default; `--no-inline-ignores` or `--no-config` bypasses it.
|
|
77
|
+
|
|
78
|
+
Example value-specific exception:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
.opencode/skills/impeccable/scripts/impeccable hooks ignore-value overused-font Inter --shared --reason "User confirmed Inter is intentional"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Example self-served exception, with the evidence named:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
.opencode/skills/impeccable/scripts/impeccable hooks ignore-value bounce-easing bounce-ball --shared --reason "Agent: literal ball-bounce animation, bounce easing is the subject"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Example whole-rule font exception:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
.opencode/skills/impeccable/scripts/impeccable hooks ignore-rule overused-font --all-values --reason "User asked to ignore overused fonts generally"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Example one-rule-in-one-file exception, for a file that is still worth reviewing
|
|
97
|
+
for everything else:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
.opencode/skills/impeccable/scripts/impeccable hooks ignore-value design-system-font-size "*" --file "src/overlay/widget.js" --reason "Injected widget builds its own type scale; DESIGN.md's ramp describes the site"
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Example whole-file exception, for a file that is out of scope entirely:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
.opencode/skills/impeccable/scripts/impeccable hooks ignore-file "src/legacy/Card.tsx"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Constraints
|
|
110
|
+
|
|
111
|
+
- Never modify `.impeccable/config.json` or `.impeccable/config.local.json` by hand from this command. Always go through `impeccable hooks` so writes stay validated and the file shape stays consistent. One exception: `detector.extensions` has no admin action, so when the user asks to cover a template stack, edit that one field in `.impeccable/config.json` directly and leave the rest of the file untouched.
|
|
112
|
+
- Do not edit the launcher or the binary behind `impeccable hook` and `impeccable hook-before-edit` from this flow. Those are skill plumbing.
|
|
113
|
+
- When a user asks how far to trust the hook, say it runs the engine unsandboxed with the agent's environment and network access (in the Copilot cloud agent too, once `.github/hooks/impeccable.json` is committed), and that the launcher checks a downloaded engine against `.opencode/skills/impeccable/scripts/engine-checksums.txt` before its first run; **never** call it sandboxed.
|
|
114
|
+
- The hook never blocks an edit; it emits a post-edit reminder. (A Cursor project still on the old `preToolUse` gate can block a write until its manifest is migrated.) Disabling stops the reminders.
|
|
115
|
+
- The hook is bundled with the Impeccable skill. Project installs use `.claude/settings.local.json`, `.codex/hooks.json`, `.cursor/hooks.json`, `.github/hooks/impeccable.json`, and `.gemini/settings.json`; a user-scope Claude install uses the active account's `$CLAUDE_CONFIG_DIR/settings.json` (default `~/.claude/settings.json`), and a user-scope Codex, Cursor or Grok install uses `~/.codex/hooks.json`, `~/.cursor/hooks.json` or `~/.grok/hooks/impeccable.json`. On Codex, the user must approve the hook via `/hooks` the first time. On Cursor, confirm hooks are enabled under Settings -> Hooks. On GitHub Copilot, the CLI loads `.github/hooks/impeccable.json` once it is committed to the repository's default branch, and the cloud agent reads it from the repo directly.
|
|
116
|
+
|
|
117
|
+
## Failure modes
|
|
118
|
+
|
|
119
|
+
- If `.impeccable/config.json` or `.impeccable/config.local.json` is unreadable or malformed, the hook ignores that file and uses the remaining valid config/defaults. `impeccable hooks status` will show malformed files as ignored.
|
|
120
|
+
- If the user asks to "disable the hook" globally, lead with `/impeccable hooks off` (persistent for this project; writes `hook.enabled: false` to config). The legacy `IMPECCABLE_HOOK_DISABLED=1` env var also works as a one-shot override that follows the shell.
|