@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,83 @@
1
+ # Slop fingerprints
2
+
3
+ Evidence base: recurring generated-UI patterns and output-homogenization evidence. These are recurrence signals, not universal moral bans. The response is redesign or explicit justification—not shame.
4
+
5
+ ## High-confidence visual fingerprints
6
+
7
+ | Fingerprint | Why it converges | Redesign move |
8
+ |---|---|---|
9
+ | cream paper + high-contrast serif + orange/terracotta accent | current “crafted AI” neo-slop cluster | derive palette/material from subject; use accent as a semantic system rather than one fashionable color |
10
+ | near-black page + single acid green/purple accent | generic futurism | define lighting/material logic and more than one semantic state color |
11
+ | Inter/Geist/Helvetica-like sans for every role | model default typography | choose voice by subject; use optical sizes, serif/mono/serifless contrast, native platform defaults when appropriate |
12
+ | purple-to-blue gradient | model/default AI branding | use color posture with physical or symbolic basis; gradients only when they encode light/material/data |
13
+ | centered hero + eyebrow + H1 + subcopy + two CTAs | template composition | choose hierarchy from user decision; asymmetric, editorial, instrument, object-led, or content-first composition |
14
+ | exactly three rounded feature cards with icon/title/text | homogeneous SaaS kit | match information structure to actual number/meaning of ideas; use table, index, timeline, object anatomy, comparison, or spatial layout |
15
+ | emoji as structural icons | cheap visual noise | use a coherent icon system or text; emoji only when culturally/semantically appropriate and never as sole critical meaning |
16
+ | `rounded-2xl` + large soft shadow everywhere | depth without material logic | choose radius/elevation from component semantics and material; flat can be intentional |
17
+ | default glassmorphism panels | decorative translucency | use translucency only where layered context/background matters; test contrast and performance |
18
+ | one italic/accented word inside roman heading | model typography tic | create hierarchy through size/weight/measure/language instead |
19
+ | unnecessary uppercase eyebrow labels | false sophistication | remove or replace with meaningful metadata/navigation |
20
+ | decorative section numbers with no sequence semantics | pseudo-editorial signaling | use actual indexing or remove |
21
+ | generic aurora/blob/grid background | meaningless generated atmosphere | derive visual field from content or omit background effect |
22
+ | card inside card inside card | noisy containment | use spacing/hairline/typographic grouping; reserve containers for semantic boundaries |
23
+ | everything centered regardless of content length | lowest-effort layout | align to reading/task logic; use measure and asymmetric negative space deliberately |
24
+ | identical radius/spacing/shadow on every component | token misunderstanding | define semantic variation and density hierarchy |
25
+ | glowing / mouse-spotlight Bento grid | 2025–2026 SaaS landing cliché | choose layout from content hierarchy; use bento grouping only when heterogeneous modules genuinely need side-by-side comparison without hover spotlights |
26
+ | fake macOS traffic-light terminal chrome on non-dev products | decorative credibility prop | show real product artifact/data or real terminal output only when the product actually runs in a terminal |
27
+ | infinite logo marquee strip | automated social-proof filler | list real, verifiable partner proof statically or omit the strip when no verified partners exist |
28
+ | fake “Trusted by 10,000+ / 4.9★” avatar stack | fabricated proof + template trust strip | remove invented metrics and generic stock avatars; use verified user-provided proof with provenance or none |
29
+ | `✨` sparkle icon spam on buttons and headings | default “AI feature” shorthand | name the concrete capability in plain language (`Summarize`, `Generate SQL`) with a system-coherent icon |
30
+ | default shadcn zinc + 1px border + pill badge hero | unexamined starter-kit collapse | treat primitives as unstyled behavior; author tokens, type voice, spacing rhythm, and surface contrast from the committed direction |
31
+ | cargo-cult Liquid Glass blur | copying iOS/macOS 26 chrome onto web/apps without layered context | restrict translucency to floating chrome over rich media, verify composited contrast over worst-case backgrounds, and provide a `prefers-reduced-transparency` solid fallback |
32
+ | generic icon inside tinted `40×40` rounded-square card badge | automated feature-card kit | drop decorative icon badges; use real product crops, structured specification rows, inline diagrams, or typography-led hierarchy |
33
+ | fake SVG sparklines & arbitrary KPI deltas (`+24.5%`, `+12.8%`) | fabricated dashboard decoration | bind charts to real data via a vetted dataviz library, show honest empty/loading states, or omit metrics entirely when no data exists |
34
+ | pulsing `animate-ping` green-dot “Live” / “v2.0” pill badge | template launch-page cliché | reserve live status indicators for real telemetry/WebSocket state paired with accessible status text, never decorative hero chrome |
35
+ | indigo-purple-pink mesh gradients & glowing border-beam cards | 2025–2026 AI wrapper cliché | derive lighting, surface contrast, and borders from the domain material and semantic elevation hierarchy |
36
+ | unstyled or half-wired forms (floating inputs, missing focus/validation/submit feedback) | rushing past operational states | author real labels, tolerant parsing, accessible error summaries, disabled/pending submit states, and input preservation |
37
+
38
+ ## Copy fingerprints
39
+
40
+ - generic AI marketing clichés without concrete evidence: `supercharge`, `elevate`, `revolutionize`, `unlock`, `seamless`, `cutting-edge`, `next-gen`, `effortless`, `empower`, `streamline`, `all-in-one`, `reimagine`, `unleash`, `AI-powered`, `built for modern teams`, `delve`, `transform your`;
41
+ - fake statistics, logos, testimonials, customer counts, awards, or case studies;
42
+ - headings that say “Features/Benefits/Why choose us” instead of subject-specific claims;
43
+ - error copy that apologizes but gives no recovery path;
44
+ - empty-state copy that explains the obvious (“No items yet”) without the next useful action;
45
+ - buttons that all say “Learn more” or “Get started” regardless of consequence.
46
+
47
+ ## Implementation laziness fingerprints
48
+
49
+ Treat these as hard delivery defects (`P0`/`P1`), never acceptable shortcuts:
50
+
51
+ - `// TODO`, `// FIXME`, or placeholder comments standing in for requested UI or state logic;
52
+ - ellipsis code truncation (`// ... rest of component`, `/* ... */`, omitted branches);
53
+ - empty or no-op event handlers (`onClick={() => {}}`, `onSubmit={() => {}}`, buttons wired to `console.log`);
54
+ - dead `href="#"` or `javascript:void(0)` links pretending to be working navigation;
55
+ - unapproved 3-item hardcoded mock arrays (`const items = [item1, item2, item3]`) masquerading as live, fetched, or persisted data;
56
+ - unwired mobile navigation (hamburger button that toggles nothing, traps focus, or silently drops desktop routes);
57
+ - lazy DIY substitutes for complex capabilities (hand-rolled `<div>` modals without focus traps, `contenteditable` rich editors, hardcoded inline SVG charts, unvirtualized massive tables, mouse-only drag-and-drop).
58
+
59
+ ## Behavior fingerprints
60
+
61
+ - animation on every section entrance regardless of purpose;
62
+ - `transition: all` and long easing everywhere;
63
+ - hover-only disclosure with no keyboard/touch path;
64
+ - skeletons that mimic fake content rather than stable structure;
65
+ - modal chains and cookie/banner chrome occupying the first screen;
66
+ - responsive behavior that only scales a desktop layout down instead of restructuring.
67
+
68
+ ## Evaluation rule
69
+
70
+ A page can have zero fingerprints and still be bad; absence of slop is not presence of design. Judge subject fit, hierarchy, craft, usability, and evidence separately.
71
+
72
+ ## Scanner traceability (`slop-scan.mjs` vs judgment)
73
+
74
+ `pixelcraft-review` runs `slop-scan.mjs` to catch the mechanically detectable subset statically (`static`); visual/taste fingerprints remain human/rendered review (`rendered` / `model-judgment`). In `slop-scan.mjs`, `--waivers` accepts ONLY the 7 advisory brand rules (`default-font-only`, `purple-blue-gradient`, plus the 5 P3 rules); P0/P1 floor rules and non-brand P2 rules cannot be suppressed via brand waivers:
75
+
76
+ | Fingerprint family | Automated `slop-scan.mjs` rule ID(s) | Check mode |
77
+ |---|---|---|
78
+ | Focus removal, zoom lock, paste blocking | `outline-removed`, `zoom-disabled`, `paste-blocked` | `static` (P0, non-waivable) |
79
+ | Placeholder-as-label, missing reduced-motion | `placeholder-as-label`, `missing-reduced-motion` | `static` (P1, non-waivable) |
80
+ | `transition: all`, emoji icons, cliché copy, hardcoded hexes | `transition-all`, `emoji-as-icon`, `generic-copy`, `hardcoded-color-literals` | `static` (P2, non-waivable) |
81
+ | Default fonts, purple-blue gradients | `default-font-only`, `purple-blue-gradient` | `static` (P2 advisory, waivable for approved brand) |
82
+ | Repeated `rounded-2xl`, uniform shadows, centered hero + 2 CTAs, gradient text, rounded accent rails | `rounded-2xl-repetition`, `uniform-shadow`, `centered-hero-two-ctas`, `gradient-text-treatment`, `rounded-accent-rail` | `static` (P3, waivable for approved brand) |
83
+ | Cream+serif+terracotta defaults, spotlight Bento grids, tinted `40×40` icon card badges, fake sparklines/KPI deltas, pulsing `animate-ping` pill badges, mesh/border-beam glow cards, fake terminal chrome, logo marquees, fake avatar proof stacks, `✨` sparkle spam, default shadcn zinc hero, cargo-cult Liquid Glass blur, implementation laziness stubs & DIY widgets | — (plus static stub/handler inspection during review) | `rendered` / `static` / `model-judgment` |
@@ -0,0 +1,47 @@
1
+ # Subject-derived wildcard generators
2
+
3
+ Use these generators when the movement catalog itself starts becoming a monoculture. A wildcard must still satisfy mode, floor, and platform constraints.
4
+
5
+ ## Constraint dice
6
+
7
+ Pick one item from three different columns, then justify each through the subject:
8
+
9
+ | Material/structure | Visual operation | Information behavior |
10
+ |---|---|---|
11
+ | ledger/index/archive | rotate one axis 2–8 degrees | reveal detail through measurement/annotation |
12
+ | instrument/control panel | crop aggressively | prioritize live state over persuasion |
13
+ | field notebook/map | repeat a module with controlled irregularity | layer primary/secondary/tertiary reading |
14
+ | packaging/label/system | translate physical print artifact digitally | use comparison rather than cards |
15
+ | stage/score/choreography | use strict horizontal/vertical rhythm | sequence information by time/state |
16
+ | organism/terrain/weather | let content determine aspect ratio | expose uncertainty/range explicitly |
17
+ | machine protocol/log | use tabular or monospaced precision | make state transitions visible |
18
+ | game/manual/signal system | use pictograms as a real system | teach through progressive disclosure |
19
+
20
+ ## Subject questions
21
+
22
+ Answer with concrete artifact evidence:
23
+
24
+ 1. What physical object, document, instrument, place, organism, or ritual already embodies the subject?
25
+ 2. What units, scales, symbols, constraints, or failure modes does the domain use?
26
+ 3. What would an expert notice that a generic observer misses?
27
+ 4. What material contrast is native to the domain (rough/precise, ephemeral/permanent, hot/cold, dense/sparse)?
28
+ 5. What is the wrong cultural stereotype for this subject? Exclude it explicitly.
29
+ 6. Which sense other than sight has a visual analog: rhythm, weight, texture, temperature, proximity, sequence?
30
+
31
+ ## Transformation operators
32
+
33
+ Apply one or two, never all:
34
+
35
+ - invert hierarchy: make metadata or mechanism the hero;
36
+ - change scale: macro texture, microscopic detail, architectural overview;
37
+ - change time: freeze a process, show provenance, expose a state machine;
38
+ - change perspective: cross-section, exploded view, plan view, operator view;
39
+ - change medium: blueprint, label, ledger, score, signal, field guide, control strip;
40
+ - impose a numerical constraint: two colors, one radius, one axis, 7-column grid, no rectangles;
41
+ - localize deeply: derive from the audience's visual vernacular rather than exported US/European SaaS taste.
42
+
43
+ ## Anti-monoculture rules
44
+
45
+ - If two consecutive directions share composition family, force the next wildcard to use a different axis of contrast.
46
+ - Never use a random aesthetic without a subject rationale.
47
+ - A wildcard is successful only if removing the subject would make the design explanation stop making sense.
@@ -0,0 +1,58 @@
1
+ ---
2
+ name: pixelcraft-document
3
+ description: Designs and verifies paginated documents, print output, reports, invoices, CVs, Office exports, and slide decks across web and document tooling. Use for print CSS, @page/paged media, page breaks, running headers/footers, physical units, bleed/prepress, PDF generation, Playwright PDF, Gotenberg, Paged.js, WeasyPrint, PrinceXML, Vivliostyle, React-PDF, pdf-lib, Typst, LaTeX, Quarto, PDF/UA, PDF.js, PptxGenJS, docx, ExcelJS, document typography, invoices/reports/CVs, Slidev/reveal.js/Marp/Touying presentations, projector legibility, and export verification.
4
+ license: MIT
5
+ metadata:
6
+ version: 0.1.0
7
+ ---
8
+
9
+ # Pixelcraft document
10
+
11
+ Documents are fixed-fragmentation interfaces. Screen scrolling assumptions do not apply: page size, margin boxes, breaks, running navigation, physical units, print color behavior, and final-file legibility are part of the design. Choose the renderer before writing print CSS because browser print, Playwright/Gotenberg, Paged.js, WeasyPrint, PrinceXML, Vivliostyle, React-PDF, Typst, and LaTeX implement different subsets.
12
+
13
+ ## Surface craft
14
+
15
+ Build a reading sequence around repeated headers, explicit units and page boundaries, not screen-size sections. Keep related rows or notes together when pagination allows, and verify totals, source facts, selectable text and reading order in the final tagged/exported artifact. Check the actual zoom, grayscale or projector distance; do not flatten a useful document to slides-as-images.
16
+
17
+ ## References
18
+
19
+ - Read [references/print-css.md](references/print-css.md) for `@page`, named pages, counters, margin boxes, `string-set`, `target-counter()`, footnotes, fragmentation, physical units, print color, bleed, and browser-support boundaries.
20
+ - Read [references/pdf-tools.md](references/pdf-tools.md) for Playwright PDF, Gotenberg, PrinceXML, Vivliostyle, Paged.js, WeasyPrint, React-PDF, `pdf-lib`, ReportLab/PDFKit, Typst, LaTeX, Quarto, and Office (`docx`/`python-docx`, ExcelJS/SheetJS) toolchains.
21
+ - Read [references/archetypes.md](references/archetypes.md) for invoice (including ZUGFeRD/Factur-X hybrid e-invoicing), report, CV/résumé, and PDF/UA tagging composition rules.
22
+ - Read [references/slides.md](references/slides.md) for Slidev, reveal.js, Marp, Touying/Polylux, Quarto RevealJS, Keynote-style slide craft, safe areas, type scale, and export verification.
23
+ - Read [references/pdfjs-and-pptx.md](references/pdfjs-and-pptx.md) when embedding client-side PDF viewers (`pdfjs-dist` worker, `TextLayer`, HiDPI transform, cancellation) or generating programmatic PowerPoint decks (`pptxgenjs`).
24
+
25
+ ## Required workflow
26
+
27
+ 1. **Define the artifact.** Identify final format (browser print, PDF file, print shop imposition, slide deck), page size/orientation, audience, reading distance, single/duplex use, locale, accessibility requirements, and distribution channel.
28
+ 2. **Choose the rendering pipeline.** HTML/CSS when content is hypertext-like; React-PDF when React data components must emit controlled PDFs; Typst/LaTeX when programmatic typographic control matters; slides tooling when presentation state/navigation matters.
29
+ 3. **Design the page system.** Cover/body/back matter, named pages, margins, columns, running headers/footers, numbering, captions, tables, figures, blank pages, and error/missing-data states.
30
+ 4. **Control fragmentation.** Specify where breaks may/must happen before styling decoration. Tables, headings, figures, signatures, totals, and footnotes need explicit behavior.
31
+ 5. **Use physical typography.** Set print body copy within **`9–12 pt`** (`1.35–1.5` leading, `45–75ch` measure) in explicit `pt`/`mm` units; verify script/font fallback, embedding/licensing, hyphenation, widows/orphans (`>= 2–3` lines), and color contrast on paper/projector.
32
+ 6. **Verify the final artifact.** Cross-check all calculations/clauses against source data, rasterize/inspect representative pages at `100%` zoom + grayscale/physical print proof (`rendered`—screen HTML or `static` PDF byte checks never satisfy **Rule #0.3** alone).
33
+
34
+ ## Anti-lazy-default & anti-slop guard
35
+
36
+ - **Never default to `window.print()`, raw browser screenshots, or unpaginated screen HTML** for paginated invoices, reports, contracts, books, or regulatory PDFs merely because HTML is familiar. Choose a dedicated pagination pipeline—**Typst**, **WeasyPrint**, **Quarto**, **React-PDF**, **PrinceXML / Vivliostyle**, **LaTeX**, or **Playwright PDF / Gotenberg** with explicit `@page` rules—that satisfies the required fragmentation, PDF/UA tagging, font embedding, and reproducibility contract.
37
+ - **Reject decorative template slop**: never ship stock-photo report covers, fake placeholder charts, rasterized slide-as-image exports, or generic corporate-blue styling detached from real source data.
38
+
39
+ ## Non-negotiable rules
40
+
41
+ | Concern | Rule |
42
+ |---|---|
43
+ | truthfulness & source cross-check | **Cross-check totals, subtotals, tax/line-item math, dates, legal clauses, and signature blocks directly against source data**; never invent invoice/report figures or silently round mismatched totals. |
44
+ | physical body scale & fragmentation | Keep print/PDF body typography in **`9–12 pt`**; enforce `thead { display: table-header-group }`, `h1, h2, h3 { break-after: avoid; break-inside: avoid }`, and `break-inside: avoid` on `tr`, figures, **signature blocks**, and **invoice totals** (never splitting totals or signatures onto an orphaned trailing page without context). |
45
+ | dual print profiles | Choose explicitly between **(A) Digital & Office Grayscale Proof** (`10–12mm` safe hardware margins, grayscale legibility without color ink, clickable TOC bookmarks, `PDF/UA` tags) and **(B) Commercial Prepress (`PDF/X-4`)** (`3mm` / `0.125"` bleed on all sides, `5mm` inner trim safety inset, `>= 300 effective DPI` photos, `FOGRA39`/`GRACoL` CMYK ICC, `TAC <= 300%`, and **body black text on single-plate `100% K` overprint `C0 M0 Y0 K100`**). |
46
+ | font subset & `ToUnicode` CMap | Verify via `pdffonts` (`emb=yes`, `uni=yes`) + `pdftotext` that subsetted fonts retain a valid `ToUnicode` CMap so copying Vietnamese, CJK, or ligatures (`fi`, `fl`) and running ATS/search parsers never yields tofu `□` or garbled bytes. |
47
+ | vector vs raster | Emit charts, diagrams, and logos as **strict vector SVG / PDF primitives**; reserve `>= 300 effective DPI` raster strictly for photographs or `100k+`-point dense heatmaps. |
48
+ | slide deck parity & speaker notes | Build on **Master Slide** layouts (`>= 24pt` room-projection body floor, `>= 18pt` dense leave-behind), include structured **speaker notes** when presenter delivery is in scope, embed/use universal fonts, keep `< 25–30 MB` email-safe deck size, emit native editable `.pptx` objects (never rasterized PNG slides), and verify **`PPTX <-> PDF` visual parity**. |
49
+ | accessibility & deliverable proofs | Ship `PDF/UA` tag trees (`H1`–`H6`, `Table`/`TH` scope, `Artifact` running headers/footers, `Figure` alt text) and deliver **representative rendered page captures (first, middle, last, multi-page table break, and edge-case long dynamic fields)** plus a **grayscale / physical print proof**. |
50
+
51
+ ## Pre-submit checklist
52
+
53
+ - [ ] output profile explicit: **Digital/Office Grayscale (`PDF/UA`)** vs **Commercial Prepress (`PDF/X-4`, `3mm` bleed, `5mm` safety, `TAC <= 300%`, `100% K` body black)** vs **Slide Deck (`16:9`, `< 25–30 MB`)**;
54
+ - [ ] **`9–12 pt` print body typography**, **totals / line-item math / legal clauses / signature blocks cross-checked against source data**, `thead` repeat, and `break-after: avoid` / `break-inside: avoid` verified;
55
+ - [ ] `pdffonts` confirms `emb=yes` and `uni=yes` (`ToUnicode` CMap intact—Vietnamese/CJK/ligatures `fi`/`fl` copy cleanly with zero `□`);
56
+ - [ ] charts/logos are vector SVG/PDF primitives; slide decks enforce Master Slides, `>= 24pt` projection (`>= 18pt` leave-behind), **speaker notes** (when in scope), native editable `.pptx` primitives, and **`PPTX <-> PDF` parity**;
57
+ - [ ] **representative rendered page captures (first, middle, last, multi-page table break, edge-case long dynamic fields)** and **grayscale / physical print proof** inspected (`rendered`) alongside `check-pdf.mjs` (`--prepress` when print-targeted, `static`);
58
+ - [ ] **Checklist-Until-Passing Stop-Gate (`<HARD-GATE>`):** walk every checklist item above + run `slop-scan.mjs --fail-on p2`, `check-pdf.mjs`, and `check-acceptance.mjs .pixelcraft/acceptance.json` (`pixelcraft-review`) in a `Fix → Re-verify` loop until passing (`0` `fail`/`pending` rows, `rendered` page/slide proofs per `Rule #0.3`).
@@ -0,0 +1,106 @@
1
+ # Document archetypes
2
+
3
+ Archetypes are structural contracts, not visual templates. Start with legal/business/reading requirements and real content. Visual identity must never obscure correctness.
4
+
5
+ ## Invoices, receipts, and billing documents
6
+
7
+ Required information depends on jurisdiction and business model. Verify legal/tax requirements instead of copying a template. Common data includes seller identity/contact, buyer identity, unique invoice number, issue date, due/payment date, currency, line items, quantity/unit price, discounts, subtotal, tax treatment, total, payment instructions, status, and credit/cancellation references.
8
+
9
+ Design rules:
10
+
11
+ | Concern | Rule |
12
+ |---|---|
13
+ | hierarchy | invoice number/status/total/due date must be findable immediately |
14
+ | line items | use a table with aligned quantities/prices/totals; repeat header across pages |
15
+ | totals | keep subtotal/tax/total block together and near the rows it summarizes; if it moves to a later page, repeat enough context |
16
+ | money | use explicit currency code/locale formatting; never round line items inconsistently with totals |
17
+ | status | draft/paid/void/overdue states need text and date, not color alone |
18
+ | payment | instructions must be actionable and truthful; expose missing/invalid payment data as a draft-blocking state |
19
+ | multilingual | tax labels, legal names, addresses, numerals, dates, and currency need locale-appropriate layout without truncating long translations |
20
+
21
+ Fragmentation checks: one-line invoice, many pages of line items, zero-rated/tax-exempt rows, discounts/credits, long addresses/legal notes, missing buyer fields, and last-page total placement.
22
+
23
+ ### EU hybrid e-invoicing (`ZUGFeRD` / `Factur-X`)
24
+
25
+ When issuing B2B or B2G invoices subject to EU EN 16931 / German ZUGFeRD / French Factur-X mandates:
26
+
27
+ - emit a **PDF/A-3** container (`PDF/A-3b` or `PDF/A-3u`) embedding the structured XML invoice (`factur-x.xml` / `zugferd-invoice.xml`) as an associated file (`/AFRelationship /Alternative` or `/Data`) with matching XMP metadata;
28
+ - derive both the visual PDF and the XML payload from the **same canonical calculation model** so line totals, VAT rates, rounding, and payment terms never diverge between human-readable and machine-readable views;
29
+ - validate both PDF/A-3 conformance and EN 16931 schema/Schematron rules (e.g., VeraPDF + Mustangproject / Factur-X validator) rather than assuming a valid-looking visual PDF is compliant.
30
+
31
+ Anti-slop: decorative oversized logo consuming the first third, fake “thank you” copy replacing payment clarity, blue gradient headers, and totals hidden in a floating card detached from line items.
32
+
33
+ ## Reports, whitepapers, and manuals
34
+
35
+ Structure follows reading purpose:
36
+
37
+ 1. cover/title with document scope/version/date;
38
+ 2. abstract or executive summary for decision-makers;
39
+ 3. table of contents when navigation cost justifies it;
40
+ 4. sections with consistent heading hierarchy;
41
+ 5. figures/tables numbered only when referenced or reusable;
42
+ 6. citations/sources/footnotes;
43
+ 7. appendices/supplemental detail;
44
+ 8. document control/version/contact where appropriate.
45
+
46
+ Design rules:
47
+
48
+ - use running headers/footers for document title/section/page only when they aid navigation;
49
+ - keep figure/table captions with their objects and references accurate;
50
+ - distinguish author opinion, measured result, citation, and generated/draft content;
51
+ - use margins for notes only if the renderer/page size supports them without shrinking body text;
52
+ - provide meaningful metadata/title/author/language;
53
+ - verify text extraction and reading order.
54
+
55
+ Long-table/long-code behavior is a first-order design decision. A code block or table that silently clips at the page edge is a defect. Use wrapping, smaller semantic fragments, landscape pages, or appendices deliberately.
56
+
57
+ Anti-slop: stock-photo cover pages before any content, decorative pull quotes repeated as filler, charts without source/axis context, fake executive summaries, and excessive brand color pages that waste ink.
58
+
59
+ ## PDF/UA accessibility tagging (invoices, reports, public deliverables)
60
+
61
+ Public-sector, EU Accessibility Act (EAA), and ADA-covered documents require **PDF/UA-1 or PDF/UA-2** tagged structure—selectable text alone is not accessibility:
62
+
63
+ | Requirement | Concrete check |
64
+ |---|---|
65
+ | document metadata | set `/Lang` (BCP-47 locale), descriptive `Title`, and `/DisplayDocTitle true` |
66
+ | logical tag tree | real nested `H1`–`H6` headings (no skipped levels), `P`, `L`/`LI`, and `Link` annotations |
67
+ | data tables | real `Table` / `TR` / `TH` (with `Scope` Column/Row) / `TD` tags; never simulate tables with absolute-positioned blocks |
68
+ | artifacts | mark running headers, footers, page numbers, watermarks, and decorative borders as `Artifact` so screen readers do not repeat them mid-sentence |
69
+ | figures & charts | attach `Alt` text (and companion data table for complex charts) on every non-decorative `Figure` |
70
+ | reading & tab order | confirm logical reading order matches visual flow in multi-column layouts, callouts, and invoice totals |
71
+
72
+ Verify tagged exports with VeraPDF (PDF/UA profile) or PAC (PDF Accessibility Checker) plus a real screen-reader pass (`static`/`rendered`); mark PDF/UA compliance `not-checked` if no tag inspection ran.
73
+
74
+ ## CVs and résumés
75
+
76
+ Norms vary by country, industry, seniority, and submission channel. Do not impose one-page/photo/personal-detail rules universally.
77
+
78
+ Content rules:
79
+
80
+ - truthful names/titles/dates/claims; no invented metrics or credential inflation;
81
+ - concrete scope and outcomes over buzzword lists;
82
+ - machine-readable text for applicant-tracking systems;
83
+ - clear chronology and explanation of relevant gaps only when chosen by the user;
84
+ - contact links that are correct and appropriate;
85
+ - no skill “meters” or percentage bars unless the scale is meaningful (it usually is not);
86
+ - photo/age/marital status only when culturally/legal-context appropriate and user-requested.
87
+
88
+ Layout rules:
89
+
90
+ - scan order: name/target role/contact, experience, evidence, skills/education;
91
+ - avoid multi-column parsing ambiguity when ATS matters;
92
+ - preserve enough whitespace for annotation and print;
93
+ - use robust typography rather than decorative icons for every line;
94
+ - test PDF text extraction/copy order and one/two-page variants.
95
+
96
+ Anti-slop: black sidebar with portrait and dot ratings, generic adjectives (“detail-oriented team player”), QR codes without destination/context, and template sections left with placeholder text.
97
+
98
+ ## Shared document QA
99
+
100
+ - inspect first/middle/last page and longest realistic content (`rendered`);
101
+ - print or preview at 100%;
102
+ - validate totals/references/page numbers/cross-references (and embedded ZUGFeRD/Factur-X XML where required);
103
+ - search/copy extracted text and inspect PDF/UA tag tree/reading order;
104
+ - verify fonts/glyph fallback for actual names/locales;
105
+ - test grayscale and backgrounds-disabled output;
106
+ - mark missing legal/PDF/UA/e-invoice review explicitly as `not-checked` rather than implying compliance.
@@ -0,0 +1,314 @@
1
+ # PDF and document toolchains
2
+
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
+
5
+ ## Selection matrix
6
+
7
+ | Tool | Input / model | Best for | Critical constraints |
8
+ |---|---|---|---|
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`).
91
+
92
+ ## Paged.js
93
+
94
+ Paged.js paginates HTML in the browser and polyfills CSS Paged Media / Generated Content:
95
+
96
+ ```js
97
+ import { Previewer } from 'pagedjs';
98
+
99
+ const flow = await new Previewer().preview(
100
+ document.querySelector('#content'),
101
+ ['/print.css'],
102
+ document.querySelector('#preview'),
103
+ );
104
+ console.log(`Rendered ${flow.total} pages`);
105
+ ```
106
+
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.
108
+
109
+ ## WeasyPrint
110
+
111
+ WeasyPrint turns HTML/CSS into PDF in Python without a browser:
112
+
113
+ ```python
114
+ from weasyprint import HTML
115
+
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
+ )
120
+ ```
121
+
122
+ Constraints:
123
+
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.
127
+
128
+ ## React-PDF (`@react-pdf/renderer`)
129
+
130
+ `@react-pdf/renderer` renders React primitives (`Document`, `Page`, `View`, `Text`, `Image`, `Link`, SVG primitives) into PDF rather than browser DOM:
131
+
132
+ ```jsx
133
+ import { Document, Page, Text, View, Font } from '@react-pdf/renderer';
134
+
135
+ Font.register({ family: 'Inter', src: '/fonts/Inter-Regular.ttf' });
136
+
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' }}>
140
+ <Text render={({ pageNumber, totalPages }) => `${pageNumber} / ${totalPages}`} fixed />
141
+ <View>{/* flexbox-like content */}</View>
142
+ </Page>
143
+ </Document>
144
+ );
145
+ ```
146
+
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)
152
+
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.
154
+
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.
197
+
198
+ ## Typst
199
+
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):
201
+
202
+ ```typst
203
+ #set document(title: "Quarterly Operations Report", author: "Example Ltd.")
204
+ #set page(
205
+ paper: "a4",
206
+ margin: (top: 18mm, right: 16mm, bottom: 20mm, left: 16mm),
207
+ header: [Quarterly Operations Report],
208
+ footer: context align(right)[#counter(page).display("1 / 1", both: true)],
209
+ )
210
+ #set text(font: "Source Serif 4", size: 10.5pt, lang: "en")
211
+ ```
212
+
213
+ Rules and Typst 0.12–0.14+ capabilities:
214
+
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.
220
+
221
+ ## LaTeX
222
+
223
+ Use LaTeX when the document lives in an academic/TeX pipeline or needs TeX's math and bibliography tooling:
224
+
225
+ ```tex
226
+ \usepackage[a4paper,margin=18mm]{geometry}
227
+ \usepackage{fancyhdr}
228
+ \pagestyle{fancy}
229
+ ```
230
+
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
+ ```
301
+
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.
304
+
305
+ ## Toolchain verification matrix
306
+
307
+ | Check | Evidence required |
308
+ |---|---|
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`) |