@thanhnguyxn/pixelcraft 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (376) hide show
  1. package/.agents/plugins/marketplace.json +1 -1
  2. package/.antigravity-plugin/plugin.json +32 -0
  3. package/.claude-plugin/marketplace.json +1 -1
  4. package/.claude-plugin/plugin.json +15 -4
  5. package/.codex-plugin/plugin.json +45 -0
  6. package/.cursor-plugin/marketplace.json +17 -0
  7. package/.cursor-plugin/plugin.json +27 -0
  8. package/.devin-plugin/plugin.json +21 -0
  9. package/.github/plugin/marketplace.json +34 -0
  10. package/CHANGELOG.md +159 -0
  11. package/GEMINI.md +1 -0
  12. package/README.md +185 -328
  13. package/SECURITY.md +28 -0
  14. package/assets/pixelcraft-logo-128.png +0 -0
  15. package/assets/pixelcraft-logo-256.png +0 -0
  16. package/bin/pixelcraft.mjs +431 -23
  17. package/docs/ARCHITECTURE.md +40 -37
  18. package/docs/DESIGN-RATIONALE.md +51 -3
  19. package/docs/INSTALL.md +221 -0
  20. package/evals/README.md +16 -6
  21. package/evals/fixtures/3d-web-engineering.json +69 -0
  22. package/evals/fixtures/acceptance-checklist-rule03-gate.json +43 -0
  23. package/evals/fixtures/ai-ui-libraries.json +53 -0
  24. package/evals/fixtures/audio-visual-accessibility.json +69 -0
  25. package/evals/fixtures/auth-and-checkout-ui.json +53 -0
  26. package/evals/fixtures/brandkit-identity-governance.json +48 -0
  27. package/evals/fixtures/build-and-architecture.json +53 -0
  28. package/evals/fixtures/canvas-and-node-editors.json +53 -0
  29. package/evals/fixtures/chat-ai-exfiltration-ime-hitl-gate.json +43 -0
  30. package/evals/fixtures/completion-gate-scan-until-clean.json +44 -0
  31. package/evals/fixtures/component-systems.json +53 -0
  32. package/evals/fixtures/component-testing.json +53 -0
  33. package/evals/fixtures/constrained-voice-and-tv.json +43 -0
  34. package/evals/fixtures/creative-code-rendering.json +69 -0
  35. package/evals/fixtures/creative-reference-evidence.json +67 -0
  36. package/evals/fixtures/data-app-python-marimo.json +49 -0
  37. package/evals/fixtures/desktop-cpp-juce-audio.json +49 -0
  38. package/evals/fixtures/desktop-csharp-avalonia.json +49 -0
  39. package/evals/fixtures/desktop-native-workspace.json +48 -0
  40. package/evals/fixtures/desktop-python-anti-tkinter.json +49 -0
  41. package/evals/fixtures/document-prepress-pdfx4-tounicode.json +43 -0
  42. package/evals/fixtures/document-rust-typst-invoice.json +49 -0
  43. package/evals/fixtures/document-typst-and-print-css.json +43 -0
  44. package/evals/fixtures/email-mjml-dark-mode.json +49 -0
  45. package/evals/fixtures/email-outlook-and-plaintext.json +43 -0
  46. package/evals/fixtures/enterprise-data-ui.json +53 -0
  47. package/evals/fixtures/extended-tui-toolkits.json +53 -0
  48. package/evals/fixtures/extensions-mv3-and-vscode.json +43 -0
  49. package/evals/fixtures/file-upload-media-ui.json +53 -0
  50. package/evals/fixtures/forms-validation.json +53 -0
  51. package/evals/fixtures/game-go-ebitengine.json +49 -0
  52. package/evals/fixtures/game-godot-gdscript.json +49 -0
  53. package/evals/fixtures/game-ui-hud-and-engines.json +43 -0
  54. package/evals/fixtures/i18n-engineering.json +53 -0
  55. package/evals/fixtures/local-first-sync.json +53 -0
  56. package/evals/fixtures/lynxjs.json +53 -0
  57. package/evals/fixtures/maizzle-email.json +53 -0
  58. package/evals/fixtures/maps-geospatial.json +53 -0
  59. package/evals/fixtures/media-og-and-video-export.json +43 -0
  60. package/evals/fixtures/media-players.json +53 -0
  61. package/evals/fixtures/mobile-compose-16kb-foldable-store-gate.json +44 -0
  62. package/evals/fixtures/mobile-elixir-liveview-native.json +49 -0
  63. package/evals/fixtures/mobile-flutter-dynamic-type.json +49 -0
  64. package/evals/fixtures/mobile-harmonyos-arkui.json +49 -0
  65. package/evals/fixtures/mobile-jetpack-compose.json +49 -0
  66. package/evals/fixtures/mobile-swiftui-ios.json +49 -0
  67. package/evals/fixtures/motion-engineering.json +69 -0
  68. package/evals/fixtures/pdfjs-and-pptx.json +53 -0
  69. package/evals/fixtures/plan-discovery-interview.json +31 -0
  70. package/evals/fixtures/plan-grill-me-brainstorm-gate.json +49 -0
  71. package/evals/fixtures/reactive-data-apps.json +53 -0
  72. package/evals/fixtures/review-evidence-audit.json +43 -0
  73. package/evals/fixtures/rich-text-and-code-editors.json +53 -0
  74. package/evals/fixtures/scrollytelling-resilience.json +70 -0
  75. package/evals/fixtures/spatial-xr-comfort-and-platforms.json +43 -0
  76. package/evals/fixtures/state-architecture.json +53 -0
  77. package/evals/fixtures/styling-ecosystem.json +53 -0
  78. package/evals/fixtures/token-tooling.json +53 -0
  79. package/evals/fixtures/tui-go-bubbletea.json +49 -0
  80. package/evals/fixtures/tui-rust-ratatui-grapheme-paste-teardown.json +44 -0
  81. package/evals/fixtures/tui-rust-ratatui.json +49 -0
  82. package/evals/fixtures/ux-state-matrix-and-i18n.json +43 -0
  83. package/evals/fixtures/web-3d-engines.json +53 -0
  84. package/evals/fixtures/web-php-laravel-filament.json +49 -0
  85. package/evals/fixtures/web-ruby-viewcomponent-phlex.json +49 -0
  86. package/evals/pixelcraft-accessibility.md +17 -0
  87. package/evals/pixelcraft-craft.md +16 -0
  88. package/evals/pixelcraft-dataviz.md +3 -3
  89. package/evals/pixelcraft-direction.md +17 -0
  90. package/evals/pixelcraft-game-ui.md +3 -3
  91. package/evals/pixelcraft-mobile.md +3 -3
  92. package/evals/pixelcraft-patterns.md +16 -0
  93. package/evals/pixelcraft-plan.md +65 -3
  94. package/evals/pixelcraft-review.md +3 -3
  95. package/evals/pixelcraft-visual-qa.md +11 -5
  96. package/evals/pixelcraft-web.md +21 -3
  97. package/evals/pixelcraft.md +4 -4
  98. package/gemini-extension.json +3 -2
  99. package/install.ps1 +57 -11
  100. package/install.sh +82 -7
  101. package/package.json +32 -4
  102. package/plugin.json +6 -1
  103. package/scripts/build-adapters.mjs +11 -13
  104. package/scripts/run-evals.mjs +397 -0
  105. package/scripts/sync-docs.mjs +381 -0
  106. package/scripts/test-build-adapters.mjs +14 -1
  107. package/scripts/test-cross-platform-qa.mjs +359 -0
  108. package/scripts/test-distribution.mjs +86 -7
  109. package/scripts/test-export-tokens.mjs +259 -3
  110. package/scripts/test-finish-gate.mjs +133 -10
  111. package/scripts/test-installers.mjs +155 -6
  112. package/scripts/test-shoot.mjs +23 -1
  113. package/scripts/test-slop-scan.mjs +390 -3
  114. package/scripts/test-style-inventory.mjs +23 -0
  115. package/scripts/test-sync-docs.mjs +140 -0
  116. package/scripts/test-validate-skills.mjs +82 -4
  117. package/scripts/validate-skills.mjs +149 -3
  118. package/skills/pixelcraft/SKILL.md +67 -47
  119. package/skills/pixelcraft/references/design-brief.md +2 -2
  120. package/skills/pixelcraft/references/floor.md +36 -19
  121. package/skills/pixelcraft/references/report-template.md +25 -11
  122. package/skills/pixelcraft/references/stack-detection.md +138 -67
  123. package/skills/pixelcraft/references/surface-acceptance.md +33 -21
  124. package/skills/pixelcraft/references/workflow-checkpoints.md +49 -7
  125. package/skills/pixelcraft-accessibility/SKILL.md +34 -13
  126. package/skills/pixelcraft-accessibility/references/apg-patterns.md +13 -0
  127. package/skills/pixelcraft-accessibility/references/motion-canvas.md +57 -0
  128. package/skills/pixelcraft-accessibility/references/platforms.md +34 -6
  129. package/skills/pixelcraft-accessibility/references/verification.md +15 -10
  130. package/skills/pixelcraft-accessibility/references/wcag22-checks.md +38 -5
  131. package/skills/pixelcraft-brandkit/SKILL.md +42 -30
  132. package/skills/pixelcraft-brandkit/references/asset-pipeline.md +90 -50
  133. package/skills/pixelcraft-brandkit/references/brand-governance.md +29 -27
  134. package/skills/pixelcraft-brandkit/references/logo-methods.md +33 -34
  135. package/skills/pixelcraft-brandkit/references/prompt-template.md +53 -51
  136. package/skills/pixelcraft-brandkit/references/qa-checklist.md +7 -2
  137. package/skills/pixelcraft-brandkit/references/visual-modes.md +16 -16
  138. package/skills/pixelcraft-chat-ui/SKILL.md +31 -27
  139. package/skills/pixelcraft-chat-ui/references/agentic-workspace.md +66 -0
  140. package/skills/pixelcraft-chat-ui/references/ai-ui-libraries.md +259 -0
  141. package/skills/pixelcraft-chat-ui/references/conversation-design.md +12 -6
  142. package/skills/pixelcraft-chat-ui/references/mobile-business-platforms.md +58 -68
  143. package/skills/pixelcraft-chat-ui/references/slack-discord.md +60 -76
  144. package/skills/pixelcraft-constrained/SKILL.md +21 -20
  145. package/skills/pixelcraft-constrained/references/specialized-hardware.md +69 -45
  146. package/skills/pixelcraft-constrained/references/tv-wearables.md +123 -73
  147. package/skills/pixelcraft-constrained/references/voice-ui.md +86 -45
  148. package/skills/pixelcraft-craft/SKILL.md +29 -15
  149. package/skills/pixelcraft-craft/references/color.md +62 -6
  150. package/skills/pixelcraft-craft/references/layout.md +32 -0
  151. package/skills/pixelcraft-craft/references/motion.md +99 -12
  152. package/skills/pixelcraft-craft/references/typography.md +48 -9
  153. package/skills/pixelcraft-data-apps/SKILL.md +50 -31
  154. package/skills/pixelcraft-data-apps/references/ai-and-internal-data-apps.md +147 -0
  155. package/skills/pixelcraft-data-apps/references/dash.md +87 -31
  156. package/skills/pixelcraft-data-apps/references/evidence.md +41 -26
  157. package/skills/pixelcraft-data-apps/references/gradio.md +65 -27
  158. package/skills/pixelcraft-data-apps/references/julia-genie.md +64 -29
  159. package/skills/pixelcraft-data-apps/references/jupyter-widgets.md +65 -27
  160. package/skills/pixelcraft-data-apps/references/nicegui.md +73 -34
  161. package/skills/pixelcraft-data-apps/references/observable-framework.md +65 -27
  162. package/skills/pixelcraft-data-apps/references/panel.md +69 -23
  163. package/skills/pixelcraft-data-apps/references/r-shiny.md +104 -34
  164. package/skills/pixelcraft-data-apps/references/reactive-data-apps.md +186 -0
  165. package/skills/pixelcraft-data-apps/references/reflex.md +85 -31
  166. package/skills/pixelcraft-data-apps/references/shiny.md +84 -27
  167. package/skills/pixelcraft-data-apps/references/streamlit.md +73 -25
  168. package/skills/pixelcraft-dataviz/SKILL.md +21 -24
  169. package/skills/pixelcraft-dataviz/references/color-accessibility.md +2 -2
  170. package/skills/pixelcraft-dataviz/references/encoding-tables-dashboards.md +35 -25
  171. package/skills/pixelcraft-dataviz/references/libraries.md +165 -46
  172. package/skills/pixelcraft-dataviz/references/maps-geospatial.md +159 -0
  173. package/skills/pixelcraft-dataviz/references/realtime-graphs-maps-scale.md +58 -65
  174. package/skills/pixelcraft-desktop/SKILL.md +61 -39
  175. package/skills/pixelcraft-desktop/references/appkit.md +60 -26
  176. package/skills/pixelcraft-desktop/references/avalonia.md +65 -29
  177. package/skills/pixelcraft-desktop/references/cpp-gui.md +104 -27
  178. package/skills/pixelcraft-desktop/references/electron.md +68 -26
  179. package/skills/pixelcraft-desktop/references/go-gui.md +59 -30
  180. package/skills/pixelcraft-desktop/references/gtk.md +74 -31
  181. package/skills/pixelcraft-desktop/references/javafx-swing.md +54 -25
  182. package/skills/pixelcraft-desktop/references/qt-pyside-qml.md +57 -30
  183. package/skills/pixelcraft-desktop/references/rust-gui.md +59 -41
  184. package/skills/pixelcraft-desktop/references/tauri.md +80 -24
  185. package/skills/pixelcraft-desktop/references/uno-platform.md +42 -23
  186. package/skills/pixelcraft-desktop/references/winui-wpf.md +66 -26
  187. package/skills/pixelcraft-desktop/references/working-context.md +82 -3
  188. package/skills/pixelcraft-direction/SKILL.md +48 -82
  189. package/skills/pixelcraft-direction/references/creative-brainstorming.md +72 -0
  190. package/skills/pixelcraft-direction/references/direction-card.md +11 -1
  191. package/skills/pixelcraft-direction/references/direction-scoring.md +5 -1
  192. package/skills/pixelcraft-direction/references/motion-identity.md +67 -0
  193. package/skills/pixelcraft-direction/references/movements.md +3 -0
  194. package/skills/pixelcraft-direction/references/reference-analysis.md +37 -0
  195. package/skills/pixelcraft-direction/references/slop-fingerprints.md +32 -7
  196. package/skills/pixelcraft-document/SKILL.md +27 -23
  197. package/skills/pixelcraft-document/references/archetypes.md +27 -4
  198. package/skills/pixelcraft-document/references/pdf-tools.md +241 -81
  199. package/skills/pixelcraft-document/references/pdfjs-and-pptx.md +114 -0
  200. package/skills/pixelcraft-document/references/print-css.md +96 -43
  201. package/skills/pixelcraft-document/references/slides.md +123 -27
  202. package/skills/pixelcraft-email/SKILL.md +42 -20
  203. package/skills/pixelcraft-email/references/client-quirks.md +101 -33
  204. package/skills/pixelcraft-email/references/html-tables.md +83 -22
  205. package/skills/pixelcraft-email/references/maizzle.md +54 -0
  206. package/skills/pixelcraft-email/references/mjml.md +13 -11
  207. package/skills/pixelcraft-email/references/react-email.md +76 -34
  208. package/skills/pixelcraft-extensions/SKILL.md +32 -27
  209. package/skills/pixelcraft-extensions/references/browser-extensions.md +91 -17
  210. package/skills/pixelcraft-extensions/references/figma-office.md +97 -14
  211. package/skills/pixelcraft-extensions/references/ide-and-saas-plugins.md +125 -0
  212. package/skills/pixelcraft-extensions/references/raycast.md +90 -11
  213. package/skills/pixelcraft-extensions/references/vscode-webviews.md +91 -17
  214. package/skills/pixelcraft-game-ui/SKILL.md +45 -26
  215. package/skills/pixelcraft-game-ui/references/bevy.md +69 -31
  216. package/skills/pixelcraft-game-ui/references/godot.md +100 -27
  217. package/skills/pixelcraft-game-ui/references/hud-principles.md +50 -21
  218. package/skills/pixelcraft-game-ui/references/love2d.md +53 -27
  219. package/skills/pixelcraft-game-ui/references/monogame.md +45 -29
  220. package/skills/pixelcraft-game-ui/references/unity-ugui.md +109 -0
  221. package/skills/pixelcraft-game-ui/references/unity-ui-toolkit.md +69 -27
  222. package/skills/pixelcraft-game-ui/references/unreal-umg.md +53 -26
  223. package/skills/pixelcraft-game-ui/references/web-and-middleware-game-ui.md +122 -0
  224. package/skills/pixelcraft-handoff/SKILL.md +14 -13
  225. package/skills/pixelcraft-handoff/references/design-translation.md +40 -10
  226. package/skills/pixelcraft-handoff/references/motion-handoff.md +54 -0
  227. package/skills/pixelcraft-media/SKILL.md +20 -23
  228. package/skills/pixelcraft-media/references/banners-video.md +83 -65
  229. package/skills/pixelcraft-media/references/og-generation.md +110 -63
  230. package/skills/pixelcraft-media/references/social-cards.md +57 -58
  231. package/skills/pixelcraft-mobile/SKILL.md +53 -36
  232. package/skills/pixelcraft-mobile/references/dotnet-maui.md +62 -34
  233. package/skills/pixelcraft-mobile/references/flet.md +53 -26
  234. package/skills/pixelcraft-mobile/references/flutter.md +76 -32
  235. package/skills/pixelcraft-mobile/references/harmonyos-and-emerging-mobile.md +121 -0
  236. package/skills/pixelcraft-mobile/references/ionic-capacitor.md +48 -26
  237. package/skills/pixelcraft-mobile/references/jetpack-compose.md +92 -24
  238. package/skills/pixelcraft-mobile/references/kivy.md +54 -31
  239. package/skills/pixelcraft-mobile/references/kotlin-multiplatform.md +53 -27
  240. package/skills/pixelcraft-mobile/references/lynxjs.md +110 -0
  241. package/skills/pixelcraft-mobile/references/nativescript-and-skip.md +91 -0
  242. package/skills/pixelcraft-mobile/references/react-native-expo.md +66 -31
  243. package/skills/pixelcraft-mobile/references/swiftui.md +158 -28
  244. package/skills/pixelcraft-mobile/references/tactile-interactions.md +55 -0
  245. package/skills/pixelcraft-mobile/references/task-state-composition.md +82 -2
  246. package/skills/pixelcraft-mobile/references/uikit.md +57 -23
  247. package/skills/pixelcraft-patterns/SKILL.md +30 -13
  248. package/skills/pixelcraft-patterns/references/accessibility-resilience.md +29 -0
  249. package/skills/pixelcraft-patterns/references/ai-and-offline-patterns.md +54 -0
  250. package/skills/pixelcraft-patterns/references/auth-onboarding.md +32 -13
  251. package/skills/pixelcraft-patterns/references/billing-paywalls.md +40 -0
  252. package/skills/pixelcraft-patterns/references/command-workspace.md +56 -0
  253. package/skills/pixelcraft-patterns/references/commerce.md +35 -16
  254. package/skills/pixelcraft-patterns/references/communication.md +34 -15
  255. package/skills/pixelcraft-patterns/references/creative-tools.md +30 -17
  256. package/skills/pixelcraft-patterns/references/creative-web-composition.md +38 -0
  257. package/skills/pixelcraft-patterns/references/dashboard-admin.md +22 -18
  258. package/skills/pixelcraft-patterns/references/history-diff-undo.md +50 -0
  259. package/skills/pixelcraft-patterns/references/marketing.md +31 -19
  260. package/skills/pixelcraft-patterns/references/multi-tenant-rbac.md +47 -0
  261. package/skills/pixelcraft-patterns/references/narrative-systems.md +42 -0
  262. package/skills/pixelcraft-patterns/references/notifications-activity.md +57 -0
  263. package/skills/pixelcraft-patterns/references/pattern-selection.md +8 -2
  264. package/skills/pixelcraft-patterns/references/scheduling-kanban.md +47 -0
  265. package/skills/pixelcraft-patterns/references/scroll-implementation.md +37 -0
  266. package/skills/pixelcraft-patterns/references/settings.md +40 -12
  267. package/skills/pixelcraft-plan/SKILL.md +54 -18
  268. package/skills/pixelcraft-plan/references/discovery-interview.md +110 -0
  269. package/skills/pixelcraft-plan/references/grill-me-protocol.md +63 -0
  270. package/skills/pixelcraft-plan/references/plan-template.md +44 -9
  271. package/skills/pixelcraft-plan/references/repo-discovery.md +16 -9
  272. package/skills/pixelcraft-plan/references/stack-freshness.md +22 -5
  273. package/skills/pixelcraft-plan/references/stack-selection.md +65 -9
  274. package/skills/pixelcraft-review/SKILL.md +41 -19
  275. package/skills/pixelcraft-review/references/audit-report.md +20 -1
  276. package/skills/pixelcraft-review/references/heuristics.md +63 -18
  277. package/skills/pixelcraft-review/references/personas.md +41 -14
  278. package/skills/pixelcraft-review/references/polish.md +66 -26
  279. package/skills/pixelcraft-review/scripts/check-acceptance.mjs +619 -0
  280. package/skills/pixelcraft-review/scripts/fixtures/focus-longhand-removal.css +34 -0
  281. package/skills/pixelcraft-review/scripts/slop-scan.mjs +679 -32
  282. package/skills/pixelcraft-spatial/SKILL.md +16 -17
  283. package/skills/pixelcraft-spatial/references/comfort-accessibility.md +25 -84
  284. package/skills/pixelcraft-spatial/references/platforms.md +123 -53
  285. package/skills/pixelcraft-tokens/SKILL.md +18 -14
  286. package/skills/pixelcraft-tokens/assets/tokens.example.json +1 -1
  287. package/skills/pixelcraft-tokens/assets/tokens.modes.example.json +1 -1
  288. package/skills/pixelcraft-tokens/references/format.md +39 -9
  289. package/skills/pixelcraft-tokens/references/governance.md +1 -1
  290. package/skills/pixelcraft-tokens/references/theme-presets.md +36 -8
  291. package/skills/pixelcraft-tokens/references/token-tooling.md +119 -0
  292. package/skills/pixelcraft-tokens/scripts/export-tokens.mjs +637 -75
  293. package/skills/pixelcraft-tui/SKILL.md +41 -25
  294. package/skills/pixelcraft-tui/references/bubbletea-lipgloss.md +49 -30
  295. package/skills/pixelcraft-tui/references/extended-tui-toolkits.md +127 -0
  296. package/skills/pixelcraft-tui/references/ink.md +77 -28
  297. package/skills/pixelcraft-tui/references/ratatui.md +70 -30
  298. package/skills/pixelcraft-tui/references/rich.md +53 -33
  299. package/skills/pixelcraft-tui/references/terminal-protocols.md +80 -0
  300. package/skills/pixelcraft-tui/references/textual.md +75 -34
  301. package/skills/pixelcraft-ux/SKILL.md +22 -12
  302. package/skills/pixelcraft-ux/references/feedback-performance.md +39 -19
  303. package/skills/pixelcraft-ux/references/forms.md +57 -3
  304. package/skills/pixelcraft-ux/references/i18n.md +50 -12
  305. package/skills/pixelcraft-ux/references/laws.md +35 -14
  306. package/skills/pixelcraft-ux/references/state-matrix.md +15 -1
  307. package/skills/pixelcraft-ux/references/ux-writing.md +1 -0
  308. package/skills/pixelcraft-visual-qa/SKILL.md +21 -7
  309. package/skills/pixelcraft-visual-qa/references/capture-desktop-game.md +28 -7
  310. package/skills/pixelcraft-visual-qa/references/capture-document.md +70 -0
  311. package/skills/pixelcraft-visual-qa/references/capture-email.md +13 -9
  312. package/skills/pixelcraft-visual-qa/references/capture-mobile.md +20 -5
  313. package/skills/pixelcraft-visual-qa/references/capture-terminal.md +6 -2
  314. package/skills/pixelcraft-visual-qa/references/motion-capture.md +63 -0
  315. package/skills/pixelcraft-visual-qa/references/performance-budgets.md +25 -12
  316. package/skills/pixelcraft-visual-qa/references/realtime-graphics.md +55 -0
  317. package/skills/pixelcraft-visual-qa/scripts/check-contrast.mjs +442 -0
  318. package/skills/pixelcraft-visual-qa/scripts/check-email.mjs +397 -0
  319. package/skills/pixelcraft-visual-qa/scripts/check-pdf.mjs +189 -0
  320. package/skills/pixelcraft-visual-qa/scripts/check-tui.mjs +321 -0
  321. package/skills/pixelcraft-visual-qa/scripts/finish-gate.mjs +50 -11
  322. package/skills/pixelcraft-visual-qa/scripts/shoot.mjs +214 -59
  323. package/skills/pixelcraft-visual-qa/scripts/style-inventory.mjs +121 -49
  324. package/skills/pixelcraft-web/SKILL.md +105 -49
  325. package/skills/pixelcraft-web/references/accessibility-performance.md +42 -0
  326. package/skills/pixelcraft-web/references/adaptive-layout.md +52 -8
  327. package/skills/pixelcraft-web/references/angular.md +63 -16
  328. package/skills/pixelcraft-web/references/assets-pipeline.md +67 -0
  329. package/skills/pixelcraft-web/references/astro.md +64 -13
  330. package/skills/pixelcraft-web/references/audio-reactive.md +61 -0
  331. package/skills/pixelcraft-web/references/auth-and-checkout-ui.md +115 -0
  332. package/skills/pixelcraft-web/references/build-and-architecture.md +215 -0
  333. package/skills/pixelcraft-web/references/canvas-and-node-editors.md +157 -0
  334. package/skills/pixelcraft-web/references/clojurescript.md +52 -17
  335. package/skills/pixelcraft-web/references/component-systems.md +102 -0
  336. package/skills/pixelcraft-web/references/component-testing.md +170 -0
  337. package/skills/pixelcraft-web/references/creative-effects.md +59 -0
  338. package/skills/pixelcraft-web/references/creative-runtime.md +34 -0
  339. package/skills/pixelcraft-web/references/enterprise-data-ui.md +138 -0
  340. package/skills/pixelcraft-web/references/file-upload-media-ui.md +82 -0
  341. package/skills/pixelcraft-web/references/forms-validation.md +123 -0
  342. package/skills/pixelcraft-web/references/fsharp-fable.md +3 -2
  343. package/skills/pixelcraft-web/references/gsap.md +102 -0
  344. package/skills/pixelcraft-web/references/html-css.md +144 -12
  345. package/skills/pixelcraft-web/references/htmx-alpine.md +68 -18
  346. package/skills/pixelcraft-web/references/i18n-engineering.md +106 -0
  347. package/skills/pixelcraft-web/references/interaction-and-search-primitives.md +196 -0
  348. package/skills/pixelcraft-web/references/java-web.md +27 -18
  349. package/skills/pixelcraft-web/references/kotlin-web.md +6 -2
  350. package/skills/pixelcraft-web/references/leptos-yew.md +62 -19
  351. package/skills/pixelcraft-web/references/lit-web-components.md +4 -2
  352. package/skills/pixelcraft-web/references/local-first-sync.md +105 -0
  353. package/skills/pixelcraft-web/references/media-players.md +104 -0
  354. package/skills/pixelcraft-web/references/motion-react.md +96 -0
  355. package/skills/pixelcraft-web/references/motion-recipes.md +82 -0
  356. package/skills/pixelcraft-web/references/preact-fresh-hono.md +111 -0
  357. package/skills/pixelcraft-web/references/pwa.md +6 -1
  358. package/skills/pixelcraft-web/references/qwik.md +51 -11
  359. package/skills/pixelcraft-web/references/r3f-integration.md +69 -0
  360. package/skills/pixelcraft-web/references/react-next.md +112 -13
  361. package/skills/pixelcraft-web/references/rendering-choice.md +63 -0
  362. package/skills/pixelcraft-web/references/rendering-performance.md +80 -0
  363. package/skills/pixelcraft-web/references/rich-text-and-code-editors.md +220 -0
  364. package/skills/pixelcraft-web/references/rive-lottie.md +73 -0
  365. package/skills/pixelcraft-web/references/scene-architecture.md +132 -0
  366. package/skills/pixelcraft-web/references/server-rendered.md +106 -63
  367. package/skills/pixelcraft-web/references/shader-workflow.md +77 -0
  368. package/skills/pixelcraft-web/references/smooth-scroll.md +58 -0
  369. package/skills/pixelcraft-web/references/solid.md +67 -16
  370. package/skills/pixelcraft-web/references/state-architecture.md +107 -0
  371. package/skills/pixelcraft-web/references/styling-ecosystem.md +273 -0
  372. package/skills/pixelcraft-web/references/svelte.md +61 -11
  373. package/skills/pixelcraft-web/references/tailwind.md +40 -14
  374. package/skills/pixelcraft-web/references/video-media.md +69 -0
  375. package/skills/pixelcraft-web/references/vue-nuxt.md +37 -13
  376. package/skills/pixelcraft-web/references/web-3d-engines.md +97 -0
