jioogen 0.2.8 → 0.2.10

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.
Files changed (163) hide show
  1. package/authoring-pack/agent/core.md +10 -4
  2. package/authoring-pack/agent/discovery.md +1 -1
  3. package/authoring-pack/agent/prd.md +7 -3
  4. package/authoring-pack/agent/specs.md +10 -6
  5. package/authoring-pack/agent/tasks.md +12 -8
  6. package/authoring-pack/knowledge/catalog.generated.json +465 -3
  7. package/authoring-pack/knowledge/library/discovery/discovery-standard.md +47 -3
  8. package/authoring-pack/knowledge/library/gamedev/K-GAME-001-discovery-game.md +60 -0
  9. package/authoring-pack/knowledge/library/gamedev/K-GAME-101-prd-game.md +62 -0
  10. package/authoring-pack/knowledge/library/gamedev/disciplines/game-ai.md +33 -0
  11. package/authoring-pack/knowledge/library/gamedev/disciplines/game-feel.md +32 -0
  12. package/authoring-pack/knowledge/library/gamedev/disciplines/game-ui-ux.md +32 -0
  13. package/authoring-pack/knowledge/library/gamedev/disciplines/level-design.md +31 -0
  14. package/authoring-pack/knowledge/library/gamedev/disciplines/procedural-gen.md +33 -0
  15. package/authoring-pack/knowledge/library/gamedev/disciplines/save-systems.md +32 -0
  16. package/authoring-pack/knowledge/library/gamedev/genres/card-game.md +33 -0
  17. package/authoring-pack/knowledge/library/gamedev/genres/fps-shooter.md +34 -0
  18. package/authoring-pack/knowledge/library/gamedev/genres/platformer.md +37 -0
  19. package/authoring-pack/knowledge/library/gamedev/genres/puzzle.md +32 -0
  20. package/authoring-pack/knowledge/library/gamedev/genres/roguelike.md +34 -0
  21. package/authoring-pack/knowledge/library/gamedev/genres/rpg.md +33 -0
  22. package/authoring-pack/knowledge/library/gamedev/genres/survival-crafting.md +34 -0
  23. package/authoring-pack/knowledge/library/gamedev/genres/tower-defense.md +33 -0
  24. package/authoring-pack/knowledge/library/gamedev/genres/visual-novel.md +32 -0
  25. package/authoring-pack/knowledge/library/prd/capability-coverage.md +2 -2
  26. package/authoring-pack/knowledge/library/prd/decomposition.md +1 -1
  27. package/authoring-pack/knowledge/library/prd/prd-standard.md +6 -2
  28. package/authoring-pack/knowledge/library/prd/self-check.md +9 -2
  29. package/authoring-pack/knowledge/library/prd/writing-style.md +2 -2
  30. package/authoring-pack/knowledge/library/qa/gate-reference.md +21 -16
  31. package/authoring-pack/knowledge/library/specs/specs-standard.md +12 -10
  32. package/authoring-pack/knowledge/library/tasks/conditional-coverage-b.md +3 -3
  33. package/authoring-pack/knowledge/library/tasks/tasks-standard.md +9 -9
  34. package/authoring-pack/knowledge/library/ui/K-UIX-001-universal-uiux-principles.md +66 -0
  35. package/authoring-pack/knowledge/library/ui/K-UIX-002-visual-ux-qa-rubric.md +65 -0
  36. package/authoring-pack/knowledge/library/ui/K-UIX-003-adaptive-ui-authoring.md +66 -0
  37. package/authoring-pack/manifest.json +105 -25
  38. package/authoring-pack/skills/business-discovery/SKILL.md +22 -0
  39. package/authoring-pack/skills/creative-discovery/SKILL.md +11 -0
  40. package/authoring-pack/skills/prd-authoring/SKILL.md +54 -6
  41. package/authoring-pack/skills/product-discovery/SKILL.md +16 -5
  42. package/authoring-pack/skills/specs-authoring/SKILL.md +26 -22
  43. package/authoring-pack/skills/specs-authoring/skill.yaml +1 -1
  44. package/authoring-pack/skills/tasks-authoring/SKILL.md +44 -29
  45. package/authoring-pack/skills/tasks-authoring/skill.yaml +1 -1
  46. package/dist/index.js +4279 -2608
  47. package/dist/index.js.map +4 -4
  48. package/package.json +1 -1
  49. package/skills-pack/ui-quality/THIRD-PARTY-NOTICE.md +32 -0
  50. package/skills-pack/ui-quality/impeccable/LICENSE +191 -0
  51. package/skills-pack/ui-quality/impeccable/SKILL.md +93 -0
  52. package/skills-pack/ui-quality/impeccable/reference/adapt.md +318 -0
  53. package/skills-pack/ui-quality/impeccable/reference/adapt.native.md +58 -0
  54. package/skills-pack/ui-quality/impeccable/reference/android.md +46 -0
  55. package/skills-pack/ui-quality/impeccable/reference/animate.md +106 -0
  56. package/skills-pack/ui-quality/impeccable/reference/audit.md +150 -0
  57. package/skills-pack/ui-quality/impeccable/reference/audit.native.md +143 -0
  58. package/skills-pack/ui-quality/impeccable/reference/bolder.md +33 -0
  59. package/skills-pack/ui-quality/impeccable/reference/clarify.md +94 -0
  60. package/skills-pack/ui-quality/impeccable/reference/colorize.md +86 -0
  61. package/skills-pack/ui-quality/impeccable/reference/component-review.md +63 -0
  62. package/skills-pack/ui-quality/impeccable/reference/craft-floor.md +44 -0
  63. package/skills-pack/ui-quality/impeccable/reference/craft.md +5 -0
  64. package/skills-pack/ui-quality/impeccable/reference/critique-rubric.md +496 -0
  65. package/skills-pack/ui-quality/impeccable/reference/critique.md +327 -0
  66. package/skills-pack/ui-quality/impeccable/reference/degraded/asset-producer.md +42 -0
  67. package/skills-pack/ui-quality/impeccable/reference/degraded/documenter.md +24 -0
  68. package/skills-pack/ui-quality/impeccable/reference/degraded/finish-reviewer.md +38 -0
  69. package/skills-pack/ui-quality/impeccable/reference/degraded/manual-edit-applier.md +93 -0
  70. package/skills-pack/ui-quality/impeccable/reference/degraded/motion-reviewer.md +29 -0
  71. package/skills-pack/ui-quality/impeccable/reference/delight.md +70 -0
  72. package/skills-pack/ui-quality/impeccable/reference/distill.md +111 -0
  73. package/skills-pack/ui-quality/impeccable/reference/doctor.md +54 -0
  74. package/skills-pack/ui-quality/impeccable/reference/document.md +418 -0
  75. package/skills-pack/ui-quality/impeccable/reference/extract.md +69 -0
  76. package/skills-pack/ui-quality/impeccable/reference/foundations.md +44 -0
  77. package/skills-pack/ui-quality/impeccable/reference/generate.md +101 -0
  78. package/skills-pack/ui-quality/impeccable/reference/harden.md +362 -0
  79. package/skills-pack/ui-quality/impeccable/reference/hooks.md +120 -0
  80. package/skills-pack/ui-quality/impeccable/reference/init.md +133 -0
  81. package/skills-pack/ui-quality/impeccable/reference/ios.md +51 -0
  82. package/skills-pack/ui-quality/impeccable/reference/layout.md +84 -0
  83. package/skills-pack/ui-quality/impeccable/reference/live-setup.md +104 -0
  84. package/skills-pack/ui-quality/impeccable/reference/live.md +341 -0
  85. package/skills-pack/ui-quality/impeccable/reference/mode-operate.md +21 -0
  86. package/skills-pack/ui-quality/impeccable/reference/mode-persuade.md +19 -0
  87. package/skills-pack/ui-quality/impeccable/reference/mode-read.md +21 -0
  88. package/skills-pack/ui-quality/impeccable/reference/new-work-comp.md +24 -0
  89. package/skills-pack/ui-quality/impeccable/reference/new-work-world.md +20 -0
  90. package/skills-pack/ui-quality/impeccable/reference/new-work.md +124 -0
  91. package/skills-pack/ui-quality/impeccable/reference/onboard.md +235 -0
  92. package/skills-pack/ui-quality/impeccable/reference/operate.md +61 -0
  93. package/skills-pack/ui-quality/impeccable/reference/optimize.md +257 -0
  94. package/skills-pack/ui-quality/impeccable/reference/overdrive.md +127 -0
  95. package/skills-pack/ui-quality/impeccable/reference/polish.md +105 -0
  96. package/skills-pack/ui-quality/impeccable/reference/quieter.md +99 -0
  97. package/skills-pack/ui-quality/impeccable/reference/region-map.md +26 -0
  98. package/skills-pack/ui-quality/impeccable/reference/routing.md +24 -0
  99. package/skills-pack/ui-quality/impeccable/reference/shape.md +59 -0
  100. package/skills-pack/ui-quality/impeccable/reference/typeset.md +96 -0
  101. package/skills-pack/ui-quality/impeccable/reference/visualize.md +47 -0
  102. package/skills-pack/ui-quality/impeccable/scripts/VERSION +1 -0
  103. package/skills-pack/ui-quality/impeccable/scripts/command-metadata.json +98 -0
  104. package/skills-pack/ui-quality/impeccable/scripts/data/font-index-failures.json +121 -0
  105. package/skills-pack/ui-quality/impeccable/scripts/data/font-index.json +1 -0
  106. package/skills-pack/ui-quality/impeccable/scripts/engine-checksums.txt +9 -0
  107. package/skills-pack/ui-quality/impeccable/scripts/impeccable +319 -0
  108. package/skills-pack/ui-quality/impeccable/scripts/impeccable.cmd +354 -0
  109. package/skills-pack/ui-quality/impeccable/scripts/live-browser-dom.js +320 -0
  110. package/skills-pack/ui-quality/impeccable/scripts/live-browser-ignores.js +246 -0
  111. package/skills-pack/ui-quality/impeccable/scripts/live-browser-session.js +183 -0
  112. package/skills-pack/ui-quality/impeccable/scripts/live-browser.js +13901 -0
  113. package/skills-pack/ui-quality/impeccable/scripts/modern-screenshot.umd.js +14 -0
  114. package/skills-pack/ui-quality/impeccable/skill.yaml +25 -0
  115. package/skills-pack/ui-quality/ui-ux-pro-max/LICENSE +21 -0
  116. package/skills-pack/ui-quality/ui-ux-pro-max/SKILL.md +217 -0
  117. package/skills-pack/ui-quality/ui-ux-pro-max/data/app-interface.csv +33 -0
  118. package/skills-pack/ui-quality/ui-ux-pro-max/data/catalog-summary.json +78 -0
  119. package/skills-pack/ui-quality/ui-ux-pro-max/data/charts.csv +26 -0
  120. package/skills-pack/ui-quality/ui-ux-pro-max/data/colors.csv +193 -0
  121. package/skills-pack/ui-quality/ui-ux-pro-max/data/data-provenance.json +1396 -0
  122. package/skills-pack/ui-quality/ui-ux-pro-max/data/google-font-licenses.json +20185 -0
  123. package/skills-pack/ui-quality/ui-ux-pro-max/data/google-fonts.csv +1935 -0
  124. package/skills-pack/ui-quality/ui-ux-pro-max/data/icons.csv +106 -0
  125. package/skills-pack/ui-quality/ui-ux-pro-max/data/landing.csv +35 -0
  126. package/skills-pack/ui-quality/ui-ux-pro-max/data/motion.csv +18 -0
  127. package/skills-pack/ui-quality/ui-ux-pro-max/data/phosphor-icons-upstream.json +32582 -0
  128. package/skills-pack/ui-quality/ui-ux-pro-max/data/products.csv +193 -0
  129. package/skills-pack/ui-quality/ui-ux-pro-max/data/react-performance.csv +45 -0
  130. package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/angular.csv +51 -0
  131. package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  132. package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/avalonia.csv +57 -0
  133. package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  134. package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/html-tailwind.csv +60 -0
  135. package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/javafx.csv +76 -0
  136. package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  137. package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/laravel.csv +51 -0
  138. package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/nextjs.csv +62 -0
  139. package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/nuxt-ui.csv +84 -0
  140. package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/nuxtjs.csv +68 -0
  141. package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  142. package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/react.csv +67 -0
  143. package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/shadcn.csv +69 -0
  144. package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/svelte.csv +56 -0
  145. package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  146. package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/threejs.csv +54 -0
  147. package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/uno.csv +60 -0
  148. package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/uwp.csv +56 -0
  149. package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  150. package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/winui.csv +60 -0
  151. package/skills-pack/ui-quality/ui-ux-pro-max/data/stacks/wpf.csv +57 -0
  152. package/skills-pack/ui-quality/ui-ux-pro-max/data/styles.csv +90 -0
  153. package/skills-pack/ui-quality/ui-ux-pro-max/data/typography.csv +75 -0
  154. package/skills-pack/ui-quality/ui-ux-pro-max/data/ui-reasoning.csv +193 -0
  155. package/skills-pack/ui-quality/ui-ux-pro-max/data/ux-guidelines.csv +121 -0
  156. package/skills-pack/ui-quality/ui-ux-pro-max/references/pro-rules.md +117 -0
  157. package/skills-pack/ui-quality/ui-ux-pro-max/references/quick-reference.md +257 -0
  158. package/skills-pack/ui-quality/ui-ux-pro-max/scripts/core.py +1053 -0
  159. package/skills-pack/ui-quality/ui-ux-pro-max/scripts/design_system.py +1668 -0
  160. package/skills-pack/ui-quality/ui-ux-pro-max/scripts/reasoning_contract.py +123 -0
  161. package/skills-pack/ui-quality/ui-ux-pro-max/scripts/search.py +201 -0
  162. package/skills-pack/ui-quality/ui-ux-pro-max/scripts/validate_data.py +1095 -0
  163. package/skills-pack/ui-quality/ui-ux-pro-max/skill.yaml +25 -0
