@thanhnguyxn/pixelcraft 0.1.0 → 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 (376) hide show
  1. package/.agents/plugins/marketplace.json +1 -1
  2. package/.antigravity-plugin/plugin.json +32 -0
  3. package/.claude-plugin/marketplace.json +1 -1
  4. package/.claude-plugin/plugin.json +15 -4
  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/README.md +185 -328
  13. package/SECURITY.md +28 -0
  14. package/assets/pixelcraft-logo-128.png +0 -0
  15. package/assets/pixelcraft-logo-256.png +0 -0
  16. package/bin/pixelcraft.mjs +431 -23
  17. package/docs/ARCHITECTURE.md +40 -37
  18. package/docs/DESIGN-RATIONALE.md +51 -3
  19. package/docs/INSTALL.md +221 -0
  20. package/evals/README.md +16 -6
  21. package/evals/fixtures/3d-web-engineering.json +69 -0
  22. package/evals/fixtures/acceptance-checklist-rule03-gate.json +43 -0
  23. package/evals/fixtures/ai-ui-libraries.json +53 -0
  24. package/evals/fixtures/audio-visual-accessibility.json +69 -0
  25. package/evals/fixtures/auth-and-checkout-ui.json +53 -0
  26. package/evals/fixtures/brandkit-identity-governance.json +48 -0
  27. package/evals/fixtures/build-and-architecture.json +53 -0
  28. package/evals/fixtures/canvas-and-node-editors.json +53 -0
  29. package/evals/fixtures/chat-ai-exfiltration-ime-hitl-gate.json +43 -0
  30. package/evals/fixtures/completion-gate-scan-until-clean.json +44 -0
  31. package/evals/fixtures/component-systems.json +53 -0
  32. package/evals/fixtures/component-testing.json +53 -0
  33. package/evals/fixtures/constrained-voice-and-tv.json +43 -0
  34. package/evals/fixtures/creative-code-rendering.json +69 -0
  35. package/evals/fixtures/creative-reference-evidence.json +67 -0
  36. package/evals/fixtures/data-app-python-marimo.json +49 -0
  37. package/evals/fixtures/desktop-cpp-juce-audio.json +49 -0
  38. package/evals/fixtures/desktop-csharp-avalonia.json +49 -0
  39. package/evals/fixtures/desktop-native-workspace.json +48 -0
  40. package/evals/fixtures/desktop-python-anti-tkinter.json +49 -0
  41. package/evals/fixtures/document-prepress-pdfx4-tounicode.json +43 -0
  42. package/evals/fixtures/document-rust-typst-invoice.json +49 -0
  43. package/evals/fixtures/document-typst-and-print-css.json +43 -0
  44. package/evals/fixtures/email-mjml-dark-mode.json +49 -0
  45. package/evals/fixtures/email-outlook-and-plaintext.json +43 -0
  46. package/evals/fixtures/enterprise-data-ui.json +53 -0
  47. package/evals/fixtures/extended-tui-toolkits.json +53 -0
  48. package/evals/fixtures/extensions-mv3-and-vscode.json +43 -0
  49. package/evals/fixtures/file-upload-media-ui.json +53 -0
  50. package/evals/fixtures/forms-validation.json +53 -0
  51. package/evals/fixtures/game-go-ebitengine.json +49 -0
  52. package/evals/fixtures/game-godot-gdscript.json +49 -0
  53. package/evals/fixtures/game-ui-hud-and-engines.json +43 -0
  54. package/evals/fixtures/i18n-engineering.json +53 -0
  55. package/evals/fixtures/local-first-sync.json +53 -0
  56. package/evals/fixtures/lynxjs.json +53 -0
  57. package/evals/fixtures/maizzle-email.json +53 -0
  58. package/evals/fixtures/maps-geospatial.json +53 -0
  59. package/evals/fixtures/media-og-and-video-export.json +43 -0
  60. package/evals/fixtures/media-players.json +53 -0
  61. package/evals/fixtures/mobile-compose-16kb-foldable-store-gate.json +44 -0
  62. package/evals/fixtures/mobile-elixir-liveview-native.json +49 -0
  63. package/evals/fixtures/mobile-flutter-dynamic-type.json +49 -0
  64. package/evals/fixtures/mobile-harmonyos-arkui.json +49 -0
  65. package/evals/fixtures/mobile-jetpack-compose.json +49 -0
  66. package/evals/fixtures/mobile-swiftui-ios.json +49 -0
  67. package/evals/fixtures/motion-engineering.json +69 -0
  68. package/evals/fixtures/pdfjs-and-pptx.json +53 -0
  69. package/evals/fixtures/plan-discovery-interview.json +31 -0
  70. package/evals/fixtures/plan-grill-me-brainstorm-gate.json +49 -0
  71. package/evals/fixtures/reactive-data-apps.json +53 -0
  72. package/evals/fixtures/review-evidence-audit.json +43 -0
  73. package/evals/fixtures/rich-text-and-code-editors.json +53 -0
  74. package/evals/fixtures/scrollytelling-resilience.json +70 -0
  75. package/evals/fixtures/spatial-xr-comfort-and-platforms.json +43 -0
  76. package/evals/fixtures/state-architecture.json +53 -0
  77. package/evals/fixtures/styling-ecosystem.json +53 -0
  78. package/evals/fixtures/token-tooling.json +53 -0
  79. package/evals/fixtures/tui-go-bubbletea.json +49 -0
  80. package/evals/fixtures/tui-rust-ratatui-grapheme-paste-teardown.json +44 -0
  81. package/evals/fixtures/tui-rust-ratatui.json +49 -0
  82. package/evals/fixtures/ux-state-matrix-and-i18n.json +43 -0
  83. package/evals/fixtures/web-3d-engines.json +53 -0
  84. package/evals/fixtures/web-php-laravel-filament.json +49 -0
  85. package/evals/fixtures/web-ruby-viewcomponent-phlex.json +49 -0
  86. package/evals/pixelcraft-accessibility.md +17 -0
  87. package/evals/pixelcraft-craft.md +16 -0
  88. package/evals/pixelcraft-dataviz.md +3 -3
  89. package/evals/pixelcraft-direction.md +17 -0
  90. package/evals/pixelcraft-game-ui.md +3 -3
  91. package/evals/pixelcraft-mobile.md +3 -3
  92. package/evals/pixelcraft-patterns.md +16 -0
  93. package/evals/pixelcraft-plan.md +65 -3
  94. package/evals/pixelcraft-review.md +3 -3
  95. package/evals/pixelcraft-visual-qa.md +11 -5
  96. package/evals/pixelcraft-web.md +21 -3
  97. package/evals/pixelcraft.md +4 -4
  98. package/gemini-extension.json +3 -2
  99. package/install.ps1 +57 -11
  100. package/install.sh +82 -7
  101. package/package.json +32 -4
  102. package/plugin.json +6 -1
  103. package/scripts/build-adapters.mjs +11 -13
  104. package/scripts/run-evals.mjs +397 -0
  105. package/scripts/sync-docs.mjs +381 -0
  106. package/scripts/test-build-adapters.mjs +14 -1
  107. package/scripts/test-cross-platform-qa.mjs +359 -0
  108. package/scripts/test-distribution.mjs +86 -7
  109. package/scripts/test-export-tokens.mjs +259 -3
  110. package/scripts/test-finish-gate.mjs +133 -10
  111. package/scripts/test-installers.mjs +155 -6
  112. package/scripts/test-shoot.mjs +23 -1
  113. package/scripts/test-slop-scan.mjs +390 -3
  114. package/scripts/test-style-inventory.mjs +23 -0
  115. package/scripts/test-sync-docs.mjs +140 -0
  116. package/scripts/test-validate-skills.mjs +82 -4
  117. package/scripts/validate-skills.mjs +149 -3
  118. package/skills/pixelcraft/SKILL.md +67 -47
  119. package/skills/pixelcraft/references/design-brief.md +2 -2
  120. package/skills/pixelcraft/references/floor.md +36 -19
  121. package/skills/pixelcraft/references/report-template.md +25 -11
  122. package/skills/pixelcraft/references/stack-detection.md +138 -67
  123. package/skills/pixelcraft/references/surface-acceptance.md +33 -21
  124. package/skills/pixelcraft/references/workflow-checkpoints.md +49 -7
  125. package/skills/pixelcraft-accessibility/SKILL.md +34 -13
  126. package/skills/pixelcraft-accessibility/references/apg-patterns.md +13 -0
  127. package/skills/pixelcraft-accessibility/references/motion-canvas.md +57 -0
  128. package/skills/pixelcraft-accessibility/references/platforms.md +34 -6
  129. package/skills/pixelcraft-accessibility/references/verification.md +15 -10
  130. package/skills/pixelcraft-accessibility/references/wcag22-checks.md +38 -5
  131. package/skills/pixelcraft-brandkit/SKILL.md +42 -30
  132. package/skills/pixelcraft-brandkit/references/asset-pipeline.md +90 -50
  133. package/skills/pixelcraft-brandkit/references/brand-governance.md +29 -27
  134. package/skills/pixelcraft-brandkit/references/logo-methods.md +33 -34
  135. package/skills/pixelcraft-brandkit/references/prompt-template.md +53 -51
  136. package/skills/pixelcraft-brandkit/references/qa-checklist.md +7 -2
  137. package/skills/pixelcraft-brandkit/references/visual-modes.md +16 -16
  138. package/skills/pixelcraft-chat-ui/SKILL.md +31 -27
  139. package/skills/pixelcraft-chat-ui/references/agentic-workspace.md +66 -0
  140. package/skills/pixelcraft-chat-ui/references/ai-ui-libraries.md +259 -0
  141. package/skills/pixelcraft-chat-ui/references/conversation-design.md +12 -6
  142. package/skills/pixelcraft-chat-ui/references/mobile-business-platforms.md +58 -68
  143. package/skills/pixelcraft-chat-ui/references/slack-discord.md +60 -76
  144. package/skills/pixelcraft-constrained/SKILL.md +21 -20
  145. package/skills/pixelcraft-constrained/references/specialized-hardware.md +69 -45
  146. package/skills/pixelcraft-constrained/references/tv-wearables.md +123 -73
  147. package/skills/pixelcraft-constrained/references/voice-ui.md +86 -45
  148. package/skills/pixelcraft-craft/SKILL.md +29 -15
  149. package/skills/pixelcraft-craft/references/color.md +62 -6
  150. package/skills/pixelcraft-craft/references/layout.md +32 -0
  151. package/skills/pixelcraft-craft/references/motion.md +99 -12
  152. package/skills/pixelcraft-craft/references/typography.md +48 -9
  153. package/skills/pixelcraft-data-apps/SKILL.md +50 -31
  154. package/skills/pixelcraft-data-apps/references/ai-and-internal-data-apps.md +147 -0
  155. package/skills/pixelcraft-data-apps/references/dash.md +87 -31
  156. package/skills/pixelcraft-data-apps/references/evidence.md +41 -26
  157. package/skills/pixelcraft-data-apps/references/gradio.md +65 -27
  158. package/skills/pixelcraft-data-apps/references/julia-genie.md +64 -29
  159. package/skills/pixelcraft-data-apps/references/jupyter-widgets.md +65 -27
  160. package/skills/pixelcraft-data-apps/references/nicegui.md +73 -34
  161. package/skills/pixelcraft-data-apps/references/observable-framework.md +65 -27
  162. package/skills/pixelcraft-data-apps/references/panel.md +69 -23
  163. package/skills/pixelcraft-data-apps/references/r-shiny.md +104 -34
  164. package/skills/pixelcraft-data-apps/references/reactive-data-apps.md +186 -0
  165. package/skills/pixelcraft-data-apps/references/reflex.md +85 -31
  166. package/skills/pixelcraft-data-apps/references/shiny.md +84 -27
  167. package/skills/pixelcraft-data-apps/references/streamlit.md +73 -25
  168. package/skills/pixelcraft-dataviz/SKILL.md +21 -24
  169. package/skills/pixelcraft-dataviz/references/color-accessibility.md +2 -2
  170. package/skills/pixelcraft-dataviz/references/encoding-tables-dashboards.md +35 -25
  171. package/skills/pixelcraft-dataviz/references/libraries.md +165 -46
  172. package/skills/pixelcraft-dataviz/references/maps-geospatial.md +159 -0
  173. package/skills/pixelcraft-dataviz/references/realtime-graphs-maps-scale.md +58 -65
  174. package/skills/pixelcraft-desktop/SKILL.md +61 -39
  175. package/skills/pixelcraft-desktop/references/appkit.md +60 -26
  176. package/skills/pixelcraft-desktop/references/avalonia.md +65 -29
  177. package/skills/pixelcraft-desktop/references/cpp-gui.md +104 -27
  178. package/skills/pixelcraft-desktop/references/electron.md +68 -26
  179. package/skills/pixelcraft-desktop/references/go-gui.md +59 -30
  180. package/skills/pixelcraft-desktop/references/gtk.md +74 -31
  181. package/skills/pixelcraft-desktop/references/javafx-swing.md +54 -25
  182. package/skills/pixelcraft-desktop/references/qt-pyside-qml.md +57 -30
  183. package/skills/pixelcraft-desktop/references/rust-gui.md +59 -41
  184. package/skills/pixelcraft-desktop/references/tauri.md +80 -24
  185. package/skills/pixelcraft-desktop/references/uno-platform.md +42 -23
  186. package/skills/pixelcraft-desktop/references/winui-wpf.md +66 -26
  187. package/skills/pixelcraft-desktop/references/working-context.md +82 -3
  188. package/skills/pixelcraft-direction/SKILL.md +48 -82
  189. package/skills/pixelcraft-direction/references/creative-brainstorming.md +72 -0
  190. package/skills/pixelcraft-direction/references/direction-card.md +11 -1
  191. package/skills/pixelcraft-direction/references/direction-scoring.md +5 -1
  192. package/skills/pixelcraft-direction/references/motion-identity.md +67 -0
  193. package/skills/pixelcraft-direction/references/movements.md +3 -0
  194. package/skills/pixelcraft-direction/references/reference-analysis.md +37 -0
  195. package/skills/pixelcraft-direction/references/slop-fingerprints.md +32 -7
  196. package/skills/pixelcraft-document/SKILL.md +27 -23
  197. package/skills/pixelcraft-document/references/archetypes.md +27 -4
  198. package/skills/pixelcraft-document/references/pdf-tools.md +241 -81
  199. package/skills/pixelcraft-document/references/pdfjs-and-pptx.md +114 -0
  200. package/skills/pixelcraft-document/references/print-css.md +96 -43
  201. package/skills/pixelcraft-document/references/slides.md +123 -27
  202. package/skills/pixelcraft-email/SKILL.md +42 -20
  203. package/skills/pixelcraft-email/references/client-quirks.md +101 -33
  204. package/skills/pixelcraft-email/references/html-tables.md +83 -22
  205. package/skills/pixelcraft-email/references/maizzle.md +54 -0
  206. package/skills/pixelcraft-email/references/mjml.md +13 -11
  207. package/skills/pixelcraft-email/references/react-email.md +76 -34
  208. package/skills/pixelcraft-extensions/SKILL.md +32 -27
  209. package/skills/pixelcraft-extensions/references/browser-extensions.md +91 -17
  210. package/skills/pixelcraft-extensions/references/figma-office.md +97 -14
  211. package/skills/pixelcraft-extensions/references/ide-and-saas-plugins.md +125 -0
  212. package/skills/pixelcraft-extensions/references/raycast.md +90 -11
  213. package/skills/pixelcraft-extensions/references/vscode-webviews.md +91 -17
  214. package/skills/pixelcraft-game-ui/SKILL.md +45 -26
  215. package/skills/pixelcraft-game-ui/references/bevy.md +69 -31
  216. package/skills/pixelcraft-game-ui/references/godot.md +100 -27
  217. package/skills/pixelcraft-game-ui/references/hud-principles.md +50 -21
  218. package/skills/pixelcraft-game-ui/references/love2d.md +53 -27
  219. package/skills/pixelcraft-game-ui/references/monogame.md +45 -29
  220. package/skills/pixelcraft-game-ui/references/unity-ugui.md +109 -0
  221. package/skills/pixelcraft-game-ui/references/unity-ui-toolkit.md +69 -27
  222. package/skills/pixelcraft-game-ui/references/unreal-umg.md +53 -26
  223. package/skills/pixelcraft-game-ui/references/web-and-middleware-game-ui.md +122 -0
  224. package/skills/pixelcraft-handoff/SKILL.md +14 -13
  225. package/skills/pixelcraft-handoff/references/design-translation.md +40 -10
  226. package/skills/pixelcraft-handoff/references/motion-handoff.md +54 -0
  227. package/skills/pixelcraft-media/SKILL.md +20 -23
  228. package/skills/pixelcraft-media/references/banners-video.md +83 -65
  229. package/skills/pixelcraft-media/references/og-generation.md +110 -63
  230. package/skills/pixelcraft-media/references/social-cards.md +57 -58
  231. package/skills/pixelcraft-mobile/SKILL.md +53 -36
  232. package/skills/pixelcraft-mobile/references/dotnet-maui.md +62 -34
  233. package/skills/pixelcraft-mobile/references/flet.md +53 -26
  234. package/skills/pixelcraft-mobile/references/flutter.md +76 -32
  235. package/skills/pixelcraft-mobile/references/harmonyos-and-emerging-mobile.md +121 -0
  236. package/skills/pixelcraft-mobile/references/ionic-capacitor.md +48 -26
  237. package/skills/pixelcraft-mobile/references/jetpack-compose.md +92 -24
  238. package/skills/pixelcraft-mobile/references/kivy.md +54 -31
  239. package/skills/pixelcraft-mobile/references/kotlin-multiplatform.md +53 -27
  240. package/skills/pixelcraft-mobile/references/lynxjs.md +110 -0
  241. package/skills/pixelcraft-mobile/references/nativescript-and-skip.md +91 -0
  242. package/skills/pixelcraft-mobile/references/react-native-expo.md +66 -31
  243. package/skills/pixelcraft-mobile/references/swiftui.md +158 -28
  244. package/skills/pixelcraft-mobile/references/tactile-interactions.md +55 -0
  245. package/skills/pixelcraft-mobile/references/task-state-composition.md +82 -2
  246. package/skills/pixelcraft-mobile/references/uikit.md +57 -23
  247. package/skills/pixelcraft-patterns/SKILL.md +30 -13
  248. package/skills/pixelcraft-patterns/references/accessibility-resilience.md +29 -0
  249. package/skills/pixelcraft-patterns/references/ai-and-offline-patterns.md +54 -0
  250. package/skills/pixelcraft-patterns/references/auth-onboarding.md +32 -13
  251. package/skills/pixelcraft-patterns/references/billing-paywalls.md +40 -0
  252. package/skills/pixelcraft-patterns/references/command-workspace.md +56 -0
  253. package/skills/pixelcraft-patterns/references/commerce.md +35 -16
  254. package/skills/pixelcraft-patterns/references/communication.md +34 -15
  255. package/skills/pixelcraft-patterns/references/creative-tools.md +30 -17
  256. package/skills/pixelcraft-patterns/references/creative-web-composition.md +38 -0
  257. package/skills/pixelcraft-patterns/references/dashboard-admin.md +22 -18
  258. package/skills/pixelcraft-patterns/references/history-diff-undo.md +50 -0
  259. package/skills/pixelcraft-patterns/references/marketing.md +31 -19
  260. package/skills/pixelcraft-patterns/references/multi-tenant-rbac.md +47 -0
  261. package/skills/pixelcraft-patterns/references/narrative-systems.md +42 -0
  262. package/skills/pixelcraft-patterns/references/notifications-activity.md +57 -0
  263. package/skills/pixelcraft-patterns/references/pattern-selection.md +8 -2
  264. package/skills/pixelcraft-patterns/references/scheduling-kanban.md +47 -0
  265. package/skills/pixelcraft-patterns/references/scroll-implementation.md +37 -0
  266. package/skills/pixelcraft-patterns/references/settings.md +40 -12
  267. package/skills/pixelcraft-plan/SKILL.md +54 -18
  268. package/skills/pixelcraft-plan/references/discovery-interview.md +110 -0
  269. package/skills/pixelcraft-plan/references/grill-me-protocol.md +63 -0
  270. package/skills/pixelcraft-plan/references/plan-template.md +44 -9
  271. package/skills/pixelcraft-plan/references/repo-discovery.md +16 -9
  272. package/skills/pixelcraft-plan/references/stack-freshness.md +22 -5
  273. package/skills/pixelcraft-plan/references/stack-selection.md +65 -9
  274. package/skills/pixelcraft-review/SKILL.md +41 -19
  275. package/skills/pixelcraft-review/references/audit-report.md +20 -1
  276. package/skills/pixelcraft-review/references/heuristics.md +63 -18
  277. package/skills/pixelcraft-review/references/personas.md +41 -14
  278. package/skills/pixelcraft-review/references/polish.md +66 -26
  279. package/skills/pixelcraft-review/scripts/check-acceptance.mjs +619 -0
  280. package/skills/pixelcraft-review/scripts/fixtures/focus-longhand-removal.css +34 -0
  281. package/skills/pixelcraft-review/scripts/slop-scan.mjs +679 -32
  282. package/skills/pixelcraft-spatial/SKILL.md +16 -17
  283. package/skills/pixelcraft-spatial/references/comfort-accessibility.md +25 -84
  284. package/skills/pixelcraft-spatial/references/platforms.md +123 -53
  285. package/skills/pixelcraft-tokens/SKILL.md +18 -14
  286. package/skills/pixelcraft-tokens/assets/tokens.example.json +1 -1
  287. package/skills/pixelcraft-tokens/assets/tokens.modes.example.json +1 -1
  288. package/skills/pixelcraft-tokens/references/format.md +39 -9
  289. package/skills/pixelcraft-tokens/references/governance.md +1 -1
  290. package/skills/pixelcraft-tokens/references/theme-presets.md +36 -8
  291. package/skills/pixelcraft-tokens/references/token-tooling.md +119 -0
  292. package/skills/pixelcraft-tokens/scripts/export-tokens.mjs +637 -75
  293. package/skills/pixelcraft-tui/SKILL.md +41 -25
  294. package/skills/pixelcraft-tui/references/bubbletea-lipgloss.md +49 -30
  295. package/skills/pixelcraft-tui/references/extended-tui-toolkits.md +127 -0
  296. package/skills/pixelcraft-tui/references/ink.md +77 -28
  297. package/skills/pixelcraft-tui/references/ratatui.md +70 -30
  298. package/skills/pixelcraft-tui/references/rich.md +53 -33
  299. package/skills/pixelcraft-tui/references/terminal-protocols.md +80 -0
  300. package/skills/pixelcraft-tui/references/textual.md +75 -34
  301. package/skills/pixelcraft-ux/SKILL.md +22 -12
  302. package/skills/pixelcraft-ux/references/feedback-performance.md +39 -19
  303. package/skills/pixelcraft-ux/references/forms.md +57 -3
  304. package/skills/pixelcraft-ux/references/i18n.md +50 -12
  305. package/skills/pixelcraft-ux/references/laws.md +35 -14
  306. package/skills/pixelcraft-ux/references/state-matrix.md +15 -1
  307. package/skills/pixelcraft-ux/references/ux-writing.md +1 -0
  308. package/skills/pixelcraft-visual-qa/SKILL.md +21 -7
  309. package/skills/pixelcraft-visual-qa/references/capture-desktop-game.md +28 -7
  310. package/skills/pixelcraft-visual-qa/references/capture-document.md +70 -0
  311. package/skills/pixelcraft-visual-qa/references/capture-email.md +13 -9
  312. package/skills/pixelcraft-visual-qa/references/capture-mobile.md +20 -5
  313. package/skills/pixelcraft-visual-qa/references/capture-terminal.md +6 -2
  314. package/skills/pixelcraft-visual-qa/references/motion-capture.md +63 -0
  315. package/skills/pixelcraft-visual-qa/references/performance-budgets.md +25 -12
  316. package/skills/pixelcraft-visual-qa/references/realtime-graphics.md +55 -0
  317. package/skills/pixelcraft-visual-qa/scripts/check-contrast.mjs +442 -0
  318. package/skills/pixelcraft-visual-qa/scripts/check-email.mjs +397 -0
  319. package/skills/pixelcraft-visual-qa/scripts/check-pdf.mjs +189 -0
  320. package/skills/pixelcraft-visual-qa/scripts/check-tui.mjs +321 -0
  321. package/skills/pixelcraft-visual-qa/scripts/finish-gate.mjs +50 -11
  322. package/skills/pixelcraft-visual-qa/scripts/shoot.mjs +214 -59
  323. package/skills/pixelcraft-visual-qa/scripts/style-inventory.mjs +121 -49
  324. package/skills/pixelcraft-web/SKILL.md +105 -49
  325. package/skills/pixelcraft-web/references/accessibility-performance.md +42 -0
  326. package/skills/pixelcraft-web/references/adaptive-layout.md +52 -8
  327. package/skills/pixelcraft-web/references/angular.md +63 -16
  328. package/skills/pixelcraft-web/references/assets-pipeline.md +67 -0
  329. package/skills/pixelcraft-web/references/astro.md +64 -13
  330. package/skills/pixelcraft-web/references/audio-reactive.md +61 -0
  331. package/skills/pixelcraft-web/references/auth-and-checkout-ui.md +115 -0
  332. package/skills/pixelcraft-web/references/build-and-architecture.md +215 -0
  333. package/skills/pixelcraft-web/references/canvas-and-node-editors.md +157 -0
  334. package/skills/pixelcraft-web/references/clojurescript.md +52 -17
  335. package/skills/pixelcraft-web/references/component-systems.md +102 -0
  336. package/skills/pixelcraft-web/references/component-testing.md +170 -0
  337. package/skills/pixelcraft-web/references/creative-effects.md +59 -0
  338. package/skills/pixelcraft-web/references/creative-runtime.md +34 -0
  339. package/skills/pixelcraft-web/references/enterprise-data-ui.md +138 -0
  340. package/skills/pixelcraft-web/references/file-upload-media-ui.md +82 -0
  341. package/skills/pixelcraft-web/references/forms-validation.md +123 -0
  342. package/skills/pixelcraft-web/references/fsharp-fable.md +3 -2
  343. package/skills/pixelcraft-web/references/gsap.md +102 -0
  344. package/skills/pixelcraft-web/references/html-css.md +144 -12
  345. package/skills/pixelcraft-web/references/htmx-alpine.md +68 -18
  346. package/skills/pixelcraft-web/references/i18n-engineering.md +106 -0
  347. package/skills/pixelcraft-web/references/interaction-and-search-primitives.md +196 -0
  348. package/skills/pixelcraft-web/references/java-web.md +27 -18
  349. package/skills/pixelcraft-web/references/kotlin-web.md +6 -2
  350. package/skills/pixelcraft-web/references/leptos-yew.md +62 -19
  351. package/skills/pixelcraft-web/references/lit-web-components.md +4 -2
  352. package/skills/pixelcraft-web/references/local-first-sync.md +105 -0
  353. package/skills/pixelcraft-web/references/media-players.md +104 -0
  354. package/skills/pixelcraft-web/references/motion-react.md +96 -0
  355. package/skills/pixelcraft-web/references/motion-recipes.md +82 -0
  356. package/skills/pixelcraft-web/references/preact-fresh-hono.md +111 -0
  357. package/skills/pixelcraft-web/references/pwa.md +6 -1
  358. package/skills/pixelcraft-web/references/qwik.md +51 -11
  359. package/skills/pixelcraft-web/references/r3f-integration.md +69 -0
  360. package/skills/pixelcraft-web/references/react-next.md +112 -13
  361. package/skills/pixelcraft-web/references/rendering-choice.md +63 -0
  362. package/skills/pixelcraft-web/references/rendering-performance.md +80 -0
  363. package/skills/pixelcraft-web/references/rich-text-and-code-editors.md +220 -0
  364. package/skills/pixelcraft-web/references/rive-lottie.md +73 -0
  365. package/skills/pixelcraft-web/references/scene-architecture.md +132 -0
  366. package/skills/pixelcraft-web/references/server-rendered.md +106 -63
  367. package/skills/pixelcraft-web/references/shader-workflow.md +77 -0
  368. package/skills/pixelcraft-web/references/smooth-scroll.md +58 -0
  369. package/skills/pixelcraft-web/references/solid.md +67 -16
  370. package/skills/pixelcraft-web/references/state-architecture.md +107 -0
  371. package/skills/pixelcraft-web/references/styling-ecosystem.md +273 -0
  372. package/skills/pixelcraft-web/references/svelte.md +61 -11
  373. package/skills/pixelcraft-web/references/tailwind.md +40 -14
  374. package/skills/pixelcraft-web/references/video-media.md +69 -0
  375. package/skills/pixelcraft-web/references/vue-nuxt.md +37 -13
  376. package/skills/pixelcraft-web/references/web-3d-engines.md +97 -0