@@ -1,62 +1,102 @@
1
- # Ratatui
1
+ # Ratatui (Rust, 0.28–0.30+)
2
2
 
3
- Evidence: Ratatui docs describe `TestBackend::new(width, height)` for integration testing and official recipes use `insta` snapshots of terminal output.
3
+ ## Lifecycle & panic-safe teardown (`ratatui::run` / `init` + `restore`)
4
4
 
5
- ## Token mapping
6
-
7
- Define semantic `Style`/`Color` constants or theme structs centrally:
5
+ Never leave a user's terminal trapped in raw mode or the alternate screen after an error or panic. On Ratatui 0.28+, use **`ratatui::init()`** paired with **`ratatui::restore()`** (or **`ratatui::run(|terminal| ...)`** on 0.30+), which automatically installs a panic hook that restores terminal state before printing the panic payload:
8
6
 
9
7
  ```rust
10
- pub struct PcTheme { pub action: Color, pub error: Color }
8
+ use ratatui::{
9
+ layout::{Constraint, Flex, Layout},
10
+ style::{Color, Modifier, Style},
11
+ DefaultTerminal, Frame,
12
+ };
13
+
14
+ pub struct PcTheme {
15
+ pub action: Style,
16
+ pub error: Style,
17
+ pub focused: Style,
18
+ }
19
+
20
+ impl Default for PcTheme {
21
+ fn default() -> Self {
22
+ Self {
23
+ action: Style::default().fg(Color::Cyan).add_modifier(Modifier::BOLD),
24
+ error: Style::default().fg(Color::Red).add_modifier(Modifier::BOLD),
25
+ focused: Style::default().fg(Color::Yellow).add_modifier(Modifier::REVERSED),
26
+ }
27
+ }
28
+ }
29
+
30
+ fn main() -> color_eyre::Result<()> {
31
+ ratatui::run(|terminal: &mut DefaultTerminal| app_loop(terminal))
32
+ }
11
33
  ```
