@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
@@ -0,0 +1,132 @@
1
+ # 3D scene architecture
2
+
3
+ ## Renderer and engine decision
4
+
5
+ - **Three.js**: direct control of scene, renderer, camera, asset loading, and disposal across any web stack.
6
+ - **React Three Fiber (R3F v9)**: declarative React composition over Three.js (read [r3f-integration.md](r3f-integration.md)). Use `@react-three/drei` selectively for helpers/controls/loaders—never pull the whole barrel blindly.
7
+ - **Alternative browser 3D engines**: for zero-code product GLB/AR previews (`<model-viewer>`), Babylon.js, PlayCanvas, Svelte **Threlte v8**, Vue **TresJS v5**, **luma.gl v9**, or `regl`, read [web-3d-engines.md](web-3d-engines.md). For designer-authored hosted scenes, Spline is an option when payload and accessibility trade-offs are explicitly accepted.
8
+ - **Embodied XR / headset UX**: for WebXR/visionOS/Quest comfort, depth ergonomics, and spatial interaction, use `pixelcraft-spatial`.
9
+
10
+ ## Three.js `WebGPURenderer` (`three/webgpu`) + TSL (`three/tsl`)
11
+
12
+ Modern Three.js ships **`WebGPURenderer`** from `'three/webgpu'` (which runs on WebGPU when supported and **automatically falls back to a WebGL 2 backend** when WebGPU is unavailable) alongside **TSL (`'three/tsl'` — Three.js Shading Language)**, a composable JavaScript node-material graph that compiles to both WGSL and GLSL without duplicating shader files:
13
+
14
+ ```ts
15
+ import * as THREE from 'three/webgpu';
16
+ import { color, mix, positionLocal, time, uniform } from 'three/tsl';
17
+
18
+ const renderer = new THREE.WebGPURenderer({ antialias: true, powerPreference: 'high-performance' });
19
+ renderer.setPixelRatio(Math.min(window.devicePixelRatio || 1, 2));
20
+ renderer.setSize(container.clientWidth, container.clientHeight);
21
+ renderer.toneMapping = THREE.ACESFilmicToneMapping;
22
+ await renderer.init(); // Required async init before first render
23
+ container.appendChild(renderer.domElement);
24
+
25
+ // Node material compiles to WGSL on WebGPU and GLSL on WebGL2 fallback
26
+ const uMotion = uniform(window.matchMedia('(prefers-reduced-motion: reduce)').matches ? 0 : 1);
27
+ const mat = new THREE.MeshStandardNodeMaterial();
28
+ mat.colorNode = mix(
29
+ color(0x1f2937),
30
+ color(0x38bdf8),
31
+ positionLocal.y.add(time.mul(0.4).mul(uMotion)).sin().mul(0.5).add(0.5),
32
+ );
33
+ ```
34
+
35
+ Always call `renderer.setAnimationLoop(null)`, dispose geometries/materials/textures, and call `renderer.dispose()` on unmount.
36
+
37
+ ## Scene contract
38
+
39
+ Record before building:
40
+ - world units and object scale (standardize 1 unit = 1 meter for PBR lighting and physics);
41
+ - coordinate orientation and origin;
42
+ - camera type, FOV/frustum, near/far planes, and reset behavior;
43
+ - user controls, damping, polar/zoom limits, and keyboard/DOM reset mapping;
44
+ - lighting/environment (`PMREMGenerator` / HDRI envMap) and linear-to-sRGB tone mapping (`ACESFilmicToneMapping` or `AgXToneMapping`);
45
+ - asset loading, missing asset, WebGL/WebGPU context loss, resize, and reduced-motion behavior.
46
+
47
+ Keep high-value text, pricing, forms, and primary controls in the DOM. Treat the canvas as a visual/manipulation surface, not a replacement for product semantics.
48
+
49
+ ## Composition
50
+
51
+ - Establish silhouette and camera framing before adding detail.
52
+ - Use one main light strategy plus an environment map; avoid stacking multiple real-time shadow-casting lights without profiling.
53
+ - Keep postprocessing selective: a single restrained pass can be meaningful; multiple full-screen passes multiply fill-rate and VRAM cost.
54
+ - Make object manipulation bounded, resettable, and understandable. Avoid involuntary idle camera spin.
55
+
56
+ ## Choreography & designer-authored WebGL scenes
57
+
58
+ ### Theatre.js (keyframe & sequence choreography)
59
+
60
+ Use **Theatre.js** (`@theatre/core`, `@theatre/studio`, `@theatre/r3f`) when camera rails, lighting transitions, or DOM + Three.js/R3F properties require timeline curves authored visually instead of brittle nested `setTimeout` or hand-tuned easing arrays:
61
+
62
+ - **Strip Studio from production builds**: import `@theatre/studio` dynamically behind a build-time dev guard (`if (import.meta.env.DEV)`) and load the exported static `state.json` into `getProject('Hero', { state })` in production—never bundle Studio UI into end-user JavaScript.
63
+ - **Reduced motion**: when `prefers-reduced-motion: reduce` matches, seek directly to the resting keyframe (`sheet.sequence.position = REST_TIME`) instead of playing camera sweeps.
64
+
65
+ ```ts
66
+ import { getProject, types } from '@theatre/core';
67
+ import bakedState from './hero-sequence.theatre-project-state.json';
68
+
69
+ if (import.meta.env.DEV) {
70
+ const studio = (await import('@theatre/studio')).default;
71
+ studio.initialize();
72
+ }
73
+
74
+ const project = getProject('ProductShowcase', { state: bakedState });
75
+ const sheet = project.sheet('Intro');
76
+ const cameraRig = sheet.object('Camera', {
77
+ fov: types.number(40, { range: [25, 75] }),
78
+ orbitY: types.number(0, { range: [-Math.PI, Math.PI] }),
79
+ });
80
+ ```
81
+
82
+ ### Spline (`@splinetool/react-spline` / `@splinetool/runtime`)
83
+
84
+ Use **Spline** only when a designer-authored interactive 3D scene justifies its runtime payload and the following budget rules are enforced:
85
+
86
+ - **Lazy-load**: wrap `@splinetool/react-spline` in `React.lazy` (or load `@splinetool/runtime` on `IntersectionObserver` entry) so the Spline runtime never blocks hydration or first paint.
87
+ - **Scene weight budget**: audit `.splinecode` transfer size and embedded texture resolution before shipping (compress textures, cull hidden meshes, keep total scene transfer bounded rather than shipping 15 MB hero downloads).
88
+ - **Static poster & reduced-motion fallback**: render a high-craft static WebP/AVIF poster image immediately for LCP, keep the static poster when `prefers-reduced-motion: reduce` or Save-Data is active (with an explicit opt-in play toggle if interactive inspection matters), and keep all copy, buttons, and forms in semantic DOM above the canvas.
89
+
90
+ ```tsx
91
+ 'use client';
92
+
93
+ import { lazy, Suspense, useEffect, useState } from 'react';
94
+
95
+ const Spline = lazy(() => import('@splinetool/react-spline'));
96
+
97
+ export function ProductSpline({ sceneUrl, posterUrl, alt }: { sceneUrl: string; posterUrl: string; alt: string }) {
98
+ const [reducedMotion, setReducedMotion] = useState(true);
99
+
100
+ useEffect(() => {
101
+ setReducedMotion(window.matchMedia('(prefers-reduced-motion: reduce)').matches);
102
+ }, []);
103
+
104
+ if (reducedMotion) {
105
+ return <img src={posterUrl} alt={alt} className="scene-poster" />;
106
+ }
107
+
108
+ return (
109
+ <Suspense fallback={<img src={posterUrl} alt={alt} className="scene-poster" />}>
110
+ <Spline scene={sceneUrl} aria-label={alt} />
111
+ </Suspense>
112
+ );
113
+ }
114
+ ```
115
+
116
+ ### Unicorn Studio (interactive WebGL scene embeds)
117
+
118
+ Use **Unicorn Studio** when embedding designer-authored shader/WebGL motion backdrops with explicit performance and accessibility guardrails:
119
+
120
+ - Lazy-initialize (`UnicornStudio.init()`) only when the section approaches the viewport, cap DPR (`data-us-dpi="1.5"`), and destroy/pause instances when scrolled offscreen or unmounted (`UnicornStudio.destroy()`).
121
+ - Always render a lightweight CSS/static poster fallback beneath the canvas for `prefers-reduced-motion: reduce`, low-power/Save-Data devices, or WebGL context failure.
122
+ - Treat Unicorn Studio strictly as an atmospheric layer—never lock readable headlines, navigation, or conversion forms inside the WebGL canvas.
123
+
124
+ ## Official references
125
+
126
+ - Three.js docs: https://threejs.org/docs/
127
+ - Three.js WebGPU & TSL wiki/examples: https://threejs.org/examples/?q=webgpu
128
+ - React Three Fiber docs: https://r3f.docs.pmnd.rs/
129
+ - Drei docs: https://drei.docs.pmnd.rs/
130
+ - Theatre.js docs: https://www.theatrejs.com/docs/latest
131
+ - Spline docs: https://docs.spline.design/
132
+ - WebGPU API: https://developer.mozilla.org/en-US/docs/Web/API/WebGPU_API
@@ -1,71 +1,114 @@
1
- # Server-rendered web: Rails/Hotwire, Laravel/Blade/Livewire, Django/Jinja, Phoenix/LiveView, Blazor, Go templ
1
+ # Server-rendered web: Rails, Laravel/Filament, Symfony UX, WordPress, Django/FastAPI/FastHTML, Phoenix, Blazor, Go, Dart Jaspr
2
2
 