@@ -1,20 +1,97 @@
1
1
  # PDF and document toolchains
2
2
 
3
- Choose the toolchain for the source of truth and required control. Do not route every document through screenshots or browser print merely because HTML is familiar.
3
+ Choose the toolchain for the source of truth, pagination fidelity, accessibility target (PDF/UA, PDF/A), and runtime constraints. Do not route every document through screenshots or browser print merely because HTML is familiar.
4
4
 
5
5
  ## Selection matrix
6
6
 
7
- | Tool | Input/model | Best for | Critical constraints |
7
+ | Tool | Input / model | Best for | Critical constraints |
8
8
  |---|---|---|---|
9
- | Paged.js | browser HTML/CSS paginated by JS | proofing/printing HTML publications with richer Paged Media behavior | client-side layout cost; browser/runtime integration; verify generated output and hooks |
10
- | WeasyPrint | Python HTML/CSS → PDF | server-generated invoices/reports from HTML templates | does not execute JavaScript; CSS support is broad but not browser-identical; font/layout behavior differs |
11
- | React-PDF (`@react-pdf/renderer`) | React component tree → PDF | app-generated controlled PDFs sharing data/components in JS | not DOM/CSS print; custom primitive layout model with a subset of styles; explicit font registration |
12
- | Typst | markup + programmable typesetting | precise reports, templates, scientific/business documents | separate language/model; learn layout/counter system; browser CSS does not transfer directly |
13
- | LaTeX | TeX source/macros/packages | scholarly/technical typesetting, complex references/math | steep toolchain/package differences; debugging fragmentation requires TeX knowledge |
9
+ | Playwright / Puppeteer `page.pdf()` | headless Chromium HTML/CSS/JS → PDF | web dashboards, JS charts, modern Grid/Flexbox reports | heavy Chromium runtime; `headerTemplate`/`footerTemplate` run in an isolated DOM without page CSS/fonts |
10
+ | Gotenberg | Docker HTTP API (Chromium + LibreOffice + PDF engines) | containerized multi-format conversion (HTML/Markdown/Office → PDF/A & PDF/UA), PDF merging | network/SSRF allowlists required; tune concurrency and container memory |
11
+ | PrinceXML | commercial C++ CSS Paged Media engine → PDF | books, regulatory reports, prepress CMYK/PDF/X, footnotes, TOC leaders, PDF/UA-1 | commercial license; non-browser JS subset |
12
+ | Vivliostyle | open-source Chromium-based CSS Paged Media CLI/viewer | publications, CJK vertical writing (`vertical-rl`), EPUB/print parity, `string-set`/`target-counter()` | CLI/headless overhead; verify CSS Paged Media feature coverage per version |
13
+ | Paged.js | browser HTML/CSS paginated by JS | proofing/printing HTML publications with richer Paged Media behavior | client-side layout cost; post-chunking DOM differs from screen DOM |
14
+ | WeasyPrint | Python HTML/CSS → PDF | server-generated invoices/reports from HTML templates, PDF/A-3b & PDF/UA-1 | does not execute JavaScript; CSS subset differs from browsers; explicit `font_config` required |
15
+ | React-PDF (`@react-pdf/renderer`) | React component tree → PDF | app-generated controlled PDFs sharing JS/TS data models | not DOM/CSS print; flexbox-like primitive subset; explicit font registration |
16
+ | `pdf-lib` | JS/TS programmatic PDF API (Node/Deno/Edge/browser) | modifying existing PDFs, filling/flattening AcroForms, merging, stamping watermarks | no automatic text reflow or HTML/CSS layout; coordinate-driven |
17
+ | ReportLab / PDFKit | Python (`platypus`/canvas) or Node.js streaming PDF API | deterministic high-throughput server receipts, tickets, tabular reports without a browser | manual layout/pagination design; explicit TTF font loading for Unicode |
18
+ | Typst | programmable markup + typesetting engine | precise technical/business reports, invoices, slide decks, PDF/A & PDF/UA-1 | separate language; browser CSS does not transfer; font set in compile env is part of contract |
19
+ | LaTeX (`lualatex`/`xelatex`) | TeX source/macros/packages | scholarly publishing, complex math, bibliographies, legacy TeX pipelines | multi-pass aux builds; PDF/UA tagging requires dedicated packages (`tagpdf`) |
20
+ | Quarto | computational Markdown (`.qmd`) + Python/R/Julia/Observable | reproducible data reports, papers, and decks compiled to Typst, LaTeX, RevealJS, DOCX, PPTX | requires Quarto CLI + target renderer (Typst/TeX/Chromium) in CI |
21
+ | Office (`docx` / `python-docx`, ExcelJS / SheetJS) | native `.docx` / `.xlsx` OOXML generators | editable business deliverables, audit workbooks, formula-driven spreadsheets | recipients' installed fonts and Office/LibreOffice versions affect pagination |
22
+
23
+ ## Playwright and Puppeteer `page.pdf()`
24
+
25
+ Use headless Chromium when the document already depends on modern CSS Grid/Flexbox, SVG/Canvas charts, or client-side rendering. Chromium generates tagged PDFs when enabled (`tagged: true` in Playwright / Puppeteer) and supports CSS `@page` margin boxes in Chromium 131+.
26
+
27
+ ```ts
28
+ import { chromium } from 'playwright';
29
+
30
+ const browser = await chromium.launch();
31
+ const page = await browser.newPage();
32
+ await page.goto('http://127.0.0.1:4173/report', { waitUntil: 'networkidle' });
33
+ await page.emulateMedia({ media: 'print' });
34
+ await page.evaluate(() => document.fonts.ready);
35
+
36
+ await page.pdf({
37
+ path: 'report.pdf',
38
+ format: 'A4',
39
+ printBackground: true,
40
+ preferCSSPageSize: true,
41
+ displayHeaderFooter: true,
42
+ // Isolated Chromium document: inline styles only, base64 images only, explicit font-size required
43
+ headerTemplate: '<div style="font-size:8px;width:100%;padding:0 16mm;color:#444;">Quarterly Report</div>',
44
+ footerTemplate:
45
+ '<div style="font-size:8px;width:100%;padding:0 16mm;text-align:right;color:#444;">' +
46
+ 'Page <span class="pageNumber"></span> / <span class="totalPages"></span></div>',
47
+ });
48
+ await browser.close();
49
+ ```
50
+
51
+ Rules:
52
+
53
+ - call `emulateMedia({ media: 'print' })` and `await page.evaluate(() => document.fonts.ready)` before printing so print styles and web fonts settle;
54
+ - `headerTemplate` and `footerTemplate` render inside an **isolated Chromium document**: external stylesheets, page `@font-face` rules, and remote image URLs do not load—inline CSS directly, set explicit `font-size`, embed logos as base64 data URIs, and allocate `@page` margins large enough so templates do not collide with body text;
55
+ - verify Chromium tagged PDF output when PDF/UA accessibility is required (`tagged: true` where supported by the pinned Playwright/Puppeteer version).
56
+
57
+ ## Gotenberg
58
+
59
+ Gotenberg wraps headless Chromium, LibreOffice, and PDF engines behind a stateless Docker HTTP API for HTML, Markdown, Office (`.docx`/`.xlsx`/`.pptx`) conversion, merging, and archival compliance.
60
+
61
+ ```sh
62
+ curl --fail-with-body --request POST http://gotenberg:3000/forms/chromium/convert/html \
63
+ --form files=@index.html \
64
+ --form printBackground=true \
65
+ --form preferCssPageSize=true \
66
+ --form pdfa=PDF/A-2b \
67
+ --form pdfua=true \
68
+ -o report.pdf
69
+ ```
70
+
71
+ Rules:
72
+
73
+ - restrict outbound requests with `--chromium-allow-list` / `--chromium-deny-list` to prevent SSRF when rendering user-supplied HTML;
74
+ - use `/forms/libreoffice/convert` for Office-to-PDF conversion and mount identical font packs into the container so metrics do not drift from author machines;
75
+ - use `pdfa=PDF/A-3b` when embedding hybrid e-invoice XML attachments and `pdfua=true` for tagged accessibility.
76
+
77
+ ## PrinceXML and Vivliostyle
78
+
79
+ Choose **PrinceXML** (commercial) or **Vivliostyle** (open-source) when full CSS Paged Media (`string-set`, `target-counter()`, `leader()`, `@footnote` / `float: footnote`, named pages, duplex `:left`/`:right`) is required.
80
+
81
+ ```sh
82
+ # PrinceXML: PDF/UA-1 tagged output with CSS Paged Media
83
+ prince --pdf-profile="PDF/UA-1" --pdf-lang="en" report.html -o report.pdf
84
+
85
+ # Vivliostyle CLI: CSS Paged Media & CJK vertical-writing publication build
86
+ npx @vivliostyle/cli build report.html -o report.pdf
87
+ ```
88
+
89
+ - PrinceXML also supports CMYK / spot colors, `bleed` + `marks: crop cross`, and PDF/X-4 for commercial print shops;
90
+ - Vivliostyle runs on Chromium with a CSS Paged Media engine and excels at long-form publications and CJK vertical layouts (`writing-mode: vertical-rl`).
14
91
 
