@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,53 +1,109 @@
1
1
  # Plotly Dash
2
2
 
3
- ## Token mapping
4
-
5
- Put generated CSS variables in the `assets/` folder or external stylesheet; Dash automatically serves project assets when configured correctly. Use consistent component class names/design-system wrappers rather than inline style dictionaries everywhere.
6
-
7
- ## Layout and responsive idioms
8
-
9
- Dash layout is React component composition authored in Python. Use HTML containers, grid/flex CSS, responsive breakpoints/logical spacing, and component hierarchy deliberately. Do not make a page of nested Divs with inline styles and call it a design system.
10
-
11
- ## Typography/custom fonts
12
-
13
- Load fonts through assets/external stylesheets with fallback/subset policy. Verify figure fonts separately; Plotly chart typography does not automatically inherit every page font/role.
14
-
15
- ## Motion/reduced motion
16
-
17
- Use CSS motion sparingly and honor reduced motion. Callback latency/loading states are the primary motion/feedback concern. Do not spin indefinitely because a callback failed silently.
18
-
19
- ## Accessibility specifics
3
+ ## Dash 3 runtime, theming, and component ecosystem
4
+
5
+ Dash 3 runs on **React 18**, replaces the removed `app.run_server()` with **`app.run()`**, and introduces **`dash.hooks`** for reusable plugin/layout/callback lifecycle extensions.
6
+
7
+ - **Token mapping**: Place semantic CSS variables in `assets/tokens.css` (auto-served by Dash) or configure **Dash Mantine Components (`dash_mantine_components` / `dmc.MantineProvider`)** with a typed theme object rather than duplicating inline `style={...}` dicts. Always synchronize Plotly figure templates (`layout.template`) with light/dark page tokens.
8
+ - **High-density tables**: Prefer **Dash AG Grid (`dash_ag_grid.AgGrid`)** over legacy `dash_table.DataTable` for virtualized sorting, filtering, pinned columns, accessible keyboard grid navigation, and numeric formatting.
9
+ - **Multipage apps**: Enable **Dash Pages** (`Dash(__name__, use_pages=True)`) with `dash.register_page(__name__, path="/cohorts", name="Cohorts")` and render `dash.page_container` inside one shared shell.
10
+
11
+ ## Callbacks: Patch, clientside, background, and duplicate outputs
12
+
13
+ ```python
14
+ import dash
15
+ from dash import Dash, DiskcacheManager, Input, Output, Patch, State, callback, clientside_callback, dcc, html
16
+ import dash_mantine_components as dmc
17
+ import dash_ag_grid as dag
18
+ import diskcache
19
+
20
+ cache = diskcache.Cache("./.dash-cache")
21
+ app = Dash(__name__, use_pages=True, background_callback_manager=DiskcacheManager(cache))
22
+
23
+ app.layout = dmc.MantineProvider(
24
+ dmc.AppShell(
25
+ [
26
+ dmc.AppShellHeader(dmc.Group([dmc.Title("Ops Monitor", order=3), dmc.Switch(id="dark-toggle", label="Dark")])),
27
+ dmc.AppShellMain([
28
+ dmc.Button("Run heavy backfill", id="run-btn"),
29
+ dmc.Button("Cancel", id="cancel-btn", variant="outline"),
30
+ dmc.Progress(id="job-progress", value=0),
31
+ dcc.Graph(id="live-chart"),
32
+ dag.AgGrid(id="orders-grid", columnDefs=[{"field": "order_id"}, {"field": "amount"}], rowData=[]),
33
+ dash.page_container,
34
+ ]),
35
+ ]
36
+ )
37
+ )
38
+
39
+ # Partial update with Patch(): append a point without re-serializing the whole figure
40
+ @callback(Output("live-chart", "figure", allow_duplicate=True), Input("tick", "n_intervals"), prevent_initial_call=True)
41
+ def append_point(_):
42
+ patched = Patch()
43
+ patched["data"][0]["x"].append(next_ts())
44
+ patched["data"][0]["y"].append(next_value())
45
+ return patched
46
+
47
+ # Zero-roundtrip JS callback for instant UI responsiveness (theme switch, drawer toggle)
48
+ clientside_callback(
49
+ "checked => checked ? 'dark' : 'light'",
50
+ Output("mantine-provider", "forceColorScheme"),
51
+ Input("dark-toggle", "checked"),
52
+ )
53
+
54
+ # Non-blocking background callback with cancellation and real progress
55
+ @callback(
56
+ Output("orders-grid", "rowData"),
57
+ Input("run-btn", "n_clicks"),
58
+ background=True,
59
+ running=[(Output("run-btn", "disabled"), True, False)],
60
+ cancel=[Input("cancel-btn", "n_clicks")],
61
+ progress=[Output("job-progress", "value")],
62
+ prevent_initial_call=True,
63
+ )
64
+ def run_backfill(set_progress, _n):
65
+ rows = []
66
+ for pct, batch in fetch_batches():
67
+ rows.extend(batch)
68
+ set_progress(pct)
69
+ return rows
70
+
71
+ if __name__ == "__main__":
72
+ app.run(debug=True)
73
+ ```
20
74
 
