@thanhnguyxn/pixelcraft 0.0.0-stage → 0.2.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 (455) hide show
  1. package/.agents/plugins/marketplace.json +20 -0
  2. package/.antigravity-plugin/plugin.json +32 -0
  3. package/.claude-plugin/marketplace.json +20 -0
  4. package/.claude-plugin/plugin.json +22 -0
  5. package/.codex-plugin/plugin.json +45 -0
  6. package/.cursor-plugin/marketplace.json +17 -0
  7. package/.cursor-plugin/plugin.json +27 -0
  8. package/.devin-plugin/plugin.json +21 -0
  9. package/.github/plugin/marketplace.json +34 -0
  10. package/CHANGELOG.md +159 -0
  11. package/GEMINI.md +1 -0
  12. package/LICENSE +21 -0
  13. package/README.md +264 -2
  14. package/SECURITY.md +28 -0
  15. package/assets/README.md +28 -0
  16. package/assets/pixelcraft-logo-128.png +0 -0
  17. package/assets/pixelcraft-logo-256.png +0 -0
  18. package/assets/pixelcraft-logo-512.png +0 -0
  19. package/bin/pixelcraft.mjs +852 -0
  20. package/docs/ARCHITECTURE.md +105 -0
  21. package/docs/DESIGN-RATIONALE.md +191 -0
  22. package/docs/INSTALL.md +221 -0
  23. package/evals/README.md +37 -0
  24. package/evals/fixtures/3d-web-engineering.json +69 -0
  25. package/evals/fixtures/README.md +36 -0
  26. package/evals/fixtures/acceptance-checklist-rule03-gate.json +43 -0
  27. package/evals/fixtures/ai-ui-libraries.json +53 -0
  28. package/evals/fixtures/audio-visual-accessibility.json +69 -0
  29. package/evals/fixtures/auth-and-checkout-ui.json +53 -0
  30. package/evals/fixtures/brandkit-identity-governance.json +48 -0
  31. package/evals/fixtures/build-and-architecture.json +53 -0
  32. package/evals/fixtures/canvas-and-node-editors.json +53 -0
  33. package/evals/fixtures/chat-ai-exfiltration-ime-hitl-gate.json +43 -0
  34. package/evals/fixtures/completion-gate-scan-until-clean.json +44 -0
  35. package/evals/fixtures/component-systems.json +53 -0
  36. package/evals/fixtures/component-testing.json +53 -0
  37. package/evals/fixtures/constrained-voice-and-tv.json +43 -0
  38. package/evals/fixtures/creative-code-rendering.json +69 -0
  39. package/evals/fixtures/creative-reference-evidence.json +67 -0
  40. package/evals/fixtures/data-app-python-marimo.json +49 -0
  41. package/evals/fixtures/desktop-cpp-juce-audio.json +49 -0
  42. package/evals/fixtures/desktop-csharp-avalonia.json +49 -0
  43. package/evals/fixtures/desktop-native-workspace.json +48 -0
  44. package/evals/fixtures/desktop-python-anti-tkinter.json +49 -0
  45. package/evals/fixtures/direction-prototype-complexity.json +29 -0
  46. package/evals/fixtures/document-prepress-pdfx4-tounicode.json +43 -0
  47. package/evals/fixtures/document-rust-typst-invoice.json +49 -0
  48. package/evals/fixtures/document-typst-and-print-css.json +43 -0
  49. package/evals/fixtures/email-mjml-dark-mode.json +49 -0
  50. package/evals/fixtures/email-outlook-and-plaintext.json +43 -0
  51. package/evals/fixtures/enterprise-data-ui.json +53 -0
  52. package/evals/fixtures/extended-tui-toolkits.json +53 -0
  53. package/evals/fixtures/extensions-mv3-and-vscode.json +43 -0
  54. package/evals/fixtures/file-upload-media-ui.json +53 -0
  55. package/evals/fixtures/finish-gate-anti-slop.json +30 -0
  56. package/evals/fixtures/forms-accessibility-negative.json +29 -0
  57. package/evals/fixtures/forms-validation.json +53 -0
  58. package/evals/fixtures/game-go-ebitengine.json +49 -0
  59. package/evals/fixtures/game-godot-gdscript.json +49 -0
  60. package/evals/fixtures/game-ui-hud-and-engines.json +43 -0
  61. package/evals/fixtures/handoff-fidelity-tolerance.json +29 -0
  62. package/evals/fixtures/i18n-engineering.json +53 -0
  63. package/evals/fixtures/local-first-sync.json +53 -0
  64. package/evals/fixtures/lynxjs.json +53 -0
  65. package/evals/fixtures/maizzle-email.json +53 -0
  66. package/evals/fixtures/maps-geospatial.json +53 -0
  67. package/evals/fixtures/media-og-and-video-export.json +43 -0
  68. package/evals/fixtures/media-players.json +53 -0
  69. package/evals/fixtures/mobile-compose-16kb-foldable-store-gate.json +44 -0
  70. package/evals/fixtures/mobile-elixir-liveview-native.json +49 -0
  71. package/evals/fixtures/mobile-flutter-dynamic-type.json +49 -0
  72. package/evals/fixtures/mobile-harmonyos-arkui.json +49 -0
  73. package/evals/fixtures/mobile-jetpack-compose.json +49 -0
  74. package/evals/fixtures/mobile-swiftui-ios.json +49 -0
  75. package/evals/fixtures/motion-engineering.json +69 -0
  76. package/evals/fixtures/pdfjs-and-pptx.json +53 -0
  77. package/evals/fixtures/plan-brownfield-evidence.json +28 -0
  78. package/evals/fixtures/plan-discovery-interview.json +31 -0
  79. package/evals/fixtures/plan-grill-me-brainstorm-gate.json +49 -0
  80. package/evals/fixtures/reactive-data-apps.json +53 -0
  81. package/evals/fixtures/review-evidence-audit.json +43 -0
  82. package/evals/fixtures/rich-text-and-code-editors.json +53 -0
  83. package/evals/fixtures/scrollytelling-resilience.json +70 -0
  84. package/evals/fixtures/spatial-xr-comfort-and-platforms.json +43 -0
  85. package/evals/fixtures/state-architecture.json +53 -0
  86. package/evals/fixtures/styling-ecosystem.json +53 -0
  87. package/evals/fixtures/token-tooling.json +53 -0
  88. package/evals/fixtures/tui-go-bubbletea.json +49 -0
  89. package/evals/fixtures/tui-rust-ratatui-grapheme-paste-teardown.json +44 -0
  90. package/evals/fixtures/tui-rust-ratatui.json +49 -0
  91. package/evals/fixtures/ux-state-matrix-and-i18n.json +43 -0
  92. package/evals/fixtures/visual-qa-task-evidence.json +29 -0
  93. package/evals/fixtures/web-3d-engines.json +53 -0
  94. package/evals/fixtures/web-php-laravel-filament.json +49 -0
  95. package/evals/fixtures/web-ruby-viewcomponent-phlex.json +49 -0
  96. package/evals/fixtures/workflow-checkpoints.json +30 -0
  97. package/evals/pixelcraft-accessibility.md +74 -0
  98. package/evals/pixelcraft-brandkit.md +58 -0
  99. package/evals/pixelcraft-chat-ui.md +55 -0
  100. package/evals/pixelcraft-constrained.md +55 -0
  101. package/evals/pixelcraft-craft.md +76 -0
  102. package/evals/pixelcraft-data-apps.md +55 -0
  103. package/evals/pixelcraft-dataviz.md +59 -0
  104. package/evals/pixelcraft-desktop.md +55 -0
  105. package/evals/pixelcraft-direction.md +77 -0
  106. package/evals/pixelcraft-document.md +55 -0
  107. package/evals/pixelcraft-email.md +55 -0
  108. package/evals/pixelcraft-extensions.md +55 -0
  109. package/evals/pixelcraft-game-ui.md +59 -0
  110. package/evals/pixelcraft-handoff.md +57 -0
  111. package/evals/pixelcraft-media.md +55 -0
  112. package/evals/pixelcraft-mobile.md +59 -0
  113. package/evals/pixelcraft-patterns.md +73 -0
  114. package/evals/pixelcraft-plan.md +127 -0
  115. package/evals/pixelcraft-review.md +63 -0
  116. package/evals/pixelcraft-spatial.md +55 -0
  117. package/evals/pixelcraft-tokens.md +57 -0
  118. package/evals/pixelcraft-tui.md +55 -0
  119. package/evals/pixelcraft-ux.md +59 -0
  120. package/evals/pixelcraft-visual-qa.md +86 -0
  121. package/evals/pixelcraft-web.md +89 -0
  122. package/evals/pixelcraft.md +70 -0
  123. package/gemini-extension.json +6 -0
  124. package/install.ps1 +341 -0
  125. package/install.sh +512 -0
  126. package/package.json +91 -4
  127. package/plugin.json +29 -0
  128. package/scripts/build-adapters.mjs +288 -0
  129. package/scripts/build-release-archives.mjs +61 -0
  130. package/scripts/build-skill-zips.mjs +94 -0
  131. package/scripts/run-evals.mjs +397 -0
  132. package/scripts/sync-docs.mjs +381 -0
  133. package/scripts/test-build-adapters.mjs +61 -0
  134. package/scripts/test-cross-platform-qa.mjs +359 -0
  135. package/scripts/test-distribution.mjs +203 -0
  136. package/scripts/test-export-tokens.mjs +361 -0
  137. package/scripts/test-finish-gate.mjs +271 -0
  138. package/scripts/test-installers.mjs +216 -0
  139. package/scripts/test-release-archives.mjs +42 -0
  140. package/scripts/test-shoot.mjs +87 -0
  141. package/scripts/test-slop-scan.mjs +416 -0
  142. package/scripts/test-style-inventory.mjs +234 -0
  143. package/scripts/test-sync-docs.mjs +140 -0
  144. package/scripts/test-validate-skills.mjs +195 -0
  145. package/scripts/validate-skills.mjs +658 -0
  146. package/skills/pixelcraft/SKILL.md +155 -0
  147. package/skills/pixelcraft/references/design-brief.md +75 -0
  148. package/skills/pixelcraft/references/floor.md +90 -0
  149. package/skills/pixelcraft/references/report-template.md +49 -0
  150. package/skills/pixelcraft/references/stack-detection.md +226 -0
  151. package/skills/pixelcraft/references/surface-acceptance.md +52 -0
  152. package/skills/pixelcraft/references/workflow-checkpoints.md +71 -0
  153. package/skills/pixelcraft-accessibility/SKILL.md +54 -0
  154. package/skills/pixelcraft-accessibility/references/apg-patterns.md +64 -0
  155. package/skills/pixelcraft-accessibility/references/motion-canvas.md +57 -0
  156. package/skills/pixelcraft-accessibility/references/platforms.md +86 -0
  157. package/skills/pixelcraft-accessibility/references/verification.md +64 -0
  158. package/skills/pixelcraft-accessibility/references/wcag22-checks.md +99 -0
  159. package/skills/pixelcraft-brandkit/SKILL.md +127 -0
  160. package/skills/pixelcraft-brandkit/references/asset-pipeline.md +165 -0
  161. package/skills/pixelcraft-brandkit/references/brand-governance.md +82 -0
  162. package/skills/pixelcraft-brandkit/references/layouts.md +88 -0
  163. package/skills/pixelcraft-brandkit/references/logo-concepting.md +83 -0
  164. package/skills/pixelcraft-brandkit/references/logo-methods.md +97 -0
  165. package/skills/pixelcraft-brandkit/references/pixel-art-logos.md +82 -0
  166. package/skills/pixelcraft-brandkit/references/prompt-template.md +87 -0
  167. package/skills/pixelcraft-brandkit/references/qa-checklist.md +93 -0
  168. package/skills/pixelcraft-brandkit/references/visual-modes.md +123 -0
  169. package/skills/pixelcraft-chat-ui/SKILL.md +57 -0
  170. package/skills/pixelcraft-chat-ui/references/agentic-workspace.md +66 -0
  171. package/skills/pixelcraft-chat-ui/references/ai-ui-libraries.md +259 -0
  172. package/skills/pixelcraft-chat-ui/references/conversation-design.md +84 -0
  173. package/skills/pixelcraft-chat-ui/references/mobile-business-platforms.md +77 -0
  174. package/skills/pixelcraft-chat-ui/references/slack-discord.md +80 -0
  175. package/skills/pixelcraft-constrained/SKILL.md +52 -0
  176. package/skills/pixelcraft-constrained/references/specialized-hardware.md +90 -0
  177. package/skills/pixelcraft-constrained/references/tv-wearables.md +134 -0
  178. package/skills/pixelcraft-constrained/references/voice-ui.md +104 -0
  179. package/skills/pixelcraft-craft/SKILL.md +58 -0
  180. package/skills/pixelcraft-craft/references/color.md +125 -0
  181. package/skills/pixelcraft-craft/references/imagery-icons.md +37 -0
  182. package/skills/pixelcraft-craft/references/layout-quality.md +65 -0
  183. package/skills/pixelcraft-craft/references/layout.md +73 -0
  184. package/skills/pixelcraft-craft/references/motion.md +163 -0
  185. package/skills/pixelcraft-craft/references/typography.md +110 -0
  186. package/skills/pixelcraft-data-apps/SKILL.md +86 -0
  187. package/skills/pixelcraft-data-apps/references/ai-and-internal-data-apps.md +147 -0
  188. package/skills/pixelcraft-data-apps/references/dash.md +109 -0
  189. package/skills/pixelcraft-data-apps/references/evidence.md +90 -0
  190. package/skills/pixelcraft-data-apps/references/gradio.md +103 -0
  191. package/skills/pixelcraft-data-apps/references/julia-genie.md +89 -0
  192. package/skills/pixelcraft-data-apps/references/jupyter-widgets.md +91 -0
  193. package/skills/pixelcraft-data-apps/references/nicegui.md +102 -0
  194. package/skills/pixelcraft-data-apps/references/observable-framework.md +105 -0
  195. package/skills/pixelcraft-data-apps/references/panel.md +99 -0
  196. package/skills/pixelcraft-data-apps/references/r-shiny.md +124 -0
  197. package/skills/pixelcraft-data-apps/references/reactive-data-apps.md +186 -0
  198. package/skills/pixelcraft-data-apps/references/reflex.md +116 -0
  199. package/skills/pixelcraft-data-apps/references/shiny.md +110 -0
  200. package/skills/pixelcraft-data-apps/references/streamlit.md +113 -0
  201. package/skills/pixelcraft-dataviz/SKILL.md +60 -0
  202. package/skills/pixelcraft-dataviz/references/chart-choice.md +55 -0
  203. package/skills/pixelcraft-dataviz/references/color-accessibility.md +112 -0
  204. package/skills/pixelcraft-dataviz/references/encoding-tables-dashboards.md +107 -0
  205. package/skills/pixelcraft-dataviz/references/libraries.md +176 -0
  206. package/skills/pixelcraft-dataviz/references/maps-geospatial.md +159 -0
  207. package/skills/pixelcraft-dataviz/references/realtime-graphs-maps-scale.md +92 -0
  208. package/skills/pixelcraft-desktop/SKILL.md +93 -0
  209. package/skills/pixelcraft-desktop/references/appkit.md +92 -0
  210. package/skills/pixelcraft-desktop/references/avalonia.md +95 -0
  211. package/skills/pixelcraft-desktop/references/cpp-gui.md +129 -0
  212. package/skills/pixelcraft-desktop/references/electron.md +96 -0
  213. package/skills/pixelcraft-desktop/references/go-gui.md +83 -0
  214. package/skills/pixelcraft-desktop/references/gtk.md +97 -0
  215. package/skills/pixelcraft-desktop/references/javafx-swing.md +81 -0
  216. package/skills/pixelcraft-desktop/references/qt-pyside-qml.md +88 -0
  217. package/skills/pixelcraft-desktop/references/rust-gui.md +83 -0
  218. package/skills/pixelcraft-desktop/references/tauri.md +110 -0
  219. package/skills/pixelcraft-desktop/references/uno-platform.md +71 -0
  220. package/skills/pixelcraft-desktop/references/winui-wpf.md +98 -0
  221. package/skills/pixelcraft-desktop/references/working-context.md +84 -0
  222. package/skills/pixelcraft-direction/SKILL.md +120 -0
  223. package/skills/pixelcraft-direction/references/composition-library.md +84 -0
  224. package/skills/pixelcraft-direction/references/creative-brainstorming.md +72 -0
  225. package/skills/pixelcraft-direction/references/direction-card.md +64 -0
  226. package/skills/pixelcraft-direction/references/direction-scoring.md +76 -0
  227. package/skills/pixelcraft-direction/references/motion-identity.md +67 -0
  228. package/skills/pixelcraft-direction/references/movements.md +71 -0
  229. package/skills/pixelcraft-direction/references/reference-analysis.md +37 -0
  230. package/skills/pixelcraft-direction/references/repetition-history.md +75 -0
  231. package/skills/pixelcraft-direction/references/slop-fingerprints.md +83 -0
  232. package/skills/pixelcraft-direction/references/wildcards.md +47 -0
  233. package/skills/pixelcraft-document/SKILL.md +58 -0
  234. package/skills/pixelcraft-document/references/archetypes.md +106 -0
  235. package/skills/pixelcraft-document/references/pdf-tools.md +314 -0
  236. package/skills/pixelcraft-document/references/pdfjs-and-pptx.md +114 -0
  237. package/skills/pixelcraft-document/references/print-css.md +187 -0
  238. package/skills/pixelcraft-document/references/slides.md +198 -0
  239. package/skills/pixelcraft-email/SKILL.md +80 -0
  240. package/skills/pixelcraft-email/references/client-quirks.md +113 -0
  241. package/skills/pixelcraft-email/references/html-tables.md +114 -0
  242. package/skills/pixelcraft-email/references/maizzle.md +54 -0
  243. package/skills/pixelcraft-email/references/mjml.md +54 -0
  244. package/skills/pixelcraft-email/references/react-email.md +95 -0
  245. package/skills/pixelcraft-extensions/SKILL.md +56 -0
  246. package/skills/pixelcraft-extensions/references/browser-extensions.md +105 -0
  247. package/skills/pixelcraft-extensions/references/figma-office.md +106 -0
  248. package/skills/pixelcraft-extensions/references/ide-and-saas-plugins.md +125 -0
  249. package/skills/pixelcraft-extensions/references/raycast.md +98 -0
  250. package/skills/pixelcraft-extensions/references/vscode-webviews.md +100 -0
  251. package/skills/pixelcraft-game-ui/SKILL.md +80 -0
  252. package/skills/pixelcraft-game-ui/references/bevy.md +90 -0
  253. package/skills/pixelcraft-game-ui/references/godot.md +130 -0
  254. package/skills/pixelcraft-game-ui/references/hud-principles.md +67 -0
  255. package/skills/pixelcraft-game-ui/references/love2d.md +77 -0
  256. package/skills/pixelcraft-game-ui/references/monogame.md +68 -0
  257. package/skills/pixelcraft-game-ui/references/unity-ugui.md +109 -0
  258. package/skills/pixelcraft-game-ui/references/unity-ui-toolkit.md +107 -0
  259. package/skills/pixelcraft-game-ui/references/unreal-umg.md +80 -0
  260. package/skills/pixelcraft-game-ui/references/web-and-middleware-game-ui.md +122 -0
  261. package/skills/pixelcraft-handoff/SKILL.md +50 -0
  262. package/skills/pixelcraft-handoff/references/design-translation.md +134 -0
  263. package/skills/pixelcraft-handoff/references/fidelity-tolerance.md +78 -0
  264. package/skills/pixelcraft-handoff/references/motion-handoff.md +54 -0
  265. package/skills/pixelcraft-media/SKILL.md +49 -0
  266. package/skills/pixelcraft-media/references/banners-video.md +130 -0
  267. package/skills/pixelcraft-media/references/og-generation.md +154 -0
  268. package/skills/pixelcraft-media/references/social-cards.md +71 -0
  269. package/skills/pixelcraft-mobile/SKILL.md +86 -0
  270. package/skills/pixelcraft-mobile/references/dotnet-maui.md +91 -0
  271. package/skills/pixelcraft-mobile/references/flet.md +80 -0
  272. package/skills/pixelcraft-mobile/references/flutter.md +113 -0
  273. package/skills/pixelcraft-mobile/references/harmonyos-and-emerging-mobile.md +121 -0
  274. package/skills/pixelcraft-mobile/references/ionic-capacitor.md +87 -0
  275. package/skills/pixelcraft-mobile/references/jetpack-compose.md +129 -0
  276. package/skills/pixelcraft-mobile/references/kivy.md +82 -0
  277. package/skills/pixelcraft-mobile/references/kotlin-multiplatform.md +86 -0
  278. package/skills/pixelcraft-mobile/references/lynxjs.md +110 -0
  279. package/skills/pixelcraft-mobile/references/nativescript-and-skip.md +91 -0
  280. package/skills/pixelcraft-mobile/references/react-native-expo.md +106 -0
  281. package/skills/pixelcraft-mobile/references/swiftui.md +200 -0
  282. package/skills/pixelcraft-mobile/references/tactile-interactions.md +55 -0
  283. package/skills/pixelcraft-mobile/references/task-state-composition.md +85 -0
  284. package/skills/pixelcraft-mobile/references/uikit.md +92 -0
  285. package/skills/pixelcraft-patterns/SKILL.md +75 -0
  286. package/skills/pixelcraft-patterns/references/accessibility-resilience.md +29 -0
  287. package/skills/pixelcraft-patterns/references/ai-and-offline-patterns.md +54 -0
  288. package/skills/pixelcraft-patterns/references/auth-onboarding.md +44 -0
  289. package/skills/pixelcraft-patterns/references/billing-paywalls.md +40 -0
  290. package/skills/pixelcraft-patterns/references/command-workspace.md +56 -0
  291. package/skills/pixelcraft-patterns/references/commerce.md +47 -0
  292. package/skills/pixelcraft-patterns/references/communication.md +45 -0
  293. package/skills/pixelcraft-patterns/references/creative-tools.md +42 -0
  294. package/skills/pixelcraft-patterns/references/creative-web-composition.md +38 -0
  295. package/skills/pixelcraft-patterns/references/dashboard-admin.md +35 -0
  296. package/skills/pixelcraft-patterns/references/history-diff-undo.md +50 -0
  297. package/skills/pixelcraft-patterns/references/marketing.md +44 -0
  298. package/skills/pixelcraft-patterns/references/multi-tenant-rbac.md +47 -0
  299. package/skills/pixelcraft-patterns/references/narrative-systems.md +42 -0
  300. package/skills/pixelcraft-patterns/references/notifications-activity.md +57 -0
  301. package/skills/pixelcraft-patterns/references/pattern-selection.md +80 -0
  302. package/skills/pixelcraft-patterns/references/scheduling-kanban.md +47 -0
  303. package/skills/pixelcraft-patterns/references/scroll-implementation.md +37 -0
  304. package/skills/pixelcraft-patterns/references/search-filtering.md +42 -0
  305. package/skills/pixelcraft-patterns/references/settings.md +51 -0
  306. package/skills/pixelcraft-patterns/references/tables-crud.md +43 -0
  307. package/skills/pixelcraft-plan/SKILL.md +103 -0
  308. package/skills/pixelcraft-plan/references/design-input.md +69 -0
  309. package/skills/pixelcraft-plan/references/discovery-interview.md +110 -0
  310. package/skills/pixelcraft-plan/references/grill-me-protocol.md +63 -0
  311. package/skills/pixelcraft-plan/references/plan-template.md +134 -0
  312. package/skills/pixelcraft-plan/references/repo-discovery.md +49 -0
  313. package/skills/pixelcraft-plan/references/stack-freshness.md +67 -0
  314. package/skills/pixelcraft-plan/references/stack-selection.md +98 -0
  315. package/skills/pixelcraft-review/SKILL.md +86 -0
  316. package/skills/pixelcraft-review/references/audit-report.md +69 -0
  317. package/skills/pixelcraft-review/references/critique-protocol.md +89 -0
  318. package/skills/pixelcraft-review/references/heuristics.md +63 -0
  319. package/skills/pixelcraft-review/references/personas.md +53 -0
  320. package/skills/pixelcraft-review/references/polish.md +78 -0
  321. package/skills/pixelcraft-review/scripts/check-acceptance.mjs +619 -0
  322. package/skills/pixelcraft-review/scripts/fixtures/brand-critique-waivers.json +14 -0
  323. package/skills/pixelcraft-review/scripts/fixtures/brand-critique.css +18 -0
  324. package/skills/pixelcraft-review/scripts/fixtures/clean.html +43 -0
  325. package/skills/pixelcraft-review/scripts/fixtures/focus-after-block.css +4 -0
  326. package/skills/pixelcraft-review/scripts/fixtures/focus-at-rules.css +17 -0
  327. package/skills/pixelcraft-review/scripts/fixtures/focus-comments.css +10 -0
  328. package/skills/pixelcraft-review/scripts/fixtures/focus-html-quote-leak.html +12 -0
  329. package/skills/pixelcraft-review/scripts/fixtures/focus-invalid-replacements.css +27 -0
  330. package/skills/pixelcraft-review/scripts/fixtures/focus-longhand-removal.css +34 -0
  331. package/skills/pixelcraft-review/scripts/fixtures/focus-nested-rules.css +19 -0
  332. package/skills/pixelcraft-review/scripts/fixtures/focus-not-visible-skip.css +8 -0
  333. package/skills/pixelcraft-review/scripts/fixtures/focus-outline-shorthands.css +11 -0
  334. package/skills/pixelcraft-review/scripts/fixtures/focus-unknown-and-border.css +15 -0
  335. package/skills/pixelcraft-review/scripts/fixtures/focus-unknown-last-wins.css +19 -0
  336. package/skills/pixelcraft-review/scripts/fixtures/focus-valid-replacements-extended.css +29 -0
  337. package/skills/pixelcraft-review/scripts/fixtures/focus-visible-no-replacement.css +3 -0
  338. package/skills/pixelcraft-review/scripts/fixtures/focus-visible-valid-replacements.css +9 -0
  339. package/skills/pixelcraft-review/scripts/fixtures/slop.html +28 -0
  340. package/skills/pixelcraft-review/scripts/slop-scan.mjs +1233 -0
  341. package/skills/pixelcraft-spatial/SKILL.md +51 -0
  342. package/skills/pixelcraft-spatial/references/comfort-accessibility.md +39 -0
  343. package/skills/pixelcraft-spatial/references/platforms.md +147 -0
  344. package/skills/pixelcraft-tokens/SKILL.md +60 -0
  345. package/skills/pixelcraft-tokens/assets/tokens.example.json +71 -0
  346. package/skills/pixelcraft-tokens/assets/tokens.modes.example.json +47 -0
  347. package/skills/pixelcraft-tokens/references/adoption.md +55 -0
  348. package/skills/pixelcraft-tokens/references/format.md +84 -0
  349. package/skills/pixelcraft-tokens/references/governance.md +80 -0
  350. package/skills/pixelcraft-tokens/references/state-tokens.md +62 -0
  351. package/skills/pixelcraft-tokens/references/theme-presets.md +122 -0
  352. package/skills/pixelcraft-tokens/references/token-tooling.md +119 -0
  353. package/skills/pixelcraft-tokens/scripts/export-tokens.mjs +847 -0
  354. package/skills/pixelcraft-tui/SKILL.md +76 -0
  355. package/skills/pixelcraft-tui/references/bubbletea-lipgloss.md +79 -0
  356. package/skills/pixelcraft-tui/references/extended-tui-toolkits.md +127 -0
  357. package/skills/pixelcraft-tui/references/ink.md +109 -0
  358. package/skills/pixelcraft-tui/references/ratatui.md +102 -0
  359. package/skills/pixelcraft-tui/references/rich.md +82 -0
  360. package/skills/pixelcraft-tui/references/terminal-protocols.md +80 -0
  361. package/skills/pixelcraft-tui/references/textual.md +108 -0
  362. package/skills/pixelcraft-ux/SKILL.md +56 -0
  363. package/skills/pixelcraft-ux/references/cognitive-walkthrough.md +70 -0
  364. package/skills/pixelcraft-ux/references/feedback-performance.md +50 -0
  365. package/skills/pixelcraft-ux/references/flows-ia.md +44 -0
  366. package/skills/pixelcraft-ux/references/forms.md +151 -0
  367. package/skills/pixelcraft-ux/references/i18n.md +221 -0
  368. package/skills/pixelcraft-ux/references/laws.md +39 -0
  369. package/skills/pixelcraft-ux/references/locale-test-matrix.md +60 -0
  370. package/skills/pixelcraft-ux/references/state-matrix.md +53 -0
  371. package/skills/pixelcraft-ux/references/usability-testing.md +84 -0
  372. package/skills/pixelcraft-ux/references/ux-writing.md +44 -0
  373. package/skills/pixelcraft-visual-qa/SKILL.md +96 -0
  374. package/skills/pixelcraft-visual-qa/references/baseline-governance.md +70 -0
  375. package/skills/pixelcraft-visual-qa/references/capture-desktop-game.md +59 -0
  376. package/skills/pixelcraft-visual-qa/references/capture-document.md +70 -0
  377. package/skills/pixelcraft-visual-qa/references/capture-email.md +38 -0
  378. package/skills/pixelcraft-visual-qa/references/capture-mobile.md +50 -0
  379. package/skills/pixelcraft-visual-qa/references/capture-terminal.md +35 -0
  380. package/skills/pixelcraft-visual-qa/references/critique-rubric.md +71 -0
  381. package/skills/pixelcraft-visual-qa/references/finish-gate.md +35 -0
  382. package/skills/pixelcraft-visual-qa/references/measured-craft.md +30 -0
  383. package/skills/pixelcraft-visual-qa/references/motion-capture.md +63 -0
  384. package/skills/pixelcraft-visual-qa/references/performance-budgets.md +78 -0
  385. package/skills/pixelcraft-visual-qa/references/realtime-graphics.md +55 -0
  386. package/skills/pixelcraft-visual-qa/references/task-verification.md +81 -0
  387. package/skills/pixelcraft-visual-qa/scripts/check-contrast.mjs +442 -0
  388. package/skills/pixelcraft-visual-qa/scripts/check-email.mjs +397 -0
  389. package/skills/pixelcraft-visual-qa/scripts/check-pdf.mjs +189 -0
  390. package/skills/pixelcraft-visual-qa/scripts/check-tui.mjs +321 -0
  391. package/skills/pixelcraft-visual-qa/scripts/finish-gate.mjs +174 -0
  392. package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-aria-modal.html +19 -0
  393. package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-audit.html +34 -0
  394. package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-modal.html +17 -0
  395. package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory-deferred.js +1 -0
  396. package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory-edge.html +52 -0
  397. package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory.html +80 -0
  398. package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory.js +8 -0
  399. package/skills/pixelcraft-visual-qa/scripts/shoot.mjs +668 -0
  400. package/skills/pixelcraft-visual-qa/scripts/style-inventory.mjs +1226 -0
  401. package/skills/pixelcraft-web/SKILL.md +132 -0
  402. package/skills/pixelcraft-web/references/accessibility-performance.md +42 -0
  403. package/skills/pixelcraft-web/references/adaptive-layout.md +69 -0
  404. package/skills/pixelcraft-web/references/angular.md +108 -0
  405. package/skills/pixelcraft-web/references/assets-pipeline.md +67 -0
  406. package/skills/pixelcraft-web/references/astro.md +113 -0
  407. package/skills/pixelcraft-web/references/audio-reactive.md +61 -0
  408. package/skills/pixelcraft-web/references/auth-and-checkout-ui.md +115 -0
  409. package/skills/pixelcraft-web/references/build-and-architecture.md +215 -0
  410. package/skills/pixelcraft-web/references/canvas-and-node-editors.md +157 -0
  411. package/skills/pixelcraft-web/references/clojurescript.md +88 -0
  412. package/skills/pixelcraft-web/references/component-systems.md +102 -0
  413. package/skills/pixelcraft-web/references/component-testing.md +170 -0
  414. package/skills/pixelcraft-web/references/creative-effects.md +59 -0
  415. package/skills/pixelcraft-web/references/creative-runtime.md +34 -0
  416. package/skills/pixelcraft-web/references/elm.md +53 -0
  417. package/skills/pixelcraft-web/references/enterprise-data-ui.md +138 -0
  418. package/skills/pixelcraft-web/references/file-upload-media-ui.md +82 -0
  419. package/skills/pixelcraft-web/references/forms-validation.md +123 -0
  420. package/skills/pixelcraft-web/references/fsharp-fable.md +54 -0
  421. package/skills/pixelcraft-web/references/gsap.md +102 -0
  422. package/skills/pixelcraft-web/references/html-css.md +220 -0
  423. package/skills/pixelcraft-web/references/htmx-alpine.md +103 -0
  424. package/skills/pixelcraft-web/references/i18n-engineering.md +106 -0
  425. package/skills/pixelcraft-web/references/interaction-and-search-primitives.md +196 -0
  426. package/skills/pixelcraft-web/references/java-web.md +61 -0
  427. package/skills/pixelcraft-web/references/kotlin-web.md +57 -0
  428. package/skills/pixelcraft-web/references/leptos-yew.md +97 -0
  429. package/skills/pixelcraft-web/references/lit-web-components.md +63 -0
  430. package/skills/pixelcraft-web/references/local-first-sync.md +105 -0
  431. package/skills/pixelcraft-web/references/media-players.md +104 -0
  432. package/skills/pixelcraft-web/references/motion-react.md +96 -0
  433. package/skills/pixelcraft-web/references/motion-recipes.md +82 -0
  434. package/skills/pixelcraft-web/references/preact-fresh-hono.md +111 -0
  435. package/skills/pixelcraft-web/references/pwa.md +230 -0
  436. package/skills/pixelcraft-web/references/qwik.md +94 -0
  437. package/skills/pixelcraft-web/references/r3f-integration.md +69 -0
  438. package/skills/pixelcraft-web/references/react-next.md +168 -0
  439. package/skills/pixelcraft-web/references/rendering-choice.md +63 -0
  440. package/skills/pixelcraft-web/references/rendering-performance.md +80 -0
  441. package/skills/pixelcraft-web/references/rich-text-and-code-editors.md +220 -0
  442. package/skills/pixelcraft-web/references/rive-lottie.md +73 -0
  443. package/skills/pixelcraft-web/references/scala-laminar.md +53 -0
  444. package/skills/pixelcraft-web/references/scene-architecture.md +132 -0
  445. package/skills/pixelcraft-web/references/server-rendered.md +114 -0
  446. package/skills/pixelcraft-web/references/shader-workflow.md +77 -0
  447. package/skills/pixelcraft-web/references/smooth-scroll.md +58 -0
  448. package/skills/pixelcraft-web/references/solid.md +111 -0
  449. package/skills/pixelcraft-web/references/state-architecture.md +107 -0
  450. package/skills/pixelcraft-web/references/styling-ecosystem.md +273 -0
  451. package/skills/pixelcraft-web/references/svelte.md +111 -0
  452. package/skills/pixelcraft-web/references/tailwind.md +99 -0
  453. package/skills/pixelcraft-web/references/video-media.md +69 -0
  454. package/skills/pixelcraft-web/references/vue-nuxt.md +86 -0
  455. package/skills/pixelcraft-web/references/web-3d-engines.md +97 -0