12
34
 
13
- Use semantic fields rather than raw colors in widgets. Respect terminal color capability; do not assume truecolor. Ratatui itself does not impose a token pipeline—ownership is yours.
14
-
15
- ## Layout and responsive idioms
35
+ ## Token mapping & terminal capability respect
16
36
 
17
- Use `Layout` constraints/direction/margins/splitting deliberately. Compute layout from current terminal area each frame; handle resize/minimum size/truncation/wrap/scroll state. Character-cell alignment, scanlines, density, and pane priority are explicit design decisions.
37
+ Define semantic `Style` / `Color` fields in one theme struct (defaulting to ANSI 16 named colors or mapping down cleanly when `NO_COLOR` is set or `COLORTERM` is absent) instead of scattering `Color::Rgb(...)` literals across widgets. Respect light and dark terminal backgrounds by avoiding hard-coded dark-only `Color::White` text over default terminal backgrounds—prefer `Color::Reset` for standard foreground/background cells.
18
38
 
19
- ## Typography/custom fonts
39
+ ## Layout (`Constraint::Fill` / `Flex`) & ecosystem crates
20
40
 
21
- Terminals control fonts. Use modifier flags (`BOLD`, `DIM`, `UNDERLINED`, `REVERSED`) and semantic color/sparse symbols. Unicode width requires width-aware handling; CJK/emoji/box glyphs may not occupy the width you expect.
41
+ - Derive layout every frame from `frame.area()` using **`Constraint::Fill(weight)`**, `Constraint::Length`, `Constraint::Min`, `Constraint::Max`, and **`Flex`** (`Flex::SpaceBetween`, `Flex::Center`, `Flex::Start`, `Flex::Legacy`) instead of error-prone percentage math that leaves 1-cell gaps:
22
42
 
