@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,6 +1,6 @@
1
1
  ---
2
2
  name: pixelcraft-tui
3
- description: Translates Pixelcraft direction, tokens, UX, and floor requirements into terminal user interfaces across Textual, Rich, Ink, Bubble Tea/Lip Gloss, and Ratatui. Use for keyboard-first CLI apps, dashboards, installers, logs, forms, terminal layout, character-grid composition, color/unicode fallback, NO_COLOR behavior, resizing, snapshots, accessibility, and state feedback.
3
+ description: Translates Pixelcraft direction, tokens, UX, and floor requirements into terminal user interfaces across Textual, Rich, Ink, Bubble Tea v2/Lip Gloss, Ratatui, Terminal.Gui, Spectre.Console, prompt_toolkit, OpenTUI, FTXUI, and Clack/CLI prompts. Use for keyboard-first CLI apps, dashboards, installers, logs, forms, character-grid layout, Kitty/Sixel/OSC 8/DEC 2026 terminal protocols, NO_COLOR fallback, resizing, snapshots, accessibility, and state feedback.
4
4
  license: MIT
5
5
  metadata:
6
6
  version: 0.1.0
@@ -16,45 +16,61 @@ Give repeated keyboard work stable regions: list or prompt, result, status and a
16
16
 
17
17
  ## Detection signals
18
18
 
19
- Python `textual`/`rich`, Node `ink`, Go `bubbletea`/`lipgloss`/`tcell`/`tview`, Rust `ratatui`/`crossterm`, alternate-screen/raw-mode setup, keybinding tables, snapshot tests, terminal capability handling.
19
+ Python `textual`/`rich`/`prompt_toolkit`/`questionary`, Node/Bun `ink`/`@inkjs/ui`/`@opentui/*`/`@clack/prompts`/`@inquirer/prompts`, Go `bubbletea`/`lipgloss`/`huh`/`tcell`/`tview`, Rust `ratatui`/`crossterm`/`cliclack`/`inquire`/`dialoguer`, .NET `Terminal.Gui`/`Spectre.Console`, C++ `ftxui`/`notcurses`, alternate-screen/raw-mode setup, keybinding tables, snapshot tests, and terminal capability handling.
20
20
 
21
21
  ## Translate direction to terminal idioms
22
22
 
23
23
  1. Treat cells/rows/columns as the layout system. Establish alignment, scanlines, density, focus, and rhythm explicitly.
24
24
  2. Map tokens to semantic styles supported by the framework; do not assume truecolor, Unicode width, mouse support, or persistent screen size.
25
25
  3. Keyboard-first means every task has discoverable keys, focus/order, escape/cancel behavior, help, and no hidden mouse-only path.
26
- 4. Use color as enhancement; meaning must survive 16-color, monochrome, low contrast, and `NO_COLOR` environments.
27
- 5. Unicode box glyphs/braille/sparklines need fallback glyphs or graceful degradation because width/support varies.
28
- 6. Design resize behavior: minimum dimensions, truncation/wrapping, pane priority, scrollback vs alternate screen, and terminal reflow.
26
+ 4. Use color as enhancement; meaning must survive 16-color, monochrome, low contrast, `TERM=dumb`, and `NO_COLOR` environments.
27
+ 5. Unicode box glyphs/braille/sparklines/graphics protocols need fallback glyphs or plain-text degradation because terminal and `tmux` support varies.
28
+ 6. Design resize behavior: minimum dimensions (`80Γ—24`), truncation/wrapping, pane priority, scrollback vs alternate screen, and terminal reflow.
29
29
 
30
30
  ## Platform-wide rules
31
31
 
32
- - Do not spam full-screen redraws/log output; preserve orientation and make current state visible.
33
- - Interactive UI and machine-readable output are different modes. Provide noninteractive/plain output where automation matters.
34
- - Respect stdout/stderr separation, tty detection, piped output, terminal width, locale encoding, and CI constraints.
35
- - Never require color, emoji, mouse, hyperlinks, or exact terminal emulator features unless detected or explicitly documented.
36
- - Progress is truthful and cancellable; keyboard interrupt handling is part of UX.
37
- - Terminal accessibility is limited and emulator-dependent: avoid color-only state, rapid flashing, cursor traps, and unreadable dense glyph art.
32
+ - **Startup latency & flicker-free live resize**: hit **`< 200 ms` cold startup latency** (measured with `hyperfine` or `time`) for compact CLIs/TUIs, and verify **flicker-free live resize** across **`80Γ—24`** (minimum floor) and **`120Γ—36`** (standard workspace) using DEC Mode `2026` synchronized output where supported.
33
+ - **Grapheme-cluster width (`UAX #29`) & `--ascii` fallback**: **never** measure column width with `.length`, `.len()`, or UTF-16 code units! Compute **`UAX #29` grapheme-cluster + East Asian Width** (`unicode-width` + `unicode-segmentation` in Rust, `uniseg`/`go-runewidth` in Go, `Intl.Segmenter` + `string-width` in Node, `wcwidth`/`rich.cells` in Python) so **CJK (`2` cols), ZWJ Emoji (`πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦` = `2` cols), `VS16` (`⚠️` = `2` cols), and Vietnamese combining diacritics (`0` extra cols)** never corrupt box borders; degrade to `--ascii` / `+--+` glyphs when `TERM=dumb` or locale is non-UTF-8.
34
+ - **`DECSET 2004` Bracketed Paste & `OSC 52` clipboard**: enable Bracketed Paste (`\x1b[?2004h` … `\x1b[?2004l`) on interactive inputs so multi-line pastes never fire each newline as an accidental `Enter` confirmation; support **`OSC 52`** escape sequences for copying over remote SSH/`tmux` sessions alongside local OS clipboards.
35
+ - **Stream hygiene, `SIGPIPE`, color tiers & `--plain` screen-reader mode**: send interactive TUI chrome, spinners, and progress bars to `stderr` (or alternate screen only when `isatty(stdout)`); write machine-parseable output (`--json`, `--plain`) strictly to `stdout`; handle **`SIGPIPE` / `EPIPE` / `BrokenPipeError`** (`| head -n 5` / `| jq`) silently without stack traces; and verify **`16-color` (dark + light ANSI)**, **`256-color`**, **`NO_COLOR=1`**, `TERM=dumb`, `CI=true`, and a **`--plain` screen-reader non-animated mode** (linear line-by-line output with zero cursor-rewriting spinners).
36
+ - **6-step panic & signal terminal restoration**: on normal exit, `SIGINT`, `SIGTERM`, `SIGHUP`, and uncaught panics/exceptions, execute all 6 teardown steps in order: **(1)** leave alternate screen `?1049l`, **(2)** disable mouse tracking `?1000l/?1002l/?1003l/?1006l`, **(3)** disable bracketed paste `?2004l`, **(4)** disable synchronized output `?2026l` (and clear `OSC 9;4` progress), **(5)** pop Kitty keyboard flags `\x1b[<u`, **(6)** show cursor `?25h` & exit raw mode.
37
+ - **CLI distribution, `SHA-256` signatures & uninstall contract**: ship `--help`, `--version`, semantic exit codes (**`0`** ok, **`1`** runtime error, **`2`** usage error, **`130`** `SIGINT`), **shell completions (`bash`, `zsh`, `fish`, `pwsh`)**, a `man` page, Homebrew/Winget/Scoop/Cargo/npm binary packaging, **release `SHA-256` checksums/signatures**, and **explicit uninstall instructions** (cleaning binaries, completions, and config paths).
38
+
39
+ ## Anti-lazy-default & anti-slop guard
40
+
41
+ - **Reject raw `print()` / `console.log()` / manual ANSI escape spaghetti** (`\x1b[31m...`) when structured TUI/CLI libraries fit the language: **Rich** / **Textual** (Python), **Bubble Tea v2 + Lip Gloss v2 + Huh** (Go), **Ratatui** (Rust), **Ink** / **`@clack/prompts`** (Node/Bun), or **Spectre.Console** / **Terminal.Gui v2** (.NET).
42
+ - **Match buffer mode to task scope**: use inline CLI prompts/output for one-shot commands and reserve full-screen alternate-buffer TUIs for persistent interactive workspaces; reject decorative ASCII banners that crowd out real data at `80Γ—24`.
38
43
 
