@thanhnguyxn/pixelcraft 0.0.0-stage → 0.1.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 (297) hide show
  1. package/.agents/plugins/marketplace.json +20 -0
  2. package/.claude-plugin/marketplace.json +20 -0
  3. package/.claude-plugin/plugin.json +11 -0
  4. package/LICENSE +21 -0
  5. package/README.md +407 -2
  6. package/assets/README.md +28 -0
  7. package/assets/pixelcraft-logo-512.png +0 -0
  8. package/bin/pixelcraft.mjs +444 -0
  9. package/docs/ARCHITECTURE.md +102 -0
  10. package/docs/DESIGN-RATIONALE.md +143 -0
  11. package/evals/README.md +27 -0
  12. package/evals/fixtures/README.md +36 -0
  13. package/evals/fixtures/direction-prototype-complexity.json +29 -0
  14. package/evals/fixtures/finish-gate-anti-slop.json +30 -0
  15. package/evals/fixtures/forms-accessibility-negative.json +29 -0
  16. package/evals/fixtures/handoff-fidelity-tolerance.json +29 -0
  17. package/evals/fixtures/plan-brownfield-evidence.json +28 -0
  18. package/evals/fixtures/visual-qa-task-evidence.json +29 -0
  19. package/evals/fixtures/workflow-checkpoints.json +30 -0
  20. package/evals/pixelcraft-accessibility.md +57 -0
  21. package/evals/pixelcraft-brandkit.md +58 -0
  22. package/evals/pixelcraft-chat-ui.md +55 -0
  23. package/evals/pixelcraft-constrained.md +55 -0
  24. package/evals/pixelcraft-craft.md +60 -0
  25. package/evals/pixelcraft-data-apps.md +55 -0
  26. package/evals/pixelcraft-dataviz.md +59 -0
  27. package/evals/pixelcraft-desktop.md +55 -0
  28. package/evals/pixelcraft-direction.md +60 -0
  29. package/evals/pixelcraft-document.md +55 -0
  30. package/evals/pixelcraft-email.md +55 -0
  31. package/evals/pixelcraft-extensions.md +55 -0
  32. package/evals/pixelcraft-game-ui.md +59 -0
  33. package/evals/pixelcraft-handoff.md +57 -0
  34. package/evals/pixelcraft-media.md +55 -0
  35. package/evals/pixelcraft-mobile.md +59 -0
  36. package/evals/pixelcraft-patterns.md +57 -0
  37. package/evals/pixelcraft-plan.md +65 -0
  38. package/evals/pixelcraft-review.md +63 -0
  39. package/evals/pixelcraft-spatial.md +55 -0
  40. package/evals/pixelcraft-tokens.md +57 -0
  41. package/evals/pixelcraft-tui.md +55 -0
  42. package/evals/pixelcraft-ux.md +59 -0
  43. package/evals/pixelcraft-visual-qa.md +80 -0
  44. package/evals/pixelcraft-web.md +71 -0
  45. package/evals/pixelcraft.md +70 -0
  46. package/gemini-extension.json +5 -0
  47. package/install.ps1 +295 -0
  48. package/install.sh +437 -0
  49. package/package.json +63 -4
  50. package/plugin.json +24 -0
  51. package/scripts/build-adapters.mjs +290 -0
  52. package/scripts/build-release-archives.mjs +61 -0
  53. package/scripts/build-skill-zips.mjs +94 -0
  54. package/scripts/test-build-adapters.mjs +48 -0
  55. package/scripts/test-distribution.mjs +124 -0
  56. package/scripts/test-export-tokens.mjs +105 -0
  57. package/scripts/test-finish-gate.mjs +148 -0
  58. package/scripts/test-installers.mjs +67 -0
  59. package/scripts/test-release-archives.mjs +42 -0
  60. package/scripts/test-shoot.mjs +65 -0
  61. package/scripts/test-slop-scan.mjs +29 -0
  62. package/scripts/test-style-inventory.mjs +211 -0
  63. package/scripts/test-validate-skills.mjs +117 -0
  64. package/scripts/validate-skills.mjs +512 -0
  65. package/skills/pixelcraft/SKILL.md +135 -0
  66. package/skills/pixelcraft/references/design-brief.md +75 -0
  67. package/skills/pixelcraft/references/floor.md +73 -0
  68. package/skills/pixelcraft/references/report-template.md +35 -0
  69. package/skills/pixelcraft/references/stack-detection.md +155 -0
  70. package/skills/pixelcraft/references/surface-acceptance.md +40 -0
  71. package/skills/pixelcraft/references/workflow-checkpoints.md +29 -0
  72. package/skills/pixelcraft-accessibility/SKILL.md +33 -0
  73. package/skills/pixelcraft-accessibility/references/apg-patterns.md +51 -0
  74. package/skills/pixelcraft-accessibility/references/platforms.md +58 -0
  75. package/skills/pixelcraft-accessibility/references/verification.md +59 -0
  76. package/skills/pixelcraft-accessibility/references/wcag22-checks.md +66 -0
  77. package/skills/pixelcraft-brandkit/SKILL.md +115 -0
  78. package/skills/pixelcraft-brandkit/references/asset-pipeline.md +125 -0
  79. package/skills/pixelcraft-brandkit/references/brand-governance.md +80 -0
  80. package/skills/pixelcraft-brandkit/references/layouts.md +88 -0
  81. package/skills/pixelcraft-brandkit/references/logo-concepting.md +83 -0
  82. package/skills/pixelcraft-brandkit/references/logo-methods.md +98 -0
  83. package/skills/pixelcraft-brandkit/references/pixel-art-logos.md +82 -0
  84. package/skills/pixelcraft-brandkit/references/prompt-template.md +85 -0
  85. package/skills/pixelcraft-brandkit/references/qa-checklist.md +88 -0
  86. package/skills/pixelcraft-brandkit/references/visual-modes.md +123 -0
  87. package/skills/pixelcraft-chat-ui/SKILL.md +53 -0
  88. package/skills/pixelcraft-chat-ui/references/conversation-design.md +78 -0
  89. package/skills/pixelcraft-chat-ui/references/mobile-business-platforms.md +87 -0
  90. package/skills/pixelcraft-chat-ui/references/slack-discord.md +96 -0
  91. package/skills/pixelcraft-constrained/SKILL.md +51 -0
  92. package/skills/pixelcraft-constrained/references/specialized-hardware.md +66 -0
  93. package/skills/pixelcraft-constrained/references/tv-wearables.md +84 -0
  94. package/skills/pixelcraft-constrained/references/voice-ui.md +63 -0
  95. package/skills/pixelcraft-craft/SKILL.md +44 -0
  96. package/skills/pixelcraft-craft/references/color.md +69 -0
  97. package/skills/pixelcraft-craft/references/imagery-icons.md +37 -0
  98. package/skills/pixelcraft-craft/references/layout-quality.md +65 -0
  99. package/skills/pixelcraft-craft/references/layout.md +41 -0
  100. package/skills/pixelcraft-craft/references/motion.md +76 -0
  101. package/skills/pixelcraft-craft/references/typography.md +71 -0
  102. package/skills/pixelcraft-data-apps/SKILL.md +67 -0
  103. package/skills/pixelcraft-data-apps/references/dash.md +53 -0
  104. package/skills/pixelcraft-data-apps/references/evidence.md +75 -0
  105. package/skills/pixelcraft-data-apps/references/gradio.md +65 -0
  106. package/skills/pixelcraft-data-apps/references/julia-genie.md +54 -0
  107. package/skills/pixelcraft-data-apps/references/jupyter-widgets.md +53 -0
  108. package/skills/pixelcraft-data-apps/references/nicegui.md +63 -0
  109. package/skills/pixelcraft-data-apps/references/observable-framework.md +67 -0
  110. package/skills/pixelcraft-data-apps/references/panel.md +53 -0
  111. package/skills/pixelcraft-data-apps/references/r-shiny.md +54 -0
  112. package/skills/pixelcraft-data-apps/references/reflex.md +62 -0
  113. package/skills/pixelcraft-data-apps/references/shiny.md +53 -0
  114. package/skills/pixelcraft-data-apps/references/streamlit.md +65 -0
  115. package/skills/pixelcraft-dataviz/SKILL.md +63 -0
  116. package/skills/pixelcraft-dataviz/references/chart-choice.md +55 -0
  117. package/skills/pixelcraft-dataviz/references/color-accessibility.md +112 -0
  118. package/skills/pixelcraft-dataviz/references/encoding-tables-dashboards.md +97 -0
  119. package/skills/pixelcraft-dataviz/references/libraries.md +57 -0
  120. package/skills/pixelcraft-dataviz/references/realtime-graphs-maps-scale.md +99 -0
  121. package/skills/pixelcraft-desktop/SKILL.md +71 -0
  122. package/skills/pixelcraft-desktop/references/appkit.md +58 -0
  123. package/skills/pixelcraft-desktop/references/avalonia.md +59 -0
  124. package/skills/pixelcraft-desktop/references/cpp-gui.md +52 -0
  125. package/skills/pixelcraft-desktop/references/electron.md +54 -0
  126. package/skills/pixelcraft-desktop/references/go-gui.md +54 -0
  127. package/skills/pixelcraft-desktop/references/gtk.md +54 -0
  128. package/skills/pixelcraft-desktop/references/javafx-swing.md +52 -0
  129. package/skills/pixelcraft-desktop/references/qt-pyside-qml.md +61 -0
  130. package/skills/pixelcraft-desktop/references/rust-gui.md +65 -0
  131. package/skills/pixelcraft-desktop/references/tauri.md +54 -0
  132. package/skills/pixelcraft-desktop/references/uno-platform.md +52 -0
  133. package/skills/pixelcraft-desktop/references/winui-wpf.md +58 -0
  134. package/skills/pixelcraft-desktop/references/working-context.md +5 -0
  135. package/skills/pixelcraft-direction/SKILL.md +154 -0
  136. package/skills/pixelcraft-direction/references/composition-library.md +84 -0
  137. package/skills/pixelcraft-direction/references/direction-card.md +54 -0
  138. package/skills/pixelcraft-direction/references/direction-scoring.md +72 -0
  139. package/skills/pixelcraft-direction/references/movements.md +68 -0
  140. package/skills/pixelcraft-direction/references/repetition-history.md +75 -0
  141. package/skills/pixelcraft-direction/references/slop-fingerprints.md +58 -0
  142. package/skills/pixelcraft-direction/references/wildcards.md +47 -0
  143. package/skills/pixelcraft-document/SKILL.md +54 -0
  144. package/skills/pixelcraft-document/references/archetypes.md +83 -0
  145. package/skills/pixelcraft-document/references/pdf-tools.md +154 -0
  146. package/skills/pixelcraft-document/references/print-css.md +134 -0
  147. package/skills/pixelcraft-document/references/slides.md +102 -0
  148. package/skills/pixelcraft-email/SKILL.md +58 -0
  149. package/skills/pixelcraft-email/references/client-quirks.md +45 -0
  150. package/skills/pixelcraft-email/references/html-tables.md +53 -0
  151. package/skills/pixelcraft-email/references/mjml.md +52 -0
  152. package/skills/pixelcraft-email/references/react-email.md +53 -0
  153. package/skills/pixelcraft-extensions/SKILL.md +51 -0
  154. package/skills/pixelcraft-extensions/references/browser-extensions.md +31 -0
  155. package/skills/pixelcraft-extensions/references/figma-office.md +23 -0
  156. package/skills/pixelcraft-extensions/references/raycast.md +19 -0
  157. package/skills/pixelcraft-extensions/references/vscode-webviews.md +26 -0
  158. package/skills/pixelcraft-game-ui/SKILL.md +61 -0
  159. package/skills/pixelcraft-game-ui/references/bevy.md +52 -0
  160. package/skills/pixelcraft-game-ui/references/godot.md +57 -0
  161. package/skills/pixelcraft-game-ui/references/hud-principles.md +38 -0
  162. package/skills/pixelcraft-game-ui/references/love2d.md +51 -0
  163. package/skills/pixelcraft-game-ui/references/monogame.md +52 -0
  164. package/skills/pixelcraft-game-ui/references/unity-ui-toolkit.md +65 -0
  165. package/skills/pixelcraft-game-ui/references/unreal-umg.md +53 -0
  166. package/skills/pixelcraft-handoff/SKILL.md +49 -0
  167. package/skills/pixelcraft-handoff/references/design-translation.md +104 -0
  168. package/skills/pixelcraft-handoff/references/fidelity-tolerance.md +78 -0
  169. package/skills/pixelcraft-media/SKILL.md +52 -0
  170. package/skills/pixelcraft-media/references/banners-video.md +112 -0
  171. package/skills/pixelcraft-media/references/og-generation.md +107 -0
  172. package/skills/pixelcraft-media/references/social-cards.md +72 -0
  173. package/skills/pixelcraft-mobile/SKILL.md +69 -0
  174. package/skills/pixelcraft-mobile/references/dotnet-maui.md +63 -0
  175. package/skills/pixelcraft-mobile/references/flet.md +53 -0
  176. package/skills/pixelcraft-mobile/references/flutter.md +69 -0
  177. package/skills/pixelcraft-mobile/references/ionic-capacitor.md +65 -0
  178. package/skills/pixelcraft-mobile/references/jetpack-compose.md +61 -0
  179. package/skills/pixelcraft-mobile/references/kivy.md +59 -0
  180. package/skills/pixelcraft-mobile/references/kotlin-multiplatform.md +60 -0
  181. package/skills/pixelcraft-mobile/references/react-native-expo.md +71 -0
  182. package/skills/pixelcraft-mobile/references/swiftui.md +70 -0
  183. package/skills/pixelcraft-mobile/references/task-state-composition.md +5 -0
  184. package/skills/pixelcraft-mobile/references/uikit.md +58 -0
  185. package/skills/pixelcraft-patterns/SKILL.md +58 -0
  186. package/skills/pixelcraft-patterns/references/auth-onboarding.md +25 -0
  187. package/skills/pixelcraft-patterns/references/commerce.md +28 -0
  188. package/skills/pixelcraft-patterns/references/communication.md +26 -0
  189. package/skills/pixelcraft-patterns/references/creative-tools.md +29 -0
  190. package/skills/pixelcraft-patterns/references/dashboard-admin.md +31 -0
  191. package/skills/pixelcraft-patterns/references/marketing.md +32 -0
  192. package/skills/pixelcraft-patterns/references/pattern-selection.md +74 -0
  193. package/skills/pixelcraft-patterns/references/search-filtering.md +42 -0
  194. package/skills/pixelcraft-patterns/references/settings.md +23 -0
  195. package/skills/pixelcraft-patterns/references/tables-crud.md +43 -0
  196. package/skills/pixelcraft-plan/SKILL.md +67 -0
  197. package/skills/pixelcraft-plan/references/design-input.md +69 -0
  198. package/skills/pixelcraft-plan/references/plan-template.md +99 -0
  199. package/skills/pixelcraft-plan/references/repo-discovery.md +42 -0
  200. package/skills/pixelcraft-plan/references/stack-freshness.md +50 -0
  201. package/skills/pixelcraft-plan/references/stack-selection.md +42 -0
  202. package/skills/pixelcraft-review/SKILL.md +64 -0
  203. package/skills/pixelcraft-review/references/audit-report.md +50 -0
  204. package/skills/pixelcraft-review/references/critique-protocol.md +89 -0
  205. package/skills/pixelcraft-review/references/heuristics.md +18 -0
  206. package/skills/pixelcraft-review/references/personas.md +26 -0
  207. package/skills/pixelcraft-review/references/polish.md +38 -0
  208. package/skills/pixelcraft-review/scripts/fixtures/brand-critique-waivers.json +14 -0
  209. package/skills/pixelcraft-review/scripts/fixtures/brand-critique.css +18 -0
  210. package/skills/pixelcraft-review/scripts/fixtures/clean.html +43 -0
  211. package/skills/pixelcraft-review/scripts/fixtures/focus-after-block.css +4 -0
  212. package/skills/pixelcraft-review/scripts/fixtures/focus-at-rules.css +17 -0
  213. package/skills/pixelcraft-review/scripts/fixtures/focus-comments.css +10 -0
  214. package/skills/pixelcraft-review/scripts/fixtures/focus-html-quote-leak.html +12 -0
  215. package/skills/pixelcraft-review/scripts/fixtures/focus-invalid-replacements.css +27 -0
  216. package/skills/pixelcraft-review/scripts/fixtures/focus-nested-rules.css +19 -0
  217. package/skills/pixelcraft-review/scripts/fixtures/focus-not-visible-skip.css +8 -0
  218. package/skills/pixelcraft-review/scripts/fixtures/focus-outline-shorthands.css +11 -0
  219. package/skills/pixelcraft-review/scripts/fixtures/focus-unknown-and-border.css +15 -0
  220. package/skills/pixelcraft-review/scripts/fixtures/focus-unknown-last-wins.css +19 -0
  221. package/skills/pixelcraft-review/scripts/fixtures/focus-valid-replacements-extended.css +29 -0
  222. package/skills/pixelcraft-review/scripts/fixtures/focus-visible-no-replacement.css +3 -0
  223. package/skills/pixelcraft-review/scripts/fixtures/focus-visible-valid-replacements.css +9 -0
  224. package/skills/pixelcraft-review/scripts/fixtures/slop.html +28 -0
  225. package/skills/pixelcraft-review/scripts/slop-scan.mjs +586 -0
  226. package/skills/pixelcraft-spatial/SKILL.md +52 -0
  227. package/skills/pixelcraft-spatial/references/comfort-accessibility.md +98 -0
  228. package/skills/pixelcraft-spatial/references/platforms.md +77 -0
  229. package/skills/pixelcraft-tokens/SKILL.md +56 -0
  230. package/skills/pixelcraft-tokens/assets/tokens.example.json +71 -0
  231. package/skills/pixelcraft-tokens/assets/tokens.modes.example.json +47 -0
  232. package/skills/pixelcraft-tokens/references/adoption.md +55 -0
  233. package/skills/pixelcraft-tokens/references/format.md +54 -0
  234. package/skills/pixelcraft-tokens/references/governance.md +80 -0
  235. package/skills/pixelcraft-tokens/references/state-tokens.md +62 -0
  236. package/skills/pixelcraft-tokens/references/theme-presets.md +94 -0
  237. package/skills/pixelcraft-tokens/scripts/export-tokens.mjs +285 -0
  238. package/skills/pixelcraft-tui/SKILL.md +60 -0
  239. package/skills/pixelcraft-tui/references/bubbletea-lipgloss.md +60 -0
  240. package/skills/pixelcraft-tui/references/ink.md +60 -0
  241. package/skills/pixelcraft-tui/references/ratatui.md +62 -0
  242. package/skills/pixelcraft-tui/references/rich.md +62 -0
  243. package/skills/pixelcraft-tui/references/textual.md +67 -0
  244. package/skills/pixelcraft-ux/SKILL.md +46 -0
  245. package/skills/pixelcraft-ux/references/cognitive-walkthrough.md +70 -0
  246. package/skills/pixelcraft-ux/references/feedback-performance.md +30 -0
  247. package/skills/pixelcraft-ux/references/flows-ia.md +44 -0
  248. package/skills/pixelcraft-ux/references/forms.md +97 -0
  249. package/skills/pixelcraft-ux/references/i18n.md +183 -0
  250. package/skills/pixelcraft-ux/references/laws.md +18 -0
  251. package/skills/pixelcraft-ux/references/locale-test-matrix.md +60 -0
  252. package/skills/pixelcraft-ux/references/state-matrix.md +39 -0
  253. package/skills/pixelcraft-ux/references/usability-testing.md +84 -0
  254. package/skills/pixelcraft-ux/references/ux-writing.md +43 -0
  255. package/skills/pixelcraft-visual-qa/SKILL.md +82 -0
  256. package/skills/pixelcraft-visual-qa/references/baseline-governance.md +70 -0
  257. package/skills/pixelcraft-visual-qa/references/capture-desktop-game.md +38 -0
  258. package/skills/pixelcraft-visual-qa/references/capture-email.md +34 -0
  259. package/skills/pixelcraft-visual-qa/references/capture-mobile.md +35 -0
  260. package/skills/pixelcraft-visual-qa/references/capture-terminal.md +31 -0
  261. package/skills/pixelcraft-visual-qa/references/critique-rubric.md +71 -0
  262. package/skills/pixelcraft-visual-qa/references/finish-gate.md +35 -0
  263. package/skills/pixelcraft-visual-qa/references/measured-craft.md +30 -0
  264. package/skills/pixelcraft-visual-qa/references/performance-budgets.md +65 -0
  265. package/skills/pixelcraft-visual-qa/references/task-verification.md +81 -0
  266. package/skills/pixelcraft-visual-qa/scripts/finish-gate.mjs +135 -0
  267. package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-aria-modal.html +19 -0
  268. package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-audit.html +34 -0
  269. package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-modal.html +17 -0
  270. package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory-deferred.js +1 -0
  271. package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory-edge.html +52 -0
  272. package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory.html +80 -0
  273. package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory.js +8 -0
  274. package/skills/pixelcraft-visual-qa/scripts/shoot.mjs +513 -0
  275. package/skills/pixelcraft-visual-qa/scripts/style-inventory.mjs +1154 -0
  276. package/skills/pixelcraft-web/SKILL.md +76 -0
  277. package/skills/pixelcraft-web/references/adaptive-layout.md +25 -0
  278. package/skills/pixelcraft-web/references/angular.md +61 -0
  279. package/skills/pixelcraft-web/references/astro.md +62 -0
  280. package/skills/pixelcraft-web/references/clojurescript.md +53 -0
  281. package/skills/pixelcraft-web/references/elm.md +53 -0
  282. package/skills/pixelcraft-web/references/fsharp-fable.md +53 -0
  283. package/skills/pixelcraft-web/references/html-css.md +88 -0
  284. package/skills/pixelcraft-web/references/htmx-alpine.md +53 -0
  285. package/skills/pixelcraft-web/references/java-web.md +52 -0
  286. package/skills/pixelcraft-web/references/kotlin-web.md +53 -0
  287. package/skills/pixelcraft-web/references/leptos-yew.md +54 -0
  288. package/skills/pixelcraft-web/references/lit-web-components.md +61 -0
  289. package/skills/pixelcraft-web/references/pwa.md +225 -0
  290. package/skills/pixelcraft-web/references/qwik.md +54 -0
  291. package/skills/pixelcraft-web/references/react-next.md +69 -0
  292. package/skills/pixelcraft-web/references/scala-laminar.md +53 -0
  293. package/skills/pixelcraft-web/references/server-rendered.md +71 -0
  294. package/skills/pixelcraft-web/references/solid.md +60 -0
  295. package/skills/pixelcraft-web/references/svelte.md +61 -0
  296. package/skills/pixelcraft-web/references/tailwind.md +73 -0
  297. package/skills/pixelcraft-web/references/vue-nuxt.md +62 -0