15
92
  ## Paged.js
16
93
 
17
- Paged.js paginates HTML in the browser and polyfills parts of CSS Paged Media/Generated Content. Typical usage:
94
+ Paged.js paginates HTML in the browser and polyfills CSS Paged Media / Generated Content:
18
95
 
19
96
  ```js
20
97
  import { Previewer } from 'pagedjs';
@@ -27,106 +104,123 @@ const flow = await new Previewer().preview(
27
104
  console.log(`Rendered ${flow.total} pages`);
28
105
  ```
29
106
 
30
- The polyfill build can also run in the page:
31
-
32
- ```html
33
- <script src="/vendor/paged.polyfill.js"></script>
34
- ```
35
-
36
- Serve a pinned local/project-controlled copy rather than depending on a mutable third-party CDN in production or document-generation pipelines.
37
-
38
- Rules:
39
-
40
- - wait for fonts/images/data before previewing or use the documented async configuration/hooks;
41
- - account for rendering time on long documents;
42
- - do not assume the DOM after chunking behaves like ordinary screen layout;
43
- - use hooks for running headers/footers or custom page behavior only after reading the handler lifecycle;
44
- - validate page counters, named pages, blank pages, margin boxes, and repeated table headers in actual output.
107
+ Serve a pinned local copy of Paged.js rather than a mutable third-party CDN. Wait for fonts/images/data before previewing, account for chunking latency on long documents, and verify counters, named pages, margin boxes, and repeated table headers in the final PDF.
45
108
 