3
3
  The common discipline: the server owns initial semantic HTML, routing, validation, authorization, and most state. Progressive enhancement must not break URLs, forms, back/forward, refresh, or no-/limited-JS behavior.
4
4
 
5
5
  ## Token mapping
6
6
 
7
- Import generated CSS variables in the base layout/asset pipeline. Do not duplicate token values across framework-specific CSS build systems. In component ecosystems (Livewire/Blazor/LiveView), pass semantic class names/state rather than raw visual constants.
8
-
9
- ## Rails + Hotwire
10
-
11
- - Layout/response: Turbo Frames/Drive preserve shell navigation; fragments must have stable IDs and complete semantics in context.
12
- - Forms: Rails form helpers generate labels/error associations only when used deliberately. Preserve input after validation failure and use status/pending behavior.
13
- - Motion/a11y: Turbo replacement can destroy focus. Manage focus explicitly and honor reduced motion in CSS.
14
- - Do: `<a href="/invoices/4" data-turbo-frame="_top">View invoice</a>`.
15
- - Don't: swap a frame containing duplicate heading IDs or remove the element that had focus without restoration.
16
- - Verify: `bin/rails test`, system tests/browser, `bin/rails test:system` where configured.
17
-
18
- ## Laravel Blade + Livewire
19
-
20
- - Layout/response: Blade layouts own shell; Livewire components own interactive regions. Keep URLs/authorization consistent with server routes.
21
- - Forms: use validation error bags adjacent to fields, preserve old input/model state, correct autocomplete/input types.
22
- - Motion/a11y: Livewire DOM diffing can reuse elements/focus unexpectedly; use wire:key deliberately and explicit loading states (`wire:loading` with restraint).
23
- - Do: `<button wire:click="save" wire:loading.attr="disabled">Save invoice</button>` plus visible status.
24
- - Don't: silent background mutation or validation only as disappearing toast.
25
- - Verify: `php artisan test`, Pest/PHPUnit, browser/Dusk where present.
26
-
27
- ## Django + Jinja/templates
28
-
29
- - Layout/response: template inheritance owns shell; partials/fragments must remain valid in context. CSRF/auth behavior is core UX/security.
30
- - Forms: Django form rendering can associate labels/errors, but customize deliberately rather than dumping `{{ form.as_p }}` without design. Preserve bound values after errors.
31
- - Motion/a11y: enhancement fragments require focus/status ownership just like any DOM replacement.
32
- - Do: render `form.field.errors` adjacent and use `label_tag` correctly.
33
- - Don't: hide validation behind generic “invalid form” or lose posted values.
34
- - Verify: `python manage.py test`, `python manage.py check`, browser tests where configured.
35
-
36
- ## Phoenix + LiveView
37
-
38
- - Layout/response: LiveView state/diffing is powerful but must preserve URLs, focus, scroll, and process failure semantics. Dead-view initial render matters.
39
- - Forms: `phx-change`/`phx-submit` validation must not be premature; assign errors visibly and preserve input. uploads need progress/failure/cancel behavior.
40
- - Motion/a11y: LiveView patches can move/remove focus. JS hooks must clean up and honor reduced motion.
41
- - Do: use `phx-disable-with` and explicit async_result/state assignment.
42
- - Don't: use a spinner-only LV state or reconnect behavior that loses in-progress work silently.
43
- - Verify: `mix test`, `mix format --check-formatted`, browser/LiveView tests.
44
-
45
- ## Blazor
46
-
47
- - Layout/response: Server/prerendering/interactive modes have different hydration latency and circuit behavior. Preserve semantic initial HTML and do not leave visible controls dead while interactivity starts.
48
- - Forms: `EditForm`/`Input*` components provide validation only when model annotations/custom logic are correct; use persistent labels and error summaries.
49
- - Motion/a11y: circuit reconnect/dispose state matters; JS interop must honor reduced motion and clean up.
50
- - Do: `<InputText id="email" @bind-Value="model.Email" autocomplete="email" />` with matching label/validation message.
51
- - Don't: assume validation summary replaces adjacent recovery copy.
52
- - Verify: `dotnet test`, `dotnet build`, browser Playwright/bUnit tests.
53
-
54
- ## Go templ/html/template
55
-
56
- - Layout/response: compositional templates must produce valid complete HTML; use explicit template ownership to avoid duplicated IDs/headings in partials.
57
- - Forms: handlers must preserve posted values/errors explicitly; use correct escaping and do not bypass html/template protections.
58
- - Motion/a11y: any htmx/Alpine enhancement follows the hypermedia rules; server response status/fragment design owns state truth.
59
- - Do: return a field-error partial containing the preserved value and recovery text.
60
- - Don't: print raw validation structs as user copy or drop POST input on failure.
61
- - Verify: `go test ./...`, `go vet ./...`, browser tests where configured.
7
+ Import generated CSS variables in the base layout/asset pipeline. Do not duplicate token values across framework-specific CSS build systems. In component ecosystems (Livewire/Flux/Filament, Symfony Twig Components, WordPress `theme.json`, Blazor, LiveView, ViewComponent, Phlex, Cotton, `templ`, Gomponents, Jaspr), pass semantic class names/state rather than raw visual constants.
8
+
9
+ ## Rails 8 + Hotwire (Turbo 8, Stimulus, ViewComponent & Phlex)
10
+
11
+ - **Turbo 8 page refreshes**: enable morphing refreshes (`<meta name="turbo-refresh-method" content="morph">` and `<meta name="turbo-refresh-scroll" content="preserve">`) so form updates and broadcasts preserve scroll and input focus without hand-coding fine-grained Turbo Streams for every DOM node. Mark media players or stateful widgets `data-turbo-permanent` with a stable `id`.
12
+ - **ViewComponent**: encapsulate reusable UI in Ruby classes with typed **`renders_one`** / **`renders_many`** slots, preview every state variant in **`ViewComponent::Preview`** + **Lookbook**, and assert rendered HTML/ARIA semantics directly via `render_inline(AlertComponent.new(...))`.
13
+ - **Phlex**: author pure-Ruby HTML/SVG views (`class InvoiceCard < Phlex::HTML`) with compile-safe keyword arguments, explicit `whitespace`, streaming support, and zero ERB partial-local leaks.
14
+ - **Stimulus lifecycle**: bind listeners/observers in `connect()` and always tear them down in **`disconnect()`** (Turbo caches pages and reconnects controllers on back/forward). Honor `prefers-reduced-motion` in CSS.
15
+ - **Do**: `<a href="/invoices/4" data-turbo-frame="_top">View invoice</a>`, expose ViewComponent slots/Lookbook previews or Phlex components for every design-system primitive, and tear down observers in Stimulus `disconnect()`.
16
+ - **Don't**: swap a frame containing duplicate IDs, stuff complex conditionals into unencapsulated ERB partials, drop focus when removing a trigger, or leak Stimulus `window` listeners across Turbo cache restores.
17
+ - **Verify**: `bin/rails test`, `bin/rails test:system` (Capybara/Playwright for `rendered` evidence).
18
+
19
+ ## Laravel Blade + Livewire 3 / 4, Filament, & Flux UI
20
+
21
+ - **Livewire navigation & security**: use `wire:navigate` with **`@persist('audio-player')`** for persistent chrome, cache derived lookups with **`#[Computed]`**, protect immutable IDs/foreign keys with **`#[Locked]`**, enforce Laravel Policies/Gates inside action methods (never `mount()` alone), key loops with `wire:key`, and guard buttons with `wire:loading.attr="disabled"`.
22
+ - **Laravel Filament** (TALL-stack admin, portals, and operational apps): build CRUD and workflows with declarative **`Resource`**, **`Schema`/`Form`**, **`Table`**, **`Action`**, and **`Notification`** classes; enforce authorization Policies per resource/action/bulk action; configure brand tokens cleanly through `Panel::colors(...)`, font setup, and a scoped custom Vite panel theme instead of brittle CSS overrides.
23
+ - **Livewire Flux UI**: use Flux's accessible primitives (`<flux:modal>`, `<flux:select>`, `<flux:command>`, `<flux:toast>`) backed by Tailwind semantic tokens rather than hand-rolling Alpine modals inside Livewire views.
24
+ - **Do**: keep Filament tables server-paginated/searchable with explicit empty-state actions (`emptyStateActions`) and use `#[Locked]` + Policy checks on every Livewire mutation.
25
+ - **Don't**: trust client-writable Livewire public properties without authorization, fight Filament's layout with `!important` overrides, or render validation errors only in a disappearing toast.
26
+ - **Verify**: `php artisan test` (Pest/PHPUnit + Filament Livewire tests), Laravel Dusk / Playwright (`rendered`).
27
+
28
+ ## Symfony UX (Turbo, Live Components, Twig Components, Stimulus, Autocomplete)
29
+
30
+ - **Twig Components (`#[AsTwigComponent]`)**: encapsulate design-system primitives as typed PHP + Twig components (`<twig:Alert variant="danger">`) with strict prop defaults and slots.
31
+ - **Live Components (`#[AsLiveComponent]`)**: use for interactive server-driven filters, forms, and inline edits; mark mutable properties **`#[LiveProp(writable: true)]`** *only* when user-editable and validate/authorize inside **`#[LiveAction]`** methods.
32
+ - **UX Turbo, Stimulus & Autocomplete**: use Turbo Drive/Frames/Streams (`data-turbo-permanent` for media), tear down Stimulus controllers in `disconnect()`, and wire **UX Autocomplete** (`autocomplete: true` on Symfony Form types) for async searchable selects instead of loading 5,000 `<option>` tags into HTML.
33
+ - **Do**: keep `#[LiveProp]` read-only by default, return semantic Symfony Form validation errors inline, and preserve full-page SSR routes behind Turbo Frames.
34
+ - **Don't**: expose internal entity IDs/roles as `writable: true` `LiveProp`s or attach uncleaned Stimulus listeners across Turbo navigations.
35
+ - **Verify**: `php bin/phpunit` (Symfony Panther / Playwright for `rendered` evidence).
36
+
37
+ ## WordPress Gutenberg Blocks & Interactivity API
38
+
39
+ - **Block contract (`block.json`)**: declare block metadata, `supports` (`color`, `spacing`, `typography`, `align`), editor assets, and server-side **`render.php`** (`render` field) so dynamic blocks output clean, crawlable HTML on first paint.
40
+ - **`@wordpress/interactivity`**: use declarative directives (**`data-wp-interactive`**, **`data-wp-context`**, **`data-wp-on--click`**, **`data-wp-bind--aria-expanded`**, **`data-wp-class--is-open`**) paired with `store(...)` for frontend interactivity (tabs, filters, disclosures, instant search) instead of hydrating full React trees or legacy jQuery scripts on public pages.
41
+ - **`theme.json` tokens**: map DTCG semantic tokens into `theme.json` (`settings.color.palette`, `settings.typography.fontFamilies`, `settings.spacing.spacingSizes`) and reference `var(--wp--preset--*)` in CSS so block-editor controls and frontend rendering stay in sync.
42
+ - **Do**: emit valid initial SSR markup in `render.php` with `wp_interactivity_data_wp_context(...)` and escape output via `esc_html`/`esc_attr`/`wp_kses_post`.
43
+ - **Don't**: ship a full React runtime to the public frontend just for an accordion/filter bar, or bypass `theme.json` with global `!important` resets.
44
+ - **Verify**: `npm run build` (`@wordpress/scripts`), `wp-env` + Playwright (`rendered`).
45
+
46
+ ## Inertia.js v2 (React / Vue / Svelte over Laravel, Rails, Phoenix)
47
+
48
+ Choose **Inertia.js v2** when the server owns routing, controllers, auth, and database queries while the frontend needs rich React/Vue/Svelte interactivity without maintaining a separate REST/GraphQL API layer:
49
+
50
+ - **Deferred props (`Inertia::defer(...)` + `<Deferred data="metrics" fallback={...}>`)**: render the main page immediately and stream slow secondary data asynchronously without blocking TTFB.
51
+ - **Prefetching & viewport lazy loads**: use `<Link href="/invoices" prefetch>` (hover/mount prefetch) and **`<WhenVisible data="comments" fallback={...}>`** for below-the-fold data; use `usePoll()` for controlled live refresh.
52
+ - **Forms**: use `useForm()` (or `<Form>` in Inertia v2) so server validation errors (`errors.<field>`), `processing` state, scroll preservation, and browser history work seamlessly.
53
+ - **Do**: keep authorization and data shaping in controllers and return minimal serializable props (never leak raw ORM models).
54
+ - **Don't**: recreate a client-side router or duplicate server validation/auth logic inside Inertia page components.
55
+
56
+ ## Python Web: Django (`django-htmx` / Cotton / Ninja / Unfold / Wagtail), FastAPI + Jinja2, & FastHTML
57
+
58
+ - **Django + `django-htmx` / Cotton**: use base template inheritance for the shell, **`django-cotton`** (`<c-card>`) or `django-template-partials` for reusable semantic components, and **`django-htmx`** (`if request.htmx:`) to return focused fragments on partial requests while returning the full page on direct loads/refreshes (always set `Vary: HX-Request`). Include `hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'`, render `form.field.errors` adjacent to `<label>`, and preserve bound values on HTTP 422/400 re-renders.
59
+ - **Django Ninja, Unfold, & Wagtail**: pair **Django Ninja** (typed Pydantic schemas) for island/API endpoints; adopt **Django Unfold** (`UNFOLD` semantic theme config, KPI/navigation helpers) when shipping a modern accessible Django Admin instead of hacking raw admin CSS; build editorial CMS pages in **Wagtail** using structured **`StreamField`** blocks mapped to design-system templates rather than freeform rich-text HTML blobs.
60
+ - **FastAPI + Jinja2 + htmx**: render SSR pages with `templates.TemplateResponse(request, "invoices.html", {...})`, return HTTP 422 HTML field-error fragments on Pydantic `ValidationError` for htmx requests, enforce explicit CSRF tokens on form/htmx mutations (FastAPI does not enable CSRF middleware by default), and set `Vary: HX-Request`.
61
+ - **FastHTML** (`fasthtml.common` + Starlette/ASGI + htmx): compose semantic FT components (`Main`, `Form`, `Label`, `Input`, `Button`) backed by static token CSS (`hdrs=(Link(rel='stylesheet', href='/tokens.css'),)`). Never pass untrusted user input to `NotStr(...)` (XSS risk).
62
+ - **Do**: serve the exact same URL as full HTML on refresh and as a fragment on `HX-Request` (with `Vary: HX-Request`) and preserve posted input on HTTP 422 errors.
63
+ - **Don't**: cache htmx fragments under full-page cache keys, omit CSRF protection in FastAPI form/htmx handlers, or dump unstyled `{{ form.as_p }}` / `NotStr(user_input)`.
64
+ - **Verify**: `python manage.py check`, `pytest` (`TestClient`), Playwright (`rendered`).
65
+
66
+ ## Phoenix + LiveView 1.0+
67
+
68
+ - **Memory & async discipline**: render large or growing collections with **`stream/3`** + `phx-update="stream"` (so LiveView does not retain thousands of structs in process RAM) and load slow data non-blockingly via **`assign_async/3`** paired with `<.async_result :let={data} assign={@invoices}>` (`:loading`, `:failed`, ok states).
69
+ - **Zero-round-trip UI transitions**: use **`Phoenix.LiveView.JS`** commands (`JS.show`, `JS.hide`, `JS.toggle_class`, `JS.focus`) for modals, drawers, and disclosures so local interaction is instant and respects `prefers-reduced-motion`.
70
+ - **Forms & uploads**: use `to_form/1`, `phx-change`/`phx-submit` with `phx-debounce` and `phx-disable-with`, and explicit `live_file_input` progress/cancel/error UI. Keep dead-view (initial HTTP GET) HTML complete and semantic before the WebSocket connects.
71
+ - **Do**: clean up external observers/charts in JS Hook `destroyed()` and preserve focus across patches.
72
+ - **Don't**: assign giant lists directly to socket assigns (`assign(socket, :rows, huge_list)`) or ignore socket reconnect/offline states.
73
+ - **Verify**: `mix format --check-formatted`, `mix test` (LiveView tests), Wallaby/Playwright (`rendered`).
74
+
75
+ ## Blazor (.NET 9 / 10) & Component Ecosystems
76
+
77
+ - **Render modes & streaming**: keep content-heavy routes **Static SSR** by default, apply **`[StreamRendering]`** for immediate loading skeletons, use **Enhanced Forms** (`<EditForm Enhance ...>` + `[SupplyParameterFromForm]`), and opt into `@rendermode InteractiveServer`, `InteractiveWebAssembly`, or `InteractiveAuto` only on components requiring live stateful interaction.
78
+ - **Component suites (choose ONE per app)**:
79
+ - **FluentUI Blazor** (`Microsoft.FluentUI.AspNetCore.Components`): built on Fluent Web Components with strong WCAG/keyboard/RTL parity and `<FluentDesignTheme>` live light/dark/accent tokens—strong default for accessible business/enterprise apps.
80
+ - **MudBlazor**: Material-based C#-first library; mount `<MudThemeProvider Theme="_theme" />`, `<MudPopoverProvider />`, `<MudDialogProvider />`, and `<MudSnackbarProvider />` once in `MainLayout.razor` and map semantic tokens into `MudTheme`.
81
+ - **Radzen Blazor**: data-dense enterprise `RadzenDataGrid`/scheduler/chart suite—bind server-side `LoadData` paging/sorting/filtering for large datasets and customize theme CSS tokens cleanly.
82
+ - **Accessibility & reconnects**: pair `<InputText id="email" ... />` with `<label for="email">` and `<ValidationMessage>`; design explicit SignalR circuit-reconnecting/failed UX and dispose `IJSObjectReference` in `DisposeAsync()`.
83
+ - **Do**: pick one suite (FluentUI, MudBlazor, or Radzen), mount its overlay providers once in `MainLayout`, and dispose JS interop handles.
84
+ - **Don't**: mix MudBlazor and FluentUI overlay providers on the same layout, or force `InteractiveServer` globally on static content routes.
85
+ - **Verify**: `dotnet build`, `dotnet test` (bUnit), Playwright (`rendered`).
86
+
87
+ ## Go `templ`, Gomponents, `html/template`, & htmx
88
+
89
+ - **`templ`**: compile-time type-checked HTML components (`templ generate`) with automatic contextual escaping and `templ.SafeURL` for user-supplied links.
90
+ - **Gomponents** (`maragudk/gomponents`): pure-Go functional HTML composition (`html.Div`, `html.Form`, `g.Text`) with zero code-generation step and automatic HTML escaping—pairs cleanly with **Echo**, **Chi**, or **Fiber** plus htmx (`hx-boost`, `hx-swap="morph"`) for partial fragments.
91
+ - **Forms & errors**: return an HTTP 422 field-error component containing preserved posted values, adjacent field messages, and a focusable summary; set `Vary: HX-Request` on fragment endpoints; never print raw Go validation structs as user copy.
92
+ - **Do**: escape text with `templ` / `g.Text` and pass `http.ResponseWriter` cleanly through middleware (CSRF, auth, `Vary: HX-Request`).
93
+ - **Don't**: concatenate raw HTML strings with `fmt.Sprintf` or pass untrusted strings to `g.Raw(...)` / `templ.Raw(...)`.
94
+ - **Verify**: `templ generate`, `go vet ./...`, `go test ./...`, Playwright (`rendered`).
95
+
96
+ ## Dart Jaspr (SSR & Islands)
97
+
98
+ Choose **Jaspr** when a Dart/Flutter team needs true semantic HTML/CSS web sites, SEO-crawlable SSR, or static pages without shipping Flutter Web's CanvasKit canvas runtime:
99
+
100
+ - Author server-rendered shells (`@document`) with semantic HTML components (`div`, `nav`, `main`, `form`, `button`) and mark only interactive islands with **`@client`** so client JS stays minimal.
101
+ - Map DTCG semantic CSS custom properties into global stylesheets (or Jaspr typed CSS) rather than duplicating Flutter `ThemeData` inline styles on every node.
102
+ - **Do**: keep static/content routes server-rendered (`static` or `server` mode) and hydrate small `@client` islands.
103
+ - **Don't**: embed Flutter Web's canvas inside a Jaspr marketing/docs page for text content, or ship unstyled interactive controls without keyboard/ARIA semantics.
104
+ - **Verify**: `dart analyze`, `dart test`, `jaspr build`, Playwright (`rendered`).
62
105
 
