@thanhnguyxn/pixelcraft 0.0.0-stage → 0.1.0

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 (297) hide show
  1. package/.agents/plugins/marketplace.json +20 -0
  2. package/.claude-plugin/marketplace.json +20 -0
  3. package/.claude-plugin/plugin.json +11 -0
  4. package/LICENSE +21 -0
  5. package/README.md +407 -2
  6. package/assets/README.md +28 -0
  7. package/assets/pixelcraft-logo-512.png +0 -0
  8. package/bin/pixelcraft.mjs +444 -0
  9. package/docs/ARCHITECTURE.md +102 -0
  10. package/docs/DESIGN-RATIONALE.md +143 -0
  11. package/evals/README.md +27 -0
  12. package/evals/fixtures/README.md +36 -0
  13. package/evals/fixtures/direction-prototype-complexity.json +29 -0
  14. package/evals/fixtures/finish-gate-anti-slop.json +30 -0
  15. package/evals/fixtures/forms-accessibility-negative.json +29 -0
  16. package/evals/fixtures/handoff-fidelity-tolerance.json +29 -0
  17. package/evals/fixtures/plan-brownfield-evidence.json +28 -0
  18. package/evals/fixtures/visual-qa-task-evidence.json +29 -0
  19. package/evals/fixtures/workflow-checkpoints.json +30 -0
  20. package/evals/pixelcraft-accessibility.md +57 -0
  21. package/evals/pixelcraft-brandkit.md +58 -0
  22. package/evals/pixelcraft-chat-ui.md +55 -0
  23. package/evals/pixelcraft-constrained.md +55 -0
  24. package/evals/pixelcraft-craft.md +60 -0
  25. package/evals/pixelcraft-data-apps.md +55 -0
  26. package/evals/pixelcraft-dataviz.md +59 -0
  27. package/evals/pixelcraft-desktop.md +55 -0
  28. package/evals/pixelcraft-direction.md +60 -0
  29. package/evals/pixelcraft-document.md +55 -0
  30. package/evals/pixelcraft-email.md +55 -0
  31. package/evals/pixelcraft-extensions.md +55 -0
  32. package/evals/pixelcraft-game-ui.md +59 -0
  33. package/evals/pixelcraft-handoff.md +57 -0
  34. package/evals/pixelcraft-media.md +55 -0
  35. package/evals/pixelcraft-mobile.md +59 -0
  36. package/evals/pixelcraft-patterns.md +57 -0
  37. package/evals/pixelcraft-plan.md +65 -0
  38. package/evals/pixelcraft-review.md +63 -0
  39. package/evals/pixelcraft-spatial.md +55 -0
  40. package/evals/pixelcraft-tokens.md +57 -0
  41. package/evals/pixelcraft-tui.md +55 -0
  42. package/evals/pixelcraft-ux.md +59 -0
  43. package/evals/pixelcraft-visual-qa.md +80 -0
  44. package/evals/pixelcraft-web.md +71 -0
  45. package/evals/pixelcraft.md +70 -0
  46. package/gemini-extension.json +5 -0
  47. package/install.ps1 +295 -0
  48. package/install.sh +437 -0
  49. package/package.json +63 -4
  50. package/plugin.json +24 -0
  51. package/scripts/build-adapters.mjs +290 -0
  52. package/scripts/build-release-archives.mjs +61 -0
  53. package/scripts/build-skill-zips.mjs +94 -0
  54. package/scripts/test-build-adapters.mjs +48 -0
  55. package/scripts/test-distribution.mjs +124 -0
  56. package/scripts/test-export-tokens.mjs +105 -0
  57. package/scripts/test-finish-gate.mjs +148 -0
  58. package/scripts/test-installers.mjs +67 -0
  59. package/scripts/test-release-archives.mjs +42 -0
  60. package/scripts/test-shoot.mjs +65 -0
  61. package/scripts/test-slop-scan.mjs +29 -0
  62. package/scripts/test-style-inventory.mjs +211 -0
  63. package/scripts/test-validate-skills.mjs +117 -0
  64. package/scripts/validate-skills.mjs +512 -0
  65. package/skills/pixelcraft/SKILL.md +135 -0
  66. package/skills/pixelcraft/references/design-brief.md +75 -0
  67. package/skills/pixelcraft/references/floor.md +73 -0
  68. package/skills/pixelcraft/references/report-template.md +35 -0
  69. package/skills/pixelcraft/references/stack-detection.md +155 -0
  70. package/skills/pixelcraft/references/surface-acceptance.md +40 -0
  71. package/skills/pixelcraft/references/workflow-checkpoints.md +29 -0
  72. package/skills/pixelcraft-accessibility/SKILL.md +33 -0
  73. package/skills/pixelcraft-accessibility/references/apg-patterns.md +51 -0
  74. package/skills/pixelcraft-accessibility/references/platforms.md +58 -0
  75. package/skills/pixelcraft-accessibility/references/verification.md +59 -0
  76. package/skills/pixelcraft-accessibility/references/wcag22-checks.md +66 -0
  77. package/skills/pixelcraft-brandkit/SKILL.md +115 -0
  78. package/skills/pixelcraft-brandkit/references/asset-pipeline.md +125 -0
  79. package/skills/pixelcraft-brandkit/references/brand-governance.md +80 -0
  80. package/skills/pixelcraft-brandkit/references/layouts.md +88 -0
  81. package/skills/pixelcraft-brandkit/references/logo-concepting.md +83 -0
  82. package/skills/pixelcraft-brandkit/references/logo-methods.md +98 -0
  83. package/skills/pixelcraft-brandkit/references/pixel-art-logos.md +82 -0
  84. package/skills/pixelcraft-brandkit/references/prompt-template.md +85 -0
  85. package/skills/pixelcraft-brandkit/references/qa-checklist.md +88 -0
  86. package/skills/pixelcraft-brandkit/references/visual-modes.md +123 -0
  87. package/skills/pixelcraft-chat-ui/SKILL.md +53 -0
  88. package/skills/pixelcraft-chat-ui/references/conversation-design.md +78 -0
  89. package/skills/pixelcraft-chat-ui/references/mobile-business-platforms.md +87 -0
  90. package/skills/pixelcraft-chat-ui/references/slack-discord.md +96 -0
  91. package/skills/pixelcraft-constrained/SKILL.md +51 -0
  92. package/skills/pixelcraft-constrained/references/specialized-hardware.md +66 -0
  93. package/skills/pixelcraft-constrained/references/tv-wearables.md +84 -0
  94. package/skills/pixelcraft-constrained/references/voice-ui.md +63 -0
  95. package/skills/pixelcraft-craft/SKILL.md +44 -0
  96. package/skills/pixelcraft-craft/references/color.md +69 -0
  97. package/skills/pixelcraft-craft/references/imagery-icons.md +37 -0
  98. package/skills/pixelcraft-craft/references/layout-quality.md +65 -0
  99. package/skills/pixelcraft-craft/references/layout.md +41 -0
  100. package/skills/pixelcraft-craft/references/motion.md +76 -0
  101. package/skills/pixelcraft-craft/references/typography.md +71 -0
  102. package/skills/pixelcraft-data-apps/SKILL.md +67 -0
  103. package/skills/pixelcraft-data-apps/references/dash.md +53 -0
  104. package/skills/pixelcraft-data-apps/references/evidence.md +75 -0
  105. package/skills/pixelcraft-data-apps/references/gradio.md +65 -0
  106. package/skills/pixelcraft-data-apps/references/julia-genie.md +54 -0
  107. package/skills/pixelcraft-data-apps/references/jupyter-widgets.md +53 -0
  108. package/skills/pixelcraft-data-apps/references/nicegui.md +63 -0
  109. package/skills/pixelcraft-data-apps/references/observable-framework.md +67 -0
  110. package/skills/pixelcraft-data-apps/references/panel.md +53 -0
  111. package/skills/pixelcraft-data-apps/references/r-shiny.md +54 -0
  112. package/skills/pixelcraft-data-apps/references/reflex.md +62 -0
  113. package/skills/pixelcraft-data-apps/references/shiny.md +53 -0
  114. package/skills/pixelcraft-data-apps/references/streamlit.md +65 -0
  115. package/skills/pixelcraft-dataviz/SKILL.md +63 -0
  116. package/skills/pixelcraft-dataviz/references/chart-choice.md +55 -0
  117. package/skills/pixelcraft-dataviz/references/color-accessibility.md +112 -0
  118. package/skills/pixelcraft-dataviz/references/encoding-tables-dashboards.md +97 -0
  119. package/skills/pixelcraft-dataviz/references/libraries.md +57 -0
  120. package/skills/pixelcraft-dataviz/references/realtime-graphs-maps-scale.md +99 -0
  121. package/skills/pixelcraft-desktop/SKILL.md +71 -0
  122. package/skills/pixelcraft-desktop/references/appkit.md +58 -0
  123. package/skills/pixelcraft-desktop/references/avalonia.md +59 -0
  124. package/skills/pixelcraft-desktop/references/cpp-gui.md +52 -0
  125. package/skills/pixelcraft-desktop/references/electron.md +54 -0
  126. package/skills/pixelcraft-desktop/references/go-gui.md +54 -0
  127. package/skills/pixelcraft-desktop/references/gtk.md +54 -0
  128. package/skills/pixelcraft-desktop/references/javafx-swing.md +52 -0
  129. package/skills/pixelcraft-desktop/references/qt-pyside-qml.md +61 -0
  130. package/skills/pixelcraft-desktop/references/rust-gui.md +65 -0
  131. package/skills/pixelcraft-desktop/references/tauri.md +54 -0
  132. package/skills/pixelcraft-desktop/references/uno-platform.md +52 -0
  133. package/skills/pixelcraft-desktop/references/winui-wpf.md +58 -0
  134. package/skills/pixelcraft-desktop/references/working-context.md +5 -0
  135. package/skills/pixelcraft-direction/SKILL.md +154 -0
  136. package/skills/pixelcraft-direction/references/composition-library.md +84 -0
  137. package/skills/pixelcraft-direction/references/direction-card.md +54 -0
  138. package/skills/pixelcraft-direction/references/direction-scoring.md +72 -0
  139. package/skills/pixelcraft-direction/references/movements.md +68 -0
  140. package/skills/pixelcraft-direction/references/repetition-history.md +75 -0
  141. package/skills/pixelcraft-direction/references/slop-fingerprints.md +58 -0
  142. package/skills/pixelcraft-direction/references/wildcards.md +47 -0
  143. package/skills/pixelcraft-document/SKILL.md +54 -0
  144. package/skills/pixelcraft-document/references/archetypes.md +83 -0
  145. package/skills/pixelcraft-document/references/pdf-tools.md +154 -0
  146. package/skills/pixelcraft-document/references/print-css.md +134 -0
  147. package/skills/pixelcraft-document/references/slides.md +102 -0
  148. package/skills/pixelcraft-email/SKILL.md +58 -0
  149. package/skills/pixelcraft-email/references/client-quirks.md +45 -0
  150. package/skills/pixelcraft-email/references/html-tables.md +53 -0
  151. package/skills/pixelcraft-email/references/mjml.md +52 -0
  152. package/skills/pixelcraft-email/references/react-email.md +53 -0
  153. package/skills/pixelcraft-extensions/SKILL.md +51 -0
  154. package/skills/pixelcraft-extensions/references/browser-extensions.md +31 -0
  155. package/skills/pixelcraft-extensions/references/figma-office.md +23 -0
  156. package/skills/pixelcraft-extensions/references/raycast.md +19 -0
  157. package/skills/pixelcraft-extensions/references/vscode-webviews.md +26 -0
  158. package/skills/pixelcraft-game-ui/SKILL.md +61 -0
  159. package/skills/pixelcraft-game-ui/references/bevy.md +52 -0
  160. package/skills/pixelcraft-game-ui/references/godot.md +57 -0
  161. package/skills/pixelcraft-game-ui/references/hud-principles.md +38 -0
  162. package/skills/pixelcraft-game-ui/references/love2d.md +51 -0
  163. package/skills/pixelcraft-game-ui/references/monogame.md +52 -0
  164. package/skills/pixelcraft-game-ui/references/unity-ui-toolkit.md +65 -0
  165. package/skills/pixelcraft-game-ui/references/unreal-umg.md +53 -0
  166. package/skills/pixelcraft-handoff/SKILL.md +49 -0
  167. package/skills/pixelcraft-handoff/references/design-translation.md +104 -0
  168. package/skills/pixelcraft-handoff/references/fidelity-tolerance.md +78 -0
  169. package/skills/pixelcraft-media/SKILL.md +52 -0
  170. package/skills/pixelcraft-media/references/banners-video.md +112 -0
  171. package/skills/pixelcraft-media/references/og-generation.md +107 -0
  172. package/skills/pixelcraft-media/references/social-cards.md +72 -0
  173. package/skills/pixelcraft-mobile/SKILL.md +69 -0
  174. package/skills/pixelcraft-mobile/references/dotnet-maui.md +63 -0
  175. package/skills/pixelcraft-mobile/references/flet.md +53 -0
  176. package/skills/pixelcraft-mobile/references/flutter.md +69 -0
  177. package/skills/pixelcraft-mobile/references/ionic-capacitor.md +65 -0
  178. package/skills/pixelcraft-mobile/references/jetpack-compose.md +61 -0
  179. package/skills/pixelcraft-mobile/references/kivy.md +59 -0
  180. package/skills/pixelcraft-mobile/references/kotlin-multiplatform.md +60 -0
  181. package/skills/pixelcraft-mobile/references/react-native-expo.md +71 -0
  182. package/skills/pixelcraft-mobile/references/swiftui.md +70 -0
  183. package/skills/pixelcraft-mobile/references/task-state-composition.md +5 -0
  184. package/skills/pixelcraft-mobile/references/uikit.md +58 -0
  185. package/skills/pixelcraft-patterns/SKILL.md +58 -0
  186. package/skills/pixelcraft-patterns/references/auth-onboarding.md +25 -0
  187. package/skills/pixelcraft-patterns/references/commerce.md +28 -0
  188. package/skills/pixelcraft-patterns/references/communication.md +26 -0
  189. package/skills/pixelcraft-patterns/references/creative-tools.md +29 -0
  190. package/skills/pixelcraft-patterns/references/dashboard-admin.md +31 -0
  191. package/skills/pixelcraft-patterns/references/marketing.md +32 -0
  192. package/skills/pixelcraft-patterns/references/pattern-selection.md +74 -0
  193. package/skills/pixelcraft-patterns/references/search-filtering.md +42 -0
  194. package/skills/pixelcraft-patterns/references/settings.md +23 -0
  195. package/skills/pixelcraft-patterns/references/tables-crud.md +43 -0
  196. package/skills/pixelcraft-plan/SKILL.md +67 -0
  197. package/skills/pixelcraft-plan/references/design-input.md +69 -0
  198. package/skills/pixelcraft-plan/references/plan-template.md +99 -0
  199. package/skills/pixelcraft-plan/references/repo-discovery.md +42 -0
  200. package/skills/pixelcraft-plan/references/stack-freshness.md +50 -0
  201. package/skills/pixelcraft-plan/references/stack-selection.md +42 -0
  202. package/skills/pixelcraft-review/SKILL.md +64 -0
  203. package/skills/pixelcraft-review/references/audit-report.md +50 -0
  204. package/skills/pixelcraft-review/references/critique-protocol.md +89 -0
  205. package/skills/pixelcraft-review/references/heuristics.md +18 -0
  206. package/skills/pixelcraft-review/references/personas.md +26 -0
  207. package/skills/pixelcraft-review/references/polish.md +38 -0
  208. package/skills/pixelcraft-review/scripts/fixtures/brand-critique-waivers.json +14 -0
  209. package/skills/pixelcraft-review/scripts/fixtures/brand-critique.css +18 -0
  210. package/skills/pixelcraft-review/scripts/fixtures/clean.html +43 -0
  211. package/skills/pixelcraft-review/scripts/fixtures/focus-after-block.css +4 -0
  212. package/skills/pixelcraft-review/scripts/fixtures/focus-at-rules.css +17 -0
  213. package/skills/pixelcraft-review/scripts/fixtures/focus-comments.css +10 -0
  214. package/skills/pixelcraft-review/scripts/fixtures/focus-html-quote-leak.html +12 -0
  215. package/skills/pixelcraft-review/scripts/fixtures/focus-invalid-replacements.css +27 -0
  216. package/skills/pixelcraft-review/scripts/fixtures/focus-nested-rules.css +19 -0
  217. package/skills/pixelcraft-review/scripts/fixtures/focus-not-visible-skip.css +8 -0
  218. package/skills/pixelcraft-review/scripts/fixtures/focus-outline-shorthands.css +11 -0
  219. package/skills/pixelcraft-review/scripts/fixtures/focus-unknown-and-border.css +15 -0
  220. package/skills/pixelcraft-review/scripts/fixtures/focus-unknown-last-wins.css +19 -0
  221. package/skills/pixelcraft-review/scripts/fixtures/focus-valid-replacements-extended.css +29 -0
  222. package/skills/pixelcraft-review/scripts/fixtures/focus-visible-no-replacement.css +3 -0
  223. package/skills/pixelcraft-review/scripts/fixtures/focus-visible-valid-replacements.css +9 -0
  224. package/skills/pixelcraft-review/scripts/fixtures/slop.html +28 -0
  225. package/skills/pixelcraft-review/scripts/slop-scan.mjs +586 -0
  226. package/skills/pixelcraft-spatial/SKILL.md +52 -0
  227. package/skills/pixelcraft-spatial/references/comfort-accessibility.md +98 -0
  228. package/skills/pixelcraft-spatial/references/platforms.md +77 -0
  229. package/skills/pixelcraft-tokens/SKILL.md +56 -0
  230. package/skills/pixelcraft-tokens/assets/tokens.example.json +71 -0
  231. package/skills/pixelcraft-tokens/assets/tokens.modes.example.json +47 -0
  232. package/skills/pixelcraft-tokens/references/adoption.md +55 -0
  233. package/skills/pixelcraft-tokens/references/format.md +54 -0
  234. package/skills/pixelcraft-tokens/references/governance.md +80 -0
  235. package/skills/pixelcraft-tokens/references/state-tokens.md +62 -0
  236. package/skills/pixelcraft-tokens/references/theme-presets.md +94 -0
  237. package/skills/pixelcraft-tokens/scripts/export-tokens.mjs +285 -0
  238. package/skills/pixelcraft-tui/SKILL.md +60 -0
  239. package/skills/pixelcraft-tui/references/bubbletea-lipgloss.md +60 -0
  240. package/skills/pixelcraft-tui/references/ink.md +60 -0
  241. package/skills/pixelcraft-tui/references/ratatui.md +62 -0
  242. package/skills/pixelcraft-tui/references/rich.md +62 -0
  243. package/skills/pixelcraft-tui/references/textual.md +67 -0
  244. package/skills/pixelcraft-ux/SKILL.md +46 -0
  245. package/skills/pixelcraft-ux/references/cognitive-walkthrough.md +70 -0
  246. package/skills/pixelcraft-ux/references/feedback-performance.md +30 -0
  247. package/skills/pixelcraft-ux/references/flows-ia.md +44 -0
  248. package/skills/pixelcraft-ux/references/forms.md +97 -0
  249. package/skills/pixelcraft-ux/references/i18n.md +183 -0
  250. package/skills/pixelcraft-ux/references/laws.md +18 -0
  251. package/skills/pixelcraft-ux/references/locale-test-matrix.md +60 -0
  252. package/skills/pixelcraft-ux/references/state-matrix.md +39 -0
  253. package/skills/pixelcraft-ux/references/usability-testing.md +84 -0
  254. package/skills/pixelcraft-ux/references/ux-writing.md +43 -0
  255. package/skills/pixelcraft-visual-qa/SKILL.md +82 -0
  256. package/skills/pixelcraft-visual-qa/references/baseline-governance.md +70 -0
  257. package/skills/pixelcraft-visual-qa/references/capture-desktop-game.md +38 -0
  258. package/skills/pixelcraft-visual-qa/references/capture-email.md +34 -0
  259. package/skills/pixelcraft-visual-qa/references/capture-mobile.md +35 -0
  260. package/skills/pixelcraft-visual-qa/references/capture-terminal.md +31 -0
  261. package/skills/pixelcraft-visual-qa/references/critique-rubric.md +71 -0
  262. package/skills/pixelcraft-visual-qa/references/finish-gate.md +35 -0
  263. package/skills/pixelcraft-visual-qa/references/measured-craft.md +30 -0
  264. package/skills/pixelcraft-visual-qa/references/performance-budgets.md +65 -0
  265. package/skills/pixelcraft-visual-qa/references/task-verification.md +81 -0
  266. package/skills/pixelcraft-visual-qa/scripts/finish-gate.mjs +135 -0
  267. package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-aria-modal.html +19 -0
  268. package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-audit.html +34 -0
  269. package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-modal.html +17 -0
  270. package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory-deferred.js +1 -0
  271. package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory-edge.html +52 -0
  272. package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory.html +80 -0
  273. package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory.js +8 -0
  274. package/skills/pixelcraft-visual-qa/scripts/shoot.mjs +513 -0
  275. package/skills/pixelcraft-visual-qa/scripts/style-inventory.mjs +1154 -0
  276. package/skills/pixelcraft-web/SKILL.md +76 -0
  277. package/skills/pixelcraft-web/references/adaptive-layout.md +25 -0
  278. package/skills/pixelcraft-web/references/angular.md +61 -0
  279. package/skills/pixelcraft-web/references/astro.md +62 -0
  280. package/skills/pixelcraft-web/references/clojurescript.md +53 -0
  281. package/skills/pixelcraft-web/references/elm.md +53 -0
  282. package/skills/pixelcraft-web/references/fsharp-fable.md +53 -0
  283. package/skills/pixelcraft-web/references/html-css.md +88 -0
  284. package/skills/pixelcraft-web/references/htmx-alpine.md +53 -0
  285. package/skills/pixelcraft-web/references/java-web.md +52 -0
  286. package/skills/pixelcraft-web/references/kotlin-web.md +53 -0
  287. package/skills/pixelcraft-web/references/leptos-yew.md +54 -0
  288. package/skills/pixelcraft-web/references/lit-web-components.md +61 -0
  289. package/skills/pixelcraft-web/references/pwa.md +225 -0
  290. package/skills/pixelcraft-web/references/qwik.md +54 -0
  291. package/skills/pixelcraft-web/references/react-next.md +69 -0
  292. package/skills/pixelcraft-web/references/scala-laminar.md +53 -0
  293. package/skills/pixelcraft-web/references/server-rendered.md +71 -0
  294. package/skills/pixelcraft-web/references/solid.md +60 -0
  295. package/skills/pixelcraft-web/references/svelte.md +61 -0
  296. package/skills/pixelcraft-web/references/tailwind.md +73 -0
  297. package/skills/pixelcraft-web/references/vue-nuxt.md +62 -0