21
- Use semantic html components, labels associated with inputs where supported, meaningful button/link distinctions, alt text/text summaries for charts, keyboard/focus verification. Plotly charts need nonvisual summaries/tables for critical data. Dash abstraction does not guarantee DOM correctness.
75
+ - Use `dash.hooks.layout(...)` / `dash.hooks.error(...)` to attach cross-cutting banners, telemetry, or global error handling cleanly across pages.
76
+ - Always pair `Output(..., allow_duplicate=True)` with `prevent_initial_call=True` (or `"initial_duplicate"`) and document which callbacks write to the same target.
22
77
 
23
- ## States idiom
78
+ ## Typography, motion, and accessibility
24
79
 
25
- Callbacks need explicit `Input`/`Output`/`State` ownership, validation, exception handling, duplicate/collision behavior, cancellation/background strategy where appropriate, and loading/empty/error/offline state rendering. Use `prevent_initial_call` deliberately; hidden chained callbacks create unpredictable UX.
80
+ Load custom fonts via `assets/` or `external_stylesheets` and configure `figure.layout.font` explicitly because Plotly SVGs do not inherit every page font role. Honor `prefers-reduced-motion` in `assets/*.css`. Use semantic HTML (`html.Main`, `html.Nav`, `html.Label`) or accessible `dmc` primitives, verify keyboard reach in AG Grid and modals, and pair Plotly charts with text summaries or expandable tables.
26
81
 
27
- ## Forms idiom
82
+ ## States and forms idiom
28
83
 
29
- Use correct core component types, labels/help text, validation after meaningful completion, persistence through callback failure, debouncing only when appropriate, and paste/autofill behavior inherited from DOM. Do not trigger expensive callbacks per keystroke unintentionally.
84
+ Keep user/session state in `dcc.Store(storage_type="session" | "memory")` (never mutable module globals), bound payload size, and surface empty datasets, callback errors, and offline states visibly rather than leaving an infinite loading spinner. Use `State(...)` + an explicit Apply button for multi-filter expensive queries.
30
85
 
31
86
  ## Do/don't pairs
32
87
 
33
88
  | Do | Don't |
34
89
  |---|---|
35
- | semantic stylesheet + stable class names | inline `style={...}` repeated across every component |
36
- | explicit callback error output/state | swallowing exceptions so loading never resolves |
37
- | chart plus textual takeaway/table alternative | color-only Plotly chart as sole critical evidence |
38
- | debounce/submit explicit expensive queries | backend query on every keystroke by accident |
39
- | callback ownership graph understood/documented | circular/hidden chained callbacks nobody can reason about |
90
+ | `app.run(debug=True)` in Dash 3 | Removed `app.run_server(...)` |
91
+ | `Patch()` for incremental chart/grid mutations | Re-serializing megabyte figure dicts on every tick |
92
+ | `clientside_callback` for theme toggles and pure UI state | Round-tripping to Python just to open a modal or flip dark mode |
93
+ | `background=True` with `running=`, `cancel=`, `progress=` | Blocking Gunicorn workers on 30-second queries |
94
+ | `dash_ag_grid.AgGrid` + `dash_mantine_components` | Nested raw `html.Div`s with repeated inline `style={...}` |
95
+ | `dcc.Store` per-session state | Mutating global Python lists/DataFrames across concurrent users |
40
96
 
41
97
  ## Known traps
42
98
 
43
- Duplicate callback outputs, hidden chaining, stale cache/session leakage, large serialization payloads, Plotly color/font defaults clashing with page design, callback exception opacity, asset loading order, multi-user state leakage.
99
+ Calling removed `app.run_server()`, circular callback graphs, giant JSON payloads in `dcc.Store`, forgetting `prevent_initial_call` with `allow_duplicate=True`, uncancelled long background jobs, Plotly default light template clashing with dark mode, and silent callback exceptions leaving spinners stuck.
44
100
 