23
- ## Motion/reduced motion
43
+ ```rust
44
+ let [header, body, footer] = Layout::vertical([
45
+ Constraint::Length(2),
46
+ Constraint::Fill(1),
47
+ Constraint::Length(1),
48
+ ])
49
+ .flex(Flex::Legacy)
50
+ .areas(frame.area());
51
+ ```
24
52
 
25
- Animation is manual frame/tick state. Keep redraw frequency bounded and purposeful. Provide quiet/reduced-motion flags where relevant; terminal platforms lack a uniform hook. Do not flash or continuously repaint decorative noise.
53
+ - **Images in terminal cells (`ratatui-image`)**: use `ratatui-image` when displaying previews/thumbnails—it automatically probes and renders via Kitty Graphics, Sixel, iTerm2 inline images, or Unicode halfblock (`▀`/`▄`) fallback without crashing unsupported terminals.
54
+ - **Multi-line text input (`tui-textarea` / `edtui`)**: reuse mature editing crates for cursor movement, selection, undo/redo, and paste rather than hand-rolling byte-offset UTF-8 string slicing (which panics on multi-byte Unicode/CJK graphemes).
26
55
 
27
- ## Accessibility specifics
56
+ ## Grapheme width (`UAX #29`), Bracketed Paste, `OSC 52` & 6-step teardown
28
57
 
29
- Keyboard-first input/event model, visible focus/selection, plain text state equivalents, no color-only meaning, Unicode/NO_COLOR fallback, cursor visibility/position control, escape/cancel behavior, and careful alternate-screen vs scrollback choice. Screen-reader behavior varies and must not be overstated.
58
+ - **Grapheme-cluster column width**: never use `str::len()` or `chars().count()` for cell alignment or cursor slicing. Segment text with **`unicode-segmentation`** (`s.graphemes(true)`) and compute column width with **`unicode-width`** (`UnicodeWidthStr::width`) so CJK (`2` cols), ZWJ emoji (`👨‍👩‍👧‍👦` = `2` cols), `VS16` (`⚠️` = `2` cols), and Vietnamese combining diacritics (`0` extra cols) never corrupt box borders; switch to `ratatui::symbols::border::ASCII` (`+--+`) when `--ascii`, `TERM=dumb`, or non-UTF-8 locale is active.
59
+ - **Bracketed Paste (`DECSET 2004`) & `OSC 52` clipboard**: enable `crossterm::event::EnableBracketedPaste` (`Event::Paste(String)`) so multi-line pastes into inputs never fire `KeyCode::Enter` per line; support copying via `arboard` locally plus **`OSC 52`** (`crossterm::clipboard::CopyToClipboard`) over SSH/`tmux`.
60
+ - **Complete 6-step panic & signal restoration**: whenever enabling mouse capture, bracketed paste, synchronized updates, or Kitty keyboard enhancement alongside `ratatui::init()`, ensure your `Drop` guard + panic hook + `tokio::signal` (`SIGINT`, `SIGTERM`, `SIGHUP`) handler executes all 6 steps ([terminal-protocols.md](terminal-protocols.md)): `?1049l` (leave alt screen), `?1000l/?1002l/?1003l/?1006l` (disable mouse), `?2004l` (disable bracketed paste), `?2026l` (end sync output), `\x1b[<u` (pop Kitty keyboard flags), and `?25h` + `disable_raw_mode()`.
61
+ - **Stream hygiene, `BrokenPipe`, & CLI packaging**: write TUI/spinners to `stderr` (or alt-screen only when `std::io::stdout().is_terminal()`), emit `--json`/`--plain` strictly to `stdout` while catching **`io::ErrorKind::BrokenPipe`** (`exit(0)` silently on `| head -n 5` instead of `.unwrap()` panicking!), use semantic exit codes (`0`, `1`, `2`, `130`), and generate `bash`/`zsh`/`fish`/`pwsh` completions + `man` pages via **`clap_complete`** and **`clap_mangen`** (`cargo-dist` / Homebrew / Winget / Scoop / Cargo).
30
62
 
31
- ## States idiom
63
+ Keep event polling (`crossterm::event::poll`) and tick intervals bounded so idle TUIs consume near-zero CPU. Manage async backend work on Tokio channels with explicit request IDs and cancellation (`CancellationToken`) so stale results never overwrite newer selections. Render explicit loading, empty, error, offline, and narrow-terminal fallback views into buffers—never leave blank black panes, and position the real terminal cursor (`frame.set_cursor_position(...)`) inside focused text inputs for assistive tools/IME.
32
64
 
33
- Use explicit application state/event ownership. Async/backend work requires channels/tasks with cancellation/timeout/stale-result handling. Render loading/error/empty/offline/permission/concurrency states into buffers rather than leaving blank panes. Preserve input/focus/scroll in app state across resize.
65
+ ## Snapshot & buffer verification (`TestBackend` + `insta`)
34
66
 
35
- ## Forms idiom
67
+ Test layout, narrow `80×24` collapse behavior, CJK/ZWJ/Vietnamese grapheme alignment, focus markers, and error states deterministically with **`TestBackend::new(width, height)`** and **`insta`** snapshots:
36
68
 
37
- Implement or reuse input widgets deliberately: cursor/selection/IME constraints are hard. Validate input timing, preserve values, expose errors textually, support paste/editing keys realistically, and provide noninteractive flags where automation matters.
69
+ ```rust
70
+ #[test]
71
+ fn renders_cleanly_at_80x24() {
72
+ let mut terminal = ratatui::Terminal::new(ratatui::backend::TestBackend::new(80, 24)).unwrap();
73
+ terminal.draw(|f| draw_ui(f, &App::sample())).unwrap();
74
+ insta::assert_snapshot!(terminal.backend());
75
+ }
76
+ ```
38
77
 
39
78
  ## Do/don't pairs
40
79
 
41
80
  | Do | Don't |
42
81
  |---|---|
