@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
@@ -6,20 +6,49 @@ Evidence base: usability research, platform motion/accessibility guidance, rende
6
6
 
7
7
  Motion earns its cost only when it acknowledges input, shows causality, preserves orientation, communicates progress/state, or creates the direction's single signature moment. Apple gives the same constraint: purposeful, brief, precise, optional motion—not motion for its own sake. Showcase spectacle is not permission to sacrifice usability; celebrated interfaces are still wrong when motion blocks comprehension, control, or access.
8
8
 
9
- ## Budgets
9
+ ## B1 — Frequency-calibrated motion & warm tooltip chains
10
10
 
11
- | Layer | Budget posture |
12
- |---|---|
13
- | input acknowledgment | immediate; roughly 50–120ms; never delayed behind a scene animation |
14
- | local state change | roughly 100–250ms; most UI animation belongs in a 100–500ms envelope |
15
- | sheet/panel/route transition | roughly 200–400ms; shortest non-jarring duration |
16
- | scroll-linked progress | visually respond within one normal wheel/touch increment; never require pixel-perfect scrolling |
17
- | concurrent choreographed elements | normally 1 primary + at most 2 supporting motions; cascade only when order encodes meaning |
18
- | ambient/looping motion | default none in Operate/Read; if used, subtle, pausable, and outside the reading focus |
19
- | rendering | target compositor work; animate transform/opacity, avoid layout/paint-triggering properties and `transition: all` |
20
- | assets | motion cannot justify layout shift, delayed LCP media, blocked input, or main-thread long tasks |
11
+ Calibrate animation duration inversely to daily action frequency—high-repetition controls must never pay ceremonial animation tax:
21
12
 
22
- Tokenize semantic durations/easings (`feedback.instant`, `state.standard`, `scene.enter`) rather than scattering raw milliseconds.
13
+ | Frequency tier | Typical interactions | Duration budget | Required behavior |
14
+ |---|---|---|---|
15
+ | **High frequency** (`50–100+×/day`) | command palettes, context/dropdown menus, tab/row/cell selection, keyboard list traversal, warm tooltips | **`0–100ms`** (`0ms` on key-repeat / TUI cell step) | Instant acknowledgment; zero stagger or decorative entrance delay; hold-key repeat runs at `0ms` |
16
+ | **Warm tooltip chain** | sweeping pointer/focus across sibling toolbar icons or table headers | `300–500ms` cold open (`~100ms` fade) → **`0ms` delay & `0ms` fade** while warm | Once one tooltip in a group opens, sibling tooltips open immediately with zero fade until pointer leaves the group (`~300–400ms` cooldown) |
17
+ | **Medium frequency** (`5–30×/day`) | drawers, side sheets, modal dialogs, inspector panes, accordion disclosures | **`150–220ms`** | Snappy deceleration or critically damped spring; retargetable mid-flight without queuing |
18
+ | **Low frequency / expressive** (`≤ 1–3×/session`) | first-run onboarding, signature hero reveal, milestone confirmation | **`300–500ms`** | Never block pointer, scroll, or keyboard input; user can click or navigate through immediately |
19
+ | **Rendering & concurrency** | all interactive and choreographed layers | compositor-only (`transform`, `opacity`) | Normally 1 primary + at most 2 supporting motions; ban `transition: all`, layout/paint thrashing, and idle loops in Operate/Read |
20
+
21
+ Tokenize semantic durations and physics (`motion.instant`, `motion.fast`, `motion.panel.enter`, `motion.panel.exit`, `motion.spring.operational`) rather than scattering raw milliseconds.
22
+
23
+ ## B3 — Origin-aware scaling, asymmetric open/close & damped springs
24
+
25
+ Overlays and interactive surfaces must preserve spatial causality and dismiss without drag:
26
+
27
+ 1. **Subtle trigger-anchored scale (`0.95 → 1.0`, never `0 → 1` center balloon):** popovers, context menus, combobox lists, and contextual sheets enter from **`scale(0.95)`–`scale(0.97)` to `1.0`** paired with opacity, anchored to the trigger's attachment corner or edge—never zooming from `0` or expanding from viewport center when opened by a corner button.
28
+ 2. **Asymmetric enter vs exit duration:** closing transitions run **faster than opening (`~100–130ms` exit vs `~160–200ms` enter)** using a brisk exit curve (`ease-in` or tight spring) so dismissing menus, modals, and sheets gets out of the user's way immediately.
29
+ 3. **Velocity-preserving, non-rubbery operational springs (`ζ ≥ 0.85`):** gesture-driven sheets, swipeable cards, and pan-to-dismiss overlays inherit release velocity via spring physics without cartoonish overshoot (damping ratio `ζ ≥ 0.85`—critically or near-critically damped—in Operate/Read UI; degrade to brief opacity crossfades under Reduced Motion).
30
+
31
+ | Platform | Trigger-origin anchor idiom | Asymmetric timing / operational spring (`ζ ≥ 0.85`) |
32
+ |---|---|---|
33
+ | **Web CSS / Popover** | `transform-origin: var(--popover-origin, top start)` (or CSS Anchor Positioning edge) + `scale(0.96)` | Enter `180ms` `ease-out` / spring `linear()`; exit `115ms` `ease-in` |
34
+ | **SwiftUI / AppKit** | `.popover(attachmentAnchor: .rect(.bounds))` or `.scaleEffect(open ? 1 : 0.96, anchor: .topLeading)` | `.spring(duration: 0.2, bounce: 0.0)` (enter) / `.easeIn(duration: 0.12)` (exit) |
35
+ | **Jetpack Compose** | `scaleIn(initialScale = 0.95f, transformOrigin = TransformOrigin(0f, 0f))` | `tween(180, FastOutSlowInEasing)` enter / `tween(115, FastOutLinearInEasing)` exit; `Spring.DampingRatioNoBouncy` |
36
+ | **Flutter** | `ScaleTransition` / `Transform.scale` with `alignment: AlignmentDirectional.topStart` | `SpringDescription.withDampingRatio(mass: 1, stiffness: 500, ratio: 0.9)` or `duration: 180ms` / `reverseDuration: 115ms` |
37
+ | **Desktop / Game UI** | Anchor popup rect to widget `mapToGlobal` trigger edge (Qt/WinUI/Slint/UMG); scale `0.96 → 1.0` | `160–180ms` enter, `100–120ms` exit; instant `0ms` in TUI |
38
+
39
+ ## Concentric geometry and translucent materials
40
+
41
+ - **Concentric corner radii** (see `references/layout.md` `B2`): when nesting rounded containers, compute `innerRadius = max(0, outerRadius - padding)` so nested borders stay optically parallel instead of pinching at corners.
42
+ - **Refractive / glass surfaces** (see `references/color.md` `B4`): pair translucent blur with saturation boost (`saturate(160–180%)` / native OS vibrancy) and provide a solid high-contrast fallback under `@media (prefers-reduced-transparency: reduce)` and platform Reduce Transparency settings:
43
+
44
+ ```css
45
+ @media (prefers-reduced-transparency: reduce) {
46
+ .glass-surface {
47
+ backdrop-filter: none;
48
+ background-color: var(--semantic-color-surface-raised);
49
+ }
50
+ }
51
+ ```
23
52
 