46
109
  ## WeasyPrint
47
110
 
48
- WeasyPrint turns HTML/CSS into PDF in Python:
111
+ WeasyPrint turns HTML/CSS into PDF in Python without a browser:
49
112
 
50
113
  ```python
51
114
  from weasyprint import HTML
52
115
 
53
- HTML('invoice.html', base_url='./static/').write_pdf('invoice.pdf')
116
+ HTML('invoice.html', base_url='./static/').write_pdf(
117
+ 'invoice.pdf',
118
+ pdf_variant='pdf/ua-1', # or 'pdf/a-3b' for archival/hybrid e-invoices
119
+ )
54
120
  ```
55
121
 
56
- Important constraints:
57
-
58
- - it does not execute JavaScript;
59
- - screen/browser behavior is not identical—media queries, flex/grid support, fonts, bidirectional text, and advanced CSS need version-specific verification;
60
- - `@font-face`/`font_config` matters; do not assume system fonts on deployment servers;
61
- - use `base_url` deliberately for images/fonts/static assets rather than hidden filesystem assumptions;
62
- - repeating table headers, margin boxes, counters, named pages, and footnotes can be powerful when supported by the pinned version—test against that version, not a generic feature list.
122
+ Constraints:
63
123
 
64
- Generate deterministic fixtures and inspect text extraction/embedding. Do not shell out to a browser if server-generated output must be reproducible unless that cost/security model is explicit.
124
+ - does not execute JavaScript; pre-render charts, diagrams, and logos strictly as vector SVG / PDF primitives so text and strokes stay razor-sharp at any zoom or print RIP (reserve `>= 300 effective DPI` raster strictly for continuous-tone photography or `100k+`-point dense heatmaps/scatterplots where vector node count would freeze PDF viewers);
125
+ - configure `FontConfiguration` and ship fonts in the container rather than relying on host OS fonts;
126
+ - pass `base_url` explicitly and sanitize untrusted HTML / block `url_fetcher` access to internal URLs.
65
127
 