43
- | central semantic theme struct | raw `Color::Rgb` scattered through widgets |
44
- | derive layout each frame from terminal area | fixed 120×40 assumptions |
45
- | explicit async stale/cancel handling | backend result overwriting newer user state |
46
- | text marker plus style for selection | color-only selection invisible/monochrome |
47
- | `TestBackend`/buffer tests for critical views | visual QA only by occasional manual run |
82
+ | Run `ratatui::run`/`restore` + full 6-step teardown (`?2004l`, `?1003l`, `\x1b[<u`) on panic & signals | Manual raw-mode setup leaving mouse capture, bracketed paste, or `CSI u` stuck after crashes |
83
+ | Measure/slice via `unicode-segmentation` + `unicode-width` + `border::ASCII` fallback | Slice UTF-8 strings by byte index or use `.len()` on CJK / `👨‍👩‍👧‍👦` / Vietnamese text |
84
+ | Enable `EnableBracketedPaste` (`Event::Paste`) and `OSC 52` SSH clipboard | Treat pasted newlines as accidental `Enter` confirmations |
85
+ | Catch `ErrorKind::BrokenPipe` on `--json`/`--plain` `stdout` writes and ship `clap_complete` + `man` pages | `.unwrap()` `writeln!(stdout)` so `mycli --plain \| head -n 5` panics with a backtrace |
86
+ | Centralize semantic `PcTheme` using `Color::Reset` + ANSI 16 dark/light-safe roles | Scatter `Color::Rgb(255, 255, 255)` unreadable on light terminals |
87
+ | Verify buffers across `80×24` and wide sizes with `TestBackend` + `insta` | Rely solely on `cargo build` or one wide manual glance |
48
88
 
49
89
  ## Known traps
50
90
 
51
- Unicode width errors, terminal capability mismatch, high-frequency event/render loops, stale async responses, panic leaving terminal in raw/alternate mode, scrollback/alt-screen misuse, focus/input ownership complexity, incomplete custom text editing/IME behavior.
91
+ Byte-index string slicing panicking on UTF-8/emoji/CJK/Vietnamese characters, forgetting `DisableBracketedPaste` / `PopKeyboardEnhancementFlags` on panic, `.unwrap()` panicking on `SIGPIPE`/`BrokenPipe`, hard-coding `Color::White` on light-background terminals, spinning a 0ms event loop burning 100% CPU, emitting alt-screen control codes when piped to `grep`/`jq`.
52
92
 
53
93
  ## Verification commands
54
94
 
55
95
  ```sh
56
96
  cargo test
57
- cargo insta review 2>/dev/null || true
58
- cargo clippy -- -D warnings 2>/dev/null || true
59
- cargo run
97
+ cargo clippy --all-targets -- -D warnings
98
+ NO_COLOR=1 cargo run -- --help
99
+ cargo run -- --plain | head -n 5
60
100
  ```
61
101
 
62
- Use `TestBackend`/`insta` snapshots, actual terminal runs at multiple sizes, panic/cleanup behavior, piped/non-TTY modes where relevant, keyboard-driven tests, NO_COLOR/color matrices, and interrupt/cancellation checks.
102
+ `cargo test` (`TestBackend` / `insta` snapshots) and `cargo clippy` provide `static` and deterministic buffer evidence. Run the compiled binary in real dark and light terminals at `80×24`, `NO_COLOR=1`, `TERM=dumb`, `--ascii`, multi-line paste, and panic/interrupt recovery paths for `rendered` evidence; label untested emulators `not-checked`.
@@ -1,62 +1,82 @@
1
- # Rich
1
+ # Rich (Python)
2
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.
3
+ Rich is a structured terminal rendering library—not a full-screen multi-pane application framework. Use it for CLI output, tables, panels, trees, syntax highlighting, Markdown, progress bars, and bounded live status displays. When an interface needs persistent panes, focus rings, or complex keyboard navigation, move to **Textual** (`references/textual.md`).
4
4
 
5
- ## Token mapping
5
+ ## Token mapping (`rich.theme.Theme`) & stdout/stderr separation
6
6
 
7
- Define semantic style constants centrally:
7
+ Define semantic style roles once with **`rich.theme.Theme`** and pass it to **`Console(theme=...)`**. Separate diagnostic/interactive UI (`Console(stderr=True)`) from machine-readable payload output on `stdout` so piping (`mycli list | jq`) never breaks on ANSI escape codes or spinner frames:
8
8
 
9
9
  ```python
10
- PC_STYLES = {"action": "bold #0074ca", "error": "bold red"}
10
+ from rich.console import Console
11
+ from rich.markup import escape
12
+ from rich.theme import Theme
13
+
14
+ PC_THEME = Theme({
15
+ "action": "bold #0074ca",
16
+ "success": "bold green",
17
+ "warning": "bold yellow",
18
+ "error": "bold red",
19
+ "muted": "dim",
20
+ })
21
+
22
+ out = Console(theme=PC_THEME) # primary output (auto-strips ANSI when piped)
23
+ err = Console(stderr=True, theme=PC_THEME) # progress, spinners, warnings, errors
24
+
25
+ filename = "report[2026].csv"
26
+ err.print(f"[action]Importing[/action] {escape(filename)}")
11
27
  ```
12
28
 
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.
29
+ ## Markup safety (`rich.markup.escape`)
14
30
 
15
- ## Layout and responsive idioms
31
+ Rich interprets `[...]` brackets in strings as style tags. Always wrap untrusted or dynamic strings (filenames, JSON snippets, array indices like `items[0]`, log lines) with **`rich.markup.escape(text)`**—or pass `markup=False` to `console.print(...)`—so brackets never swallow text or raise `MarkupError`.
16
32
 
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.
33
+ ## Layout, `rich.cells` width, & `--ascii` fallback
18
34
 
19
- ## Typography/custom fonts
35
+ - Let Rich adapt tables and panels to `console.width` (`expand=False` or responsive `ratio`/`overflow="fold"`/`"ellipsis"`) rather than building fixed 120-column ASCII boxes, and measure custom padding with **`rich.cells.cell_len(text)`** (never `len(text)`, which miscounts `2`-col CJK, `👨‍👩‍👧‍👦` ZWJ emoji, `⚠️` `VS16`, and `0`-col Vietnamese combining diacritics).
36
+ - Switch tables/panels to **`rich.box.ASCII`** (`+--+`) and ASCII spinners (`spinner="line"`) when `--ascii`, `TERM=dumb`, or `legacy_windows` / non-UTF-8 encoding is active.
37
+ - Prefer ANSI 16 semantic color names (`cyan`, `green`, `yellow`, `red`, `default`) over hardcoded `#ffffff` or `#000000` so output stays legible on both dark and light terminal themes, pairing color with plain-text markers (`[OK]`, `[WARN]`, `[ERR]`) for `NO_COLOR=1` and screen readers.
20
38
 
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.
39
+ ## Stream hygiene, `BrokenPipeError`, progress, & CLI packaging
22
40
 
23
- ## Motion/reduced motion
41
+ - **Strict `stdout` / `stderr` & silent `BrokenPipeError` exit**: run `Progress`, `Live`, spinners, and warnings exclusively on `Console(stderr=True)` (`refresh_per_second=4`–`10`, disabled automatically when `not err.is_terminal` or `CI=true`); emit `--json` / `--plain` data strictly to `sys.stdout` wrapped in a **`BrokenPipeError`** guard so `mycli list --plain | head -n 5` exits `0` silently without printing a Python traceback:
24
42
 
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
43
+ ```python
44
+ import os
45
+ import sys
46
+
47
+ def flush_stdout_safely() -> None:
48
+ try:
49
+ sys.stdout.flush()
50
+ except BrokenPipeError:
51
+ devnull = os.open(os.devnull, os.O_WRONLY)
52
+ os.dup2(devnull, sys.stdout.fileno())
53
+ sys.exit(0)
54
+ ```
36
55
 
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.
56
+ - **Interrupts, semantic exit codes & distribution**: catch `KeyboardInterrupt` cleanly (stop `Progress`/`Live` so `?25h` cursor visibility restores, print cancelled summary to `stderr`, and exit **`130`**); use **`0`** for success, **`1`** for runtime errors, and **`2`** for CLI usage errors.
57
+ - **Prompts & packaging**: Rich's `Prompt.ask` / `Confirm.ask` fit short linear confirmations (prefer **`prompt_toolkit`** with Bracketed Paste `?2004h` for multi-line input—see [extended-tui-toolkits.md](extended-tui-toolkits.md)). Always provide non-interactive flags (`--yes`), `--help`, `--version`, **`bash`/`zsh`/`fish`/`pwsh` shell completions** (Typer/Click), a **`man` page**, and `uv tool` / Homebrew / Scoop / Winget packaging.
38
58
 
39
59
  ## Do/don't pairs
40
60
 
41
61
  | Do | Don't |
42
62
  |---|---|
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 |
63
+ | Define 16-color-safe `Theme({...})` + `rich.cells.cell_len` + `box.ASCII` fallback | Hardcode `#ffffff` on assumed-black terminals or measure columns with Python `len()` |
64
+ | Escape dynamic strings with `rich.markup.escape(val)` or `markup=False` | Interpolate raw file paths or errors like `items[0]` into Rich markup |
65
+ | Put `Progress`, `Live`, and warnings on `Console(stderr=True)` and catch `BrokenPipeError` on `stdout` | Pollute piped `stdout` JSON with spinner ANSI codes or print `BrokenPipeError` on `\| head -n 5` |
66
+ | Emit plain line-based progress, `--json` mode, `0/1/2/130` exit codes, completions, and `man` page | Render cursor-rewriting live tables into CI log files or exit `0` on failures |
67
+ | Handle `KeyboardInterrupt` cleanly (`?25h` cursor restored, exit `130`) | Leave hidden cursors or raw Python tracebacks on `Ctrl+C` |
48
68
 