39
44
  ## Common TUI failures
40
45
 
41
- - decorative ASCII art consuming the only useful viewport;
42
- - emoji/unicode width corruption in CJK or narrow terminals;
43
- - color-only diffs/status;
44
- - keybindings conflicting with shell/readline/IME expectations;
45
- - panes disappearing at 80Γ—24 or smaller;
46
- - no noninteractive fallback in CI/pipes;
47
- - focus invisible or state lost after resize;
48
- - full-screen alternate buffer used for simple one-shot output.
46
+ - measuring columns with `.length`/`.len()` so CJK, ZWJ emoji (`πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦`), `⚠️`, or Vietnamese diacritics break borders;
47
+ - `> 500 ms` sluggish startup, missing `--plain` non-animated screen-reader mode, or tearing on `80Γ—24` ↔ `120Γ—36` live resize;
48
+ - missing `?2004h` Bracketed Paste causing pasted multi-line configs to execute every line on `Enter`;
49
+ - crashing with `BrokenPipeError` / `EPIPE` / Rust `.unwrap()` panic when piped into `head -n 5`, or leaking spinner ANSI to `stdout`;
50
+ - hardcoded `#ffffff` text unreadable on light 16-color terminals, or color-only diffs invisible under `NO_COLOR=1`;
51
+ - incomplete panic/signal teardown leaving `?1049h`, mouse tracking `?1003h`, `?2026h`, or Kitty `CSI u` stuck in the user's shell;
52
+ - missing `--version`, completions, `man` page, `SHA-256` release checksums, uninstall instructions, or exiting `0` on failure.
49
53
 
50
54
  ## Verification options
51
55
 
