@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,62 @@
1
+ # Rich
2
+
3
+ Rich is primarily a rendering/output library, not a complete interactive application framework. Use it for structured terminal output, logs, tables, panels, progress, syntax, markdown, prompts-adjacent display, and live dashboards when scope is limited.
4
+
5
+ ## Token mapping
6
+
7
+ Define semantic style constants centrally:
8
+
9
+ ```python
10
+ PC_STYLES = {"action": "bold #0074ca", "error": "bold red"}
11
+ ```
12
+
13
+ Use named styles/themes rather than repeating raw color strings. Rich markup style names should express meaning (`error`, `muted`, `action`), not appearance-only chaos.
14
+
15
+ ## Layout and responsive idioms
16
+
17
+ Use console width detection, tables/columns/panels/padding deliberately, soft wrapping/overflow settings, and avoid fixed-width ASCII diagrams. Rich output must degrade when piped, narrow, redirected, or logged. Interactive full-screen behavior belongs more naturally in Textual.
18
+
19
+ ## Typography/custom fonts
20
+
21
+ Terminals control fonts. Use bold/dim/underline/reverse/color as hierarchy. Never rely on exact font or glyph width. Use text alternatives for box glyphs/emoji/sparklines.
22
+
23
+ ## Motion/reduced motion
24
+
25
+ Use progress/live display truthfully and sparingly. Avoid rapid refresh/flash. Honor noninteractive environments and consider `NO_COLOR`; motion reduction in terminals is environment-limited, so provide quiet/no-animation flags.
26
+
27
+ ## Accessibility specifics
28
+
29
+ Do not encode meaning only through color/style. stdout/stderr separation, plaintext fallback, screen-reader legibility of linear output, no cursor-address tricks in logs, and machine-readable mode where automation matters. Verify terminal capture behavior.
30
+
31
+ ## States idiom
32
+
33
+ Progress bars/spinners/status must reflect real work. Error panels should explain recovery, not just decorate tracebacks. Empty/no-results/offline/cancelled/interrupted states should be explicit text. Keyboard interrupt handling is UX-critical.
34
+
35
+ ## Forms idiom
36
+
37
+ Rich prompts/confirmations are linear CLI interaction, not full forms. Validate input with recovery copy, preserve prior value where possible, allow paste naturally, and provide noninteractive flags/environment variables for automation.
38
+
39
+ ## Do/don't pairs
40
+
41
+ | Do | Don't |
42
+ |---|---|
43
+ | named semantic style `style="error"` | raw color repeated everywhere |
44
+ | width-aware table/panel layout | fixed 120-column ASCII layout |
45
+ | explicit interrupted/cancelled message | silent partial output on Ctrl+C |
46
+ | stdout/stderr separation and plain mode | ANSI decoration in piped machine output |
47
+ | truthful progress percentage | decorative spinner hiding unknown/failed state |
48
+
49
+ ## Known traps
50
+
51
+ Markup escaping user content, width/Unicode mismatch, piped ANSI output, logs polluted by control sequences, live display flicker, nested live displays, color-only severity, huge tables overwhelming terminal scrollback.
52
+
53
+ ## Verification commands
54
+
55
+ ```sh
56
+ python -m pytest
57
+ python -m compileall .
58
+ python cli.py --help
59
+ NO_COLOR=1 python cli.py 2>/dev/null || true
60
+ ```
61
+
62
+ Inspect actual terminal output, piped output, width matrices, screen-reader/plaintext readability where relevant, interrupt behavior, and snapshot/golden text fixtures.
@@ -0,0 +1,67 @@
1
+ # Textual
2
+
3
+ Evidence: current docs confirm Textual CSS variables use `$name`; `pytest-textual-snapshot` provides the `snap_compare` fixture and SVG snapshot comparisons.
4
+
5
+ ## Token mapping
6
+
7
+ Use exported Textual variables directly:
8
+
9
+ ```tcss
10
+ $semantic-color-action: #0074ca;
11
+ $space-control-inline: 4px;
12
+
13
+ Button {
14
+ background: $semantic-color-action;
15
+ }
16
+ ```
17
+
18
+ Keep variables semantic and scoped intentionally. Do not hard-code repeated colors through TCSS/widget constructors when a variable can express the role.
19
+
20
+ ## Layout and responsive idioms
21
+
22
+ Use containers, grids/docks/horizontal/vertical layouts, fractional/percent/auto sizing, scrollable containers, focus chains, and terminal width/height adaptation. Design minimum dimensions such as 80×24 and define what collapses/disappears first.
23
+
24
+ ## Typography/custom fonts
25
+
26
+ Terminals control fonts. Use weight/style/color/underline/inverse and spacing as typography; never assume custom typefaces or exact glyph width. Unicode width/emoji/CJK behavior can differ by terminal/font.
27
+
28
+ ## Motion/reduced motion
29
+
30
+ Textual has animation/timer/refresh capabilities, but terminal motion should be sparse. Use reduced-motion/user configuration where platform support is uncertain. Avoid rapid flashing/full-screen refresh and prefer stable state changes.
31
+
32
+ ## Accessibility specifics
33
+
34
+ Keyboard-first bindings, visible focus, logical focus order, no color-only state, screen-reader-friendly text equivalents, `NO_COLOR`/low-color fallback, mouse optional. Do not use emoji/glyph-only critical meaning. Terminal accessibility depends on emulator/screen reader integration; verify what can actually be inspected.
35
+
36
+ ## States idiom
37
+
38
+ Use widgets/screens/modals/data state explicitness: loading/error/empty/offline/permission/worker progress/cancellation. Textual workers/tasks need cancellation/error propagation. Preserve input through screen changes and resize. Show disconnected/completed/failed state textually.
39
+
40
+ ## Forms idiom
41
+
42
+ Use real Input/TextArea/Select/Checkbox/Button widgets, validation timing, focus order, keybindings, paste behavior verification, visible error copy, and preservation across modal/navigation. Do not make Enter/Escape behavior ambiguous.
43
+
44
+ ## Do/don't pairs
45
+
46
+ | Do | Don't |
47
+ |---|---|
48
+ | semantic TCSS `$variables` | hex constants repeated in every widget/rule |
49
+ | keyboard `Binding` plus visible help/footer | hidden mouse-only interaction |
50
+ | worker cancellation/error state visible | background task silently failing |
51
+ | snapshot test at multiple widths | only manually glancing at one terminal size |
52
+ | plain text state plus color | color-only green/red status |
53
+
54
+ ## Known traps
55
+
56
+ Unicode width mismatch, terminal font assumptions, color capability variation, focus loss in modals/screens, worker lifecycle leaks, rapid repaint noise, overflow/truncation at narrow width, mouse support assumptions, TCSS specificity confusion.
57
+
58
+ ## Verification commands
59
+
60
+ ```sh
61
+ python -m pytest
62
+ pytest --snapshot-update # only when intentionally updating
63
+ python -m compileall .
64
+ python app.py 2>/dev/null || true
65
+ ```
66
+
67
+ Use `pytest-textual-snapshot` snapshots, actual terminal runs, narrow/wide matrices, `NO_COLOR`/TERM variations, keyboard-only flows, and piped/non-TTY behavior where relevant.
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: pixelcraft-ux
3
+ description: Designs rigorous user experience before and during implementation. Use for task analysis, JTBD, user flows, information architecture, navigation, forms, validation, empty/error/loading/offline states, feedback timing, perceived performance, cognitive-load reduction, localization-ready UX, UX writing, and interaction recovery across any frontend stack.
4
+ license: MIT
5
+ metadata:
6
+ version: 0.1.0
7
+ ---
8
+
9
+ # Pixelcraft UX
10
+
11
+ UX precedes styling. Establish user intent, task sequence, state coverage, and recovery before choosing components or visual decoration.
12
+
13
+ ## References
14
+
15
+ - Read [references/flows-ia.md](references/flows-ia.md) for JTBD, task analysis, flow shape, IA depth, entry points, deep links, and navigation conventions.
16
+ - Read [references/cognitive-walkthrough.md](references/cognitive-walkthrough.md) when judging first-use learnability or step-by-step task completion.
17
+ - Read [references/usability-testing.md](references/usability-testing.md) when behavioral uncertainty requires real-user evidence rather than inspection.
18
+ - Read [references/state-matrix.md](references/state-matrix.md) whenever data, network, permission, input, or async behavior exists.
19
+ - Read [references/forms.md](references/forms.md) for labels, validation, input preservation, autofill, paste, mobile keyboards, redundant entry, authentication, and error recovery.
20
+ - Read [references/feedback-performance.md](references/feedback-performance.md) for response-time limits, undo/destructive behavior, loading strategy, and perceived performance.
21
+ - Read [references/i18n.md](references/i18n.md) before layout/copy for multilingual, RTL, locale-format, name/address, plural/gender, or IME contexts.
22
+ - Read [references/locale-test-matrix.md](references/locale-test-matrix.md) when selecting concrete locales, scripts, fixtures, and rendering evidence for international verification.
23
+ - Read [references/ux-writing.md](references/ux-writing.md) for microcopy, actions, errors, empty states, and tone by mode.
24
+ - Read [references/laws.md](references/laws.md) when applying Hick, Fitts, Jakob, Doherty, recognition-over-recall, and cognitive-load evidence.
25
+
26
+ ## Required sequence
27
+
28
+ 1. **Define job:** actor, triggering situation, desired outcome, constraints, success signal, frequency, expertise, locale/accessibility needs.
29
+ 2. **Map task:** current steps, decision points, interruptions, handoffs, errors, and recovery. Remove steps before decorating them.
30
+ 3. **Walk the task:** use the cognitive-walkthrough contract for first-use intent, visibility, association, and feedback; escalate behavioral uncertainty to real-user evidence instead of inventing validation.
31
+ 4. **Shape flow/IA:** minimize depth and ambiguous branches; preserve context; make entry/deep-link state explicit.
32
+ 5. **Complete state matrix:** do not implement only the happy path.
33
+ 6. **Design interaction copy and feedback:** action language, timing, progress, undo/recovery.
34
+ 7. **Reduce cognitive load:** smart defaults, recognition, progressive disclosure, grouped decisions.
35
+ 8. **Validate against platform conventions:** back/escape, scroll restoration, shortcuts, gestures, focus/controller behavior.
36
+ 9. **Record unresolved UX risks** with evidence labels in the final Pixelcraft report.
37
+
38
+ ## Non-negotiable checks
39
+
40
+ - Do not ask for information already available, inferable, previously entered, or low-value at the moment of use.
41
+ - Preserve user input across validation, navigation, authentication expiry, network failure, and accidental refresh where feasible.
42
+ - Every destructive action provides proportional undo, confirmation, or explicit irreversibility friction.
43
+ - Every async action exposes pending/success/failure/cancellation/retry semantics.
44
+ - Navigation state survives back/forward, refresh, deep link, logout/login, and app relaunch as appropriate.
45
+ - Primary tasks are operable without hover, memory of hidden commands, perfect network, or precise pointer control.
46
+ - Copy names the user's goal and next action; never blame the user.
@@ -0,0 +1,70 @@
1
+ # Cognitive walkthrough
2
+
3
+ Use this reference to evaluate whether a first-time user can learn and complete a task without training or hidden knowledge. It is an inspection method, not a substitute for observing real users.
4
+
5
+ ## Setup contract
6
+
7
+ Before walking steps, record:
8
+
9
+ 1. **Actor/persona hypothesis:** role, expertise, language/locale, accessibility needs, device/input modality, interruption context.
10
+ 2. **Task:** exact goal in user terms, not a feature name.
11
+ 3. **Correct action sequence:** the shortest successful path, including decisions, system feedback, recovery, and completion.
12
+ 4. **Evidence boundary:** prototype, implementation, static specification, or rendered surface.
13
+
14
+ Do not use a persona as proof of user behavior. Label it a hypothesis and include evidence class (`user-provided`, `analytics/research`, `assumption`, or `unknown`).
15
+
16
+ ## Stepwise inspection
17
+
18
+ For every action in the correct sequence, answer four questions:
19
+
20
+ | Question | Failure examples |
21
+ |---|---|
22
+ | Will the user try to achieve the right effect? | user does not know this step is necessary; feature framing does not match their goal |
23
+ | Will the user notice the correct action/control? | hidden navigation, ambiguous icon, low contrast, action outside expected scan/input region |
24
+ | Will the user associate the action with the intended effect? | label describes implementation rather than outcome; control placement contradicts mental model |
25
+ | If the action is taken, will feedback show progress toward the goal? | no acknowledgment, delayed/ambiguous state, success/error unclear, input lost |
26
+
27
+ A “yes” must cite observable UI evidence: visible label, proximity, conventional placement, feedback text/state, or platform idiom. “Users will figure it out” is not evidence.
28
+
29
+ ## Walkthrough record
30
+
31
+ ```markdown
32
+ | Step | User goal at step | Correct action | Q1 intent | Q2 notice | Q3 association | Q4 feedback | Finding/evidence |
33
+ |---|---|---|---|---|---|---|---|
34
+ | 1 | | | pass/risk/fail/not-checked | | | | |
35
+ ```
36
+
37
+ Record confidence and evidence label for each important judgment. Distinguish:
38
+
39
+ - **failure:** the interface blocks or misleads the correct action;
40
+ - **risk:** ambiguity depends on knowledge/context not yet validated;
41
+ - **assumption:** missing persona/task evidence;
42
+ - **positive confirmation:** concrete cue supports learnability.
43
+
44
+ ## Required inspection passes
45
+
46
+ Run the walkthrough at least once for:
47
+
48
+ - first use with no prior product knowledge;
49
+ - returning use after interruption where state matters;
50
+ - error/recovery path for the highest-cost failure;
51
+ - accessibility/input-modality path relevant to the audience (keyboard, screen reader, touch, controller, IME/voice where applicable);
52
+ - non-English/RTL or expanded-text path when localization is in scope.
53
+
54
+ For expert/high-frequency interfaces, evaluate both initial learnability and efficient repeated use. Do not excuse a confusing first use solely because training exists unless training is part of the actual product context.
55
+
56
+ ## Common failure patterns
57
+
58
+ - actions named after system objects rather than user outcomes;
59
+ - progressive disclosure that hides the only path forward;
60
+ - success feedback identical to neutral state;
61
+ - focus/scroll position moving without explanation;
62
+ - destructive or irreversible consequence revealed only after commitment;
63
+ - required conceptual knowledge present nowhere in the interface or onboarding;
64
+ - recovery path requiring memory of a previous screen;
65
+ - translated text pushing the action outside the visible/focusable region;
66
+ - confirmation dialogs used as a substitute for clear action labeling.
67
+
68
+ ## Output and escalation
69
+
70
+ Report blockers/risks in task order with concrete repair suggestions. If the walkthrough depends on uncertain user knowledge, task frequency, domain vocabulary, or environmental constraints, escalate to lightweight usability testing rather than treating model judgment as validation.
@@ -0,0 +1,30 @@
1
+ # Feedback, response time, and perceived performance
2
+
3
+ Evidence: response-time limits, feedback principles, and state-hardening practice.
4
+
5
+ ## Time budget
6
+
7
+ | Elapsed time | UX requirement |
8
+ |---|---|
9
+ | ~0.1s | direct manipulation feels instantaneous; press/drag feedback must appear here |
10
+ | ~1s | user flow remains uninterrupted; avoid blocking chrome or unnecessary progress UI |
11
+ | ~10s | outer attention boundary; before this show explicit progress, scope, cancellation, or background completion |
12
+
13
+ Doherty: when feedback plus meaningful work stays near or under ~400ms, perceived momentum rises. Do not add artificial animation delay that breaks this rhythm.
14
+
15
+ ## Feedback design
16
+
17
+ - Acknowledge input immediately with pressed/pending/selection state independent of network completion.
18
+ - Distinguish queued, processing, uploaded, verified, indexed, synced, and failed when users care about lifecycle.
19
+ - Use determinate progress when real progress exists. Use sparse indeterminate feedback otherwise; never fake precision.
20
+ - For long work, explain what can safely be done meanwhile and whether leaving/navigating away cancels it.
21
+ - Use undo instead of confirmation when reversal is cheap and reliable. Reserve confirmation for irreversible, high-cost, ambiguous, or externally visible destruction.
22
+ - Destructive copy names the object/consequence: “Delete 14 invoices” not “Are you sure?” Double protection must be proportionate, not habitual friction.
23
+
24
+ ## Perceived performance
25
+
26
+ - Prioritize primary content/action over decorative media and below-fold assets.
27
+ - Reserve media/layout dimensions to prevent layout shift. Skeletons should preserve structure without pretending content exists.
28
+ - Make repeated interactions cheaper through caching, optimistic UI with rollback, prefetching only high-probability next steps, and stable navigation.
29
+ - Do not block input during animation/hydration/network activity unless operation truly is modal.
30
+ - Measure or inspect the actual path: startup, route transition, input latency, scroll/jank, image decode, database/API wait. A fast Lighthouse score alone does not prove interaction quality.
@@ -0,0 +1,44 @@
1
+ # Flows, JTBD, and information architecture
2
+
3
+ Evidence: recognition-over-recall and cognitive-load principles plus platform conventions.
4
+
5
+ ## JTBD frame
6
+
7
+ Write: “When `<situation>`, `<actor>` wants to `<progress>` so `<outcome>`, despite `<constraint>`.” Add frequency, urgency, expertise, device/input, locale, accessibility need, and emotional/stakes context. Do not confuse persona demographics with causal context.
8
+
9
+ ## Task analysis
10
+
11
+ | Column | Required detail |
12
+ |---|---|
13
+ | trigger | what starts the task; every entry point |
14
+ | goal state | observable success, not UI submission |
15
+ | steps | user decision/action, system work, handoff/wait |
16
+ | knowledge | what must be remembered vs recognized |
17
+ | failure | validation/network/permission/interruption/ambiguity |
18
+ | recovery | undo/retry/edit/cancel/support path |
19
+
20
+ Remove or automate steps before optimizing their visual design. Smart defaults must be reversible and visible.
21
+
22
+ ## Flow shape
23
+
24
+ - Count real decision/action steps, not screen count. A one-screen overloaded form can be worse than a short sequence.
25
+ - Keep depth shallow for high-frequency tasks; use progressive disclosure only when the hidden choice is genuinely secondary.
26
+ - Preserve orientation: current position, progress certainty, completion consequence, escape/back behavior.
27
+ - Branch only when answers change later questions. Do not gate optional enhancement behind mandatory account creation or irrelevant choices.
28
+ - End with confirmation that states what happened, what happens next, and the useful next action—not a dead end.
29
+
30
+ ## IA checks
31
+
32
+ - Group by user task/domain object, not internal org chart or implementation modules.
33
+ - Labels must be mutually exclusive at the same level; avoid catch-all “More/Other” unless genuinely necessary.
34
+ - Search, browse, filters, recent items, and saved state serve different recall/recognition modes; choose intentionally.
35
+ - Deep links must restore entity, filter/tab/pane, scroll anchor, permission state, and meaningful not-found/error behavior.
36
+ - Every entry point—notification, QR, email, search result, share sheet, CLI/docs link—lands in context rather than dumping users at home.
37
+
38
+ ## Platform navigation
39
+
40
+ - Honor platform back: browser history, Android predictive back, iOS edge swipe/navigation back, desktop Escape/close semantics. Never trap or silently discard work.
41
+ - Restore scroll/pagination/selection when returning; reset only when context changed or stale state is unsafe.
42
+ - Desktop/web productivity: document keyboard shortcuts, focus behavior, modified-state semantics, and conflict handling.
43
+ - Mobile: account for one-hand reach, edge gestures, bottom-sheet dismissal, keyboard occlusion, and interruption by calls/notifications.
44
+ - TUI/game/controller: publish navigation model and focus order; do not depend on pointer-only mental models.
@@ -0,0 +1,97 @@
1
+ # Forms
2
+
3
+ Evidence: validation and checkout research, WCAG redundant-entry/accessible-authentication requirements, and input usability guidance.
4
+
5
+ ## Structure
6
+
7
+ - One persistent visible label per field. Placeholder is never a label because it disappears, harms recall, and is often low contrast.
8
+ - Ask only for information needed now. Mark optional fields rather than plastering required markers everywhere when most fields are required.
9
+ - Group related choices; order by user mental model, not database schema. Use one column in most task flows.
10
+ - Use correct control type: text input vs select vs radio/checkbox/stepper/date picker. Do not force tiny dropdowns for few choices or free text for constrained values.
11
+ - Accept forgiving formats; parse and normalize rather than forcing users to match backend storage.
12
+ - Preserve entered input after errors, navigation, refresh, authentication expiry, and submission failure.
13
+
14
+ ## Input semantics and mobile adaptation
15
+
16
+ - Use correct autocomplete/input purpose tokens (`name`, `email`, `tel`, `url`, `postal-code`, payment fields), input types/modes, virtual keyboard layout, capitalization/autocorrect settings, and paste behavior.
17
+ - Never block paste in email/password/verification/payment fields. Do not require retyping email or other redundant entry unless a security/legal reason exists.
18
+ - Accessible authentication: no cognitive memory test, puzzle, or transcription-only flow; support password managers, paste, passkeys/biometrics/magic links where appropriate.
19
+ - Use input masking only when it visibly reduces uncertainty without trapping IMEs/paste/screen readers.
20
+ - Verification codes: allow paste/autofill, do not split focus unpredictably, announce errors accessibly, and preserve countdown/resend state.
21
+
22
+ ## Validation timing
23
+
24
+ | Moment | Use for |
25
+ |---|---|
26
+ | while typing | format hinting only when non-disruptive; do not show premature errors |
27
+ | after field completion/blur | invalid format, availability, mismatch, missing required value |
28
+ | on submit | cross-field/server/business-rule validation |
29
+ | after correction | clear error promptly; do not require full resubmission to know it fixed |
30
+
31
+ Do not validate required empty fields aggressively before the user has had a chance to answer. Never disable submit as the only indication of incomplete input; explain missing/invalid fields on attempt.
32
+
33
+ ## Error copy and recovery
34
+
35
+ Pattern: `<what is wrong>` + `<what was preserved>` + `<how to fix>`.
36
+
37
+ - Bad: “Invalid input.” Better: “Enter the expiry month as two digits, for example 09. Your other payment details are unchanged.”
38
+ - Put messages adjacent to fields and provide an error summary for long/complex forms; moving focus must be deliberate and accessible.
39
+ - Use forgiving constraints before validation. A date picker, mask, or autocomplete is often prevention; validation is the fallback.
40
+ - Destructive form reset/cancel must distinguish discard from close/back and protect entered work.
41
+
42
+ ## Input-type and autocomplete matrix
43
+
44
+ Choose semantics before layout:
45
+
46
+ | Data | Input/control posture | Formatting behavior |
47
+ |---|---|---|
48
+ | email | email semantics; `email` autocomplete; paste allowed | do not reject valid internationalized/plus-address forms because they look unusual; trim only insignificant outer whitespace |
49
+ | telephone | telephone semantics/input mode; `tel` autocomplete | accept grouping punctuation/spaces; normalize internally; never assume one national format without locale scope |
50
+ | URL | URL semantics/input mode; paste allowed | accept bare host only if product explicitly supports normalization; explain final normalization |
51
+ | postal code | postal-code autocomplete; text input, not number | preserve leading zeroes/spaces/case; validate by selected country/region only when known |
52
+ | payment card/expiry/CVC | correct payment autocomplete/input mode; numeric keyboard where appropriate | mask grouping visibly; tolerant spaces; never alter paste ordering or block password-manager/autofill behavior |
53
+ | name/address | full granular autocomplete tokens where platform supports them | do not force ASCII-only or given/family-name structure globally; preserve user spelling exactly |
54
+ | verification code | one-time-code semantics where supported; single coherent field or controlled segmented behavior | paste/autofill must fill the complete code; do not move focus unpredictably or lose digits during IME/paste |
55
+ | date/time/currency/number | constrained picker/stepper/input mode appropriate to locale and precision | parse locale-aware user input where feasible; store exact semantic value separately from display string |
56
+
57
+ `type=number` is not a substitute for validation. It can reject leading zeros, expose steppers users do not need, and mishandle localized decimal/grouping input. Use text input plus input mode/pattern behavior when identifiers are numeric strings rather than quantities.
58
+
59
+ ## Masking rules
60
+
61
+ Use input masks only when they reduce uncertainty more than they constrain input:
62
+
63
+ - show expected grouping, not hidden enforcement;
64
+ - preserve cursor position predictably during correction/paste;
65
+ - accept unmasked pasted values and normalize them;
66
+ - never trap IME composition or screen-reader announcements;
67
+ - expose the mask/format in persistent hint text when failure is costly;
68
+ - validate the semantic value, not the visual mask;
69
+ - provide a plain-text fallback when international variation or assistive input makes the mask unreliable.
70
+
71
+ Do not use masks for names, free-form addresses, globally variable phone formats, or data whose valid structure is unknown.
72
+
73
+ ## Adaptive validation behavior
74
+
75
+ Validation timing adapts to correction state:
76
+
77
+ 1. Initial entry: avoid premature required/format errors while the user is still composing.
78
+ 2. Commit/blur: validate field-level format/completeness when enough input exists to judge.
79
+ 3. Submit attempt: run cross-field/business/server validation and preserve all input.
80
+ 4. Correction: revalidate the corrected field promptly; clear resolved errors without requiring full form resubmission.
81
+ 5. Server rejection: map the failure to the responsible field when possible, keep a summary for complex forms, and explain what was preserved.
82
+ 6. Async availability/uniqueness: show pending state, stale-response protection, cancellation behavior, and failure-to-verify separately from invalid input.
83
+
84
+ Do not enable submit but silently ignore clicks, and do not disable submit as the only explanation. On attempted submit, summarize all material missing/invalid fields without overwhelming the user with redundant live announcements.
85
+
86
+ ## Error summary and focus behavior
87
+
88
+ For long or complex forms:
89
+
90
+ - place an error summary near the top/result of the submission attempt and field-level messages adjacent to their controls;
91
+ - move focus deliberately to the summary or first actionable error according to platform convention; never move focus on every keystroke;
92
+ - summary entries link/navigate to the actual controls where supported and preserve scroll/context;
93
+ - use wording that identifies the field and correction, not a generic “error occurred”;
94
+ - expose summary/status through platform accessibility semantics without repeated live-region noise;
95
+ - after correction, remove stale summary entries or explain that revalidation/submission is required.
96
+
97
+ Focus movement is a context change. Do not use it as a substitute for visible persistent messages.
@@ -0,0 +1,183 @@
1
+ # International UX
2
+
3
+ Evidence: Unicode locale data, W3C internationalization guidance, logical layout behavior, and cross-cultural variation. Treat every writing system as a first-class constraint. Do not center one language or transliterated ASCII as the default human reality.
4
+
5
+ ## Script and text-engine requirements
6
+
7
+ | Script family | Required behavior |
8
+ |---|---|
9
+ | Latin with diacritics | Preserve base letters, combining marks, normalization, and mark positioning. Vietnamese and Polish are examples only—not special cases. Test stacked tone/underdotted marks, uppercase forms, casing, search normalization, and font clipping. Do not strip accents for validation or storage. |
10
+ | Cyrillic/Greek | Preserve native alphabets without treating them as Latin lookalikes. Test casing/locales, sorting, glyph coverage, italic availability, and stress marks. Greek uses context-sensitive final sigma; let the text engine handle it rather than manipulating letters manually. |
11
+ | Arabic/Hebrew/Persian | Support right-to-left layout, contextual shaping, ligatures, joining, diacritics where used, native/European digits as locale-appropriate, and mixed-direction runs. Never split or reverse strings by code point. Persian digits/letterforms and Arabic-script language variation are not interchangeable automatically. |
12
+ | CJK | Respect locale-specific line breaking/prohibition rules, punctuation compression, ruby/furigana needs where relevant, and no-space scan behavior. Do not synthesize italics by skewing CJK glyphs; use weight/color/semantic emphasis instead. Vertical writing can be culturally appropriate but changes line progression, punctuation, numerals, ruby, scrolling, and text metrics—test it deliberately rather than rotating horizontal text. |
13
+ | Thai/Lao/Khmer | These scripts do not use spaces as ordinary word separators. Use dictionary/locale-aware segmentation for search, selection, wrapping, and measurement. Browser/runtime behavior differs by font/platform. |
14
+ | Indic scripts | Correct rendering depends on complex shaping: reordering, conjuncts, matras, ligatures, clusters, and script-specific font tables. Never truncate/split inside a grapheme/orthographic cluster and never shape manually in application code. |
15
+ | Emoji/ZWJ sequences | Emoji can be multi-code-point graphemes using ZWJ, skin-tone modifiers, flags/regional indicators, variation selectors, and keycap sequences. JavaScript `.length` counts UTF-16 code units and is not a user-perceived character count. |
16
+
17
+ ## Bidi isolation and logical layout
18
+
19
+ Use `dir="auto"` or explicit direction on user-generated mixed-direction text and isolate inline fragments:
20
+
21
+ ```html
22
+ <span dir="auto">اسم المستخدم</span>
23
+ <bdi>@user</bdi>
24
+ ```
25
+
26
+ CSS form: `unicode-bidi: isolate` / `plaintext` where appropriate. Isolate filenames, handles, URLs, error excerpts, brand names, and user-generated strings inserted into opposite-direction prose. Keep punctuation attached to the correct semantic fragment.
27
+
28
+ Use logical properties (`margin-inline-start`, `padding-inline`, `inset-block`, `border-start-end-radius`) rather than physical left/right when meaning follows reading direction. Mirror navigation/progression/layout only when direction is semantic. Do **not** blindly mirror numerals, charts' chronological direction, clocks, playback/media symbols, mathematical notation, playback progress direction, asymmetric product screenshots, or culturally directional iconography.
29
+
30
+ ## Segmentation and grapheme counting
31
+
32
+ Use `Intl.Segmenter` where available:
33
+
34
+ ```js
35
+ const segmenter = new Intl.Segmenter('th', { granularity: 'word' });
36
+ const words = [...segmenter.segment('ภาษาไทย')].map((part) => part.segment);
37
+
38
+ const graphemes = new Intl.Segmenter('en', { granularity: 'grapheme' });
39
+ const count = [...graphemes.segment('👨‍👩‍👧‍👦')].length; // 1
40
+ ```
41
+
42
+ Rules:
43
+
44
+ - use `granularity: 'word'` for Thai/Lao/Khmer word segmentation where supported; provide fallback behavior because segmentation quality/availability varies;
45
+ - use `granularity: 'grapheme'` for maxlength counters, caret movement, truncation, avatars/initials, and deletion behavior;
46
+ - never count UTF-16 units or bytes as user-visible characters;
47
+ - test surrogate pairs, combining marks, regional-indicator flags, family/profession emoji, variation selectors, and skin tones;
48
+ - search indexing/tokenization may need a different locale pipeline from display truncation.
49
+
50
+ ## Font fallback stacks
51
+
52
+ Fallback must be explicit per script and font role. Examples are starting points, not universal mandates:
53
+
54
+ ```css
55
+ font-family:
56
+ "Inter", "Noto Sans", system-ui, sans-serif; /* Latin/Cyrillic/Greek baseline */
57
+
58
+ font-family:
59
+ "Noto Sans Arabic", "Noto Naskh Arabic", "Segoe UI", sans-serif; /* Arabic/Persian */
60
+
61
+ font-family:
62
+ "Noto Sans Hebrew", "Arial Hebrew", sans-serif; /* Hebrew */
63
+
64
+ font-family:
65
+ "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei",
66
+ "Noto Sans CJK JP", "Hiragino Sans", "Yu Gothic",
67
+ "Noto Sans CJK KR", "Malgun Gothic", sans-serif; /* CJK examples */
68
+
69
+ font-family:
70
+ "Noto Sans Thai", "Leelawadee UI",
71
+ "Noto Sans Khmer", "Khmer UI",
72
+ "Noto Sans Lao", "Lao UI", sans-serif; /* mainland SE Asian examples */
73
+
74
+ font-family:
75
+ "Noto Sans Devanagari", "Noto Sans Bengali", "Noto Sans Tamil",
76
+ "Noto Sans Telugu", "Noto Sans Kannada", "Noto Sans Malayalam", sans-serif;
77
+ ```
78
+
79
+ Add emoji fallback such as platform emoji fonts where the product expects emoji rendering. Do not list fonts you do not test or ship/license. Metrics differ by script: line height, ascender/descender clipping, mark attachment, baseline alignment, underline/strike position, and weight synthesis must be inspected. Disable fake/oblique synthesis for CJK where possible (`font-synthesis` controls on web) and avoid synthetic bold when the font lacks proper weight.
80
+
81
+ ## Expansion, contraction, and layout budgets
82
+
83
+ A 30–40% expansion budget is a useful baseline for dense Latin-first UI, not a universal guarantee. Short labels can expand far more; CJK can contract visually while line count increases because fewer characters fit per line. Design rules:
84
+
85
+ - use wrapping/flexibility before truncation;
86
+ - reserve no fixed width for critical labels without an overflow rule;
87
+ - test both expansion and contraction;
88
+ - preserve minimum hit targets after translation;
89
+ - avoid vertically centered single-line assumptions;
90
+ - never use ellipsis in legal/safety/destructive confirmation text without an inspectable full-text path;
91
+ - measure using real translations plus pseudo-localization, not guessed length multiplication alone.
92
+
93
+ ## ICU plural, gender, and message structure
94
+
95
+ Use complete locale-aware messages; never concatenate grammar around variables. ICU MessageFormat supports plural/select/selectordinal and nested formatting. Example shape:
96
+
97
+ ```text
98
+ {gender, select,
99
+ female {She}
100
+ male {He}
101
+ other {They}
102
+ } updated {count, plural,
103
+ one {# file}
104
+ other {# files}
105
+ }
106
+ ```
107
+
108
+ Correct behavior depends on locale plural categories: languages may use zero/one/two/few/many/other and different semantics. Gender is message/context dependent; do not infer it from names. Preserve placeholders, formatting types, escaping, and translator context. Do not reuse one key in multiple grammatical contexts merely because the English source matches.
109
+
110
+ ## Locale formatting with platform APIs
111
+
112
+ Use `Intl`/CLDR-backed APIs rather than hand formatting:
113
+
114
+ - `Intl.DateTimeFormat` for dates/times/calendars/time zones;
115
+ - `Intl.NumberFormat` for decimal/currency/percent/unit notation;
116
+ - `Intl.RelativeTimeFormat` for localized relative time;
117
+ - `Intl.ListFormat` for conjunction/disjunction lists;
118
+ - `Intl.DisplayNames` for language/region/script/currency names;
119
+ - `Intl.Collator` for sorting/search matching with numeric/case/accent sensitivity options.
120
+
121
+ Do not hard-code digit grouping, decimal separators, month/day order, 12/24-hour clocks, week start, currency symbol placement, negative signs, capitalization, or list punctuation. Persist exact timestamps/values separately from localized display strings.
122
+
123
+ ## Platform notes
124
+
125
+ | Platform | Notes |
126
+ |---|---|
127
+ | Web | `dir`, `lang`, logical CSS, `unicode-bidi`, `Intl`, font `unicode-range`, line breaking/hyphenation vary by browser/lang. Verify actual shaping in target browsers and test `input` behavior during IME composition. |
128
+ | iOS/macOS | use localized strings dictionaries/plural rules, `NSLocale`/formatters, correct semantic content/input direction; test Dynamic Type, line-height clipping, keyboard/IME composition, and localized collation. |
129
+ | Android | use resources/plurals/`strings.xml`, locale-aware formatters, `textDirection`, font fallback, and `Layout` measurement; test pseudo-locales, RTL layout direction, IME composition, and per-app language preferences. |
130
+ | Flutter | use ICU-backed localization/message package plus `Directionality`, locale-aware text measurement/rendering, correct font fallback, and integration tests for RTL/CJK/emoji. Do not rely on pixel count or `String.length`. |
131
+ | Qt/QML | use `qsTr`/translation catalogs, plural-aware overloads, locale-aware formatting, correct `LayoutMirroring`/input method behavior, and font fallback validation. Test desktop/mobile input-method editors. |
132
+ | Terminal/TUI | width calculation is ambiguous: Unicode width, combining marks, East Asian wide/fullwidth, emoji presentation, and terminal emulator support differ. Do not assume one code point equals one cell; test truecolor/NO_COLOR/mono fallback and avoid relying on complex shaping that terminals may not perform. |
133
+
134
+ ## Testing with pseudo-localization
135
+
136
+ Pseudo-localization expands text, adds visible boundaries/accents, and can simulate RTL or placeholder corruption. Use it to detect hard-coded strings, concatenation, clipping, missing locale fallback, encoding errors, and layout fragility. It is not a substitute for real translation or native-speaker review.
137
+
138
+ Minimum fixture matrix for international products:
139
+
140
+ 1. Latin text with combining/stacked diacritics and long compound words;
141
+ 2. Cyrillic and Greek native text;
142
+ 3. Arabic plus Hebrew/Persian mixed-direction examples;
143
+ 4. Chinese/Japanese/Korean text and IME input;
144
+ 5. Thai/Lao/Khmer segmentation examples;
145
+ 6. at least one relevant Indic script;
146
+ 7. emoji/ZWJ/flag/keycap sequences;
147
+ 8. plural categories from multiple language families;
148
+ 9. locale-formatted dates/numbers/currency/lists;
149
+ 10. pseudo-localized expansion plus real RTL layout.
150
+
151
+ Label unavailable review/rendering evidence `not-checked`; passing English-only screenshots is not international verification.
152
+
153
+ ## Message authoring rules
154
+
155
+ Write translatable messages as complete semantic units:
156
+
157
+ - never concatenate sentence fragments around variables because word order, case agreement, gender, number, and prepositions change by language;
158
+ - pass structured values into one ICU/localization message rather than stitching translated substrings in code;
159
+ - include translator context for ambiguous verbs/nouns, truncation, character limits, placeholders, markup, tone, and audience;
160
+ - do not reuse a key in a different grammatical context merely because the English text is identical;
161
+ - preserve placeholder names/types and document allowable formatting;
162
+ - keep markup out of translated strings where possible; when inline emphasis/links are unavoidable, use explicit placeholder boundaries rather than positional string splitting;
163
+ - do not assemble plurals with `if count == 1`; use locale plural categories including zero/two/few/many where relevant;
164
+ - do not infer gender/grammatical agreement from names, avatars, or binary user settings;
165
+ - keep brand/product names stable only when intentionally untranslated; transliteration is a locale decision, not automatic romanization;
166
+ - test empty, zero, one, two/few/many, large-number, negative, and unknown-value cases.
167
+
168
+ A message is not localization-ready if translators cannot see the whole sentence or cannot reorder all meaningful parts.
169
+
170
+ ## Pseudolocalization workflow
171
+
172
+ Use pseudolocalization early and repeatedly, not as a final screenshot trick:
173
+
174
+ 1. **Enable a controlled pseudo-locale** or deterministic transform in the development environment.
175
+ 2. **Accenter visible Latin letters** to expose hard-coded/non-localized strings and encoding failure without making text unreadable to developers.
176
+ 3. **Add visible boundaries** such as brackets so truncation/clipping is obvious.
177
+ 4. **Expand representative strings** aggressively enough to expose fixed widths, missing wrapping, and overlap; do not treat one percentage as universal.
178
+ 5. **Exercise placeholders/plurals** with zero/one/other and long variable values rather than only static copy.
179
+ 6. **Run an RTL pseudo-direction pass** where supported to expose physical layout properties, missing isolation, bad mirroring, and punctuation placement.
180
+ 7. **Inspect input paths** including paste, IME composition, validation errors, autocomplete, and bidi isolation.
181
+ 8. **Record what pseudolocalization cannot validate:** real translation quality, correct cultural tone, shaping correctness in every font, native-speaker comprehension, and locale-specific legal wording.
182
+
183
+ Any untransformed visible string is a hard-coded-string candidate. Any clipped boundary marker is a layout defect. Do not hide failures by truncating all text or reducing minimum target sizes.
@@ -0,0 +1,18 @@
1
+ # UX laws as operational checks
2
+
3
+ Evidence: established UX laws, usability heuristics, and response-time limits.
4
+
5
+ | Principle | Operational check | Misuse to avoid |
6
+ |---|---|---|
7
+ | Hick | reduce simultaneous choices; group/progressively disclose genuinely secondary options | hiding critical controls behind mystery disclosure |
8
+ | Fitts | size/spacing/position match frequency and input precision; edge/corner value depends on platform | scaling web pixel rules blindly to pt/dp/controller |
9
+ | Jakob | use familiar platform/domain conventions unless differentiation is worth learning cost | copying patterns across OS/input modalities |
10
+ | Doherty | preserve momentum around ~400ms feedback/work cycles where possible | artificial speed that sacrifices correctness or truth |
11
+ | recognition over recall | visible options, autocomplete, recent/saved context, meaningful labels | exposing every option at once |
12
+ | progressive disclosure | reveal detail as confidence/need increases | nested menus/modals that lose context |
13
+ | smart defaults | choose reversible likely value and make it visible | dark-pattern defaults or hidden consent |
14
+ | chunking/grouping | group by meaning/proximity; use whitespace/hierarchy | arbitrary visual cards for unrelated controls |
15
+ | peak-end | make critical completion/recovery clear and humane | optimizing only visual first impression |
16
+ | aesthetic-usability | polish can increase perceived usability but cannot compensate for failed tasks | using delight to excuse floor violations |
17
+
18
+ Use laws to generate hypotheses and tradeoff questions, not as pseudo-mathematical proof. Validate with the state matrix, real content, platform conventions, and evidence-labeled review.