24
53
  ## Technique library
25
54
 
@@ -35,6 +64,64 @@ Tokenize semantic durations/easings (`feedback.instant`, `state.standard`, `scen
35
64
  | WebGL/shader accent | material/light/data inherently spatial or generative | one bounded canvas/scene; pause offscreen; static poster; GPU/memory budget | Metal/Vulkan/OpenGL/native scene only at signature surface | high-quality static image/canvas fallback | default orb/fluid/aurora background |
36
65
  | kinetic type/marquee | ticker/log/scoreboard semantics or deliberate print/poster voice | transform-only loop, pause on hover/focus, duplicate content accessibly | ticker view with reduced speed/control | static wrapped text | meaningless infinite marquee as faux award-site signal |
37
66
 
67
+ ## Modern native CSS motion primitives
68
+
69
+ Prefer declarative browser primitives over JS animation runtimes when targeting modern web surfaces—always pair with `@supports` progressive enhancement and `@media (prefers-reduced-motion: reduce)`:
70
+
71
+ ```css
72
+ /* 1. Critically damped operational spring curve (zeta >= 0.85, zero rubbery overshoot) */
73
+ :root {
74
+ --ease-spring-operational: linear(
75
+ 0, 0.012, 0.049 2.2%, 0.194 5%, 0.421 9%, 0.728 15.5%,
76
+ 0.892 20.8%, 0.968 25.4%, 0.996 29.8%, 1.004 35%, 1.002 46%, 1
77
+ );
78
+ }
79
+
80
+ /* 2. Origin-aware 0.96 -> 1.0 scale + asymmetric faster exit (115ms close vs 180ms open) */
81
+ [popover], dialog {
82
+ opacity: 0;
83
+ transform-origin: var(--popover-origin, top left);
84
+ transform: scale(0.96) translateY(-2px);
85
+ /* Exit transition (applies when closing): brisk 115ms ease-in */
86
+ transition: opacity 115ms ease-in, transform 115ms ease-in,
87
+ overlay 115ms allow-discrete, display 115ms allow-discrete;
88
+ }
89
+ [popover]:popover-open, dialog[open] {
90
+ opacity: 1;
91
+ transform: scale(1) translateY(0);
92
+ /* Enter transition (applies when opening): 180ms damped spring */
93
+ transition: opacity 160ms ease-out, transform 180ms var(--ease-spring-operational),
94
+ overlay 180ms allow-discrete, display 180ms allow-discrete;
95
+ @starting-style { opacity: 0; transform: scale(0.96) translateY(-2px); }
96
+ }
97
+
98
+ /* 3. Cross-document View Transitions + shared group styling */
99
+ @view-transition { navigation: auto; }
100
+ .card-media { view-transition-class: card-morph; }
101
+ ::view-transition-group(.card-morph) { animation-duration: 240ms; }
102
+
103
+ /* 4. Scroll-driven animations gated by @supports and reduced-motion */
104
+ @supports (animation-timeline: view()) {
105
+ @media (prefers-reduced-motion: no-preference) {
106
+ .reading-progress {
107
+ animation: grow-bar linear both;
108
+ animation-timeline: scroll(root block);
109
+ }
110
+ .chapter-figure {
111
+ animation: reveal-figure linear both;
112
+ animation-timeline: view();
113
+ animation-range: entry 10% cover 35%;
114
+ }
115
+ }
116
+ }
117
+
118
+ /* 5. Scroll-state container queries (sticky header elevation without JS scroll listeners) */
119
+ .header-wrap { container-type: scroll-state; position: sticky; top: 0; }
120
+ @container scroll-state(stuck: top) {
121
+ .site-header { border-bottom-color: var(--semantic-border-strong); }
122
+ }
123
+ ```
124
+
38
125
  ## Scrolljacking boundary
39
126
 
40
127
  Default answer: **do not scrolljack**. Scroll manipulation commonly disorients users; when stakeholders insist, use it only for functional value, keep required scroll input small, make change visible quickly, preserve normal scrollbar/progress, provide direct section links, avoid precision-dependent reveals, and user-test the rate. Never hijack input, invert direction, suppress keyboard/scrollbar behavior, or make content vanish on a slight overscroll.
@@ -39,15 +39,54 @@ Choose a typographic voice from the direction: editorial, instrumental, humanist
39
39
  | vertical/rotated type | culturally meaningful vertical writing or navigational furniture | vertical CJK requires real line-breaking/font review; Latin rotation only for labels/metadata | rotated text that becomes unreadable chrome |
40
40
  | expressive numerals | scoreboards, indexes, finance, measurement | choose lining/tabular behavior intentionally; align decimal/degree/unit | oversized numerals implying fake metrics |
41
41
 
42
- ## Scale, measure, and detail
43
-
44
- - Dense UI scale ratio roughly 1.125–1.2; editorial/persuasion roughly 1.25–1.4. Do not create twelve indistinguishable steps.
45
- - Long-form Latin target around 65–75 characters per line; adjust rather than copying blindly for CJK/Arabic/Indic and dense UI.
46
- - Latin body line-height roughly 1.45–1.65; tighten display while protecting ascenders/diacritics; dense UI may tighten only when scanlines remain clear.
47
- - Use optical size when available: display optical sizes tighter/sharper, text optical sizes sturdier.
48
- - Use tabular figures for changing/aligned data; proportional figures for prose unless alignment matters.
49
- - Avoid tracked-out lowercase; uppercase/labels can receive modest tracking. Extreme negative tracking breaks script rendering.
50
- - Preserve hanging punctuation, baseline rhythm, paragraph spacing, and orphan/widow behavior where platform allows.
42
+ ## Scale, measure, and macro discipline
43
+
44
+ - **Intentional type palette cap:** use **at most 2 font families + 1 monospace** (`display` + `body/UI` + optional `code/data` mono) unless the user's brief explicitly justifies additional voices. Delete loaded weights/styles that lack a distinct semantic role.
45
+ - **Comfortable reading measure (`45–75ch`):** constrain continuous Latin prose columns to **`45–75ch`** (`60–70ch` sweet spot); never let body paragraphs span full desktop viewport width. Calibrate equivalent character density for CJK (`~30–42` fullwidth glyphs/line) and RTL scripts.
46
+ - **Scale & line-height:** dense UI scale ratio roughly `1.125–1.2`; editorial/persuasion roughly `1.25–1.4` (avoid twelve indistinguishable steps). Latin body line-height roughly `1.45–1.65`; tighten display while protecting ascenders and stacked diacritics (`ệ, ử`).
47
+ - **Unified icon & glyph language:** match icon stroke weight, cap/join geometry, corner radius, and `1cap`/optical sizing to the active typeface—never mix rounded cartoon icons, sharp hairline technical glyphs, and solid fills across the same toolbar or navigation chrome.
48
+ - **Optical size & tracking:** use `opsz` when available; avoid tracked-out lowercase; restrict subtle negative tracking (`-0.02em` to `-0.04em`) to large Latin display headlines—never body copy or scripts with combining marks/shaping. Preserve hanging punctuation and orphan/widow control where supported.
49
+
50
+ ## B6 — Cross-platform tabular numerals (`tnum`) & true minus (`U+2212`)
51
+
52
+ Proportional digits (`1` narrower than `8`) make live counters, timers, prices, progress readouts, scrubbers, and table columns jitter horizontally on every tick or row scan, while ASCII hyphen-minus (`-`, `U+002D`) sits too low and narrow beside `+`:
53
+
54
+ 1. **Lock tabular figures (`tnum`)** on every live counter, timer/stopwatch, financial/price readout, KPI delta, data-table numeric column, badge count, and playback/progress percentage. Keep proportional figures (`pnum`) only inside flowing narrative prose where vertical column alignment is irrelevant.
55
+ 2. **Render true typographic minus `−` (`U+2212`)** for negative numbers, currency deltas (`−$42.00`, `−3.4%`), coordinates, and axis ticks so negative signs match the width and crossbar height of `+` (while keeping input parsers tolerant of typed ASCII `-`, `U+002D`).
56
+
57
+ | Platform | Idiomatic tabular-numeral & minus implementation |
58
+ |---|---|
59
+ | **Web CSS / HTML** | `font-variant-numeric: tabular-nums lining-nums;` (fallback `font-feature-settings: "tnum" 1;`); format negative display values via `Intl.NumberFormat` or `U+2212` `−` |
60
+ | **SwiftUI / UIKit / AppKit** | `.monospacedDigit()` on `Text` / `UIFontDescriptor` `kNumberSpacingType: kMonospacedNumbersSelector`; `NumberFormatter` / `.number.sign(strategy:)` |
61
+ | **Jetpack Compose / Android** | `TextStyle(fontFeatureSettings = "tnum")` on `Text` (`android:fontFeatureSettings="tnum"` in Views) |
62
+ | **Flutter** | `TextStyle(fontFeatures: const [FontFeature.tabularFigures()])` (`dart:ui`) |
63
+ | **Desktop / Game / TUI** | Qt `QFont::setTag("tnum")` (`QFont::Tag("tnum")`), WinUI/WPF `Typography.NumeralAlignment="Tabular"`, Slint/Godot/Unity SDF OpenType `tnum` or fixed-advance digit kerning; TUI cells are intrinsically monospace |
64
+
65
+ ### Modern web typographic controls
66
+
67
+ Apply modern CSS typographic primitives progressively without breaking non-Latin scripts or CLS budgets:
68
+
69
+ - **Line wrapping:** use `text-wrap: balance` on short headings/titles (≤ 4–6 lines) to eliminate awkward single-word last lines, and `text-wrap: pretty` on body prose paragraphs to reduce orphans.
70
+ - **Optical cap-height alignment:** use `text-box-trim: trim-both` with `text-box-edge: cap alphabetic` (progressively, checking browser support) on buttons, badges, and tight headings so icons and uppercase labels optically center without magic pixel padding offsets.
71
+ - **Dark-mode halation via variable `GRAD` axis:** when a variable typeface provides a `GRAD` (grade) axis, reduce grade slightly in dark mode (`font-variation-settings: "GRAD" -25`) to soften light-on-dark stroke bloom without changing glyph advance widths or causing layout shift.
72
+ - **Zero-CLS fallback metrics:** pair webfont `@font-face` declarations with metric-matched fallback faces using `size-adjust`, `ascent-override`, `descent-override`, and `line-gap-override` so font swap never shifts headings or paragraphs.
73
+ - **Typographic vertical rhythm units:** use `cap` (cap height) to align inline icons with capitals, and `lh` / `rlh` (line-height / root line-height) for paragraph margins, vertical gaps, and list indents that automatically scale with font size and leading.
74
+
75
+ ```css
76
+ @font-face {
77
+ font-family: "EditorialFallback";
78
+ src: local("Georgia");
79
+ size-adjust: 104%;
80
+ ascent-override: 92%;
81
+ descent-override: 24%;
82
+ }
83
+ h1, h2 { text-wrap: balance; text-box-trim: trim-both; text-box-edge: cap alphabetic; }
84
+ p { text-wrap: pretty; margin-block-end: 1rlh; }
85
+ .inline-icon { height: 1cap; width: auto; }
86
+ @media (prefers-color-scheme: dark) {
87
+ body { font-variation-settings: "GRAD" -25; }
88
+ }
89
+ ```
51
90
 
52
91
  ## International script floor
53
92
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: pixelcraft-data-apps
3
- description: Translates Pixelcraft direction, tokens, UX, and floor requirements into data applications, AI/ML demos, dashboards, notebooks, BI reports, and internal tools in any language. Use for Streamlit, Gradio, Reflex, NiceGUI, Dash, Panel, Shiny for Python or R, Julia Genie/Stipple, Jupyter widgets, Observable Framework, Evidence, data-app state/rerun behavior, theming limits, custom components, SQL/data freshness, reproducibility, and honest verification.
3
+ description: Translates Pixelcraft direction, tokens, UX, and floor requirements into data applications, AI/ML demos, dashboards, notebooks, BI reports, and internal tools in any language. Use for Streamlit, Gradio, Reflex, NiceGUI, Dash, Panel, Shiny for Python or R, Julia Genie/Stipple, marimo, Solara, Mesop, Taipy, Chainlit, FastHTML, Preswald, Jupyter ipywidgets, AnyWidget, Voila, Observable Framework, Evidence, and low-code internal tools (Retool, Appsmith, ToolJet, Budibase) including state/rerun behavior, theming limits, SQL freshness, and honest verification.
4
4
  license: MIT
5
5
  metadata:
6
6
  version: 0.1.0
@@ -12,11 +12,11 @@ Use this skill when the workload is a data app, AI/ML demo, dashboard, notebook
12
12
 
13
13
  ## Surface craft
14
14
 
15
- Keep active filters, data freshness and the selected result visibly linked. Put stable summaries near the controls that change them; defer heavier details without replacing the working context. Test a slow query, an empty result, a changed filter and a stale result. Do not copy a dashboard layout without its data provenance or rerun behavior.
15
+ Keep active filters, data freshness, and the selected result visibly linked. Put stable summaries near the controls that change them; defer heavier details without replacing the working context. Test a slow query, an empty result, a changed filter, and a stale result. Do not copy a dashboard layout without its data provenance or rerun behavior.
16
16
 
17
17
  ## Detection signals
18
18
 
19
- Python imports/entry points (`st.*`, `gr.*`, `rx.*`, NiceGUI `ui.*`, Dash callbacks, Panel objects, Shiny UI/server), `.streamlit/config.toml`, notebooks/ipywidgets, R `DESCRIPTION`/`app.R` with Shiny/bslib, Julia `Project.toml` with Genie/Stipple, Observable `observablehq.config.*`/data loaders, Evidence `evidence.config.yaml`/`theme.yaml`/`pages`/`sources`, SQL/warehouse configuration, model/demo artifacts, cache/data-loader definitions.
19
+ Python imports/entry points (`st.*`, `gr.*`, `rx.*`, NiceGUI `ui.*`, Dash callbacks, Panel/HoloViz objects, Shiny UI/server, `marimo` `@app.cell`, `solara`, `mesop`, `taipy`, `chainlit` `@cl.*`, `fasthtml`, `preswald`, `anywidget`/`ipywidgets`, `voila`), `.streamlit/config.toml`, `.chainlit/config.toml`, `preswald.toml`, notebooks, R `DESCRIPTION`/`app.R` with Shiny/`bslib`, Julia `Project.toml` with Genie/Stipple, Observable `observablehq.config.*`/data loaders, Evidence `evidence.config.yaml`/`theme.yaml`/`pages`/`sources`, low-code exports/configs (Retool, Appsmith, ToolJet, Budibase), SQL/warehouse configs, and cache/data-loader definitions.
20
20
 
21
21
  ## Translate direction with honest constraints
22
22
 
@@ -24,44 +24,63 @@ Python imports/entry points (`st.*`, `gr.*`, `rx.*`, NiceGUI `ui.*`, Dash callba
24
24
  2. Map tokens through the framework's supported theme layer first; use custom CSS/components only as scoped escape hatches.
25
25
  3. Understand rerun/session/callback/build semantics before designing interaction. Do not lose form state because a widget key, query lifecycle, or callback owner was careless.
26
26
  4. Prioritize data legibility, task flow, feedback, empty/error states, reproducibility, and trust over cosmetic pixel matching.
27
- 5. Escape hatch order: native theme/config → semantic component props/layout containers → documented custom CSS/classes → custom component/extension. Avoid brittle selectors where docs warn internals change.
27
+ 5. Escape hatch order: native theme/config -> semantic component props/layout containers -> documented custom CSS/classes -> custom component/extension. Avoid brittle selectors where internals change across releases.
28
28
 
29
29
  ## Platform-wide rules
30
30
 
31
- - Do not fake a generic SaaS dashboard when the framework's strength is rapid data/ML workflow clarity.
32
- - Every expensive computation or query exposes progress, freshness/cache state, cancellation/timeout expectations, and failure recovery.
33
- - Inputs have labels/help/format validation and preserve values across reruns/callbacks/navigation where possible.
34
- - Tables/charts need text summaries, empty states, real units, appropriate color scales, uncertainty/freshness cues, and non-color encoding.
35
- - Session state is explicit: inspect keys, initialization, stale cache, concurrency, multi-user leakage, query invalidation, and static snapshot age.
36
- - Secrets, uploaded files, generated files, credentials, warehouse results, and user data must not leak across sessions/users or into client bundles/static output.
31
+ - **Chart shell & interaction latency budgets**: render the **primary chart/dashboard shell in `< 1–2 s`** and keep **filter, hover, cross-filter, and brush responses within `100–200 ms`**; verify **concurrent multi-user session load** and **explicit query timeout + cancellation recovery** so slow warehouse queries never hang worker pools.
32
+ - **Truthful freshness, source attribution & metric definitions**: every query/view exposes progress, **explicit display timezone (`UTC` vs local)**, a **Data Freshness / SLA Staleness badge** (`Updated 12s ago` -> warning when lagging SLA), **visible data source attribution**, and **inline/popover metric definitions** (formula, denominator, exclusions).
33
+ - **Honest numeric, time-series & accessible chart fallbacks**: enforce right-aligned `tabular-nums`, **True Minus `U+2212` (`−`)**, explicit unit headers (`$ USD`, `ms`, `%`), **strict visual separation between `0` (measured zero) and `null / — / N/A` (missing)**, **`LTTB` / `Min-Max` envelope downsampling** on `10k–1M+` time-series, and a **screen-reader accessible data-table / text summary fallback + keyboard data-point navigation** for every chart.
34
+ - **Enterprise grid & URL-serialized state**: drive large tables via **server-side indexed cursor/keyset pagination** (`WHERE (ts, id) < (:c_ts, :c_id)` rather than slow high-offset `OFFSET`) and serialize active filters, sorts, date windows, and views into **shareable URL query parameters**.
35
+ - **OWASP CSV/XLSX security & PII masking/redaction**: neutralize **CSV/XLSX Formula Injection** by escaping/prefixing string cells starting with `=`, `+`, `-`, `@`, `\t`, or `\r`, **mask/redact PII by role on UI views, QA screenshots, and CSV/XLSX exports**, and stream large exports asynchronously rather than blocking worker RAM.
36
+ - **Safe internal-tool mutations & session isolation**: enforce **RBAC + database Row-Level Security (RLS)**, require a **`Diff / Confirm` impact modal** (`Before -> After` field preview + affected row count) before bulk updates/deletes, append every write to an immutable **Audit Log** (`actor`, `timestamp_utc`, `target`, `before -> after`), and isolate session caches/uploads strictly across concurrent users.
37
+
38
+ ## Anti-lazy-default & anti-slop guard
39
+
40
+ - **Do not reflexively default every Python/data workload to Streamlit or Gradio**: Streamlit's top-to-bottom script rerun model and Gradio's single-model demo layout excel at quick prototypes and ML inference demos, but **escalate** when the workload outgrows them:
41
+ - **Reactive notebooks & zero-hidden-state DAGs / WASM**: choose **marimo** (`@app.cell`, DuckDB `mo.sql`).
42
+ - **Concurrent multi-user reactive apps & long-running tasks**: choose **Shiny** (`ExtendedTask`), **Panel** (HoloViz / Datashader million-point streaming), or **Dash** (enterprise AG Grid + clientside/background callbacks).
43
+ - **Custom stateful web UI / full layout & auth control in Python**: choose **Reflex** or **NiceGUI**.
44
+ - **Fast read-heavy BI reports & scheduled SQL publications**: choose **Observable Framework** or **Evidence** (static/pre-built SQL snapshots with instant loads).
45
+ - **Reject untouched template slop**: do not ship default sidebar-filter dumps, unattributed KPI numbers without units/source/metric definitions/SLA freshness badges, naive `every-Nth` chart slicing, unredacted PII exports, unescaped CSVs, or unguarded bulk-delete buttons.
37
46
 
38
47
  ## Common data-app failures
39
48
 
40
- - uncontrolled reruns or rebuilds wiping input and triggering expensive work;
49
+ - uncontrolled reruns wiping input, primary chart shell stalling `> 2 s`, or concurrent multi-user load / slow queries exhausting workers without query timeouts;
41
50
  - hidden state keys or SQL parameters colliding across pages/users;
42
- - stale data presented without timestamp/cache provenance;
43
- - custom CSS selectors depending on unstable autogenerated classes;
44
- - charts with no loading/error/empty-data treatment or text summary;
45
- - sidebar/filter panel overloaded as navigation and control surface simultaneously;
46
- - progress bars that fake progress or block interaction;
47
- - wide desktop layout unusable in narrow embedded contexts;
48
- - theming confined to primary color while hierarchy/state/copy remain default.
51
+ - KPIs/charts missing source attribution, metric definitions, timezone, or SLA freshness badge, or `null` coerced to `0`;
52
+ - canvas/SVG charts lacking screen-reader data-table/summary fallbacks or keyboard data-point traversal;
53
+ - naive `every-Nth` downsampling hiding incident spikes, or `OFFSET 100000` pagination timing out;
54
+ - CSV/XLSX exports leaking unmasked PII or vulnerable to `=CMD|...` formula injection;
55
+ - internal admin tools executing bulk SQL mutations without RBAC, `Diff / Confirm` preview, or Audit Log writes.
49
56
 
50
57
  ## Verification options
51
58
 
52
- DOM-backed frameworks can often be inspected in browser when the app runs, but visual verification requires actually launching them. Unit tests may validate callbacks, SQL, loaders, or state without proving rendering. Notebook widgets depend on kernel/frontend context. Static data apps need build inspection plus browser rendering. Label absence honestly; do not imply rendering happened because Python/R/Julia/JS code compiled or SQL succeeded.
59
+ Unit tests (`AppTest`, `nicegui.testing.User`, `testthat`, `pytest`) validate callbacks, SQL, CSV escaping, PII masking, or RBAC (`static`) without proving visual or latency budgets (**Rule #0.3**: launch the app in a browser/runtime to measure `< 1–2 s` shell load, `100–200 ms` filter/brush response, keyboard/screen-reader table fallback, and concurrent/timeout behavior as `rendered` evidence). Label unavailable warehouse/load environments `not-checked`.
60
+
61
+ ## Pre-submit checklist
62
+
63
+ - [ ] zero `TODO`s, placeholder stubs, fabricated KPIs, or dead widget callbacks;
64
+ - [ ] framework choice matches **concurrent multi-user load**, rerun/DAG, and publishing needs, with **`< 1–2 s` primary chart shell**, **`100–200 ms` filter/hover/brush response**, and **query timeout/cancel recovery** verified;
65
+ - [ ] loading, empty, error, explicit timezone (`UTC`/local), **Data Freshness / SLA Staleness badge**, **visible data source attribution**, and **metric definitions** wired;
66
+ - [ ] heavy filtering/downsampling runs lazily (`LTTB` / `Min-Max`) with **indexed keyset/cursor pagination**, **URL-serialized filters**, right-aligned `tabular-nums`, **True Minus `U+2212` (`−`)**, unit headers, and strict **`0` vs `null / — / N/A`** separation;
67
+ - [ ] every chart provides a **screen-reader accessible data-table / text summary fallback + keyboard data-point navigation**;
68
+ - [ ] **PII masking/redaction** verified on UI, QA screenshots, and exports; CSV/XLSX exports neutralize formula injection (`=`, `+`, `-`, `@`, `\t`, `\r`); internal writes enforce **RBAC/RLS**, **`Diff / Confirm` modal**, and immutable **Audit Log**;
69
+ - [ ] **Checklist-Until-Passing Stop-Gate (`<HARD-GATE>`):** walk every checklist item above + run `slop-scan.mjs --fail-on p2`, `check-contrast.mjs`, runtime/query tests, and `check-acceptance.mjs .pixelcraft/acceptance.json` (`pixelcraft-review`) in a `Fix → Re-verify` loop until passing (`0` `fail`/`pending` rows, `rendered` evidence on visual/perf/a11y per `Rule #0.3`).
53
70
 
54
71
  ## Framework routing
55
72
 
56
- - Read [references/streamlit.md](references/streamlit.md) for Streamlit.
57
- - Read [references/gradio.md](references/gradio.md) for Gradio.
58
- - Read [references/reflex.md](references/reflex.md) for Reflex.
59
- - Read [references/nicegui.md](references/nicegui.md) for NiceGUI.
60
- - Read [references/dash.md](references/dash.md) for Plotly Dash.
61
- - Read [references/panel.md](references/panel.md) for Panel/HoloViz.
62
- - Read [references/shiny.md](references/shiny.md) for Shiny for Python.
63
- - Read [references/jupyter-widgets.md](references/jupyter-widgets.md) for ipywidgets/Jupyter surfaces.
64
- - Read [references/r-shiny.md](references/r-shiny.md) for R Shiny data apps.
65
- - Read [references/julia-genie.md](references/julia-genie.md) for Julia Genie/Stipple data apps.
66
- - Read [references/observable-framework.md](references/observable-framework.md) for Observable Framework dashboards/data documents.
67
- - Read [references/evidence.md](references/evidence.md) for Evidence SQL/Markdown BI reports and data products.
73
+ - Read [references/streamlit.md](references/streamlit.md) when building or auditing Streamlit apps (`.streamlit/config.toml`, `@st.fragment`, `st.navigation`, `AppTest`).
74
+ - Read [references/gradio.md](references/gradio.md) when building or auditing Gradio 5/6 demos, chat UIs, `@gr.render`, or MCP-exposed ML interfaces.
75
+ - Read [references/reflex.md](references/reflex.md) when building or auditing Reflex apps (`@rx.event`, background tasks, `rx.ComponentState`).
76
+ - Read [references/nicegui.md](references/nicegui.md) when building or auditing NiceGUI apps (`@ui.page`, `app.storage.*`, `run.io_bound`, `nicegui.testing`).
77
+ - Read [references/dash.md](references/dash.md) when building or auditing Plotly Dash 3 apps (`Patch`, clientside/background callbacks, Dash Pages, Mantine/AG Grid).
78
+ - Read [references/panel.md](references/panel.md) when building or auditing Panel/HoloViz apps (`pn.rx`, `panel-material-ui`, `ChatInterface`, Pyodide export).
79
+ - Read [references/shiny.md](references/shiny.md) when building or auditing Shiny for Python apps (`ui.Theme`, Express vs Core, `ExtendedTask`, `ui.Chat`, Shinylive).
80
+ - Read [references/reactive-data-apps.md](references/reactive-data-apps.md) when building or auditing reactive Python data apps and notebooks (`marimo`, `Solara`, `Mesop`, `Taipy`) or lazy **Polars / Narwhals** dataframe pipelines.
81
+ - Read [references/jupyter-widgets.md](references/jupyter-widgets.md) when building or auditing `ipywidgets`, `AnyWidget` ESM widgets, or `Voilá` standalone dashboards.
82
+ - Read [references/r-shiny.md](references/r-shiny.md) when building or auditing R Shiny apps (`bslib`, `ExtendedTask`+`mirai`, `bindCache`, `shinychat`/`ellmer`, modules).
83
+ - Read [references/julia-genie.md](references/julia-genie.md) when building or auditing Julia Genie/Stipple reactive data apps (`@app`, `@in`/`@out`/`@onchange`).
84
+ - Read [references/observable-framework.md](references/observable-framework.md) when building or auditing Observable Framework data documents (polyglot loaders, DuckDB-Wasm, `resize()`).
85
+ - Read [references/evidence.md](references/evidence.md) when building or auditing Evidence SQL/Markdown BI reports (Universal SQL, Svelte components, `npm run sources`).
86
+ - Read [references/ai-and-internal-data-apps.md](references/ai-and-internal-data-apps.md) when building or auditing Chainlit, FastHTML, Preswald, or low-code internal tools (Retool, Appsmith, ToolJet, Budibase).
@@ -0,0 +1,147 @@
1
+ # AI data apps and internal operational tools (Chainlit, FastHTML, Preswald, Low-Code)
2
+
3
+ Use this reference when building conversational Python AI apps (**Chainlit**), hypermedia Python web/data apps (**FastHTML**), browser-local SQL/Python data apps (**Preswald**), or **low-code internal operational tools** (**Retool**, **Appsmith**, **ToolJet**, **Budibase**). For app-owned multi-agent UX patterns and streaming chat anatomy, pair with `pixelcraft-chat-ui`.
4
+
5
+ ## Surface decision matrix
6
+
7
+ | Tool | Execution model | Primary strength | Primary constraint |
8
+ |---|---|---|---|
9
+ | **Chainlit** | Python async websocket server + React chat UI | Rapid LLM/RAG/agent chat apps with step traces, file uploads, feedback buttons, auth | Opinionated chat-first shell; heavy custom layouts need React Elements or custom CSS |
10
+ | **FastHTML** | Python ASGI (`Starlette`) + FT components + HTMX | Fast server-rendered HTML/hypermedia internal apps and dashboards with zero JS build | Complex client-side visual editors still need small JS islands or Web Components |
11
+ | **Preswald** | Python + SQL + DuckDB-WASM reactive runtime | Lightweight SQL/Python data apps deployable locally or as static browser WASM | Younger ecosystem; keep external warehouse secrets out of static WASM exports |
12
+ | **Retool / Appsmith / ToolJet / Budibase** | Visual canvas + query/transformer DAG + RBAC | Fast internal CRUD, approvals, SQL/REST admin panels, built-in SSO/audit logs | Vendor lock-in, hidden DAG coupling, strict sandbox boundaries for custom widgets |
13
+
14
+ ## Chainlit idioms
15
+
16
+ Configure appearance, custom CSS, file upload limits, and features in `.chainlit/config.toml` (`[UI] name`, `custom_css`, `default_theme`). Use `@cl.on_chat_start`, `@cl.on_message`, `cl.Step` (for tool/retrieval traces), and `msg.stream_token(...)` for truthful streaming:
17
+
18
+ ```python
19
+ import chainlit as cl
20
+
21
+ @cl.on_chat_start
22
+ async def on_start():
23
+ cl.user_session.set("history", [])
24
+ await cl.Message(content="Ready. Ask a question about regional orders.").send()
25
+
26
+ @cl.on_message
27
+ async def on_message(message: cl.Message):
28
+ async with cl.Step(name="SQL Warehouse Lookup", type="tool") as step:
29
+ step.input = message.content
30
+ rows = await run_parameterized_query(message.content)
31
+ step.output = f"Fetched {len(rows)} rows"
32
+
33
+ reply = cl.Message(content="")
34
+ await reply.send()
35
+ async for token in stream_answer(message.content, rows):
36
+ await reply.stream_token(token)
37
+ await reply.update()
38
+ ```
39
+
40
+ Keep per-user state in `cl.user_session` (never module globals), enable human feedback/auth callbacks before production deployment, and distinguish retrieval errors from empty data inside `cl.Step` output.
41
+
42
+ ## FastHTML (`python-fasthtml`) idioms
43
+
44
+ FastHTML builds semantic HTML directly in Python via FT tags (`Div`, `Form`, `Table`, `Input`) and **HTMX** attributes (`hx_post`, `hx_target`, `hx_swap`). Override or disable default PicoCSS when bringing a custom token stylesheet:
45
+
46
+ ```python
47
+ from fasthtml.common import *
48
+
49
+ app, rt = fast_app(pico=False, hdrs=(Link(rel="stylesheet", href="/tokens.css"),))
50
+
51
+ @rt("/")
52
+ def index():
53
+ return Titled(
54
+ "Order Lookup",
55
+ Form(
56
+ Label("Region", Input(name="region", value="EMEA", required=True)),
57
+ Button("Filter", type="submit"),
58
+ hx_post="/orders",
59
+ hx_target="#orders-panel",
60
+ hx_swap="innerHTML",
61
+ ),
62
+ Div(id="orders-panel", aria_live="polite"),
63
+ )
64
+
65
+ @rt("/orders", methods=["POST"])
66
+ def orders(region: str):
67
+ rows = query_orders(region)
68
+ if not rows:
69
+ return P("No orders match that region.", cls="empty-state")
70
+ return Table(
71
+ Thead(Tr(Th("Order ID"), Th("Amount"))),
72
+ Tbody(*[Tr(Td(r["id"]), Td(f"${r['amount']:,.2f}")) for r in rows]),
73
+ )
74
+ ```
75
+
76
+ Use server-side validation, CSRF/session middleware for mutations, explicit `aria-live="polite"` on HTMX target regions, and `hx-indicator` for slow queries.
77
+
78
+ ## Preswald idioms
79
+
80
+ Preswald pairs `preswald.toml` configuration (data sources, branding title/logo/primary color) with declarative Python (`connect()`, `query()`, `slider()`, `table()`, `plotly()`) powered by DuckDB:
81
+
82
+ ```python
83
+ from preswald import connect, query, slider, table, text
84
+
85
+ connect()
86
+ threshold = slider("Minimum revenue (USD)", min_val=0, max_val=10000, default=500)
87
+ df = query(f"SELECT order_id, region, revenue FROM orders WHERE revenue >= {int(threshold)}", "orders_csv")
88
+
89
+ text("# Regional Orders")
90
+ if df.empty:
91
+ text("No orders exceed the selected revenue threshold.")
92
+ else:
93
+ table(df, title="Matching orders")
94
+ ```
95
+
96
+ Coerce numeric filter inputs strictly before SQL formatting, verify source freshness, and avoid exporting private data or credentials in browser-side WASM builds.
97
+
98
+ ## Enterprise grid, export security, and safe mutations (internal tools & admin apps)
99
+
100
+ Operational data apps and low-code panels (Retool, Appsmith, ToolJet, Budibase, FastHTML, Reflex, Dash) touch live production tables—enforce enterprise data-grid, export, and write safety by default:
101
+
102
+ - **Indexed cursor/keyset pagination + URL-serialized views**: replace `OFFSET 50000` (which scans and discards 50k rows per page) with indexed keyset pagination (`WHERE (created_at, id) < (:cursor_ts, :cursor_id) ORDER BY created_at DESC, id DESC LIMIT 50`), and mirror active filters, sort keys, timezone (`UTC` vs local), and saved view IDs in the URL query string so operators can bookmark and share exact incident views.
103
+ - **OWASP CSV/XLSX Formula Injection neutralization + streaming exports**: user-controlled strings starting with `=`, `+`, `-`, `@`, `\t`, or `\r` execute as live formulas or `DDE` payloads when opened in Excel, LibreOffice Calc, or Google Sheets! Neutralize every string cell before CSV/XLSX serialization (while keeping genuine `int`/`float` negatives typed as numbers in XLSX), and stream exports (`> 10k` rows) via chunked/background workers instead of buffering whole tables in web worker RAM:
104
+
105
+ ```python
106
+ FORMULA_TRIGGERS = ("=", "+", "-", "@", "\t", "\r")
107
+
108
+ def sanitize_spreadsheet_cell(val: object) -> object:
109
+ # Keep real numbers numeric; neutralize untrusted strings that Excel/Sheets parse as formulas
110
+ if isinstance(val, (int, float)) or val is None:
111
+ return val
112
+ text = str(val)
113
+ if text.startswith(FORMULA_TRIGGERS):
114
+ return f"'{text}"
115
+ return text
116
+ ```
117
+
118
+ - **RBAC, Row-Level Security (RLS), `Diff / Confirm` modals, and Audit Logs**:
119
+ - Separate `development` / `staging` / `production` credentials and enforce both UI role gates **and** backend/database **Row-Level Security (RLS)** (hiding a button in UI never secures the endpoint).
120
+ - Gate every bulk update, refund, status override, or delete behind a **`Diff / Confirm` impact modal** showing exact affected row count, target scope, and `Before -> After` field diffs (requiring a typed reason or confirmation token for high-blast-radius actions).
121
+ - Record every mutation in an append-only **Audit Log** (`actor_id`, `role`, `timestamp_utc`, `entity_id`, `before_json`, `after_json`, `reason`, `request_id`).
122
+
123
+ ## Do/don't pairs
124
+
125
+ | Do | Don't |
126
+ |---|---|
127
+ | `cl.Step` + `cl.user_session` in Chainlit | Module-global conversation lists shared across users |
128
+ | FastHTML semantic HTML + `hx_indicator` + `aria_live` | Dropping raw unescaped user HTML via `NotStr()` |
129
+ | Indexed keyset/cursor pagination + URL-serialized filter/timezone state | `OFFSET 100000` queries or ephemeral filters lost on browser refresh |
130
+ | Prefix string cells starting with `=`, `+`, `-`, `@`, `\t`, `\r` on CSV/XLSX export and stream large downloads | Export raw user strings into CSV/XLSX where `=HYPERLINK(...)` or `=CMD|...` executes on open |
131
+ | Enforce backend RBAC/RLS + `Diff / Confirm` impact modal + immutable `who/when/before->after` Audit Log | Execute direct production bulk `UPDATE`/`DELETE` on a single unlogged button click |
132
+
133
+ ## Verification commands
134
+
135
+ ```sh
136
+ # Chainlit
137
+ chainlit run app.py -w
138
+
139
+ # FastHTML
140
+ python -m pytest
141
+ uvicorn main:app --reload
142
+
143
+ # Preswald
144
+ preswald run
145
+ ```
146
+
147
+ Run staging tests across each RBAC role (`viewer` vs `operator` vs `admin`), test CSV/XLSX export payloads containing `=1+1` and `@SUM(...)` (`static`), verify keyset pagination, URL filter reload, SLA staleness badges, and `Diff / Confirm` modals in a real browser (`rendered`), and inspect Audit Log writes (`static`/`rendered`).