52
- TUI rendering can be inspected with actual terminal runs, framework test backends, snapshot tests, width/height fixtures, piped-output tests, NO_COLOR/TERM/color-term matrices, and keyboard-driven integration tests. Textual supports SVG snapshot tests through `pytest-textual-snapshot`; Ratatui supports `TestBackend` and insta-style snapshot testing. Passing a unit test without a buffer/snapshot is not visual evidence.
56
+ Passing a unit test without a rendered frame/buffer/recording is `static`, never `rendered` (**Rule #0.3**). Deliver `hyperfine`/`time` startup benchmarks (`< 200 ms`), **`asciinema` or Charm `VHS` terminal recordings**, framework snapshot tests (`Pilot`, `TestBackend`+`insta`, `Teatest`, `ink-testing-library`), and rendered checks across **`iTerm2` / `Terminal.app`, `Windows Terminal`, `GNOME Terminal`, `tmux`, and `SSH`** (`rendered`, labeling unavailable OS emulators `not-checked`).
57
+
58
+ ## Pre-submit checklist
59
+
60
+ - [ ] zero `TODO`s, placeholder stubs, dead keybindings, or raw hardcoded ANSI escape spaghetti;
61
+ - [ ] **`< 200 ms` startup latency** (`hyperfine`/`time`), **`UAX #29` grapheme width** (CJK `2`, ZWJ emoji `2`, `VS16` `2`, Vietnamese diacritics `0`), `--ascii` fallback, and **flicker-free `80Γ—24` + `120Γ—36` live resize** verified;
62
+ - [ ] `DECSET 2004` Bracketed Paste (`?2004h`…`?2004l`) and `OSC 52` SSH/`tmux` + local clipboard wired;
63
+ - [ ] `stderr`/`stdout` separation, silent `SIGPIPE`/`EPIPE`/`BrokenPipeError` exit (`| head -n 5`), **`16-color` (dark+light)**, **`256-color`**, **`NO_COLOR=1`**, `TERM=dumb`, `CI=true`, and **`--plain` screen-reader non-animated mode** verified;
64
+ - [ ] full 6-step terminal restoration (`?1049l`, mouse `?1000–1006l`, `?2004l`, `?2026l`, `\x1b[<u`, `?25h` + raw mode) verified on exit, `SIGINT`/`SIGTERM`/`SIGHUP`, and panic;
65
+ - [ ] `--help`, `--version`, `0/1/2/130` exit codes, `bash`/`zsh`/`fish`/`pwsh` completions, `man` page, **`SHA-256` release checksums/signatures + uninstall instructions**, and **`asciinema`/`VHS` + multi-terminal (`iTerm2`/`Terminal.app`, `Windows Terminal`, `GNOME Terminal`, `tmux`, `SSH`)** deliverables verified or labeled `not-checked`;
66
+ - [ ] **Checklist-Until-Passing Stop-Gate (`<HARD-GATE>`):** walk every checklist item above + run `slop-scan.mjs --fail-on p2`, `check-tui.mjs` (`--cols 80`, `--cols 120`, `NO_COLOR=1`), compiler/tests, and `check-acceptance.mjs .pixelcraft/acceptance.json` (`pixelcraft-review`) in a `Fix β†’ Re-verify` loop until passing (`0` `fail`/`pending` rows, `rendered` evidence on visual/perf/a11y per `Rule #0.3`).
53
67
 
54
68
  ## Framework routing
55
69
 
56
- - Read [references/textual.md](references/textual.md) for Textual apps/widgets/CSS.
57
- - Read [references/rich.md](references/rich.md) for Rich output, live display, logging, and prompt-adjacent use.
58
- - Read [references/ink.md](references/ink.md) for Ink/React terminal UI.
59
- - Read [references/bubbletea-lipgloss.md](references/bubbletea-lipgloss.md) for Bubble Tea/Lip Gloss Go TUI.
60
- - Read [references/ratatui.md](references/ratatui.md) for Rust Ratatui.
70
+ - Read [references/terminal-protocols.md](references/terminal-protocols.md) when implementing DEC Mode 2026 synchronized output, Kitty/Sixel/iTerm2 graphics fallbacks, OSC 8 hyperlinks, Kitty keyboard protocol (`CSI u`), OSC 52 clipboard, OSC 9;4 progress, or `NO_COLOR`/`TERM`/`isatty` capability handling.
71
+ - Read [references/textual.md](references/textual.md) when building Python Textual apps with `Theme`, TCSS cell units, `CommandPalette`, `@work(exclusive=True)`, and `Pilot`/SVG snapshots.
72
+ - Read [references/rich.md](references/rich.md) when building Python Rich CLI output, `Theme` consoles, `stderr` progress/live displays, or markup-safe logging.
73
+ - Read [references/ink.md](references/ink.md) when building Node/Bun Ink 5/6 (React 19) terminal UIs with `<Static>`, `useInput`, `useFocus`, `@inkjs/ui`, and `ink-testing-library`.
74
+ - Read [references/bubbletea-lipgloss.md](references/bubbletea-lipgloss.md) when building Go Bubble Tea v2 / Lip Gloss v2 TUIs or using the Charm ecosystem (Huh, Bubbles, Glamour, Gum, Fang, Teatest).
75
+ - Read [references/ratatui.md](references/ratatui.md) when building Rust Ratatui (`0.28–0.30+`) TUIs with `ratatui::run`/`init`+`restore`, `Constraint::Fill`/`Flex`, `ratatui-image`, and `TestBackend`+`insta`.
76
+ - Read [references/extended-tui-toolkits.md](references/extended-tui-toolkits.md) when building .NET `Terminal.Gui v2` or `Spectre.Console`, Python `prompt_toolkit`, `OpenTUI`, C++ `FTXUI`, `Notcurses`, Go `tcell`/`tview`, migrating off Blessed, or choosing inline CLI prompts (`@clack/prompts`, `@inquirer/prompts`, `questionary`, `cliclack`/`inquire`/`dialoguer`).
@@ -1,60 +1,79 @@
1
- # Bubble Tea + Lip Gloss (Go)
1
+ # Bubble Tea & Lip Gloss (Go / Charm ecosystem)
2
2
 
3
- ## Token mapping
3
+ ## Bubble Tea v2 & Lip Gloss v2 idioms
4
4
 
5
- Define semantic Lip Gloss styles centrally:
5
+ Bubble Tea **v2** (alongside v1 in existing reposβ€”check `go.mod` module path before editing) introduces major craft and performance upgrades:
6
+
7
+ - **Declarative `tea.View` struct (v2)**: `View()` returns a `tea.View` value (e.g., `tea.NewView(content)`) where `AltScreen`, `MouseMode`, `WindowTitle`, `ProgressBar` (OSC 9;4), and cursor position are declared directly from model state instead of imperative startup options or command toggles.
8
+ - **Cursed Renderer**: cell-level diffing renderer minimizing terminal writes and flicker on high-frequency updates.
9
+ - **Built-in Kitty Keyboard Protocol & `tea.KeyPressMsg`**: accurate disambiguation of `shift+enter`, `ctrl+i` vs `tab`, and release events while degrading gracefully on legacy terminals.
10
+ - **Lip Gloss v2**: built-in **`table`**, **`tree`**, and **`list`** subpackages, compositing **`Layer` / `Canvas`** for clean modal overlays over panes without corrupting background cells, and automatic color **downsampling** (TrueColor β†’ ANSI 256 β†’ ANSI 16 β†’ ASCII/`NO_COLOR`) via color profile detection.
6
11
 
7
12
  ```go
8
- var actionStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#0074ca"))
13
+ // Bubble Tea v2 declarative View() + semantic Lip Gloss styles:
14
+ type PcStyles struct {
15
+ Action lipgloss.Style
16
+ Error lipgloss.Style
17
+ Focus lipgloss.Style
18
+ }
19
+
20
+ func (m model) View() tea.View {
21
+ content := m.styles.Focus.Render("> "+m.selectedTitle()) + "\n" + m.helpView()
22
+ v := tea.NewView(content)
23
+ v.AltScreen = true
24
+ v.WindowTitle = "Invoices"
25
+ return v
26
+ }
9
27
  ```
10
28
 
11
- Use semantic variables (`actionStyle`, `errorStyle`) rather than raw color/style literals scattered through model/view code. Color profile detection should influence output; do not assume truecolor.
12
-
13
- ## Layout and responsive idioms
14
-
15
- Use width/height messages to recompute layout, Lip Gloss join/place/align helpers deliberately, truncation/wrapping libraries/helpers carefully, and define minimum terminal dimensions. Keep scanlines/alignment stable across updates. Alternate screen vs inline output is an intentional choice.
16
-
17
- ## Typography/custom fonts
18
-
19
- Terminals control fonts. Use bold/faint/italic/underline/reverse/color and spacing. Unicode width and emoji/CJK behavior need width-aware libraries/fallbacks. Do not center everything by naive string length because printable width differs.
29
+ *(In Bubble Tea v1 repos, `View() string` returns the string directly and `tea.WithAltScreen()` is passed to `tea.NewProgram`.)*
20
30
 
21
- ## Motion/reduced motion
31
+ ## Broader Charm ecosystem decision table
22
32
 
23
- Use ticks/spinner/progress truthfully. Avoid high-frequency redraw loops. Provide quiet/no-color/noninteractive modes and cancel timers/ticks correctly. Reduced-motion support is terminal-limited; do not depend on motion for meaning.
33
+ Reuse first-party Charm libraries instead of reimplementing terminal primitives from scratch:
24
34
 
25
- ## Accessibility specifics
35
+ | Library | Role | When to use |
36
+ |---|---|---|
37
+ | **Bubbles** | Core widgets (`textinput`, `textarea`, `viewport`, `table`, `list`, `progress`, `spinner`, `help`, `key`) | Standard interactive controls inside Bubble Tea apps with built-in keymaps |
38
+ | **Huh** | Interactive CLI forms & multi-step wizards (`huh.NewForm`) | Setup wizards, config prompts, validated inputs; supports **`huh.WithAccessible(true)`** screen-reader-friendly linear mode |
39
+ | **Glamour** | Styled terminal Markdown renderer | Release notes, docs, AI responses, help pages with width-aware wrapping |
40
+ | **Gum** | Composable shell-scriptable TUI primitives | Bash/CI scripts needing quick filter/choose/confirm/spin UX without a Go binary |
41
+ | **Fang** | Modern Cobra CLI wrapper | Styled help text, manpages, version output, and shell completions out of the box |
42
+ | **Teatest** | Headless Bubble Tea test harness (`x/exp/teatest`) | Automated keystroke simulation, resize tests, and golden output assertions |
26
43
 
27
- Keyboard-first key map, visible cursor/selection/focus, escape/cancel/back semantics, plaintext state markers, no color-only meaning, stdout/stderr separation, screen-reader-readable output where possible, and no hidden mouse-only functionality.
44
+ ## Token mapping, `UAX #29` width, & `--ascii` fallback
28
45
 
29
- ## States idiom
46
+ Centralize semantic `lipgloss.Style` definitions in one styles struct derived from detected terminal color profile / light-dark background (`lipgloss.HasDarkBackground` / v2 background-color query) so colors never clash on light terminals or disappear under `NO_COLOR=1` (never hardcode `#ffffff` or `#000000` without adapting to background luminance).
30
47
 
31
- Bubble Tea model-update-view architecture makes state explicitβ€”use it. Represent loading/error/empty/offline/permission/cancelled/concurrent operations in the model. Commands need cancellation/timeout/error messages; avoid duplicate commands on repeated keys. Preserve input in model state across resize/navigation.
48
+ Always recompute pane widths/heights on `tea.WindowSizeMsg` using **`lipgloss.Width(...)`**, **`github.com/rivo/uniseg`** (`uniseg.StringWidth` / `uniseg.NewGraphemes`), or `go-runewidth`β€”**never** Go `len(str)` or `utf8.RuneCountInString(str)`, which corrupt borders on CJK (`2` cols), ZWJ emoji (`πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦` = `2` cols), `VS16` (`⚠️` = `2` cols), and Vietnamese combining diacritics (`0` extra cols). Switch `lipgloss.RoundedBorder()` to `lipgloss.ASCIIBorder()` when `--ascii`, `TERM=dumb`, or non-UTF-8 locale is detected, and define a clean `80Γ—24` minimum layout.
32
49
 
33
- ## Forms idiom
50
+ ## Bracketed Paste, `OSC 52`, `SIGPIPE`, 6-step teardown & CLI packaging
34
51
 
35
- Use textinput/textarea/list/help/bubbles-style components or explicit model state with labels/instructions, validation timing, cursor/paste behavior verification, error copy, back/cancel semantics, and noninteractive flags.
52
+ - **Bracketed Paste (`DECSET 2004`) & `OSC 52` clipboard**: handle `tea.PasteMsg` (Bubble Tea enables `?2004h` automatically) so pasted multi-line configs enter `textarea`/`textinput` cleanly without firing `enter` per newline; copy via **`OSC 52`** (`github.com/aymanbagabas/go-osc52/v2` / Bubble Tea v2 `tea.SetClipboard`) alongside local OS clipboard so remote SSH/`tmux` copies work out of the box.
53
+ - **Stream hygiene, `EPIPE`, & 6-step panic/signal restoration**: run interactive Bubble Tea on `tea.WithOutput(os.Stderr)` when `stdout` must emit pipeable selections, write `--json`/`--plain` strictly to `os.Stdout` while ignoring `errors.Is(err, syscall.EPIPE)` (exiting `0` silently on `| head -n 5`), and ensure `recover()` + `SIGINT`/`SIGTERM`/`SIGHUP` handlers complete the full 6-step terminal reset (`?1049l`, mouse `?1000l/?1002l/?1003l/?1006l`, `?2004l`, `?2026l`, `\x1b[<u`, `?25h` + raw mode restoreβ€”see [terminal-protocols.md](terminal-protocols.md)).
54
+ - **Accessibility, exit codes & distribution**: keep `tea.Tick` bounded, cancel async work via `context.Context` + request generation IDs, honor `ACCESSIBLE=1` (`huh.WithAccessible(true)`), use semantic exit codes (`0`, `1`, `2`, `130`), and wire **Fang** / Cobra to emit `--help`, `--version`, **`bash`/`zsh`/`fish`/`pwsh` completions**, **`man` pages**, and **GoReleaser** Homebrew/Winget/Scoop binaries.
36
55
 
37
56
  ## Do/don't pairs
38
57
 
39
58
  | Do | Don't |
40
59
  |---|---|
41
- | centralized semantic styles | raw ANSI/color literals throughout views |
42
- | update layout on `tea.WindowSizeMsg` | fixed width captured once at startup |
43
- | explicit model state machine | boolean soup and duplicated async commands |
44
- | plain marker + color for selection | color-only invisible selection |
45
- | cancel/timeout command ownership | goroutine/cmd results mutating stale state |
60
+ | Measure/truncate graphemes with `lipgloss.Width` / `rivo/uniseg` + `lipgloss.ASCIIBorder()` fallback | Align columns with `len(s)` or `utf8.RuneCountInString(s)` (corrupts CJK, `πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦`, and Vietnamese) |
61
+ | Handle `tea.PasteMsg` (`?2004h`), `OSC 52` SSH copy, and full 6-step reset on panic/signal | Treat pasted newlines as `Enter` submits or leave `?1049h`/`CSI u` active on panic |
62
+ | Route TUI chrome to `stderr` when piping, ignore `syscall.EPIPE` on `stdout`, and ship Fang/Cobra completions + `man` | Pollute `stdout` JSON with spinner ANSI codes or print errors on `mycli --plain \| head -n 5` |
63
+ | Recompute layout on every `tea.WindowSizeMsg` (tested at `80Γ—24`) + light/dark-adaptive styles | Hard-code `120` columns or `#ffffff` text unreadable on light terminals |
64
+ | Use Bubble Tea v2 `tea.View` + Lip Gloss v2 `Layer` + **Huh** (`WithAccessible`) + **Teatest** | Mix v1 `tea.EnterAltScreen` commands with v2 `tea.View` or skip automated TUI tests |
46
65
 
47
66
  ## Known traps
48
67
 
49
- Unicode width miscalculation, unbounded redraw frequency, stale async command results, terminal color profile differences, focus/key conflicts, resize truncation, alternate-screen misuse, scrollback behavior, hidden noninteractive incompatibility.
68
+ Measuring printable width with `len()` or `RuneCountInString()` instead of `lipgloss.Width()` / `uniseg`, forgetting `recover()` cleanup when spawning custom goroutines, leaving alt-screen/raw mode active on non-TTY piped output, unhandled `EPIPE` errors when piped to `head`, ignoring light-background terminal contrast.
50
69
 
51
70
  ## Verification commands
52
71
 
53
72
  ```sh
54
73
  go test ./...
55
74
  go vet ./...
56
- go run ./cmd/app --help
57
- NO_COLOR=1 go run ./cmd/app 2>/dev/null || true
75
+ NO_COLOR=1 COLUMNS=80 go run ./cmd/app --help
76
+ go run ./cmd/app --plain | head -n 5
58
77
  ```
59
78
 
60
- Use actual terminal runs, golden output/snapshot tests where configured, narrow/wide matrices, piped/non-TTY behavior, keyboard-driven tests, interrupt/cancel paths, and color-capability matrices.
79
+ `go test` (including **Teatest** golden-file simulations) and `go vet` provide `static`/virtual-buffer evidence. Run the binary in real dark and light terminals at `80Γ—24`, `NO_COLOR=1`, `TERM=dumb`, `--ascii`, multi-line paste, and piped `head -n 5` for `rendered` evidence; label untested emulators `not-checked`.
@@ -0,0 +1,127 @@
1
+ # Extended TUI toolkits & CLI prompt libraries
2
+
3
+ For Python Textual/Rich, Node Ink, Go Bubble Tea/Lip Gloss, and Rust Ratatui, read their dedicated references in `pixelcraft-tui`. Use this reference for **.NET (`Terminal.Gui v2`, `Spectre.Console`), Python `prompt_toolkit`, OpenTUI, C++ `FTXUI`, `Notcurses`, Go `tcell`/`tview`, legacy Blessed migration, and inline CLI prompt libraries**.
4
+
5
+ ## CLI prompts vs full-screen TUI (choose the right surface first)
6
+
7
+ Do **not** launch an alternate-screen full-screen TUI for a linear setup wizard, scaffolder, or one-shot confirmationβ€”preserving terminal scrollback makes copy-paste, error inspection, and CI debugging far cleaner:
8
+
9
+ | Mode | When to choose | Modern libraries |
10
+ |---|---|---|
11
+ | **Inline CLI prompts** (scrollback-preserving) | Linear wizards, `init` scaffolders, auth/confirm flows, 1–5 step inputs | **TS/JS**: `@clack/prompts` (clean linear rail aesthetic), `@inquirer/prompts` (modular modern rewrite) Β· **Python**: `questionary` (`prompt_toolkit`-backed) Β· **Rust**: `cliclack`, `inquire`, `dialoguer` Β· **Go**: Charm `huh` / `gum` Β· **.NET**: `Spectre.Console` |
12
+ | **Full-screen TUI** (alternate buffer) | Live monitoring, multi-pane browsing, log/DB/git exploration, persistent keyboard workspaces | Textual, Bubble Tea v2, Ratatui, Ink, **Terminal.Gui v2**, **OpenTUI**, **FTXUI**, **tview** |
13
+
14
+ Always pair inline prompts with non-interactive flags (`--yes`, `--json`, env vars) and check `isatty` so CI pipelines never hang waiting on stdin.
15
+
16
+ ## Extended full-screen & REPL toolkit matrix
17
+
18
+ | Toolkit | Ecosystem | UI model | Best fit & key caveats |
19
+ |---|---|---|---|
20
+ | **Terminal.Gui (v2)** | .NET / C# | Retained widget toolkit (`Window`, `MenuBar`, `TableView`, `Pos`/`Dim`, `Scheme`) | .NET admin consoles, DB/file browsers; always wrap `Application.Init()` / `Shutdown()` in `try`/`finally` |
21
+ | **Spectre.Console** | .NET / C# | Inline rich CLI (`Table`, `Tree`, `Progress`, `Live`, `SelectionPrompt`) | Modern .NET CLIs & installers; escape user input with `Markup.Escape()` |
22
+ | **prompt_toolkit (v3)** | Python | Readline-plus REPL (`PromptSession`, `WordCompleter`, `patch_stdout`) & full-screen `Application` | Interactive SQL/AI/dev REPLs & multiline code prompts; for CSS dashboards prefer **Textual** |
23
+ | **OpenTUI** | TS/JS + Zig | Zig-powered high-FPS native cell renderer with `@opentui/core`, `@opentui/react`, `@opentui/solid` | Performance-sensitive TS/React/Solid TUIs needing native cell diffing beyond Ink/Yoga |
24
+ | **FTXUI** | C++ (17+) | Functional declarative C++ TUI (`ScreenInteractive`, `vbox`/`hbox`/`flex`, `CatchEvent`) | Zero-dependency native C++ CLIs, profilers, and embedded Linux diagnostics |
25
+ | **tcell / tview** | Go | `tcell` (low-level terminal cell/event engine) + `tview` (imperative widget library: `Table`, `TreeView`, `Flex`) | Existing Go repos using `tview`/`k9s`-style widgets; for new Go TUIs compare **Bubble Tea v2** (Elm architecture, richer ecosystem) |
26
+ | **Notcurses** | C / C++ / Rust | High-throughput multimedia/blitter TUI engine | Specialized visual/media terminal apps; heavy capability assumptions require plain fallback when unsupported |
27
+
28
+ **Blessed / Neo-Blessed migration note**: `blessed` and `neo-blessed` are legacy, largely unmaintained Node.js libraries with brittle terminfo/escape parsing. Migrate active or new Node/Bun TUIs to **Ink** (`references/ink.md`), **OpenTUI**, or **`@clack/prompts` / `@inquirer/prompts`** rather than building new features on Blessed internals.
29
+
30
+ ## Verified implementation idioms
31
+
32
+ ### .NET `Terminal.Gui` v2 (`Pos`/`Dim`, `Scheme`/`Attribute`, safe teardown)
33
+
34
+ Use relative **`Pos`** and **`Dim`** layout expressions (never fixed pixel-style coordinates) and semantic **`Scheme` / `Attribute`** pairs; always guarantee `Application.Shutdown()` runs even on exceptions:
35
+
36
+ ```csharp
37
+ using Terminal.Gui;
38
+
39
+ Application.Init();
40
+ try
41
+ {
42
+ var actionScheme = new Scheme(new Attribute(Color.White, Color.Blue));
43
+ var win = new Window { Title = "Invoices (Ctrl+Q Quit)", Width = Dim.Fill(), Height = Dim.Fill() };
44
+ var status = new Label { Text = "Ready", X = 1, Y = 1, Width = Dim.Fill(1) };
45
+ var saveBtn = new Button { Text = "_Save", X = Pos.Center(), Y = Pos.Bottom(status) + 1, ColorScheme = actionScheme };
46
+ win.Add(status, saveBtn);
47
+ Application.Run(win);
48
+ }
49
+ finally
50
+ {
51
+ Application.Shutdown();
52
+ }
53
+ ```
54
+
55
+ ### .NET `Spectre.Console` (markup injection guard & CI check)
56
+
57
+ Escape dynamic text with **`Markup.Escape(userInput)`** or **`AnsiConsole.MarkupLineInterpolated`** so brackets like `items[0]` never crash, and check `AnsiConsole.Profile.Capabilities.Interactive` before prompting:
58
+
59
+ ```csharp
60
+ using Spectre.Console;
61
+
62
+ string userInput = "settings[debug]";
63
+ AnsiConsole.MarkupLineInterpolated($"[green]Key:[/] {userInput}");
64
+ ```
65
+
66
+ ### Python `prompt_toolkit` (history & async-safe logging)
67
+
68
+ Wrap background logging inside **`with patch_stdout():`** so asynchronous messages print cleanly above the active prompt without shredding the user's input line:
69
+
70
+ ```python
71
+ from prompt_toolkit import PromptSession
72
+ from prompt_toolkit.completion import WordCompleter
73
+ from prompt_toolkit.history import FileHistory
74
+ from prompt_toolkit.patch_stdout import patch_stdout
75
+
76
+ session = PromptSession(
77
+ history=FileHistory(".app_history"),
78
+ completer=WordCompleter(["status", "deploy", "rollback", "exit"]),
79
+ )
80
+ with patch_stdout():
81
+ cmd = session.prompt("ops> ")
82
+ ```
83
+
84
+ ### C++ `FTXUI` (functional flexbox + keyboard handler)
85
+
86
+ ```cpp
87
+ #include <ftxui/component/component.hpp>
88
+ #include <ftxui/component/screen_interactive.hpp>
89
+ #include <ftxui/dom/elements.hpp>
90
+
91
+ using namespace ftxui;
92
+
93
+ int main() {
94
+ auto screen = ScreenInteractive::Fullscreen();
95
+ auto body = Renderer([] {
96
+ return vbox({ text("Invoices") | bold, separator(), text("[q] Quit") | dim }) | border;
97
+ });
98
+ auto app = CatchEvent(body, [&](Event e) {
99
+ if (e == Event::Character('q') || e == Event::Escape) { screen.Exit(); return true; }
100
+ return false;
101
+ });
102
+ screen.Loop(app);
103
+ }
104
+ ```
105
+
106
+ ## Do/don't pairs
107
+
108
+ | Do | Don't |
109
+ |---|---|
110
+ | Choose inline prompts (`@clack/prompts`, `questionary`, `cliclack`, `Spectre.Console`) for linear wizards | Launch a full-screen alt-buffer TUI just to ask 3 setup questions |
111
+ | Wrap `Terminal.Gui` `Application.Init()` / `Shutdown()` in `try`/`finally` with `Pos`/`Dim` | Hard-code coordinates or skip `Shutdown()` on exceptions |
112
+ | Escape dynamic strings via `Markup.Escape()` / `MarkupLineInterpolated()` in Spectre.Console | Interpolate unescaped paths/errors into `AnsiConsole.MarkupLine($"...")` |
113
+ | Wrap concurrent output in `with patch_stdout():` in `prompt_toolkit` | Call `print()` from background threads and corrupt the active REPL line |
114
+ | Migrate legacy Blessed/Neo-Blessed apps to Ink, OpenTUI, or `@clack/prompts` | Build new production Node TUIs on abandoned Blessed internals |
115
+
116
+ ## Verification commands
117
+
118
+ ```sh
119
+ # Run the build/test suite matching your ecosystem:
120
+ dotnet test # Terminal.Gui / Spectre.Console
121
+ python -m pytest # prompt_toolkit / questionary
122
+ cmake --build build && ctest --test-dir build # FTXUI / Notcurses
123
+ go test ./... # tcell / tview
124
+ npm test # OpenTUI / @clack/prompts / @inquirer/prompts
125
+ ```
126
+
127
+ Test suites provide `static` / logic evidence. Inspect live `80Γ—24` interactive sessions, `NO_COLOR=1`, `TERM=dumb`, `Ctrl+C` cleanup, and piped non-TTY CI runs for `rendered` evidence; label untested emulators `not-checked`.
@@ -1,60 +1,109 @@
1
- # Ink (React for CLI)
1
+ # Ink (React for CLI, v5 / v6)
2
+
3
+ Ink 5/6 runs **React 19** + **Yoga 3** Flexbox in terminal cells. Treat Ink as a keyboard-driven terminal surfaceβ€”not a browser DOM running inside Node/Bun.
2
4
 
3
5
  ## Token mapping
4
6
 
5
- Define semantic constants in a theme module/context and map them to Ink color props/style behavior:
7
+ Centralize semantic colors, borders, and spacing in a typed theme module or `@inkjs/ui` `ThemeProvider` / `extendTheme` so components reference semantic roles (`action`, `danger`, `muted`) rather than scattering raw hex/chalk strings:
6
8
 
7
9
  ```tsx
8
- export const theme = { action: '#0074ca', error: 'red' };
10
+ export const pcTheme = {
11
+ action: 'cyan',
12
+ success: 'green',
13
+ error: 'red',
14
+ muted: 'gray',
15
+ focusBorder: 'blue',
16
+ } as const;
9
17
  ```
10
18
 
11
- Do not scatter chalk-style color literals through components. Terminal themes/capabilities vary, so semantic names must degrade gracefully.
12
-
13
- ## Layout and responsive idioms
14
-
15
- Ink uses Yoga-like flexbox in terminal cells. Use flex direction/width/margin/padding deliberately, measure terminal columns/rows, define truncation/wrapping/minimum size behavior, and avoid browser layout assumptions. Static vs interactive output should be separated intentionally.
16
-
17
- ## Typography/custom fonts
19
+ Prefer ANSI semantic palette names (`cyan`, `red`, `green`, `yellow`) or test graceful degradation under `NO_COLOR=1` and 16-color terminalsβ€”never assume truecolor support.
18
20
 
19
- Terminals control fonts. Use color/bold/dim/underline/inverse and spacing. Do not assume emoji/Unicode width consistency. Use plaintext fallbacks for symbols.
21
+ ## Core Ink 5/6 primitives: `<Static>`, `useInput`, `useFocus`, & `@inkjs/ui`
20
22
 
21
- ## Motion/reduced motion
23
+ - **`<Static items={completedLogs}>`**: render completed log lines, build steps, or historical entries once above the dynamic interactive footer so Ink appends cleanly to terminal scrollback without flickering or redrawing thousands of past lines.
24
+ - **`useInput((input, key) => ..., { isActive })`**: gate keyboard listeners with `isActive` whenever a modal, confirmation prompt, or nested pane opens so background views never steal `Enter`, `Escape`, or arrow keys.
25
+ - **`useFocus` & `useFocusManager`**: wire `Tab` / `Shift+Tab` focus traversal across panes and show an unmistakable focus indicator (border + text marker `>`, never color alone).
26
+ - **`@inkjs/ui`**: prefer official accessible-baseline Ink widgets (`Select`, `MultiSelect`, `ConfirmInput`, `TextInput`, `Spinner`, `ProgressBar`, `StatusMessage`, `Badge`, `ThemeProvider`) before hand-rolling raw keystroke handlers.
22
27
 
23
- Use spinners/progress truthfully and avoid rapid render loops. Offer noninteractive/quiet mode in CI/piped contexts. Reduced-motion support is terminal-limited; avoid flashing/continuous animation by default.
28
+ ```tsx
29
+ import React, { useState } from 'react';
30
+ import { Box, Static, Text, useFocus, useInput } from 'ink';
31
+ import { StatusMessage } from '@inkjs/ui';
32
+
33
+ type LogEntry = { id: string; text: string };
34
+
35
+ export function DeployView({ logs, onCancel }: { logs: LogEntry[]; onCancel: () => void }) {
36
+ const { isFocused } = useFocus({ autoFocus: true });
37
+ const [confirming, setConfirming] = useState(false);
38
+
39
+ useInput(
40
+ (input, key) => {
41
+ if (key.escape || input === 'q') setConfirming(true);
42
+ if (confirming && input === 'y') onCancel();
43
+ if (confirming && input === 'n') setConfirming(false);
44
+ },
45
+ { isActive: isFocused },
46
+ );
47
+
48
+ return (
49
+ <Box flexDirection="column">
50
+ <Static items={logs}>{(entry) => <Text key={entry.id}>{entry.text}</Text>}</Static>
51
+ <Box borderStyle="round" borderColor={isFocused ? 'cyan' : 'gray'} paddingX={1}>
52
+ <Text>{isFocused ? '> ' : ' '}</Text>
53
+ {confirming ? (
54
+ <StatusMessage variant="warning">Abort deploy? [y/n]</StatusMessage>
55
+ ) : (
56
+ <Text>Press q or Esc to abort</Text>
57
+ )}
58
+ </Box>
59
+ </Box>
60
+ );
61
+ }
62
+ ```
24
63
 
25
- ## Accessibility specifics
64
+ ## Layout, `UAX #29` width, Bracketed Paste, `EPIPE`, & teardown idioms
26
65
 
27
- Keyboard input handling/focus semantics are application responsibility. Visible selection/focus, logical key order, escape/cancel, no color-only state, plaintext alternatives, stdout/stderr separation, and screen-reader-friendly linear output matter. Mouse support cannot be assumed.
66
+ - **Grapheme width (`Intl.Segmenter` + `string-width`) & `--ascii`**: never pad or truncate terminal strings with JS `str.length` (UTF-16 code units corrupt CJK `2`-col glyphs, `πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦` ZWJ emoji, `⚠️` `VS16`, and Vietnamese NFD combining marks). Segment cursor steps with `new Intl.Segmenter(undefined, { granularity: 'grapheme' })` and measure columns with **`string-width`**; switch `borderStyle` / glyphs to ASCII (`borderStyle="classic"` or `+--+`) under `--ascii`, `TERM=dumb`, or non-UTF-8 locales.
67
+ - **Query `useStdout()` (`stdout.columns`, `stdout.rows`)** and subscribe to `resize` events to adapt layouts at `80Γ—24` minimum; set `wrap="truncate-end"` intentionally on narrow labels.
68
+ - **Bracketed Paste (`DECSET 2004`) & `OSC 52` clipboard**: enable `\x1b[?2004h` on interactive text inputs so multi-line pastes arrive intact instead of triggering `key.return` on every newline; emit `OSC 52` (`\x1b]52;c;<base64>\x07`) alongside local clipboard helpers for SSH/`tmux` copy support.
69
+ - **Stream hygiene & silent `EPIPE` exit**: render Ink diagnostic/progress UI on `stderr` (`render(<App />, { stdout: process.stderr })`) whenever `stdout` is reserved for pipeable results, emit `--json`/`--plain` strictly to `process.stdout`, and install `process.stdout.on('error', (err) => { if (err.code === 'EPIPE') process.exit(0); })` so `mycli --plain | head -n 5` never crashes with an unhandled `Error: write EPIPE` stack trace!
70
+ - **6-step signal/crash restoration & CLI distribution**: register cleanup handlers on `SIGINT`, `SIGTERM`, `SIGHUP`, and `uncaughtException` to run the 6-step terminal reset (`?1049l`, mouse `?1000l/?1002l/?1003l/?1006l`, `?2004l`, `?2026l`, `\x1b[<u`, `?25h` + `stdin.setRawMode(false)`) before exiting (`0` ok, `1` runtime error, `2` flag error, `130` `SIGINT`). Ship `--help`, `--version`, `bash`/`zsh`/`fish`/`pwsh` completions, a `man` page, and npm/Homebrew/Winget/Scoop distribution ([terminal-protocols.md](terminal-protocols.md)).
28
71
 
29
- ## States idiom
72
+ ## Automated frame & input testing (`ink-testing-library`)
30
73
 
31
- Use explicit React state/reducer state machines for loading/error/empty/offline/permission/optimistic/cancelled states. Async effects need cancellation/cleanup. Ctrl+C/EOF/interrupt behavior must be designed. Preserve input across step navigation/resize/render.
74
+ Drive deterministic component rendering and keystroke sequences with **`ink-testing-library`**:
32
75
 
33
- ## Forms idiom
76
+ ```tsx
77
+ import { render } from 'ink-testing-library';
78
+ import { DeployView } from './DeployView.js';
34
79
 
35
- Use text input components/hooks with labels/instructions, validation timing, paste behavior, cursor visibility, key conflict awareness, error copy, and input preservation. Multi-step CLI forms need back/cancel semantics and noninteractive equivalents.
80
+ const { lastFrame, stdin } = render(<DeployView logs={[]} onCancel={() => {}} />);
81
+ stdin.write('q');
82
+ // Assert frame contains "[y/n]" prompt text and focus marker ">"
83
+ ```
36
84
 
37
85
  ## Do/don't pairs
38
86
 
39
87
  | Do | Don't |
40
88
  |---|---|
41
- | central semantic theme constants | hard-coded color props in every component |
42
- | visible selected/focused row style plus text marker | color-only invisible focus |
43
- | cleanup async effect/cancel operation | state update after unmount/interrupt |
44
- | explicit noninteractive flags for automation | requiring full-screen input inside CI |
45
- | width-aware truncation/wrapping | overwriting terminal output unpredictably |
89
+ | Render completed log history inside `<Static>` above live status | Re-render a growing 500-line array inside the dynamic `<Box>` every tick |
90
+ | Measure/slice text with `Intl.Segmenter` + `string-width` and provide `--ascii` fallback | Pad columns with `str.length` / `.padEnd()`, breaking CJK, `πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦`, and Vietnamese diacritics |
91
+ | Enable Bracketed Paste (`?2004h`), handle `stdout` `EPIPE` silently, and run 6-step reset on `SIGINT`/crash | Fire `key.return` on pasted newlines, crash with `EPIPE` on `\| head -n 5`, or leave raw mode stuck |
92
+ | Gate `useInput(..., { isActive })` by focus/modal state + ANSI 16 dark/light-safe colors | Let hidden views intercept `Enter`/`Escape` or hardcode `#ffffff` on light terminals |
93
+ | Detect `!process.stdout.isTTY` / `CI=1`, emit plain/JSON to `stdout`, and ship completions + `man` page | Hang CI pipelines waiting on interactive `<Select>` or leak spinner ANSI to `stdout` |
46
94
 
47
95
  ## Known traps
48
96
 
49
- React effect lifecycle leaks, render-loop flicker, input key conflicts, Unicode width mismatch, terminal resize behavior, hidden state loss on rerender, stdout/stderr misuse, assuming TTY in automation, ANSI/INK version behavior differences.
97
+ Rendering unbounded lists outside `<Static>`, `str.length` UTF-16 width misalignment on emoji/CJK/Vietnamese, unhandled `stdout` `EPIPE` stack traces when piped to `head`/`jq`, multi-line paste firing accidental `Enter` submits without `?2004h`, React effect leaks after `Ctrl+C` keeping the Node event loop alive.
50
98
 
51
99
  ## Verification commands
52
100
 
53
101
  ```sh
54
102
  npm run lint
55
103
  npm run test -- --run
56
- node dist/cli.js --help
57
- CI=1 node dist/cli.js 2>/dev/null || true
104
+ npm run build
105
+ NO_COLOR=1 COLUMNS=80 node dist/cli.js --help
106
+ node dist/cli.js --plain | head -n 5
58
107
  ```
59
108
 
60
- Use actual terminal runs at multiple widths, keyboard-driven integration tests, ink-testing-library-style tests where configured, piped/non-TTY checks, NO_COLOR/TERM matrices, and interrupt-path testing.
109
+ Lint, build, and `ink-testing-library` assertions provide `static` / virtual-frame evidence. Run the built CLI in real dark and light terminals at `80Γ—24`, `NO_COLOR=1`, `--ascii`, multi-line paste, piped `head -n 5`, and `Ctrl+C` interrupt paths for `rendered` evidence; label untested terminal emulators `not-checked`.