66
- ## React-PDF
128
+ ## React-PDF (`@react-pdf/renderer`)
67
129
 
68
- `@react-pdf/renderer` is not a DOM renderer. It uses primitives such as `Document`, `Page`, `View`, `Text`, `Image`, `Link`, and SVG-related components with a controlled style subset.
130
+ `@react-pdf/renderer` renders React primitives (`Document`, `Page`, `View`, `Text`, `Image`, `Link`, SVG primitives) into PDF rather than browser DOM:
69
131
 
70
132
  ```jsx
71
133
  import { Document, Page, Text, View, Font } from '@react-pdf/renderer';
72
134
 
73
- Font.register({
74
- family: 'Inter',
75
- src: '/fonts/Inter-Regular.ttf',
76
- });
135
+ Font.register({ family: 'Inter', src: '/fonts/Inter-Regular.ttf' });
77
136
 
78
- const doc = (
79
- <Document title="Invoice" author="Example Ltd.">
80
- <Page size="A4" wrap style={{ padding: 40 }}>
137
+ export const InvoiceDoc = () => (
138
+ <Document title="Invoice 2026-041" author="Example Ltd." language="en">
139
+ <Page size="A4" wrap style={{ padding: 40, fontFamily: 'Inter' }}>
81
140
  <Text render={({ pageNumber, totalPages }) => `${pageNumber} / ${totalPages}`} fixed />
82
- <View>{/* content */}</View>
141
+ <View>{/* flexbox-like content */}</View>
83
142
  </Page>
84
143
  </Document>
85
144
  );
86
145
  ```