45
101
  ## Verification commands
46
102
 
47
103
  ```sh
48
- python app.py
49
- python -m pytest
50
104
  python -m compileall .
105
+ python -m pytest
106
+ python app.py
51
107
  ```
52
108
 
53
- Use browser inspection and callback/network tracing for interaction evidence. Plotly export/static screenshots are not full UI verification.
109
+ Use `dash.testing` (`dash_duo` with headless Chromium) or Playwright to inspect rendered callbacks, network payloads, dark mode, and keyboard navigation (`rendered` evidence); direct Python callback unit tests prove logic only (`static`).
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Token mapping
4
4
 
5
- Evidence projects keep project settings in `evidence.config.yaml` and theme configuration in `theme.yaml` at the project root. Use the theme system for colors, palettes, and scales before local overrides; keep light/dark palettes paired and semantic rather than recoloring individual charts:
5
+ Keep project settings in `evidence.config.yaml` and theme configuration in `theme.yaml` at the project root. Define paired light/dark palettes and color scales in `theme.yaml` before overriding individual components:
6
6
 
7
7
  ```yaml
8
8
  theme:
@@ -10,66 +10,81 @@ theme:
10
10
  primary:
11
11
  light: "#2563eb"
12
12
  dark: "#3b82f6"
13
+ colorPalettes:
14
+ default:
15
+ light: ["#2563eb", "#0d9488", "#d97706", "#7c3aed"]
16
+ dark: ["#60a5fa", "#2dd4bf", "#fbbf24", "#a78bfa"]
13
17
  ```
14
18
 
15
- Verify exact theme keys against the installed Evidence version because the project has evolved across releases.
19
+ Verify exact theme keys against the installed `@evidence-dev/evidence` version because palette/theme schemas evolve across releases.
16
20
 
17
21
  ## Layout and responsive idioms
18
22
 
19
- Pages are Markdown files, normally under the configured `pages` directory. `evidence.config.yaml` can set defaults such as page width, cards, table of contents, and auto-refresh. Compose operational dashboards around reading order and decision density rather than filling width with equal cards. Test narrow screens, print/export/share links, long dimension names, and navigation depth.
23
+ Pages are Markdown files under `pages/`. `evidence.config.yaml` sets defaults such as layout width, navigation, and appearance. Evidence compiles SQL extracts from `sources/` into local Parquet files queried in the browser via **Universal SQL (DuckDB-Wasm)**. Compose operational reports around reading order and decision density rather than equal-height KPI cards. Test narrow screens, print/export views, shared filter URLs, and long dimension names.
20
24
 
21
- ## Typography/custom fonts
25
+ ## Typography and numeric precision
22
26
 
23
- Use project theme/layout settings for typography where supported. Keep numeric alignment, units, date granularity, and label truncation deliberate. Markdown prose is part of the product: explain what the query means, freshness, caveats, and action expected.
27
+ Configure font families in `theme.yaml` where supported. Keep numeric format strings explicit (`fmt=usd0`, `fmt=pct1`, tabular alignment) and label time grain and timezone in headings or notes. Markdown prose is part of the product: document metric definitions, freshness timestamps, and caveats right beside the visuals.
24
28
 
25
- ## Motion/reduced motion
29
+ ## Motion and reduced motion
26
30
 
27
- Evidence renders browser UI. Any custom motion must respect `prefers-reduced-motion`; do not use animated chart transitions as the only signal that data refreshed. Auto-refresh needs visible freshness/state feedback.
31
+ Evidence renders Svelte browser UI. Any custom transitions must respect `prefers-reduced-motion`, and never rely on chart animation as the sole signal that filters or data updated.
28
32
 
29
33
  ## Accessibility specifics
30
34
 
31
- Use semantic Markdown headings and text alternatives for charts/tables. Validate keyboard reach and visible focus for filters/buttons, non-color encoding in charts, contrast of both light/dark theme palettes, and table summaries for screen-reader users. Component accessibility varies by version; inspect the rendered page rather than assuming BI components are accessible by default.
35
+ Use semantic Markdown heading levels (`h1` -> `h2` -> `h3`) and plain-language summaries around charts and tables. Validate keyboard reach and visible focus on inputs (`Dropdown`, `DateRange`, `ButtonGroup`), contrast in both light and dark modes, non-color chart encodings, and table column labels in the rendered DOM rather than assuming BI components are accessible by default.
32
36
 