49
69
  ## Known traps
50
70
 
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.
71
+ Unescaped `[...]` brackets throwing `MarkupError`, `Progress` written to `stdout` breaking `jq` pipes, uncaught `BrokenPipeError` tracebacks when piped to `head`, Python `len()` misaligning CJK/ZWJ/Vietnamese columns, `NO_COLOR=1` or light-terminal themes rendering status invisible.
52
72
 
53
73
  ## Verification commands
54
74
 
55
75
  ```sh
56
- python -m pytest
57
76
  python -m compileall .
58
- python cli.py --help
59
- NO_COLOR=1 python cli.py 2>/dev/null || true
77
+ python -m pytest
78
+ NO_COLOR=1 COLUMNS=80 python cli.py --help
79
+ python cli.py --plain | head -n 5
60
80
  ```
61
81
 
62
- Inspect actual terminal output, piped output, width matrices, screen-reader/plaintext readability where relevant, interrupt behavior, and snapshot/golden text fixtures.
82
+ Unit tests and `Console(record=True, width=80, no_color=True)` string-capture fixtures provide repeatable `static`/snapshot evidence. Inspect actual dark and light terminal runs across `80`-column width, `NO_COLOR=1`, `--ascii`, piped `head -n 5`, and `Ctrl+C` interruption for `rendered` evidence; label untested emulators `not-checked`.
@@ -0,0 +1,80 @@
1
+ # Terminal protocols & capability detection
2
+
3
+ Modern terminal emulators (Ghostty, Kitty, WezTerm, Alacritty, iTerm2, Windows Terminal, foot) support rich protocols that eliminate flicker, unlock crisp keyboard shortcuts, and enable graphics and clipboard integration over SSH. Every protocol is **progressive enhancement**—never assume universal emulator or multiplexer (`tmux`/`screen`) support.
4
+
5
+ ## Modern terminal protocols
6
+
7
+ | Protocol | Sequence / contract | Purpose | Mandatory fallback & safety rule |
8
+ |---|---|---|---|
9
+ | **DEC Mode 2004** (Bracketed Paste) | Enable: `ESC [ ? 2004 h` · Disable: `ESC [ ? 2004 l` · Paste payload wrapped in `ESC [ 200 ~ ... ESC [ 201 ~` | Distinguishes pasted multi-line text from typed keystrokes. | **Mandatory** whenever reading raw/interactive input so pasting multi-line configs/SQL/commands never fires each newline as an accidental `Enter` submit! Always disable (`?2004l`) on exit. |
10
+ | **DEC Mode 2026** (Synchronized Output) | Begin: `ESC [ ? 2026 h` · End: `ESC [ ? 2026 l` (query via DECRQM `ESC [ ? 2026 $ p`) | Batches screen updates atomically so the terminal renders one complete frame with zero mid-frame tearing/flicker. | Safely ignored by older terminals; **always** emit `ESC [ ? 2026 l` on exit/panic so terminals never freeze waiting for end-of-frame. |
11
+ | **Graphics Protocols** (Kitty / Sixel / iTerm2) | Kitty `APC G ... ST` · Sixel `DCS q ... ST` · iTerm2 `OSC 1337 ; File=... BEL/ST` | Renders crisp thumbnails, charts, or previews inside character cells. | Probe support (or use `ratatui-image` / Chafa-style detection); degrade cleanly to **Unicode halfblocks (`▀`/`▄`)**, Braille, or an explicit text placeholder (`[Image: diagram.png]`) inside unsupported terminals or un-configured `tmux`/SSH. |
12
+ | **OSC 8 Hyperlinks** | `OSC 8 ; params ; URI ST label OSC 8 ; ; ST` | Makes labels clickable links in supporting terminals without cluttering narrow columns. | Never hide essential URLs behind `"click here"`—keep link text self-explanatory or print the raw URL in plain/`!isatty` output so piped logs and non-OSC-8 terminals still have the destination. |
13
+ | **Kitty Keyboard Protocol (`CSI u`)** | Push flags: `ESC [ > flags u` · Pop on exit: `ESC [ < u` | Disambiguates `Ctrl+I` vs `Tab`, `Ctrl+M` vs `Enter`, `Ctrl+[` vs `Esc`, `Shift+Enter`, and key release/repeat events. | Negotiate cleanly and **always pop (`ESC [ < u`) on exit/panic**; maintain legacy ANSI keybinding fallbacks so users on older terminals or basic SSH sessions can complete every task. |
14
+ | **OSC 52 Clipboard** | `OSC 52 ; c ; <base64-utf8> ST` | Copies text directly to the user's local clipboard even across remote SSH and `tmux` (`set-clipboard on`) without `pbcopy`/`xclip`/`wl-copy`. | Pair with local OS clipboard when running locally, respect emulator payload caps (~100 KB), handle security denial silently, and show visible copy confirmation. |
15
+ | **OSC 9;4 Progress** | `OSC 9 ; 4 ; <state> ; <0-100> ST` (`0`=clear, `1`=normal, `2`=error, `3`=indeterminate, `4`=paused) | Surfaces native taskbar/tab progress bars in Windows Terminal, Ghostty, WezTerm, and iTerm2. | Emit **only** to an interactive TTY and **always emit `state=0` (clear)** on completion, error exit, or `SIGINT` so stuck progress indicators never linger on the terminal tab. |
16
+
17
+ ## Grapheme-cluster column width (`UAX #29`) & `--ascii` fallback
18
+
19
+ **Never** compute terminal column width with `.length`, `.len()`, `len()`, or UTF-16 code units—every border and table column will misalign on real international text:
20
+
21
+ - Segment by **Unicode Standard Annex #29 (`UAX #29`) extended grapheme clusters** + **East Asian Width**:
22
+ - **CJK ideographs** (`日本語` / `中文`) = **`2` cols** per character;
23
+ - **ZWJ Emoji sequences** (`👨‍👩‍👧‍👦`) = **`2` cols** total (not 8 or 11);
24
+ - **Variation Selector-16 (`VS16`, `U+FE0F`)** (`⚠️`) = **`2` cols**;
25
+ - **Vietnamese & combining diacritics** (e.g., `Nguyễn` NFD combining marks `U+0300`–`U+036F`) = **`0` extra cols**.
26
+ - Use proven width libraries per runtime: `unicode-segmentation` + `unicode-width` (Rust), `rivo/uniseg` / `go-runewidth` / `lipgloss.Width` (Go), `Intl.Segmenter` + `string-width` (Node/Bun), and `wcwidth` / `rich.cells.cell_len` (Python).
27
+ - **`--ascii` & non-UTF-8 locale fallback**: when `--ascii` is passed, `TERM=dumb`, or `LC_ALL`/`LANG` is `C`/`POSIX` (non-UTF-8), replace Unicode box-drawing (`╭─╮` → `+--+`), Braille spinners (`⠋` → `- \ | /`), and status glyphs (`✔`/`✖` → `[OK]`/`[ERR]`).
28
+
29
+ ## 6-step panic & signal terminal restoration hook
30
+
31
+ Register a teardown hook covering normal exit, **`SIGINT`**, **`SIGTERM`**, **`SIGHUP`**, and uncaught **panics/exceptions** that executes all 6 restoration steps in order before writing any crash traceback:
32
+
33
+ 1. **Leave alternate screen**: `\x1b[?1049l`
34
+ 2. **Disable mouse tracking**: `\x1b[?1000l\x1b[?1002l\x1b[?1003l\x1b[?1006l`
35
+ 3. **Disable bracketed paste**: `\x1b[?2004l`
36
+ 4. **Disable synchronized output**: `\x1b[?2026l` (and clear `OSC 9;4` progress `\x1b]9;4;0;\x1b\\`)
37
+ 5. **Pop Kitty keyboard protocol flags**: `\x1b[<u`
38
+ 6. **Show cursor & exit raw mode**: `\x1b[?25h` + restore cooked `termios` / console mode.
39
+
40
+ ## Capability, stream hygiene, `SIGPIPE`, color tiers & `--plain` screen-reader mode
41
+
42
+ | Signal / Condition | Required behavior |
43
+ |---|---|
44
+ | **Startup latency & live resize (`80×24` + `120×36`)** | Boot in **`< 200 ms`** (`hyperfine`/`time`) for compact CLIs/TUIs via lazy subcommand/plugin imports; reflow cleanly with **zero tearing/flicker** across **`80×24`** and **`120×36`** live `SIGWINCH` resizes. |
45
+ | **Stream separation (`stdout` vs `stderr`)** | Interactive TUI chrome, spinners, progress bars, and human warnings go strictly to `stderr` (or alternate screen only when `isatty(stdout)`). Machine-parseable payloads (`--json`, `--plain`, CSV) go strictly to `stdout`. |
46
+ | **Downstream pipe close (`SIGPIPE` / `EPIPE` / `BrokenPipeError`)** | Piping into `head -n 5` or `jq` closes `stdout` early. Catch `BrokenPipe` / `EPIPE` / `BrokenPipeError` and exit `0` **silently**—never print uncaught stack traces or panic dumps! |
47
+ | **`NO_COLOR=1` / `TERM=dumb` / `CI=true` / `--plain` screen-reader mode** | Strip ANSI colors (`NO_COLOR=1`), disable CSI/OSC escapes (`TERM=dumb`), disable interactive prompts (`CI=true`), and provide **`--plain`** (linear, non-animated, cursor-stable text output with explicit `[OK]`/`[ERR]` markers so terminal screen readers like NVDA, VoiceOver, and TDSR/Fenrir are never spammed by redrawing spinners). |
48
+ | **`16-color` + `256-color` + truecolor themes** | **Never** hardcode `#ffffff` assuming a black terminal or `#000000` assuming a white terminal. Verify graceful downgrade across `COLORTERM=truecolor`, `TERM=xterm-256color` (`256-color` palette), and **`16-color` dark + light ANSI themes**. |
49
+
50
+ ## CLI & TUI distribution, `SHA-256` integrity & deliverables
51
+
52
+ Ship production terminal tools with complete operator ergonomics:
53
+ - **Standard flags & semantic exit codes**: `-h`/`--help`, `-V`/`--version`, `--json`, **`--plain`** (screen-reader non-animated mode), `--no-color`, `--ascii`; exit **`0`** on success, **`1`** on runtime/API failure, **`2`** on CLI usage/flag error, and **`130`** on `SIGINT` (`Ctrl+C`).
54
+ - **Shell completions & `man` page**: generate completions for **`bash`, `zsh`, `fish`, and `pwsh`** (`mycli completions <shell>`) plus a `roff` **`man` page** (`man 1 mycli`).
55
+ - **Checksums, signatures & clean uninstall**: publish **`SHA-256` (`SHA256SUMS`) checksums and cryptographic release signatures** (`cosign` / GPG / GitHub Attestations) across **Homebrew**, **Winget**, **Scoop**, **Cargo**, **npm**, or **PyPI**, paired with **documented uninstall instructions** removing binaries, completions, caches, and config files cleanly.
56
+ - **Required deliverable captures**: attach **`asciinema` (`.cast`) or Charm `VHS` recordings** plus rendered verification across **`iTerm2` / `Terminal.app`, `Windows Terminal`, `GNOME Terminal`, `tmux`, and `SSH`**.
57
+
58
+ ## Do/don't pairs
59
+
60
+ | Do | Don't |
61
+ |---|---|
62
+ | Boot in `< 200 ms` (`hyperfine`), enable `?2004h` Bracketed Paste, and run the 6-step teardown on panic/signal | Ship a `1.5 s` CLI cold start, fire `Enter` on multi-line paste, or leave `?1049h`/`?1003h`/`CSI u` stuck after a crash |
63
+ | Measure columns with `UAX #29` grapheme + East Asian Width + `--ascii` fallback across `80×24` and `120×36` live resizes | Align borders with `.length`/`.len()`, breaking CJK, `👨‍👩‍👧‍👦`, `⚠️`, and Vietnamese diacritics |
64
+ | Route spinners to `stderr`, JSON/plain data to `stdout`, support `--plain` screen-reader mode, and exit silently on `SIGPIPE` | Spam screen readers with `60 Hz` Braille spinner redraws or dump a stack trace on `mycli list \| head -n 5` |
65
+ | Verify `16-color` (dark+light), `256-color`, and `NO_COLOR=1` legibility | Hardcode `#ffffff` text invisible on Solarized/macOS Light terminals |
66
+ | Ship `--help`, `--version`, `0/1/2/130` exit codes, completions, `man` page, `SHA-256` checksums/signatures, and uninstall docs | Exit `0` on errors or ship unsigned archives with no checksums or uninstall cleanup |
67
+
68
+ ## Verification commands
69
+
70
+ ```sh
71
+ # Benchmark < 200ms startup latency and test capability degradation / SIGPIPE:
72
+ hyperfine --warmup 3 'your-cli --version'
73
+ NO_COLOR=1 your-cli --help
74
+ TERM=xterm-256color your-cli --help
75
+ TERM=dumb your-cli --plain | head -n 5
76
+ # Verify stdout remains free of ANSI escape sequences when piped:
77
+ if your-cli --plain | LC_ALL=C grep -q $'\x1b\['; then echo "FAIL: ANSI leaked"; exit 1; fi
78
+ ```
79
+
80
+ Piped escape, `SHA-256` checksum, and `head -n 5` `SIGPIPE` checks provide deterministic `static`/output evidence. Record **`hyperfine`/`time` (`< 200 ms`)**, **`asciinema`/`VHS` walkthroughs**, `80×24` + `120×36` live resize, `16-color`/`256-color`/`NO_COLOR=1`/`--plain` modes, and 6-step panic restoration across **`iTerm2`/`Terminal.app`, `Windows Terminal`, `GNOME Terminal`, `tmux`, and `SSH`** (`rendered`; label unavailable host OS emulators `not-checked`).
@@ -1,67 +1,108 @@
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:
1
+ # Textual (Python)
2
+
3
+ ## Token mapping & Textual v1–v3+ `Theme` API
4
+
5
+ Textual CSS (TCSS) uses **character cell units** (`1`, `2`, `1fr`, `50%`, `w`, `h`)—**never `px`** (pixel units are invalid in TCSS). Register semantic themes via the **`Theme`** API (`app.register_theme(...)`) and reference built-in semantic design variables (`$primary`, `$surface`, `$panel`, `$error`, `$text-muted`) across TCSS:
6
+
7
+ ```python
8
+ from textual.app import App, ComposeResult
9
+ from textual.theme import Theme
10
+
11
+ PC_THEME = Theme(
12
+ name="pixelcraft-dark",
13
+ primary="#5BB2FF",
14
+ secondary="#7EE787",
15
+ accent="#D2A8FF",
16
+ foreground="#E6EDF3",
17
+ background="#0D1117",
18
+ surface="#161B22",
19
+ panel="#21262D",
20
+ error="#F85149",
21
+ dark=True,
22
+ )
23
+ ```
8
24
 
