@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,26 +1,100 @@
1
- # VS Code webviews
1
+ # VS Code extensions and webviews
2
2
 
3
- Webviews are isolated embedded documents inside the editor. Treat them as application UI constrained by VS Code security and theme systems.
3
+ Always choose the **smallest native VS Code UI surface** before creating a Webview. Native surfaces inherit keyboard navigation, screen-reader accessibility, themes, zoom, and low memory usage automatically.
4
4
 
5
- ## Security/resource rules
5
+ ## Surface decision matrix
6
6
 
7
- - Convert local resources with `webview.asWebviewUri`; do not hardcode legacy `vscode-resource:` paths.
8
- - Use `webview.cspSource` in the Content Security Policy and nonce scripts/styles rather than broad unsafe directives.
9
- - Enable scripts only when needed and constrain `localResourceRoots` to the smallest workspace/extension directories.
10
- - Validate every `postMessage` payload by type/schema/origin context. Treat webview input as untrusted.
11
- - Do not use remote scripts/CDNs as a shortcut around CSP or offline behavior.
7
+ | Surface | API | Best fit |
8
+ |---|---|---|
9
+ | **QuickPick / InputBox** | `vscode.window.showQuickPick` / `showInputBox` | Fast keyboard-driven commands, multi-step prompts, pickers |
10
+ | **TreeView** | `vscode.window.createTreeView` + `TreeDataProvider` | Hierarchical explorers, resource lists, status trees in Activity/Side Bar |
11
+ | **StatusBar / CodeLens / InlayHints** | `createStatusBarItem`, `registerCodeLensProvider` | Ambient status indicators and inline contextual actions above symbols |
12
+ | **Custom Editors** | `CustomTextEditorProvider` / `CustomEditorProvider` | Visual/binary editors backed by real workspace files with native Save, Undo/Redo, and dirty tab state |
13
+ | **Notebook Renderers** | `contributes.notebookRenderers` | Custom rich MIME outputs inside Jupyter/VS Code notebooks |
14
+ | **Chat Participants, LM Tools & MCP** | `vscode.chat.createChatParticipant`, `vscode.lm.registerTool`, `vscode.lm.registerMcpServerDefinitionProvider` | Native AI chat extensions, agent tools, and MCP servers—prefer these over building a custom chat Webview |
15
+ | **WebviewView / WebviewPanel** | `WebviewViewProvider` / `createWebviewPanel` | Rich bespoke visualizers, diagrams, or domain UIs native primitives cannot express |
12
16
 
13
- ## Theme integration
17
+ ## Security, CSP/nonce, `asWebviewUri`, and state persistence
14
18
 
15
- VS Code exposes theme colors as CSS variables in webviews. Use variables such as `--vscode-editor-background`, `--vscode-editor-foreground`, `--vscode-focusBorder`, `--vscode-button-background`, `--vscode-button-foreground`, `--vscode-input-background`, `--vscode-errorForeground`, and font-family/size variables where appropriate. Test themes rather than hardcoding light/dark detection. Respect high-contrast borders/focus and editor font scaling.
19
+ - **Deprecated toolkit warning**: **`@vscode/webview-ui-toolkit` is archived and deprecated.** Use **`@vscode-elements/elements`** (community-maintained Web Components matching VS Code styling) or semantic HTML styled directly with VS Code's `--vscode-*` CSS custom properties.
20
+ - Never hardcode `vscode-resource:` paths, never disable CSP or load remote CDN scripts, and restrict `localResourceRoots` to the extension's `dist/` (or media) directory.
21
+ - Prefer **`acquireVsCodeApi().getState()` / `setState()`** + **`WebviewPanelSerializer`** over blindly enabling `retainContextWhenHidden: true` (which keeps an entire background Chromium frame resident in memory even when the tab is hidden).
16
22
 