@@ -0,0 +1,53 @@
1
+ # Jupyter widgets / ipywidgets
2
+
3
+ ## Token mapping
4
+
5
+ ipywidgets exposes limited style/layout objects rather than a complete design-token system. Use semantic Python constants and apply them consistently to `Layout`/`style` objects; use notebook/custom CSS only when the environment is controlled. Do not expect broad theming across JupyterLab/classic/VS Code/nbconvert contexts.
6
+
7
+ ## Layout and responsive idioms
8
+
9
+ Compose boxes/grids intentionally but accept host frontend constraints. Notebook cells are document flow, not application windows. Width/height/responsive behavior differs across frontends. Keep controls close to the output they affect and preserve reading order in the notebook narrative.
10
+
11
+ ## Typography/custom fonts
12
+
13
+ Notebook/frontend typography is host-controlled. Do not fight it globally. Use heading hierarchy, concise labels, units, captions, and formatted output. Charts need their own legible typography/color decisions.
14
+
15
+ ## Motion/reduced motion
16
+
17
+ Use progress/trait updates truthfully. Decorative motion is inappropriate in most notebook contexts and host support varies. Long computations need interrupt/cancel guidance because kernel interruption is user-visible behavior.
18
+
19
+ ## Accessibility specifics
20
+
21
+ Notebook frontend accessibility varies and is actively evolving. Use real labels/descriptions, logical output order, text alternatives/data tables for charts, keyboard verification, and no color-only meaning. Custom widgets must implement frontend semantics deliberately; do not assume Python trait names are exposed accessibly.
22
+
23
+ ## States idiom
24
+
25
+ Trait synchronization (`observe`, `link`, `unlink`) and kernel/frontend lifecycle are the state model. Handle kernel restart/disconnect, stale widget state, expensive computation interruption, missing data, empty results, validation errors, and duplicated output. Preserve user-entered state in traits deliberately.
26
+
27
+ ## Forms idiom
28
+
29
+ Use labeled controls, constrained numeric/date/text widgets, validation after meaningful interaction, explicit run/apply buttons for costly work, and input preservation. Do not couple expensive computation directly to every slider movement without throttling/apply semantics.
30
+
31
+ ## Do/don't pairs
32
+
33
+ | Do | Don't |
34
+ |---|---|
35
+ | semantic constants reused across layout/style | raw styling copied per widget |
36
+ | explicit Apply/Run control for expensive analysis | retraining/requerying on every slider tick |
37
+ | narrative headings/help adjacent to controls | disconnected control panel far from output |
38
+ | text/table summary under chart | color-only chart as sole answer |
39
+ | graceful kernel-restart/missing-state behavior | assuming widget state survives every frontend action |
40
+
41
+ ## Known traps
42
+
43
+ Frontend differences (JupyterLab/classic/VS Code/Colab/nbconvert), kernel disconnect/restart, widget state serialization, custom widget extension complexity, limited theming, accessibility variability, hidden mutable kernel state, accidental expensive recompute loops.
44
+
45
+ ## Verification commands
46
+
47
+ ```sh
48
+ python -m pytest
49
+ python -m compileall .
50
+ jupyter lab 2>/dev/null || jupyter notebook 2>/dev/null || true
51
+ ```
52
+
53
+ Verify in every target frontend claimed. Static notebook export is evidence only of static rendering, not interactive widget behavior.
@@ -0,0 +1,63 @@
1
+ # NiceGUI
2
+
3
+ Evidence: current docs confirm `ui.colors(...)`, app-wide `app.colors(...)`, `ui.dark_mode()`, and `ui.add_head_html` for custom CSS/HTML.
4
+
5
+ ## Token mapping
6
+
7
+ Use app/page color configuration first:
8
+
9
+ ```python
10
+ app.colors(primary='#0074ca', brand='#0074ca')
11
+ ui.colors(primary='#0074ca')
12
+ dark = ui.dark_mode() # None means auto
13
+ ```
14
+
15
+ Use Quasar/Tailwind-style classes deliberately and inject scoped CSS with `ui.add_head_html` only when supported configuration is insufficient.
16
+
17
+ ## Layout and responsive idioms
18
+
19
+ NiceGUI is component/server driven. Use rows/columns/cards/expansion/tabs/pages by task flow, but verify actual responsive DOM. Shared/global page state and per-user state must be separated explicitly. Avoid fixed-width desktop dashboard assumptions.
20
+
21
+ ## Typography/custom fonts
22
+
23
+ Use CSS/font assets through documented HTML/head mechanisms. Because output is web DOM, fallback/loading/script coverage remain relevant. Do not hide typography inside ad hoc inline styles everywhere.
24
+
25
+ ## Motion/reduced motion
26
+
27
+ Use CSS/Quasar motion sparingly and honor `prefers-reduced-motion`. Server push/update latency is interaction feedback; use immediate local pending state where possible.
28
+
29
+ ## Accessibility specifics
30
+
31
+ Quasar components provide baseline semantics, but labels/aria/focus/keyboard behavior still need inspection. Dynamic server-side updates need status/error visibility. `ui.add_head_html` can add meta/CSS but cannot repair missing semantic structure by itself.
32
+
33
+ ## States idiom
34
+
35
+ Understand page lifecycle, shared objects, background tasks, timers, and websocket/client state. Explicitly model loading/error/empty/offline/disconnected states. Avoid mutating shared global UI objects across users. Background work needs cancellation/timeout/error propagation.
36
+
37
+ ## Forms idiom
38
+
39
+ Use labeled inputs, validation rules where supported, correct props/types, preservation across server events, and explicit submit behavior. Do not run expensive actions on every keystroke unless intentionally debounced/designed.
40
+
41
+ ## Do/don't pairs
42
+
43
+ | Do | Don't |
44
+ |---|---|
45
+ | `app.colors(primary=...)` or page-level `ui.colors` intentionally | injecting global CSS that fights Quasar unpredictably |
46
+ | `ui.dark_mode()` auto/manual behavior explicit | assuming dark mode exists because browser prefers it |
47
+ | stable classes plus scoped `ui.add_head_html` CSS | brittle generated-selector hacks |
48
+ | per-user page/state ownership | shared mutable globals leaking across sessions |
49
+ | visible reconnect/error state | silent websocket failure while UI appears live |
50
+
51
+ ## Known traps
52
+
53
+ Shared-state leakage, server-client synchronization gaps, dark-mode precedence confusion, custom CSS instability, background task lifecycle, browser disconnect/reconnect state, mobile layout assumptions, injected HTML/security risk.
54
+
55
+ ## Verification commands
56
+
57
+ ```sh
58
+ python main.py
59
+ python -m pytest
60
+ python -m compileall .
61
+ ```
62
+
63
+ Rendered evidence requires actual browser inspection including resize, dark mode, keyboard, disconnect/reconnect, and multi-client behavior where relevant.
@@ -0,0 +1,67 @@
1
+ # Observable Framework
2
+
3
+ ## Token mapping
4
+
5
+ Keep generated DTCG values in version-controlled static assets/modules and map them once into CSS custom properties, shared JavaScript style objects, and chart scales. `observablehq.config.js`/`.ts` can define project-level structure such as `title` and `pages`; inspect the installed version before depending on newer theme/config keys. Prefer a project stylesheet and semantic custom properties over repeating hex values in Markdown/JS blocks:
6
+
7
+ ```css
8
+ :root {
9
+ --pc-action: oklch(55% 0.15 250);
10
+ --pc-surface-raised: oklch(98% 0.01 250);
11
+ }
12
+ ```
13
+
14
+ ## Layout and responsive idioms
15
+
16
+ Framework pages are Markdown/HTML documents with executable JavaScript blocks. Use normal document flow first, then CSS grid/flex containers for dense dashboards. Design cards/panels from the data-reading task rather than copying a generic SaaS grid. Test narrow embeds, wide monitors, print/export where relevant, and sidebar/table-of-contents behavior configured for the project.
17
+
18
+ ## Typography/custom fonts
19
+
20
+ Load fonts deliberately through static assets/stylesheet with fallback metrics and licensing checked. Data labels often need tabular numerals; long SQL/category labels need wrapping/truncation rules. Do not let chart type become the only readable text on the page.
21
+
22
+ ## Motion/reduced motion
23
+
24
+ Observable Framework output is browser UI, so CSS/JS motion must honor `prefers-reduced-motion`. Keep transitions purposeful and do not animate every chart update:
25
+
26
+ ```css
27
+ @media (prefers-reduced-motion: reduce) {
28
+ *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
29
+ }
30
+ ```
31
+
32
+ ## Accessibility specifics
33
+
34
+ Use real headings, labels, buttons, links, tables, and form controls in Markdown/HTML. Treat canvas/SVG charts as inaccessible until given text summaries, table alternatives, keyboard/focus behavior where interactive, and non-color encoding. Verify Plot/custom SVG aria behavior rather than assuming it.
35
+
36
+ ## States idiom
37
+
38
+ Data loaders create static snapshots at build time; surface freshness, build failure, empty result sets, runtime fetch failure, permissions, and stale-cache state explicitly. `FileAttachment("name.json")` must use a static literal path and is only a handle until `.json()`, `.csv()`, or another contents method is invoked. Runtime `fetch`/WebSocket behavior needs loading/offline/error states separate from build-time loader behavior.
39
+
40
+ ## Forms idiom
41
+
42
+ Use labeled native inputs/selects and preserve user selections across navigation where expected. Validate numeric/date/query parameters before use, show active filters in text, and never let malformed input become unsafe SQL or a misleading chart.
43
+
44
+ ## Do/don't pairs
45
+
46
+ | Do | Don't |
47
+ |---|---|
48
+ | `FileAttachment("quakes.json").json()` | dynamically constructing a `FileAttachment` path that static analysis cannot resolve |
49
+ | polyglot data loaders for reproducible snapshots | giving every browser direct warehouse credentials |
50
+ | visible data timestamp/build provenance | silently stale dashboard numbers |
51
+ | text summary plus accessible table | a color-only canvas chart as the sole evidence |
52
+ | semantic CSS custom properties | hex literals scattered through Markdown JS blocks |
53
+
54
+ ## Known traps
55
+
56
+ Static snapshot freshness, accidentally exposing secrets to client code, unstable custom selectors, oversized serialized data, chart accessibility gaps, notebook-vs-app mental model confusion, runtime/build data divergence, Markdown pages that look correct while loader output is empty.
57
+
58
+ ## Verification commands
59
+
60
+ ```sh
61
+ cat observablehq.config.js 2>/dev/null || cat observablehq.config.ts
62
+ cat package.json
63
+ npm run build
64
+ npm run dev
65
+ ```
66
+
67
+ Exact scripts vary by template; inspect `package.json`. Browser inspection of the built/preview page is rendered evidence; a successful build is only static evidence.
@@ -0,0 +1,53 @@
1
+ # Panel / HoloViz
2
+
3
+ ## Token mapping
4
+
5
+ Use Panel theme/config/template mechanisms before custom CSS. Depending project version, configure theme on template/extension and inject scoped stylesheets through documented extension/assets mechanisms. Keep Plotly/HoloViews/Bokeh figure themes synchronized with page semantic tokens; figure defaults are a common mismatch.
6
+
7
+ ## Layout and responsive idioms
8
+
9
+ Use `Row`, `Column`, `GridSpec`/template layouts and sizing modes intentionally (`stretch_width`, fixed, responsive). Panel dashboards often fail because resize behavior was never specified. Sidebar/main/template structure should reflect task hierarchy rather than exposing every control at once.
10
+
11
+ ## Typography/custom fonts
12
+
13
+ Use template/global CSS/font configuration deliberately. Visualization libraries may require separate font settings; test rendering/export contexts. Keep dense scientific labels legible and localized units/formats explicit.
14
+
15
+ ## Motion/reduced motion
16
+
17
+ Panel interaction is callback/server driven. Use loading spinners/indicators and busy state truthfully; decorative motion is secondary. Any custom CSS/JS animation must honor reduced motion.
18
+
19
+ ## Accessibility specifics
20
+
21
+ Use labels/names/help text, keyboard-operable widgets, semantic ordering, chart alternatives/summaries, and visible focus. DOM output is web-backed but accessibility varies across widget/type; inspect actual output rather than assuming Bokeh/Panel abstractions guarantee semantics.
22
+
23
+ ## States idiom
24
+
25
+ Understand parameter/`param` dependencies, reactive functions, session state, caching, and async tasks. Render empty data, missing file/model, backend exception, stale cache, busy state, offline/disconnect state, and permission failure explicitly. Avoid hidden global mutable state across sessions.
26
+
27
+ ## Forms idiom
28
+
29
+ Use widgets with names/labels/help, validation bounds/types, explicit apply/submit controls for expensive computation, and input preservation. Parameterized forms should not recompute expensively on every tiny adjustment unless designed.
30
+
31
+ ## Do/don't pairs
32
+
33
+ | Do | Don't |
34
+ |---|---|
35
+ | deliberate sizing mode per pane | fixed notebook-sized layout pasted into production dashboard |
36
+ | explicit busy/error state around expensive callbacks | silent spinner or stale plot after backend failure |
37
+ | semantic page CSS plus synchronized figure theme | default white plot floating inside custom dark UI |
38
+ | apply button for costly parameter sweeps | recompute on every slider tick unintentionally |
39
+ | per-session state ownership | global mutable cache leaking user-specific data |
40
+
41
+ ## Known traps
42
+
43
+ Resize/sizing behavior, template/version differences, disconnected sessions, callback ordering, hidden global state, plot theme mismatch, expensive recompute loops, notebook-vs-server behavior divergence, dense expert UI becoming inaccessible through clutter.
44
+
45
+ ## Verification commands
46
+
47
+ ```sh
48
+ panel serve app.py
49
+ python -m pytest
50
+ python -m compileall .
51
+ ```
52
+
53
+ Rendered evidence requires browser inspection at multiple widths/session states; notebook rendering alone is insufficient.
@@ -0,0 +1,54 @@
1
+ # R Shiny (adjacent data-app ecosystem)
2
+
3
+ This is not Python, but Shiny belongs in the same rapid data-app decision space. Do not force Python idioms onto reactive R code.
4
+
5
+ ## Token mapping
6
+
7
+ Use `bslib::bs_theme()` arguments (`bg`, `fg`, `primary`, `base_font`, `heading_font`) and Bootswatch only as a deliberate base. Add scoped custom CSS variables/rules for semantic roles; use `thematic` so plots inherit app colors/fonts where appropriate.
8
+
9
+ ## Layout and responsive idioms
10
+
11
+ Use `page_sidebar`, `page_navbar`, cards/layout columns and Bootstrap responsivity rather than absolute positioning. Sidebar is for controls, navigation for tasks—do not overload both. Validate narrow/embedded windows.
12
+
13
+ ## Typography/custom fonts
14
+
15
+ Configure `base_font`/`heading_font` or webfont helpers deliberately. Verify numeric legibility, fallback, localization, plot font matching, scaling.
16
+
17
+ ## Motion/reduced motion
18
+
19
+ Browser CSS controls most motion. Keep progress/spinner behavior truthful and honor `prefers-reduced-motion` in custom CSS. Reactive invalidation must not masquerade as progress.
20
+
21
+ ## Accessibility specifics
22
+
23
+ Use headings/landmarks/labels, alt text or text summaries for plots, non-color encodings, keyboard-reachable controls, accessible tables, focus management after dynamic UI. Shiny/Bootstrap maturity does not make arbitrary output accessible.
24
+
25
+ ## States idiom
26
+
27
+ Reactive dependencies need explicit empty/no-data/error/loading/permission/stale states. Use req/validate/showNotification/progress deliberately; distinguish no rows from query failure. Expensive work needs caching, invalidation, cancellation expectations, and multi-user isolation.
28
+
29
+ ## Forms idiom
30
+
31
+ Inputs require labels/help/format validation and preserve values across reactivity. Validate timing using dedicated validation patterns/packages or explicit server logic; never clear inputs because another reactive invalidates. Uploaded files need type/size/security feedback.
32
+
33
+ ## Do/don't pairs
34
+
35
+ | Do | Don't |
36
+ |---|---|
37
+ | `bs_theme(primary = "#005f73", base_font = …)` | random CSS overriding autogenerated internals |
38
+ | explicit `validate()` empty/error message | blank plot/table interpreted as zero data |
39
+ | non-color plot encoding | color-only categorical meaning |
40
+ | labeled upload/control input | relying on placeholder-like hints |
41
+
42
+ ## Known traps
43
+
44
+ Reactive loops/invalidation storms, hidden cross-session leakage, long computation blocking worker process, plot/UI theme mismatch, unstable custom CSS, unstable deployment memory/timeouts, treating prototype security as production-ready.
45
+
46
+ ## Verification commands
47
+
48
+ ```sh
49
+ Rscript -e 'shiny::runApp()'
50
+ Rscript -e 'testthat::test_dir("tests")'
51
+ Rscript -e 'shinytest2::test_app()' 2>/dev/null || true
52
+ ```
53
+
54
+ Inspect real browser rendering, keyboard/focus, empty/error/large data, concurrent users, upload failure, timeout/memory behavior, responsive zoom/localization.
@@ -0,0 +1,62 @@
1
+ # Reflex
2
+
3
+ Evidence: current docs confirm `rx.App(theme=rx.theme(appearance="light", has_background=True, radius="large", accent_color="teal"))` and Radix Themes-based props.
4
+
5
+ ## Token mapping
6
+
7
+ Use `rx.theme` for global appearance/accent/radius and semantic style props/classes for local composition:
8
+
9
+ ```python
10
+ app = rx.App(theme=rx.theme(appearance="light", radius="medium", accent_color="blue"))
11
+ ```
12
+
13
+ Map DTCG semantic decisions into theme props plus a constrained style constants module. Do not scatter raw style dictionaries through every component.
14
+
15
+ ## Layout and responsive idioms
16
+
17
+ Reflex compiles to web UI; use responsive layout components/props and CSS-like semantics rather than desktop-only fixed widths. State-driven conditional rendering should preserve layout stability. Treat backend event latency as part of interaction design.
18
+
19
+ ## Typography/custom fonts
20
+
21
+ Use theme/head asset configuration deliberately. Font loading is web behavior even though authoring is Python; fallbacks/subsets/script coverage still matter.
22
+
23
+ ## Motion/reduced motion
24
+
25
+ Use web-level motion sparingly and honor `prefers-reduced-motion` in CSS/custom components. Backend roundtrips are not animation; immediate client feedback may be needed for responsive interaction.
26
+
27
+ ## Accessibility specifics
28
+
29
+ Reflex/Radix components provide useful primitives but still require names/labels/focus behavior. Dynamic server-driven updates need loading/error/status semantics and keyboard verification. Do not hide state behind color-only conditional styles.
30
+
31
+ ## States idiom
32
+
33
+ Reflex state classes/vars define interaction truth. Explicitly model loading/error/empty/permission/offline/optimistic states. Understand backend state scope per user/session; never leak mutable global state. Event handlers need validation, error return paths, and duplicate-submit protection.
34
+
35
+ ## Forms idiom
36
+
37
+ Use form controls with labels/name/value binding and validation timing appropriate to backend events. Preserve input in state after failed validation. Correct input types/autocomplete behavior ultimately depend on generated DOM—inspect it.
38
+
39
+ ## Do/don't pairs
40
+
41
+ | Do | Don't |
42
+ |---|---|
43
+ | central typed state vars for form draft | hidden mutable module-global data shared across users |
44
+ | explicit pending bool during backend mutation | allowing repeated double-submit while waiting |
45
+ | theme-level semantic appearance | arbitrary inline style dictionaries repeated everywhere |
46
+ | validation error text adjacent to field | toast-only backend failure |
47
+ | inspect generated DOM/a11y behavior | assuming Python component abstraction guarantees browser semantics |
48
+
49
+ ## Known traps
50
+
51
+ Backend roundtrip latency, state serialization limits, accidental shared mutable state, websocket/offline behavior, compile/runtime version mismatch, style prop sprawl, browser-only assumptions hidden in Python, generated DOM differing from expectation.
52
+
53
+ ## Verification commands
54
+
55
+ ```sh
56
+ reflex run
57
+ reflex export 2>/dev/null || true
58
+ python -m pytest
59
+ python -m compileall .
60
+ ```
61
+
62
+ Inspect actual browser rendering/network behavior for visual/interaction evidence; Python compile success proves almost nothing about UX.
@@ -0,0 +1,53 @@
1
+ # Shiny for Python
2
+
3
+ ## Token mapping
4
+
5
+ Use the project's supported theme/bootstrap mechanism plus external CSS assets. Exact theme APIs vary by Shiny for Python version and UI layout choice; verify local dependency docs before relying on a named constructor. Keep semantic CSS variables in assets and map plots separately because plotting libraries have independent themes.
6
+
7
+ ## Layout and responsive idioms
8
+
9
+ Use Shiny UI layout functions (`page_*`, layout columns/sidebar/nav panels/cards depending version) to express information architecture. Reactive outputs should occupy stable reserved space where possible. Do not depend on fixed browser width or hidden overflow for dense dashboards.
10
+
11
+ ## Typography/custom fonts
12
+
13
+ Use external CSS/font assets with explicit fallback/loading policy. Configure plotting typography separately. Ensure numeric/date/locale formatting happens through explicit formatting rather than raw string concatenation.
14
+
15
+ ## Motion/reduced motion
16
+
17
+ Reactive invalidation/progress feedback is more important than decorative animation. Use progress indicators honestly for long operations. Custom CSS/JS animation must honor reduced motion.
18
+
19
+ ## Accessibility specifics
20
+
21
+ Use semantic headings/labels/input bindings, visible focus, accessible error/status text, chart summaries/tables, and keyboard verification. Shiny generates web UI, but abstraction does not guarantee accessible custom layout or plot meaning.
22
+
23
+ ## States idiom
24
+
25
+ Understand reactive graph invalidation. Separate inputs, reactive calculations, outputs, side effects, and session/user state. Render loading/recalculating/empty/error/stale/offline states explicitly. Long jobs need progress/error/cancellation expectations and input preservation.
26
+
27
+ ## Forms idiom
28
+
29
+ Use correct input controls/types/bounds/labels/help, validation timing after meaningful input, explicit submit/apply for expensive workflows, and recovery copy. Do not trigger costly reactive chains on every keystroke unless debounced/intentional.
30
+
31
+ ## Do/don't pairs
32
+
33
+ | Do | Don't |
34
+ |---|---|
35
+ | explicit reactive dependency graph | hidden chain reactions nobody can debug |
36
+ | `req()`/validation paths with user-visible explanation | output silently disappearing when inputs are invalid |
37
+ | stable placeholder layout while recalculating | whole dashboard collapsing/flashing on each input |
38
+ | user/session-scoped state | mutable module-global state leaking across users |
39
+ | plot plus text/table alternative | color-only chart treated as complete analysis |
40
+
41
+ ## Known traps
42
+
43
+ Reactive graph over-invalidation, stale session state, hidden server errors, version-dependent theme APIs, plot/page theme mismatch, input focus loss during redraw, expensive recomputation, concurrency/multi-user leakage.
44
+
45
+ ## Verification commands
46
+
47
+ ```sh
48
+ shiny run app.py
49
+ python -m pytest
50
+ python -m compileall .
51
+ ```
52
+
53
+ Use browser inspection across widths/input sequences and inspect reactive errors/logs; compile success is not UI evidence.
@@ -0,0 +1,65 @@
1
+ # Streamlit
2
+
3
+ Evidence: current docs confirm `[theme]` keys including `primaryColor`, `backgroundColor`, `secondaryBackgroundColor`, `textColor`, `linkColor`, chart color arrays, `fontFaces`, `baseFontSize`, and light/dark/sidebar sections.
4
+
5
+ ## Token mapping
6
+
7
+ Use `.streamlit/config.toml` first:
8
+
9
+ ```toml
10
+ [theme]
11
+ base = "light"
12
+ primaryColor = "#0074ca"
13
+ backgroundColor = "#faf8f1"
14
+ textColor = "#161b24"
15
+ ```
16
+
17
+ Map semantic tokens deliberately; primary color alone is not a design system. Use supported sidebar/light/dark tables and stable custom CSS only for gaps the config cannot express.
18
+
19
+ ## Layout and responsive idioms
20
+
21
+ Use `st.columns`, containers, sidebar, tabs/expander/dialog/form intentionally. Streamlit layout is document-flow centric, not arbitrary CSS positioning. Avoid wide fixed grids and nested columns that collapse badly. Use `use_container_width` only where content benefits.
22
+
23
+ ## Typography/custom fonts
24
+
25
+ `fontFaces`/base font settings are supported within documented constraints; complex type control is limited. Do not load heavyweight custom CSS/fonts just to imitate a web product if hierarchy/copy/layout can carry the direction.
26
+
27
+ ## Motion/reduced motion
28
+
29
+ Streamlit provides little direct animation control. Use progress/spinner/status semantics honestly and avoid custom animated CSS that ignores reduced-motion. Long computation belongs in explicit status/progress patterns.
30
+
31
+ ## Accessibility specifics
32
+
33
+ Use labels/help text, semantic ordering, meaningful chart titles/alt/summary, keyboard-focusable native widgets, and concise status announcements where supported. Custom HTML/components must preserve DOM semantics. Streamlit accessibility constraints are framework-dependent—verify rather than assuming full control.
34
+
35
+ ## States idiom
36
+
37
+ Every input change can rerun script execution. Initialize `st.session_state` explicitly, use stable keys, cache expensive data with correct scope/invalidation, and isolate mutation. Use `st.form` to batch inputs when intermediate reruns are wrong. Render empty data, exceptions, permission/upload failure, missing secrets, stale cache, and long-running progress explicitly.
38
+
39
+ ## Forms idiom
40
+
41
+ `st.form` batches widget state until submit. Use labels/help/placeholders correctly (labels are not optional), input validation after submit, preserve invalid values through session state/defaults, and never silently discard uploads.
42
+
43
+ ## Do/don't pairs
44
+
45
+ | Do | Don't |
46
+ |---|---|
47
+ | `with st.form("batch"): ... st.form_submit_button("Review batch")` | rerunning expensive inference on every keystroke |
48
+ | explicit `st.session_state.setdefault("draft", "")` | relying on widget key side effects you never inspected |
49
+ | cache data with clear invalidation | per-user mutable data hidden in global cache |
50
+ | theme config plus restrained scoped CSS | selectors targeting unstable autogenerated DOM classes |
51
+ | `st.empty()/st.status` used for meaningful lifecycle | fake progress or spinner-only long tasks |
52
+
53
+ ## Known traps
54
+
55
+ Script reruns, duplicate widget IDs/keys, stale cache, secrets leakage, session concurrency, unstable DOM selectors, sidebar overload, wide-mode false assumptions, uploaded file lifecycle, heavy objects reconstructed per rerun.
56
+
57
+ ## Verification commands
58
+
59
+ ```sh
60
+ streamlit run app.py
61
+ python -m pytest
62
+ python -m compileall .
63
+ ```
64
+
65
+ Browser inspection can validate DOM/visual behavior only when the app is actually run. Playwright/browser tests are rendered evidence; Python unit tests are state/static evidence.
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: pixelcraft-dataviz
3
+ description: Designs and verifies truthful, legible, accessible data visualization across any frontend stack. Use for charts, plots, dashboards, metrics, analytics, scientific visualization, tables as visualization, real-time/streaming data, node/link diagrams, maps/geospatial UI, SVG/canvas/WebGL/3D rendering choices, chart accessibility, and library-specific implementation in D3, Observable Plot, Vega-Lite, ECharts, Recharts/visx, Plotly, matplotlib/Altair, ggplot2, Makie, Swift Charts, or Compose/Vico.
4
+ license: MIT
5
+ metadata:
6
+ version: 0.1.0
7
+ ---
8
+
9
+ # Pixelcraft dataviz
10
+
11
+ Data visualization is evidence communication, not dashboard decoration. Start with the analytical question and the decision it informs; choose the simplest encoding that preserves magnitude, uncertainty, freshness, and missingness. A technically impressive chart that misreads the data is a failed chart.
12
+
13
+ ## Surface craft
14
+
15
+ Start with the judgment the reader must make and expose its comparison baseline, units, uncertainty and missing values. Use annotations and ordered or small-multiple views when they remove comparison work. Verify the meaning survives monochrome, resizing and keyboard access; provide a data or text alternative for canvas or hover-only details.
16
+
17
+ ## References
18
+
19
+ - Read [references/chart-choice.md](references/chart-choice.md) when choosing among comparison, distribution, composition, relationship, time, flow, hierarchy, and geographic representations.
20
+ - Read [references/encoding-tables-dashboards.md](references/encoding-tables-dashboards.md) for encoding hierarchy, axes, units, direct labeling, annotations, tables as visualization, and dashboard layout/density.
21
+ - Read [references/color-accessibility.md](references/color-accessibility.md) for colorblind-safe palettes, redundant encodings, contrast, text alternatives, keyboard interaction, sonification boundaries, and reduced motion.
22
+ - Read [references/realtime-graphs-maps-scale.md](references/realtime-graphs-maps-scale.md) for streaming updates, node graphs, maps, SVG/canvas/WebGL/3D scale decisions, and performance verification.
23
+ - Read [references/libraries.md](references/libraries.md) when implementing in a specific charting library or language ecosystem.
24
+
25
+ ## Required workflow
26
+
27
+ 1. **Question first.** Write the exact question in words: compare what, over what period, filtered how, measured in which unit, and what decision follows. Reject chart requests that have no readable question.
28
+ 2. **Audit the data.** Inspect cardinality, type, units, timezone/calendar, nulls, zeros versus missing values, outliers, sampling rate, update latency, duplicate keys, precision, and whether values are counts/rates/estimates/cumulative totals.
29
+ 3. **Choose the representation.** Use the chart-choice table; prefer small multiples or tables over overplotted multi-series charts. Do not let library defaults choose the chart.
30
+ 4. **Encode explicitly.** Map columns to position/length/color/shape/facet intentionally. State what is quantitative, categorical, temporal, spatial, uncertainty, and metadata.
31
+ 5. **Label for reading.** Prefer direct labels and concise annotations; show units, source scope, freshness, and baseline. Legends are fallback navigation, not the primary reading path.
32
+ 6. **Implement idiomatically.** Use the platform/library reference without forcing browser assumptions into native, document, terminal, or notebook surfaces.
33
+ 7. **Verify with real cardinality.** Test empty/one/few/many series, extreme values, long labels, null gaps, negative values, locale formatting, dark/high-contrast themes, keyboard/screen-reader path, resize/reflow, and update bursts.
34
+
35
+ ## Non-negotiable rules
36
+
37
+ | Concern | Rule |
38
+ |---|---|
39
+ | truthfulness | Never fabricate data, smooth away meaningful variation, truncate axes to exaggerate, or hide missing/uncertain values. |
40
+ | baseline | Bar/area magnitude charts include zero unless there is an explicit indexed/change baseline; line charts may use nonzero scales only when labeled. |
41
+ | color | Color never carries meaning alone; use direct labels, shape, line style, pattern, position, or text as a redundant channel. |
42
+ | interaction | Hover/tooltips are enhancement. Keyboard, touch, screen-reader, and print/static export must retain the substance. |
43
+ | density | Match density to decision frequency. Do not turn every metric into an equal card or every dataset into a chart. |
44
+ | motion | Animated transitions must explain object constancy or state change; provide reduced-motion/static behavior. |
45
+ | performance | Choose rendering technology after measuring element count, update rate, and interaction—not because WebGL sounds advanced. |
46
+ | accessibility | Every chart has a text equivalent: summary plus underlying data table/list or structured access appropriate to its complexity. |
47
+
48
+ ## Anti-slop warnings
49
+
50
+ Avoid the default analytics collage: four KPI cards with invented deltas, a gradient area chart, a donut with unreadable slices, a purple-blue palette, unexplained “live” badges, generic axis ticks, and a legend that forces constant eye travel. Avoid chartjunk copied from demos: heavy gridlines, shadows, glassmorphism, 3D perspective, meaningless animated counters, and decorative map pin clouds. Distinctiveness belongs in editorial judgment, annotation quality, composition, and domain-specific emphasis—not in distorting evidence.
51
+
52
+ ## Pre-submit checklist
53
+
54
+ - [ ] analytical question, unit, population, filter, timezone, freshness, and decision are explicit;
55
+ - [ ] chart type matches the question rather than library convenience;
56
+ - [ ] axis baseline/scale/transformation and missing-data treatment are defensible;
57
+ - [ ] direct labels or annotation carry the primary reading path;
58
+ - [ ] palette is colorblind-safe and meaning is redundantly encoded;
59
+ - [ ] empty/one/many/extreme/null/long-label/locale states are designed;
60
+ - [ ] text alternative and keyboard/screen-reader path exist;
61
+ - [ ] update/rendering performance was measured or explicitly labeled `not-checked`;
62
+ - [ ] static export/print/responsive behavior preserves legibility;
63
+ - [ ] final claims separate rendered evidence from static inspection/model judgment.
@@ -0,0 +1,55 @@
1
+ # Choosing a chart by analytical question
2
+
3
+ Choose the question before the geometry. Several correct charts can answer one question; choose the one with the least decoding work for the intended audience and data shape.
4
+
5
+ ## Core choice table
6
+
7
+ | Analytical question | First candidates | Use when | Avoid / correct common misuse |
8
+ |---|---|---|---|
9
+ | Compare categories | horizontal/vertical bar, dot plot, lollipop, grouped bar | discrete categories or ranked values; horizontal bars for long labels | Don't use a line for unordered categories; don't sort alphabetically when magnitude/rank matters. |
10
+ | Change over time | line, slope, step line, column, small-multiple lines | continuous time or ordered periods; line for trend, columns for discrete period totals | Don't connect missing observations across gaps silently; don't use dual y-axes merely to fit two scales. |
11
+ | Distribution | histogram, density strip, box plot, violin, empirical cumulative distribution | spread, skew, outliers, quantiles matter | Don't average away distribution; don't use bins that hide multimodality—test several bin widths. |
12
+ | Composition of a total | stacked bar, 100% stacked bar, treemap, pie only for 2–5 familiar parts | part-to-whole at one or a few times | Don't use many-slice pies/donuts; angles/areas are weak for comparison. Use ranked bars for exact comparison. |
13
+ | Relationship/correlation | scatterplot, bubble only for a third quantitative variable, hexbin/2D density for overplotting | two numeric variables per observation | Don't imply causation; don't use bubbles when area differences are not meaningful. |
14
+ | Flow between stages/entities | funnel for ordered conversion stages; Sankey for conserved flow; waterfall for additive change | quantities move through stages or split/recombine | Don't force cyclic/non-conserved networks into funnels; label leakage/dropoff honestly. |
15
+ | Geographic pattern | point/symbol map, choropleth for normalized regional rates, cartogram, hex/tile grid map | location itself is the comparison key | Don't choropleth raw counts where population drives values; don't use color-filled regions for sparse point events. |
16
+ | Hierarchy/partition | tree, icicle, sunburst, treemap | structure and containment matter more than exact comparison | Don't use deep circular layouts when labels cannot fit; provide breadcrumb/table fallback. |
17
+ | Rank/order | ordered bar, dot plot, slope chart | position/rank or change in rank matters | Don't hide ties or unstable confidence intervals. |
18
+ | Uncertainty/estimate | point + interval, fan chart, error bars, quantile bands | confidence/credible/prediction interval matters | Never present forecast/estimate as observed fact; label interval definition. |
19
+
20
+ ## Match geometry to data type
21
+
22
+ - **Nominal categories:** position on a shared baseline is strongest. Sort intentionally: magnitude, semantic order, or alphabetically only for lookup.
23
+ - **Ordinal categories:** preserve intrinsic order before magnitude sorting.
24
+ - **Time:** check missing intervals, irregular sampling, timezone boundaries, daylight-saving transitions, fiscal versus calendar periods, and whether trailing periods are complete.
25
+ - **Quantitative values:** distinguish absolute values, rates, ratios, percentages, cumulative quantities, indexes, and uncertainty. Their axis labels must not be interchangeable.
26
+ - **Multiple series:** more than roughly 4–6 visually overlapping lines usually needs small multiples, filtering, aggregation, direct highlighting, or an interactive focus+context design. Measure actual legibility rather than obeying the number blindly.
27
+ - **High cardinality:** rank/aggregate the tail only when the remaining group is honestly labeled (“other”, “47 remaining suppliers”), and preserve expansion/drill-down.
28
+
29
+ ## Composition traps
30
+
31
+ - Pie/donut charts are acceptable only when the number of parts is small, the whole is meaningful, and exact comparison is not required. Direct-label values and percentages; never rely on a detached legend.
32
+ - Stacked bars compare the first segment and total well, but middle segments poorly. Use small multiples or grouped bars when every segment matters.
33
+ - Treemap area is weak for precise comparison; use it for overview + drill-down, not exact ranking.
34
+ - Waterfall charts require unambiguous positive/negative color semantics and connector labels; do not use red/green as the only sign encoding.
35
+
36
+ ## Time and comparison traps
37
+
38
+ - Dual-axis plots often manufacture correlation. Prefer indexed values, panels, ratio/difference plots, or a clear annotation of why shared scale is impossible.
39
+ - Smoothed lines must identify the smoothing window/method. Keep raw observations available when noise is meaningful.
40
+ - Slope charts work for two time points/conditions and few entities. They are not a substitute for a full time series.
41
+ - Area charts emphasize magnitude and accumulation; overlapping translucent areas become unreadable quickly. Stack only when the sum itself means something.
42
+
43
+ ## Small multiples and tables
44
+
45
+ Use small multiples when group comparison matters more than cross-group overlay. Keep shared scales when magnitude comparison matters; use independent scales only for shape comparison and label that choice prominently.
46
+
47
+ Use a table when the user needs exact lookup, sorting, copying, row-level action, or comparison of a handful of values. “Chart or table?” is not a taste decision; it follows the task.
48
+
49
+ ## Anti-slop checks
50
+
51
+ - A dashboard demo dataset (`sales`, `users`, `revenue`) is not evidence that the chart fits the user's domain.
52
+ - Gradients, glow, rounded bars, and dark-mode neon do not compensate for missing labels or meaningless metrics.
53
+ - Do not include a donut merely because the layout has an empty corner.
54
+ - Do not animate every number counting up unless the count-up explains temporal accumulation.
55
+ - Do not normalize away absolute magnitude without saying so.