9
25
  ```tcss
10
- $semantic-color-action: #0074ca;
11
- $space-control-inline: 4px;
26
+ /* Integer cell units only — never `px` */
27
+ $space-control-inline: 2;
12
28
 
13
- Button {
14
- background: $semantic-color-action;
29
+ Button.-primary {
30
+ background: $primary;
31
+ padding: 0 $space-control-inline;
15
32
  }
16
33
  ```
17
34
 
18
- Keep variables semantic and scoped intentionally. Do not hard-code repeated colors through TCSS/widget constructors when a variable can express the role.
35
+ Register the theme in `on_mount` (`self.register_theme(PC_THEME); self.theme = "pixelcraft-dark"`) so users can switch cleanly between light, dark, and high-contrast themes (including `textual-ansi` for 16-color/low-capability terminals).
36
+
37
+ ## Layout, `CommandPalette`, & responsive idioms
19
38
 
20
- ## Layout and responsive idioms
39
+ Use `Vertical`, `Horizontal`, `Grid`, `Container`, `TabbedContent`, `DataTable`, `Dock`, fractional (`1fr`) and cell sizing, and terminal-size CSS/reactive breakpoints. Test at `80×24` minimum and define which secondary pane collapses first.
21
40
 
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.
41
+ Expose keyboard-first command discovery through Textual's built-in **`CommandPalette`** (`Ctrl+P` by default) by adding custom `Provider` classes (`search` yielding `Hit` results) alongside concise `BINDINGS` displayed in `Footer`.
23
42
 
24
- ## Typography/custom fonts
43
+ ## Async workers (`@work(exclusive=True)`) & states idiom
25
44
 
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.
45
+ Never block the Textual asyncio event loop with disk/HTTP calls. Isolate async or blocking work in **`@work`** methods with explicit `exclusive=True` (automatically cancelling superseded refreshes when the user changes filters or navigates) and `thread=True` for blocking SDK calls:
27
46
 
28
- ## Motion/reduced motion
47
+ ```python
48
+ from textual import work
49
+ from textual.worker import get_current_worker
29
50
 
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.
51
+ class InvoiceApp(App):
52
+ @work(exclusive=True, thread=True)
53
+ def load_invoices(self, query: str) -> None:
54
+ worker = get_current_worker()
55
+ rows = fetch_blocking(query)
56
+ if not worker.is_cancelled:
57
+ self.call_from_thread(self.apply_rows, rows)
58
+ ```
59
+
60
+ Handle loading (`LoadingIndicator`), empty, error, offline, and worker-cancelled states visibly in the widget tree; preserve user input across `push_screen` / `pop_screen` modal dialogs and terminal resizes.
31
61
 
32
- ## Accessibility specifics
62
+ ## `UAX #29` width (`wcwidth`/`rich.cells`), Bracketed Paste, `OSC 52` & teardown
33
63
 
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.
64
+ - **Grapheme width & `--ascii`**: never compute terminal column alignment with Python `len(s)`—use **`rich.cells.cell_len`** or **`wcwidth.wcswidth`** so CJK (`2` cols), ZWJ emoji (`👨‍👩‍👧‍👦` = `2` cols), `VS16` (`⚠️` = `2` cols), and Vietnamese combining diacritics (`0` extra cols) align cleanly; provide `textual-ansi` (16-color dark+light safe) and ASCII borders (`border: ascii`) when `--ascii`, `TERM=dumb`, or non-UTF-8 locale is set.
65
+ - **Bracketed Paste (`DECSET 2004`) & `OSC 52` clipboard**: handle Textual's **`events.Paste`** (`?2004h`) in `Input` / `TextArea` / custom widgets so multi-line pastes never fire accidental `Enter` submissions, and call **`self.copy_to_clipboard(text)`** (which emits **`OSC 52`** automatically over remote SSH/`tmux`).
66
+ - **Stream hygiene, `BrokenPipeError`, & 6-step crash restoration**: only boot the alternate-screen Textual app when `sys.stdout.isatty()`; for `--json`/`--plain` CLI modes, write strictly to `sys.stdout`, catch **`BrokenPipeError`** (`os.dup2(os.open(os.devnull, os.O_WRONLY), sys.stdout.fileno())` + `sys.exit(0)` so `| head -n 5` exits silently without a Python traceback!), and ensure `SIGINT`/`SIGTERM`/`SIGHUP` + uncaught exception hooks complete the 6-step terminal reset (`?1049l`, mouse `?1000l/?1002l/?1003l/?1006l`, `?2004l`, `?2026l`, `\x1b[<u`, `?25h` + raw mode exit—see [terminal-protocols.md](terminal-protocols.md)).
67
+ - **Accessibility & CLI distribution**: ensure every task works strictly via keyboard (`Tab`/`Shift+Tab`, arrow keys, `Enter`, `Esc`, `CommandPalette`), pair colors with plain-text state markers (`[ERR]`, `[*]`), and ship `--help`, `--version`, `0/1/2/130` exit codes, `bash`/`zsh`/`fish`/`pwsh` completions (via Typer/Click/argcomplete), a `man` page, and `uv tool` / Homebrew / Scoop / Winget packaging.
35
68
 
