@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,359 @@
1
+ #!/usr/bin/env node
2
+ import assert from 'node:assert/strict';
3
+ import { spawnSync } from 'node:child_process';
4
+ import fs from 'node:fs';
5
+ import os from 'node:os';
6
+ import path from 'node:path';
7
+ import { fileURLToPath } from 'node:url';
8
+
9
+ if (process.argv.includes('--help') || process.argv.includes('-h')) {
10
+ console.log('Usage: node scripts/test-cross-platform-qa.mjs\n\nTests check-contrast.mjs, check-email.mjs, check-tui.mjs, and check-pdf.mjs.');
11
+ process.exit(0);
12
+ }
13
+
14
+ const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
15
+ const qaScripts = path.join(root, 'skills/pixelcraft-visual-qa/scripts');
16
+ const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'pixelcraft-cross-qa-'));
17
+
18
+ function runScript(name, args) {
19
+ return spawnSync(process.execPath, [path.join(qaScripts, name), ...args], { encoding: 'utf8' });
20
+ }
21
+
22
+ try {
23
+ // 1. --help contract on all 4 scripts
24
+ for (const script of ['check-contrast.mjs', 'check-email.mjs', 'check-tui.mjs', 'check-pdf.mjs']) {
25
+ const res = runScript(script, ['--help']);
26
+ assert.equal(res.status, 0, `${script} --help failed: ${res.stderr}`);
27
+ assert.match(res.stdout, /Usage:/i, `${script} --help missing Usage text`);
28
+ }
29
+ console.log('ok 1 - all 4 cross-platform QA scripts implement --help');
30
+
31
+ // 2. check-contrast.mjs: auto-detect on bundled tokens.example.json & modes, passing/failing pairs, hex/rgb/oklch, APCA Lc
32
+ const exampleTokens = path.join(root, 'skills/pixelcraft-tokens/assets/tokens.example.json');
33
+ const exRes = runScript('check-contrast.mjs', [exampleTokens, '--json']);
34
+ assert.equal(exRes.status, 0, exRes.stderr || exRes.stdout);
35
+ const exJson = JSON.parse(exRes.stdout);
36
+ assert.equal(exJson.label, 'static');
37
+ assert.equal(exJson.pass, true);
38
+ assert.ok(exJson.totalPairs >= 2, 'should auto-detect semantic foreground/action pairs');
39
+
40
+ const modesTokens = path.join(root, 'skills/pixelcraft-tokens/assets/tokens.modes.example.json');
41
+ const darkRes = runScript('check-contrast.mjs', [modesTokens, '--mode', 'dark', '--json']);
42
+ assert.equal(darkRes.status, 0, darkRes.stderr || darkRes.stdout);
43
+ const darkJson = JSON.parse(darkRes.stdout);
44
+ assert.equal(darkJson.mode, 'dark');
45
+ assert.equal(darkJson.pass, true);
46
+ assert.ok(darkJson.results.some((r) => r.apcaLc < -70), 'dark mode light-on-dark should produce negative APCA Lc');
47
+
48
+ const customTokens = path.join(tmp, 'contrast-tokens.json');
49
+ fs.writeFileSync(customTokens, JSON.stringify({
50
+ color: {
51
+ $type: 'color',
52
+ bg: { $value: '#ffffff' },
53
+ ink: { $value: 'rgb(0, 0, 0)' },
54
+ oklchGood: { $value: 'oklch(0.35 0.12 250)' },
55
+ lowContrast: { $value: '#aaaaaa' },
56
+ uiBorder: { $value: '#767676' },
57
+ },
58
+ }, null, 2));
59
+ const customPairs = path.join(tmp, 'pairs.json');
60
+ fs.writeFileSync(customPairs, JSON.stringify([
61
+ { foreground: 'color.ink', background: 'color.bg', role: 'text', name: 'Black on white' },
62
+ { foreground: 'color.oklchGood', background: 'color.bg', role: 'text', name: 'OKLCH on white' },
63
+ { foreground: 'color.uiBorder', background: 'color.bg', role: 'ui', name: 'UI border' },
64
+ ]));
65
+ const customPass = runScript('check-contrast.mjs', [customTokens, '--pairs', customPairs, '--json']);
66
+ assert.equal(customPass.status, 0, customPass.stderr || customPass.stdout);
67
+ const customJson = JSON.parse(customPass.stdout);
68
+ assert.equal(customJson.results[0].wcagRatio, 21);
69
+ assert.ok(customJson.results[0].apcaLc >= 105 && customJson.results[0].apcaLc <= 107, `unexpected APCA Lc for black-on-white: ${customJson.results[0].apcaLc}`);
70
+ assert.equal(customJson.results[1].pass, true);
71
+ assert.equal(customJson.results[2].pass, true);
72
+
73
+ const failPairs = path.join(tmp, 'fail-pairs.json');
74
+ fs.writeFileSync(failPairs, JSON.stringify([
75
+ { foreground: 'color.lowContrast', background: 'color.bg', role: 'text' },
76
+ ]));
77
+ const customFail = runScript('check-contrast.mjs', [customTokens, '--pairs', failPairs, '--json']);
78
+ assert.equal(customFail.status, 1, 'low contrast text pair (< 4.5:1) must fail');
79
+ const failJson = JSON.parse(customFail.stdout);
80
+ assert.equal(failJson.pass, false);
81
+ assert.equal(failJson.failedPairs, 1);
82
+ console.log('ok 2 - check-contrast.mjs computes exact WCAG 2.2 + APCA Lc for hex/rgb/oklch/DTCG tokens and modes');
83
+
84
+ // 3. check-email.mjs: clean HTML + plaintext passes; Outlook CSS, Gmail >102KB, missing alt/role/lang/title, empty plaintext fail
85
+ const goodEmail = path.join(tmp, 'good-email.html');
86
+ const goodText = path.join(tmp, 'good-email.txt');
87
+ fs.writeFileSync(goodEmail, `<!doctype html>
88
+ <html lang="en">
89
+ <head><title>Invoice #4821</title></head>
90
+ <body>
91
+ <table role="presentation" width="600" cellpadding="0" cellspacing="0">
92
+ <tr><td><img src="https://example.com/logo.png" alt="Northwind Billing" width="120" height="32"></td></tr>
93
+ <tr><td>Invoice #4821 for USD 42.00 is ready. View details at <a href="https://example.com/inv/4821">billing portal</a>.</td></tr>
94
+ </table>
95
+ </body>
96
+ </html>
97
+ `);
98
+ fs.writeFileSync(goodText, 'Invoice #4821 for USD 42.00 is ready.\nView details: https://example.com/inv/4821\n');
99
+ const emailPass = runScript('check-email.mjs', [goodEmail, '--plaintext', goodText, '--json']);
100
+ assert.equal(emailPass.status, 0, emailPass.stderr || emailPass.stdout);
101
+ const emailPassJson = JSON.parse(emailPass.stdout);
102
+ assert.equal(emailPassJson.pass, true);
103
+ assert.equal(emailPassJson.label, 'static');
104
+ assert.equal(emailPassJson.plaintextStatus, 'pass');
105
+
106
+ const badEmail = path.join(tmp, 'bad-email.html');
107
+ const emptyText = path.join(tmp, 'empty-email.txt');
108
+ fs.writeFileSync(badEmail, `<html><head><style>.wrap { display: flex; color: var(--brand); } .grid { display: grid; position: fixed; }</style></head>
109
+ <body><table><tr><td><img src="x.png"></td></tr></table>${' '.repeat(105 * 1024)}</body></html>`);
110
+ fs.writeFileSync(emptyText, ' \n');
111
+ const emailFail = runScript('check-email.mjs', [badEmail, '--plaintext', emptyText, '--json']);
112
+ assert.equal(emailFail.status, 1, 'bad email must fail');
113
+ const emailFailJson = JSON.parse(emailFail.stdout);
114
+ const emailRules = new Set(emailFailJson.findings.map((f) => f.rule));
115
+ for (const expected of ['gmail-clip-risk', 'missing-lang', 'missing-title', 'outlook-unsafe-css', 'img-missing-alt', 'layout-table-missing-role', 'plaintext-empty']) {
116
+ assert.ok(emailRules.has(expected), `missing email finding '${expected}': ${[...emailRules]}`);
117
+ }
118
+
119
+ // Email Studio-Grade checks: image-only link empty alt, short preheader spacer, and --headers RFC 8058 One-Click
120
+ const promoEmail = path.join(tmp, 'promo-email.html');
121
+ const badHeaders = path.join(tmp, 'bad-headers.eml');
122
+ const goodHeaders = path.join(tmp, 'good-headers.eml');
123
+ fs.writeFileSync(promoEmail, `<!doctype html>
124
+ <html lang="en">
125
+ <head>
126
+ <title>Spring Release</title>
127
+ <style>@layer base { .btn { color: #111111; } } ${'/*p*/'.repeat(3500)}</style>
128
+ </head>
129
+ <body>
130
+ <div style="display:none;max-height:0;overflow:hidden;">Preview copy &#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;</div>
131
+ <table role="presentation" width="600">
132
+ <tr><td>Xin chao {{customer_name}}, <a href="https://example.com/buy"><img src="https://example.com/cta.png" alt=""></a></td></tr>
133
+ </table>
134
+ </body>
135
+ </html>`);
136
+ fs.writeFileSync(badHeaders, 'Subject: Spring Release\nList-Unsubscribe: <mailto:unsub@example.com>\n');
137
+ const promoFail = runScript('check-email.mjs', [promoEmail, '--headers', badHeaders, '--json']);
138
+ assert.equal(promoFail.status, 1, 'image-only CTA + short preheader + @layer + >16KB style + merge tag + missing RFC 8058 headers must fail');
139
+ const promoRules = new Set(JSON.parse(promoFail.stdout).findings.map((f) => f.rule));
140
+ for (const expected of ['image-only-link-empty-alt', 'short-preheader-spacer', 'style-block-too-large', 'gmail-unsafe-modern-css', 'unfilled-merge-tag', 'missing-list-unsubscribe', 'missing-one-click-unsubscribe']) {
141
+ assert.ok(promoRules.has(expected), `missing promo email finding '${expected}': ${[...promoRules]}`);
142
+ }
143
+
144
+ fs.writeFileSync(goodHeaders, 'List-Unsubscribe: <https://example.com/unsub?id=1>, <mailto:unsub@example.com>\nList-Unsubscribe-Post: List-Unsubscribe=One-Click\n');
145
+ const headerPass = runScript('check-email.mjs', [goodEmail, '--plaintext', goodText, '--headers', goodHeaders, '--json']);
146
+ assert.equal(headerPass.status, 0, headerPass.stderr || headerPass.stdout);
147
+ assert.equal(JSON.parse(headerPass.stdout).headersStatus, 'pass');
148
+ console.log('ok 3 - check-email.mjs catches Gmail 102KB/>16KB style/@layer, Outlook CSS, image-only CTAs, merge tags, RFC 8058 headers, and plaintext gaps');
149
+
150
+ // 4. check-tui.mjs: clean capture & live NO_COLOR command pass; ZWJ/VS16/NFD grapheme width exact; ANSI/overflow/6-step teardown fail
151
+ const goodTui = path.join(tmp, 'good-tui.txt');
152
+ // Family ZWJ emoji (2 cols) + Warning VS16 (2 cols) + NFD Vietnamese "Tiếng Việt" (10 cols) + CJK "日本" (4 cols)
153
+ const graphemeLine = '👨‍👩‍👧‍👦 ⚠️ Tie\u0302\u0301ng Vie\u0323\u0302t 日本';
154
+ fs.writeFileSync(goodTui, `STATUS SERVICE LATENCY\n${graphemeLine}\n`);
155
+ const tuiPassInput = runScript('check-tui.mjs', ['--input', goodTui, '--cols', '30', '--json']);
156
+ assert.equal(tuiPassInput.status, 0, tuiPassInput.stderr || tuiPassInput.stdout);
157
+ const tuiGraphemeJson = JSON.parse(tuiPassInput.stdout);
158
+ assert.equal(tuiGraphemeJson.label, 'static');
159
+ assert.equal(tuiGraphemeJson.pass, true);
160
+
161
+ // Exact grapheme width check on ZWJ + VS16 + NFD + CJK line (2 + 1 + 2 + 1 + 10 + 1 + 4 = 21 cols)
162
+ const exactGraphemeFile = path.join(tmp, 'grapheme-exact.txt');
163
+ fs.writeFileSync(exactGraphemeFile, `${graphemeLine}\n`);
164
+ const exactRes = JSON.parse(runScript('check-tui.mjs', ['--input', exactGraphemeFile, '--cols', '21', '--json']).stdout);
165
+ assert.equal(exactRes.maxWidth, 21, `expected ZWJ+VS16+NFD+CJK line to equal 21 cols, got ${exactRes.maxWidth}`);
166
+ assert.equal(exactRes.pass, true);
167
+
168
+ const tuiPassCmd = runScript('check-tui.mjs', [
169
+ '--cols', '60', '--json', '--', process.execPath, '-e',
170
+ 'if (process.env.NO_COLOR !== "1") process.exit(2); console.log("Clean TUI line under 60 cols");',
171
+ ]);
172
+ assert.equal(tuiPassCmd.status, 0, tuiPassCmd.stderr || tuiPassCmd.stdout);
173
+ const tuiCmdJson = JSON.parse(tuiPassCmd.stdout);
174
+ assert.equal(tuiCmdJson.label, 'rendered');
175
+ assert.equal(tuiCmdJson.pass, true);
176
+
177
+ const tuiFailAnsiWidth = runScript('check-tui.mjs', [
178
+ '--cols', '40', '--json', '--', process.execPath, '-e',
179
+ 'process.stdout.write("\\x1b[?1049h\\x1b[?2004h\\x1b[?1006h\\x1b[>1u\\x1b[31m" + "X".repeat(55) + "\\x1b[0m\\n"); process.exit(1);',
180
+ ]);
181
+ assert.equal(tuiFailAnsiWidth.status, 1, 'leaking ANSI, overflow, teardown leak, and nonzero exit must fail');
182
+ const tuiFailJson = JSON.parse(tuiFailAnsiWidth.stdout);
183
+ const tuiRules = new Set(tuiFailJson.findings.map((f) => f.rule));
184
+ for (const expected of ['nonzero-exit', 'teardown-leak', 'ansi-leak-no-color', 'line-overflow']) {
185
+ assert.ok(tuiRules.has(expected), `missing TUI finding '${expected}': ${[...tuiRules]}`);
186
+ }
187
+ const teardownMsgs = tuiFailJson.findings.filter((f) => f.rule === 'teardown-leak').map((f) => f.message).join(' | ');
188
+ assert.match(teardownMsgs, /2004h/, 'should report unclosed bracketed paste ?2004h');
189
+ assert.match(teardownMsgs, /1006h/, 'should report unclosed mouse tracking ?1006h');
190
+ assert.match(teardownMsgs, /Kitty keyboard/, 'should report unclosed Kitty keyboard push');
191
+ console.log('ok 4 - check-tui.mjs validates UAX #29 grapheme widths (ZWJ/VS16/NFD/CJK), NO_COLOR, 6-step teardown leaks, and exit status');
192
+
193
+ // 5. check-pdf.mjs: valid tagged PDF passes; subset font missing /ToUnicode fails; --prepress checks /TrimBox /BleedBox /OutputIntents
194
+ const goodPdf = path.join(tmp, 'tagged.pdf');
195
+ fs.writeFileSync(goodPdf, Buffer.from(
196
+ '%PDF-1.7\n'
197
+ + '1 0 obj << /Type /Catalog /Pages 2 0 R /StructTreeRoot 5 0 R /MarkInfo << /Marked true >> /Lang (en-US) >> endobj\n'
198
+ + '2 0 obj << /Type /Pages /Count 2 /Kids [3 0 R 4 0 R] >> endobj\n'
199
+ + '3 0 obj << /Type /Page /Parent 2 0 R >> endobj\n'
200
+ + '4 0 obj << /Type /Page /Parent 2 0 R >> endobj\n'
201
+ + '5 0 obj << /Type /StructTreeRoot >> endobj\n'
202
+ + '6 0 obj << /Title (Quarterly Statement) >> endobj\n'
203
+ + '7 0 obj << /Type /FontDescriptor /FontFile2 8 0 R >> endobj\n'
204
+ + '%%EOF\n',
205
+ 'latin1',
206
+ ));
207
+ const pdfPass = runScript('check-pdf.mjs', [goodPdf, '--json']);
208
+ assert.equal(pdfPass.status, 0, pdfPass.stderr || pdfPass.stdout);
209
+ const pdfPassJson = JSON.parse(pdfPass.stdout);
210
+ assert.equal(pdfPassJson.label, 'static');
211
+ assert.equal(pdfPassJson.validHeader, true);
212
+ assert.equal(pdfPassJson.pageCount, 2);
213
+ assert.equal(pdfPassJson.markers.structTreeRoot, true);
214
+ assert.equal(pdfPassJson.markers.embeddedFonts, true);
215
+ assert.equal(pdfPassJson.pass, true);
216
+
217
+ const subsetNoUnicodePdf = path.join(tmp, 'subset-no-unicode.pdf');
218
+ fs.writeFileSync(subsetNoUnicodePdf, Buffer.from(
219
+ '%PDF-1.7\n'
220
+ + '1 0 obj << /Type /Catalog /StructTreeRoot 2 0 R /MarkInfo << /Marked true >> /Lang (vi-VN) /Title (Bao Cao) >> endobj\n'
221
+ + '3 0 obj << /Type /Page >> endobj\n'
222
+ + '4 0 obj << /Type /Font /Subtype /Type0 /BaseFont /ABCDEF+BeVietnamPro /Encoding /Identity-H /FontFile2 5 0 R >> endobj\n'
223
+ + '%%EOF\n',
224
+ 'latin1',
225
+ ));
226
+ const subsetFail = runScript('check-pdf.mjs', [subsetNoUnicodePdf, '--json']);
227
+ assert.equal(subsetFail.status, 1, 'subset Type0 font without /ToUnicode must fail');
228
+ assert.ok(JSON.parse(subsetFail.stdout).findings.some((f) => f.rule === 'missing-tounicode-cmap'));
229
+
230
+ const prepressFail = runScript('check-pdf.mjs', [goodPdf, '--prepress', '--json']);
231
+ assert.equal(prepressFail.status, 1, '--prepress without TrimBox/BleedBox/OutputIntents/ToUnicode must fail');
232
+ const prepressRules = new Set(JSON.parse(prepressFail.stdout).findings.map((f) => f.rule));
233
+ for (const expected of ['missing-tounicode-cmap', 'missing-trim-box', 'missing-bleed-box', 'missing-output-intent']) {
234
+ assert.ok(prepressRules.has(expected), `missing prepress finding '${expected}': ${[...prepressRules]}`);
235
+ }
236
+
237
+ const prepressPassPdf = path.join(tmp, 'prepress-ok.pdf');
238
+ fs.writeFileSync(prepressPassPdf, Buffer.from(
239
+ '%PDF-1.7\n'
240
+ + '1 0 obj << /Type /Catalog /StructTreeRoot 2 0 R /MarkInfo << /Marked true >> /Lang (en) /Title (Brochure) /OutputIntents [9 0 R] >> endobj\n'
241
+ + '3 0 obj << /Type /Page /TrimBox [0 0 595 842] /BleedBox [-8.5 -8.5 603.5 850.5] >> endobj\n'
242
+ + '4 0 obj << /Type /Font /Subtype /Type0 /BaseFont /ABCDEF+Fraunces /ToUnicode 6 0 R /FontFile2 7 0 R >> endobj\n'
243
+ + '%%EOF\n',
244
+ 'latin1',
245
+ ));
246
+ const prepressOk = runScript('check-pdf.mjs', [prepressPassPdf, '--prepress', '--json']);
247
+ assert.equal(prepressOk.status, 0, prepressOk.stderr || prepressOk.stdout);
248
+
249
+ const untaggedPdf = path.join(tmp, 'untagged.pdf');
250
+ fs.writeFileSync(untaggedPdf, Buffer.from('%PDF-1.4\n1 0 obj << /Type /Page >> endobj\n%%EOF\n', 'latin1'));
251
+ const pdfFail = runScript('check-pdf.mjs', [untaggedPdf, '--json']);
252
+ assert.equal(pdfFail.status, 1, 'untagged PDF without fonts/lang/title must fail');
253
+ const pdfFailRules = new Set(JSON.parse(pdfFail.stdout).findings.map((f) => f.rule));
254
+ for (const expected of ['missing-struct-tree', 'missing-mark-info', 'missing-pdf-lang', 'missing-pdf-title', 'unembedded-fonts']) {
255
+ assert.ok(pdfFailRules.has(expected), `missing PDF finding '${expected}': ${[...pdfFailRules]}`);
256
+ }
257
+
258
+ const fakePdf = path.join(tmp, 'not-a-pdf.pdf');
259
+ fs.writeFileSync(fakePdf, '<html>not a pdf</html>');
260
+ const fakePdfRes = runScript('check-pdf.mjs', [fakePdf, '--json']);
261
+ assert.equal(fakePdfRes.status, 1);
262
+ assert.equal(JSON.parse(fakePdfRes.stdout).findings[0].rule, 'invalid-pdf-header');
263
+ console.log('ok 5 - check-pdf.mjs validates %PDF header, PDF/UA markers, embedded fonts, /ToUnicode CMap, and --prepress PDF/X gates');
264
+
265
+ // 6. check-acceptance.mjs: all 14 platforms initialize cleanly, pending/static-on-rendered fail (Rule #0.3), PASS_STUDIO_10K_20K & EXCEEDS_STUDIO pass
266
+ const acceptanceCli = path.join(root, 'skills/pixelcraft-review/scripts/check-acceptance.mjs');
267
+ const runAcc = (args) => spawnSync(process.execPath, [acceptanceCli, ...args], { encoding: 'utf8' });
268
+
269
+ const accHelp = runAcc(['--help']);
270
+ assert.equal(accHelp.status, 0);
271
+ assert.match(accHelp.stdout, /Rule #0\.3/);
272
+
273
+ const listRes = JSON.parse(runAcc(['--list-platforms', '--json']).stdout);
274
+ assert.equal(listRes.platforms.length, 14, `expected 14 platforms, got ${listRes.platforms.length}`);
275
+
276
+ // Unwalked initialized template must exit 1 (FAIL) so agents cannot stop without filling it
277
+ const accPath = path.join(tmp, 'web-acceptance.json');
278
+ const initRes = runAcc(['--init', 'web', '--out', accPath]);
279
+ assert.equal(initRes.status, 0, initRes.stderr);
280
+ const rawFail = runAcc([accPath, '--json']);
281
+ assert.equal(rawFail.status, 1, 'unwalked pending template must fail');
282
+ assert.equal(JSON.parse(rawFail.stdout).grade, 'FAIL');
283
+
284
+ // Fill every row, intentionally violating Rule #0.3 (marking A4-accessibility pass with static!)
285
+ const manifest = JSON.parse(fs.readFileSync(accPath, 'utf8'));
286
+ manifest.target = 'https://billing.example.com/checkout';
287
+ manifest.sowThresholds = {
288
+ devicesAndEnvironments: 'Chrome/Firefox/Safari macOS + iPhone 15 Safari + Galaxy S23 Chrome under 4G throttle',
289
+ numericBudgets: 'LCP <= 2.5s, INP <= 200ms, CLS <= 0.1, initial JS+CSS <= 220 KB gzip',
290
+ };
291
+ for (const sec of [manifest.baseline, manifest.surfaceMatrix, manifest.platformGates]) {
292
+ for (const item of Object.values(sec)) {
293
+ item.result = 'pass';
294
+ item.label = item.requiresRendered ? 'rendered' : 'static';
295
+ item.evidence = item.requiresRendered
296
+ ? 'visual-qa/checkout-390-768-1440.png + Lighthouse 3-run median Perf 94 / A11y 98'
297
+ : 'slop-scan score 0 + tsc --noEmit exit 0 + package-lock.json audit clean';
298
+ }
299
+ }
300
+ manifest.baseline['A4-accessibility-floor'].label = 'static'; // Violates Rule #0.3!
301
+ fs.writeFileSync(accPath, JSON.stringify(manifest, null, 2));
302
+ const rule03Fail = runAcc([accPath, '--json']);
303
+ assert.equal(rule03Fail.status, 1, 'Rule #0.3 violation (static on requiresRendered) must exit 1');
304
+ const rule03Json = JSON.parse(rule03Fail.stdout);
305
+ assert.equal(rule03Json.grade, 'FAIL');
306
+ assert.equal(rule03Json.issues[0].rule, 'static-or-model-judgment-insufficient');
307
+
308
+ // Fix Rule #0.3, test PENDING_RENDERED_ENV (exit 2 without flag, exit 0 with --allow-not-checked)
309
+ manifest.baseline['A4-accessibility-floor'].label = 'rendered';
310
+ manifest.platformGates['WEB-6-deliverable-bundle'] = {
311
+ ...manifest.platformGates['WEB-6-deliverable-bundle'],
312
+ result: 'not-checked',
313
+ label: 'not-checked',
314
+ reason: 'Physical iPhone Safari device unavailable in headless Linux CI container',
315
+ };
316
+ fs.writeFileSync(accPath, JSON.stringify(manifest, null, 2));
317
+ const envBlocked = runAcc([accPath, '--json']);
318
+ assert.equal(envBlocked.status, 2, 'PENDING_RENDERED_ENV must exit 2 by default');
319
+ assert.equal(JSON.parse(envBlocked.stdout).grade, 'PENDING_RENDERED_ENV');
320
+ const envAllowed = runAcc([accPath, '--allow-not-checked', '--json']);
321
+ assert.equal(envAllowed.status, 0, '--allow-not-checked should exit 0 while keeping PENDING_RENDERED_ENV grade');
322
+ assert.equal(JSON.parse(envAllowed.stdout).grade, 'PENDING_RENDERED_ENV');
323
+
324
+ // Full rendered pass + valid client waiver -> PASS_STUDIO_10K_20K (exit 0)
325
+ manifest.platformGates['WEB-6-deliverable-bundle'] = {
326
+ title: manifest.platformGates['WEB-6-deliverable-bundle'].title,
327
+ requiresRendered: true,
328
+ result: 'pass',
329
+ label: 'rendered',
330
+ evidence: 'qa/lighthouse-median-3runs.json + qa/safari-ios18-recording.mp4 + qa/voiceover-notes.md',
331
+ };
332
+ manifest.surfaceMatrix['M7-text-scale-and-localization'] = {
333
+ title: manifest.surfaceMatrix['M7-text-scale-and-localization'].title,
334
+ requiresRendered: true,
335
+ result: 'pass',
336
+ label: 'waived',
337
+ approvedBy: 'Client SOW §4.2 (2026-11-25)',
338
+ scope: 'RTL Arabic mirroring deferred to Phase 2; 200% zoom & EN/VI verified',
339
+ consequence: 'RTL locales remain unsupported in v1.0 launch',
340
+ };
341
+ fs.writeFileSync(accPath, JSON.stringify(manifest, null, 2));
342
+ const studioPass = runAcc([accPath, '--json']);
343
+ assert.equal(studioPass.status, 0, studioPass.stderr || studioPass.stdout);
344
+ assert.equal(JSON.parse(studioPass.stdout).grade, 'PASS_STUDIO_10K_20K');
345
+
346
+ // Adding verified usability study -> EXCEEDS_STUDIO (exit 0)
347
+ manifest.exceeds = [
348
+ { id: 'usability-study-8-users', result: 'pass', label: 'rendered', evidence: 'research/moderated-checkout-study-n8.md (8/8 task completion)' },
349
+ ];
350
+ fs.writeFileSync(accPath, JSON.stringify(manifest, null, 2));
351
+ const exceedsPass = runAcc([accPath, '--json']);
352
+ assert.equal(exceedsPass.status, 0);
353
+ assert.equal(JSON.parse(exceedsPass.stdout).grade, 'EXCEEDS_STUDIO');
354
+ console.log('ok 6 - check-acceptance.mjs enforces all 14 platform checklists, Rule #0.3 rendered-evidence law, waivers, and 3-tier Studio grading');
355
+
356
+ console.log('cross-platform QA CLI tests passed');
357
+ } finally {
358
+ fs.rmSync(tmp, { recursive: true, force: true });
359
+ }
@@ -0,0 +1,203 @@
1
+ import assert from 'node:assert/strict';
2
+ import { execFileSync } 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 { inflateRawSync } from 'node:zlib';
8
+
9
+ if (process.argv.includes('--help')) {
10
+ console.log('Usage: npm run test:distribution -- [--release]');
11
+ process.exit(0);
12
+ }
13
+
14
+ const root = fileURLToPath(new URL('..', import.meta.url));
15
+ const json = (relativePath) => JSON.parse(fs.readFileSync(path.join(root, relativePath), 'utf8'));
16
+ const pkg = json('package.json');
17
+ const portable = json('plugin.json');
18
+ const claudeCatalog = json('.claude-plugin/marketplace.json');
19
+ const claudePlugin = json('.claude-plugin/plugin.json');
20
+ const cursorPlugin = json('.cursor-plugin/plugin.json');
21
+ const cursorCatalog = json('.cursor-plugin/marketplace.json');
22
+ const antigravityPlugin = json('.antigravity-plugin/plugin.json');
23
+ const codexPlugin = json('.codex-plugin/plugin.json');
24
+ const codexCatalog = json('.agents/plugins/marketplace.json');
25
+ const copilotCatalog = json('.github/plugin/marketplace.json');
26
+ const devinPlugin = json('.devin-plugin/plugin.json');
27
+ const gemini = json('gemini-extension.json');
28
+ const skillDirectories = fs.readdirSync(path.join(root, 'skills'), { withFileTypes: true })
29
+ .filter((entry) => entry.isDirectory() && fs.existsSync(path.join(root, 'skills', entry.name, 'SKILL.md')))
30
+ .map((entry) => `./skills/${entry.name}`)
31
+ .sort();
32
+
33
+ assert.equal(claudeCatalog.plugins.length, 1);
34
+ const [claude] = claudeCatalog.plugins;
35
+ for (const manifest of [
36
+ portable,
37
+ claude,
38
+ claudePlugin,
39
+ cursorPlugin,
40
+ antigravityPlugin,
41
+ codexPlugin,
42
+ devinPlugin,
43
+ gemini,
44
+ ]) {
45
+ assert.equal(manifest.name, 'pixelcraft');
46
+ assert.equal(manifest.version, pkg.version);
47
+ }
48
+ assert.equal(claude.source, './');
49
+ assert.equal(claude.strict, undefined);
50
+ assert.equal(claude.skills, undefined, 'Claude discovers the canonical skills/ directory from the plugin root');
51
+ assert.equal(claudePlugin.icon, undefined, 'Claude plugin manifest must omit directory-only icon for Cowork sync');
52
+
53
+ // Agent Plugins 1.0.0 closed top-level schema check
54
+ assert.equal(portable.$schema, 'https://agent-plugins.org/schemas/1.0.0/plugin.schema.json');
55
+ const allowedAgentPluginKeys = new Set([
56
+ '$schema', 'name', 'version', 'description', 'author', 'homepage', 'repository', 'license', 'keywords', 'extensions',
57
+ ]);
58
+ for (const key of Object.keys(portable)) {
59
+ assert.ok(allowedAgentPluginKeys.has(key), `unexpected top-level key in plugin.json: ${key}`);
60
+ }
61
+
62
+ // Antigravity strict JSON schema check (https://antigravity.google/schemas/v1/plugin.json)
63
+ assert.equal(antigravityPlugin.$schema, 'https://antigravity.google/schemas/v1/plugin.json');
64
+ const allowedAntigravityKeys = new Set([
65
+ '$schema', 'name', 'displayName', 'description', 'version', 'disabled', 'logo',
66
+ 'suggestedPrompts', 'skills', 'author', 'homepage', 'repository', 'license', 'keywords', 'extensions',
67
+ ]);
68
+ for (const key of Object.keys(antigravityPlugin)) {
69
+ assert.ok(allowedAntigravityKeys.has(key), `unexpected key in .antigravity-plugin/plugin.json: ${key}`);
70
+ }
71
+ assert.ok(antigravityPlugin.suggestedPrompts.length >= 1 && antigravityPlugin.suggestedPrompts.length <= 3);
72
+ assert.ok(fs.existsSync(path.join(root, antigravityPlugin.logo)), `missing antigravity logo: ${antigravityPlugin.logo}`);
73
+
74
+ // Cursor plugin & marketplace schema checks
75
+ assert.equal(cursorPlugin.skills, './skills/');
76
+ assert.ok(fs.existsSync(path.join(root, cursorPlugin.logo)), `missing cursor logo: ${cursorPlugin.logo}`);
77
+ assert.equal(cursorCatalog.name, 'pixelcraft');
78
+ assert.equal(cursorCatalog.metadata.version, pkg.version);
79
+ assert.equal(cursorCatalog.plugins[0].name, 'pixelcraft');
80
+ assert.equal(cursorCatalog.plugins[0].source, './');
81
+
82
+ // Codex plugin & .agents marketplace checks
83
+ assert.equal(codexPlugin.skills, './skills/');
84
+ assert.equal(codexPlugin.interface.displayName, codexCatalog.interface.displayName);
85
+ assert.ok(fs.existsSync(path.join(root, codexPlugin.interface.logo)), `missing codex logo: ${codexPlugin.interface.logo}`);
86
+ assert.ok(fs.existsSync(path.join(root, codexPlugin.interface.composerIcon)), `missing codex composerIcon: ${codexPlugin.interface.composerIcon}`);
87
+ assert.equal(codexCatalog.plugins[0].name, portable.name);
88
+ assert.equal(codexCatalog.plugins[0].source.source, 'local');
89
+ assert.equal(path.resolve(root, codexCatalog.plugins[0].source.path), path.resolve(root));
90
+ assert.equal(portable.extensions['com.openai'].interface.displayName, codexCatalog.interface.displayName);
91
+
92
+ // GitHub Copilot marketplace check
93
+ assert.equal(copilotCatalog.name, 'pixelcraft');
94
+ assert.equal(copilotCatalog.metadata.version, pkg.version);
95
+ assert.equal(copilotCatalog.plugins[0].name, 'pixelcraft');
96
+ assert.equal(copilotCatalog.plugins[0].version, pkg.version);
97
+ assert.equal(copilotCatalog.plugins[0].source, './');
98
+
99
+ // Gemini CLI extension contextFileName check
100
+ assert.equal(gemini.contextFileName, 'GEMINI.md');
101
+ assert.ok(fs.existsSync(path.join(root, gemini.contextFileName)), 'missing GEMINI.md');
102
+
103
+ assert.deepEqual(pkg.pi.skills, ['./skills']);
104
+ console.log('ok - all native multi-platform manifests share the canonical skill root, strict schema fields, and package version');
105
+
106
+ if (process.argv.includes('--release')) {
107
+ assert.equal(process.env.GITHUB_REF, `refs/tags/v${pkg.version}`, 'the release tag must match package.json');
108
+ }
109
+
110
+ const packArgs = ['pack', '--dry-run', '--json'];
111
+ const npmCli = process.env.npm_execpath;
112
+ const rawPack = JSON.parse(execFileSync(npmCli ? process.execPath : 'npm', npmCli ? [npmCli, ...packArgs] : packArgs, {
113
+ cwd: root,
114
+ encoding: 'utf8',
115
+ }));
116
+ const pack = Array.isArray(rawPack) ? rawPack[0] : (rawPack.files ? rawPack : rawPack[pkg.name] || Object.values(rawPack)[0]);
117
+ assert.equal(pack.name, '@thanhnguyxn/pixelcraft');
118
+ assert.equal(pkg.publishConfig.access, 'public');
119
+ assert.deepEqual(pkg.bin, { pixelcraft: 'bin/pixelcraft.mjs' });
120
+ const files = new Set(pack.files.map((entry) => entry.path));
121
+ for (const expected of [
122
+ 'package.json',
123
+ pkg.bin.pixelcraft,
124
+ 'plugin.json',
125
+ 'gemini-extension.json',
126
+ 'GEMINI.md',
127
+ 'scripts/build-skill-zips.mjs',
128
+ '.claude-plugin/marketplace.json',
129
+ '.claude-plugin/plugin.json',
130
+ '.cursor-plugin/plugin.json',
131
+ '.cursor-plugin/marketplace.json',
132
+ '.antigravity-plugin/plugin.json',
133
+ '.codex-plugin/plugin.json',
134
+ '.agents/plugins/marketplace.json',
135
+ '.github/plugin/marketplace.json',
136
+ '.devin-plugin/plugin.json',
137
+ 'assets/pixelcraft-logo-128.png',
138
+ 'assets/pixelcraft-logo-256.png',
139
+ 'assets/pixelcraft-logo-512.png',
140
+ ]) {
141
+ assert.ok(files.has(expected), `missing from npm package: ${expected}`);
142
+ }
143
+ for (const directory of skillDirectories) {
144
+ const skill = `${directory.slice(2)}/SKILL.md`;
145
+ assert.ok(files.has(skill), `missing from npm package: ${skill}`);
146
+ }
147
+ console.log(`ok - npm pack --dry-run includes the CLI, all multi-platform host manifests, and canonical skills for ${pack.name}@${pack.version}`);
148
+
149
+ function countFiles(folder) {
150
+ return fs.readdirSync(folder, { withFileTypes: true }).reduce((count, entry) =>
151
+ count + (entry.isDirectory() ? countFiles(path.join(folder, entry.name)) : Number(entry.isFile())), 0);
152
+ }
153
+
154
+ const output = fs.mkdtempSync(path.join(os.tmpdir(), 'pixelcraft-skill-zips-'));
155
+ try {
156
+ execFileSync(process.execPath, [path.join(root, 'scripts/build-skill-zips.mjs'), '--out', output]);
157
+ assert.deepEqual(fs.readdirSync(output).sort(), skillDirectories.map((directory) => `${path.basename(directory)}.zip`).sort());
158
+ for (const directory of skillDirectories) {
159
+ const folder = path.basename(directory);
160
+ const zip = fs.readFileSync(path.join(output, `${folder}.zip`));
161
+ const end = zip.length - 22;
162
+ assert.equal(zip.readUInt32LE(end), 0x06054b50);
163
+ let cursor = zip.readUInt32LE(end + 16);
164
+ const entries = new Set();
165
+ for (let n = 0; n < zip.readUInt16LE(end + 10); n++) {
166
+ assert.equal(zip.readUInt32LE(cursor), 0x02014b50);
167
+ const nameLength = zip.readUInt16LE(cursor + 28);
168
+ const name = zip.toString('utf8', cursor + 46, cursor + 46 + nameLength);
169
+ assert.ok(name.startsWith(`${folder}/`) && !name.split('/').includes('..') && !entries.has(name), name);
170
+ entries.add(name);
171
+ const local = zip.readUInt32LE(cursor + 42);
172
+ const start = local + 30 + zip.readUInt16LE(local + 26);
173
+ assert.deepEqual(inflateRawSync(zip.subarray(start, start + zip.readUInt32LE(cursor + 20))),
174
+ fs.readFileSync(path.join(root, 'skills', name)), name);
175
+ cursor += 46 + nameLength;
176
+ }
177
+ assert.equal(entries.size, countFiles(path.join(root, directory)));
178
+ assert.ok(entries.has(`${folder}/SKILL.md`));
179
+ }
180
+ console.log(`ok - all ${skillDirectories.length} upload ZIPs contain one canonical skill and all its bundled files`);
181
+ } finally {
182
+ fs.rmSync(output, { recursive: true, force: true });
183
+ }
184
+
185
+ const checkout = fs.mkdtempSync(path.join(os.tmpdir(), 'pixelcraft-default-builds-'));
186
+ try {
187
+ fs.cpSync(path.join(root, 'skills'), path.join(checkout, 'skills'), { recursive: true });
188
+ fs.cpSync(path.join(root, 'scripts'), path.join(checkout, 'scripts'), { recursive: true });
189
+ const run = (script) => execFileSync(process.execPath, [path.join(checkout, 'scripts', script)]);
190
+ run('build-skill-zips.mjs');
191
+ const archive = path.join(checkout, 'skill-zips', 'pixelcraft.zip');
192
+ const original = fs.readFileSync(archive);
193
+ run('build-adapters.mjs');
194
+ run('build-adapters.mjs');
195
+ assert.deepEqual(fs.readFileSync(archive), original);
196
+ fs.rmSync(path.dirname(archive), { recursive: true });
197
+ run('build-skill-zips.mjs');
198
+ assert.deepEqual(fs.readFileSync(archive), original);
199
+ assert.ok(fs.existsSync(path.join(checkout, 'dist', 'manifest.json')));
200
+ console.log('ok - default skill ZIPs and adapters can build in either order and survive adapter rebuilds');
201
+ } finally {
202
+ fs.rmSync(checkout, { recursive: true, force: true });
203
+ }