87
146
 
88
- Exact behavioral notes:
147
+ - Do not copy CSS Grid or full cascade assumptions; stick to React-PDF's documented style subset;
148
+ - register every font weight/style explicitly—built-in standard fonts lack non-Latin glyph coverage;
149
+ - test multi-page wrapping (`wrap`, `break`, `fixed`) with worst-case row counts.
150
+
151
+ ## `pdf-lib` (programmatic mutation & AcroForms)
89
152
 
90
- - `<Document>` must be the root and its children are `<Page>` elements;
91
- - `Page` defaults to A4/portrait in current v4 docs but accepts explicit size/orientation;
92
- - `wrap` controls page wrapping;
93
- - `fixed` repeats an element on each page;
94
- - `render` on `Text`/`View` receives pagination context; `totalPages` is available for text and is resolved through a multi-pass render;
95
- - styles use JavaScript objects and a constrained layout engine, not the full browser cascade;
96
- - register fonts explicitly, especially for archival/conformance output; built-in standard fonts have limited glyph coverage.
153
+ Use `pdf-lib` in JS/TS (Node, Deno, edge workers, browsers) to merge PDFs, stamp page numbers/watermarks, or fill/flatten AcroForm templates. Do not use it as a responsive reflow layout engine.
97
154
 
98
- Do not copy browser CSS/grid assumptions. Use simple flex-like layout, measure text expansion, and test long content because wrapping/pagination is library-specific.
155
+ ```ts
156
+ import { PDFDocument } from 'pdf-lib';
157
+
158
+ const pdfDoc = await PDFDocument.load(templateBytes);
159
+ const form = pdfDoc.getForm();
160
+ form.getTextField('invoice.number').setText('INV-2026-041');
161
+ form.flatten();
162
+ const outBytes = await pdfDoc.save();
163
+ ```
164
+
165
+ Register `@pdf-lib/fontkit` and embed a TTF/OTF subset whenever filling fields with Unicode/CJK/diacritic characters; standard WinAnsi fonts throw on unsupported code points.
166
+
167
+ ## ReportLab (Python) and PDFKit (Node.js)
168
+
169
+ Use **ReportLab** (`platypus`) in Python or **PDFKit** in Node.js for fast, deterministic, browser-free server PDFs:
170
+
171
+ ```python
172
+ from reportlab.lib.pagesizes import A4
173
+ from reportlab.lib.units import mm
174
+ from reportlab.pdfbase import pdfmetrics
175
+ from reportlab.pdfbase.ttfonts import TTFont
176
+ from reportlab.platypus import SimpleDocTemplate, Paragraph
177
+ from reportlab.lib.styles import getSampleStyleSheet
178
+
179
+ pdfmetrics.registerFont(TTFont('Inter', 'fonts/Inter-Regular.ttf'))
180
+ doc = SimpleDocTemplate('statement.pdf', pagesize=A4, leftMargin=18*mm, rightMargin=18*mm)
181
+ styles = getSampleStyleSheet()
182
+ styles['Normal'].fontName = 'Inter'
183
+ doc.build([Paragraph('Account Statement', styles['Normal'])])
184
+ ```
185
+
186
+ ```ts
187
+ import PDFDocument from 'pdfkit';
188
+ import fs from 'node:fs';
189
+
190
+ const doc = new PDFDocument({ size: 'A4', margin: 50, tagged: true, lang: 'en-US' });
191
+ doc.pipe(fs.createWriteStream('receipt.pdf'));
192
+ doc.font('fonts/Inter-Regular.ttf').fontSize(11).text('Receipt #2026-041');
193
+ doc.end();
194
+ ```
195
+
196
+ Both require explicit TTF/OTF registration for non-Latin text and deliberate pagination logic for multi-page tables.
99
197
 
100
198
  ## Typst
101
199
 
102
- Typst is a programmable typesetting system with concise markup. Basic page setup:
200
+ Typst (0.12–0.14+) is a fast programmable typesetting engine with explicit `context` introspection, archival/accessibility PDF standards, and `@preview` packages (**Touying** / **Polylux** for slides, **CeTZ** for vector diagrams):
103
201
 
104
202
  ```typst
203
+ #set document(title: "Quarterly Operations Report", author: "Example Ltd.")
105
204
  #set page(
106
- width: 210mm,
107
- height: 297mm,
205
+ paper: "a4",
108
206
  margin: (top: 18mm, right: 16mm, bottom: 20mm, left: 16mm),
109
- bleed: 3mm,
110
- header: [Report],
111
- footer: align(right)[#counter(page).display()],
207
+ header: [Quarterly Operations Report],
208
+ footer: context align(right)[#counter(page).display("1 / 1", both: true)],
112
209
  )
113
- #set text(font: "Source Serif 4", size: 10.5pt)
210
+ #set text(font: "Source Serif 4", size: 10.5pt, lang: "en")
114
211
  ```
115
212
 
116
- Strengths and constraints:
213
+ Rules and Typst 0.12–0.14+ capabilities:
117
214
 
118
- - explicit page dimensions/margins/bleed/headers/footers;
119
- - programmable counters, queries, templates, and layout reuse;
120
- - strong math and bibliography ecosystem;
121
- - not HTML/CSS—web components and browser assumptions do not transfer;
122
- - font availability in the compile environment is part of the artifact contract;
123
- - inspect generated PDF text extraction/bookmarks/links rather than assuming semantic correctness.
124
-
125
- Use Typst when repeatability and typography matter more than reusing HTML.
215
+ - **`context` is mandatory** for inspecting dynamic state (`counter(page).display()`, `query(heading)`): calling `#counter(page).display()` outside a `context` block fails in Typst 0.11+; for simple page numbering without a custom footer, `#set page(numbering: "1")` is sufficient;
216
+ - **Bleed / TrimBox**: `#set page(...)` does not guarantee a universal `bleed` parameter across Typst versions—verify the pinned Typst release or prepress package before relying on native TrimBox/bleed flags, or expand page dimensions explicitly (`width: 210mm + 6mm, height: 297mm + 6mm`) with trim offsets and crop marks;
217
+ - **PDF/A & PDF/UA-1**: compile with `typst compile --pdf-standard a-2b` or `--pdf-standard a-3b` (hybrid e-invoices/attachments), and `--pdf-standard ua-1` (Typst 0.14+ tagged PDF/UA-1, pairing `#set document(title: ...)` with `image(..., alt: "...")` and semantic headings/tables);
218
+ - **HTML export**: Typst 0.13+ exposes experimental single-source HTML export (`typst compile --format html --features html`) for publishing web + print from one source—gate behind feature verification;
219
+ - pin `@preview/...` package versions and bundle fonts with `--font-path` in CI so builds remain reproducible.
126
220
 
127
221
  ## LaTeX
128
222
 
129
- Use LaTeX when the document already lives in a TeX ecosystem or needs its math/bibliography/macro depth. Relevant primitives:
223
+ Use LaTeX when the document lives in an academic/TeX pipeline or needs TeX's math and bibliography tooling:
130
224
 
131
225
  ```tex
132
226
  \usepackage[a4paper,margin=18mm]{geometry}
@@ -134,21 +228,87 @@ Use LaTeX when the document already lives in a TeX ecosystem or needs its math/b
134
228
  \pagestyle{fancy}
135
229
  ```
136
230
 