36
- ## States idiom
69
+ ## Headless verification (`App.run_test()` / `Pilot` & SVG snapshots)
37
70
 
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.
71
+ Drive real keyboard workflows and narrow-terminal resize checks deterministically using **`App.run_test()`** and **`Pilot`**, paired with **`pytest-textual-snapshot`** (`snap_compare`) SVG snapshots:
39
72
 
40
- ## Forms idiom
73
+ ```python
74
+ import pytest
41
75
 
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.
76
+ @pytest.mark.asyncio
77
+ async def test_narrow_keyboard_flow():
78
+ app = InvoiceApp()
79
+ async with app.run_test(size=(80, 24)) as pilot:
80
+ await pilot.press("ctrl+p")
81
+ await pilot.press("escape")
82
+ assert app.focused is not None
83
+ ```
43
84
 
44
85
  ## Do/don't pairs
45
86
 
46
87
  | Do | Don't |
47
88
  |---|---|
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 |
89
+ | Use cell units (`padding: 0 2;`), registered `Theme` vars, and `textual-ansi` / `border: ascii` fallbacks | Write web pixel units (`4px`) or hardcode `#ffffff` unreadable on light 16-color terminals |
90
+ | Measure columns with `rich.cells.cell_len` / `wcwidth`, handle `events.Paste`, and use `copy_to_clipboard` (`OSC 52`) | Use Python `len(s)` on CJK/`👨‍👩‍👧‍👦`/Vietnamese text or let pasted newlines fire `Enter` submits |
91
+ | Use `@work(exclusive=True)`, catch `BrokenPipeError` on `--plain`/`--json`, and verify 6-step signal reset | Block asyncio, dump `BrokenPipeError` tracebacks on `\| head -n 5`, or leave `?1049h`/`?1003h` stuck |
92
+ | Test keyboard flows with `App.run_test(size=(80, 24))` + `Pilot` & `snap_compare` | Rely only on manually glancing at one wide developer terminal |
93
+ | Pair `BINDINGS` + `Footer` + `CommandPalette` + CLI completions (`bash`/`zsh`/`fish`/`pwsh`) + `man` page | Hide essential commands behind mouse-only clicks or ship without `--version`/completions |
53
94
 
54
95
  ## Known traps
55
96
 
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.
97
+ Invalid CSS `px` units in TCSS, blocking the asyncio loop with synchronous `requests` calls, Python `len()` miscounting CJK/ZWJ/combining marks, `BrokenPipeError` tracebacks on piped `--json` output, focus lost after closing `ModalScreen`, omitting non-interactive CLI fallback when piped in CI.
57
98
 
58
99
  ## Verification commands
59
100
 
60
101
  ```sh
61
- python -m pytest
62
- pytest --snapshot-update # only when intentionally updating
63
102
  python -m compileall .
64
- python app.py 2>/dev/null || true
103
+ python -m pytest
104
+ NO_COLOR=1 python app.py --help
105
+ python app.py --plain | head -n 5
65
106
  ```
66
107
 
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.
108
+ `compileall` and logic tests are `static`; `App.run_test`/`Pilot` and `snap_compare` SVGs verify headless rendering (`rendered` snapshot evidence). Also run in real dark and light terminal emulators at `80×24`, `TERM=dumb`/`NO_COLOR=1`, `--ascii`, multi-line paste, and piped `head -n 5` (`rendered`; label untested terminals `not-checked`).
@@ -1,6 +1,6 @@
1
1
  ---
2
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.
3
+ description: Designs rigorous user experience before and during implementation across any frontend stack. Use for task analysis, JTBD, user flows, information architecture, navigation, forms, passkeys, validation, empty/error/loading/offline and AI/streaming states, feedback timing, perceived performance, cognitive-load reduction, cognitive walkthrough, usability testing, localization-ready UX (i18n, RTL), UX writing, and interaction recovery.
4
4
  license: MIT
5
5
  metadata:
6
6
  version: 0.1.0
@@ -16,9 +16,9 @@ UX precedes styling. Establish user intent, task sequence, state coverage, and r
16
16
  - Read [references/cognitive-walkthrough.md](references/cognitive-walkthrough.md) when judging first-use learnability or step-by-step task completion.
17
17
  - Read [references/usability-testing.md](references/usability-testing.md) when behavioral uncertainty requires real-user evidence rather than inspection.
18
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.
19
+ - Read [references/forms.md](references/forms.md) for labels, validation, input preservation, autofill, paste, mobile keyboards, redundant entry, passkeys, cross-platform `IME` composition `Enter`/`Escape` guards, and error recovery.
20
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.
21
+ - Read [references/i18n.md](references/i18n.md) before layout/copy for `+30–40%` prose vs `+50–100%` short-label expansion, `Unicode NFC` & Vietnamese/stacked-diacritic glyph coverage, `IME` safety, RTL, and ICU/MF2 plurals.
22
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
23
  - Read [references/ux-writing.md](references/ux-writing.md) for microcopy, actions, errors, empty states, and tone by mode.
24
24
  - Read [references/laws.md](references/laws.md) when applying Hick, Fitts, Jakob, Doherty, recognition-over-recall, and cognitive-load evidence.
@@ -27,20 +27,30 @@ UX precedes styling. Establish user intent, task sequence, state coverage, and r
27
27
 
28
28
  1. **Define job:** actor, triggering situation, desired outcome, constraints, success signal, frequency, expertise, locale/accessibility needs.
29
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.
30
+ 3. **Diverge IA & workflow (greenfield / redesign):** before locking one layout or navigation pattern, compare **2–3 competing flow/IA shapes** (e.g., master-detail workbench vs. stepped drawer vs. inline ledger; single-screen workspace vs. tabbed routes) against step count, context preservation, and recovery cost. Record why the rejected shapes lost. Skip only when existing product IA or an approved spec fixes the flow.
31
+ 4. **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.
32
+ 5. **Complete the mandatory core state matrix:** do not build only the happy path. Explicitly specify and wire every applicable core state: **empty** (first-use + no-results), **loading** (stable skeleton/progress without layout shift), **error** (cause + preserved input + recovery action), **disabled** (why disabled + how to unlock), **offline / degraded network**, **permission / unauthorized**, **long-content / overflow / extreme counts**, and **AI / streaming** (pending, partial tokens, abort/stop, citation provenance, side-effect approval).
33
+ 6. **Design interaction copy and feedback:** concrete domain verbs, response-time budgets, progress, undo/recovery; zero AI marketing clichés (`references/ux-writing.md`).
34
+ 7. **Reduce cognitive load:** smart defaults, recognition over recall, progressive disclosure, grouped decisions.
35
+ 8. **Apply logical layout, expansion budgets & `IME`/`NFC` safety by default:** use logical directional properties (`inline-start`/`inline-end`, leading/trailing), budget `+30–40%` prose and `+50–100%` short-label expansion, normalize `Unicode NFC` diacritics with verified glyph coverage (`ư, ơ, ệ`), guard `Enter`/`Escape` during active `IME` composition, and format dates/numbers/plurals via locale APIs **even on English-first apps**.
36
+ 9. **Validate against platform conventions & record risks:** back/escape, scroll restoration, shortcuts, gestures, focus/controller behavior, and unresolved UX risks with evidence labels.
37
37
 
38
- ## Non-negotiable checks
38
+ ## Non-negotiable checks & anti-slop guard
39
39
 
40
40
  - Do not ask for information already available, inferable, previously entered, or low-value at the moment of use.
41
41
  - Preserve user input across validation, navigation, authentication expiry, network failure, and accidental refresh where feasible.
42
+ - Guard `Enter`/`Escape` key handlers on search bars, chat composers, inline editors, and dialogs against active `IME` composition (`isComposing`, `markedTextRange`, `composition != null`, `hasMarkedText`).
42
43
  - Every destructive action provides proportional undo, confirmation, or explicit irreversibility friction.
43
44
  - Every async action exposes pending/success/failure/cancellation/retry semantics.
44
45
  - Navigation state survives back/forward, refresh, deep link, logout/login, and app relaunch as appropriate.
45
46
  - 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.
47
+ - **Anti-slop UX guard:** never ship a happy-path-only wireframe, dead-end `"No items yet"` empty state, `"Oops! Something went wrong"` error toast, vague `"Submit"`/`"Learn more"` buttons, AI hype microcopy, or half-wired forms that wipe entered values on validation failure.
48
+
49
+ ## Pre-submit checklist
50
+
51
+ - [ ] 2–3 competing IA/workflow shapes compared and recorded for undecided greenfield/redesign flows (or existing/approved IA cited).
52
+ - [ ] All applicable core states specified and wired: `empty`, `loading`, `error`, `disabled`, `offline`, `permission`, `long-content`, and `AI/streaming`.
53
+ - [ ] User input preserved across errors and retries; `Enter`/`Escape` guarded during active `IME` composition; destructive actions have proportionate undo or confirmation.
54
+ - [ ] Logical layout direction (`inline-start`/leading), `+50–100%` short-label / `+30–40%` prose expansion, `Unicode NFC` diacritic glyph integrity, and locale-aware formatting applied.
55
+ - [ ] All CTAs, headings, errors, and empty states use concrete domain nouns/verbs with zero AI marketing clichés or fake proof.
56
+ - [ ] Primary task verified without hover, via keyboard/platform back-escape, and labeled honestly (`rendered`, `static`, `model-judgment`, or `not-checked`).