@@ -0,0 +1,341 @@
1
+ Interactive live variant mode: select elements in the browser, pick a design action, and get AI-generated HTML+CSS variants hot-swapped via the dev server's HMR.
2
+
3
+ ## Prerequisites
4
+
5
+ A running dev server with HMR (Vite, Next.js, Bun, etc.), OR a static HTML file open in the browser. If the dev server's default port is busy, the app is very likely ALREADY running; probe the default URL before spawning a second server.
6
+
7
+ Live editing requires a local checkout; injection into deployed production sites (including HTTPS) is unsupported. For production inspection, use `.opencode/skills/impeccable/scripts/impeccable detect <url>` or the browser extension, not the live helper. Do not disable browser security or weaken production CSP to enable live mode.
8
+
9
+ ## The contract (read once)
10
+
11
+ Execute in order. No step skipped, no step reordered. Every tool output in live mode may carry an `_instructions` field: it is the authoritative next step for that exact situation, with real ids and paths substituted; when it conflicts with your recollection of this document, `_instructions` wins. One exception: a printed `live-wrap` with an empty `--element-id` and an empty `--classes` follows the bare-element rule in the wrap step instead (drop both, pass `--query`).
12
+
13
+ 1. `impeccable live --allow-missing-context --dev-url --auto-config`: boot (always with all three flags; see Start). If the request names or implies a file, route, or app inside a monorepo, infer the concrete path and add `--target <path>`; then run the rest of this live session from the returned `projectRoot`. The boot resolves the app root from dev-server config files and persists it in `.impeccable/live/roots.json`; every helper re-anchors to that manifest at startup (a wrong cwd cannot fork session state), PRODUCT.md / DESIGN.md are discovered upward to the git root, and relative helper args like `--file` resolve against the app root.
14
+ 2. Open the page. This is how to find its URL wherever the boot's `_instructions` say to open a `pageFiles` page. `devUrl` is the origin of a running dev server: append the route the request names, or the path that serves the target `pageFiles` entry; a bare `devUrl` is the root page only. When `devUrl` is null the boot says which case this is. `pageUrls` lists ready `file://` URLs for a static folder: open the one for the target page. `devCommand` names the project's dev script: the probe may simply have missed a server on an unlisted port or on HTTPS, so check the terminal output, the dev config's port, and any open tab first, and start `devCommand` in the background only when nothing is running, wait for it to print its URL, then boot again. With neither field, find the app's URL the same way before starting anything. Never use `serverPort`; it's the helper, not the app. Always tell the user the URL in one line, so they can open it themselves when you have no browser tool, and on a project's first Live session add the first move in the same breath: click anything on the page, say what to change, press Go (Pick is already on in a browser's first session; later it is the crosshair in the bar at the bottom of the page). **Cursor:** `browser_navigate` to that URL before polling; do not skip. **Other harnesses:** use the available browser tool; if no URL can be found, ask the user once.
15
+ 3. Poll loop with the default long timeout (600000 ms). Run `impeccable live-poll` again immediately after every event or `--reply`; Codex runs this one-shot poll in the foreground. Never pass a short `--timeout=`. The global bar's **Impeccable mark** dims with a pulsing amber dot when nothing is polling `/poll`; restart `impeccable live-poll` to reconnect.
16
+ 4. On `generate`: reuse `event.scaffold` when present; read the screenshot if present; load the action's reference; deliver variants; `--reply done`; poll again. Generate in this thread: you already hold the project's tokens and layout. The overlay preview IS the verification channel; do not screenshot, re-render, or QA variants between generate and accept. Apply craft-floor's contrast, spacing, and type floors by construction as you write; full verification runs once at accept on the chosen variant.
17
+ 5. On `steer`: read the message and `pageUrl`; do the work; `--reply steer_done`; poll again. No pickup ack.
18
+ 6. On `accept` / `discard`: the poll script runs `impeccable live-accept`, acknowledges delivery, and prints `_completionAck`. Plain accepts/discards are terminal immediately; carbonize accepts stay recoverable until `impeccable live-complete --id EVENT_ID` runs. Finish that cleanup before polling again.
19
+ 7. If interrupted, run `impeccable live-status` or `impeccable live-resume` before guessing. The journal under `.impeccable/live/sessions/` is canonical and replays unacknowledged work after a helper restart; the injected `live.js` re-attaches when the page reopens. Fall back to the direct-edit loop only when `impeccable live-resume` reports no active session, never because disconnects felt frequent.
20
+ 8. On `exit`: run the cleanup at the bottom.
21
+
22
+ Harness policy:
23
+ - **Claude Code**: run the poll as a **background task** (no short timeout); the harness notifies you on completion. Do not block the shell.
24
+ - **Cursor**: **one-shot** poll in a **background terminal** with notify on `"type":"(steer|generate|accept|discard|manual_edit_apply|variant_mount_failed|prefetch|exit)"`; handle, `--reply`, restart the poll. Do **not** use `--stream` on Cursor (measured ~5s pickup vs sub-second one-shot).
25
+ - **Codex**: default one-shot poll in a **yielded foreground exec session**. No `&`, no `--stream`, never leave Live without an active foreground poll. Starting the poll is not enough: SERVICE it (keep reading the exec session until it returns an event). Never announce "waiting for the user" and idle; a yielded poll nobody reads is a dead session, and the user's Go sits unanswered.
26
+ - **Other harnesses**: one-shot foreground unless you know stdout reliably returns when a shell exits.
27
+
28
+ Delivery policy: atomic single-edit delivery everywhere; do not switch a harness to progressive publishing unless its poll loop is known not to block on the extra calls.
29
+
30
+ Chat is overhead. No recap, no tutorial output, no pasting PRODUCT / DESIGN bodies. Spend tokens on tools and edits; on failure, one or two short sentences.
31
+
32
+ ## Poll loop
33
+
34
+ ```
35
+ LOOP:
36
+ .opencode/skills/impeccable/scripts/impeccable live-poll # default long timeout; no --timeout=
37
+ Read JSON; dispatch on "type"
38
+
39
+ "generate" → Handle Generate; reply done; LOOP
40
+ "steer" → Handle Steer; reply steer_done; LOOP
41
+ "accept" → Handle Accept; complete carbonize cleanup if required; LOOP
42
+ "discard" → Handle Discard; LOOP
43
+ "prefetch" → Handle Prefetch; LOOP
44
+ "manual_edit_apply" → Handle Manual Edit Apply; reply done|partial|error; LOOP
45
+ "variant_mount_failed" → Fix the variant files; reply done --file <path>; LOOP
46
+ "timeout" → LOOP
47
+ "exit" → break → Cleanup
48
+ ```
49
+
50
+ `variant_mount_failed` means the browser could not render what you published (`variant`, module `url`, `error`). The user sees a persistent error card, not variants. Fix the variant files, then `--reply EVENT_ID done --file <manifest or source path>`; the browser retries on its own.
51
+
52
+ **Stream mode** (`--stream`, experimental, never on Cursor): one long-lived process, one JSON line per event, `--reply` from a separate command. Only for harnesses that read incremental stdout reliably.
53
+
54
+ ## Start
55
+
56
+ ```bash
57
+ .opencode/skills/impeccable/scripts/impeccable live --allow-missing-context --dev-url --auto-config
58
+ ```
59
+
60
+ Output JSON: `{ ok, serverPort, serverToken, configCreated, pageFiles, roots, targetPath, devUrl, pageUrls, devCommand, contextMissing, hasProduct, product, productPath, hasDesign, design, designPath, hasSurfaceBrief, surfaceBrief }`. `devUrl` is the running dev server that serves the page, or null when none answered; `pageUrls` or `devCommand` then name the next step (step 2). `contextMissing` lists PRODUCT.md or DESIGN.md when absent: Live never waits on init or document. Work from the page as below, and offer `init` or `document` after the session, not before it. `roots` is the resolved root manifest; `projectRoot` mirrors `roots.appRoot`. The surface brief rides along; do not shell out to `impeccable surface-brief` separately. Precedence for generation: **DESIGN.md wins on visual decisions; PRODUCT.md wins on durable product and voice decisions; the surface brief wins on this surface's strategy.** When DESIGN.md is missing, identity is **not** absent; extract it from CSS variables, computed styles, and sibling components (Step 4 Phase A). Identity preservation is the default; departure requires the user's explicit redesign intent.
61
+
62
+ `serverPort`/`serverToken` belong to the small helper HTTP server (`/live.js`, SSE, `/poll`), not your dev server; the page URL is whatever origin serves a `pageFiles` entry.
63
+
64
+ A plain page needs no setup: when the app root holds an `index.html` page shell (Vite, React, or a plain HTML folder) with no CSP, the boot writes the one-line config itself and reports `configCreated: true`. Tell the user once that `.impeccable/live/config.json` was added, and carry on.
65
+
66
+ If output is `{ ok: false, error: "config_invalid", message, path }`, the config at `path` exists but `message` names what is wrong with it: repair that field in the existing file ([live-setup.md](live-setup.md) describes each field), keep every other field as it is, and boot again. Never replace the file with the common-case config below.
67
+
68
+ If output is `{ ok: false, error: "config_missing", path }`, the boot could not decide alone. A static folder whose page has another name takes one step: when `.opencode/skills/impeccable/scripts/impeccable detect-csp` reports `shape: null`, write `{"files":["<page>.html"],"insertBefore":"</body>","commentSyntax":"html","cspChecked":true}` at the boot's reported `path` and boot again. Anything else (another framework, a CSP, several HTML files): read [live-setup.md](live-setup.md) and follow it. If the output carries a non-null `configDrift`, tell the user once which HTML files are uncovered and suggest adding them or switching `files` to a glob; never auto-edit the config.
69
+
70
+ On `no_page`, tell the person in one sentence that there is nothing for Live to open yet. Offer to build the first page with `/impeccable craft <what they want>` and start Live on it once it exists. Do not create a page unless the person asks for one.
71
+
72
+ ## Recovery commands
73
+
74
+ The append-only journal under `.impeccable/live/sessions/` is canonical durable state (not project source). When the chat was interrupted, polling was missed, the helper restarted, or the browser reloaded:
75
+
76
+ ```bash
77
+ .opencode/skills/impeccable/scripts/impeccable live-status # helper state, active sessions, queued events; works with the helper down
78
+ .opencode/skills/impeccable/scripts/impeccable live-resume --id SESSION_ID # active snapshot, pending event, next safe action
79
+ .opencode/skills/impeccable/scripts/impeccable live-complete --id SESSION_ID # canonical manual final acknowledgement after verified cleanup
80
+ ```
81
+
82
+ Server restart rule: start `impeccable live-server` again, then poll; startup requeues unacknowledged events, so never ask the user to click Go again unless `impeccable live-resume` says no active session exists.
83
+
84
+ ## Handle `generate`
85
+
86
+ **Replace mode** (default): `{id, action, freeformPrompt?, count, pageUrl, element, screenshotPath?, comments?, strokes?}`.
87
+
88
+ **Insert mode** (`event.mode === "insert"`): `{id, mode: "insert", count, pageUrl, insert: { position, anchor }, placeholder: { width, height }, freeformPrompt?, screenshotPath?, comments?, strokes?}`. No `action`; requires a non-empty `freeformPrompt` **or** annotations. `placeholder` is a soft size hint.
89
+
90
+ Speed matters; the user is watching the selected element. Reuse preflight metadata, minimize discovery calls.
91
+
92
+ ### Insert mode branch
93
+
94
+ 1. Read the screenshot if present (annotations only).
95
+ 2. If `event.scaffold` is present, use it and do **not** run the helper again. Otherwise:
96
+
97
+ ```bash
98
+ .opencode/skills/impeccable/scripts/impeccable live-insert --id EVENT_ID --count EVENT_COUNT --position after \
99
+ --element-id "ANCHOR_ID" --classes "class1,class2" --tag "section" --text "ANCHOR_TEXT"
100
+ ```
101
+
102
+ `--position` ← `event.insert.position`; anchor flags map exactly like wrap's. The scaffold has **no** `data-impeccable-variant="original"`; variants are net-new HTML+CSS at `insertLine`. On source-preview targets the scaffold carries `sourceWritten: false` with `wrapperBlock`: splice variants into `wrapperBlock` at the marker and replace `[replaceStartLine, replaceEndLine]` with the spliced block in ONE edit, exactly as the wrap section describes; when `replaceEndLine < replaceStartLine` this is a pure insertion that removes nothing. Decide the visitor mode from the surface and load [craft-floor.md](craft-floor.md) before writing net-new markup. Svelte targets follow the same component flow as wrap below (`mode: "insert"` in the manifest): each variant is a real single-root component under `componentDir` with no `data-impeccable-*` attributes; never edit the route during generation; accept splices the chosen markup into `sourceFile` mechanically. For non-Svelte targets, accept/discard removes the wrapper; the anchor is untouched.
103
+
104
+ ### Replace mode (default)
105
+
106
+ ### 1. Read the screenshot (if present)
107
+
108
+ `event.screenshotPath` is sent **only when the user annotated before Go**; it is a PNG of the element with annotations baked in. Read it before planning. When absent, do not ask for one or screenshot the page yourself: without annotations a screenshot anchors you on the existing design and fights the three-distinct-directions brief; work from `element.outerHTML`, the computed styles, and the prompt.
109
+
110
+ Annotation semantics: a comment's `{x, y}` is element-local and binds the text to the child under that point (a comment near the title is about the title). Comments and strokes are independent unless clearly paired. Strokes read by shape: closed loop = "this thing" (emphasis, not a clipping region); arrow = direction or movement; cross/slash = delete; scribble = emphasis or delete by context. If a stroke's intent is genuinely ambiguous and it changes the brief, ask one short question before generating; otherwise state your reading in one sentence.
111
+
112
+ ### 2. Wrap the element
113
+
114
+ When `event.scaffold` is present, the helper already found the source and computed the wrapper; treat it as the successful output and skip the command. `event.scaffoldAttempted` with `scaffoldError` means preflight could not finish; use the command below.
115
+
116
+ **On source-preview targets `event.scaffold` carries `sourceWritten: false`.** The helper did NOT write the wrapper; it hands you `scaffold.wrapperBlock` plus the picked element's source range (`replaceStartLine`, `replaceEndLine`, 1-indexed). Write the wrapper **and** all variants in ONE edit: splice your variants into `wrapperBlock` at the "Variants: insert below this line" marker, then replace lines `[replaceStartLine, replaceEndLine]` with the result. A separate scaffold write reloads the framework before your variant write lands and strands the browser at 0/N. (`replaceEndLine < replaceStartLine` means insert mode: insert, remove nothing.) The `svelte-component` path never sets `sourceWritten`.
117
+
118
+ ```bash
119
+ .opencode/skills/impeccable/scripts/impeccable live-wrap --id EVENT_ID --count EVENT_COUNT --element-id "ELEMENT_ID" --classes "class1,class2" --tag "div" --text "TEXT_SNIPPET"
120
+ ```
121
+
122
+ Flag mapping (keep separate, never collapse into `--query`): `--element-id` ← `event.element.id`; `--classes` ← classes joined with commas; `--tag` ← tagName; `--text` ← first ~80 chars of textContent, **every call**: it disambiguates repeated sibling components, and without it a class locator lands on the first match. If `event.pageUrl` implies the file, pass `--file PATH`. If `--text` still matches several candidates, wrap exits `{ error: "element_ambiguous", candidates, fallback: "agent-driven" }`: pick the right range from page context and write the wrapper manually per the fallback flow.
123
+
124
+ An element with neither an id nor classes (a bare `<h1>`, the usual first pick on a fresh page) leaves both flags out; the tag alone locates it:
125
+
126
+ ```bash
127
+ .opencode/skills/impeccable/scripts/impeccable live-wrap --id EVENT_ID --count EVENT_COUNT --tag "h1" --text "TEXT_SNIPPET"
128
+ ```
129
+
130
+ A tag alone never lands on the first match: when the tag repeats and `--text` does not single out one element, or the element shares a source line with other markup (`reason: "shared_line"`), wrap exits `element_ambiguous`; follow the fallback flow as above. Short text settles it only when it is one element's whole text.
131
+
132
+ Success output: `{ file, insertLine, commentSyntax, styleMode, styleTag, cssSelectorPrefixExamples, cssAuthoring }` (plus the `sourceWritten: false` fields above on source-preview targets). Run directly with no preflight scaffold, it writes the wrapper itself and you splice variants at `insertLine`. `styleMode` controls how preview CSS must be authored. Treat it as a detected capability mode, not a framework guess: `scoped` means `@scope ([data-impeccable-variant="N"])` rules; `astro-global-prefixed` means explicit `[data-impeccable-variant="N"]` prefixes with the exact returned `styleTag`. Use `cssAuthoring` as the source of truth for the current file (styleTag, selector strategy, requirements, forbidden patterns); apply no framework-specific exception unless it says to.
133
+
134
+ For Svelte/SvelteKit targets, `impeccable live-wrap` returns `previewMode: "svelte-component"` with `file` pointing at a temporary `node_modules/.impeccable-live/<id>/manifest.json`, `componentDir` holding the variant components, and `sourceFile` the real route. The scaffold is AST-based: control-flow blocks (`{#each}`, `{#if}`) survive intact and a free each-collection crosses the contract as ONE structured prop (kind `collection`). The payload includes `componentStubMarkup` (the prop-substituted markup already written into every stub), so do not read the manifest or stubs back. EDIT `v1.svelte`, `v2.svelte`, ... in place; never delete and recreate them; keep the stub's control flow and `propContract` prop names; never flatten a loop into literal items. The stub `<style>` arrives seeded with the source rules that currently style the selection; restyle or delete them freely. On accept, any seeded rule your variant does not re-declare is REMOVED from the source (the preview never applied it, so the user approved a design without it). Use semantic class selectors, no `@scope`, no `data-impeccable-*`. Reply with `--file` set to the manifest path; the browser mounts the compiled components so Svelte HMR does not reset page state. Accept merges the chosen component back mechanically (markup restored to route expressions, CSS reconciled, params baked, indentation preserved); you have no post-accept cleanup on this path. When the selection contains constructs a detached preview cannot support (component tags, `bind:`/`use:`, await blocks, inline scripts, spread attributes), wrap returns the normal source-preview wrapper with `previewFallback: { from: "svelte-component", reason }`; just follow the returned shape.
135
+
136
+ **Params on component-preview paths go in a sidecar, never as an attribute** (Svelte parses `{` in attribute values as an expression). Declare them in `componentDir/params.json` keyed by variant number, using the schema from section 7:
137
+
138
+ ```json
139
+ { "1": [ {"id":"density","kind":"steps","default":"snug","label":"Density","options":[
140
+ {"value":"airy","label":"Airy"},{"value":"snug","label":"Snug"} ]} ] }
141
+ ```
142
+
143
+ Author the component `<style>` against `var(--p-<id>, default)` for `range`/`toggle` and `[data-p-<id>="…"]` for `steps`, wrapped in `:global(...)` so runtime knob values on the mounted root reach your rules.
144
+
145
+ **Fallback errors.** Wrap refuses to write into non-source files (generated, untracked): accepting into one is silent data loss. Three shapes, all with `fallback: "agent-driven"` (see **Handle fallback**): `file_is_generated` (your `--file` points at a generated file), `element_not_in_source` with `generatedMatch` (element only exists generated), `element_not_found` (likely runtime-injected).
146
+
147
+ ### 3. Load the action's reference
148
+
149
+ `event.action` is `impeccable` (freeform): work from SKILL.md's design rules plus [craft-floor.md](craft-floor.md); decide the visitor mode from the surface; do not load a sub-command reference. Freeform is not a pass to skip parameters: follow the budget and freeform bias in section 7. Any other action (`bolder`, `quieter`, `distill`, `polish`, `typeset`, `colorize`, `layout`, `adapt`, `animate`, `delight`, `overdrive`): read `reference/<action>.md` before planning; its MUST params layer on top of the section 7 budget.
150
+
151
+ ### 4. Plan three variants: identity first, then mode, then axes
152
+
153
+ Live runs on an existing surface; the brand is already chosen. The job is variation **within identity**, not selection between identities. The worst failure is three off-brand variants the user cannot accept. Four phases, in order.
154
+
155
+ #### Phase A: Extract the identity (non-skippable)
156
+
157
+ Sources in priority order: DESIGN.md's visual system fields; CSS custom properties (de-facto tokens); computed styles on the picked element and parent; sibling components' visual rhetoric. Write ONE sentence recording what is actually on screen: dominant surface and accent color (real values, not "warm"), the loaded font pairing, layout topology (stacked / side-by-side / grid / asymmetric / overlay), surface treatment (corners, borders, shadows, decoration density), and the voice tone read off the copy. Be specific; skip an axis rather than fabricate; do not name an aesthetic family (a conclusion, not data). This sentence is the **identity lock**: every variant must read as the same brand side by side. Absence of DESIGN.md is never an excuse.
158
+
159
+ #### Phase B: Pick mode (default vs departure)
160
+
161
+ **Default** preserves the identity and varies expression within it; right for ~90% of sessions. **Departure** rejects the identity; trigger ONLY on the user's explicit ask in the current request or prompt ("redesign this", "rebuild from scratch", "something completely different"); a stale critique or old note is not authorization. Unsure means default: wrong-default costs "three on-brand variants with similar feel" (recoverable), wrong-departure costs three off-brand variants (unrecoverable).
162
+
163
+ #### Phase C: Plan three variants
164
+
165
+ **Default mode.** Each variant commits to a different **primary axis**, preserving the identity sentence. The six axes: 1 **Hierarchy** (which element commands the eye), 2 **Layout topology** (stacked / side-by-side / grid / asymmetric / overlay), 3 **Typographic system** (pairing logic, scale ratio, case/weight, *within the available faces*), 4 **Color strategy** (which existing palette role carries the surface: Restrained / Committed / Full palette / Drenched; existing tokens only), 5 **Density** (minimal / comfortable / dense), 6 **Structural decomposition** (merge, split, progressive disclosure). Three variants, three DIFFERENT axes: the same brand at three angles. New fonts, new hues, or new aesthetic-family signals belong to departure mode only.
166
+
167
+ **Departure mode.** Each variant anchors to a different aesthetic direction derived from the brand, never a fixed catalog: read PRODUCT.md's Brand Personality words; derive physical, spatial, or material experiences that embody them; from those, derive three directions genuinely different from each other AND from the current surface; reject reflex choices whose rationale would fit a neighboring product. Each direction must be one concrete sentence naming a real-world referent ("a museum exhibition label system", not "clean and minimal").
168
+
169
+ **In both modes, name each variant's 2 or 3 parameter knobs while planning** (section 7 budget). Parameters are part of the design; deciding "what's tunable" during planning beats retrofitting.
170
+
171
+ #### Phase D: Squint test
172
+
173
+ **Default:** compare each variant against the Phase A lock; palette, type voice, or rhetoric drift means it crossed into departure by accident: rework. Then confirm three different primary axes; three "tighter density" variants is failure. **Departure:** two passes, family before sentence. Family pass (non-negotiable): label each variant with a concrete family of your own choosing; shared or interchangeable labels mean rework. Sentence pass: three one-line descriptions side by side; two that rhyme mean rework. When the primary axis is color or theme, the trio must not share theme + dominant hue: three color worlds, not three shades.
174
+
175
+ **Action-specific invocations** must vary along the action's dimension; in default mode every variation stays within the available faces and existing tokens:
176
+
177
+ - `bolder`: amplify a different dimension per variant (scale / saturation / structural change).
178
+ - `quieter`: pull back a different dimension (color / ornament / spacing).
179
+ - `distill`: remove a different class of excess (visual noise / redundant content / nested structure).
180
+ - `polish`: a different refinement axis (rhythm / hierarchy / micro-details).
181
+ - `typeset`: departure varies the pairing AND the scale ratio each; default keeps the faces and varies scale ratio, case, and weight each.
182
+ - `colorize`: departure gives each a different hue family and varies chroma and contrast strategy; default gives each a different existing palette role carrying the surface (Restrained / Committed / Full palette / Drenched) and a different contrast strategy.
183
+ - `layout`: different structural arrangement, not spacing tweaks.
184
+ - `adapt`: different target context per variant (mobile-first / tablet / desktop / print or low-data).
185
+ - `animate`: different motion vocabulary (cascade stagger / clip wipe / scale-and-focus / morph / parallax).
186
+ - `delight`: different flavor of personality (micro-interaction / typographic surprise / illustrated accent / sonic-or-haptic / easter egg).
187
+ - `overdrive`: different convention broken (scale / structure / motion / input model / state transitions); skip its "propose and ask" step, live is non-interactive.
188
+
189
+ ### 5. Apply the freeform prompt (if present)
190
+
191
+ `event.freeformPrompt` is the user's ceiling on direction: all variants honor it while exploring different interpretations within the Phase B mode. Default mode: the prompt narrows the axes, not the identity ("more confident" → one variant amplifies hierarchy, one commits the accent color, one tightens density). Departure mode: the prompt narrows the lanes, not the families ("newspaper front page" → broadsheet vs tabloid vs trade journal, then run the family pass). When the prompt conflicts with a binding brand commitment or DESIGN.md invariant, preserve the invariant unless the user explicitly revokes it.
192
+
193
+ ### 6. Deliver variants
194
+
195
+ Complete HTML replacement of the original element per variant, not a CSS-only patch. Colocate preview CSS as a `<style>` tag inside the wrapper. **Atomic default:** CSS + all variants + parameter manifests in one edit at `insertLine`.
196
+
197
+ ```html
198
+ <!-- Variants: insert below this line -->
199
+ <style data-impeccable-css="SESSION_ID">
200
+ /* rules matching cssAuthoring.rulePattern */
201
+ </style>
202
+ <div data-impeccable-variant="1">
203
+ <!-- variant 1: full element replacement (single top-level element) -->
204
+ </div>
205
+ <div data-impeccable-variant="2" style="display: none">
206
+ <!-- variant 2 -->
207
+ </div>
208
+ <div data-impeccable-variant="3" style="display: none">
209
+ <!-- variant 3 -->
210
+ </div>
211
+ ```
212
+
213
+ Replace the style opening tag with `cssAuthoring.styleTag` when the tool returns a different one, and close it with `cssAuthoring.styleClose` (`</component>` on `.vue`). **Each variant div contains exactly one top-level element**, same tag as the original; loose siblings break outline tracking and accept. First variant visible, all others `display: none`. The browser's MutationObserver accepts atomic or progressive arrival; accepting an arrived variant fences the worker, so later publications are rejected.
214
+
215
+ For `styleMode: "scoped"`, author every `:scope` rule with a descendant combinator: the `@scope` boundary is the variant wrapper div, not your element, so a bare `:scope { ... }` styles a `display: contents` shell. Always step in (`:scope > .card`, `:scope .hero-title`). The fake test agent's CSS in the [repo agent template](https://github.com/pbakaus/impeccable/blob/8dac6ae7e020c43ab10ce9b41939f6fd42627b96/tests/live-e2e/agent.mjs) is a faithful template.
216
+
217
+ **JSX / TSX targets:** wrap `<style>` content in a template literal (CSS braces would parse as JSX), use `className=` / `style={{…}}`, keep `data-impeccable-*` attributes as plain strings:
218
+
219
+ ```tsx
220
+ <style data-impeccable-css="SESSION_ID">{`
221
+ @scope ([data-impeccable-variant="1"]) { ... }
222
+ `}</style>
223
+ <div data-impeccable-variant="2" style={{ display: 'none' }}>
224
+ {/* variant 2 */}
225
+ </div>
226
+ ```
227
+
228
+ The wrap script provides a single-rooted JSX wrapper with the marker comments inside; drop the block at the marker and the source stays valid TSX.
229
+
230
+ ### 7. Parameters (composition-sized, 0-4 per variant)
231
+
232
+ Each variant can expose **coarse** knobs; the browser docks one control per parameter with zero regeneration cost (knobs drive a CSS variable or data attribute your scoped CSS is authored against). Wire an axis as soon as the user could plausibly mutter "a bit tighter" or "a touch more accent" without wanting a regeneration; micro-margins and one-off nudges are not parameters. Freeform bias: you chose the axes, so expose them; a hero with 0 params is almost always a mistake, and 1 is underweight unless the design is a genuine fixed point.
233
+
234
+ Budget scales with the element's VISUAL weight (count visual children, not DOM depth):
235
+
236
+ - **Leaf / tiny** (button, icon, bare heading): **0 params.**
237
+ - **Small composition** (simple card, labeled input, ≤ ~5 visual children): **0-1**.
238
+ - **Medium composition** (section, nav cluster, 6-15 children): **target 2**; 1 if simple.
239
+ - **Large composition** (hero, full region, 16+ children or sub-sections): **target 2-3, up to 4** when independent axes are all authored in CSS.
240
+
241
+ **Hard cap: four** per variant. For named sub-commands, the action reference's MUST params are non-negotiable when expressible; respect the cap, no duplicate knobs.
242
+
243
+ **Declare** on the HTML/JSX path as a wrapper attribute (component-preview paths use `componentDir/params.json` instead, same schema, keyed by variant number; see the wrap section):
244
+
245
+ ```html
246
+ <div data-impeccable-variant="1" data-impeccable-params='[
247
+ {"id":"color-amount","kind":"range","min":0,"max":1,"step":0.05,"default":0.5,"label":"Color amount"},
248
+ {"id":"serif","kind":"toggle","default":false,"label":"Serif display"}
249
+ ]'>
250
+ ```
251
+
252
+ Three kinds: `range` (slider; drives `--p-<id>`; author `var(--p-color-amount, 0.5)`; fields min/max/step/default/label), `steps` (segmented radio; drives `data-p-<id>`; author `:scope[data-p-density="airy"] .grid { ... }`; fields options/default/label), `toggle` (drives both `--p-<id>: 0|1` and attribute presence; fields default/label). Reset on variant switch is a known limitation: each variant starts at its declared defaults.
253
+
254
+ **On accept**, the browser sends current values and `impeccable live-accept` writes them as a sibling comment: `<!-- impeccable-param-values SESSION_ID: {"color-amount":0.7} -->`. Carbonize cleanup bakes them: keep only the matching `steps`/`toggle` branch, drop the others, collapse `:scope[data-p-…]` to semantic rules; substitute `range` literals or update the var's default.
255
+
256
+ ### 8. Signal done
257
+
258
+ ```bash
259
+ .opencode/skills/impeccable/scripts/impeccable live-poll --reply EVENT_ID done --file RELATIVE_PATH
260
+ ```
261
+
262
+ `RELATIVE_PATH` is relative to project root; the browser fetches source directly if the dev server lacks HMR. Then poll again immediately.
263
+
264
+ ### Aborting an in-flight session
265
+
266
+ If wrap or generation fails after the browser flipped to GENERATING, tell the **browser** so its bar resets: `.opencode/skills/impeccable/scripts/impeccable live-poll --reply EVENT_ID error "Short reason"`. Never use `live-accept --discard` for this (pure file mutator, browser never sees it, bar sticks on dots); `--discard` is only source-side cleanup for a discard the browser itself initiated.
267
+
268
+ ## Handle fallback
269
+
270
+ When wrap returns `fallback: "agent-driven"`, you pick the source file yourself; the goal is unchanged: three preview variants now, and the accepted one persisted where the next build cannot wipe it.
271
+
272
+ 1. **Find where the element really lives** from the error payload: `element_not_in_source` + `generatedMatch` means the served HTML is generated, so find the generator's template or partial; `element_not_found` means runtime-injected, so find the rendering component or data source; `file_is_generated` resolves the same way. A purely visual change may belong in a shared stylesheet rather than a template.
273
+ 2. **Preview in the served file**: manually write the same wrapper scaffold `impeccable live-wrap` produces into the file the browser actually loaded, moving the element itself into the original slot: `<!-- impeccable-variants-start ID --><div data-impeccable-variants="ID" data-impeccable-variant-count="3" style="display: contents"><div data-impeccable-variant="original">THE ELEMENT, UNCHANGED</div><!-- Variants: insert below this line --></div><!-- impeccable-variants-end ID -->`. Insert your variant divs after the marker, then `--reply EVENT_ID done --file <served file>`. Put the start marker and the end marker each on a line of its own: accept replaces whole lines from marker to marker, so a marker that shares its line with other markup takes that markup with it (in a one-line or minified file, break the line around the element first). Never drop the original slot: discard restores the element from it and refuses a wrapper without one. This edit is temporary; a regen wiping it is fine.
274
+ 3. **On accept, write to true source** (accept refuses generated files, so `_acceptResult.handled` is usually `false` here): structural change → template/component source; visual-only → the right stylesheet; content rendered from data → the data source or render logic. Then remove the temporary wrapper from the served file.
275
+ 4. **On discard**, just remove the temporary wrapper.
276
+
277
+ ## Handle `accept`
278
+
279
+ Event: `{id, variantId, _acceptResult, _completionAck}`. The poll script already ran `impeccable live-accept` deterministically and acknowledged delivery; the browser DOM is already updated.
280
+
281
+ - The accept event includes `pageUrl`; the poll script must forward it to `impeccable live-accept --page-url PAGE_URL` so accept-time cleanup only scrubs staged copy edits for the current page.
282
+ - `_completionAck.ok !== true`: do not poll yet. Run `impeccable live-status` / `impeccable live-resume`, finish cleanup manually if needed, then `impeccable live-complete --id EVENT_ID`.
283
+ - `handled: true, carbonize: false`: nothing to do; poll again.
284
+ - `handled: true, carbonize: true`: required cleanup below; `_acceptResult.todo`, `_completionAck.requiresComplete`, and the stderr banner all point at it.
285
+ - `handled: false, mode: "fallback"`: the session lived in a generated file; you already wrote true source in fallback Step 3; clean the temporary wrapper and poll.
286
+ - `handled: false, mode: "error"`: **do not hand-edit the file**, with one exception. `source_locked`: rerun the same `impeccable live-accept` command (idempotent) until the publisher releases. `markers_share_line`: a session marker comment shares its line with other markup and nothing was written; move each marker onto a line of its own (the only edit allowed), then rerun the same command. `accept_receipt_conflict`: the session already resolved as `priorOperation`; run `impeccable live-status` and tell the user. Anything else: report briefly, run `impeccable live-status` first.
287
+ - `handled: false` without `mode`: manual cleanup: read file, find markers, edit.
288
+
289
+ ### Required after accept (carbonize)
290
+
291
+ `carbonize: true` means the accepted variant is stitched into source with helper markers and inline CSS (so the browser renders with no gap). That stitch-in is temporary; rewrite it into permanent form before anything else, or dead `@scope` rules, wrapper divs, and marker comments accumulate across sessions. Five steps, synchronously, before the next poll:
292
+
293
+ 1. **Locate the carbonize block** in `_acceptResult.file`: the `<!-- impeccable-carbonize-start/end SESSION_ID -->` markers bracket only the `data-impeccable-css` style element, and the accepted `data-impeccable-variant` div follows the end marker (on JSX both sit inside an outer `data-impeccable-carbonize` div). `SESSION_ID` here, in `styleTag` and in every `--id` is the event's `id`; read the `<!-- impeccable-param-values -->` comment first when present, it drives steps 3 and 4.
294
+ 2. **Move the CSS rules** into the project's real stylesheet (whichever already owns styling for the surrounding element).
295
+ 3. **Bake param values while rewriting selectors**: retarget `@scope ([data-impeccable-variant="N"])` to real semantic classes; keep only the `:scope[data-p-<id>="VALUE"]` branch matching the chosen value; substitute `var(--p-<id>)` literals or update the var's default.
296
+ 4. **Unwrap the accepted content**: delete the inner variant div (and on JSX the outer `data-impeccable-carbonize` div); drop `data-impeccable-params` and all `data-p-*` attributes.
297
+ 5. **Delete** the inline `data-impeccable-css` style element, the param-values comment, both carbonize markers, and any `@scope` rules for non-accepted variants.
298
+
299
+ Then run `impeccable live-complete --id SESSION_ID` and verify `phase: "completed"` before polling again. The command is a gate, not a formality: it refuses with `error: "source_dirty"` plus findings while any live-mode leftover remains; fix and rerun (`--force` only for false positives).
300
+
301
+ ## Handle `discard`
302
+
303
+ Event: `{id, _acceptResult, _completionAck}`. The poll script already restored the original and acknowledged `discarded`. Nothing to do unless `_completionAck.ok !== true`; then `impeccable live-complete --id EVENT_ID --discarded` and poll again.
304
+
305
+ ## Handle `steer`
306
+
307
+ Event: `{id, message, pageUrl}`: page-level direction from the global bar's Steer control (typed or spoken), no element context, no variant cycling. Read `message`, inspect the page or files as needed, make edits or answer in prose. Reply `.opencode/skills/impeccable/scripts/impeccable live-poll --reply EVENT_ID steer_done ["Optional short toast"]`, or on failure `--reply EVENT_ID error "Short reason"`, then poll immediately. No separate pickup reply; the Steer bar unlocks on `steer_done` or `error`.
308
+
309
+ ## Handle `prefetch`
310
+
311
+ Event: `{pageUrl}`: fired once per route on first selection; the user is likely about to Go on a page you have not read. Resolve the route to its file (root `/` is usually the boot's `pageFile`; multi-page sites often map `/foo` to `public/foo/index.html`; SPAs map everything to one entry), read it, poll again. No `--reply`. If you cannot resolve it confidently, skip and poll.
312
+
313
+ ## Handle `manual_edit_apply`
314
+
315
+ Event: `{id, pageUrl, batch: {entries}, evidencePath?, chunk?, repair?, deadlineMs}`.
316
+
317
+ The user already clicked Apply. Do not ask what to do, discard, or redirect to Go. The parent live thread keeps the foreground poll loop and sends the final `/poll --reply --data`.
318
+
319
+ When native subagents are available, delegate source edits to `impeccable_manual_edit_applier` / `impeccable-manual-edit-applier`. Pass cwd, scripts path, event id, page URL, chunk/deadline, `batch`, `evidencePath`, and the canonical JSON result schema. The subagent must not poll or reply. If unavailable, apply inline with the same contract.
320
+
321
+ An op with `deleted: true` and `removeElement: true` is the browser's Remove badge: delete that whole element from source, children included, not just its text. Locate it by `sourceHint`, then by `leaf.outerHTML` and `originalText`, and remove exactly that element's source range; leave no empty wrapper, orphaned children, or dangling markup behind.
322
+
323
+ If `repair` is present, the previous Apply changed source but final validation failed. Fix the current source and return the same canonical JSON result; do not roll files back yourself. The browser will ask the user before any rollback.
324
+
325
+ After source edits finish, reply exactly once with `.opencode/skills/impeccable/scripts/impeccable live-poll --reply EVENT_ID done --data '{"status":"done","appliedEntryIds":["8hexid"],"failed":[],"files":["src/page.html"],"notes":[]}'`. Use `status:"partial"` or `status:"error"` with `failed[]` when not every entry applied. Then poll again. Never reply without the event id; `--reply done --file ...` is invalid for manual Apply.
326
+
327
+ ## Exit
328
+
329
+ The user stops live mode by saying so in chat, closing the tab (SSE drops; poll returns `exit` after 8s), or the browser's exit button. On `exit`, kill any still-running background poll, then clean up.
330
+
331
+ ## Cleanup
332
+
333
+ ```bash
334
+ .opencode/skills/impeccable/scripts/impeccable live-server stop
335
+ ```
336
+
337
+ Stops the helper and runs `impeccable live-inject --remove` to strip the injected script (use `stop --keep-inject` to keep it for a quick restart; `.impeccable/live/config.json` persists as project config). Then search for and remove any leftover `impeccable-variants-start` wrappers and `impeccable-carbonize-start` blocks, stop a dev server this session started (by its own process id), and when the boot's context asked for the detector (`MANUAL_DETECTOR_REQUIRED`), run it once over the files an accept changed.
338
+
339
+ ## First-time setup
340
+
341
+ Only when `impeccable live` reports `config_missing` / `config_invalid`, or `configDrift` needs explaining, or the config lacks `cspChecked`: read [live-setup.md](live-setup.md). It owns the config schema, the per-framework `files` table, injection adapters, drift healing, and the CSP detection and consent flow.
@@ -0,0 +1,21 @@
1
+ # Operate
2
+
3
+ `impeccable concept-seed --mode operate` prints the two sections below as its MODE RULES block. On an Operate surface the visitor came to get a job done, so the page is first a working product of its category and the world serves it.
4
+
5
+ ## Directions
6
+
7
+ Someone who uses tools like this one should know where everything is before they notice the world. The world lends four things and only these: type, palette, density, and one signature move. It never supplies the layout, the navigation model, or the controls. Colour is part of the world's contribution, and it does real jobs: a committed palette for the shell (a coloured rail or header, a tinted ground), state colours, data series, selection, and the signature move. A grey screen with one accent colour is the category default without the category's polish, not restraint.
8
+
9
+ Read every candidate, the assigned direction, and every challenger through that limit before you fuse or judge it. A world taken from a tool or instrument the audience operates (a terminal, a scope, a control panel, a cockpit) or from a fictional interface comes back as a costume of that tool on a working screen: take from it only what transfers as type, palette, density, and a signature move, or replace it from your list. When a catalog world's source is itself an interface language, the same limit holds: it lends type, density, palette, and one signature move, while navigation and controls stay the standard ones for the platform, web components on the web and native controls in an app.
10
+
11
+ Write each direction's first viewport as the product's shell first: the navigation, the work areas and what each is for, the data the visitor reads first and its states, and then where the signature move lives. Expression may never obscure the task, state, or familiar affordance. Name the signature move concretely, so the comp and the build can find it: service health drawn as a transit map, a schedule set in a timetable's column rhythm. A direction whose world shows up only as a colour scheme has not found its move yet. When you weigh fused challengers, product clarity includes reading as a working product of this category.
12
+
13
+ ## Comps
14
+
15
+ The comp is the product screen, in the direction's committed palette: its shell and navigation with a distinct area for each job and, where there is data, filters over what they scope and charts and tables with clear states. The world enters only through type, palette, density, and the one signature move; it never supplies the page's organisation, so a working screen never reads as a newspaper, a poster, or any other artifact of the world. Every control is a standard one the visitor already knows how to use, a web component on the web and the platform's native control in an app: buttons, tabs, inputs, selects, filters, tables with sortable headers, navigation that reads as navigation. Never a costume of the world's own interface: a terminal's function-key bar or command prompt, an instrument's bezel, ruled ledger paper standing in for a table. A comp an engineer could not build from the platform's standard components is a picture of the tool, not the tool. The finish bar is the best product in the category: an aligned grid, consistent spacing, a real type scale, and clear hierarchy. The signature move adds to a screen that is already that clean; it never stands in for it.
16
+
17
+ Prompt with the screen's real content: the product name, realistic data with plausible values and units, real labels, and one state worth seeing (an alert, a degraded service, an empty filter result), never placeholder tiles. State colours (red for critical, amber for degraded) sit on top of the world's palette only where they carry meaning, and a headline number that moves over time shows its recent history, with the onset marked when something changed.
18
+
19
+ Comps two and three vary the product's organisation, never its world coverage: the navigation model (side rail, top bar, command-first), how the work areas divide the screen, which data leads, the density, and where the signature move sits. Each must be recognisably different from the first at thumbnail size; a variant only its prompt can tell apart adds no choice. A variant that adds world material, texture, or ornament goes further in the wrong direction; on a working screen, more world is a costume.
20
+
21
+ Self-check every render: with the name covered, does it read as a product of its category, could the visitor do the task from it, and is it at least as clean as the category standard and more distinctive than it? If it reads as an artifact of the world first, regenerate with the shell and the work areas named region by region and the world held to its four contributions.
@@ -0,0 +1,19 @@
1
+ # Persuade and Experience
2
+
3
+ `impeccable concept-seed --mode persuade` (or `experience`) prints the two sections below as its MODE RULES block. On these surfaces the design is what the visitor judges, so the world may own and structure the page.
4
+
5
+ ## Directions
6
+
7
+ When a catalog world's source is itself an interface language, the surface may carry its native grammar across navigation, content, controls, and states, within the platform conventions a native app keeps.
8
+
9
+ For **Persuade**, the opening must make the offer intelligible and desirable, expose a clear action, and demonstrate something only this product can prove. The action is the one the category's visitors came to take, in its working form: an airline's route-and-dates search, a clinic's open appointment slots, a store's add to cart. A decorative link pointing at it elsewhere does not count. Conversion lives inside the form's own vocabulary: a hook that lands in one line, a visible primary action, a legible reading order. A committed form that hides the offer or the action has not finished translating. For **Experience**, the work itself leads from the first viewport.
10
+
11
+ ## Comps
12
+
13
+ The world may be the carrier of the page, never a picture of it: a facade, a shutter or a book can be what the page is built on, while a viewport painted whole as a facade, a book cover or a travel poster, with no working parts in it, is a picture of the world, not its website. Material coverage is wanted: the world's material is the ground and the major surfaces, its type sets the headlines, and a world reduced to an accent on a neutral template is the category default with a sticker on it. Coverage is not performance: how many regions act out the concept is limited by the depth rule in visualize.md, and the rest stay in the world's material without performing it. Both ends erase the direction: the painted poster, and the generic product page (a headline over subcopy and a button, a row of equal cards below). The dealt composition sets the skeleton, and the compositions you write for comps two and three answer to the same test: a split hero (copy on one side, the product on the other, a badge row under it) or a centred headline over a row of cards is the template whatever world paints it.
14
+
15
+ The world carries the page's parts and never absorbs them, so wherever it puts one, the page still works as a page: navigation set into a facade reads as links, copy on a shutter as set text a visitor reads, an action on a door plaque as plainly clickable, text reads against whatever sits behind it, the sections keep a steady vertical rhythm, the primary action is unmistakable, and the section below starts as a section rather than more painting. Fix a poster by making its parts work where the world put them, never by moving them into a standard layout on the world's colour: a cover that becomes copy beside a device on marigold has lost the cover.
16
+
17
+ When the world is an object, the page is that one object seen once, at one scale and from one point of view, and the object keeps its real form: a book opens to two pages on one gutter, never a third panel, and a spine that carries the navigation belongs to the book on the page, never a second book beside it. More content goes on the object's own surfaces or on the next spread below, never on extra copies or impossible folds.
18
+
19
+ Comps two and three each go further than the first, never cleaner: a bolder use of the same world, where the world's material carries more of the page's structure (still one dominant move, per the depth rule), a larger or stranger focal move, or a composition the category would not attempt.
@@ -0,0 +1,21 @@
1
+ # Read
2
+
3
+ `impeccable concept-seed --mode read` prints the two sections below as its MODE RULES block. On a Read surface the visitor came to understand something, so the page is first a document of its kind, framed by the world.
4
+
5
+ ## Directions
6
+
7
+ The reader's question leads, and comprehension and wayfinding stay intact at every step. Documentation reads as documentation, a guide as a guide, an article as an article, a changelog as a changelog. The world owns the frame and serves the column. The frame is the masthead, the navigation rail, the ground, the title and section openers, and the way code, tables, and callouts are set: there the world's palette, type, and signature move commit fully, so the page could belong to no other product. The reading column inside it stays calm: a reading face, real contrast, a real measure, nothing performing behind the text. The world never supplies the reading order or replaces the navigation with something a reader has to learn. Documentation still reads as documentation, a guide as a guide, an article as an article.
8
+
9
+ Candidates from the world's own publishing traditions transfer best: reference books, type specimens, timetables, field guides, technical manuals, scholarly apparatus, a newspaper's wayfinding. A tool, instrument, or fictional interface from the audience's world comes back as a costume on a page meant for reading: take from it only what transfers as type, palette, density, and a signature move, or replace it from your list. When a catalog world's source is itself an interface language, the same limit holds: it lends type, density, palette, and one signature move, while navigation and controls stay the standard ones for the platform.
10
+
11
+ Write each direction's first viewport as the document's shell first: the navigation and where the reader stands in it, the title and the opening that answers or frames the reader's question, the reading column, and the way forward (contents, section headings, next and previous). Then name where the world owns the frame and where the signature move lives: a masthead, a coloured rail, a running head, a margin system, a numbering scheme, a way of setting code or tables. When you weigh fused challengers, product clarity includes how fast a reader finds and understands the answer.
12
+
13
+ ## Comps
14
+
15
+ The comp is the document as the reader meets it: a frame the world owns, in the direction's committed palette and type, around a calm reading column at a real measure (on the web about 60 to 75 characters with body text near 16px; in a native app, the platform's body text style and its readable width), with headings in a clear hierarchy and the wayfinding that carries the reader through. Body text is set in a reading face with real contrast against its ground; a monospace face is for code, parameters, and small labels, never the running text or the headings by default. Code, tables, notes, and figures sit in the standard forms readers already know, set in the world's type and palette. The signature move is one system used where it earns its place, never a frame repeated around every element. The world never supplies the page's reading order, so a document never reads as a poster, a magazine cover, or a book photographed open.
16
+
17
+ Prompt with the real material: the actual title, a real opening paragraph, real section names, and one example of the hardest content the surface holds (a code sample, a reference table, a diagram), never filler text.
18
+
19
+ Comps two and three vary the reading structure and how the frame carries the world, never the column: the navigation model (sidebar tree, top tabs, inline contents), the column and margin system, how densely the reference material sits, and where the signature move appears. Each must be recognisably different from the first at thumbnail size; a variant only its prompt can tell apart adds no choice. A variant that pushes world material into the reading column makes reading harder and goes the wrong way.
20
+
21
+ Self-check every render: can a reader tell where they are and where to go next, and read the body comfortably? Then cover the name: could this be any other product's documentation? If so, the frame has not taken the world; push the masthead, rail, ground, and openers further into it. If the render reads as an artifact of the world before it reads as a document, the world has reached the column; pull it back to the frame.
@@ -0,0 +1,24 @@
1
+ # New visual work: the comp-led build
2
+
3
+ The comp-led branch of [new-work.md](new-work.md) step 6. Both paths and step 7 of new-work.md still apply.
4
+
5
+ ### Comp-led: the comp is a measured contract
6
+
7
+ When an approved comp exists, it is a spatial contract, not a mood board: only the user can downgrade its authority, in explicit words. Models systematically believe their HTML, CSS, and SVG recreation of an image succeeded when it did not, so the build runs as a state machine on disk whose gates measure the screen against the comp instead of asking you to remember it. Start it once, and let it tell you what is next:
8
+
9
+ `.opencode/skills/impeccable/scripts/impeccable build-phase start --direction <seed reference, or none when it was unavailable or a direction pinned whole skipped the roll> --artifact <entry file>` right after the direction choice, adding `--decision-comp <path>` when the chosen card has a decision comp (the path CHOSEN COMP names) so the comps gate counts it as option one, or `start --comp <approved comp> --artifact <entry file>` when a surface round already locked one. Start is not the choice ping: that is the `concept-seed --kind` rerun the roll's TELEMETRY line names, sent once when the roll printed one.
10
+
11
+ Then, in order, each closed by `.opencode/skills/impeccable/scripts/impeccable build-phase advance` (every verb below runs as `.opencode/skills/impeccable/scripts/impeccable <verb>`; exit 2 means the gate failed and printed why; fix that and advance again; write nothing for a later phase while an earlier gate is open):
12
+
13
+ 0. **comps.** The comp round from [visualize.md](visualize.md): three compositional comps of the requested surface at its own viewport under `.impeccable/mocks/`, each with a prompt sidecar, put in front of the user; the chosen one's sidecar gets `"approved": true`. The gate counts them and reads the approval; a `start --comp` skips this phase because it already happened.
14
+ The comp-led path is a frontier-tier job: it asks the builder to hold a measured layout, place plates at their boxes, and act on numeric readings across a dozen attempts. Smaller or faster models produce a recognisable page and stall under the hero gate; if the model in hand is one of those, say so before the direction round and take the code-led path, or expect the run to end at the hero with its readings unmet.
15
+
16
+ 1. **spec.** Measure the comp: `impeccable comp-spec --comp <comp> --grid` writes a coordinate grid over the comp; open it, name every salient region by grid span in a regions file (text and control regions narrow to an ink cluster only when it retains at least 95% of the span’s contrasting pixels; inspect the resulting crop, especially for compound controls and multiline text; `snap: false` keeps the span, and an explicit `box` is taken as drawn) (kind `plate` / `image` / `texture` for anything painted: every illustration, photograph, figure, product object, and material texture; `text` / `control` / `chrome` for what code draws; every region carries a `note` saying what the comp shows there, which the plate prompt and the gate messages read), and run `impeccable comp-spec --comp <comp> --regions <file>`. The spec carries each region's box, sampled palette, and medium; `impeccable comp-spec --print` is the build's reference from here on. Type is measured, not guessed: `impeccable font-match --measure <text region>` reads the comp's cap height, width class, and weight off the pixels, and `impeccable font-match --rank <region> --text "..."` takes its candidates from a fingerprint index of the Google Fonts catalog (the nearest faces to the crop's shape) plus any names you pass with `--candidates`, renders them at that cap height with the region's words, and ranks them by fingerprint distance (its `USE` line is the CSS); with no browser resolvable it records the catalog's nearest face and says the size is estimated, which is still the choice to build on. Do not install a browser to rank, and never write a `chosen` face into the spec by hand: the gate accepts only what font-match wrote. The spec gate refuses to close until the lead text region is measured and ranked. A region note that describes painted material (a diagram, drawing, photograph, texture) under a code kind is refused at the spec: reclassify it as a plate, or reword the note if code really draws it. The script refuses a regions file that leaves comp ink unnamed: what is never named can never be missing. It also refuses a `text` / `control` / `chrome` region larger than a quarter of the comp: that is a column, not an element. Name each element inside it (`container: true` only when it truly is one undivided element). Anything drawn is a plate: an inline SVG past an icon's budget (a diagram, notation, leader lines with arrows, a "quick approximation" of the artwork) is refused at the hero; icon-sized SVG (under 64px, a few paths) is fine, and a chart the page draws from data at runtime is a chart, not an illustration. Callout lines and arrows that annotate a drawing belong to that drawing's plate, with only their labels set as text. Split regions by what varies independently, as [region-map.md](region-map.md) sets out; a framed view is a frame plate over its own image region. A crop of the comp is never a plate (the plates gate refuses a resample of the comp region); the crop is the reference the plate is generated from. A plate region's box has to hold its whole artwork with a margin: the spec measures the artwork's contact with the box edges and refuses a box that cuts through it (`bleed: true` only when the page really crops it there), because a plate placed with `object-fit: cover` on such a box shows the artwork minus the side the box lost. Anything not in the spec does not exist on the page: no borders, rules, containers, or chrome the comp does not show. Only three concessions exist: fonts (the closest obtainable face), icon glyphs (close enough, exact if the user chose an icon library; this covers the pictogram only, never a control's chrome, so a chevron, an arrow, a dropdown's border and fill, a button's shape are the comp's), and genuine defects in the comp such as spelling errors.
17
+ Inspect the proposed map before producing assets: `impeccable comp-spec --comp <comp> --regions <file> --inspect-map` writes a numbered overlay, exact crops, foreground-mask previews, and a consolidated report without changing the spec or build state. Inspect boundaries and excluded pixels together; an empty reference needs corrected geometry. `parentId` names an enclosing `container`; it never removes regions or approves assets. The report diagnoses geometry, not semantic completeness.
18
+
19
+ 2. **plates.** Every raster region ships as a plate: an illustration, photo, or figure regenerated at asset resolution from its comp crop, UI text removed, at its `plate` path (isolated ink, figures, or objects use native transparent PNG so they sit on the page's own ground; photos and textures stay opaque); a texture (paper, cloth, grain) is a clean patch of the comp region mirror-tiled to size, generated only when no clean patch exists. `impeccable comp-spec --crop <id>` writes the reference; save `impeccable comp-spec --plate-prompt <id> --background transparent` to a prompt file for a cutout, or use `--background opaque` otherwise. Prefer the harness-native image tool with that crop and prompt, then `impeccable embed-prompt <plate> --prompt-file <prompt.txt>`. The API fallback is `impeccable generate-image --ref <crop.png> --prompt-file <prompt.txt> --out <plate.png> --size <WxH> --quality high --background transparent` (use `--background opaque` for full-frame assets); create the output directory first. Verify actual alpha, white foregrounds, fine edges, and clear holes on light and dark grounds; do not chroma-key native output. The plates gate scores the assets against the comp; also inspect placement and scale visually. With parallel subagents, spawn the shipped asset producer (`impeccable-asset-producer`; `impeccable_asset_producer` in codex; `/impeccable-asset-producer` in Cursor; on GitHub Copilot say "Use the impeccable-asset-producer agent") with the spec path and let it produce them all; without subagents, produce them here. A crop of the comp is a reference, never a shipping pixel. The approved comp is a fixed reference: never edit it, composite into it, or regenerate it, and never copy a crop of it in as a plate (the crop is only the reference you generate from). The gate checks every plate exists, is at least 1.5x the region's size, and reads as the region. Page code waits for this gate: a page written before its plates exist is a page that draws its material in CSS. A single-file deliverable changes nothing here: the plate is produced the same way and inlined as a data URI. `--force` exists for one case only, the user downgrading the comp's authority in words you quote in `--reason`; the script refuses every other reason. Score the plates before the review opens: once `build-phase advance` reports nothing but the pending review, run the plan and asset review in [component-review.md](component-review.md), where the user checks the plates and which regions code draws. A plate replaced after they accept needs a new round. No page code is written before they accept it; `build-phase advance` refuses until they do.
20
+
21
+ 3. **hero.** `impeccable build-phase scaffold` first: it writes the measured layout as CSS custom properties (`.impeccable/build/scaffold/layout.css`: `--r-<id>-x/y/w/h` in % of the comp, plus cap height, font-size, family, and weight where measured) and a reference page (`hero-reference.html`) with every region at its box and every plate placed. Bind the numbers to your own semantic structure, an element per region; the reference is a check on positions, never the page, and overlapping boxes are overlapping boxes. Then build only the first viewport, at the comp's own dimensions, the comp's words copied verbatim (the user approved that comp with those words; rewording is a stated decision after the hero passes, never a silent one inside it), every text region sized from its measured cap height and set in its ranked face (served from the project: put the face's font files beside the page and load them with `@font-face`, never a hosted font stylesheet such as fonts.googleapis.com or a font data URI, because the first-viewport capture allows fonts only from the page's own files and refuses any other host as an external dependency), plates first: place every plate at its spec box (`object-fit: cover`, an `<img>`, a background image, or an inlined data URI named for it) before any text or control, capture into `.impeccable/review/hero-repro.png`, run `impeccable build-phase record hero` once so you see the plate regions read as match before any text exists, then lay the semantic layer over the plates from the spec's palette and boxes and advance. The gate first refuses while any plate is unreferenced by the source, then runs `impeccable comp-diff`, writes `.impeccable/review/diff/hero/` (side-by-side, heatmap, one paired crop per region, `report.json`; `raw-report.json` preserves the uninterpreted measurements). The report and crop labels use the gate's verdicts; `gate.reasons` lists the remaining blockers even when a region is called drift. An accepted plate is revalidated if its file, measured region, or comp changes. The gate passes at 72% overall with no hard veto outstanding (a missing region, a contradicted plate or text block, an SVG illustration, a clipped plate, invented ink block at any score); above the bar, the numeric readings become advisories printed with the pass, and the polish pass before responsive is where they get fixed: the gate also reads each text region's cap height, line count, weight, ink colour, and position against the comp, each chrome strip's height off its rule, and the frame for ink where the comp is calm (a kicker, an extra nav item, a divider), and says each miss as a number ("cap height 78px in the build, 103px in the comp"); those numbers are the edit. When it fails, open the region crops it lists, in order, before editing: a region scored `missing` needs its material, `contradicted` needs its structure re-derived from the spec box, `drift` is where size and spacing edits belong; repeated attempts do not clear unresolved blockers. After three failed attempts, present the first-viewport review from [component-review.md](component-review.md) instead of iterating. Once the user accepts a first viewport, the overall bar, the palette check and every numeric reading are advisories while the capture still matches it; a missing or unreferenced plate, an SVG illustration, an organic clip, a clipped plate, invented ink and failed rendered presence still block. When the capture drifts from what they accepted, restore it: that review is closed and is never requested again. This is where the run's ambition is won or lost, and a retry here costs minutes where a rebuild verdict at the finish costs the run.
22
+ 4. **sections.** Build the rest of the surface inside the spec's system: the same corner language, line weights, and palette, and nothing the comp never shows. Where the comp does not cover a region, it inherits the recorded system.
23
+ 5. **motion.** The signature interaction, reveals, and motion, orchestrated once rather than scattered.
24
+ 6. **responsive.** The other viewports, and the first viewport at common desktop widths (1280 to 1600), not only at the comp's exact size: fluid columns, no fixed-pixel grid that wraps a hundred pixels narrower, and sizes in proportion to the viewport rather than px floors, so nothing the comp's first viewport shows is pushed below it and an accepted first viewport still matches at desktop width. Capture `desktop.png` (1440 wide, full page) and `mobile.png` (390 wide) into `.impeccable/review/`; the gate diffs the desktop first viewport (1440 wide at the comp's aspect; a native capture renders its own) against the comp and refuses a first viewport that only held at the comp's width. When it fails, open the crops it lists, in order: a `displaced` region is present but pushed out of the first viewport, so restore it there by resizing what sits above it, not by moving it alone. After three failed attempts the gate names the route (the first-viewport review, or the user's decision once one is accepted); take it instead of iterating or recording `fix`. A comp'd surface that is mobile-first was comped portrait; the plates were produced for that frame.
@@ -0,0 +1,20 @@
1
+ # New visual work: create or replace the visual world
2
+
3
+ The branch of [new-work.md](new-work.md) step 3 for a new or replacement world. Steps 4 to 7 of new-work.md follow it.
4
+
5
+ ### Create or replace the visual world
6
+
7
+ 1. Name the product's unique mechanism in one sentence, the audience's real scene, its cultural home, and what this first surface must prove. Note the page this category always ships and its predictable opposite; both are the rut, kept out of the seven-candidate list. A brief that paints its own picture, a product name, a titled artifact, a governing metaphor, adds its literal reading to the rut: spend at most one candidate on it and derive the rest from elsewhere in the audience's world.
8
+ 2. From that cultural world, list seven concrete visual systems, artifacts, places, or rituals the audience knows by heart, each with one line on why it resonates and can carry the mechanism and one on how it looks (its ground and main colours, its type voices, the one signature that makes it recognisable), ordered by resonance. The audience's world includes its graphic and screen traditions, not only its physical objects: the notation, publications, identity programs, data graphics, and interfaces it reads daily. On an Operate or Read surface, the seven still come from anywhere in that world (its graphic traditions, places, rituals, and artifacts), never from the tools and instruments the audience operates: a terminal, a scope, or a control panel handed to a working screen comes back as a costume of that tool. A nameable abstract system (a school of poster, a documentation standard) is as concrete a candidate as any artifact. On a Persuade or Experience surface, the tools and instruments the audience operates count toward the rut: spend at most one candidate on them. Also ask what this thing would look like as a physical object and what its world looked like before the web. Near-duplicates count once. When more than three of the seven share one material family, the derivation stopped at the subject's most obvious artifact; dig until the list spans at least three families.
9
+ 3. Turn that material into complete directions: each joins a reusable visual world to a concrete first-surface experience.
10
+ 4. Run `.opencode/skills/impeccable/scripts/impeccable concept-seed --scope direction --mode <mode>` and follow what it prints. No substitute, no skip: on a new or replacement world, writing artifact code before this script has run and its assignment is acknowledged is a contract violation, whatever the harness, the model, or the time pressure; the roll is what keeps every run from converging on the category default. When DESIGN.md's frontmatter names a catalog `world:` and the user asked to replace that world, add `--replace-world` (keep it on every re-roll of the round): without it the roll stays settled on the old world and deals no others. A `--replace-world` run is a replacement world, never a seeded world's first build, so tell the documenter at finish that this world replaced the seeded one. The one exception is a direction the user or brief pins whole, naming its world and its first-surface experience both in words you can quote: steps 1 to 3 have nothing to derive and the assignment has nothing left to bind, so no roll and no decision page; confirm a pin only a brief file carries with the user, so the finish review can corroborate it, and record the pin under section 5. Anything less rolls: a pin that leaves a dimension open, a direction you completed from a partial brief, or a brief's picture or metaphor alone, which is step 1's rut material. The script assigns the direction to build and deals catalog challengers. Fuse each challenger before judging it: the challenger supplies the form and its system grammar, the product supplies every fact, clarity wins conflicts. Weigh fused challengers against the assigned direction on exactly two axes, audience identification and product clarity. Losing to strong grounded material is a valid outcome; beating a thin or tool-monoculture list is the point. Close with a verdict per challenger, decided before any borrowing: wins (beats the assigned direction on both axes; becomes the build candidate), competitive (holds one axis; stays a full alternate), or declined (loses both). A declined challenger is not spent: name the one discipline of its system the assigned direction lacks, and raise the assigned direction to match before presenting it. A donation transfers ambition and system discipline (a palette's total commitment, a grid's density courage, a form's structural honesty), never the challenger's clothes. A component treatment, such as a button's shadow or a display face, is clothes, not discipline; a lifted motif is a costume note, not a raise, and one world owns the page. Write each raise into the presented direction as its own line, named for its donor; a raise nobody can read did not happen.
11
+ 5. Present one direction, fully committed and already raised by the hand it beat, raises visible as named lines: world, first viewport, visitor path, signature interaction, cross-surface reach, honest risk. Route each challenger by verdict: winning and competitive challengers are full alternates with their QUALITY BAR cards and one-line case; declined challengers render demoted, compact and quiet, each carrying its verdict and what the direction kept from it, never full-size, never silently dropped, still adoptable on request. The verdict informs the user's choice, never pre-empts it; the demoted row is the hand's proof of judgment. A hand holds at most three full-card challengers: when the roll deals more, the three strongest join and the rest wait in the re-roll pool, noted in one line; dropping a challenger from the hand itself takes a named product-truth failure, disclosed. The hand's size follows the verdicts, never a number the user named: when the weighing yields fewer full cards than asked, deliver the honest hand, say in one line why it is smaller, and offer a re-roll to deal candidates that could earn full cards. A declined challenger is never promoted to fill a slot; a promoted card looks exactly like a competitive one, so the promotion leaves no trace. The standing exit does not count toward a requested number once the user has seen and rejected it; it stays present as the quiet door. Add one card for your own top-ranked grounded candidate when it is not the assigned direction, kicker IMPECCABLE’S PICK, same anatomy as every card, with an honest risk line naming its familiarity when true: the strongest grounded direction is often where most runs in this category land, and the user deciding that trade is the point of showing it. Familiar and effective is a legitimate destination, not a failure of nerve; the pick card and the standing exit serve it at two depths. One pick card, never two, never a ranked list: a lineup of your candidates hands selection back to a taste function and invites the safest card. The pick never takes the lead position; when the dice assign your top candidate there is no pick card, and the assigned card notes it topped your list. Add re-roll with an optional one-line steer, in three registers: plain (a fresh hand, same spread), safer (your remaining conventional grounded candidates plus the canon against named competitors), bolder (foreign forms only, at full commitment). The register is the user's steering on the familiar-to-bold axis, never yours to pre-select; when the answer carries one, re-run the seed with `--register <value>` and the next `--reroll` round, and follow what it prints. A user saying "bolder" or "safer" while a direction round is open means these registers, never the bolder or harden commands. The two channels share this structure and differ only in richness: cards and boards on the decision page, names and one-liners through the structured tool, whose option list carries the assigned direction, the pick, the winning and competitive challengers, and the standing exit last; declined challengers fold into the assigned option's description as their kept lines, so the raise survives the text channel.
12
+
13
+ The standing exit: every direction round offers one quiet, permanent alternative, the category standard, played straight. It is the user's door, never yours: never recommend it, never weigh it against the roll, never let it soften the dealt directions; the counterweights bind the unchosen default, not the chosen one. When the user takes it (the canon action, a safer-steer, or plain words asking for the familiar or competitor-like path), convention becomes the commitment: ask once for two or three products this should sit alongside, make their craft level the bar, and execute the canon at full fidelity, without irony or smuggled quirk. Record a standing preference as a brand commitment in PRODUCT.md. Re-roll eliminates every direction already shown, grounded and challenger alike; after two consecutive re-rolls, ask what quality is missing. Re-roll on your own only on named factual grounds, when the assigned direction cannot carry the product's truth or task; taste is never grounds. The user may re-roll freely, and a user- or brief-pinned direction beats the roll, always. A pin names the look itself, in the user's words or as a brand commitment the user made binding; a product the brief cites as a reference sets the craft bar, not the world, and an answer to an open steer that restates the brief pins nothing. Resolve collisions field by field: preserve every user- or brief-pinned constraint. In dimensions the brief leaves open, the assignment still binds through its topology, controls, state vocabulary, and ritual; when only its materials conflict with a pinned visual direction or PRODUCT.md brand commitment, translate that material expression and name the translation in the presented direction. A look mismatch is not grounds to re-roll. Present the decision visually: write an options payload with the assigned direction leading, its raised lines included; the pick card when one exists; the dealt challengers as alternates with their QUALITY BAR cards, verdicts, and kept lines; re-roll with its safer and bolder registers; steer; canon enabled; and `buildPath` carrying the recorded default with `toggle: true` whenever image generation exists (details in new-work.md, **The build path of a decision round**). A degraded roll with no challengers still uses the page, as a single text-only card with re-roll. Every option declares its identity: `kind` is `assigned`, `pick`, `challenger`, `grounded` (another of your own grounded directions, such as each card of a safer hand's lineup, any number of them), or `dealt` (a surface round's dealt structures other than the lead), and each challenger carries `catalogId`, the SOURCE ID concept-seed printed for its world, never the card's own id; `--start` and `--update` refuse a direction or surface payload without them, and the page reports the choice from them. Give every card the same anatomy: thesis, palette, materials, first viewport, honest risk, and the challengers' case lines (`--schema` prints the exact shape); the page renders identity from these fields, demotes declined challengers to their row on its own, and a challenger's catalog image rides as labeled inspiration, never the promise of the build. Author `canonCard` too: the category standard as one honest card, same anatomy; the page keeps it subordinate, and the counterweights still bind you. Run `.opencode/skills/impeccable/scripts/impeccable serve-question --start --payload <file>` (`--schema` first for the payload shape). It daemonizes, prints the page URL and a key, and exits; open that URL for the user, in-app browser first, then the system opener, then showing the URL. Collect the choice with `--wait --key <key>`, repeating while it exits 3; the ANSWER prints as JSON. An ANSWER of `{"optionId":"reroll"}` keeps the server alive and the page open on a loading hand: rerun concept-seed with the same `--scope` and `--mode` plus `--from <seed-key> --reroll <n>` (1 on the first re-roll, counting up), build the next payload, deliver it with `--update --key <same key> --payload <file>`, then return to `--wait` on that key. Never `--start` a second server or fall back to chat here: either strands the open tab on a hand that never arrives. Exit 4 means the page closed unanswered: re-present once through the structured question tool, and with no answer there either, proceed unattended with the assigned direction and state the assumptions. A harness that can leave a shell blocked in the background may run the script without `--start` and let it auto-open and block. A harness that cannot hold a blocking `--wait` (it detaches long-running commands without ever returning their output, or reaps a backgrounded child) takes the structured tool without starting the page and discloses the substitution in the first reply, so the tab is never left unanswered. A shell that hands back a still-running command as a session you can poll holds the wait: poll that session until it exits, and rerun `--wait` only after it exits without an answer. Never predict any other fallback: run the script, and only exit code 2 from starting it, or that wait check before starting, routes the decision to the structured tool; those are the fallback, never an error to retry. concept-seed closes every roll with this procedure, condensed, as a PRESENTATION block that names the recorded build path.
14
+
15
+ When image generation exists, every card also declares a `comp` path under `.impeccable/mocks/decision/`, the canon card included. Where the harness sandboxes its shell, start the page through the least-sandboxed command path it offers: a sandboxed shell cannot bind the board's port, and the first-attempt failure costs a retry every session. Serve the page first, then produce the comps; the page shimmer-waits per slot and the user may answer before they land. Load [visualize.md](visualize.md) before writing the first decision comp prompt, not at the comp round: each card's image is that direction's north-star comp at full fidelity under its comp discipline and the MODE RULES block concept-seed printed, and a prompt written before reading them misses every rule there: the requested surface as the real page, its first viewport and the start of the section below it, held like every comp to visualize.md's rule that a template skeleton stays the template whatever world paints it (your own pick included: a safe layout under a world skin is the template), a short prompt in visualize.md's shape, real product name and real content, no invented commercial claims, in that card's own palette, type character, and material world, committed all the way. Once a round declares comps it has not generated yet, `impeccable serve-question --start` (and `--update`, and a flip to comp) prints a `NEXT read <path>/visualize.md` line; read that file then, before the first prompt. `--wait` prints `COMP SIDECAR MISSING` for any landed decision comp with no prompt sidecar (the image's full file name plus `.json`: `a.png` gets `a.png.json`); write the missing sidecar before you continue. `COMP STALE` names a file an earlier round left at one of this hand's slots; regenerate it there. Generation takes the same time at any fidelity, so an unfinished draft pays comp cost for draft quality; fairness between cards is equal fidelity in each card's own grammar, one surface, one aspect, never shared unfinishedness. The frame's aspect is the surface's own: portrait at device viewport for a native app or mobile-first surface, landscape for desktop web; the decision page adapts to either, and a phone screen comped landscape is a broken frame, not a neutral default. Produce in reading order, the assigned card, then the pick, then the full-card hand, then canon, each file written with its prompt sidecar the moment it is done, so a re-roll's spend front-loads onto the cards read first; declined challengers get no comp, their catalog thumb is their face. With parallel subagents, fan out one agent per card: each spawn is the shipped asset producer with a single-comp packet, that card's fields, its world's card images when the NEXT line names them, PRODUCT.md, the shared frame, the path to visualize.md for its comp discipline, the COMPS section of the MODE RULES block copied verbatim (the subagent never sees the roll's output), and the card's declared path, up to four in flight. Regenerate inline any slot still empty when its agent returns; drop without ceremony any slot still empty when the user answers. No other supervision is owed. Without parallel subagents, generate in the main thread after serving, same order, and let the harness's own generation display carry the progress; the wait for the answer follows the last file. The chosen card's comp is not spent by the choice: comp-led, it enters the comp round as compositional option one; code-led, it returns at the finish review as the critique reference, what the image dared that the build did not. Unchosen comps stay in `.impeccable/mocks/decision/` as the round's spent hand; they carry no approval and imply none. With no image generation, cards carry their identity in palette chips and facts, and that page is complete, not a lesser version; the page then also demotes every challenger's catalog art to a labeled thumbnail on its own, because salience must encode the verdict, never the accident of which cards have images.
16
+ Catalog worlds are working systems, not mood references. When one survives, carry its palette and material, type and composition, topology, controls and state, and responsive rules into the product, as far as the surface's mode allows. How far a source that is itself an interface language may carry its grammar is the mode's call, in the MODE RULES block. Open the QUALITY BAR board and hero for the world you build the moment the choice lands, even if you viewed another card earlier; the ANSWER line names the chosen card's images (when the harness only reads files or runs sandboxed, download them into the workspace and open the relative path; sandboxed viewers reject absolute paths outside it). They set the craft level the build must reach, a rendered reference's finish, commitment, and art direction, never the composition; your surface serves this product.
17
+
18
+ Every direction the roll can land on must already be viable: every relationship and claim it visualizes true, a real palette and component family, a distinctive composition with one product-specific experience, workable at full-surface scale within the available assets, tools, and performance budget. A candidate that fails on truth is replaced before the roll, never rescued by it. Truth binds claims, not demonstrations: in greenfield work, author whatever illustrative material the concept needs at full fidelity, label it synthetic wherever a visitor could mistake it for the real thing, and hand the user the list of what to replace with real material. What stays uninventable are commercial and factual claims: prices, customers, benchmarks, endpoints, capabilities the product does not have. Refusing a bold direction because its demonstration data does not exist yet is the timidity reflex wearing honesty's clothes.
19
+
20
+ What the opening must do, and how far the world may reach into the page, depends on the surface's mode. `concept-seed --mode <mode>` prints that mode's rules as a MODE RULES block, DIRECTIONS and COMPS; they govern every direction, card, and comp for this surface, and where they conflict with shared guidance they win. A session that reaches directions or comps without concept-seed having run (a direction pinned whole, step 4) reads the mode's file instead: [mode-persuade.md](mode-persuade.md) for Persuade and Experience, [mode-operate.md](mode-operate.md), or [mode-read.md](mode-read.md).