@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,76 @@
1
+ ---
2
+ name: pixelcraft-web
3
+ description: Translates Pixelcraft direction, tokens, UX, and floor requirements into idiomatic web UI across HTML/CSS, React/Next, Vue/Nuxt, Svelte, Solid, Angular, Astro, Qwik, htmx/Alpine, Lit, Tailwind, server-rendered stacks, Rust/Leptos/Yew, Kotlin web, Elm, ClojureScript, F#/Fable, Scala/Laminar, and Java web. Use when building or reviewing browser UI, routing/navigation, responsive layout, forms, states, motion, accessibility, rendering performance, hydration, or web component behavior.
4
+ license: MIT
5
+ metadata:
6
+ version: 0.1.0
7
+ ---
8
+
9
+ # Pixelcraft web
10
+
11
+ Use this skill when the rendering surface is HTML/CSS/DOM, including server-rendered pages and hybrid islands. Do not assume React or Tailwind; detect the actual framework nearest the changed files.
12
+
13
+ ## Surface craft
14
+
15
+ Use one memorable device when the brief warrants it: a real product as the spatial anchor, editorial rows around comparable facts, or expressive type constrained by an underlying grid. Keep navigation and primary controls ordinary. Inspect normal scroll, mobile reflow, first-load payload and the reduced-motion path; never trade orientation for scroll hijacking, a custom cursor or delayed essential content.
16
+
17
+ ## Detection signals
18
+
19
+ `package.json` dependencies, framework config files, template extensions, server routes/controllers, component imports, CSS/Tailwind entry files, hydration/islands markers, and server framework conventions. Multiple web stacks can coexist; scope each decision to the route/component surface.
20
+
21
+ ## Translate direction to web idioms
22
+
23
+ 1. Convert semantic DTCG roles to CSS custom properties or the framework's theme object; primitives remain hidden behind semantic names.
24
+ 2. Express composition with layout primitives appropriate to the surface: CSS grid/flex/container queries/logical properties before framework-specific utility soup.
25
+ 3. Choose rendering strategy deliberately: static, server-rendered, streamed, client hydration, island, SPA, or enhanced partial. Do not hydrate the whole page for one small control.
26
+ 4. Implement interaction with real HTML semantics first (`a`, `button`, `form`, `label`, `dialog` where appropriate), then framework behavior.
27
+ 5. Connect state matrix rows to route/cache/network behavior: loading, empty, error, offline, stale, unauthorized, optimistic rollback, and deep-link restoration.
28
+ 6. Honor `prefers-reduced-motion`, `prefers-color-scheme`, forced colors, text scaling, logical direction, keyboard/focus behavior, and browser/platform differences.
29
+
30
+ ## Platform-wide rules
31
+
32
+ - Use logical properties (`margin-inline`, `inset-block`) for direction-sensitive layout; physical left/right only when the meaning is physical.
33
+ - Preserve form input across failed validation and auth redirects; use correct `autocomplete`, `inputmode`, type, and paste behavior.
34
+ - Native browser navigation/history/scroll restoration is part of UX. Do not break it with hash misuse or trapped SPA state.
35
+ - Measure actual rendering: cumulative layout shift, input latency, hydration blocking, font loading, image priority, and route transitions—not only bundle size.
36
+ - Avoid global resets or token overrides that destroy inherited project/system behavior.
37
+
38
+ ## Common web-specific slop/UX failures
39
+
40
+ - centered hero + eyebrow + two CTAs + three cards regardless of content;
41
+ - div/span buttons with no keyboard/focus semantics;
42
+ - hydration delay making visible controls dead;
43
+ - infinite scroll without position recovery or accessibility alternative;
44
+ - sticky/fixed chrome obscuring focus or small-viewport content;
45
+ - Tailwind utility repetition mistaken for a token system;
46
+ - modal/dropdown focus escaping or remaining in removed DOM;
47
+ - dark mode implemented by inversion rather than semantic tokens;
48
+ - responsive behavior that merely shrinks desktop instead of restructuring.
49
+
50
+ ## Verification options
51
+
52
+ Be explicit: browser rendering and interaction can be inspected here when a browser/toolchain is available; screenshots, DOM/accessibility tree, axe scans, Playwright/Cypress/component tests, Lighthouse, responsive/device emulation, and network throttling are possible. Their absence is `not-checked`, not failure-proof. Static inspection cannot prove visual quality.
53
+
54
+ ## Framework routing
55
+
56
+ - Read [references/adaptive-layout.md](references/adaptive-layout.md) when a web surface must work across phone, tablet, desktop, split window or different input modes.
57
+ - Read [references/html-css.md](references/html-css.md) when working directly in HTML/CSS or framework-independent browser behavior.
58
+ - Read [references/react-next.md](references/react-next.md) for React, Next.js, Remix-like React routing/hydration concerns.
59
+ - Read [references/vue-nuxt.md](references/vue-nuxt.md) for Vue/Nuxt.
60
+ - Read [references/svelte.md](references/svelte.md) for Svelte/SvelteKit.
61
+ - Read [references/solid.md](references/solid.md) for Solid/SolidStart.
62
+ - Read [references/angular.md](references/angular.md) for Angular.
63
+ - Read [references/astro.md](references/astro.md) for Astro content/islands architecture.
64
+ - Read [references/qwik.md](references/qwik.md) for Qwik resumability.
65
+ - Read [references/htmx-alpine.md](references/htmx-alpine.md) for hypermedia-driven htmx/Alpine interfaces.
66
+ - Read [references/lit-web-components.md](references/lit-web-components.md) for Lit/standards-based web components.
67
+ - Read [references/tailwind.md](references/tailwind.md) whenever Tailwind is the styling layer, especially v4 CSS-first configuration.
68
+ - Read [references/server-rendered.md](references/server-rendered.md) for Rails/Hotwire, Laravel/Blade/Livewire, Django/Jinja, Phoenix/LiveView, Blazor, and Go templ surfaces.
69
+ - Read [references/leptos-yew.md](references/leptos-yew.md) for Rust browser/WASM UI in Leptos or Yew.
70
+ - Read [references/kotlin-web.md](references/kotlin-web.md) for Compose Multiplatform Web/Kobweb.
71
+ - Read [references/elm.md](references/elm.md) for Elm.
72
+ - Read [references/clojurescript.md](references/clojurescript.md) for Reagent/re-frame ClojureScript.
73
+ - Read [references/fsharp-fable.md](references/fsharp-fable.md) for F#/Fable Feliz/Elmish.
74
+ - Read [references/scala-laminar.md](references/scala-laminar.md) for Scala.js/Laminar.
75
+ - Read [references/java-web.md](references/java-web.md) for Vaadin and Thymeleaf.
76
+ - Read [references/pwa.md](references/pwa.md) whenever the browser app must be installable, offline-capable, push-enabled, cache-managed, update-aware, or evaluated on iOS/iPadOS home-screen behavior.
@@ -0,0 +1,25 @@
1
+ # Adaptive web interfaces
2
+
3
+ Design the task for available space and input, not for a device name. Decide in the plan where navigation, order, density and controls actually need a different composition. Preserve the same destinations, meaningful information, task outcomes and state. Share behavior and data across presentations; avoid duplicate focusable controls and loss of form inputs, selection or focus when crossing a breakpoint.
4
+
5
+ ## Representative size and input classes
6
+
7
+ Use these as starting CSS viewport sizes, not prescribed breakpoints. Check just below and above meaningful layout changes and resize between classes, not only at preset widths. Combine cases only if the resulting coverage exercises each constraint; document scope that cannot be tested.
8
+
9
+ | Class | Example width × height | Task constraint to check |
10
+ |---|---|---|
11
+ | Small / large phone portrait | 320×640 / 430×932 | One-handed reach, touch targets, no hover dependency, long labels and soft keyboard. |
12
+ | Phone landscape | 844×390 | Safe insets, short dialogs, keyboard/scroll recovery, primary action stays reachable. |
13
+ | Tablet portrait / landscape | 768×1024 / 1024×768 | Touch and attached keyboard/pointer; panes that adapt without losing current selection. |
14
+ | Foldable / split pane | Host pane sizes before and after change | Avoid a hinge or constrained pane when relevant; retain progress when resized or folded. |
15
+ | Laptop / desktop | 1280×720 / 1440×900 | Keep scan efficiency, pointer actions and all keyboard/focus paths; avoid hiding important actions in hover alone. |
16
+ | Ultrawide | 2560×1080 | Constrain reading measure and control travel without stretching unrelated content. |
17
+ | Short-height window | 1280×480 | Reachable focused fields and dialogs despite sticky bars and reduced vertical space. |
18
+
19
+ ## Implementation
20
+
21
+ - Use fluid Grid/Flex, intrinsic sizing and logical properties. Use container queries for components reused in panels of different widths; reserve viewport queries for shell changes, including height and aspect-ratio constraints where needed.
22
+ - Consider a wide sidebar versus a compact tab bar or sheet, a table versus a summary list with details, and denser desktop controls versus touch targets. Choose only patterns that fit the task. Preserve actual table semantics or a usable comparison view when the task requires comparing rows/columns; do not remove fields to avoid reflow.
23
+ - Match affordances to keyboard, pointer and touch; use hover as enhancement, not the sole way to reveal an action. Test mixed-input devices and preserve Tab order and focus across presentation changes.
24
+ - Handle mobile browser chrome with supported dynamic viewport units (for example `dvh` for an available-height layout) and a compatible fallback; treat on-screen keyboard occlusion as a separate runtime check. Use safe-area insets as applicable and make constrained regions scroll rather than clipping or locking the whole page. Verify the control that has focus can still be reached visually.
25
+ - Test the actual primary task in each distinct layout. Check touch, mouse and keyboard where relevant; include long content/text scaling, keyboard-open state for forms, and orientation/resize mid-task. Label an emulated browser viewport separately from touch hardware, hinge or browser-chrome evidence.
@@ -0,0 +1,61 @@
1
+ # Angular
2
+
3
+ ## Token mapping
4
+
5
+ Import generated CSS variables in global styles and expose semantic roles through design-system components rather than copying values into decorators:
6
+
7
+ ```scss
8
+ @import './tokens.css';
9
+ ```
10
+
11
+ Angular component encapsulation is useful for state variants, not a substitute for global semantic token ownership.
12
+
13
+ ## Layout and responsive idioms
14
+
15
+ Use route-level layouts/components plus CSS grid/flex/container queries. Angular CDK layout utilities can help but should not hide simple CSS. Standalone components/imports make ownership explicit; avoid deep wrapper hierarchies that exist only for styling.
16
+
17
+ ## Typography/custom fonts
18
+
19
+ Load fonts globally with preload/fallback policy. Use typographic classes/component roles rather than inline repeated typography. Verify text scaling because enterprise density often encourages fixed-height clipping.
20
+
21
+ ## Motion/reduced motion
22
+
23
+ Angular animations (`@angular/animations`) should encode meaningful state transitions. Use the platform/browser reduction signal through CSS media queries or runtime service reading `matchMedia`; do not build motion assuming every user sees it. Keep animations interruptible.
24
+
25
+ ## Accessibility specifics
26
+
27
+ Prefer native HTML controls or Angular CDK/Material components with correct configuration. CDK a11y tools (focus trap, live announcer, list key manager, a11y module) must be wired correctly; importing them is not evidence. Route focus/heading management is application responsibility. Reactive forms still require visible persistent labels and accessible error association.
28
+
29
+ ## States idiom
30
+
31
+ Model async state explicitly with signals/observables: loading, refreshing, loaded-empty, loaded-partial, error, offline/stale, mutation pending, rollback. Do not unwrap async values into blank undefined states. HTTP interceptors must not swallow user-facing error context.
32
+
33
+ ## Forms idiom
34
+
35
+ Reactive forms provide validation timing/control state (`touched`, `dirty`, `invalid`, async pending) but UX copy/recovery still must be designed. Use correct native input attributes/autocomplete/inputmode. Preserve form model/input after submit failure and expose validation summary for complex flows.
36
+
37
+ ## Do/don't pairs
38
+
39
+ | Do | Don't |
40
+ |---|---|
41
+ | `<a [routerLink]="['/invoice', id]">View invoice</a>` | `<div (click)="router.navigate(['/invoice', id])">View invoice</div>` |
42
+ | `cdkFocusInitial`/explicit focus strategy in dialog | autofocusing the first field regardless of task/safety |
43
+ | semantic token-backed component variants | copying hex constants into each component stylesheet |
44
+ | validation after blur/submit using control state | marking untouched fields red on initial render |
45
+ | typed error state rendered adjacent to control | toast-only validation feedback that disappears before correction |
46
+
47
+ ## Known traps
48
+
49
+ Change-detection misunderstanding, subscription leaks, stale async state, zoneless/signal migration confusion, deep provider hierarchy hiding ownership, focus traps that never release, enterprise fixed-density clipping, Angular Material defaults mistaken for project direction.
50
+
51
+ ## Verification commands
52
+
53
+ ```sh
54
+ npm run lint
55
+ npm run test -- --watch=false
56
+ npm run build
57
+ npx playwright test
58
+ npx ng test --watch=false 2>/dev/null || true
59
+ ```
60
+
61
+ Use browser/device inspection for actual rendering and interaction evidence.
@@ -0,0 +1,62 @@
1
+ # Astro
2
+
3
+ ## Token mapping
4
+
5
+ Import generated CSS variables in a shared layout or global stylesheet:
6
+
7
+ ```astro
8
+ ---
9
+ import '../styles/tokens.css';
10
+ ---
11
+ ```
12
+
13
+ Use semantic variables in static CSS and pass only semantic names/roles into hydrated islands. Do not ship tokens repeatedly inside every island bundle.
14
+
15
+ ## Layout and responsive idioms
16
+
17
+ Astro's strength is content-first static rendering with selective islands. Keep navigation/article/content composition server-rendered; use framework islands only where interaction is required. Layouts own shell structure; pages own content. Use CSS grid/container queries/measure rather than hydrating layout that does not need JS.
18
+
19
+ ## Typography/custom fonts
20
+
21
+ Static rendering makes font loading visible immediately: use explicit font-face/head preload/fallback policy and subset scripts carefully. Do not load display fonts needed only in one island globally unless reuse justifies cost.
22
+
23
+ ## Motion/reduced motion
24
+
25
+ Use CSS motion for static/semantic transitions. In client directives (`client:load`, `client:visible`, etc.), initialize JS motion only in the island and honor `prefers-reduced-motion`. Prefer `client:visible`/idle loading for nonessential animated/effects islands.
26
+
27
+ ## Accessibility specifics
28
+
29
+ Static HTML must be correct before hydration. Islands need real controls, labels, focus behavior, and route/navigation semantics. View transitions must preserve focus/order and reduced-motion expectations. Do not use client directives to delay critical semantic content unnecessarily.
30
+
31
+ ## States idiom
32
+
33
+ Static content has fewer runtime states by design; dynamic data states belong in server endpoints/islands. Render empty/error/loading explicitly in the island and make form submission progressively enhanced where possible. Content collections need empty/missing-draft/frontmatter validation behavior.
34
+
35
+ ## Forms idiom
36
+
37
+ Native forms and server actions/endpoints can provide baseline behavior. Use labels/input types/autocomplete and preserve values across failed submission. Hydrated validation is enhancement, not the only path.
38
+
39
+ ## Do/don't pairs
40
+
41
+ | Do | Don't |
42
+ |---|---|
43
+ | static article/navigation markup plus `<Search client:visible />` | hydrating the entire marketing/docs page because one control exists |
44
+ | `<a href="/docs/tokens">Design tokens</a>` | click-only navigation inside a framework island |
45
+ | scoped island for genuinely interactive visual effect | animated background island blocking primary content rendering |
46
+ | semantic heading/content order in `.astro` layout | relying on client JS to construct basic document structure |
47
+ | stable fallback sized like final island | blank layout-shifting island placeholder |
48
+
49
+ ## Known traps
50
+
51
+ Too many client directives, duplicated framework renderers, island boundary duplication, stale static content mistaken for live state, view-transition focus loss, content collection schema drift, partial hydration hiding interaction cost, image/asset priority mistakes.
52
+
53
+ ## Verification commands
54
+
55
+ ```sh
56
+ npm run check
57
+ npm run build
58
+ npm run test -- --run
59
+ npx playwright test
60
+ ```
61
+
62
+ Inspect generated HTML as static evidence and browser behavior/hydration as rendered evidence.
@@ -0,0 +1,53 @@
1
+ # ClojureScript: Reagent and re-frame
2
+
3
+ ## Token mapping
4
+
5
+ Emit CSS variables/semantic classes and consume them in hiccup/Reagent components. Keep visual constants in CSS/theme assets; do not scatter hex/style maps through every view. Ratoms/re-frame subscriptions may control theme class selection at the root.
6
+
7
+ ## Layout and responsive idioms
8
+
9
+ Reagent produces React-powered DOM. Use ordinary semantic HTML/CSS layout; Reagent components should expose composition without hiding markup semantics. re-frame owns event/subscription flow, not visual layout truth.
10
+
11
+ ## Typography/custom fonts
12
+
13
+ Configure fonts in static CSS/HTML and map semantic type classes. Verify keyword/class naming, fallback, scaling, localization expansion, and hydration/initial render behavior.
14
+
15
+ ## Motion/reduced motion
16
+
17
+ Use CSS or deliberate React-compatible animation libraries only when needed. Read `prefers-reduced-motion` through CSS or browser interop/subscription; do not trigger animation purely because a ratom changed.
18
+
19
+ ## Accessibility specifics
20
+
21
+ Hiccup keywords can generate semantic elements and ARIA attributes, but nothing enforces them. Use labels/roles/names, visible focus, keyboard events, focus restoration after mutation/dialog close, and browser validation semantics. Avoid div-click handlers.
22
+
23
+ ## States idiom
24
+
25
+ re-frame app-db should model async state explicitly rather than isolated booleans: idle/loading/success-empty/success-partial/error/offline/permission/stale/optimistic. Subscriptions must expose enough state for empty/error/recovery UX without leaking secrets.
26
+
27
+ ## Forms idiom
28
+
29
+ Use real forms/labels/input types/autocomplete/inputmode. Controlled inputs need careful cursor/IME behavior; preserve values after failed submit and map server validation back to fields. Do not block paste or turn every keystroke into destructive validation.
30
+
31
+ ## Do/don't pairs
32
+
33
+ | Do | Don't |
34
+ |---|---|
35
+ | `[:label {:for "email"} "Email"]` | placeholder-only input |
36
+ | `[:button {:type "submit"} "Save invoice"]` | `[:div {:on-click …}]` as a button |
37
+ | explicit async state in app-db | unrelated booleans hiding empty/error/loading conflict |
38
+ | focus restoration event | focus lost when reagent rerenders |
39
+
40
+ ## Known traps
41
+
42
+ Stale subscriptions, enormous untyped app-db shape, keyword typos invisible to compile, rerender focus/caret loss, copy-paste React assumptions without understanding re-frame ownership, inaccessible component libraries.
43
+
44
+ ## Verification commands
45
+
46
+ ```sh
47
+ clojure -M:test
48
+ npx shadow-cljs compile app
49
+ npx shadow-cljs watch app
50
+ npx playwright test
51
+ ```
52
+
53
+ Inspect DOM/accessibility tree, keyboard/focus behavior, hot-reload versus production output, offline/server errors, reduced motion, localization/text scaling.
@@ -0,0 +1,53 @@
1
+ # Elm
2
+
3
+ ## Token mapping
4
+
5
+ Use generated CSS variables and semantic HTML classes; Elm views should consume meaning (`ui-action-primary`) rather than hard-code colors. Shared constants can exist in Elm for dynamic behavior, but visual source of truth belongs in CSS/theme assets.
6
+
7
+ ## Layout and responsive idioms
8
+
9
+ Elm architecture is Model–Update–View. Use `Browser.element/document/application` according to ownership; use real HTML and CSS responsive layout rather than measuring viewport in Elm unless interaction truly depends on it. Route state belongs in URL/model for application pages.
10
+
11
+ ## Typography/custom fonts
12
+
13
+ Load fonts through static HTML/CSS with subsets/fallbacks. Keep text scaling and long localized strings fluid; compile-time type safety does not prevent clipping.
14
+
15
+ ## Motion/reduced motion
16
+
17
+ Prefer CSS transitions/animations and `@media (prefers-reduced-motion: reduce)`. Use ports/subscription to media query only when motion behavior must affect Elm state. Keep animation completion out of correctness-critical state transitions.
18
+
19
+ ## Accessibility specifics
20
+
21
+ Use `Html`, `Html.Attributes` and semantic elements; ARIA only where HTML cannot express meaning. Manage focus explicitly through `Browser.Dom.focus` tasks after route/dialog/list mutation. Elm's virtual DOM does not automatically produce names, roles, landmarks, or focus order.
22
+
23
+ ## States idiom
24
+
25
+ Model impossible states precisely: remote data as `NotAsked/Loading/Success/Failure` or richer state. Cover empty, partial, offline, unauthorized, optimistic rollback, retry, deep-link restore, and stale data in the model rather than ad hoc booleans.
26
+
27
+ ## Forms idiom
28
+
29
+ Use forms/labels/types/autocomplete/inputmode and preserve model input on failed validation/server submit. Validate at appropriate blur/submit boundaries; server errors map back to fields without clearing input. Use ports only when native browser behavior truly cannot do the job.
30
+
31
+ ## Do/don't pairs
32
+
33
+ | Do | Don't |
34
+ |---|---|
35
+ | `Html.label [ for "email" ] [ text "Email" ]` | unlabeled placeholder-only input |
36
+ | explicit `RemoteData` branches | nested Bool/Maybe soup with impossible states |
37
+ | `Browser.Dom.focus` after dialog opens | leaving focus in deleted virtual DOM |
38
+ | CSS reduced-motion media query | timer-driven decorative motion by default |
39
+
40
+ ## Known traps
41
+
42
+ Focus tasks requiring element IDs, ports bypassing Elm invariants, URL/model drift, inaccessible custom widgets, over-modeling visual state, runtime decoder failure causing blank/error screens, test-only happy paths.
43
+
44
+ ## Verification commands
45
+
46
+ ```sh
47
+ elm make src/Main.elm
48
+ elm-test
49
+ elm-review
50
+ npx playwright test
51
+ ```
52
+
53
+ Inspect browser rendering, keyboard/focus flow, route/deep-link restore, offline/server failure, screen reader semantics, text scaling, and reduced-motion emulation.
@@ -0,0 +1,53 @@
1
+ # F# Fable: Feliz/Elmish
2
+
3
+ ## Token mapping
4
+
5
+ Use generated CSS variables/semantic classes through Feliz props or imported stylesheets. Keep theme selection in typed domain state when behavior depends on it, but do not duplicate visual constants as untraceable inline F# style lists.
6
+
7
+ ## Layout and responsive idioms
8
+
9
+ Feliz compiles F# to React/browser DOM. Use semantic HTML/CSS layout and explicit responsive behavior. Elmish Model–Update–Msg architecture owns application state; visual composition remains DOM truth.
10
+
11
+ ## Typography/custom fonts
12
+
13
+ Declare webfonts/assets in host HTML/CSS and use semantic classes. Type-safe CSS helpers help correctness but do not choose a voice, fallback chain, scaling behavior, or localization coverage for you.
14
+
15
+ ## Motion/reduced motion
16
+
17
+ Prefer CSS with `@media (prefers-reduced-motion: reduce)`. Use Fable browser interop (`Browser.Dom.window.matchMedia`) only when animation state must depend on the preference. Keep effectful subscriptions explicit in Elmish commands/subs.
18
+
19
+ ## Accessibility specifics
20
+
21
+ Feliz emits React elements; use semantic tags, labels, keyboard handlers, focus management, ARIA only when needed, and visible focus. F# type safety does not verify names/roles or prevent focus loss. Validate generated DOM rather than inferring from types.
22
+
23
+ ## States idiom
24
+
25
+ Elmish excels at explicit state machines. Model loading/empty/error/offline/permission/optimistic state in domain types and reject impossible combinations. Preserve input and validation context across failed commands/navigation.
26
+
27
+ ## Forms idiom
28
+
29
+ Use real forms/labels/types/autocomplete/inputmode and controlled input patterns that preserve cursor/IME composition. Validate at blur/submit boundaries, map server errors to fields, and never discard model input because a command failed.
30
+
31
+ ## Do/don't pairs
32
+
33
+ | Do | Don't |
34
+ |---|---|
35
+ | `Html.button [ prop.type' "submit"; prop.text "Save" ]` | clickable div with no keyboard semantics |
36
+ | explicit Elmish async union states | bool/Maybe combinations permitting impossible UI |
37
+ | `window.matchMedia` reduced-motion check | assuming React/Fable reads OS preference automatically |
38
+ | semantic CSS classes | long repeated inline style lists in every component |
39
+
40
+ ## Known traps
41
+
42
+ Interop impedance mismatch, bundle splitting/startup, typed model divergence from actual server contract, hot reload hiding initialization bugs, focus/caret behavior in controlled inputs, inaccessible imported React components.
43
+
44
+ ## Verification commands
45
+
46
+ ```sh
47
+ dotnet test
48
+ dotnet fable watch src --run webpack
49
+ npm test
50
+ npx playwright test
51
+ ```
52
+
53
+ Inspect generated DOM/accessibility tree, browser keyboard/focus behavior, offline/server failure, text scaling/localization, reduced-motion emulation, production bundle behavior.
@@ -0,0 +1,88 @@
1
+ # HTML + CSS
2
+
3
+ Evidence: WCAG 2.2, logical properties.
4
+
5
+ ## Token mapping
6
+
7
+ Use generated CSS variables verbatim in a semantic layer:
8
+
9
+ ```css
10
+ @import "./tokens.css";
11
+ :root { color-scheme: light dark; }
12
+ body { background: var(--semantic-color-background); color: var(--semantic-color-foreground); }
13
+ ```
14
+
15
+ Do not bypass semantic roles with primitive color variables in component rules. Keep primitive scales available for charts/illustration only.
16
+
17
+ ## Layout and responsive idioms
18
+
19
+ Use semantic HTML structure first, then CSS Grid for two-dimensional composition, flexbox for one-dimensional groups, container queries for component adaptation, and logical properties for direction-sensitive spacing. Prefer `clamp()` and intrinsic sizing over hard breakpoints alone. Restructure at narrow widths rather than scaling a desktop mockup.
20
+
21
+ For an editorial or commerce shell, separate the primary task or active state from the destination index. If inline navigation becomes a disclosure on touch, consider keeping booking, a cart count, or the current chapter exposed outside it. Keep the same destination and state across layouts. Test the closed and open menu at phone portrait and landscape: reach the primary action, dismiss the menu with the supported inputs, and confirm focus returns to its trigger. If the scene cannot fit in a shallow viewport, use a purposeful crop or a static composition instead of burying the action below empty scene space.
22
+
23
+ ## Typography/custom fonts
24
+
25
+ Use `font-face` with `font-display: swap` or `optional` deliberately, preload only critical fonts, set metric overrides/fallbacks where needed, and use system fonts when platform fit/performance matters. Control measure with `max-inline-size: 65ch`–`75ch` rather than arbitrary containers.
26
+
27
+ ## Motion/reduced motion
28
+
29
+ Use CSS transitions/animations only for purposeful transform/opacity/state change. Gate motion:
30
+
31
+ ```css
32
+ @media (prefers-reduced-motion: no-preference) {
33
+ .panel { transition: opacity 160ms ease-out, translate 160ms ease-out; }
34
+ }
35
+ ```
36
+
37
+ JavaScript should query `matchMedia('(prefers-reduced-motion: reduce)')` when motion is imperative.
38
+
39
+ If a static poster replaces a decorative scene, make that decision before starting its JS, video, or GPU work when the task does not need it. Keep the poster and live semantic content independent of the scene bundle. A small or reduced-motion layout that looks static can still download and initialize the desktop effect.
40
+
41
+ ## Modern browser-native craft idioms
42
+
43
+ Use progressive, zero-dependency CSS capabilities before importing JS animation or layout libraries:
44
+
45
+ - **Discrete entry/exit transitions**: combine `@starting-style` and `transition-behavior: allow-discrete` for native `<dialog>`, `[popover]`, and disclosure reveals so overlays animate smoothly without JS choreography and degrade cleanly when unsupported.
46
+ - **Scroll-driven progress**: gate `animation-timeline: view()` / `scroll()` behind both `@supports (animation-timeline: view())` and `@media (prefers-reduced-motion: no-preference)`; keep the final layout readable without animation.
47
+ - **Typographic rag polish**: apply `text-wrap: balance` on short headings/callouts and `text-wrap: pretty` on body paragraphs to prevent awkward single-word orphans.
48
+ - **Viewport & scrollbar stability**: prefer `svh`/`dvh` over `100vh` on mobile and `scrollbar-gutter: stable` on scrolling regions to prevent horizontal jump when content toggles overflow.
49
+ - **Self-adapting components**: use `container-type: inline-size` with `@container` queries for cards, sidebars, and dense toolbars so components respond to their actual slot width rather than assuming global viewport breakpoints.
50
+
51
+ ## Accessibility specifics
52
+
53
+ Native elements carry most semantics: `button`, `a`, `form`, `label`, `input`, `select`, `table`, headings, landmarks. Do not use positive `tabindex`; use DOM order. Use `dialog`/popover/inert patterns carefully and restore focus. Validate names/roles/status behavior in the accessibility tree.
54
+
55
+ ## States idiom
56
+
57
+ Use real elements/classes and server/client state consistently: `hidden`, `disabled`, `aria-disabled` only when focus must remain, `role="status"` for nonintrusive async completion, skeleton containers with stable dimensions, and explicit empty/error markup rather than blank containers.
58
+
59
+ ## Forms idiom
60
+
61
+ Use one persistent `label`, correct `type`, `inputmode`, `autocomplete`, spellcheck/autocapitalize settings, constraint validation only where appropriate, and server error association through text near the field plus summary for complex forms. Never block paste.
62
+
63
+ ## Do/don't pairs
64
+
65
+ | Do | Don't |
66
+ |---|---|
67
+ | `<button type="button">Save draft</button>` | `<div onclick="save()">Save draft</div>` |
68
+ | `margin-inline-start: var(--space-4);` | `margin-left: var(--space-4);` for direction-neutral layout |
69
+ | `@media (prefers-reduced-motion: reduce) { * { animation: none } }` plus intentional state equivalents | deleting focus/state feedback entirely in reduced mode |
70
+ | `<label for="email">Email</label><input id="email" autocomplete="email">` | `<input placeholder="Email">` as the only label |
71
+ | `grid-template-columns: minmax(0, 1fr) minmax(16rem, 24rem);` | fixed pixel columns that overflow/clip localized content |
72
+
73
+ ## Known traps
74
+
75
+ `100vh` on mobile browsers, sticky/fixed chrome obscuring focus, container query support assumptions, specificity wars caused by utility layering, autofocus as a substitute for flow design, duplicated IDs from reused fragments, CSS nesting support differences, logical/physical mismatch in charts and media controls.
76
+
77
+ ## Verification commands
78
+
79
+ Use the project's actual toolchain; typical commands:
80
+
81
+ ```sh
82
+ npx playwright test
83
+ npx axe <url-or-file>
84
+ npx lighthouse <url> --only-categories=accessibility,performance
85
+ npm run test -- --run
86
+ ```
87
+
88
+ Rendered evidence requires a real browser/device or trace/screenshot inspection, not merely a successful build.
@@ -0,0 +1,53 @@
1
+ # htmx + Alpine.js
2
+
3
+ ## Token mapping
4
+
5
+ Import generated CSS variables in the base template. Because htmx swaps server-generated fragments, semantic CSS must apply consistently to both full pages and partial responses. Alpine state should reference semantic classes rather than embedding ad hoc hex/style values.
6
+
7
+ ## Layout and responsive idioms
8
+
9
+ Server-driven hypermedia is a feature: design coherent full pages first, then partial enhancement. Use CSS for layout. htmx targets/swaps must preserve shell structure, scroll behavior, focus, headings, and meaningful URLs where appropriate. Alpine belongs to local interaction state, not application architecture by accident.
10
+
11
+ ## Typography/custom fonts
12
+
13
+ Load fonts once in the base template. Partial responses inherit them; do not inject duplicate font/link tags through fragments. Maintain reading measure in server templates regardless of enhancement.
14
+
15
+ ## Motion/reduced motion
16
+
17
+ Use CSS transitions/classes for swap/settle states. htmx transition behavior and Alpine `x-transition` must respect `prefers-reduced-motion`. Avoid animating replacement in a way that hides content reordering or focus jumps.
18
+
19
+ ## Accessibility specifics
20
+
21
+ Fragments must contain valid, complete semantics in context: labels, headings, buttons/links, live regions where needed. Manage focus after `hx-swap`, especially when replacing the triggering element. Use `hx-boost`/links/forms to preserve baseline navigation. Alpine `x-cloak` avoids flash-of-uninitialized behavior but must not hide content permanently if JS fails.
22
+
23
+ ## States idiom
24
+
25
+ Use htmx indicator classes/request lifecycle to expose pending state; return real error/status fragments from the server. Include empty/no-result/partial/error states in fragment templates. Preserve input on validation failure. Out-of-band swaps need clear ownership and no duplicated IDs.
26
+
27
+ ## Forms idiom
28
+
29
+ Native form semantics are the baseline. `hx-post`/`hx-put` enhance rather than replace valid action/method behavior where feasible. Correct labels/autocomplete/inputmode remain server template responsibilities. Validation timing belongs server-side plus careful local hints; don't validate every keystroke.
30
+
31
+ ## Do/don't pairs
32
+
33
+ | Do | Don't |
34
+ |---|---|
35
+ | `<a href="/invoices" hx-boost>Invoices</a>` | `<span hx-get="/invoices">Invoices</span>` pretending to be navigation |
36
+ | render validation fragment with preserved values | returning only `422` with a generic toast |
37
+ | explicit `hx-target`/`hx-swap` ownership | replacing large page regions because targeting was never designed |
38
+ | visible `htmx-indicator` plus duplicate-submit protection | silent background mutation with no pending state |
39
+ | stable ID ownership across full/partial render | duplicated IDs after fragment insertion |
40
+
41
+ ## Known traps
42
+
43
+ Invalid nested/interleaved HTML after swaps, focus disappearing with replaced trigger, duplicated IDs/live regions, hidden state divergence between URL and DOM, overuse of polling, Alpine x-data scope confusion, CSP/inline-script restrictions, no-JS baseline accidentally broken.
44
+
45
+ ## Verification commands
46
+
47
+ Run the owning server framework's test suite and browser E2E suite without suppressing failures:
48
+
49
+ ```sh
50
+ npm test && npx playwright test
51
+ ```
52
+
53
+ Test both no-JS/full-page behavior and enhanced fragment behavior; they are separate evidence.
@@ -0,0 +1,52 @@
1
+ # Java web: Vaadin and Thymeleaf
2
+
3
+ ## Token mapping
4
+
5
+ Vaadin: map tokens to Lumo/custom CSS properties (`--lumo-primary-color`, application semantic variables) and theme folders; do not restyle every component instance. Thymeleaf: use generated CSS variables/semantic classes in templates. Keep server constants synchronized through token export rather than copying hex into Java/templates.
6
+
7
+ ## Layout and responsive idioms
8
+
9
+ Vaadin Flow routes/layouts produce real web components but need responsive CSS/viewport design. Thymeleaf is server-rendered HTML: use progressive enhancement, semantic markup, template fragments, and standard browser layout. Choose based on application interaction depth, team Java ownership, SEO/initial-load needs—not because Java is familiar.
10
+
11
+ ## Typography/custom fonts
12
+
13
+ Load fonts through static/theme CSS with fallback/subsetting. Vaadin theme typography should use documented custom properties; Thymeleaf remains ordinary CSS. Verify scaling/localization in actual browser.
14
+
15
+ ## Motion/reduced motion
16
+
17
+ Use CSS `@media (prefers-reduced-motion: reduce)`. Vaadin component animation coverage varies by component/version, so inspect actual overlays/progress/dialog behavior and add reduced-motion overrides in the application theme. Thymeleaf has no motion model beyond browser/CSS/JS.
18
+
19
+ ## Accessibility specifics
20
+
21
+ Vaadin states WCAG-oriented component support for current versions, but application composition can still break labels, landmarks, focus order, dialogs, grids, and screen-reader flow. Thymeleaf accessibility is exactly the emitted HTML. Manage server round-trip focus/error summary and keyboard behavior.
22
+
23
+ ## States idiom
24
+
25
+ Vaadin: model loading/error/empty/permission/offline/push/session expiration explicitly; never leave dead UI after session disconnect. Thymeleaf: use HTTP semantics, redirects/flashes/form errors, no-js fallback, empty/error templates, and idempotency. Preserve deep links and scroll/back behavior.
26
+
27
+ ## Forms idiom
28
+
29
+ Vaadin Binder/validators need labels, required indicators independent of color, validation timing, server error recovery, input preservation, autocomplete/inputmode equivalents where available. Thymeleaf uses native form semantics and constraint validation plus server-side field errors.
30
+
31
+ ## Do/don't pairs
32
+
33
+ | Do | Don't |
34
+ |---|---|
35
+ | Vaadin `new Button("Save invoice")` | click listener on layout/div |
36
+ | semantic theme variables | per-instance inline colors everywhere |
37
+ | Thymeleaf `<label for="email">` | placeholder-only form fields |
38
+ | explicit session-expired state | dead controls after disconnect |
39
+
40
+ ## Known traps
41
+
42
+ Vaadin version/theme breaking changes, session timeout/push behavior, grid density/accessibility, blocking server round trips, treating Thymeleaf as incapable of modern UX, CSRF/security regression while polishing forms, JavaScript interop ownership conflicts.
43
+
44
+ ## Verification commands
45
+
46
+ ```sh
47
+ ./mvnw verify
48
+ ./gradlew test build
49
+ npx playwright test
50
+ ```
51
+
52
+ Inspect browser DOM/accessibility tree, session expiry/offline/push interruption, keyboard/focus order, screen readers where required, reduced motion, responsive/zoom/localization behavior.
@@ -0,0 +1,53 @@
1
+ # Kotlin web: Compose Multiplatform Web and Kobweb
2
+
3
+ ## Token mapping
4
+
5
+ Kobweb uses Compose HTML/DOM concepts and Silk-style theme objects/CSS variables; map DTCG output into semantic theme singletons plus generated CSS. Compose Multiplatform Web may draw through its own rendering pipeline/canvas depending mode; decide whether DOM semantics or shared Compose rendering is intentional before styling.
6
+
7
+ ## Layout and responsive idioms
8
+
9
+ Kobweb/Compose HTML: use real CSS grid/flex/media/container queries and semantic elements. Compose Web canvas: shared modifiers/layouts can reuse mobile knowledge but browser text selection, semantics, zoom, and deep links require explicit validation.
10
+
11
+ ## Typography/custom fonts
12
+
13
+ Register webfont assets/stylesheet and map semantic type roles in Kotlin theme. Never assume mobile font assets behave identically in browser; verify fallback, FOUT/CLS, scaling, localization glyphs.
14
+
15
+ ## Motion/reduced motion
16
+
17
+ Use CSS media queries in DOM mode. In Kotlin/browser interop read `window.matchMedia("(prefers-reduced-motion: reduce)")`; gate Compose animation specs/canvas effects accordingly. SSR or first paint must not depend on animation completion.
18
+
19
+ ## Accessibility specifics
20
+
21
+ DOM-mode Kobweb can produce semantic HTML—use real tags/labels. Canvas-rendered Compose Web may expose weaker browser accessibility depending target/version; do not claim screen-reader parity without testing the actual rendering mode. Manage focus/routes and keyboard interaction.
22
+
23
+ ## States idiom
24
+
25
+ Model routing, loading/error/empty/offline/permission states in Kotlin state holders. Keep URLs/deep links meaningful. Preserve input across navigation/server failure and avoid blank canvas while static content could render.
26
+
27
+ ## Forms idiom
28
+
29
+ In DOM mode use `<form>`, labels, autocomplete/inputmode, constraint validation and server round-trip errors. In canvas/shared Compose mode verify paste, IME composition, keyboard type, focus traversal, browser autofill limitations, and validation timing honestly.
30
+
31
+ ## Do/don't pairs
32
+
33
+ | Do | Don't |
34
+ |---|---|
35
+ | choose Kobweb DOM for semantic content/forms | choosing canvas Compose merely to reuse mobile code |
36
+ | `window.matchMedia("(prefers-reduced-motion: reduce)")` | assuming Compose honors web reduced motion automatically |
37
+ | semantic Kotlin theme object | scattered `Color(0xff…)` constants |
38
+ | real URL/form fallback | blank WASM canvas with no useful failure state |
39
+
40
+ ## Known traps
41
+
42
+ Confusing Compose HTML with canvas Compose UI, bundle size/startup, browser semantics loss, SEO/deep-link gaps, duplicate routing ownership, font/glyph mismatch, thinking Kotlin type safety implies accessibility.
43
+
44
+ ## Verification commands
45
+
46
+ ```sh
47
+ ./gradlew build
48
+ ./gradlew jsBrowserTest
49
+ ./gradlew jsBrowserDevelopmentRun
50
+ npx playwright test
51
+ ```
52
+
53
+ Inspect initial HTML/DOM versus canvas pixels, keyboard/focus/accessibility tree, network failure, bundle size, browser zoom/text scaling, reduced motion, back/deep-link behavior.