17
- ## Editor UX
23
+ ```ts
24
+ // Extension host: strict CSP + nonce + asWebviewUri + serializer
25
+ import * as vscode from 'vscode';
26
+ import crypto from 'node:crypto';
18
27
 
19
- - Choose webview panel vs sidebar/tree/custom editor based on workflow persistence and document ownership.
20
- - Preserve view state across reveal/hide deliberately; document the cost of `retainContextWhenHidden` rather than enabling it blindly.
21
- - Keyboard focus must enter/leave the webview without trapping users; command palette/menu paths remain available.
22
- - Match editor density, iconography, terminology, split behavior, and workspace trust expectations.
28
+ export function buildWebviewHtml(webview: vscode.Webview, extensionUri: vscode.Uri): string {
29
+ const nonce = crypto.randomBytes(16).toString('base64');
30
+ const scriptUri = webview.asWebviewUri(vscode.Uri.joinPath(extensionUri, 'dist', 'webview.js'));
31
+ const styleUri = webview.asWebviewUri(vscode.Uri.joinPath(extensionUri, 'dist', 'webview.css'));
23
32
 
24
- ## Verification
33
+ return `<!DOCTYPE html>
34
+ <html lang="en">
35
+ <head>
36
+ <meta charset="UTF-8" />
37
+ <meta http-equiv="Content-Security-Policy"
38
+ content="default-src 'none'; img-src ${webview.cspSource} https: data:; style-src ${webview.cspSource}; script-src 'nonce-${nonce}';" />
39
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
40
+ <link rel="stylesheet" href="${styleUri}" />
41
+ </head>
42
+ <body>
43
+ <main id="app"></main>
44
+ <script nonce="${nonce}" src="${scriptUri}"></script>
45
+ </body>
46
+ </html>`;
47
+ }
25
48
 
26
- Inspect narrow sidebar width, split/editor resize, light/dark/high-contrast themes, font scaling, keyboard/screen-reader path, CSP console errors, offline behavior, workspace trust restricted mode, window reload, serialization/restoration, message schema errors, and Linux/macOS/Windows/web differences where claimed.
49
+ // Register serializer so panels survive VS Code reloads cleanly:
50
+ context.subscriptions.push(
51
+ vscode.window.registerWebviewPanelSerializer('pixelcraft.inspector', {
52
+ async deserializeWebviewPanel(panel: vscode.WebviewPanel, state: unknown) {
53
+ panel.webview.options = {
54
+ enableScripts: true,
55
+ localResourceRoots: [vscode.Uri.joinPath(context.extensionUri, 'dist')],
56
+ };
57
+ panel.webview.html = buildWebviewHtml(panel.webview, context.extensionUri);
58
+ panel.webview.postMessage({ type: 'restore', state });
59
+ },
60
+ }),
61
+ );
62
+ ```
63
+
64
+ ```ts
65
+ // Webview script: persist lightweight UI state without retainContextWhenHidden
66
+ const vscodeApi = acquireVsCodeApi<{ selectedId?: string }>();
67
+ const restored = vscodeApi.getState() ?? {};
68
+
69
+ function selectItem(selectedId: string) {
70
+ vscodeApi.setState({ ...vscodeApi.getState(), selectedId });
71
+ vscodeApi.postMessage({ type: 'select', selectedId }); // validate schema on extension host
72
+ }
73
+ ```
74
+
75
+ ## Activation budget (`< 50 ms`), PKCE + `SecretStorage`, Theme tokens, and Workspace Trust
76
+
77
+ - **Ban `"activationEvents": ["*"]` (`< 50 ms` activation budget)**: never wake your extension on every VS Code launch! VS Code `>= 1.74` automatically activates extensions from `contributes.commands`, `contributes.views`, `contributes.customEditors`, and `contributes.languages`. Use narrow `onLanguage:...` or `workspaceContains:...` triggers only when needed, bundle the extension entrypoint into a single file (`esbuild` / `rolldown`), and keep `activate()` synchronous work **`< 50 ms`** (check `Developer: Show Running Extensions`).
78
+ - **OAuth 2.0 + PKCE (`S256`) & OS `SecretStorage` (`context.secrets`)**: prefer built-in `vscode.authentication.getSession(providerId, scopes, { createIfNone: true })` or run **OAuth 2.0 Authorization Code + PKCE (`S256`)** via `vscode.env.openExternal` + `vscode.window.registerUriHandler`—**never bundle a `client_secret` in the `.vsix`** and store refresh/API tokens strictly inside OS-keychain-backed **`await context.secrets.store(key, token)`** (never plaintext `globalState` or `settings.json`!).
79
+ - **Live host themes**: Bind every surface, border, button, focus ring, and error state to VS Code CSS tokens (`--vscode-editor-background`, `--vscode-editor-foreground`, `--vscode-sideBar-background`, `--vscode-focusBorder`, `--vscode-button-background`, `--vscode-button-foreground`, `--vscode-input-background`, `--vscode-errorForeground`, `--vscode-font-family`, `--vscode-font-size`). Verify **High Contrast Dark** and **High Contrast Light** borders and focus rings.
80
+ - **Workspace Trust**: Check `vscode.workspace.isTrusted` and declare `capabilities.untrustedWorkspaces` in `package.json`. In Restricted Mode, disable code execution/terminal/local script features cleanly and explain *why* with a one-click link to manage trust.
81
+ - **`vscode.dev` / Browser Web Extensions**: If targeting `vscode.dev` or GitHub Codespaces web, set `"browser"` entrypoint in `package.json`, bundle for `webworker`, and replace Node `fs`/`child_process` calls with `vscode.workspace.fs` and browser `fetch` (respecting CORS).
82
+
83
+ ## Do/don't pairs
84
+
85
+ | Do | Don't |
86
+ |---|---|
87
+ | Rely on implicit `contributes.*` activation and keep `activate()` `< 50 ms` | Put `"activationEvents": ["*"]` in `package.json` or run heavy startup scans |
88
+ | Authenticate via `vscode.authentication` or **OAuth 2.0 + PKCE (`S256`)** + `context.secrets` | Embed `client_secret` in `.vsix` or store credentials in `globalState` / `settings.json` |
89
+ | Use `TreeView`, `QuickPick`, `CustomEditor`, or `vscode.chat`/`vscode.lm` first | Build a heavy Webview for a simple list, form, or AI chat |
90
+ | Use `@vscode-elements/elements` or semantic HTML + `--vscode-*` vars | Add archived/deprecated `@vscode/webview-ui-toolkit` to new projects |
91
+ | Nonce scripts + `webview.cspSource` + `asWebviewUri` + `WebviewPanelSerializer` | Allow `'unsafe-inline'` scripts or enable `retainContextWhenHidden: true` everywhere |
92
+
93
+ ## Verification commands
94
+
95
+ ```sh
96
+ npm run compile
97
+ npx @vscode/test-cli
98
+ ```
99
+
100
+ Inspect `package.json` for zero `"activationEvents": ["*"]` and zero embedded secrets (`static`), then launch the **Extension Development Host** to verify `< 50 ms` startup in `Developer: Show Running Extensions`, PKCE/`SecretStorage` sign-in, Light/Dark/High-Contrast themes, Restricted Workspace mode, and window reload (`rendered`).
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: pixelcraft-game-ui
3
- description: Translates Pixelcraft direction, tokens, UX, and floor requirements into game interfaces across Unity UI Toolkit, Godot Control/UI, Unreal UMG, LÖVE2D, Bevy, and MonoGame. Use for HUDs, menus, inventory, controller/keyboard navigation, focus order, safe areas, subtitles, accessibility options, localization, legibility at distance, platform certification-style constraints, pause/settings flows, and game UI verification.
3
+ description: Translates Pixelcraft direction, tokens, UX, and floor requirements into game interfaces across Unity UI Toolkit, Unity uGUI/TextMeshPro, Godot Control/UI (GDScript/C#), Unreal UMG/CommonUI/MVVM, Bevy, LÖVE2D, MonoGame, Phaser/PixiJS/Kaplay, Ebitengine, Macroquad, Flame, Pygame/Arcade, NoesisGUI/RmlUi/Gameface/Dear ImGui, and Raylib/SDL3/Defold/Cocos. Use for HUDs, menus, inventory, controller/keyboard navigation, dynamic input glyphs, focus order, safe areas, HDR/ultrawide HUDs, subtitles, accessibility options, localization, legibility at distance, and game UI verification.
4
4
  license: MIT
5
5
  metadata:
6
6
  version: 0.1.0
@@ -16,46 +16,65 @@ Separate always-needed survival information from inspect-on-demand stats. Preser
16
16
 
17
17
  ## Detection signals
18
18
 
19
- Unity `ProjectSettings/`, `.unity`, UXML/USS/UI Builder assets; Godot `project.godot`, `.tscn`, `.gd`, Control/Theme resources; Unreal `.uproject`, UMG widget assets/Blueprints; input maps, localization pipelines, platform target settings, safe-area/certification documentation.
19
+ Unity `ProjectSettings/`, `.unity`, UXML/USS/UI Builder or uGUI `Canvas`/`TextMeshPro` assets; Godot `project.godot`, `.tscn`, `.gd`/`.cs`, Control/Theme resources; Unreal `.uproject`, UMG/CommonUI/MVVM widget assets and Slate; Rust `bevy`/`macroquad` (`Cargo.toml`); Go `ebiten`/`ebitenui` (`go.mod`); Flutter `flame` (`pubspec.yaml`); Python `pygame`/`pygame_gui`/`arcade`; LÖVE2D (`conf.lua`, `main.lua`); MonoGame (`.csproj`, Gum/Myra/FontStashSharp); Phaser/PixiJS/Excalibur/Kaplay (`package.json`); NoesisGUI (`.xaml`), RmlUi (`.rml`/`.rcss`), Coherent Gameface, Dear ImGui; Raylib/`raygui`, SDL3/`SDL_ttf`, Defold (`.gui`/`.gui_script`), Cocos Creator; input maps, localization pipelines, and safe-area/certification docs.
20
20
 
21
21
  ## Translate direction to game idioms
22
22
 
23
- 1. Map semantic tokens to engine theme/style systems: Unity USS variables/selectors, Godot Theme resources, Unreal styles/brushes/materials.
23
+ 1. Map semantic tokens to engine theme/style systems: Unity USS variables/ScriptableObjects, Godot Theme resources, Unreal CommonUI styles/brushes/materials, or engine theme modules.
24
24
  2. Separate diegetic world presentation, HUD state, menu/settings, and cinematic narration. Do not let spectacle destroy critical state legibility.
25
25
  3. Design focus/navigation for controller/keyboard before mouse/touch polish; every actionable element needs predictable spatial navigation and visible focus.
26
- 4. Reserve safe areas and platform-specific system overlays; verify aspect ratio, resolution scaling, split screen, handheld/TV distance, and stream/capture cropping.
26
+ 4. Reserve safe areas, ultrawide HUD clamps, HDR paper-white luminance, and platform system overlays; verify aspect ratio, resolution scaling, split screen, handheld/TV distance, and stream/capture cropping.
27
27
  5. Treat localization, accessibility options, input remapping, subtitles/captions, colorblind differentiation, and difficulty/assists as core UI systems—not post-launch patches.
28
28
 
29
29
  ## Platform-wide rules
30
30
 
31
- - Critical HUD information survives motion, explosion/particle noise, low brightness, colorblindness, and glanceable viewing distance.
32
- - Do not cover crosshair/objective/danger/state with decorative panels or tutorial prompts.
33
- - Controller navigation must have sane initial focus, wrapping/dead-end behavior, back/cancel semantics, and no invisible focus traps.
34
- - Text scaling/localization can break bitmap atlases, fixed-width labels, and glyph coverage; plan overflow/expansion early.
35
- - Certification-style requirements vary by platform/version; treat them as constraints to verify against current official checklists, not universal law.
36
- - UI audio/haptics/animation should reinforce state without masking gameplay-critical feedback.
31
+ - **Steam Deck Verified (`1280×800`, `16:10`) & brightest/darkest HUD legibility**: enforce **`>= 9px` absolute floor / `12–14px` body target at `1280×800`** handheld (`>= 24–28px` at `1080p` 10-foot TV distance), full gamepad navigation from boot with **zero external mouse-only launcher**, automatic OS/Steam virtual keyboard invocation (`ShowFloatingGamepadTextInput`), and **HUD legibility verified on both the brightest (glare/snow/sky) AND darkest gameplay scenes** (using subtle dropplates/backings/keylines rather than bare floating glyphs).
32
+ - **Safe areas & non-stretched ultrawide clamping**: keep critical HUD inside a **`90%` title-safe inset** (`5%` margin) and clamp peripheral HUD widgets to a centered **`16:9` anchor box** on `21:9` / `32:9` displays (with an edge-offset slider) **without stretching 2D sprites, radial reticles, or minimaps**.
33
+ - **Console Lotcheck / TRC / XR, interruption states & store compliance**:
34
+ - Immediately **auto-pause single-player gameplay + open a modal prompt** on **controller disconnect** AND handle **OS interruption states** (**incoming mobile call, console Home/Quick Resume overlay, screen lock/suspend, and explicit `save-failed` / storage-full recovery**);
35
+ - Display a persistent **active player profile / gamertag indicator** across account-bound menus;
36
+ - Render an explicit **"Saving — do not turn off…" autosave indicator** before/during non-volatile writes without stalling the render thread;
37
+ - Cap full-screen/UI luminance flashes strictly **`<= 3 Hz`** (photosensitivity floor), and satisfy **store age-rating (`ESRB` / `PEGI` / `IARC`), chat/UGC moderation, and child/player privacy compliance**.
38
+ - **Zero-lag glyphs, input buffering, audio feel & `0 B/frame` GC**:
39
+ - Hot-swap input glyphs (`Xbox <-> DualSense <-> Switch <-> Steam Deck <-> KB/Mouse`) in **`<= 1 frame` (`0` hysteresis lag on deliberate input)** using fixed-metrics inline icon slots so prompts **never layout-jump**;
40
+ - Buffer menu/confirm inputs for **`100–150 ms`** across brief state transitions, modulate repeated UI SFX pitch by **`±3%`** (`0.97–1.03`), route UI audio to **decoupled buses** (`Master / Music / SFX / Voice / UI`), and hold steady-state UI heap allocations to **`0 B/frame`** (pooled floaters, `SetText` / preallocated buffers).
41
+ - **Accessibility & motor/vestibular customization**: ship independent **HUD Scale**, **Subtitle size + background opacity (`0–100%`)**, **Colorblind symbol + palette**, **Full Input Remapping** (with conflict detection + hold-to-toggle), **hold-instead-of-mash (`tap-assist` / hold-to-repeat)** for QTEs/rapid actions, and **camera/screen-shake + FOV motion reduction (`0–100%`)**.
42
+
43
+ ## Anti-lazy / do-not-hand-roll & anti-slop guard
44
+
45
+ - **Never hand-roll raw `drawRect` / `fillText` / `pygame.draw.rect` layout and hit-test engines** when real UI toolkits exist for the engine: Unity UI Toolkit/uGUI, Godot `Control`, Unreal CommonUI/UMG, Bevy `bevy_ui`, Flame `overlayBuilderMap` Flutter widgets, `ebitenui`, `macroquad::ui`, `pygame_gui`, `arcade.gui`, or semantic HTML/DOM overlays in Phaser/Excalibur.
46
+ - **Reject generic sci-fi/neon HUD slop**: do not paste glowing cyan boxes, stretched 16:9 bitmaps on 21:9 monitors, mouse-only launchers, per-frame string-concatenation GC spikes, or hardcoded Xbox/keyboard prompt strings detached from the active input device.
37
47
 
38
48
  ## Common game-UI failures
39
49
 
40
- - HUD designed on a static 1080p mockup but illegible in motion/at distance;
41
- - menu navigation impossible without mouse or precise touch;
42
- - focus jumping unpredictably after closing a popup;
43
- - text clipped in German/Finnish or missing CJK/Arabic glyph atlases;
44
- - color-only team/enemy/rarity/status encoding;
45
- - tutorial modal blocking the mechanic it teaches;
46
- - safe-area violation on TV/handheld/notched devices;
47
- - remapping UI that cannot represent conflicts/chords/multiple devices.
50
+ - text shrinking below `9px` on Steam Deck (`1280×800`) or `24px` on `1080p` TV, HUD washing out against snow/sky glare, or text inputs failing to summon the gamepad virtual keyboard;
51
+ - gameplay continuing unpaused on wireless controller disconnect, incoming call, or console Home overlay, or silent `save-failed` disk errors;
52
+ - mandatory button-mashing QTEs without `tap-assist` hold alternatives, or un-togglable camera/screen shake;
53
+ - input-glyph swaps lagging multiple seconds or shifting surrounding text layout;
54
+ - `21:9`/`32:9` ultrawide stretching 2D HUD sprites or pinning health bars at extreme screen edges;
55
+ - per-frame UI string allocations (`$"HP: {hp}"`) triggering GC frame hitches, `> 3 Hz` flashes, or single-bus audio lacking a dedicated `UI` slider.
48
56
 
49
57
  ## Verification options
50
58
 
51
- Engine editor preview is not equivalent to runtime gameplay verification. Use playmode/device screenshots, controller-only walkthroughs, resolution/aspect matrices, localization pseudo-text/glyph tests, accessibility settings tests, and platform-specific validation where available. Label console/certification claims `not-checked` unless current official requirements were actually inspected.
59
+ Engine editor preview is `static`, never runtime gameplay verification (**Rule #0.3**). Capture playmode/device screenshots at `1280×800` (`16:10`), `1920×1080` (`16:9`), and `3440×1440` (`21:9`) across **both brightest (glare/snow/sky) and darkest scenes**, run controller-only boot-to-gameplay + interruption walkthroughs (disconnect, call/overlay, lock, `save-failed`), profile steady-state `0 B/frame` UI allocations, and test pseudo-localized (+35–40%) + CJK/RTL builds (`rendered`). Label unverified console TRC/Lotcheck/XR items `not-checked`.
60
+
61
+ ## Pre-submit checklist
62
+
63
+ - [ ] zero `TODO`s, placeholder stubs, mouse-only boot launchers, or dead menu/remapping handlers;
64
+ - [ ] **Steam Deck (`1280×800`, `16:10`)** text `>= 9px` floor (`12–14px` target), **10ft TV (`1080p`)** `>= 24–28px`, gamepad virtual keyboard, `90%` safe zone, non-stretched `16:9` ultrawide HUD clamp, and **HUD legibility captures on both brightest (glare/snow/sky) and darkest scenes** verified;
65
+ - [ ] **TRC/Lotcheck/XR, interruptions & store compliance**: controller-disconnect auto-pause modal, **incoming call / console Home overlay / screen-lock / `save-failed` interruption states**, active player profile indicator, `"Saving — do not turn off…"` notice, `<= 3 Hz` flash cap, and **store age-rating (`ESRB`/`PEGI`/`IARC`) & privacy compliance** wired;
66
+ - [ ] **`<= 1 frame` input-glyph hot-swap** (zero layout jump), `100–150 ms` menu input buffer, `±3%` UI SFX pitch modulation, decoupled `Master/Music/SFX/Voice/UI` buses, and **`0 B/frame` steady-state UI GC** verified;
67
+ - [ ] independent HUD Scale, Subtitle background opacity (`0–100%`), Colorblind symbol+palette, Full Input Remapping, **hold-instead-of-mash (`tap-assist` / hold-to-repeat)**, **camera/screen-shake reduction (`0–100%`)**, and +35–40% / CJK / RTL localization verified;
68
+ - [ ] **Checklist-Until-Passing Stop-Gate (`<HARD-GATE>`):** walk every checklist item above + run `slop-scan.mjs --fail-on p2`, `check-contrast.mjs`, playmode/profiler checks, 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`).
52
69
 
53
70
  ## Framework routing
54
71
 
55
- - Read [references/unity-ui-toolkit.md](references/unity-ui-toolkit.md) for Unity UI Toolkit/UXML/USS.
56
- - Read [references/godot.md](references/godot.md) for Godot Control/UI/Theme/focus behavior.
57
- - Read [references/unreal-umg.md](references/unreal-umg.md) for Unreal UMG/Slate-style UI.
58
- - Read [references/hud-principles.md](references/hud-principles.md) for cross-engine HUD, controller navigation, safe-area, localization, accessibility, and certification-style constraints.
59
- - Read [references/love2d.md](references/love2d.md) for LÖVE2D/Lua games.
60
- - Read [references/bevy.md](references/bevy.md) for Bevy/Rust UI and AccessKit-oriented semantics.
61
- - Read [references/monogame.md](references/monogame.md) for MonoGame/C# custom game UI.
72
+ - Read [references/hud-principles.md](references/hud-principles.md) for cross-engine HUD taxonomy (diegetic/spatial/meta/non-diegetic), dynamic input-glyph swapping, HDR paper-white calibration, ultrawide HUD clamping, controller navigation, safe areas, XAG accessibility patterns, and verification.
73
+ - Read [references/unity-ui-toolkit.md](references/unity-ui-toolkit.md) for Unity UI Toolkit (UXML/USS, Unity 6 `DataBinding`, Runtime Accessibility, `PanelSettings`, and UI Toolkit vs uGUI selection).
74
+ - Read [references/unity-ugui.md](references/unity-ugui.md) for Unity uGUI (`Canvas` static/dynamic splitting, `CanvasScaler`, `RectTransform`, `TextMeshPro` SDF atlases, `InputSystemUIInputModule`, explicit `Selectable` navigation, and world-space canvases).
75
+ - Read [references/godot.md](references/godot.md) for Godot 4 Control/Theme UI (GDScript & C# bindings), Godot 4.5 AccessKit, MSDF fonts, `DisplayServer.get_display_safe_area()`, `process_mode`, and `mouse_filter`.
76
+ - Read [references/unreal-umg.md](references/unreal-umg.md) for Unreal UMG, CommonUI (`UCommonActivatableWidget`, `CommonActionWidget`), UMG ViewModel (`MVVM`), Enhanced Input UI routing, Slate boundaries, and `InvalidationBox`/`RetainerBox`.
77
+ - Read [references/bevy.md](references/bevy.md) for Bevy 0.15–0.18 Rust UI (Required Components, `children!`, `bevy_picking`, `bevy_ui_widgets`, `bevy_feathers`, `bevy_input_focus`, and AccessKit).
78
+ - Read [references/love2d.md](references/love2d.md) for LÖVE2D/Lua games (`love.window.getSafeArea()`, gamepad glyph detection, SUIT/Slab/FlexLove).
79
+ - Read [references/monogame.md](references/monogame.md) for MonoGame/C# game UI (Gum UI, Myra, FontStashSharp).
80
+ - Read [references/web-and-middleware-game-ui.md](references/web-and-middleware-game-ui.md) for HTML5/web game engines (Phaser, PixiJS `@pixi/ui`, Excalibur, Kaplay), AAA/native middleware (NoesisGUI, RmlUi, Coherent Gameface, Dear ImGui), and native/indie engines (Raylib `raygui`, SDL3/`SDL_ttf` v3, Defold, Cocos Creator, Ebitengine `ebitenui`, Macroquad, Flame Flutter overlays, Pygame `pygame_gui`, and Python Arcade).
@@ -1,45 +1,83 @@
1
- # Bevy UI (Rust)
2
-
3
- ## Token mapping
4
-
5
- Use semantic Rust constants/resources/components for theme values and shared styles. Current Bevy UI uses ECS nodes/components; avoid raw repeated colors/fonts. Coordinate game-art color grading with UI token intent.
6
-
7
- ## Layout and responsive idioms
8
-
9
- Use `Node` layout properties/flex-like behavior, explicit hierarchy, camera/render-target scale, aspect/resolution changes, safe margins, HUD versus menu/world-space ownership. Verify resizing/window scaling rather than static editor assumptions.
10
-
11
- ## Typography/custom fonts
12
-
13
- Load font assets explicitly; validate glyph coverage/localization, scaling, bitmap/vector rendering, texture atlas behavior. Text size/readability at gameplay distance is a design constraint, not a default.
14
-
15
- ## Motion/reduced motion
16
-
17
- Implement animation through systems/timers/tweens deliberately. Expose reduced-motion/flash-reduction options, handle pause/cancellation/interruption, and never make critical state dependent on animation completion.
18
-
19
- ## Accessibility specifics
20
-
21
- Bevy integrates AccessKit-oriented accessibility infrastructure in current versions; examples use `bevy::a11y::AccessibilityNode` with `accesskit::Role`. Add semantic nodes/roles/labels for custom UI and verify actual platform adapters/version support. ECS rendering does not automatically create usable focus/screen-reader behavior.
1
+ # Bevy UI (Rust, Bevy 0.15–0.18)
2
+
3
+ ## Token mapping and Required Components (Bevy 0.15+)
4
+
5
+ Bevy 0.15+ replaced legacy `*Bundle` structs (`NodeBundle`, `ButtonBundle`, `TextBundle`) and `Style` with **Required Components**: spawn `Node`, `BackgroundColor`, `BorderColor`, `Button`, `Text`, `TextFont`, and `TextColor` directly, and compose hierarchies with Bevy 0.16+ **`children![...]`** relationships. Store palette, typography, and spacing in a semantic `Resource` rather than scattering raw `Color::srgb(...)` literals across spawn sites:
6
+
7
+ ```rust
8
+ use bevy::a11y::AccessibilityNode;
9
+ use bevy::picking::events::{Click, Pointer};
10
+ use bevy::prelude::*;
11
+ use bevy::ui::Val;
12
+ use accesskit::{Node as AccessibleNode, Role};
13
+
14
+ #[derive(Resource)]
15
+ struct UiTokens {
16
+ action_bg: Color,
17
+ action_text: Color,
18
+ border: Color,
19
+ font: Handle<Font>,
20
+ }
21
+
22
+ fn spawn_pause_menu(mut commands: Commands, tokens: Res<UiTokens>) {
23
+ commands.spawn((
24
+ Node {
25
+ width: Val::Percent(100.0),
26
+ height: Val::Percent(100.0),
27
+ justify_content: JustifyContent::Center,
28
+ align_items: AlignItems::Center,
29
+ ..default()
30
+ },
31
+ children![(
32
+ Button,
33
+ Node {
34
+ padding: UiRect::axes(Val::Px(24.0), Val::Px(14.0)),
35
+ border: UiRect::all(Val::Px(2.0)),
36
+ ..default()
37
+ },
38
+ BackgroundColor(tokens.action_bg),
39
+ BorderColor(tokens.border),
40
+ AccessibilityNode(AccessibleNode::new(Role::Button)),
41
+ children![(
42
+ Text::new("Resume"),
43
+ TextFont { font: tokens.font.clone(), font_size: 22.0, ..default() },
44
+ TextColor(tokens.action_text),
45
+ )],
46
+ )],
47
+ ))
48
+ .observe(|_trigger: Trigger<Pointer<Click>>| {
49
+ // Bevy 0.15–0.16: Trigger<Pointer<Click>> (Bevy 0.17+: On<Pointer<Click>>)
50
+ });
51
+ }
52
+ ```
22
53
 
23
- ## States idiom
54
+ ## Native `bevy_picking`, `bevy_ui_widgets`, `bevy_feathers`, and focus (0.15–0.18)
24
55
 
25
- Use explicit ECS states/resources/events for loading/menu/pause/error/death/network/empty inventory/settings/remap/interruption. Model focus ownership and restoration after popups/scene/state transitions.
56
+ - **Native `bevy_picking` (0.15+)**: attach ECS observers (`.observe(...)` handling `Pointer<Click>`, `Pointer<Over>`, `Pointer<Out>`, `Pointer<Drag>`) directly on UI entities instead of polling `Query<&Interaction>` manually for complex pointer states. Note exact observer parameter syntax across versions (`Trigger<Pointer<Click>>` in 0.15–0.16 vs `On<Pointer<Click>>` in 0.17+).
57
+ - **`bevy_ui_widgets` (0.17–0.18)**: use Bevy's official headless widgets (buttons, sliders, checkboxes, radio groups) for pointer/keyboard activation, disabled states, and AccessKit synchronization without locking visual appearance.
58
+ - **`bevy_feathers` (0.17–0.18)**: use the opinionated themed widget suite atop `bevy_ui_widgets` for rapid settings/debug/editor tooling when custom game skinning is not needed.
59
+ - **`bevy_input_focus` & `AutoDirectionalNavigation`**: track active focus through `InputFocus` / `InputFocusVisible` resources and wire D-pad/arrow traversal via `AutoDirectionalNavigation` (or explicit `DirectionalNavigationMap` edges) so controller navigation never depends on ad-hoc index counters.
60
+ - **BSN (Bevy Scene Notation)**: treat declarative BSN syntax as experimental until stabilized in your pinned Bevy minor release; do not mix unstable BSN examples with production Required Component code.
26
61
 
27
- ## Forms idiom
62
+ ## Layout, typography, motion, and AccessKit accessibility
28
63
 
29
- Text input is low-level/custom unless using mature widgets/plugins. Validate keyboard focus, selection/caret/clipboard/IME behavior, remapping conflicts, virtual keyboard needs, validation timing, and recovery before using it for consequential input.
64
+ - Use Taffy-backed `Node` Flexbox/Grid properties (`Display::Flex`, `Display::Grid`, `Val::Percent`/`Val::Px`/`Val::Vw`), handle `WindowResized` / `UiScale` changes, and keep HUD vs menu camera layers distinct.
65
+ - Load TTF/OTF fonts explicitly via `AssetServer`, verify CJK/RTL/Cyrillic glyph coverage (cosmic-text handles shaping in Bevy 0.15+, but fallback fonts must still be available), and test distance legibility.
66
+ - **AccessKit semantics**: construct `AccessibilityNode(accesskit::Node::new(Role::Button))` from the `accesskit` crate, populate accessible labels/checked/value states on interactive widgets, and test actual OS screen-reader output (`rendered`, or label unsupported targets `not-checked`).
67
+ - Model pause, loading, disconnect, death/respawn, and modal focus restoration cleanly with `States` / `SubStates` and explicit `DespawnOnExit`; expose reduced-motion/flash settings in game options.
30
68
 
31
69
  ## Do/don't pairs
32
70
 
33
71
  | Do | Don't |
34
72
  |---|---|
35
- | `AccessibilityNode(Accessible::new(Role::Button))` where custom semantics are needed | drawing text/rectangles and calling it a button |
36
- | explicit state machine/menu focus ownership | focus disappearing after entity despawn |
37
- | semantic theme resource | raw color constants in every spawn bundle |
38
- | reduced flash/motion gameplay setting | assuming engine automatically honors OS settings |
73
+ | Spawn Required Components (`Node`, `BackgroundColor`, `BorderColor`, `Text`, `TextFont`, `TextColor`) + `children![...]` | Copy legacy pre-0.15 `NodeBundle` / `ButtonBundle` / `Style` snippets |
74
+ | Use `AccessibilityNode(accesskit::Node::new(Role::Button))` and `bevy_ui_widgets` where available | Draw plain rects/text without AccessKit `Node` semantics or focus wiring |
75
+ | Wire `bevy_picking` observers and `bevy_input_focus` / `AutoDirectionalNavigation` | Build mouse-only menus or drop focus silently when despawning modal entities |
76
+ | Keep theme tokens in a `Resource` and verify `UiScale` + reduced-motion toggles | Hard-code `Color::srgb(...)` per entity or assume OS reduced motion is auto-applied |
39
77
 
40
78
  ## Known traps
41
79
 
42
- Rapid API churn/version mismatch, entity despawn focus loss, accessibility adapter gaps, font glyph omissions, scaling/render-target mismatch, ECS event ordering bugs, custom input complexity.
80
+ Fast minor-version API shifts across 0.15 → 0.18 (`Trigger<E>` vs `On<E>`, `BorderColor::all(...)` helpers, `DespawnOnExit`), despawning the focused entity without restoring `InputFocus`, forgetting `Pickable::IGNORE` on non-interactive HUD overlays that steal clicks, and incomplete font fallback in localized builds.
43
81
 
44
82
  ## Verification commands
45
83
 
@@ -49,4 +87,4 @@ cargo clippy -- -D warnings
49
87
  cargo run
50
88
  ```
51
89
 
52
- Run resolution/aspect/input matrix, keyboard/controller-only flow, actual accessibility tooling where supported, pause/interruption/resume, localization/glyph tests, screenshots/device targets.
90
+ Verify resolution/aspect/`UiScale` matrix, controller-only `AutoDirectionalNavigation` traversal, AccessKit inspection on supported platforms, pause/interruption transitions, and localization glyph rendering (`rendered`).
@@ -1,57 +1,130 @@
1
- # Godot UI
1
+ # Godot 4 UI
2
2
 
3
- Evidence: Godot docs confirm Control focus modes including keyboard/D-pad behavior, `add_theme_*_override` methods, theme inheritance, and dynamic font formats/size overrides.
3
+ ## Token mapping and Theme architecture
4
4
 
5
- ## Token mapping
6
-
7
- Use Theme resources for shared colors/fonts/styles/constants and scoped overrides only when necessary:
5
+ Centralize semantic colors, fonts, font sizes, constants, and `StyleBox` assets in shared **`Theme`** resources (using `theme_type_variation` for semantic button/panel roles like `PrimaryButton` or `DangerBadge`), using scoped `add_theme_*_override` calls only for truly dynamic runtime state:
8
6
 
9
7
  ```gdscript
10
- button.add_theme_color_override("font_color", pc_action_text)
8
+ # Apply safe area, pause ownership, mouse pass-through, and Godot 4.5 AccessKit semantics
9
+ extends CanvasLayer
10
+
11
+ @onready var safe_margin: MarginContainer = $SafeMargin
12
+ @onready var pause_overlay: Control = $PauseOverlay
13
+ @onready var hud_banner: Label = $SafeMargin/HudBanner
14
+ @onready var resume_button: Button = $PauseOverlay/Panel/ResumeButton
15
+
16
+ func _ready() -> void:
17
+ # Pause menu stays responsive while SceneTree is paused
18
+ pause_overlay.process_mode = Node.PROCESS_MODE_WHEN_PAUSED
19
+ # Decorative HUD text must never swallow clicks or hover beneath it
20
+ hud_banner.mouse_filter = Control.MOUSE_FILTER_IGNORE
21
+ # Godot 4.5+ AccessKit screen-reader semantics
22
+ resume_button.accessibility_name = tr("UI_RESUME_GAME")
23
+ resume_button.accessibility_description = tr("UI_RESUME_DESC")
24
+ _apply_safe_area()
25
+ get_viewport().size_changed.connect(_apply_safe_area)
26
+
27
+ func _apply_safe_area() -> void:
28
+ var safe := DisplayServer.get_display_safe_area()
29
+ var win_size := DisplayServer.window_get_size()
30
+ if win_size.x <= 0 or win_size.y <= 0:
31
+ return
32
+ safe_margin.add_theme_constant_override("margin_left", safe.position.x)
33
+ safe_margin.add_theme_constant_override("margin_top", safe.position.y)
34
+ safe_margin.add_theme_constant_override("margin_right", win_size.x - safe.end.x)
35
+ safe_margin.add_theme_constant_override("margin_bottom", win_size.y - safe.end.y)
11
36
  ```
12
37
 
13
- Prefer theme types/items that express semantic roles. Do not duplicate styleboxes/fonts per control unless variation is intentional.
38
+ ## Layout, `DisplayServer.get_display_safe_area()`, and `mouse_filter`
39
+
40
+ - Build layouts with containers (`VBoxContainer`, `HBoxContainer`, `GridContainer`, `MarginContainer`, `AspectRatioContainer`) and explicit `size_flags` / anchors rather than absolute pixel positions; separate gameplay HUD `CanvasLayer` from modal/menu `CanvasLayer` ordering.
41
+ - Query **`DisplayServer.get_display_safe_area()`** (and reconnect on viewport resize/orientation changes) to pad root HUD margins away from mobile notches, camera cutouts, and TV overscan.
42
+ - Configure **`Control.mouse_filter`** deliberately on every Control:
43
+ - `MOUSE_FILTER_STOP`: interactive buttons, modal backdrops, and clickable panels that intentionally consume pointer events;
44
+ - `MOUSE_FILTER_PASS`: scrollable/container wrappers that observe events while letting unhandled clicks bubble to parents;
45
+ - `MOUSE_FILTER_IGNORE`: decorative HUD labels, icons, vignettes, and non-interactive containers so they never block gameplay picking or clicks underneath.
46
+
47
+ ## `CanvasItem.process_mode` and pause/state ownership
48
+
49
+ Set **`process_mode`** explicitly whenever pausing the `SceneTree` (`get_tree().paused = true`):
50
+
51
+ - `Node.PROCESS_MODE_PAUSABLE`: gameplay HUD tickers/animations that freeze while paused;
52
+ - `Node.PROCESS_MODE_WHEN_PAUSED`: pause menus and modal dialogs active only during pause;
53
+ - `Node.PROCESS_MODE_ALWAYS`: global audio/settings/system-notification layers and the pause-toggle controller itself.
54
+
55
+ Store the previously focused `Control` (`get_viewport().gui_get_focus_owner()`) before opening popups and call `grab_focus()` on close so controller focus is never orphaned.
14
56
 
15
- ## Layout and responsive idioms
57
+ ## Typography and MSDF fonts
16
58
 
17
- Use Control containers (`VBoxContainer`, `HBoxContainer`, `GridContainer`, `MarginContainer`, aspect/size flags/anchors) rather than absolute positioning everywhere. Handle window resizing/stretch mode/aspect ratio/safe area/controller distance. Separate HUD CanvasLayer from menu/control tree ownership.
59
+ - Use dynamic `FontFile` (TTF/OTF/WOFF2) with explicit `fallbacks` arrays covering CJK, Arabic/RTL (Godot 4 includes HarfBuzz + ICU BiDi shaping), Cyrillic, and symbols; reserve bitmap fonts strictly for pixel-art games with verified locale coverage.
60
+ - **MSDF fonts**: enable `multichannel_signed_distance_field = true` on `FontFile` import settings for crisp UI scaling across 720p–4K and user HUD-scale sliders. Note that MSDF cannot represent overlapping variable-font contours or every complex script cleanly—verify CJK/Arabic/Indic rendering and keep raster dynamic fallback fonts where needed.
18
61
 
19
- ## Typography/custom fonts
62
+ ## Accessibility and Godot 4.5 AccessKit
20
63
 
21
- Use dynamic TTF/OTF/WOFF fonts where scaling/localization matter; bitmap fonts only for intentional pixel/bitmap systems. Since Godot 4 separates font resource and size override, define sizes semantically. Verify glyph coverage/fallbacks/localization expansion.
64
+ - **Godot 4.5 native AccessKit**: Godot 4.5 integrates AccessKit for native screen-reader trees on supported desktop/mobile platforms. Set **`accessibility_name`**, **`accessibility_description`**, and semantic control types (`Button`, `CheckBox`, `HSlider`, `Label`) especially on icon-only buttons and custom-drawn `Control` nodes, and test on actual assistive technology (label untested platforms `not-checked`).
65
+ - Configure `focus_mode` (`FOCUS_ALL` for interactive controls, `FOCUS_NONE` for decorative nodes), explicit `focus_neighbor_*` overrides where spatial focus jumps erratically, visible `:focus` `StyleBox` states, `ui_accept`/`ui_cancel` InputMap parity, subtitles/scale/colorblind/reduced-motion settings, and conflict-aware remapping.
22
66
 
23
- ## Motion/reduced motion
67
+ ## Godot C# UI bindings
24
68
 
25
- Use Tweens/AnimationPlayer purposefully, pause/cancel behavior explicitly, and expose reduced-motion/flash-reduction options. Do not make critical state dependent on tween completion without interruption handling.
69
+ Godot C# (`Godot.NET.Sdk`) shares the exact same `Control`, `Theme`, `DisplayServer`, `ProcessMode`, `MouseFilter`, and Godot 4.5 AccessKit runtime as GDScript—enforce idiomatic C# binding hygiene:
26
70
 
27
- ## Accessibility specifics
71
+ - Prefer typed **`[Export]`** node properties over brittle string `GetNode<Button>("...")` paths.
72
+ - Subscribe with C# event delegates (`ResumeButton.Pressed += OnResumePressed;`) and unsubscribe in **`_ExitTree()`** when listening to longer-lived autoloads/viewports so freed UI nodes never leak or throw `ObjectDisposedException`; use **`Callable.From(...)`** when connecting dynamic/custom Godot signals.
73
+ - Maintain exact parity with GDScript for localization (`Tr("UI_RESUME_GAME")`), safe areas (`DisplayServer.GetDisplaySafeArea()`), `AddThemeConstantOverride(...)`, `ProcessModeEnum.WhenPaused`, and `MouseFilterEnum.Ignore`.
28
74
 
29
- Use Control focus mode and focus neighbors/input map behavior deliberately. Focus visual appears for keyboard/gamepad/grab focus scenarios; do not hide it. Verify controller/keyboard navigation, colorblind differentiation, subtitle/caption sizing/background, remapping, scalable HUD/text, and platform screen-reader limitations honestly.
75
+ ```csharp
76
+ using Godot;
30
77
 
31
- ## States idiom
78
+ public partial class HudController : CanvasLayer
79
+ {
80
+ [Export] public Control PauseOverlay { get; set; } = null!;
81
+ [Export] public Button ResumeButton { get; set; } = null!;
32
82
 
33
- Model pause/loading/error/empty inventory/network/offline/death/respawn/dialogue/cutscene/permission states explicitly. Pause behavior/process mode affects UI; interruption/resume semantics are core game UX. Restore focus after popup/menu close/scene transition.
83
+ private Callable _resizeCallable;
34
84
 
35
- ## Forms idiom
85
+ public override void _Ready()
86
+ {
87
+ PauseOverlay.ProcessMode = ProcessModeEnum.WhenPaused;
88
+ ResumeButton.Text = Tr("UI_RESUME_GAME");
89
+ ResumeButton.Pressed += OnResumePressed;
36
90
 
37
- LineEdit/controls need labels/help, validation timing, virtual keyboard/platform input awareness, paste behavior where available, focus order, input preservation, and recovery copy. Settings/remapping UI must handle conflicts/device multiplicity.
91
+ _resizeCallable = Callable.From(ApplySafeArea);
92
+ GetViewport().Connect(Viewport.SignalName.SizeChanged, _resizeCallable);
93
+ ApplySafeArea();
94
+ }
95
+
96
+ public override void _ExitTree()
97
+ {
98
+ ResumeButton.Pressed -= OnResumePressed;
99
+ if (GetViewport().IsConnected(Viewport.SignalName.SizeChanged, _resizeCallable))
100
+ GetViewport().Disconnect(Viewport.SignalName.SizeChanged, _resizeCallable);
101
+ }
102
+
103
+ private void OnResumePressed() => GetTree().Paused = false;
104
+ private void ApplySafeArea() { /* apply DisplayServer.GetDisplaySafeArea() */ }
105
+ }
106
+ ```
38
107
 
39
108
  ## Do/don't pairs
40
109
 
41
110
  | Do | Don't |
42
111
  |---|---|
43
- | shared Theme resource with scoped overrides | duplicating styleboxes/fonts across every Control |
44
- | explicit `focus_neighbor_*`/initial focus | random controller navigation dead ends |
45
- | containers/size flags for resize | absolute pixel layout only at 1080p |
46
- | focus restoration after popup close | focus trapped in hidden/freed node |
47
- | process mode/pause behavior explicit | menu hidden or input dead because pause ownership was unclear |
112
+ | Shared `Theme` + `theme_type_variation` with scoped overrides | Duplicating `StyleBox` and font overrides across every `Control` |
113
+ | Set `mouse_filter = MOUSE_FILTER_IGNORE` on decorative HUD overlays and `process_mode = PROCESS_MODE_ALWAYS`/`WHEN_PAUSED` on pause UI | Leave default `MOUSE_FILTER_STOP` blocking clicks or freeze the pause menu when `get_tree().paused = true` |
114
+ | Apply `DisplayServer.get_display_safe_area()` and responsive containers | Hard-code 1920×1080 pixel coordinates that clip on notches or ultrawide screens |
115
+ | Set Godot 4.5 `accessibility_name`/`accessibility_description`, explicit `focus_neighbor_*`, and focus restoration | Ship icon-only controls with no accessible name or orphan focus on `queue_free()` |
116
+ | Enable MSDF selectively with dynamic fallback fonts tested on CJK/Arabic | Assume English editor glyphs cover localized player names or variable scales |
48
117
 
49
118
  ## Known traps
50
119
 
51
- Mouse filter blocking input unintentionally, focus loss after node removal, theme item confusion because theme values are not ordinary object properties, localization glyph/overflow issues, stretch/aspect mismatch, safe-area neglect, controller/keyboard input map conflict, pause/process-mode bugs.
120
+ Default `MOUSE_FILTER_STOP` silently blocking clicks under full-rect containers, focus lost when freeing a focused node, `process_mode` freezing pause/unpause buttons, `Theme` item lookup confusion (theme values are not ordinary node properties), MSDF artifacts on complex overlapping glyphs, and controller/keyboard `ui_*` InputMap conflicts.
52
121
 
53
122
  ## Verification commands
54
123
 
55
- Run the project's configured headless test runner and preserve its exit status and log. Launch the affected scene in the target engine version; a clean boot does not validate navigation or gameplay.
124
+ Run the project's configured headless test runner (e.g., GUT or GdUnit4) preserving exit status and logs, then launch the affected scene in the target Godot runtime:
125
+
126
+ ```sh
127
+ godot --headless --path . --quit-after 1
128
+ ```
56
129
 
57
- Use runtime screenshots/device tests, controller-only navigation, resize/aspect/safe-area matrix, localization pseudo-text/glyph checks, accessibility option tests, pause/interruption/reconnect flows, and platform export validation where applicable.
130
+ Inspect runtime screenshots, controller-only focus flows, `DisplayServer.get_display_safe_area()` / ultrawide / stretch-mode matrix, pseudo-localized CJK/Arabic fonts, Godot 4.5 AccessKit output on supported OS screen readers, and pause/interruption recovery (`rendered`).