137
- Rules:
231
+ - Pick `lualatex` or `xelatex` for native OpenType/Unicode/CJK/RTL fonts instead of legacy `pdflatex`;
232
+ - run multi-pass builds (`latexmk -lualatex`) so TOC, references, and page counts converge;
233
+ - PDF/UA tagging in LaTeX is opt-in (use the LaTeX Tagging Project / `\DocumentMetadata{tagging=on, pdfstandard=ua-2}` with `lualatex` and validate the output).
234
+
235
+ ## Quarto
236
+
237
+ Use Quarto (`.qmd`) when analytical prose, tables, and charts must compile reproducibly from Python, R, Julia, or Observable into Typst, LaTeX/PDF, RevealJS, HTML, DOCX, or PPTX:
238
+
239
+ ```yaml
240
+ ---
241
+ title: "Q4 Reliability Report"
242
+ format:
243
+ typst:
244
+ papersize: a4
245
+ margin: { x: 18mm, y: 20mm }
246
+ docx:
247
+ reference-doc: templates/brand-reference.docx
248
+ execute:
249
+ echo: false
250
+ ---
251
+ ```
252
+
253
+ Run `quarto render report.qmd --to typst` in CI with pinned runtime environments (`uv`/`renv`) and inspect each target format independently—one Markdown source does not auto-verify pagination across Typst, DOCX, and RevealJS.
254
+
255
+ ## Office document generation (`docx`, `python-docx`, ExcelJS, SheetJS)
256
+
257
+ Generate native `.docx` or `.xlsx` files when stakeholders must edit text, track changes, or run live spreadsheet formulas.
258
+
259
+ ```python
260
+ # python-docx: use semantic styles instead of inline run formatting everywhere
261
+ from docx import Document
262
+ from docx.shared import Mm
263
+
264
+ doc = Document()
265
+ section = doc.sections[0]
266
+ section.page_width, section.page_height = Mm(210), Mm(297)
267
+ doc.add_heading('Quarterly Review', level=1)
268
+ doc.add_paragraph('Verified actuals from Q4 ledger.')
269
+ doc.save('quarterly-review.docx')
270
+ ```
271
+
272
+ ```ts
273
+ // ExcelJS: styled, formula-driven workbook with frozen header & explicit currency format
274
+ import ExcelJS from 'exceljs';
275
+
276
+ const wb = new ExcelJS.Workbook();
277
+ const ws = wb.addWorksheet('Invoices', { views: [{ state: 'frozen', ySplit: 1 }] });
278
+ ws.columns = [
279
+ { header: 'Invoice #', key: 'id', width: 16 },
280
+ { header: 'Amount (EUR)', key: 'amount', width: 18, style: { numFmt: '€#,##0.00' } },
281
+ ];
282
+ ws.addRow({ id: 'INV-2026-041', amount: 1420.5 });
283
+ await wb.xlsx.writeFile('invoices.xlsx');
284
+ ```
285
+
286
+ - **Word (`docx` JS/TS, `python-docx`)**: attach a reference template or named styles, set explicit page sizes/headers/footers, and inspect in Word + LibreOffice Writer;
287
+ - **Spreadsheets (ExcelJS vs SheetJS)**: use **ExcelJS** (or Python `openpyxl` / `xlsxwriter`) when column widths, frozen headers, cell styles, data validation, or streaming `WorkbookWriter` matter; **SheetJS (`xlsx`)** Community Edition is fast for unstyled data import/export but omits cell styling. Never inject untrusted strings starting with `=`, `+`, `-`, or `@` unescaped into spreadsheet cells (CSV/formula injection).
288
+
289
+ ## Font subsetting & `ToUnicode` CMap copy / ATS gate
290
+
291
+ Subsetting embedded fonts keeps PDFs compact, but broken subsetters strip or corrupt the **`ToUnicode` CMap**—causing copy-paste, search indexers, and Applicant Tracking Systems (ATS) to extract tofu `□`, Private Use Area garbage, or broken OpenType ligatures (`fi`, `fl`, `ffi`) and stacked diacritics (Vietnamese `Nguyễn`, `ệ`, `ợ`, CJK, Arabic).
292
+
293
+ Run Poppler's `pdffonts` and `pdftotext` (plus `check-pdf.mjs` from `pixelcraft-visual-qa`, passing `--prepress` for commercial `PDF/X-4` `/TrimBox`, `/BleedBox`, `/OutputIntents`, and `/ToUnicode` verification) on every generated PDF before delivery:
294
+
295
+ ```sh
296
+ # Every font must report emb=yes AND uni=yes (valid ToUnicode CMap)
297
+ pdffonts output.pdf
298
+ # Verify ligatures (fi, fl), Vietnamese/CJK diacritics, and reading order extract cleanly
299
+ pdftotext output.pdf - | head -n 40
300
+ ```
138
301
 
139
- - choose engine deliberately (`pdflatex`, `xelatex`, `lualatex`) because font/Unicode behavior differs;
140
- - floating placement is probabilistic unless constrained; inspect actual pages rather than forcing every float;
141
- - use appropriate packages for tables, headers/footers, hyperlinks, accessibility-aware metadata, color, and microtype;
142
- - compile repeatedly and treat auxiliary files/caches as part of reproducibility;
143
- - PDF accessibility/tagging is specialized work, not automatic merely because text is selectable.
302
+ - If `uni` is `no`, switch from legacy Type 3 / bitmap / broken subset paths to OpenType/TrueType embedding with full Unicode CMap generation (`lualatex` over `pdflatex`, `@pdf-lib/fontkit`, WeasyPrint `FontConfiguration`, Typst `--font-path`, Chromium `tagged: true`).
303
+ - Never convert body text or CV headings to vector paths/outlines (`text-to-path`)—outlined glyphs look crisp visually but fail ATS parsing, Ctrl+F search, and screen readers completely.
144
304
 
145
305
  ## Toolchain verification matrix
146
306
 
147
307
  | Check | Evidence required |
148
308
  |---|---|