33
- ## States idiom
37
+ ## States and Universal SQL idiom
34
38
 
35
- SQL fenced blocks define named queries; components consume them through `data` attributes. Handle empty results, warehouse/connectivity failure, invalid credentials, stale snapshots, partial query failure, auto-refresh pending/error, and no-permission states honestly:
39
+ SQL fenced blocks define named client-side DuckDB-Wasm queries; Svelte components consume them through `{query_name}` props and reactive `${inputs.*}` bindings. Handle empty results, source-build failure, stale Parquet snapshots, and missing permissions explicitly:
36
40
 
37
41
  ````markdown
38
42
  ```sql daily_orders
39
- select * from demo.daily_orders limit 10
43
+ select
44
+ order_date,
45
+ region,
46
+ revenue_usd
47
+ from warehouse.daily_orders
48
+ where region like '${inputs.region.value}'
49
+ order by order_date desc
40
50
  ```
41
51
 
42
- {% table data="daily_orders" /%}
43
- ````
52
+ <Dropdown data={regions} name=region value=region title="Region">
53
+ <DropdownOption value="%" valueLabel="All regions" />
54
+ </Dropdown>
44
55
 
45
- Syntax/version details change; verify against the project template before editing broadly.
56
+ {#if daily_orders.length === 0}
57
+ No orders match the selected region. Widen the filter or check the latest source build.
58
+ {:else}
59
+ <BarChart data={daily_orders} x=order_date y=revenue_usd yFmt=usd0 title="Daily revenue" />
60
+ <DataTable data={daily_orders} search=true rows=15 />
61
+ {/if}
62
+ ````
46
63
 
47
- ## Forms idiom
64
+ ## Forms and filter idiom
48
65
 
49
- Use labeled filters/input components supported by the installed version. Show active filters in text, preserve useful filter state across navigation/share links where supported, validate date/numeric ranges, and never expose raw SQL injection paths through interpolated user input.
66
+ Use labeled Evidence input components (`Dropdown`, `DateRange`, `TextInput`, `ButtonGroup`). Reflect active filters in prose or headings, validate date/numeric bounds, and avoid constructing unquoted raw SQL identifiers from user text even against local DuckDB-Wasm snapshots.
50
67
 
51
68
  ## Do/don't pairs
52
69
 
53
70
  | Do | Don't |
54
71
  |---|---|
55
- | version-controlled `evidence.config.yaml`/`theme.yaml` | undocumented local-only theme or page settings |
56
- | named SQL blocks consumed by components | duplicated ad hoc SQL with inconsistent filters |
57
- | empty/error copy near the affected component | a blank chart region with no explanation |
58
- | light/dark palette contrast checks | one palette copied into both modes |
59
- | visible last-refreshed/source context | implying warehouse freshness without evidence |
72
+ | Svelte component syntax (`<DataTable data={daily_orders} />`) | Liquid/Markdoc syntax (`{% table data="daily_orders" /%}`) that fails to compile |
73
+ | Run `npm run sources` to refresh Parquet extracts before `npm run build` | Deploy stale `static/data` snapshots without checking source freshness |
74
+ | Version-controlled `evidence.config.yaml` and `theme.yaml` | Undocumented local-only theme or connector settings |
75
+ | `{#if query.length === 0}` empty states beside affected charts | Blank chart regions with no explanation |
76
+ | Visible last-built timestamp and source caveats | Implying live warehouse queries when serving static Universal SQL extracts |
60
77
 
61
78
  ## Known traps
62
79
 
63
- Warehouse credential leakage, expensive unbounded queries, implicit timezone/date-grain mistakes, SQL dialect differences by connector, static deployment freshness, theme key/version drift, filter state confusion, component accessibility gaps, Markdown prose diverging from actual query logic.
80
+ Warehouse credentials committed to `sources/*/connection.yaml` (use env vars), unbounded source queries bloating browser Parquet downloads, implicit timezone/date-grain mismatches between warehouse SQL and DuckDB-Wasm, SQL dialect differences across connectors, stale static builds, filter state confusion on narrow viewports, and prose diverging from SQL logic.
64
81
 
65
82
  ## Verification commands
66
83
 
67
84
  ```sh
68
- cat evidence.config.yaml
69
- cat theme.yaml
70
- cat package.json
85
+ npm run sources
71
86
  npm run build
72
87
  npm run dev
73
88
  ```
74
89
 
75
- Exact scripts depend on the generated project. Browser inspection of the rendered report is rendered evidence; successful SQL/build output is static/data evidence only.
90
+ `npm run sources` verifies connector extraction into Universal SQL / DuckDB-Wasm Parquet files (`static`/`data` evidence); `npm run build` validates Svelte/Markdown compilation (`static`); browser inspection across light/dark modes and narrow viewports is required for `rendered` evidence.
@@ -1,65 +1,103 @@
1
1
  # Gradio
2
2
 
3
- Evidence: current docs confirm `gr.Blocks(theme=gr.themes.Soft())`, prebuilt themes, `.set()` for theme CSS variables, `css=` on Blocks, and stable `elem_id`/`elem_classes` escape hatches.
3
+ ## Version compatibility and breaking changes (Gradio 5 vs 6)
4
+
5
+ Check the installed `gradio` version before editing theme, CSS, or chat code:
6
+
7
+ - **Message-format chat history**: Use OpenAI-style message dicts (`{"role": "user" | "assistant", "content": ...}`) with `type="messages"` in Gradio 5 (`gr.Chatbot(type="messages")`, `gr.ChatInterface(..., type="messages")`). Legacy `[user, bot]` tuple history is deprecated in Gradio 5 and removed in Gradio 6 (where message dicts are the default).
8
+ - **`theme` and `css` placement**: In Gradio 5, pass `theme=` and `css=` to `gr.Blocks(theme=..., css=...)`. In **Gradio 6**, `theme`, `css`, `js`, and `head` move to `demo.launch(theme=..., css=...)`. Inspect the repo's `gradio` pin and existing entrypoints before choosing placement.
4
9
 
5
10
  ## Token mapping
6
11
 
7
- Prefer themes before CSS:
12
+ Start with a prebuilt theme (`gr.themes.Base`, `Soft`, `Default`, `Monochrome`) and override semantic CSS variables with `.set(...)`. Attach stable `elem_id` or `elem_classes` hooks rather than targeting generated Svelte classes:
8
13
 
9
14
  ```python
10
- theme = gr.themes.Default(primary_hue="blue").set(
15
+ import gradio as gr
16
+
17
+ theme = gr.themes.Soft(primary_hue="blue", neutral_hue="slate").set(
18
+ body_background_fill="#faf8f1",
11
19
  loader_color="#0074ca",
12
20
  )
13
- with gr.Blocks(theme=theme, css=".gradio-container { }") as demo:
14
- ...
21
+
22
+ # Gradio 5: gr.Blocks(theme=theme, css=".result-panel { border-radius: 12px; }")
23
+ # Gradio 6: pass theme=theme and css=... to demo.launch(...)
24
+ with gr.Blocks() as demo:
25
+ out = gr.Markdown(elem_classes=["result-panel"])
26
+
27
+ demo.launch(theme=theme, css=".result-panel { border-radius: 12px; }")
15
28
  ```
16
29
 
17
- Map semantic tokens through documented theme variables first. Use `elem_classes` for stable hooks; autogenerated DOM selectors are brittle across versions.
30
+ ## Chat, dynamic rendering, multipage, and state idioms
31
+
32
+ ```python
33
+ import gradio as gr
18
34
 
19
- ## Layout and responsive idioms
35
+ def respond(message: str, history: list[dict]):
36
+ partial = ""
37
+ for token in stream_model(message, history):
38
+ partial += token
39
+ yield partial
20
40
 
21
- Use Blocks rows/columns/tabs/groups/accordion according to task flow. ML demos often need input → control → output scan clarity, not dashboard chrome. Control density depends on expert frequency. Mobile embedding and narrow iframe behavior must be checked.
41
+ with gr.Blocks() as demo:
42
+ prefs = gr.BrowserState({"temperature": 0.2}) # persisted in browser localStorage
43
+ session_cache = gr.State({}) # per-session server state
22
44
 
23
- ## Typography/custom fonts
45
+ gr.ChatInterface(
46
+ fn=respond,
47
+ type="messages", # required in Gradio 5; default in Gradio 6
48
+ title="Model Evaluator",
49
+ )
24
50
 
25
- Theme typography control is limited but theme objects/CSS variables can affect major surfaces. Use custom fonts only when licensing/loading/fallback are explicit; ML demo clarity usually matters more than decorative type.
51
+ count = gr.Slider(1, 4, step=1, value=2, label="Candidate outputs")
26
52
 
27
- ## Motion/reduced motion
53
+ @gr.render(inputs=count)
54
+ def render_candidates(n: int):
55
+ with gr.Row():
56
+ for i in range(int(n)):
57
+ gr.Textbox(label=f"Candidate {i + 1}", interactive=False)
28
58
 
29
- Gradio loading/progress semantics matter more than decorative motion. Use generator progress updates truthfully where supported. Custom CSS/JS animation must honor reduced motion and not interfere with streamed output.
59
+ with demo.route("Settings"):
60
+ gr.Markdown("## Evaluation settings")
61
+ gr.Slider(0.0, 1.0, value=0.2, label="Temperature")
30
62
 
31
- ## Accessibility specifics
63
+ demo.launch(ssr_mode=True, mcp_server=True)
64
+ ```
32
65
 
33
- Use component labels/info/placeholders appropriately, meaningful input/output ordering, text alternatives for media, visible focus in custom CSS, and keyboard inspection. Gradio component accessibility varies by component/version; custom components must not regress semantics.
66
+ - **`@gr.render`**: Dynamically generate components from reactive inputs instead of pre-allocating dozens of hidden widgets with `visible=False`.
67
+ - **Multipage (`demo.route(...)`)**: Split distinct workflows (inference vs benchmark settings) onto dedicated routes with automatic nav links instead of cramming tabs into one page.
68
+ - **`gr.BrowserState` vs `gr.State`**: Use `gr.BrowserState` for safe non-secret client preferences that survive reloads; use `gr.State` for ephemeral per-session server objects; never store credentials in `BrowserState`.
69
+ - **`ssr_mode=True` & `mcp_server=True`**: Enable `ssr_mode=True` when fast initial HTML paint matters (requires Node runtime); enable `mcp_server=True` when exposing typed Python functions (with docstrings and type hints) as MCP tools for agents.
70
+ - **Custom components**: Author custom components with the **Svelte 5** CLI workflow (`gradio cc create`, `gradio cc dev`, `gradio cc build`) rather than injecting fragile inline `<script>` hacks.
34
71
 
35
- ## States idiom
72
+ ## Layout, motion, and accessibility
36
73
 
37
- Model queued/running/streaming/cancelled/error/empty states. Event handlers need concurrency/queue/cancellation semantics considered. Render missing model/file/input validation errors and preserve user input. Do not leave output blank when no result exists.
74
+ Group controls in `gr.Row`, `gr.Column`, `gr.Tabs`, and `gr.Accordion` along the input -> trigger -> output scan path. Use generator yields and `gr.Progress(track_tqdm=True)` for truthful long-running feedback; ensure custom CSS honors `prefers-reduced-motion`. Give every control a clear `label` and `info` text, keep media alt/captions present, and test narrow iframe and mobile widths.
38
75
 
39
- ## Forms idiom
76
+ ## Forms and concurrency idiom
40
77
 
41
- Input components are often live controls rather than a single submit form. Make computation triggers explicit when cost is high. Validate format/range/file type before expensive work and preserve failed inputs.
78
+ Make expensive inference triggers explicit (`gr.Button("Run", variant="primary")`) rather than firing on every slider tick. Configure `concurrency_limit` and `cancels=[run_event]` on `.click()` handlers so users can abort slow generations cleanly and queue backpressure stays visible. Validate file types/sizes before GPU work and preserve inputs on error (`gr.Error("...")`).
42
79
 
43
80
  ## Do/don't pairs
44
81
 
45
82
  | Do | Don't |
46
83
  |---|---|
47
- | stable `elem_classes=["result-panel"]` hook | scraping generated class names in custom CSS |
48
- | explicit Run/Generate button for costly work | inference on every slider movement without control |
49
- | truthful queue/progress state | fake progress that never reflects backend work |
50
- | input/output grouping by task flow | copying generic SaaS dashboard cards around everything |
51
- | clear empty/error output text | leaving blank media/output after failure |
84
+ | `type="messages"` dict history (`{"role", "content"}`) | Deprecated `[user, bot]` tuple chat history |
85
+ | Match `theme`/`css` placement to installed Gradio 5 vs 6 | Pass Gradio 5 `Blocks(theme=...)` blindly on Gradio 6 |
86
+ | `@gr.render` for variable-length UI lists | Pre-creating 20 hidden components toggled with `visible=` |
87
+ | `elem_classes=["result-panel"]` stable CSS hooks | Scraping generated Svelte class hashes |
88
+ | Explicit Run + Cancel button with `concurrency_limit` | Triggering heavy inference on every slider drag |
89
+ | `gr.BrowserState` only for non-secret client prefs | Storing API keys or PII in `gr.BrowserState` |
52
90
 
53
91
  ## Known traps
54
92
 
55
- DOM instability across versions, queue concurrency, generator cancellation, large media memory/upload limits, hidden session leakage, theme variable sprawl, iframe embedding, mobile clipping, custom JS security/file access restrictions.
93
+ Gradio 5/6 `Blocks` vs `launch` API mismatch, tuple-vs-messages `Chatbot` format errors, generator cancellation leaks, queue starvation without `concurrency_limit`, large media uploads exhausting memory, `ssr_mode=True` failing without Node, and mobile/iframe horizontal clipping.
56
94
 
57
95
  ## Verification commands
58
96
 
59
97
  ```sh
60
- python app.py
61
- python -m pytest
62
98
  python -m compileall .
99
+ python -m pytest
100
+ python app.py
63
101
  ```
64
102
 
65
- Run browser/mobile-width inspection for rendered evidence. Backend unit tests validate handlers only, not Gradio rendering.
103
+ Backend `pytest` checks verify handler logic (`static`); inspect rendered desktop/mobile/iframe views, streaming cancellation, and error paths in a browser for `rendered` evidence.
@@ -1,47 +1,82 @@
1
- # Julia Genie (adjacent data-app ecosystem)
1
+ # Julia Genie / Stipple
2
2
 
3
- Genie/Stipple is Julia web/data-app infrastructure, not Python. Route it here because the product shape is closest to internal data applications; verify current framework APIs because the ecosystem evolves quickly.
3
+ Genie and Stipple provide reactive Julia web/data-app infrastructure built over Vue/Quasar browser components. Keep reactive idioms native to Julia (`GenieFramework`) rather than porting Python patterns literally.
4
4
 
5
5
  ## Token mapping
6
6
 
7
- Stipple/Genie commonly expose Vue/Quasar-style browser UI behavior. Map tokens through theme/configuration and generated CSS variables rather than mutating autogenerated internals. Keep Julia-computed constants synchronized via token export or explicit semantic mapping.
8
-
9
- ## Layout and responsive idioms
10
-
11
- Use server-defined pages/layout/components plus responsive browser layout. Distinguish static content, reactive dashboard regions, and API-backed interactions. Do not treat every dashboard as a blank reactive canvas.
12
-
13
- ## Typography/custom fonts
14
-
15
- Load fonts in page assets/templates with fallback/subsets. Verify numeric/tabular legibility, plot/UI font consistency, scaling/localization, initial server render behavior.
16
-
17
- ## Motion/reduced motion
18
-
19
- Use CSS/component-level motion sparingly and respect `prefers-reduced-motion`. Reactive loading indicators must represent actual server/computation state rather than decorative spinners.
20
-
21
- ## Accessibility specifics
22
-
23
- Use semantic generated HTML/components, labels, keyboard/focus behavior, text summaries for plots/tables, non-color encoding, error announcements. Julia backend correctness does not prove browser accessibility; inspect emitted DOM.
7
+ Stipple renders Quasar/Vue components in the browser. Configure theme colors and typography through `public/css/` custom stylesheets (semantic CSS variables and Quasar brand overrides `--q-primary`, `--q-dark-page`) rather than mutating autogenerated component internals. Keep Plotly/Makie chart palettes synchronized with page tokens explicitly.
8
+
9
+ ## Reactive `@app` idiom (`@in`, `@out`, `@private`, `@onchange`)
10
+
11
+ Declare every reactive variable's direction explicitly: `@in` is browser-writable, `@out` is server-to-browser read-only, and `@private` stays strictly server-side (never serialized over WebSocket to the browser).
12
+
13
+ ```julia
14
+ module OpsApp
15
+ using GenieFramework, DataFrames, PlotlyBase
16
+ @genietools
17
+
18
+ @app begin
19
+ @in region = "EMEA"
20
+ @in run_trigger = false
21
+ @out regions = ["EMEA", "AMER", "APAC"]
22
+ @out loading = false
23
+ @out error_msg = ""
24
+ @out rows = DataTable(DataFrame(order_id = String[], revenue = Float64[]))
25
+ @private db_pool = init_db_pool() # never serialized to client
26
+
27
+ @onchange isready, region, run_trigger begin
28
+ loading = true
29
+ error_msg = ""
30
+ try
31
+ df = query_orders(db_pool, region)
32
+ rows = DataTable(df)
33
+ catch err
34
+ error_msg = sprint(showerror, err)
35
+ rows = DataTable(DataFrame(order_id = String[], revenue = Float64[]))
36
+ finally
37
+ loading = false
38
+ end
39
+ end
40
+ end
41
+
42
+ function ui()
43
+ [
44
+ row(class = "q-pa-md items-center q-gutter-md", [
45
+ select(:region, options = :regions, label = "Region", outlined = true),
46
+ btn("Refresh", color = "primary", @click("run_trigger = !run_trigger"), loading = :loading),
47
+ ]),
48
+ p("{{error_msg}}", class = "text-negative q-px-md", @if("error_msg != ''")),
49
+ p("No orders match this region.", class = "q-px-md", @if("!loading && error_msg == '' && rows.data.length === 0")),
50
+ table(:rows, flat = true, bordered = true),
51
+ ]
52
+ end
53
+
54
+ @page("/", ui)
55
+ end
56
+ ```
24
57
 
25
- ## States idiom
58
+ ## Layout, typography, motion, and accessibility
26
59
 
27
- Model loading/empty/error/permission/offline/stale/reactive-disconnect states explicitly. Long Julia computations need task ownership, cancellation/timeout expectations, progress feedback, cache invalidation, and multi-user isolation.
60
+ Compose responsive views with Quasar flex/grid helpers (`row`, `cell`, `col-12 col-md-6`) instead of fixed pixel widths. Load custom fonts via `public/css/` with fallbacks and `tabular-nums` on numeric cells. Bind `loading = :loading` truthfully to server computation and honor `prefers-reduced-motion` in custom CSS. Because Stipple emits Vue/Quasar DOM, inspect actual browser labels, keyboard reach, focus order, contrast, and text/table alternatives for plots.
28
61
 
29
- ## Forms idiom
62
+ ## States and concurrency idiom
30
63
 
31
- Use real labeled inputs/browser validation plus server validation. Preserve inputs across reactive updates/failed submit; use correct keyboard/paste/IME behavior and field-level recovery copy. Uploaded data needs type/size/security constraints.
64
+ - Keep mutable per-user state inside `@app` reactive models (instantiated per session); never mutate module-global `DataFrame`s shared across sessions.
65
+ - Keep database handles, tokens, and large intermediate matrices in `@private` fields so they never serialize over WebSocket.
66
+ - Offload long scientific/optimization runs with `Threads.@spawn` / async channels so WebSocket heartbeats remain responsive, and surface timeout/error branches cleanly.
32
67
 
33
68
  ## Do/don't pairs
34
69
 
35
70
  | Do | Don't |
36
71
  |---|---|
37
- | semantic theme/CSS variables | brittle overrides of generated component internals |
38
- | explicit empty-vs-error branches | blank chart when query fails |
39
- | labeled reactive inputs | controls that reset on unrelated invalidation |
40
- | server task progress/error state | fake spinner disconnected from computation |
72
+ | `@in` for user inputs, `@out` for read-only outputs, `@private` for server objects | Exposing server handles or large raw arrays as `@in`/`@out` |
73
+ | Explicit `loading`, `error_msg`, and empty-table UI branches | Leaving an empty table or stuck spinner when a query throws |
74
+ | Per-session `@app` state with `try/catch/finally` | Mutating module-level globals across concurrent sessions |
75
+ | Semantic CSS vars in `public/css/` synced with Plotly/Makie themes | Brittle overrides of generated Quasar internals |
41
76
 
42
77
  ## Known traps
43
78
 
44
- Version/API drift, reactive round-trip latency, hidden state shared across users, long-running task blocking, plot/theme mismatch, browser accessibility neglect, deployment resource limits.
79
+ Serializing huge DataFrames or secrets via `@out` instead of `@private`, blocking Genie worker threads on unspawned scientific compute, Julia first-plot/TTFX cold latency without precompilation/PackageCompiler, plot/dark-mode theme mismatch, and mutating shared module globals.
45
80
 
46
81
  ## Verification commands
47
82
 
@@ -51,4 +86,4 @@ julia --project app.jl
51
86
  npx playwright test
52
87
  ```
53
88
 
54
- Inspect browser DOM/rendering, concurrent sessions, network loss/reconnect, empty/error/large data, keyboard/focus behavior, text scaling/localization, production resource limits.
89
+ `Pkg.test()` validates Julia data and handler logic (`static`/unit evidence); browser/Playwright inspection across narrow viewports, concurrent sessions, error paths, and reconnects provides `rendered` evidence.