63
106
  ## Cross-stack traps
64
107
 
65
- - fragment swaps duplicating IDs/landmarks or destroying focus;
66
- - hidden divergence between enhanced and no-JS behavior;
67
- - validation rendered only in toast/console;
68
- - cached fragments leaking user/session-specific data;
69
- - timezone/locale rendering mismatch between server/client;
70
- - CSRF/session expiry losing form input;
71
- - pagination/filter state absent from URLs and therefore lost on back/share/refresh.
108
+ - fragment swaps duplicating IDs/landmarks or destroying keyboard focus;
109
+ - caching partial responses without `Vary: HX-Request` / `Vary: X-Inertia`;
110
+ - hidden divergence between enhanced (Turbo/htmx/Livewire/Interactivity API/Enhanced Forms) and no-JS behavior;
111
+ - validation rendered only in toast/console or dropping posted input on error;
112
+ - authorization checked only on initial GET render, not inside Livewire/Live Component/Filament/LiveView/Turbo/Inertia POST mutations;
113
+ - timezone/locale rendering mismatch between server and browser;
114
+ - pagination/filter state absent from URLs and lost on back/share/refresh.
@@ -0,0 +1,77 @@
1
+ # Shader workflow (GLSL, WGSL, and TSL)
2
+
3
+ ## Before writing a shader
4
+
5
+ - State the visual/material behavior in plain language and identify its semantic role.
6
+ - Choose **GLSL ES 3.0** (`#version 300 es`) for WebGL 2, **WGSL** for raw WebGPU, or **TSL (`three/tsl`)** when using Three.js `WebGPURenderer` so one node graph compiles to both WGSL and GLSL (`scene-architecture.md`).
7
+ - Define input textures, coordinate space, uniforms, color space (linear math → sRGB output), alpha behavior, precision (`precision highp float;` on mobile GPUs to avoid UV/time banding), and a **`uReduceMotion`** uniform (`0.0` or `1.0`) so reduced-motion mode freezes evolution cleanly without recompiling shaders.
8
+ - Build a static UV diagnostic frame first, then layer clamped time/pointer/audio uniforms.
9
+
10
+ ## Starter patterns (GLSL / WGSL / TSL)
11
+
12
+ ```glsl
13
+ // GLSL ES 3.0 fragment starter: explicit highp precision, aspect-corrected UVs, uReduceMotion gate
14
+ #version 300 es
15
+ precision highp float;
16
+
17
+ uniform vec2 uResolution;
18
+ uniform float uTime;
19
+ uniform float uReduceMotion; // 1.0 when prefers-reduced-motion: reduce
20
+
21
+ out vec4 fragColor;
22
+
23
+ void main() {
24
+ vec2 uv = gl_FragCoord.xy / uResolution;
25
+ vec2 centered = (gl_FragCoord.xy - 0.5 * uResolution) / min(uResolution.x, uResolution.y);
26
+ float phase = mix(uTime * 0.35, 0.0, uReduceMotion);
27
+ float band = 0.5 + 0.5 * sin(length(centered) * 6.0 - phase);
28
+ vec3 col = mix(vec3(0.08, 0.11, 0.16), vec3(0.20, 0.42, 0.62), band * (1.0 - uv.y * 0.3));
29
+ fragColor = vec4(col, 1.0);
30
+ }
31
+ ```
32
+
33
+ ```wgsl
34
+ // WGSL fragment starter: uniform buffer with reduced-motion gate
35
+ struct Uniforms {
36
+ resolution: vec2<f32>,
37
+ time: f32,
38
+ reduceMotion: f32,
39
+ };
40
+ @group(0) @binding(0) var<uniform> u: Uniforms;
41
+
42
+ @fragment
43
+ fn fs_main(@builtin(position) pos: vec4<f32>) -> @location(0) vec4<f32> {
44
+ let centered = (pos.xy - 0.5 * u.resolution) / min(u.resolution.x, u.resolution.y);
45
+ let phase = mix(u.time * 0.35, 0.0, u.reduceMotion);
46
+ let band = 0.5 + 0.5 * sin(length(centered) * 6.0 - phase);
47
+ return vec4<f32>(mix(vec3<f32>(0.08, 0.11, 0.16), vec3<f32>(0.20, 0.42, 0.62), band), 1.0);
48
+ }
49
+ ```
50
+
51
+ ```ts
52
+ // Three.js TSL starter (compiles to WGSL on WebGPU and GLSL on WebGL2)
53
+ import { color, float, length, mix, sin, time, uniform, uv } from 'three/tsl';
54
+
55
+ const uReduce = uniform(window.matchMedia('(prefers-reduced-motion: reduce)').matches ? 1 : 0);
56
+ const phase = mix(time.mul(0.35), float(0), uReduce);
57
+ const band = sin(length(uv().sub(0.5)).mul(6).sub(phase)).mul(0.5).add(0.5);
58
+ material.colorNode = mix(color(0x141c29), color(0x336b9e), band);
59
+ ```
60
+
61
+ ## Debugging sequence
62
+
63
+ 1. Confirm shader compiles cleanly (check `gl.getShaderInfoLog` / `device.pushErrorScope('validation')`).
64
+ 2. Render a diagnostic UV gradient to verify aspect ratio and DPR scaling.
65
+ 3. Verify sRGB/linear color space, tone mapping, premultiplied alpha, and texture flip-Y orientation.
66
+ 4. Add one pass at a time while checking GPU frame time and memory.
67
+ 5. Test context loss, resize, texture load failure, `uReduceMotion = 1`, and static fallback (`rendered`).
68
+
69
+ ## Rules
70
+
71
+ - Bound loop counts and texture reads; avoid deep nested loops or wide blur kernels on mobile GPUs.
72
+ - Use derivative-based antialiasing (`fwidth`) for crisp procedural edges.
73
+ - Never introduce high-frequency flashing or strobing (>3 Hz, WCAG 2.3.1).
74
+ - Seed procedural noise deterministically for reproducible visual QA.
75
+ - Never paste proprietary shaders; derive original effects from the surface brief.
76
+
77
+ References: WebGL Fundamentals (https://webglfundamentals.org/), WGSL spec (https://www.w3.org/TR/WGSL/), and Three.js TSL (https://threejs.org/examples/?q=tsl).
@@ -0,0 +1,58 @@
1
+ # Smooth scrolling: Lenis and GSAP ScrollSmoother
2
+
3
+ Smooth scrolling is optional. It alters input feel and browser behavior, so add it only when the brief explicitly calls for inertial scroll choreography and normal native scroll remains intact. Never force smooth-scroll hijacking on operational dashboards, tables, or forms.
4
+
5
+ ## Selection checks
6
+
7
+ - Confirm there is no existing smooth-scroll library or custom scroll container.
8
+ - Check keyboard (`Space`/`PageDown`/arrows), wheel, touch momentum, scrollbar dragging, `#anchor` jumps, history restoration, focus-into-view, nested scroll regions, and `prefers-reduced-motion`.
9
+ - Never combine Lenis with GSAP `ScrollSmoother`, Locomotive, or another scroll controller.
10
+ - Disable smooth scroll on `prefers-reduced-motion: reduce`, low-power/constrained surfaces, and preserve native touch inertia on mobile.
11
+
12
+ ## Lenis (`lenis`, `lenis/react`) + GSAP ScrollTrigger
13
+
14
+ - **Package rename**: use **`lenis`** (not legacy `@studio-freight/lenis`), import its required stylesheet **`import 'lenis/dist/lenis.css'`**, and in React use **`lenis/react`** (`<ReactLenis root options={{ autoRaf: false }} ref={lenisRef}>` / `useLenis`).
15
+ - **Single-clock rule (`autoRaf: false`)**: when driving Lenis from `gsap.ticker`, explicitly pass **`autoRaf: false`** so Lenis v1.1+ does not run a competing internal `requestAnimationFrame` loop.
16
+ - **Nested scrollable panels**: mark scrollable modals, drawers, code blocks, and select menus with **`data-lenis-prevent`** (or `data-lenis-prevent-wheel` / `data-lenis-prevent-touch`) so wheel/touch scrolling inside overlays is not hijacked by the page scroller.
17
+ - **CSS hygiene**: remove `html { scroll-behavior: smooth; }` when Lenis is active so native smooth scroll does not fight Lenis interpolation; use `overflow-x: clip` (never `overflow-x: hidden`) on `body` so `position: sticky` keeps working.
18
+
19
+ ```ts
20
+ // Single-clock Lenis + ScrollTrigger sync (skip when reduced motion is preferred)
21
+ import Lenis from 'lenis';
22
+ import 'lenis/dist/lenis.css';
23
+ import gsap from 'gsap';
24
+ import { ScrollTrigger } from 'gsap/ScrollTrigger';
25
+
26
+ gsap.registerPlugin(ScrollTrigger);
27
+
28
+ let cleanup = () => {};
29
+ if (!window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
30
+ const lenis = new Lenis({ autoRaf: false, duration: 1.05, smoothWheel: true });
31
+ lenis.on('scroll', ScrollTrigger.update);
32
+ const tick = (time: number) => lenis.raf(time * 1000);
33
+ gsap.ticker.add(tick);
34
+ gsap.ticker.lagSmoothing(0);
35
+ cleanup = () => {
36
+ gsap.ticker.remove(tick);
37
+ lenis.destroy();
38
+ };
39
+ }
40
+ ```
41
+
42
+ ## GSAP `ScrollSmoother` (free in GSAP 3.13+)
43
+
44
+ If the route is already heavily GSAP/ScrollTrigger-driven and needs built-in `data-speed` / `data-lag` parallax without a second vendor, **`ScrollSmoother`** (free in GSAP 3.13+) is a direct alternative to Lenis:
45
+
46
+ - Wrap scrollable content in `#smooth-wrapper > #smooth-content` while keeping `position: fixed` headers, modals, and drawers **outside** `#smooth-content` (transforms on `#smooth-content` trap fixed descendants).
47
+ - Keep `smoothTouch: 0` (or `false`) so mobile touch scrolling stays native, skip creation under `(prefers-reduced-motion: reduce)`, and call `smoother.kill()` on teardown.
48
+
49
+ ## Progressive fallback
50
+
51
+ The page must remain scrollable when JavaScript, Lenis, or ScrollSmoother fails. Never hide the browser scrollbar or suppress wheel/touch input, and test `<a href="#section">` anchors, `Tab` focus into offscreen controls, and nested `data-lenis-prevent` containers in a real browser (`rendered`).
52
+
53
+ ## Official references
54
+
55
+ - Lenis documentation: https://lenis.darkroom.engineering/
56
+ - Lenis repository: https://github.com/darkroomengineering/lenis
57
+ - GSAP ScrollSmoother: https://gsap.com/docs/v3/Plugins/ScrollSmoother/
58
+ - GSAP ScrollTrigger: https://gsap.com/docs/v3/Plugins/ScrollTrigger/
@@ -12,41 +12,92 @@ Fine-grained reactivity does not require fine-grained token duplication. Use typ
12
12
 
13
13
  ## Layout and responsive idioms
14
14
 
15
- Use CSS-first layout. `<Show>`, `<For>`, and `<Suspense>` control state rendering; they do not design layout. Solid's lack of VDOM means DOM structure and control flow are explicit—use that predictability rather than hiding conditionality inside broad wrappers.
15
+ Use CSS-first layout. `<Show>`, `<For>`, `<Index>`, `<Switch>`/`<Match>`, `<ErrorBoundary>`, and `<Suspense>` control state rendering; they do not design layout. Solid's lack of VDOM means components run once and DOM bindings update at fine-grained signal level—never destructure `props` at the top of a component, or reactivity silently breaks. Use **`splitProps`** and **`mergeProps`** when forwarding or defaulting props.
16
16
 
17
17
  ## Typography/custom fonts
18
18
 
19
- Load fonts in HTML entry/root route with explicit fallback behavior. Keep text as real DOM text; do not replace typography with canvas or SVG except for genuinely graphical content.
19
+ Load fonts in HTML entry/root route (`src/entry-server.tsx` in SolidStart) with explicit fallback behavior. Keep text as real DOM text; do not replace typography with canvas or SVG except for genuinely graphical content.
20
20
 
21
21
  ## Motion/reduced motion
22
22
 
23
- Use CSS transitions/animations where possible. JS animation should be created inside lifecycle-aware code (`onMount`/`createEffect`) and honor `matchMedia('(prefers-reduced-motion: reduce)')`. Avoid retriggering effects because signals mutate too broadly.
23
+ Use CSS transitions/animations where possible. JS animation should be created inside lifecycle-aware code (`onMount`/`createEffect`) with cleanup in `onCleanup`, honoring `matchMedia('(prefers-reduced-motion: reduce)')`. Derive values with **`createMemo`** rather than mirroring signals via `createEffect`.
24
24
 
25
25
  ## Accessibility specifics
26
26
 
27
- Use native elements. Solid event/delegation patterns still require keyboard/focus semantics. `<For>` with keyed references preserves DOM identity; incorrect reuse can retain focus/selection in the wrong row. Manage focus when conditional branches mount/unmount controls.
28
-
29
- ## States idiom
30
-
31
- Use resources: `resource.loading`, `resource.error`, `resource.latest`/`()` distinction, refetch/stale behavior, and mutation pending/rollback. Show empty and partial data explicitly. `<Suspense>` fallback should preserve structure rather than blanking a full route.
27
+ Use native elements or Solid-native headless primitives (**Kobalte**, **Corvu**, **Ark UI**; see `component-systems.md`). Use `createUniqueId()` for SSR-safe `<label for>` and `aria-describedby` IDs. Choose **`<For>`** for arrays of objects with stable reference identity (rows/cards that reorder) and **`<Index>`** for arrays of primitives or editable input values (keyed by index, passing an accessor `item()` so typing does not recreate the `<input>` and drop focus).
28
+
29
+ ## States idiom & SolidStart 1.x
30
+
31
+ Use `<ErrorBoundary fallback={(err, reset) => ...}>` around `<Suspense>` so rejected async queries render recoverable errors instead of crashing the route. In **SolidStart 1.x** (`@solidjs/router` + Vinxi):
32
+
33
+ - Define cached read loaders with **`query(async (...) => { 'use server'; ... }, 'key')`** and consume them with **`createAsync(() => getInvoices())`** (preloaded via route `preload`).
34
+ - Define progressive mutations with **`action(async (formData: FormData) => { 'use server'; ... }, 'key')`**, attach directly to `<form action={saveInvoice} method="post">`, and inspect pending/error/optimistic state with **`useSubmission(saveInvoice)`** (or `useSubmissions` for concurrent item actions).
35
+ - Isolate browser-only widgets (WebGL canvases, rich editors) with **`clientOnly(() => import('./CanvasEditor'))`** from `@solidjs/start` so server rendering never imports browser globals.
36
+
37
+ ```tsx
38
+ import { query, action, createAsync, useSubmission } from '@solidjs/router';
39
+ import { ErrorBoundary, For, Show, Suspense, createMemo, mergeProps, splitProps } from 'solid-js';
40
+
41
+ const getInvoices = query(async () => {
42
+ 'use server';
43
+ return db.invoices.list();
44
+ }, 'invoices');
45
+
46
+ const archiveInvoice = action(async (formData: FormData) => {
47
+ 'use server';
48
+ const id = String(formData.get('id') ?? '');
49
+ if (!id) return { error: 'Missing invoice ID.' };
50
+ await db.invoices.archive(id);
51
+ return { ok: true };
52
+ }, 'archive-invoice');
53
+
54
+ export function InvoicePanel(rawProps: { filter?: string; class?: string }) {
55
+ const merged = mergeProps({ filter: '' }, rawProps);
56
+ const [local, rest] = splitProps(merged, ['filter']);
57
+ const invoices = createAsync(() => getInvoices());
58
+ const submission = useSubmission(archiveInvoice);
59
+ const visible = createMemo(() =>
60
+ (invoices() ?? []).filter((inv) => inv.code.includes(local.filter))
61
+ );
62
+
63
+ return (
64
+ <section {...rest}>
65
+ <ErrorBoundary fallback={(err, reset) => <button onClick={reset}>Retry: {err.message}</button>}>
66
+ <Suspense fallback={<p role="status" aria-busy="true">Loading invoices…</p>}>
67
+ <Show when={visible().length > 0} fallback={<p>No matching invoices.</p>}>
68
+ <For each={visible()}>
69
+ {(inv) => (
70
+ <form action={archiveInvoice} method="post">
71
+ <input type="hidden" name="id" value={inv.id} />
72
+ <button type="submit" disabled={submission.pending}>Archive {inv.code}</button>
73
+ </form>
74
+ )}
75
+ </For>
76
+ </Show>
77
+ </Suspense>
78
+ </ErrorBoundary>
79
+ </section>
80
+ );
81
+ }
82
+ ```
32
83
 
33
84
  ## Forms idiom
34
85
 
35
- Use native forms where possible. Correct attributes (`for` in Solid is usually `for`/`htmlFor` depending version/plugin—follow project convention and generated DOM) must produce real label association. Server functions/actions need validation error shape and input preservation.
86
+ Use native `<form action={myAction} method="post">` in SolidStart or Modular Forms (`@modular-forms/solid`) for complex client/server validation (`forms-validation.md`). Solid accepts standard HTML `for` on `<label>` (producing real label association). Preserve user input on failed server validation and expose `submission.error` / returned validation data next to the control.
36
87
 
37
88
  ## Do/don't pairs
38
89
 
39
90
  | Do | Don't |
40
91
  |---|---|
41
- | `<A href="/invoice/42">View invoice</A>` | click-only `<div>` navigation |
42
- | `<For each={items()}>{item => <Row item={item} />}</For>` with stable identity | index-only logic that reuses DOM/state incorrectly |
43
- | narrow signal ownership near the state | one global mutable store with unclear invalidation |
44
- | `createResource` state rendered explicitly | treating loading/error/empty as one falsey branch |
45
- | cleanup animation/listener in `onCleanup` | assuming component teardown removes browser work automatically |
92
+ | `<A href="/invoice/42">View invoice</A>` | Click-only `<div>` navigation |
93
+ | `splitProps`/`mergeProps` and `props.title` access inside JSX/memos | `function Card({ title })` destructuring that kills reactivity |
94
+ | `<For>` for object lists; `<Index>` for primitive/editable input lists | `<For>` over primitive strings inside `<input>` (recreates DOM and loses focus on every keystroke) |
95
+ | `createMemo` for derived values; `query`/`createAsync` + `action`/`useSubmission` in SolidStart | Mirroring derived state in `createEffect` or manual `onMount` fetch waterfalls |
96
+ | `clientOnly(() => import(...))` for browser-only modules and `onCleanup` for listeners | Importing `window`-dependent canvases directly in SSR routes or leaking listeners |
46
97
 
47
98
  ## Known traps
48
99
 
49
- Signal dependency over-invalidation, destructuring props losing reactivity, DOM identity/focus reuse, SSR hydration mismatch, suspense layout collapse, hidden browser-only initialization, overuse of effects where derived state belongs.
100
+ Destructuring `props` and silently losing reactivity, using `<For>` on primitive input arrays (dropping focus), missing `<ErrorBoundary>` around `<Suspense>`/`createAsync`, browser-only imports crashing SolidStart SSR without `clientOnly()`, overusing `createEffect` where `createMemo` belongs, forgetting `'use server'` inside `query`/`action` handlers.
50
101
 
51
102
  ## Verification commands
52
103
 
@@ -57,4 +108,4 @@ npm run build
57
108
  npx playwright test
58
109
  ```
59
110
 
60
- Rendered browser inspection is still required for hierarchy, focus, and motion evidence.
111
+ Rendered browser inspection is required for hierarchy, focus, hydration, and motion evidence (`rendered`); builds and typechecks are `static`.