149
- | pagination | inspect generated PDF/page images at first/middle/last pages |
150
- | fonts | embedded/subset correctly; glyph coverage; license |
151
- | links/bookmarks | clickable destinations and correct metadata where required |
152
- | accessibility | reading order/tags/text extraction/alt text or explicit limitation |
153
- | reproducibility | pinned dependencies/fonts/assets and deterministic build inputs |
154
- | security | no untrusted remote assets/scripts in server rendering; sanitize HTML input |
309
+ | pagination | inspect rendered PDF/DOCX/XLSX first, middle, and last pages + grayscale proof (`rendered`) |
310
+ | fonts & `ToUnicode` CMap | `pdffonts` confirms `emb=yes` and `uni=yes`; `pdftotext` extracts Vietnamese/CJK/ligatures (`fi`, `fl`) with zero `□` (`static`) |
311
+ | vector vs prepress | charts/logos are vector SVG/PDF primitives; `PDF/X-4` print jobs verify `3mm` bleed, `5mm` trim safety, `>= 300 DPI` photos, `TAC <= 300%`, and `100% K` (`C0 M0 Y0 K100`) body black (`static`/`rendered`) |
312
+ | links / bookmarks | clickable TOC outline tree, internal destinations, and `/Title` + `/Lang` metadata (`rendered`/`static`) |
313
+ | accessibility | `PDF/UA` tag tree (`H1`–`H6`, `Table`/`TH`, `Artifact` running headers), reading order, and `Figure` alt text (`static`/`rendered`, or `not-checked`) |
314
+ | reproducibility & security | pinned CLI/font paths, SSRF allowlists on Chromium/Gotenberg, sanitized HTML, and OWASP formula-injection escaping (`=`, `+`, `-`, `@`, `\t`, `\r`) in spreadsheets (`static`) |
@@ -0,0 +1,114 @@
1
+ # Client-side PDF viewers (PDF.js) and programmatic PPTX decks (PptxGenJS)
2
+
3
+ For print CSS, Playwright/Gotenberg, WeasyPrint, React-PDF, Typst, LaTeX, Quarto, and web/Typst slide frameworks, read `references/pdf-tools.md` and `references/slides.md`. Use this reference when **rendering PDFs inside a web app (`pdfjs-dist`)** or **generating editable PowerPoint `.pptx` files (`pptxgenjs`)**.
4
+
5
+ ## PDF.js (`pdfjs-dist` v4.2+ / v5) viewer idioms
6
+
7
+ - **Dedicated Web Worker**: configure `GlobalWorkerOptions.workerSrc` (or `GlobalWorkerOptions.workerPort`) pointing to a bundled/same-origin `pdf.worker.min.mjs` matching the exact `pdfjs-dist` version—never parse PDFs on the main thread.
8
+ - **HiDPI crispness (`devicePixelRatio` + `transform`)**: scale the `<canvas>` backing store (`canvas.width` / `canvas.height`) by `window.devicePixelRatio`, keep CSS width/height at logical viewport pixels, and pass `transform: dpr !== 1 ? [dpr, 0, 0, dpr, 0, 0] : undefined` into `page.render(...)` so glyphs stay razor-sharp on Retina/4K screens.
9
+ - **Selectable & accessible `TextLayer` (v4.2+ / v5)**: instantiate `new TextLayer({ textContentSource, container, viewport }).render()` and set `--scale-factor` and `--total-scale-factor` CSS custom properties on the page/text-layer container (imported with `pdfjs-dist/web/pdf_viewer.css`) so selectable spans align accurately with the rendered canvas.
10
+ - **Cancellation & teardown**: cancel superseded `page.render(...)` and `TextLayer` tasks (`renderTask.cancel()`, `textLayer.cancel()`, ignoring `RenderingCancelledException`) on rapid zoom/page turns, and call `await loadingTask.destroy()` on unmount to abort pending range fetches and terminate the worker.
11
+
12
+ ```ts
13
+ import { getDocument, GlobalWorkerOptions, TextLayer } from 'pdfjs-dist';
14
+ import 'pdfjs-dist/web/pdf_viewer.css';
15
+
16
+ GlobalWorkerOptions.workerSrc = new URL(
17
+ 'pdfjs-dist/build/pdf.worker.min.mjs',
18
+ import.meta.url,
19
+ ).toString();
20
+
21
+ const loadingTask = getDocument({ url: '/report.pdf' });
22
+ const pdf = await loadingTask.promise;
23
+ const page = await pdf.getPage(1);
24
+
25
+ const scale = 1.5;
26
+ const dpr = window.devicePixelRatio || 1;
27
+ const viewport = page.getViewport({ scale });
28
+
29
+ // 1. HiDPI canvas backing store + DPR transform
30
+ canvas.width = Math.floor(viewport.width * dpr);
31
+ canvas.height = Math.floor(viewport.height * dpr);
32
+ canvas.style.width = `${Math.floor(viewport.width)}px`;
33
+ canvas.style.height = `${Math.floor(viewport.height)}px`;
34
+
35
+ const renderTask = page.render({
36
+ canvasContext: ctx,
37
+ viewport,
38
+ transform: dpr !== 1 ? [dpr, 0, 0, dpr, 0, 0] : undefined,
39
+ });
40
+
41
+ // 2. Synchronized TextLayer (PDF.js v4.2+/v5 requires scale CSS vars)
42
+ pageContainer.style.setProperty('--scale-factor', String(viewport.scale));
43
+ pageContainer.style.setProperty('--total-scale-factor', String(viewport.scale));
44
+ textLayerDiv.replaceChildren();
45
+ const textLayer = new TextLayer({
46
+ textContentSource: page.streamTextContent(),
47
+ container: textLayerDiv,
48
+ viewport,
49
+ });
50
+
51
+ try {
52
+ await Promise.all([renderTask.promise, textLayer.render()]);
53
+ } catch (err) {
54
+ if ((err as Error).name !== 'RenderingCancelledException') throw err;
55
+ }
56
+
57
+ // On zoom/page change: renderTask.cancel(); textLayer.cancel();
58
+ // On unmount: await loadingTask.destroy();
59
+ ```
60
+
61
+ ## PptxGenJS (v3/v4 programmatic `.pptx` generation)
62
+
63
+ - **Slide masters & physical inches**: set `pres.layout = 'LAYOUT_16x9'` (10" × 5.625") or `defineLayout(...)` in **inches**, and define reusable `defineSlideMaster({ title, background, objects, slideNumber })` templates so headers, footers, margins, and slide numbers stay consistent across every generated slide.
64
+ - **Native editable objects**: prefer `slide.addText(...)`, `slide.addTable(...)` (supports auto-paging across slides), and native `slide.addChart(...)` over rasterizing entire slides as PNG screenshots.
65
+ - **RTL localization**: set `pres.rtlMode = true` for Arabic/Hebrew/Persian decks and verify text alignment, chart axis direction, and slide-number anchor positions in PowerPoint/Impress.
66
+ - **Canonical Export API (v3/v4)**: use `await pres.writeFile({ fileName: 'deck.pptx' })` for direct file downloads/writes, or `await pres.write({ outputType: 'nodebuffer' })` in Node.js services (supported `outputType` values: `'nodebuffer' | 'stream' | 'blob' | 'base64' | 'arraybuffer' | 'uint8array'`). Do not pass deprecated string-only arguments to `writeFile` or call removed v2 streaming methods.
67
+ - **Font availability & scale floor**: PowerPoint substitutes missing fonts on recipients' machines—use cross-OS safe fonts (`Arial`, `Segoe UI`, `Calibri`, `Aptos`) or embed licensed subsetted fonts explicitly; enforce **`>= 24pt` body text for room projection** (`>= 18pt` only for dense read-alone leave-behind decks), pixel-snap `16:9` raster assets so the `.pptx` stays **`< 25–30 MB`** (email-safe), and verify **`PPTX <-> PDF` visual parity** at 100% scale.
68
+
69
+ ```ts
70
+ import PptxGenJS from 'pptxgenjs';
71
+
72
+ const pres = new PptxGenJS();
73
+ pres.layout = 'LAYOUT_16x9';
74
+ pres.rtlMode = false; // Set true for RTL locales (ar, he, fa)
75
+
76
+ pres.defineSlideMaster({
77
+ title: 'REPORT_MASTER',
78
+ background: { color: 'FFFFFF' },
79
+ slideNumber: { x: 9.2, y: 5.2, fontSize: 12, color: '555555' },
80
+ });
81
+
82
+ const slide = pres.addSlide({ masterName: 'REPORT_MASTER' });
83
+ slide.addText('Quarterly Operations Review', { x: 0.6, y: 0.4, w: 8.8, fontSize: 28, bold: true });
84
+ slide.addChart(
85
+ pres.ChartType.bar,
86
+ [{ name: 'Uptime %', labels: ['Q1', 'Q2', 'Q3', 'Q4'], values: [99.8, 99.9, 99.95, 99.98] }],
87
+ { x: 0.6, y: 1.2, w: 8.8, h: 3.6, showValue: true, barDir: 'col' },
88
+ );
89
+
90
+ // Server-side Buffer (or 'stream' | 'blob' for streaming/browser)
91
+ const buffer = (await pres.write({ outputType: 'nodebuffer' })) as Buffer;
92
+ // Or direct save: await pres.writeFile({ fileName: 'q4-review.pptx' });
93
+ ```
94
+
95
+ ## Do/don't pairs
96
+
97
+ | Do | Don't |
98
+ |---|---|
99
+ | Set `GlobalWorkerOptions.workerSrc` and call `loadingTask.destroy()` in PDF.js | Parse multi-megabyte PDFs on the main thread or leak PDF workers on unmount |
100
+ | Scale backing canvas by `devicePixelRatio` with `transform: [dpr, 0, 0, dpr, 0, 0]` | Render 1× logical canvas pixels onto Retina screens, producing blurry text |
101
+ | Pair `new TextLayer({ textContentSource, container, viewport }).render()` with `--scale-factor` / `--total-scale-factor` | Ship an image-only PDF canvas or misaligned text overlay that breaks copy/search/a11y |
102
+ | Cancel in-flight `renderTask` and `textLayer` on zoom/page change and ignore `RenderingCancelledException` | Race concurrent `page.render()` calls onto the same `<canvas>` |
103
+ | Define `defineSlideMaster`, keep body `>= 24pt` (`>= 18pt` leave-behind), budget `.pptx` `< 25–30 MB`, and use native `addText`/`addTable`/`addChart` | Export flattened PNG-per-slide screenshots as `.pptx`, shrink text to `11pt`, or ship `90 MB` uncompressed hero bitmaps |
104
+
105
+ ## Verification commands
106
+
107
+ ```sh
108
+ npm run build
109
+ # Headless PPTX <-> PDF visual parity render (when LibreOffice + Poppler are installed)
110
+ soffice --headless --convert-to pdf q4-review.pptx
111
+ pdftoppm -png -r 150 q4-review.pdf slide-proof
112
+ ```
113
+
114
+ Verify PDF.js worker bundling and `.pptx` byte size `< 25–30 MB` (`static`), test HiDPI canvas + `TextLayer` selection alignment + zoom cancellation in a real browser (`rendered`), and compare exported `.pptx` against its rendered `.pdf` slides in PowerPoint / Keynote / LibreOffice Impress to confirm `PPTX <-> PDF` parity, chart legibility, RTL layout (when enabled), and zero text clipping or font substitution (`rendered`).