@@ -0,0 +1,397 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from 'node:child_process';
3
+ import fs from 'node:fs';
4
+ import os from 'node:os';
5
+ import path from 'node:path';
6
+ import { fileURLToPath } from 'node:url';
7
+ import { evaluateEvidence } from '../skills/pixelcraft-visual-qa/scripts/finish-gate.mjs';
8
+
9
+ function help() {
10
+ return `Usage: node scripts/run-evals.mjs [--json]
11
+
12
+ Zero-dependency offline deterministic evaluation harness for Pixelcraft.
13
+ Validates all evals/*.md guides and evals/fixtures/*.json fixtures, reports
14
+ language/ecosystem and surface coverage statistics (JS/TS vs Non-JS/TS vs Mixed),
15
+ and runs deterministic contract checks against slop-scan, export-tokens,
16
+ finish-gate, check-contrast, check-email, check-tui, and check-pdf.
17
+
18
+ Options:
19
+ --json Print machine-readable JSON report
20
+ --help Show this help`;
21
+ }
22
+
23
+ const args = process.argv.slice(2);
24
+ if (args.includes('--help') || args.includes('-h')) {
25
+ console.log(help());
26
+ process.exit(0);
27
+ }
28
+ const jsonOut = args.includes('--json');
29
+ for (const arg of args) {
30
+ if (arg !== '--json') {
31
+ console.error(`run-evals: unknown option '${arg}'`);
32
+ process.exit(1);
33
+ }
34
+ }
35
+
36
+ const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
37
+ const skillsRoot = path.join(root, 'skills');
38
+ const evalsRoot = path.join(root, 'evals');
39
+ const fixturesRoot = path.join(evalsRoot, 'fixtures');
40
+ const namePattern = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
41
+ const isNonEmpty = (v) => typeof v === 'string' && v.trim().length > 0;
42
+
43
+ function listSkills() {
44
+ return new Set(
45
+ fs.readdirSync(skillsRoot, { withFileTypes: true })
46
+ .filter((e) => e.isDirectory() && fs.existsSync(path.join(skillsRoot, e.name, 'SKILL.md')))
47
+ .map((e) => e.name),
48
+ );
49
+ }
50
+
51
+ function classifyEcosystem(fixture) {
52
+ const haystack = [
53
+ fixture.id,
54
+ fixture.title,
55
+ fixture.contextSnapshot?.platform || '',
56
+ fixture.contextSnapshot?.surface || '',
57
+ ].join(' ');
58
+
59
+ const hasNonJs = /\b(swift|swiftui|uikit|appkit|kotlin|jetpack compose|compose|flutter|dart|harmonyos|arkui|arkts|rust|ratatui|gpui|egui|bevy|typst|go\b|bubble tea|lip gloss|ebitengine|godot|gdscript|python|marimo|pyside|pyqt|qt|tkinter|streamlit|gradio|textual|rich|c\+\+|juce|c#|\.net|avalonia|wpf|winui|maui|php|laravel|filament|livewire|ruby|rails|viewcomponent|phlex|elixir|phoenix|liveview|mjml|print css|pdf|tvos|visionos|unity|unreal|love2d|monogame|cocoa)\b/i.test(haystack);
60
+ const hasJsTs = /\b(javascript|typescript|react|next\.js|nextjs|vue|nuxt|svelte|solid|angular|astro|qwik|node|vite|tailwind|css-in-js|gsap|three\.js|r3f|babylon|pixi|playcanvas|mapbox|maplibre|tip-?tap|prosemirror|monaco|codemirror|tanstack|ag grid|electron|tauri|lynxjs|maizzle|react email|ink\b|vscode|webview|chrome mv3|browser extension|raycast|pdf\.js|pptxgenjs|pwa|html5|webxr|spa)\b/i.test(haystack);
61
+
62
+ if (hasNonJs && !hasJsTs) return 'non-js';
63
+ if (hasJsTs && !hasNonJs) return 'js-ts';
64
+ return 'mixed';
65
+ }
66
+
67
+ function checkGuides() {
68
+ const errors = [];
69
+ let guideCount = 0;
70
+ let totalCases = 0;
71
+ for (const entry of fs.readdirSync(evalsRoot, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
72
+ if (!entry.isFile() || !entry.name.endsWith('.md') || entry.name === 'README.md') continue;
73
+ guideCount += 1;
74
+ const text = fs.readFileSync(path.join(evalsRoot, entry.name), 'utf8');
75
+ const headings = [...text.matchAll(/^##\s+Case\b.*$/gm)].map((m) => m[0]);
76
+ if (headings.length === 0) {
77
+ errors.push(`evals/${entry.name}: missing ## Case headings`);
78
+ continue;
79
+ }
80
+ totalCases += headings.length;
81
+ headings.forEach((heading, idx) => {
82
+ const m = /^##\s+Case\s+(\d+)\s+—\s+\S/.exec(heading);
83
+ if (!m) {
84
+ errors.push(`evals/${entry.name}: unnumbered or malformed case heading '${heading}'`);
85
+ } else if (Number(m[1]) !== idx + 1) {
86
+ errors.push(`evals/${entry.name}: expected Case ${idx + 1}, got '${heading}'`);
87
+ }
88
+ });
89
+ }
90
+ return { guideCount, totalCases, errors };
91
+ }
92
+
93
+ function checkFixtures(skillNames) {
94
+ const errors = [];
95
+ const fixtures = [];
96
+ const seenIds = new Set();
97
+ const byEcosystem = { 'non-js': 0, 'js-ts': 0, mixed: 0 };
98
+ const bySkill = {};
99
+ const byMode = {};
100
+
101
+ for (const entry of fs.readdirSync(fixturesRoot, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
102
+ if (!entry.isFile() || !entry.name.endsWith('.json')) continue;
103
+ const rel = `evals/fixtures/${entry.name}`;
104
+ let data;
105
+ try {
106
+ data = JSON.parse(fs.readFileSync(path.join(fixturesRoot, entry.name), 'utf8'));
107
+ } catch (err) {
108
+ errors.push(`${rel}: invalid JSON (${err.message})`);
109
+ continue;
110
+ }
111
+
112
+ if (data.schemaVersion !== 1) errors.push(`${rel}: schemaVersion must be 1`);
113
+ if (!isNonEmpty(data.id) || !namePattern.test(data.id) || data.id !== path.basename(entry.name, '.json')) {
114
+ errors.push(`${rel}: invalid or mismatched id '${data.id}'`);
115
+ } else if (seenIds.has(data.id)) {
116
+ errors.push(`${rel}: duplicate id '${data.id}'`);
117
+ } else {
118
+ seenIds.add(data.id);
119
+ }
120
+ if (!isNonEmpty(data.skill) || !skillNames.has(data.skill)) {
121
+ errors.push(`${rel}: unknown skill '${data.skill}'`);
122
+ }
123
+ if (!isNonEmpty(data.title)) errors.push(`${rel}: missing title`);
124
+ if (!isNonEmpty(data.prompt)) errors.push(`${rel}: missing prompt`);
125
+ if (!data.contextSnapshot || typeof data.contextSnapshot !== 'object') {
126
+ errors.push(`${rel}: missing contextSnapshot`);
127
+ } else {
128
+ for (const k of ['surface', 'platform', 'mode']) {
129
+ if (!isNonEmpty(data.contextSnapshot[k])) errors.push(`${rel}: missing contextSnapshot.${k}`);
130
+ }
131
+ if (!Array.isArray(data.contextSnapshot.states) || !data.contextSnapshot.states.length) {
132
+ errors.push(`${rel}: contextSnapshot.states must be nonempty`);
133
+ }
134
+ if (!Array.isArray(data.contextSnapshot.constraints) || !data.contextSnapshot.constraints.length) {
135
+ errors.push(`${rel}: contextSnapshot.constraints must be nonempty`);
136
+ }
137
+ }
138
+ if (!Array.isArray(data.expectedRouting) || !data.expectedRouting.length) {
139
+ errors.push(`${rel}: expectedRouting must be nonempty`);
140
+ } else {
141
+ const owners = [data.skill, ...data.expectedRouting.filter((x) => isNonEmpty(x) && skillNames.has(x))];
142
+ for (const item of data.expectedRouting) {
143
+ if (/^pixelcraft(?:-[a-z0-9]+)*$/.test(item) && !skillNames.has(item)) {
144
+ errors.push(`${rel}: expectedRouting references unknown skill '${item}'`);
145
+ } else if (typeof item === 'string' && item.startsWith('references/')) {
146
+ const ok = owners.some((owner) => owner && fs.existsSync(path.join(skillsRoot, owner, item)));
147
+ if (!ok) errors.push(`${rel}: expectedRouting references missing file '${item}'`);
148
+ }
149
+ }
150
+ }
151
+ if (!Array.isArray(data.forbiddenBehaviors) || !data.forbiddenBehaviors.length) {
152
+ errors.push(`${rel}: forbiddenBehaviors must be nonempty`);
153
+ }
154
+ if (!Array.isArray(data.rubricDimensions) || !data.rubricDimensions.length) {
155
+ errors.push(`${rel}: rubricDimensions must be nonempty`);
156
+ }
157
+ if (!Array.isArray(data.negativeControls) || !data.negativeControls.length) {
158
+ errors.push(`${rel}: negativeControls must be nonempty`);
159
+ }
160
+ if (!data.baseline || !isNonEmpty(data.baseline.withoutSkill) || !isNonEmpty(data.baseline.withSkill)) {
161
+ errors.push(`${rel}: baseline.withoutSkill and baseline.withSkill required`);
162
+ }
163
+
164
+ const eco = classifyEcosystem(data);
165
+ byEcosystem[eco] += 1;
166
+ bySkill[data.skill] = (bySkill[data.skill] || 0) + 1;
167
+ const mode = data.contextSnapshot?.mode || 'unknown';
168
+ byMode[mode] = (byMode[mode] || 0) + 1;
169
+ fixtures.push({ id: data.id, skill: data.skill, ecosystem: eco, mode });
170
+ }
171
+
172
+ return { count: fixtures.length, byEcosystem, bySkill, byMode, errors };
173
+ }
174
+
175
+ function runNode(scriptRel, scriptArgs) {
176
+ return spawnSync(process.execPath, [path.join(root, scriptRel), ...scriptArgs], { encoding: 'utf8' });
177
+ }
178
+
179
+ function runContractChecks() {
180
+ const checks = [];
181
+ const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'pixelcraft-evals-'));
182
+ const record = (name, label, fn) => {
183
+ try {
184
+ const detail = fn();
185
+ checks.push({ name, label, pass: true, detail });
186
+ } catch (error) {
187
+ checks.push({ name, label, pass: false, detail: error.message });
188
+ }
189
+ };
190
+ const expect = (cond, msg) => {
191
+ if (!cond) throw new Error(msg);
192
+ };
193
+
194
+ try {
195
+ // 1. slop-scan contract
196
+ record('slop-scan', 'static', () => {
197
+ const clean = runNode('skills/pixelcraft-review/scripts/slop-scan.mjs', [
198
+ path.join(root, 'skills/pixelcraft-review/scripts/fixtures/clean.html'), '--json', '--fail-on', 'any',
199
+ ]);
200
+ expect(clean.status === 0, `clean.html failed: ${clean.stderr}`);
201
+ expect(JSON.parse(clean.stdout).score === 0, 'clean.html score should be 0');
202
+
203
+ const slop = runNode('skills/pixelcraft-review/scripts/slop-scan.mjs', [
204
+ path.join(root, 'skills/pixelcraft-review/scripts/fixtures/slop.html'), '--json', '--fail-on', 'p0',
205
+ ]);
206
+ expect(slop.status === 1, 'slop.html must exit 1 under --fail-on p0');
207
+ expect(JSON.parse(slop.stdout).score === 40, 'slop.html score should remain 40');
208
+
209
+ const kt = path.join(tmp, 'Check.kt');
210
+ fs.writeFileSync(kt, 'Text("Price", fontSize = 14.dp)\n');
211
+ const ktRes = runNode('skills/pixelcraft-review/scripts/slop-scan.mjs', [kt, '--json', '--fail-on', 'p1']);
212
+ expect(ktRes.status === 1, 'Compose .dp fontSize must fail under --fail-on p1');
213
+ expect(JSON.parse(ktRes.stdout).findings.some((f) => f.rule === 'compose-dp-font-size'), 'missing compose-dp-font-size');
214
+ return 'clean.html=0, slop.html=40, Compose .dp caught under --fail-on p1';
215
+ });
216
+
217
+ // 2. export-tokens contract
218
+ record('export-tokens', 'static', () => {
219
+ const outDir = path.join(tmp, 'tokens-out');
220
+ const res = runNode('skills/pixelcraft-tokens/scripts/export-tokens.mjs', [
221
+ path.join(root, 'skills/pixelcraft-tokens/assets/tokens.example.json'), '--format', 'all', '--out-dir', outDir,
222
+ ]);
223
+ expect(res.status === 0, `export-tokens failed: ${res.stderr}`);
224
+ const written = fs.readdirSync(outDir);
225
+ expect(written.length === 19, `expected 19 token format files, got ${written.length}`);
226
+ expect(written.includes('tokens-gtk4.css') && written.includes('tokens.typ') && written.includes('tokens.slint'), 'missing new non-JS token outputs');
227
+ return '19/19 DTCG token target formats emitted cleanly';
228
+ });
229
+
230
+ // 3. finish-gate contract
231
+ record('finish-gate', 'static', () => {
232
+ const ev = (artifact, extra = {}) => ({
233
+ result: 'pass', label: 'rendered', method: 'harness', expected: 'ok', observed: 'ok', artifact, ...extra,
234
+ });
235
+ const valid = {
236
+ schemaVersion: 1, surface: 'responsive-web', target: '/', revision: 'eval', task: 'submit', fixture: 'local',
237
+ applicability: { error: true, empty: true, loading: true, theme: { applies: false, reason: 'Single static theme configured' }, 'reduced-motion': { applies: false, reason: 'No CSS or JS animations present' }, 'reflow-320': true },
238
+ layoutMatrix: { 'layout-landscape': { width: 844, height: 390 }, 'layout-short-height': { width: 1280, height: 480 } },
239
+ checks: {
240
+ outcome: ev('o.png', { assertion: 'saved' }),
241
+ input: ev('i.png', { modality: 'keyboard', focus: 'ring visible' }),
242
+ 'width-390': ev('w390.png', { width: 390 }),
243
+ 'width-768': ev('w768.png', { width: 768 }),
244
+ 'width-1440': ev('w1440.png', { width: 1440 }),
245
+ 'layout-landscape': ev('land.png', { width: 844, height: 390 }),
246
+ 'layout-short-height': ev('short.png', { width: 1280, height: 480 }),
247
+ 'reflow-320': ev('r320.png', { width: 320 }),
248
+ error: ev('err.png'), empty: ev('emp.png'), loading: ev('load.png'),
249
+ },
250
+ rounds: [],
251
+ };
252
+ const has = () => true;
253
+ expect(evaluateEvidence(valid, has).status === 'PASS', 'valid manifest should PASS');
254
+ const dup = evaluateEvidence({ ...valid, checks: { ...valid.checks, 'width-768': ev('w390.png', { width: 768 }) } }, has);
255
+ expect(dup.status === 'NOT CHECKED', 'duplicate viewport artifact should be rejected');
256
+ const lazy = evaluateEvidence({ ...valid, applicability: { ...valid.applicability, theme: { applies: false, reason: 'n/a' } } }, has);
257
+ expect(lazy.status === 'NOT CHECKED', 'lazy n/a core floor reason should be rejected');
258
+ return 'valid PASS, duplicate artifact rejected, lazy core-floor excuse rejected';
259
+ });
260
+
261
+ // 4. check-contrast contract
262
+ record('check-contrast', 'static', () => {
263
+ const ok = runNode('skills/pixelcraft-visual-qa/scripts/check-contrast.mjs', [
264
+ path.join(root, 'skills/pixelcraft-tokens/assets/tokens.example.json'), '--json',
265
+ ]);
266
+ expect(ok.status === 0, `check-contrast failed on example tokens: ${ok.stderr}`);
267
+ const parsed = JSON.parse(ok.stdout);
268
+ expect(parsed.pass === true && parsed.label === 'static', 'contrast example should pass with static label');
269
+ return `${parsed.totalPairs} auto-detected pairs verified (WCAG 2.2 + APCA Lc)`;
270
+ });
271
+
272
+ // 5. check-email contract
273
+ record('check-email', 'static', () => {
274
+ const html = path.join(tmp, 'mail.html');
275
+ const txt = path.join(tmp, 'mail.txt');
276
+ fs.writeFileSync(html, '<!doctype html><html lang="en"><head><title>Receipt</title></head><body><table role="presentation"><tr><td>Order confirmed at <a href="https://example.com/1">portal</a>.</td></tr></table></body></html>');
277
+ fs.writeFileSync(txt, 'Order confirmed: https://example.com/1\n');
278
+ const ok = runNode('skills/pixelcraft-visual-qa/scripts/check-email.mjs', [html, '--plaintext', txt, '--json']);
279
+ expect(ok.status === 0 && JSON.parse(ok.stdout).pass === true, 'valid email should pass');
280
+ const bad = path.join(tmp, 'bad-mail.html');
281
+ fs.writeFileSync(bad, '<html><body><div style="display: flex"><img src="a.png"></div></body></html>');
282
+ const fail = runNode('skills/pixelcraft-visual-qa/scripts/check-email.mjs', [bad, '--json']);
283
+ expect(fail.status === 1, 'unsafe email should fail');
284
+ return 'clean email + plaintext PASS; Outlook-unsafe CSS + missing alt FAIL';
285
+ });
286
+
287
+ // 6. check-tui contract
288
+ record('check-tui', 'rendered', () => {
289
+ const ok = runNode('skills/pixelcraft-visual-qa/scripts/check-tui.mjs', [
290
+ '--cols', '80', '--json', '--', process.execPath, '-e', 'console.log("OK billing 12ms");',
291
+ ]);
292
+ expect(ok.status === 0 && JSON.parse(ok.stdout).label === 'rendered', 'clean TUI command should pass');
293
+ const bad = runNode('skills/pixelcraft-visual-qa/scripts/check-tui.mjs', [
294
+ '--cols', '20', '--json', '--', process.execPath, '-e', 'console.log("\\x1b[31m" + "A".repeat(30) + "\\x1b[0m");',
295
+ ]);
296
+ expect(bad.status === 1, 'ANSI leak + overflow should fail');
297
+ return 'NO_COLOR=1 clean command PASS; ANSI leak + overflow FAIL';
298
+ });
299
+
300
+ // 7. check-pdf contract
301
+ record('check-pdf', 'static', () => {
302
+ const good = path.join(tmp, 'ok.pdf');
303
+ fs.writeFileSync(good, Buffer.from('%PDF-1.7\n1 0 obj << /Type /Page /StructTreeRoot 2 0 R /MarkInfo << /Marked true >> /Lang (en) /Title (Invoice) /FontFile2 3 0 R >> endobj\n%%EOF\n', 'latin1'));
304
+ const ok = runNode('skills/pixelcraft-visual-qa/scripts/check-pdf.mjs', [good, '--json']);
305
+ expect(ok.status === 0 && JSON.parse(ok.stdout).pass === true, 'tagged PDF should pass');
306
+ const bad = path.join(tmp, 'bad.pdf');
307
+ fs.writeFileSync(bad, Buffer.from('%PDF-1.4\n1 0 obj << /Type /Page >> endobj\n%%EOF\n', 'latin1'));
308
+ const fail = runNode('skills/pixelcraft-visual-qa/scripts/check-pdf.mjs', [bad, '--json']);
309
+ expect(fail.status === 1, 'untagged PDF should fail');
310
+ return 'tagged PDF with embedded font PASS; untagged PDF FAIL';
311
+ });
312
+
313
+ // 8. check-acceptance contract
314
+ record('check-acceptance', 'static', () => {
315
+ const accFile = path.join(tmp, 'acceptance.json');
316
+ const init = runNode('skills/pixelcraft-review/scripts/check-acceptance.mjs', ['--init', 'desktop', '--out', accFile]);
317
+ expect(init.status === 0, `check-acceptance --init failed: ${init.stderr}`);
318
+ const pending = runNode('skills/pixelcraft-review/scripts/check-acceptance.mjs', [accFile, '--json']);
319
+ expect(pending.status === 1 && JSON.parse(pending.stdout).grade === 'FAIL', 'unwalked checklist must exit 1 FAIL');
320
+ const doc = JSON.parse(fs.readFileSync(accFile, 'utf8'));
321
+ doc.target = 'Northwind Studio Desktop v1.2';
322
+ doc.sowThresholds = {
323
+ devicesAndEnvironments: 'macOS 15 arm64 + Windows 11 24H2 @ 100%/150%/200% DPI',
324
+ numericBudgets: 'Cold start < 500ms, idle CPU < 0.5%, 30m RAM < 180 MB',
325
+ };
326
+ for (const sec of [doc.baseline, doc.surfaceMatrix, doc.platformGates]) {
327
+ for (const item of Object.values(sec)) {
328
+ item.result = 'pass';
329
+ item.label = item.requiresRendered ? 'rendered' : 'static';
330
+ item.evidence = item.requiresRendered
331
+ ? 'qa/desktop-100-200dpi-dark.png + Activity Monitor 30m trace + VoiceOver/NVDA log'
332
+ : 'cargo clippy -- -D warnings + cargo audit + slop-scan score 0';
333
+ }
334
+ }
335
+ fs.writeFileSync(accFile, JSON.stringify(doc, null, 2));
336
+ const clean = runNode('skills/pixelcraft-review/scripts/check-acceptance.mjs', [accFile, '--json']);
337
+ expect(clean.status === 0 && JSON.parse(clean.stdout).grade === 'PASS_STUDIO_10K_20K', 'completed checklist should exit 0 PASS_STUDIO_10K_20K');
338
+ return '14-platform checklist init=FAIL(exit 1) -> Rule #0.3 verified -> PASS_STUDIO_10K_20K(exit 0)';
339
+ });
340
+ } finally {
341
+ fs.rmSync(tmp, { recursive: true, force: true });
342
+ }
343
+
344
+ return checks;
345
+ }
346
+
347
+ const skillNames = listSkills();
348
+ const guides = checkGuides();
349
+ const fixtures = checkFixtures(skillNames);
350
+ const contracts = runContractChecks();
351
+ const failedContracts = contracts.filter((c) => !c.pass);
352
+ const totalErrors = guides.errors.length + fixtures.errors.length + failedContracts.length;
353
+
354
+ const pct = (n, total) => (total ? `${((n / total) * 100).toFixed(1)}%` : '0.0%');
355
+ const report = {
356
+ label: 'static',
357
+ pass: totalErrors === 0,
358
+ guides: {
359
+ count: guides.guideCount,
360
+ totalCases: guides.totalCases,
361
+ errors: guides.errors,
362
+ },
363
+ fixtures: {
364
+ count: fixtures.count,
365
+ coverage: {
366
+ nonJs: { count: fixtures.byEcosystem['non-js'], share: pct(fixtures.byEcosystem['non-js'], fixtures.count) },
367
+ jsTs: { count: fixtures.byEcosystem['js-ts'], share: pct(fixtures.byEcosystem['js-ts'], fixtures.count) },
368
+ mixed: { count: fixtures.byEcosystem.mixed, share: pct(fixtures.byEcosystem.mixed, fixtures.count) },
369
+ },
370
+ bySkill: Object.fromEntries(Object.entries(fixtures.bySkill).sort(([a], [b]) => a.localeCompare(b))),
371
+ byMode: Object.fromEntries(Object.entries(fixtures.byMode).sort(([a], [b]) => a.localeCompare(b))),
372
+ errors: fixtures.errors,
373
+ },
374
+ contracts,
375
+ };
376
+
377
+ if (jsonOut) {
378
+ console.log(JSON.stringify(report, null, 2));
379
+ } else {
380
+ console.log(`Pixelcraft Offline Eval Harness [static + live CLI contracts]`);
381
+ console.log(`Guides: ${guides.guideCount} skill eval guides (${guides.totalCases} numbered cases), ${guides.errors.length} error(s)`);
382
+ console.log(`Fixtures: ${fixtures.count} JSON fixtures, ${fixtures.errors.length} error(s)`);
383
+ console.log(`Ecosystem coverage:`);
384
+ console.log(` - Non-JS/TS: ${report.fixtures.coverage.nonJs.count} (${report.fixtures.coverage.nonJs.share})`);
385
+ console.log(` - JS/TS: ${report.fixtures.coverage.jsTs.count} (${report.fixtures.coverage.jsTs.share})`);
386
+ console.log(` - Mixed: ${report.fixtures.coverage.mixed.count} (${report.fixtures.coverage.mixed.share})`);
387
+ console.log(` - Skills covered: ${Object.keys(report.fixtures.bySkill).length}/${skillNames.size}`);
388
+ console.log(`Deterministic tool contracts:`);
389
+ for (const c of contracts) {
390
+ console.log(` ${c.pass ? 'PASS' : 'FAIL'} [${c.label}] ${c.name} — ${c.detail}`);
391
+ }
392
+ for (const err of [...guides.errors, ...fixtures.errors]) {
393
+ console.error(`ERROR: ${err}`);
394
+ }
395
+ }
396
+
397
+ if (!report.pass) process.exit(1);