@@ -0,0 +1,35 @@
1
+ # Finish gate for UI flows
2
+
3
+ Use this gate before reporting a new or materially changed UI flow as complete. For a small visual change outside such a flow, verify the affected surface and report the narrower scope. Do not turn a scoped review into a pass for the application.
4
+
5
+ 1. **Define scope before verification.** Record route/window, target revision or build, fixture, primary task, expected success and relevant states. Use a disposable/sandboxed fixture for external or destructive effects as described in [task verification](task-verification.md).
6
+ 2. **Collect evidence.** For responsive web, inspect pixels at 390, 768 and 1440 CSS px; add 320 for reflow-sensitive work (e.g. navigation, forms, dense text or a supported 320 px viewport). Add landscape and short-height cases and each distinct applicable class from the plan. Record width × height, input modality and what changed (navigation, density, controls); exercise the task and at least one relevant resize/rotation transition without losing focus, selection or draft input. Execute the task with a real keyboard and inspect focus visibility and order. For other surfaces use representative sizes and actual input/focus conventions. Capture error, empty, loading, theme and reduced-motion cases when applicable. Use the actual app or a labeled emulation.
7
+ 3. **Assert an outcome.** A checked end state must prove a task-specific change (e.g. saved row survives reload or invalid input remains while the error is announced), not just page load, a clean console or a screenshot. Use an executed assertion with test output/trace, or an observed live interaction recorded with its result and artifact. A mock response or demo controls prove only the labeled fixture scope; a stub never proves the production action. `shoot.mjs` is layout evidence, not an outcome test.
8
+ 4. **Record defects and repair.** Put confirmed deterministic findings under `checks` with stable IDs (e.g. `checkout-submit-clipped`). Inspect the rendered lead before claiming failure. Normally use one round; for reproducible, measurable defects use up to three total rounds, preserving before/after artifacts and rerun results. Never shrink coverage, hide content/overflow, weaken assertions, change the fixture, or update a baseline just to go green. A taste observation belongs in critique, not the gate. Do not restart the round count for the same scoped flow.
9
+ 5. **Report.** Run `node scripts/finish-gate.mjs path/to/evidence.json`. Report `PASS`, `FAIL`, `OPEN` (confirmed failure remains after round three), or `NOT CHECKED` with remaining failures, unchecked scope, non-applicability reasons and supporting artifacts. Missing required evidence remains visible even when a confirmed failure sets the status. A waiver cannot satisfy a required check; if the user chooses to ship anyway, report the same unresolved status and their decision.
10
+
11
+ ## Evidence manifest
12
+
13
+ Store the manifest beside redacted evidence files. The command validates scope and record completeness, not the truth or contents of artifacts; a reviewer must inspect them. Use one manifest per primary flow; keep the required coverage fixed across rounds.
14
+
15
+ `schemaVersion` is `1`. Set `surface` to `responsive-web` or `other`. Supply nonempty `target`, `revision`, `task`, and `fixture` (include runtime, locale, and data/emulation context as appropriate). Set `applicability` with `error`, `empty`, `loading`, `theme`, `reduced-motion`, and (web only) `reflow-320`. Each is `true` or `{"applies":false,"reason":"specific product reason"}`. Tool unavailability is not a reason to mark a state inapplicable.
16
+
17
+ In `checks`, include `outcome`, `input`, and `width-390`, `width-768`, `width-1440` (web) or `layout` (other), plus every applicable ID above. Use objects like:
18
+
19
+ ```json
20
+ {
21
+ "result": "pass",
22
+ "label": "rendered",
23
+ "method": "Playwright, invite with test mailbox, reload list",
24
+ "expected": "Pending invite persists after reload",
25
+ "observed": "test@example.test shown once with Pending state after reload",
26
+ "artifact": "invite-trace.zip",
27
+ "assertion": "expect(inviteRow).toHaveCount(1) after reload"
28
+ }
29
+ ```
30
+
31
+ - `outcome` also requires `assertion`; `input` requires `focus` (what visibly focused; order/restoration) and web `modality: "keyboard"`. Width checks require numeric `width` matching `reflow-320`, `width-<px>`, or a width-scoped defect ID such as `width-390-submit`. For a state or theme, record the states/modes actually exercised in `method` and expected/observed results.
32
+ - For responsive web, declare `layoutMatrix` with at least `layout-landscape` and `layout-short-height`. Add a `layout-<class>` entry for each distinct planned case not covered by a base width check. Use `{"width":844,"height":390}` (CSS px) or `{"applies":false,"reason":"specific product reason"}`. Each applicable entry requires a matching `checks` ID with the same numeric `width` and `height`, the input/transition exercised in `method`, and observed task/control evidence. Short-height checks use a viewport below 600 CSS px tall and a separate artifact from `width-1440`; this is a verification threshold, not a layout breakpoint. A blocked device or tool is `not-checked`, not a product exclusion. Update older responsive evidence manifests with these rows before reporting `PASS`.
33
+ - Use `result: "fail"` for confirmed failures. For a blocked or unrun check use `result: "not-checked"` and a `reason`; never label static evidence rendered.
34
+ - `artifact` is a nonempty local file path relative to the manifest directory (screenshot, trace or result log as appropriate). Do not paste secrets or rely on externally mutable debug output.
35
+ - `rounds` starts as `[]`. Append one object per actual repair-and-retest cycle with `failure`, `reproduction`, `change`, `rerun`, and distinct `before`/`after` evidence paths. Every `failure` names a current check ID whose rendered result is required even after the defect passes. Keep the prior failure evidence.
@@ -0,0 +1,30 @@
1
+ # Measured craft by surface
2
+
3
+ State the craft claim and expected result before capturing. Compare the same fixture, revision pair, input sequence, theme, locale, device/client/renderer version, and geometry. Record changes in cache, throttling, data, capture timing or OS if you cannot hold them fixed. Store comparable artifacts and inspect the path that matters; do not reward a prettier screenshot when task success regresses.
4
+
5
+ | Surface | Evidence to capture instead of a generic browser score |
6
+ |---|---|
7
+ | Responsive web | Identical 390/768/1440 captures and browser inventory for changed flows; add 320 when reflow-sensitive. Compare type, palette, estimated geometry, motion signals, initial/deferred requests and vitals; execute the actual interaction and inspect reduced-motion separately. |
8
+ | Mobile / constrained | Device or clearly labeled emulator at supported scaling and insets; capture interrupted/resumed task, first usable state and reduced/disabled animation. Include physical distance or input limits when relevant. |
9
+ | Desktop / extensions | Host window at minimum size and target scale, native theme and keyboard state; capture action and restoration, plus startup or input latency if that is the claim. |
10
+ | Game / spatial | Target controller and viewing distance; capture a sequence against changing scene backgrounds or object depths, focus/motion options and frame timing under load. No device means mark device claims unchecked. |
11
+ | TUI | Terminal recording or snapshots with exact rows/columns, locale and terminal capability; measure resize recovery, focus, prompt feedback and non-color fallback. |
12
+ | Email / document / media | Actual sent/exported artifact in supported client, PDF reader, print, projector or thumbnail renderer. Inspect images off, page breaks, plain text/reading order, final crop or compressed playback as applicable. |
13
+ | Chat / data / dataviz | Capture action acknowledgement, failure/empty/expired response, filtering or stale-data transition; inspect comparable scales, text alternatives and client-specific fallbacks. |
14
+
15
+ ## Browser before/after
16
+
17
+ Use the existing inventory for a changed view where it can answer a question. Use the same target, fixture and settings for both revisions:
18
+
19
+ ```sh
20
+ node scripts/style-inventory.mjs http://localhost:3000 --breakpoints 390x844,768x1024,1440x900 --out before-inventory.json
21
+ # Apply the scoped change and run the same fixture again:
22
+ node scripts/style-inventory.mjs http://localhost:3000 --breakpoints 390x844,768x1024,1440x900 --out after-inventory.json
23
+ node scripts/shoot.mjs http://localhost:3000 --breakpoints 390x844,768x1024,1440x900 --out visual-qa
24
+ ```
25
+
26
+ The inventory uses optional Playwright/Chromium and CDP. Computed font families are not per-glyph proof; the palette omits many image effects; geometric whitespace is an estimate; script names and media-query rules are not proof of active or reduced animation. Payload is specific to cache and load timing. Use a Chrome DevTools Performance or Network trace when you need to attribute a web regression; use platform-native profiling for non-browser claims. Do not turn gallery medians into targets. Label a missing renderer, fixture or untested motion path `not-checked`.
27
+
28
+ For a canvas-, video-, or image-led first screen, label the art layer separately before using DOM color, whitespace, font counts, or content width to critique it. A full-bleed plane can drive geometric whitespace to zero while the image itself has negative space; an intro or consent overlay can dominate the sampled text. Inspect paired captures with region names and capture times, and compare equivalent scene states rather than folding dissimilar captures into one range.
29
+
30
+ When claiming a lighter static or compact alternative, start fresh default and reduced-motion contexts at the same viewport, select the setting before navigation, and replay the same entry task. Check requests and initialization for the specific scene, not just total bytes or CSS rules. Repeat at the supported landscape or short-height viewport if the shell recomposes. Distinguish an unneeded scene that never initializes from a needed scene that loads later on explicit request.
@@ -0,0 +1,65 @@
1
+ # Performance budgets
2
+
3
+ Budgets are user-experience constraints, not score chasing. Set them during planning and measure in the real runtime whenever possible.
4
+
5
+ ## Core Web Vitals
6
+
7
+ | Metric | Good threshold | What it represents |
8
+ |---|---:|---|
9
+ | LCP | ≤ 2.5 s at p75 | largest contentful paint / perceived loading |
10
+ | INP | ≤ 200 ms at p75 | interaction responsiveness |
11
+ | CLS | ≤ 0.1 at p75 | visual stability |
12
+
13
+ Use field data when available. Lighthouse/WebPageTest/local tracing are lab evidence and must be labeled as such. Do not optimize hidden test widgets at the expense of the real page.
14
+
15
+ ## Interaction and frame budgets
16
+
17
+ | Surface | Budget |
18
+ |---|---|
19
+ | pointer/keyboard acknowledgment | visible feedback within 100 ms; preferably immediate |
20
+ | ordinary 60 Hz frame | 16.7 ms total frame budget; leave main-thread headroom |
21
+ | high-refresh/game frame | 11.1 ms at 90 Hz, 8.3 ms at 120 Hz; engine/platform dependent |
22
+ | scrolling/dragging | no long task blocking input; virtualization for large lists |
23
+ | startup | meaningful skeleton/first useful surface before decorative assets |
24
+
25
+ ## Indicative web asset budgets
26
+
27
+ Adjust by mode and document the choice.
28
+
29
+ | Mode | Initial compressed JS+CSS | Notes |
30
+ |---|---:|---|
31
+ | content/read | ≤ 150–250 KB | prioritize fonts/images and stable measure |
32
+ | operate/dashboard | ≤ 250–450 KB | route-level splitting; avoid chart/map cost on unrelated routes |
33
+ | persuade/experience | ≤ 350–700 KB | media-heavy work needs explicit loading/adaptive quality |
34
+ | embedded/widget | ≤ 100–200 KB | host page pays additional cost |
35
+
36
+ Fonts: subset and limit families/weights; use `font-display` appropriate to content. Images: responsive sizes, modern formats when supported, explicit dimensions to prevent CLS. Video/3D: adaptive quality, poster/loading state, reduced-motion/data path.
37
+
38
+ ## Measurement commands and signals
39
+
40
+ - Browser: Performance panel, Lighthouse/WebPageTest, `performance.measure`, long-task/INP observers, coverage and bundle analyzer.
41
+ - Native/mobile: platform profiler, frame-time instrumentation, startup tracing, memory/energy impact.
42
+ - Game: engine profiler, CPU/GPU frame breakdown, texture/font atlas cost, worst-scene capture—not menu-only measurement.
43
+ - Terminal: startup latency, resize redraw cost, input echo latency; snapshot tests do not measure runtime performance.
44
+
45
+ ## Budget failure response
46
+
47
+ 1. identify the user-visible symptom and measurement context;
48
+ 2. attribute cost before deleting features;
49
+ 3. fix the largest causal cost (blocking work, payload, layout instability, memory pressure);
50
+ 4. remeasure the same surface;
51
+ 5. report before/after numbers or `not-checked` honestly.
52
+
53
+ ## Rendered payload inventory
54
+
55
+ For web surfaces, record total compressed transfer, JavaScript transfer, CSS/media/font cost where available, request count, LCP, CLS, and whether the measurement was cold, warm, cached, throttled, or emulation. Separate requests/bytes initiated before document load from deferred or idle work so a heavy initial payload cannot hide inside a lazy-loading total. In the live corpus of high-end marketing, portfolio, product, editorial, and gallery pages, the desktop median was approximately **3.1 MB compressed transfer and 103 requests**; the upper quartile reached **6.1 MB and 137 requests**, and the worst decile approached **9.9 MB and 217 requests**. Treat those numbers as calibration for how costly polished work can become, not as acceptable budgets.
56
+
57
+ Keep the mode budgets above as defaults. If a Persuade/Experience direction requires more payload, record the user-facing reason, the expected network/device cost, what is deferred or adaptive, and the explicit waiver owner. Never use visual ambition itself as the waiver.
58
+
59
+ Watch for two recurring live-production regressions:
60
+ - **Zero-CLS, slow-LCP hydration trap**: product sites frequently achieve near-zero CLS (`≤ 0.002`) while still shipping 600 KB–1.5 MB of compressed JS that pushes LCP past 3–6 seconds. Keep critical hero text/media server-rendered and unblocked by client bundles or excessive font preloads.
61
+ - **Deferred third-party/media stalling `load`**: heavy video, WebGL scenes, or third-party scripts can hold the document `load` event open well past interactive readiness; isolate them below the fold, lazy-load after first paint, and verify both `DOMContentLoaded` and LCP.
62
+
63
+ ## Style inventory evidence
64
+
65
+ Use `scripts/style-inventory.mjs` when a browser runtime is available. Its JSON output separates typography, palette, layout geometry, cursor/motion signals, initial/deferred payload and resource-type breakdowns, and basic semantic checks so critique starts from measurements rather than taste adjectives.
@@ -0,0 +1,81 @@
1
+ # Task-driven visual QA
2
+
3
+ Use this reference when judging whether the interface actually works. A screenshot is evidence about appearance at one instant; it is not proof that users can complete the task. Execute realistic tasks and capture the resulting evidence.
4
+
5
+ ## Task selection
6
+
7
+ Choose tasks from the design brief/plan rather than generic inspection:
8
+
9
+ | Task type | Examples | Required evidence |
10
+ |---|---|---|
11
+ | primary success | create, search, checkout, publish, configure, navigate to detail | initial state → key intermediate feedback → final end state |
12
+ | recovery | invalid input, offline retry, permission denied, conflict, cancellation | preserved input/context, truthful error, recovery path completion |
13
+ | orientation | deep link, back/forward/escape, refresh/relaunch, interruption | understandable restored state |
14
+ | adaptation | small viewport/window, text scaling, RTL/locale, input modality change | task remains possible and legible |
15
+ | destructive/high-cost | delete, reset, payment, irreversible publish, sending messages to real users | consequence communication, confirmation/undo/cancel behavior |
16
+
17
+ Define the expected end state before execution. “No console errors” or “page loads” is not a task outcome.
18
+
19
+ ## Destructive/high-cost execution boundary
20
+
21
+ Never execute destructive or high-cost tasks against live/production data, real customer accounts, real payment instruments, production publish targets, or real message recipients. These tasks may run only inside a sandbox, disposable fixture, mocked backend, local/test environment, or provider-approved test mode using test credentials.
22
+
23
+ Before execution, verify and record which boundary applies. If no safe boundary exists:
24
+
25
+ 1. exercise the flow only up to the final confirmation/commit step;
26
+ 2. verify consequence copy, friction, focus/keyboard behavior, cancellation, input preservation, and recovery affordances that do not commit the action;
27
+ 3. mark the irreversible submission/payment/deletion/publish/send step `not run` in the execution record;
28
+ 4. ask the user for a sandbox/test fixture/mock/test-mode credential or explicit direction before attempting completion.
29
+
30
+ A user interface being locally hosted does not make downstream effects safe: payment APIs, email delivery, production databases, publish endpoints, and shared remote state remain live side effects unless explicitly isolated.
31
+
32
+ ## Execution record
33
+
34
+ ```markdown
35
+ | Task | Fixture/context | Steps executed | Expected end state | Actual result | Evidence artifact | Label |
36
+ |---|---|---|---|---|---|---|
37
+ | invite teammate | empty project, keyboard only, 390px, en-LTR | | | pass/fail/blocked/not run | path/timestamp | rendered/not-checked |
38
+ ```
39
+
40
+ Record runtime/build/version, platform/emulation status, viewport/device, locale/direction, network state, input modality, and exact fixture. Redact secrets/private data.
41
+
42
+ ## Agent execution rules
43
+
44
+ 1. Drive the real surface using the most faithful available mechanism: browser interaction, device/simulator control, native test harness, terminal interaction, snapshot interaction runner, or manual capture.
45
+ 2. Do not only inspect static markup and infer behavior. Static evidence may supplement but not replace execution.
46
+ 3. Verify intermediate feedback: pending/disabled state, validation timing, focus movement, announcements/status where inspectable, progress, cancellation, and retry.
47
+ 4. Verify the end state in data/UI terms, not only visual similarity: object created, navigation location correct, input preserved, error shown, undo available, permission enforced.
48
+ 5. Capture failure traces at the moment of failure. Do not retry until evidence disappears.
49
+ 6. Fix one deterministic defect at a time and rerun the affected task only.
50
+ 7. Stop after the agreed repair budget (at most three rounds); report remaining defects or uncertainty instead of looping by taste.
51
+
52
+ ## Failure classification
53
+
54
+ Classify failures before repairing:
55
+
56
+ - **task blocker:** correct action impossible/missing/inaccessible;
57
+ - **navigation failure:** state lost, wrong back/escape/deep-link behavior;
58
+ - **feedback failure:** action occurred but status/result is invisible or misleading;
59
+ - **input failure:** keyboard/touch/controller/IME/paste/autofill path broken;
60
+ - **layout failure:** action/content clipped, obscured, unreachable, or unstable;
61
+ - **data/state failure:** stale response, duplication, lost input, wrong permission/conflict behavior;
62
+ - **visual fidelity issue:** implementation diverges visually without blocking behavior;
63
+ - **test fixture failure:** harness/data/environment invalid rather than product broken.
64
+
65
+ Do not repair a fixture failure by changing product behavior unless the product defect is independently proven.
66
+
67
+ ## Evidence precedence
68
+
69
+ Strongest evidence for behavior:
70
+
71
+ 1. real device/platform runtime (`rendered`);
72
+ 2. simulator/emulator/browser interaction (`rendered`, labeled emulation);
73
+ 3. deterministic interactive test harness/snapshot backend (`rendered` only for the behavior it truly exercises);
74
+ 4. static event/state analysis (`static`);
75
+ 5. model screenshot interpretation (`model-judgment`).
76
+
77
+ Never escalate a screenshot reading into task-completion evidence.
78
+
79
+ ## Lightweight two-width evidence floor
80
+
81
+ For a narrow review outside the finish gate, capture at least one desktop width and one narrow mobile width such as 390 px. Compare hierarchy, measure, navigation availability, clipping, touch target spacing, and whether the signature composition survives or intentionally degrades. If only one width is captured, mark responsive behavior `not-checked`. For a new or materially changed flow, use the full width matrix in [finish-gate.md](finish-gate.md).
@@ -0,0 +1,135 @@
1
+ #!/usr/bin/env node
2
+ import fs from 'node:fs';
3
+ import path from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+
6
+ const optional = ['error', 'empty', 'loading', 'theme', 'reduced-motion', 'reflow-320'];
7
+ const interfaces = ['responsive-web', 'other'];
8
+ const shortHeightLayout = 'layout-short-height';
9
+ const shortHeightLimit = 600;
10
+ const webLayoutClasses = ['layout-landscape', shortHeightLayout];
11
+ const present = (value) => typeof value === 'string' && Boolean(value.trim());
12
+ const record = (value) => value && typeof value === 'object' && !Array.isArray(value);
13
+ const dimension = (value) => Number.isSafeInteger(value) && value > 0;
14
+
15
+ export function evaluateEvidence(manifest, hasArtifact) {
16
+ if (!record(manifest) || manifest.schemaVersion !== 1 || !interfaces.includes(manifest.surface)
17
+ || ![manifest.target, manifest.revision, manifest.task, manifest.fixture].every(present)
18
+ || !record(manifest.applicability) || !record(manifest.checks) || !Array.isArray(manifest.rounds)) {
19
+ throw new Error('expected schemaVersion 1, surface, target, revision, task, fixture, applicability, checks and rounds');
20
+ }
21
+ const web = manifest.surface === 'responsive-web';
22
+ const required = ['outcome', 'input', ...(web ? ['width-390', 'width-768', 'width-1440'] : ['layout'])];
23
+ const notChecked = new Map();
24
+ const failures = new Map();
25
+ const skipped = new Map();
26
+ for (const id of optional) {
27
+ if (id === 'reflow-320' && !web) continue;
28
+ const applicability = manifest.applicability[id];
29
+ if (applicability === true) required.push(id);
30
+ else if (record(applicability) && applicability.applies === false && present(applicability.reason)) {
31
+ skipped.set(id, applicability.reason);
32
+ } else notChecked.set(id, 'Applicability must be decided before verification.');
33
+ }
34
+
35
+ const layouts = record(manifest.layoutMatrix) ? manifest.layoutMatrix : {};
36
+ const expectedLayouts = new Map();
37
+ for (const id of new Set([...(web ? webLayoutClasses : []), ...Object.keys(layouts)])) {
38
+ const layout = layouts[id];
39
+ if (!/^layout-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(id)) {
40
+ notChecked.set(id, 'Use layout-<class> for layout matrix IDs.');
41
+ } else if (record(layout) && layout.applies === false && present(layout.reason)) {
42
+ skipped.set(id, layout.reason);
43
+ } else if (web && id === shortHeightLayout && dimension(layout?.height) && layout.height >= shortHeightLimit) {
44
+ notChecked.set(id, `Short-height evidence must use a viewport below ${shortHeightLimit} CSS px tall.`);
45
+ } else if (record(layout) && layout.applies !== false
46
+ && dimension(layout.width) && dimension(layout.height)
47
+ && (id !== 'layout-landscape' || layout.width > layout.height)) {
48
+ required.push(id);
49
+ expectedLayouts.set(id, layout);
50
+ } else {
51
+ notChecked.set(id, 'Declare positive layout width and height (landscape must be wider than tall), or a reason it does not apply.');
52
+ }
53
+ }
54
+
55
+ if (manifest.rounds.length > 3) throw new Error('at most three repair rounds are allowed');
56
+ const repaired = new Set();
57
+ for (const round of manifest.rounds) {
58
+ if (!record(round) || ![round.failure, round.reproduction, round.change, round.rerun].every(present)
59
+ || !hasArtifact(round.before) || !hasArtifact(round.after)
60
+ || round.before === round.after) {
61
+ throw new Error('every repair round needs a failure, reproduction, change, rerun and distinct before/after artifacts');
62
+ }
63
+ repaired.add(round.failure);
64
+ skipped.delete(round.failure);
65
+ }
66
+
67
+ const desktopArtifact = manifest.checks['width-1440']?.artifact;
68
+ for (const id of new Set([...required, ...repaired, ...Object.keys(manifest.checks)])) {
69
+ const entry = Object.hasOwn(manifest.checks, id) ? manifest.checks[id] : undefined;
70
+ if (skipped.has(id) && entry?.result !== 'fail') continue;
71
+ const width = id === 'reflow-320' ? 320 : Number(/^width-([1-9]\d*)(?:-.+)?$/.exec(id)?.[1]);
72
+ const layout = expectedLayouts.get(id);
73
+ if (id.startsWith('width-') && !Number.isSafeInteger(width)) {
74
+ notChecked.set(id, 'Invalid width check ID; use width-<px> or width-<px>-<defect>.');
75
+ continue;
76
+ }
77
+ if (web && layout && id === shortHeightLayout && present(entry?.artifact) && present(desktopArtifact)
78
+ && path.normalize(entry.artifact) === path.normalize(desktopArtifact)) {
79
+ notChecked.set(id, 'Short-height evidence must use a separate artifact from width-1440.');
80
+ continue;
81
+ }
82
+ if (!record(entry) || !['pass', 'fail'].includes(entry.result) || entry.label !== 'rendered'
83
+ || ![entry.method, entry.expected, entry.observed].every(present) || !hasArtifact(entry.artifact)
84
+ || (id === 'outcome' && !present(entry.assertion))
85
+ || (id === 'input' && !present(entry.focus))
86
+ || (web && id === 'input' && entry.modality !== 'keyboard')
87
+ || (Number.isSafeInteger(width) && entry.width !== width)
88
+ || (layout && (entry.width !== layout.width || entry.height !== layout.height))) {
89
+ notChecked.set(id, present(entry?.reason) ? entry.reason : 'Missing required rendered evidence or assertion.');
90
+ } else if (entry.result === 'fail') {
91
+ skipped.delete(id);
92
+ failures.set(id, { expected: entry.expected, observed: entry.observed, artifact: entry.artifact });
93
+ }
94
+ }
95
+
96
+ const status = failures.size ? (manifest.rounds.length === 3 ? 'OPEN' : 'FAIL')
97
+ : notChecked.size ? 'NOT CHECKED' : 'PASS';
98
+ return { status, rounds: manifest.rounds.length, failures: Object.fromEntries(failures),
99
+ notChecked: Object.fromEntries(notChecked), notApplicable: Object.fromEntries(skipped) };
100
+ }
101
+
102
+ function main(args) {
103
+ if (args.includes('--help') || args.includes('-h')) {
104
+ console.log('Usage: node finish-gate.mjs <evidence.json>\nChecks evidence completeness; exit 0 PASS, 1 FAIL/OPEN, 2 NOT CHECKED or invalid input.');
105
+ return;
106
+ }
107
+ if (args.length !== 1) throw new Error('provide one evidence manifest; see --help');
108
+ const file = path.resolve(args[0]);
109
+ const root = path.dirname(file);
110
+ const manifest = JSON.parse(fs.readFileSync(file, 'utf8'));
111
+ const hasArtifact = (relative) => {
112
+ if (!present(relative) || path.isAbsolute(relative)) return false;
113
+ try {
114
+ const resolved = fs.realpathSync(path.resolve(root, relative));
115
+ const local = path.relative(fs.realpathSync(root), resolved);
116
+ if (!local || local === '..' || local.startsWith(`..${path.sep}`) || path.isAbsolute(local)) return false;
117
+ const stat = fs.statSync(resolved);
118
+ return stat.isFile() && stat.size > 0;
119
+ } catch {
120
+ return false;
121
+ }
122
+ };
123
+ const result = evaluateEvidence(manifest, hasArtifact);
124
+ console.log(JSON.stringify(result, null, 2));
125
+ process.exitCode = { PASS: 0, FAIL: 1, OPEN: 1, 'NOT CHECKED': 2 }[result.status];
126
+ }
127
+
128
+ if (process.argv[1] && fileURLToPath(import.meta.url) === path.resolve(process.argv[1])) {
129
+ try {
130
+ main(process.argv.slice(2));
131
+ } catch (error) {
132
+ console.error(`finish-gate: ${error.message}`);
133
+ process.exitCode = 2;
134
+ }
135
+ }
@@ -0,0 +1,19 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <meta charset="utf-8">
4
+ <title>ARIA modal occlusion</title>
5
+ <style>
6
+ body { color: #171717; background: white; }
7
+ .backdrop { position: fixed; inset: 0; background: white; }
8
+ .modal { position: fixed; inset: 40% 25% auto; padding: 1rem; background: white; }
9
+ .sample { position: relative; width: max-content; }
10
+ .cover { position: absolute; inset: 0; background: white; }
11
+ @media (max-width: 500px) { .modal { display: none; } }
12
+ </style>
13
+ <p id="behind-aria-modal">Background text intentionally covered by a sibling backdrop.</p>
14
+ <div class="backdrop"></div>
15
+ <div class="modal" role="dialog" aria-modal="true" aria-label="Settings">
16
+ <p id="readable-aria-modal">Readable modal text.</p>
17
+ <div class="sample"><span id="occluded-aria-modal">Hidden modal text.</span><div class="cover"></div></div>
18
+ </div>
19
+ </html>
@@ -0,0 +1,34 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <meta charset="utf-8">
4
+ <meta name="viewport" content="width=device-width, initial-scale=1">
5
+ <title>Rendered diagnostics</title>
6
+ <style>
7
+ body { margin: 12px; color: #171717; background: white; }
8
+ #wide { width: 450px; }
9
+ #hidden-essential { opacity: 0; }
10
+ .sample { position: relative; width: max-content; }
11
+ .cover { position: absolute; inset: 0; z-index: 1; }
12
+ #opaque { background: white; }
13
+ #low-contrast { color: #ddd; }
14
+ #focusless:focus { outline: none; }
15
+ #focus-ring:focus-visible { outline: 3px solid #1754ad; }
16
+ </style>
17
+ <main>
18
+ <h1>Settings</h1>
19
+ <button id="focusless">Focus lost</button>
20
+ <button id="focus-ring">Focus works</button>
21
+ <p id="wide">Wide element causes overflow at narrow sizes.</p>
22
+ <p id="hidden-essential" data-pixelcraft-essential>Required content cannot be seen.</p>
23
+ <details><summary>More details</summary><p id="closed" data-pixelcraft-essential>Intentionally closed.</p></details>
24
+ <dialog><h1 id="closed-dialog">Intentionally closed dialog</h1></dialog>
25
+ <div role="dialog" aria-modal="true" hidden>Intentionally hidden ARIA dialog</div>
26
+ <div class="sample"><span id="occluded">Important content hidden under an opaque layer</span><div id="opaque" class="cover"></div></div>
27
+ <div class="sample"><span id="not-occluded">Important content visible under a transparent layer</span><div class="cover"></div></div>
28
+ <p id="low-contrast">Insufficient text contrast.</p>
29
+ <p id="readable">Sufficient text contrast.</p>
30
+ <img id="broken" src="missing.png" alt="Broken product image" width="30" height="30">
31
+ <img id="valid" src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30'%3E%3Crect width='30' height='30'/%3E%3C/svg%3E" alt="Valid product image" width="30" height="30">
32
+ <img id="hidden-image" hidden src="missing-hidden.png" alt="" width="30" height="30">
33
+ </main>
34
+ </html>
@@ -0,0 +1,17 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <meta charset="utf-8">
4
+ <title>Modal occlusion</title>
5
+ <style>
6
+ body { color: #171717; background: white; }
7
+ dialog::backdrop, .cover { background: white; }
8
+ .sample { position: relative; width: max-content; }
9
+ .cover { position: absolute; inset: 0; z-index: 1; }
10
+ </style>
11
+ <p id="behind-modal">Background text intentionally covered by a modal backdrop.</p>
12
+ <dialog aria-label="Settings">
13
+ <p id="readable-modal">Readable modal text.</p>
14
+ <div class="sample"><span id="occluded-modal">Hidden modal text.</span><div class="cover"></div></div>
15
+ </dialog>
16
+ <script>document.querySelector('dialog').showModal();</script>
17
+ </html>
@@ -0,0 +1 @@
1
+ window.__styleInventoryDeferredFixture = true;
@@ -0,0 +1,52 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <title>Style inventory edge fixture</title>
7
+ <style>
8
+ :root, body {
9
+ margin: 0;
10
+ min-height: 100vh;
11
+ background: #000000;
12
+ color: #f5f5f5;
13
+ font: 400 16px/1.5 Arial, sans-serif;
14
+ }
15
+ main {
16
+ padding: 24px;
17
+ }
18
+ h1 {
19
+ margin: 0 0 12px;
20
+ font-size: 32px;
21
+ }
22
+ .faded {
23
+ opacity: 0.25;
24
+ }
25
+ .clipped-box {
26
+ width: 0;
27
+ height: 0;
28
+ overflow: hidden;
29
+ }
30
+ .clipped-box p {
31
+ color: #111111;
32
+ background: #000000;
33
+ }
34
+ </style>
35
+ </head>
36
+ <body>
37
+ <header role="presentation"></header>
38
+ <nav aria-hidden="true"></nav>
39
+ <aside hidden></aside>
40
+ <main>
41
+ <article>
42
+ <header></header>
43
+ <h1>Zero-channel dark surface</h1>
44
+ <p>Pure black background must resolve as dark mode with #000000 dominant color.</p>
45
+ <p class="faded">Low opacity text must fail contrast even though its color is light.</p>
46
+ <div class="clipped-box"><p>Clipped low-contrast text inside zero-size overflow hidden ancestor.</p></div>
47
+ <footer></footer>
48
+ </article>
49
+ </main>
50
+ <footer></footer>
51
+ </body>
52
+ </html>
@@ -0,0 +1,80 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <title>Style inventory fixture</title>
7
+ <style>
8
+ :root {
9
+ background: #f6f1e7;
10
+ color: #1b1b18;
11
+ font-family: Arial, Helvetica, sans-serif;
12
+ }
13
+ body {
14
+ margin: 0;
15
+ background: #f6f1e7;
16
+ color: #1b1b18;
17
+ font: 400 16px/1.55 Arial, Helvetica, sans-serif;
18
+ }
19
+ main {
20
+ box-sizing: border-box;
21
+ max-width: 720px;
22
+ margin: 0 auto;
23
+ padding: 48px 24px;
24
+ }
25
+ h1 {
26
+ margin: 0 0 24px;
27
+ color: #172554;
28
+ font-size: 48px;
29
+ font-weight: 800;
30
+ letter-spacing: -0.04em;
31
+ line-height: 1;
32
+ }
33
+ .lede {
34
+ max-width: 34rem;
35
+ font-size: 20px;
36
+ line-height: 1.4;
37
+ }
38
+ .actions {
39
+ display: flex;
40
+ gap: 16px;
41
+ margin-top: 32px;
42
+ }
43
+ button {
44
+ border: 0;
45
+ border-radius: 999px;
46
+ padding: 12px 20px;
47
+ background: #2854c5;
48
+ color: white;
49
+ cursor: pointer;
50
+ font-weight: 700;
51
+ }
52
+ .specimen {
53
+ width: 160px;
54
+ height: 90px;
55
+ margin-top: 40px;
56
+ background: #d9480f;
57
+ cursor: none;
58
+ }
59
+ @media (prefers-reduced-motion: reduce) {
60
+ *, *::before, *::after {
61
+ animation-duration: 0.001ms !important;
62
+ transition-duration: 0.001ms !important;
63
+ }
64
+ }
65
+ :focus-visible {
66
+ outline: 3px solid #2854c5;
67
+ outline-offset: 3px;
68
+ }
69
+ </style>
70
+ <script src="./style-inventory.js"></script>
71
+ </head>
72
+ <body>
73
+ <main>
74
+ <h1>Measured inventory</h1>
75
+ <p class="lede">A static fixture with deliberate type contrast, palette roles, spacing, focus treatment, and semantic structure.</p>
76
+ <div class="actions"><button type="button">Inspect</button></div>
77
+ <div class="specimen" role="img" aria-label="orange specimen block"></div>
78
+ </main>
79
+ </body>
80
+ </html>
@@ -0,0 +1,8 @@
1
+ window.__styleInventoryFixture = true;
2
+ window.addEventListener('load', () => {
3
+ window.setTimeout(() => {
4
+ const script = document.createElement('script');
5
+ script.src = './style-inventory-deferred.js';
6
+ document.head.append(script);
7
+ }, 0);
8
+ });