@thanhnguyxn/pixelcraft 0.0.0-stage → 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 (455) hide show
  1. package/.agents/plugins/marketplace.json +20 -0
  2. package/.antigravity-plugin/plugin.json +32 -0
  3. package/.claude-plugin/marketplace.json +20 -0
  4. package/.claude-plugin/plugin.json +22 -0
  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/LICENSE +21 -0
  13. package/README.md +264 -2
  14. package/SECURITY.md +28 -0
  15. package/assets/README.md +28 -0
  16. package/assets/pixelcraft-logo-128.png +0 -0
  17. package/assets/pixelcraft-logo-256.png +0 -0
  18. package/assets/pixelcraft-logo-512.png +0 -0
  19. package/bin/pixelcraft.mjs +852 -0
  20. package/docs/ARCHITECTURE.md +105 -0
  21. package/docs/DESIGN-RATIONALE.md +191 -0
  22. package/docs/INSTALL.md +221 -0
  23. package/evals/README.md +37 -0
  24. package/evals/fixtures/3d-web-engineering.json +69 -0
  25. package/evals/fixtures/README.md +36 -0
  26. package/evals/fixtures/acceptance-checklist-rule03-gate.json +43 -0
  27. package/evals/fixtures/ai-ui-libraries.json +53 -0
  28. package/evals/fixtures/audio-visual-accessibility.json +69 -0
  29. package/evals/fixtures/auth-and-checkout-ui.json +53 -0
  30. package/evals/fixtures/brandkit-identity-governance.json +48 -0
  31. package/evals/fixtures/build-and-architecture.json +53 -0
  32. package/evals/fixtures/canvas-and-node-editors.json +53 -0
  33. package/evals/fixtures/chat-ai-exfiltration-ime-hitl-gate.json +43 -0
  34. package/evals/fixtures/completion-gate-scan-until-clean.json +44 -0
  35. package/evals/fixtures/component-systems.json +53 -0
  36. package/evals/fixtures/component-testing.json +53 -0
  37. package/evals/fixtures/constrained-voice-and-tv.json +43 -0
  38. package/evals/fixtures/creative-code-rendering.json +69 -0
  39. package/evals/fixtures/creative-reference-evidence.json +67 -0
  40. package/evals/fixtures/data-app-python-marimo.json +49 -0
  41. package/evals/fixtures/desktop-cpp-juce-audio.json +49 -0
  42. package/evals/fixtures/desktop-csharp-avalonia.json +49 -0
  43. package/evals/fixtures/desktop-native-workspace.json +48 -0
  44. package/evals/fixtures/desktop-python-anti-tkinter.json +49 -0
  45. package/evals/fixtures/direction-prototype-complexity.json +29 -0
  46. package/evals/fixtures/document-prepress-pdfx4-tounicode.json +43 -0
  47. package/evals/fixtures/document-rust-typst-invoice.json +49 -0
  48. package/evals/fixtures/document-typst-and-print-css.json +43 -0
  49. package/evals/fixtures/email-mjml-dark-mode.json +49 -0
  50. package/evals/fixtures/email-outlook-and-plaintext.json +43 -0
  51. package/evals/fixtures/enterprise-data-ui.json +53 -0
  52. package/evals/fixtures/extended-tui-toolkits.json +53 -0
  53. package/evals/fixtures/extensions-mv3-and-vscode.json +43 -0
  54. package/evals/fixtures/file-upload-media-ui.json +53 -0
  55. package/evals/fixtures/finish-gate-anti-slop.json +30 -0
  56. package/evals/fixtures/forms-accessibility-negative.json +29 -0
  57. package/evals/fixtures/forms-validation.json +53 -0
  58. package/evals/fixtures/game-go-ebitengine.json +49 -0
  59. package/evals/fixtures/game-godot-gdscript.json +49 -0
  60. package/evals/fixtures/game-ui-hud-and-engines.json +43 -0
  61. package/evals/fixtures/handoff-fidelity-tolerance.json +29 -0
  62. package/evals/fixtures/i18n-engineering.json +53 -0
  63. package/evals/fixtures/local-first-sync.json +53 -0
  64. package/evals/fixtures/lynxjs.json +53 -0
  65. package/evals/fixtures/maizzle-email.json +53 -0
  66. package/evals/fixtures/maps-geospatial.json +53 -0
  67. package/evals/fixtures/media-og-and-video-export.json +43 -0
  68. package/evals/fixtures/media-players.json +53 -0
  69. package/evals/fixtures/mobile-compose-16kb-foldable-store-gate.json +44 -0
  70. package/evals/fixtures/mobile-elixir-liveview-native.json +49 -0
  71. package/evals/fixtures/mobile-flutter-dynamic-type.json +49 -0
  72. package/evals/fixtures/mobile-harmonyos-arkui.json +49 -0
  73. package/evals/fixtures/mobile-jetpack-compose.json +49 -0
  74. package/evals/fixtures/mobile-swiftui-ios.json +49 -0
  75. package/evals/fixtures/motion-engineering.json +69 -0
  76. package/evals/fixtures/pdfjs-and-pptx.json +53 -0
  77. package/evals/fixtures/plan-brownfield-evidence.json +28 -0
  78. package/evals/fixtures/plan-discovery-interview.json +31 -0
  79. package/evals/fixtures/plan-grill-me-brainstorm-gate.json +49 -0
  80. package/evals/fixtures/reactive-data-apps.json +53 -0
  81. package/evals/fixtures/review-evidence-audit.json +43 -0
  82. package/evals/fixtures/rich-text-and-code-editors.json +53 -0
  83. package/evals/fixtures/scrollytelling-resilience.json +70 -0
  84. package/evals/fixtures/spatial-xr-comfort-and-platforms.json +43 -0
  85. package/evals/fixtures/state-architecture.json +53 -0
  86. package/evals/fixtures/styling-ecosystem.json +53 -0
  87. package/evals/fixtures/token-tooling.json +53 -0
  88. package/evals/fixtures/tui-go-bubbletea.json +49 -0
  89. package/evals/fixtures/tui-rust-ratatui-grapheme-paste-teardown.json +44 -0
  90. package/evals/fixtures/tui-rust-ratatui.json +49 -0
  91. package/evals/fixtures/ux-state-matrix-and-i18n.json +43 -0
  92. package/evals/fixtures/visual-qa-task-evidence.json +29 -0
  93. package/evals/fixtures/web-3d-engines.json +53 -0
  94. package/evals/fixtures/web-php-laravel-filament.json +49 -0
  95. package/evals/fixtures/web-ruby-viewcomponent-phlex.json +49 -0
  96. package/evals/fixtures/workflow-checkpoints.json +30 -0
  97. package/evals/pixelcraft-accessibility.md +74 -0
  98. package/evals/pixelcraft-brandkit.md +58 -0
  99. package/evals/pixelcraft-chat-ui.md +55 -0
  100. package/evals/pixelcraft-constrained.md +55 -0
  101. package/evals/pixelcraft-craft.md +76 -0
  102. package/evals/pixelcraft-data-apps.md +55 -0
  103. package/evals/pixelcraft-dataviz.md +59 -0
  104. package/evals/pixelcraft-desktop.md +55 -0
  105. package/evals/pixelcraft-direction.md +77 -0
  106. package/evals/pixelcraft-document.md +55 -0
  107. package/evals/pixelcraft-email.md +55 -0
  108. package/evals/pixelcraft-extensions.md +55 -0
  109. package/evals/pixelcraft-game-ui.md +59 -0
  110. package/evals/pixelcraft-handoff.md +57 -0
  111. package/evals/pixelcraft-media.md +55 -0
  112. package/evals/pixelcraft-mobile.md +59 -0
  113. package/evals/pixelcraft-patterns.md +73 -0
  114. package/evals/pixelcraft-plan.md +127 -0
  115. package/evals/pixelcraft-review.md +63 -0
  116. package/evals/pixelcraft-spatial.md +55 -0
  117. package/evals/pixelcraft-tokens.md +57 -0
  118. package/evals/pixelcraft-tui.md +55 -0
  119. package/evals/pixelcraft-ux.md +59 -0
  120. package/evals/pixelcraft-visual-qa.md +86 -0
  121. package/evals/pixelcraft-web.md +89 -0
  122. package/evals/pixelcraft.md +70 -0
  123. package/gemini-extension.json +6 -0
  124. package/install.ps1 +341 -0
  125. package/install.sh +512 -0
  126. package/package.json +91 -4
  127. package/plugin.json +29 -0
  128. package/scripts/build-adapters.mjs +288 -0
  129. package/scripts/build-release-archives.mjs +61 -0
  130. package/scripts/build-skill-zips.mjs +94 -0
  131. package/scripts/run-evals.mjs +397 -0
  132. package/scripts/sync-docs.mjs +381 -0
  133. package/scripts/test-build-adapters.mjs +61 -0
  134. package/scripts/test-cross-platform-qa.mjs +359 -0
  135. package/scripts/test-distribution.mjs +203 -0
  136. package/scripts/test-export-tokens.mjs +361 -0
  137. package/scripts/test-finish-gate.mjs +271 -0
  138. package/scripts/test-installers.mjs +216 -0
  139. package/scripts/test-release-archives.mjs +42 -0
  140. package/scripts/test-shoot.mjs +87 -0
  141. package/scripts/test-slop-scan.mjs +416 -0
  142. package/scripts/test-style-inventory.mjs +234 -0
  143. package/scripts/test-sync-docs.mjs +140 -0
  144. package/scripts/test-validate-skills.mjs +195 -0
  145. package/scripts/validate-skills.mjs +658 -0
  146. package/skills/pixelcraft/SKILL.md +155 -0
  147. package/skills/pixelcraft/references/design-brief.md +75 -0
  148. package/skills/pixelcraft/references/floor.md +90 -0
  149. package/skills/pixelcraft/references/report-template.md +49 -0
  150. package/skills/pixelcraft/references/stack-detection.md +226 -0
  151. package/skills/pixelcraft/references/surface-acceptance.md +52 -0
  152. package/skills/pixelcraft/references/workflow-checkpoints.md +71 -0
  153. package/skills/pixelcraft-accessibility/SKILL.md +54 -0
  154. package/skills/pixelcraft-accessibility/references/apg-patterns.md +64 -0
  155. package/skills/pixelcraft-accessibility/references/motion-canvas.md +57 -0
  156. package/skills/pixelcraft-accessibility/references/platforms.md +86 -0
  157. package/skills/pixelcraft-accessibility/references/verification.md +64 -0
  158. package/skills/pixelcraft-accessibility/references/wcag22-checks.md +99 -0
  159. package/skills/pixelcraft-brandkit/SKILL.md +127 -0
  160. package/skills/pixelcraft-brandkit/references/asset-pipeline.md +165 -0
  161. package/skills/pixelcraft-brandkit/references/brand-governance.md +82 -0
  162. package/skills/pixelcraft-brandkit/references/layouts.md +88 -0
  163. package/skills/pixelcraft-brandkit/references/logo-concepting.md +83 -0
  164. package/skills/pixelcraft-brandkit/references/logo-methods.md +97 -0
  165. package/skills/pixelcraft-brandkit/references/pixel-art-logos.md +82 -0
  166. package/skills/pixelcraft-brandkit/references/prompt-template.md +87 -0
  167. package/skills/pixelcraft-brandkit/references/qa-checklist.md +93 -0
  168. package/skills/pixelcraft-brandkit/references/visual-modes.md +123 -0
  169. package/skills/pixelcraft-chat-ui/SKILL.md +57 -0
  170. package/skills/pixelcraft-chat-ui/references/agentic-workspace.md +66 -0
  171. package/skills/pixelcraft-chat-ui/references/ai-ui-libraries.md +259 -0
  172. package/skills/pixelcraft-chat-ui/references/conversation-design.md +84 -0
  173. package/skills/pixelcraft-chat-ui/references/mobile-business-platforms.md +77 -0
  174. package/skills/pixelcraft-chat-ui/references/slack-discord.md +80 -0
  175. package/skills/pixelcraft-constrained/SKILL.md +52 -0
  176. package/skills/pixelcraft-constrained/references/specialized-hardware.md +90 -0
  177. package/skills/pixelcraft-constrained/references/tv-wearables.md +134 -0
  178. package/skills/pixelcraft-constrained/references/voice-ui.md +104 -0
  179. package/skills/pixelcraft-craft/SKILL.md +58 -0
  180. package/skills/pixelcraft-craft/references/color.md +125 -0
  181. package/skills/pixelcraft-craft/references/imagery-icons.md +37 -0
  182. package/skills/pixelcraft-craft/references/layout-quality.md +65 -0
  183. package/skills/pixelcraft-craft/references/layout.md +73 -0
  184. package/skills/pixelcraft-craft/references/motion.md +163 -0
  185. package/skills/pixelcraft-craft/references/typography.md +110 -0
  186. package/skills/pixelcraft-data-apps/SKILL.md +86 -0
  187. package/skills/pixelcraft-data-apps/references/ai-and-internal-data-apps.md +147 -0
  188. package/skills/pixelcraft-data-apps/references/dash.md +109 -0
  189. package/skills/pixelcraft-data-apps/references/evidence.md +90 -0
  190. package/skills/pixelcraft-data-apps/references/gradio.md +103 -0
  191. package/skills/pixelcraft-data-apps/references/julia-genie.md +89 -0
  192. package/skills/pixelcraft-data-apps/references/jupyter-widgets.md +91 -0
  193. package/skills/pixelcraft-data-apps/references/nicegui.md +102 -0
  194. package/skills/pixelcraft-data-apps/references/observable-framework.md +105 -0
  195. package/skills/pixelcraft-data-apps/references/panel.md +99 -0
  196. package/skills/pixelcraft-data-apps/references/r-shiny.md +124 -0
  197. package/skills/pixelcraft-data-apps/references/reactive-data-apps.md +186 -0
  198. package/skills/pixelcraft-data-apps/references/reflex.md +116 -0
  199. package/skills/pixelcraft-data-apps/references/shiny.md +110 -0
  200. package/skills/pixelcraft-data-apps/references/streamlit.md +113 -0
  201. package/skills/pixelcraft-dataviz/SKILL.md +60 -0
  202. package/skills/pixelcraft-dataviz/references/chart-choice.md +55 -0
  203. package/skills/pixelcraft-dataviz/references/color-accessibility.md +112 -0
  204. package/skills/pixelcraft-dataviz/references/encoding-tables-dashboards.md +107 -0
  205. package/skills/pixelcraft-dataviz/references/libraries.md +176 -0
  206. package/skills/pixelcraft-dataviz/references/maps-geospatial.md +159 -0
  207. package/skills/pixelcraft-dataviz/references/realtime-graphs-maps-scale.md +92 -0
  208. package/skills/pixelcraft-desktop/SKILL.md +93 -0
  209. package/skills/pixelcraft-desktop/references/appkit.md +92 -0
  210. package/skills/pixelcraft-desktop/references/avalonia.md +95 -0
  211. package/skills/pixelcraft-desktop/references/cpp-gui.md +129 -0
  212. package/skills/pixelcraft-desktop/references/electron.md +96 -0
  213. package/skills/pixelcraft-desktop/references/go-gui.md +83 -0
  214. package/skills/pixelcraft-desktop/references/gtk.md +97 -0
  215. package/skills/pixelcraft-desktop/references/javafx-swing.md +81 -0
  216. package/skills/pixelcraft-desktop/references/qt-pyside-qml.md +88 -0
  217. package/skills/pixelcraft-desktop/references/rust-gui.md +83 -0
  218. package/skills/pixelcraft-desktop/references/tauri.md +110 -0
  219. package/skills/pixelcraft-desktop/references/uno-platform.md +71 -0
  220. package/skills/pixelcraft-desktop/references/winui-wpf.md +98 -0
  221. package/skills/pixelcraft-desktop/references/working-context.md +84 -0
  222. package/skills/pixelcraft-direction/SKILL.md +120 -0
  223. package/skills/pixelcraft-direction/references/composition-library.md +84 -0
  224. package/skills/pixelcraft-direction/references/creative-brainstorming.md +72 -0
  225. package/skills/pixelcraft-direction/references/direction-card.md +64 -0
  226. package/skills/pixelcraft-direction/references/direction-scoring.md +76 -0
  227. package/skills/pixelcraft-direction/references/motion-identity.md +67 -0
  228. package/skills/pixelcraft-direction/references/movements.md +71 -0
  229. package/skills/pixelcraft-direction/references/reference-analysis.md +37 -0
  230. package/skills/pixelcraft-direction/references/repetition-history.md +75 -0
  231. package/skills/pixelcraft-direction/references/slop-fingerprints.md +83 -0
  232. package/skills/pixelcraft-direction/references/wildcards.md +47 -0
  233. package/skills/pixelcraft-document/SKILL.md +58 -0
  234. package/skills/pixelcraft-document/references/archetypes.md +106 -0
  235. package/skills/pixelcraft-document/references/pdf-tools.md +314 -0
  236. package/skills/pixelcraft-document/references/pdfjs-and-pptx.md +114 -0
  237. package/skills/pixelcraft-document/references/print-css.md +187 -0
  238. package/skills/pixelcraft-document/references/slides.md +198 -0
  239. package/skills/pixelcraft-email/SKILL.md +80 -0
  240. package/skills/pixelcraft-email/references/client-quirks.md +113 -0
  241. package/skills/pixelcraft-email/references/html-tables.md +114 -0
  242. package/skills/pixelcraft-email/references/maizzle.md +54 -0
  243. package/skills/pixelcraft-email/references/mjml.md +54 -0
  244. package/skills/pixelcraft-email/references/react-email.md +95 -0
  245. package/skills/pixelcraft-extensions/SKILL.md +56 -0
  246. package/skills/pixelcraft-extensions/references/browser-extensions.md +105 -0
  247. package/skills/pixelcraft-extensions/references/figma-office.md +106 -0
  248. package/skills/pixelcraft-extensions/references/ide-and-saas-plugins.md +125 -0
  249. package/skills/pixelcraft-extensions/references/raycast.md +98 -0
  250. package/skills/pixelcraft-extensions/references/vscode-webviews.md +100 -0
  251. package/skills/pixelcraft-game-ui/SKILL.md +80 -0
  252. package/skills/pixelcraft-game-ui/references/bevy.md +90 -0
  253. package/skills/pixelcraft-game-ui/references/godot.md +130 -0
  254. package/skills/pixelcraft-game-ui/references/hud-principles.md +67 -0
  255. package/skills/pixelcraft-game-ui/references/love2d.md +77 -0
  256. package/skills/pixelcraft-game-ui/references/monogame.md +68 -0
  257. package/skills/pixelcraft-game-ui/references/unity-ugui.md +109 -0
  258. package/skills/pixelcraft-game-ui/references/unity-ui-toolkit.md +107 -0
  259. package/skills/pixelcraft-game-ui/references/unreal-umg.md +80 -0
  260. package/skills/pixelcraft-game-ui/references/web-and-middleware-game-ui.md +122 -0
  261. package/skills/pixelcraft-handoff/SKILL.md +50 -0
  262. package/skills/pixelcraft-handoff/references/design-translation.md +134 -0
  263. package/skills/pixelcraft-handoff/references/fidelity-tolerance.md +78 -0
  264. package/skills/pixelcraft-handoff/references/motion-handoff.md +54 -0
  265. package/skills/pixelcraft-media/SKILL.md +49 -0
  266. package/skills/pixelcraft-media/references/banners-video.md +130 -0
  267. package/skills/pixelcraft-media/references/og-generation.md +154 -0
  268. package/skills/pixelcraft-media/references/social-cards.md +71 -0
  269. package/skills/pixelcraft-mobile/SKILL.md +86 -0
  270. package/skills/pixelcraft-mobile/references/dotnet-maui.md +91 -0
  271. package/skills/pixelcraft-mobile/references/flet.md +80 -0
  272. package/skills/pixelcraft-mobile/references/flutter.md +113 -0
  273. package/skills/pixelcraft-mobile/references/harmonyos-and-emerging-mobile.md +121 -0
  274. package/skills/pixelcraft-mobile/references/ionic-capacitor.md +87 -0
  275. package/skills/pixelcraft-mobile/references/jetpack-compose.md +129 -0
  276. package/skills/pixelcraft-mobile/references/kivy.md +82 -0
  277. package/skills/pixelcraft-mobile/references/kotlin-multiplatform.md +86 -0
  278. package/skills/pixelcraft-mobile/references/lynxjs.md +110 -0
  279. package/skills/pixelcraft-mobile/references/nativescript-and-skip.md +91 -0
  280. package/skills/pixelcraft-mobile/references/react-native-expo.md +106 -0
  281. package/skills/pixelcraft-mobile/references/swiftui.md +200 -0
  282. package/skills/pixelcraft-mobile/references/tactile-interactions.md +55 -0
  283. package/skills/pixelcraft-mobile/references/task-state-composition.md +85 -0
  284. package/skills/pixelcraft-mobile/references/uikit.md +92 -0
  285. package/skills/pixelcraft-patterns/SKILL.md +75 -0
  286. package/skills/pixelcraft-patterns/references/accessibility-resilience.md +29 -0
  287. package/skills/pixelcraft-patterns/references/ai-and-offline-patterns.md +54 -0
  288. package/skills/pixelcraft-patterns/references/auth-onboarding.md +44 -0
  289. package/skills/pixelcraft-patterns/references/billing-paywalls.md +40 -0
  290. package/skills/pixelcraft-patterns/references/command-workspace.md +56 -0
  291. package/skills/pixelcraft-patterns/references/commerce.md +47 -0
  292. package/skills/pixelcraft-patterns/references/communication.md +45 -0
  293. package/skills/pixelcraft-patterns/references/creative-tools.md +42 -0
  294. package/skills/pixelcraft-patterns/references/creative-web-composition.md +38 -0
  295. package/skills/pixelcraft-patterns/references/dashboard-admin.md +35 -0
  296. package/skills/pixelcraft-patterns/references/history-diff-undo.md +50 -0
  297. package/skills/pixelcraft-patterns/references/marketing.md +44 -0
  298. package/skills/pixelcraft-patterns/references/multi-tenant-rbac.md +47 -0
  299. package/skills/pixelcraft-patterns/references/narrative-systems.md +42 -0
  300. package/skills/pixelcraft-patterns/references/notifications-activity.md +57 -0
  301. package/skills/pixelcraft-patterns/references/pattern-selection.md +80 -0
  302. package/skills/pixelcraft-patterns/references/scheduling-kanban.md +47 -0
  303. package/skills/pixelcraft-patterns/references/scroll-implementation.md +37 -0
  304. package/skills/pixelcraft-patterns/references/search-filtering.md +42 -0
  305. package/skills/pixelcraft-patterns/references/settings.md +51 -0
  306. package/skills/pixelcraft-patterns/references/tables-crud.md +43 -0
  307. package/skills/pixelcraft-plan/SKILL.md +103 -0
  308. package/skills/pixelcraft-plan/references/design-input.md +69 -0
  309. package/skills/pixelcraft-plan/references/discovery-interview.md +110 -0
  310. package/skills/pixelcraft-plan/references/grill-me-protocol.md +63 -0
  311. package/skills/pixelcraft-plan/references/plan-template.md +134 -0
  312. package/skills/pixelcraft-plan/references/repo-discovery.md +49 -0
  313. package/skills/pixelcraft-plan/references/stack-freshness.md +67 -0
  314. package/skills/pixelcraft-plan/references/stack-selection.md +98 -0
  315. package/skills/pixelcraft-review/SKILL.md +86 -0
  316. package/skills/pixelcraft-review/references/audit-report.md +69 -0
  317. package/skills/pixelcraft-review/references/critique-protocol.md +89 -0
  318. package/skills/pixelcraft-review/references/heuristics.md +63 -0
  319. package/skills/pixelcraft-review/references/personas.md +53 -0
  320. package/skills/pixelcraft-review/references/polish.md +78 -0
  321. package/skills/pixelcraft-review/scripts/check-acceptance.mjs +619 -0
  322. package/skills/pixelcraft-review/scripts/fixtures/brand-critique-waivers.json +14 -0
  323. package/skills/pixelcraft-review/scripts/fixtures/brand-critique.css +18 -0
  324. package/skills/pixelcraft-review/scripts/fixtures/clean.html +43 -0
  325. package/skills/pixelcraft-review/scripts/fixtures/focus-after-block.css +4 -0
  326. package/skills/pixelcraft-review/scripts/fixtures/focus-at-rules.css +17 -0
  327. package/skills/pixelcraft-review/scripts/fixtures/focus-comments.css +10 -0
  328. package/skills/pixelcraft-review/scripts/fixtures/focus-html-quote-leak.html +12 -0
  329. package/skills/pixelcraft-review/scripts/fixtures/focus-invalid-replacements.css +27 -0
  330. package/skills/pixelcraft-review/scripts/fixtures/focus-longhand-removal.css +34 -0
  331. package/skills/pixelcraft-review/scripts/fixtures/focus-nested-rules.css +19 -0
  332. package/skills/pixelcraft-review/scripts/fixtures/focus-not-visible-skip.css +8 -0
  333. package/skills/pixelcraft-review/scripts/fixtures/focus-outline-shorthands.css +11 -0
  334. package/skills/pixelcraft-review/scripts/fixtures/focus-unknown-and-border.css +15 -0
  335. package/skills/pixelcraft-review/scripts/fixtures/focus-unknown-last-wins.css +19 -0
  336. package/skills/pixelcraft-review/scripts/fixtures/focus-valid-replacements-extended.css +29 -0
  337. package/skills/pixelcraft-review/scripts/fixtures/focus-visible-no-replacement.css +3 -0
  338. package/skills/pixelcraft-review/scripts/fixtures/focus-visible-valid-replacements.css +9 -0
  339. package/skills/pixelcraft-review/scripts/fixtures/slop.html +28 -0
  340. package/skills/pixelcraft-review/scripts/slop-scan.mjs +1233 -0
  341. package/skills/pixelcraft-spatial/SKILL.md +51 -0
  342. package/skills/pixelcraft-spatial/references/comfort-accessibility.md +39 -0
  343. package/skills/pixelcraft-spatial/references/platforms.md +147 -0
  344. package/skills/pixelcraft-tokens/SKILL.md +60 -0
  345. package/skills/pixelcraft-tokens/assets/tokens.example.json +71 -0
  346. package/skills/pixelcraft-tokens/assets/tokens.modes.example.json +47 -0
  347. package/skills/pixelcraft-tokens/references/adoption.md +55 -0
  348. package/skills/pixelcraft-tokens/references/format.md +84 -0
  349. package/skills/pixelcraft-tokens/references/governance.md +80 -0
  350. package/skills/pixelcraft-tokens/references/state-tokens.md +62 -0
  351. package/skills/pixelcraft-tokens/references/theme-presets.md +122 -0
  352. package/skills/pixelcraft-tokens/references/token-tooling.md +119 -0
  353. package/skills/pixelcraft-tokens/scripts/export-tokens.mjs +847 -0
  354. package/skills/pixelcraft-tui/SKILL.md +76 -0
  355. package/skills/pixelcraft-tui/references/bubbletea-lipgloss.md +79 -0
  356. package/skills/pixelcraft-tui/references/extended-tui-toolkits.md +127 -0
  357. package/skills/pixelcraft-tui/references/ink.md +109 -0
  358. package/skills/pixelcraft-tui/references/ratatui.md +102 -0
  359. package/skills/pixelcraft-tui/references/rich.md +82 -0
  360. package/skills/pixelcraft-tui/references/terminal-protocols.md +80 -0
  361. package/skills/pixelcraft-tui/references/textual.md +108 -0
  362. package/skills/pixelcraft-ux/SKILL.md +56 -0
  363. package/skills/pixelcraft-ux/references/cognitive-walkthrough.md +70 -0
  364. package/skills/pixelcraft-ux/references/feedback-performance.md +50 -0
  365. package/skills/pixelcraft-ux/references/flows-ia.md +44 -0
  366. package/skills/pixelcraft-ux/references/forms.md +151 -0
  367. package/skills/pixelcraft-ux/references/i18n.md +221 -0
  368. package/skills/pixelcraft-ux/references/laws.md +39 -0
  369. package/skills/pixelcraft-ux/references/locale-test-matrix.md +60 -0
  370. package/skills/pixelcraft-ux/references/state-matrix.md +53 -0
  371. package/skills/pixelcraft-ux/references/usability-testing.md +84 -0
  372. package/skills/pixelcraft-ux/references/ux-writing.md +44 -0
  373. package/skills/pixelcraft-visual-qa/SKILL.md +96 -0
  374. package/skills/pixelcraft-visual-qa/references/baseline-governance.md +70 -0
  375. package/skills/pixelcraft-visual-qa/references/capture-desktop-game.md +59 -0
  376. package/skills/pixelcraft-visual-qa/references/capture-document.md +70 -0
  377. package/skills/pixelcraft-visual-qa/references/capture-email.md +38 -0
  378. package/skills/pixelcraft-visual-qa/references/capture-mobile.md +50 -0
  379. package/skills/pixelcraft-visual-qa/references/capture-terminal.md +35 -0
  380. package/skills/pixelcraft-visual-qa/references/critique-rubric.md +71 -0
  381. package/skills/pixelcraft-visual-qa/references/finish-gate.md +35 -0
  382. package/skills/pixelcraft-visual-qa/references/measured-craft.md +30 -0
  383. package/skills/pixelcraft-visual-qa/references/motion-capture.md +63 -0
  384. package/skills/pixelcraft-visual-qa/references/performance-budgets.md +78 -0
  385. package/skills/pixelcraft-visual-qa/references/realtime-graphics.md +55 -0
  386. package/skills/pixelcraft-visual-qa/references/task-verification.md +81 -0
  387. package/skills/pixelcraft-visual-qa/scripts/check-contrast.mjs +442 -0
  388. package/skills/pixelcraft-visual-qa/scripts/check-email.mjs +397 -0
  389. package/skills/pixelcraft-visual-qa/scripts/check-pdf.mjs +189 -0
  390. package/skills/pixelcraft-visual-qa/scripts/check-tui.mjs +321 -0
  391. package/skills/pixelcraft-visual-qa/scripts/finish-gate.mjs +174 -0
  392. package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-aria-modal.html +19 -0
  393. package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-audit.html +34 -0
  394. package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-modal.html +17 -0
  395. package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory-deferred.js +1 -0
  396. package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory-edge.html +52 -0
  397. package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory.html +80 -0
  398. package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory.js +8 -0
  399. package/skills/pixelcraft-visual-qa/scripts/shoot.mjs +668 -0
  400. package/skills/pixelcraft-visual-qa/scripts/style-inventory.mjs +1226 -0
  401. package/skills/pixelcraft-web/SKILL.md +132 -0
  402. package/skills/pixelcraft-web/references/accessibility-performance.md +42 -0
  403. package/skills/pixelcraft-web/references/adaptive-layout.md +69 -0
  404. package/skills/pixelcraft-web/references/angular.md +108 -0
  405. package/skills/pixelcraft-web/references/assets-pipeline.md +67 -0
  406. package/skills/pixelcraft-web/references/astro.md +113 -0
  407. package/skills/pixelcraft-web/references/audio-reactive.md +61 -0
  408. package/skills/pixelcraft-web/references/auth-and-checkout-ui.md +115 -0
  409. package/skills/pixelcraft-web/references/build-and-architecture.md +215 -0
  410. package/skills/pixelcraft-web/references/canvas-and-node-editors.md +157 -0
  411. package/skills/pixelcraft-web/references/clojurescript.md +88 -0
  412. package/skills/pixelcraft-web/references/component-systems.md +102 -0
  413. package/skills/pixelcraft-web/references/component-testing.md +170 -0
  414. package/skills/pixelcraft-web/references/creative-effects.md +59 -0
  415. package/skills/pixelcraft-web/references/creative-runtime.md +34 -0
  416. package/skills/pixelcraft-web/references/elm.md +53 -0
  417. package/skills/pixelcraft-web/references/enterprise-data-ui.md +138 -0
  418. package/skills/pixelcraft-web/references/file-upload-media-ui.md +82 -0
  419. package/skills/pixelcraft-web/references/forms-validation.md +123 -0
  420. package/skills/pixelcraft-web/references/fsharp-fable.md +54 -0
  421. package/skills/pixelcraft-web/references/gsap.md +102 -0
  422. package/skills/pixelcraft-web/references/html-css.md +220 -0
  423. package/skills/pixelcraft-web/references/htmx-alpine.md +103 -0
  424. package/skills/pixelcraft-web/references/i18n-engineering.md +106 -0
  425. package/skills/pixelcraft-web/references/interaction-and-search-primitives.md +196 -0
  426. package/skills/pixelcraft-web/references/java-web.md +61 -0
  427. package/skills/pixelcraft-web/references/kotlin-web.md +57 -0
  428. package/skills/pixelcraft-web/references/leptos-yew.md +97 -0
  429. package/skills/pixelcraft-web/references/lit-web-components.md +63 -0
  430. package/skills/pixelcraft-web/references/local-first-sync.md +105 -0
  431. package/skills/pixelcraft-web/references/media-players.md +104 -0
  432. package/skills/pixelcraft-web/references/motion-react.md +96 -0
  433. package/skills/pixelcraft-web/references/motion-recipes.md +82 -0
  434. package/skills/pixelcraft-web/references/preact-fresh-hono.md +111 -0
  435. package/skills/pixelcraft-web/references/pwa.md +230 -0
  436. package/skills/pixelcraft-web/references/qwik.md +94 -0
  437. package/skills/pixelcraft-web/references/r3f-integration.md +69 -0
  438. package/skills/pixelcraft-web/references/react-next.md +168 -0
  439. package/skills/pixelcraft-web/references/rendering-choice.md +63 -0
  440. package/skills/pixelcraft-web/references/rendering-performance.md +80 -0
  441. package/skills/pixelcraft-web/references/rich-text-and-code-editors.md +220 -0
  442. package/skills/pixelcraft-web/references/rive-lottie.md +73 -0
  443. package/skills/pixelcraft-web/references/scala-laminar.md +53 -0
  444. package/skills/pixelcraft-web/references/scene-architecture.md +132 -0
  445. package/skills/pixelcraft-web/references/server-rendered.md +114 -0
  446. package/skills/pixelcraft-web/references/shader-workflow.md +77 -0
  447. package/skills/pixelcraft-web/references/smooth-scroll.md +58 -0
  448. package/skills/pixelcraft-web/references/solid.md +111 -0
  449. package/skills/pixelcraft-web/references/state-architecture.md +107 -0
  450. package/skills/pixelcraft-web/references/styling-ecosystem.md +273 -0
  451. package/skills/pixelcraft-web/references/svelte.md +111 -0
  452. package/skills/pixelcraft-web/references/tailwind.md +99 -0
  453. package/skills/pixelcraft-web/references/video-media.md +69 -0
  454. package/skills/pixelcraft-web/references/vue-nuxt.md +86 -0
  455. package/skills/pixelcraft-web/references/web-3d-engines.md +97 -0
@@ -0,0 +1,159 @@
1
+ # Maps and geospatial UI
2
+
3
+ Choose a mapping engine only when spatial location is essential—tables, ranked lists, or tile-grid cartograms often communicate regional comparisons better. When a map is justified, pick the engine by **tile format (vector vs raster), coordinate system (Web Mercator vs custom GIS CRS vs 3D WGS84 globe), feature count, and licensing**.
4
+
5
+ ## Geospatial engine decision matrix
6
+
7
+ | Engine | Rendering | Best fit | Licensing / cost | Primary trade-off |
8
+ |---|---|---|---|---|
9
+ | **MapLibre GL JS (v5+)** | WebGL2 vector tiles + native globe projection | Open-source 2D/3D vector maps, custom basemap styles, self-hosted PMTiles/Protomaps | BSD-3 (bring your own tiles/styles) | Requires tile/style hosting or PMTiles setup |
10
+ | **Mapbox GL JS** | WebGL vector tiles + 3D terrain/globe | Commercial turnkey maps, geocoding, directions, Studio styling | Proprietary / metered map loads | Vendor lock-in and per-load billing |
11
+ | **Leaflet** | DOM/SVG or Canvas (`preferCanvas: true`) raster tiles | Lightweight store locators, simple markers/choropleths (< 5k features) | BSD-2 (open source) | Raster tiles blur on fractional zoom/rotation; DOM markers lag past ~1k points |
12
+ | **OpenLayers** | Canvas 2D / WebGL | Specialized GIS: custom projections (`proj4`), OGC WMS/WFS/WMTS/WCS, cadastral editing | BSD-2 (open source) | Steeper API surface for simple consumer maps |
13
+ | **deck.gl (v9+)** | WebGL2 / WebGPU GPU layers | 100k–10M+ points, trips, arcs, hexbin/heatmap aggregations overlaid on a basemap | MIT (open source) | Needs a basemap provider for geographic context |
14
+ | **kepler.gl** | Turnkey geospatial analytics workbench over deck.gl | Exploratory data-science map apps with built-in filters and time sliders | MIT (open source) | Heavy Redux-coupled app shell; oversized for simple embeds |
15
+ | **CesiumJS** | WebGL 3D WGS84 globe + 3D Tiles | Aerospace, urban digital twins, terrain draping, satellite orbits, photogrammetry | Apache-2.0 (Cesium ion assets metered) | Large bundle (~3–5 MB + workers) and high GPU/battery draw on mobile |
16
+
17
+ ## Protomaps / PMTiles self-hosted vector tiles
18
+
19
+ Use **Protomaps / PMTiles** when you need zero-tile-server, cost-predictable vector maps served as a single static `.pmtiles` archive via HTTP Range requests (S3, Cloudflare R2, CDN). Always verify **glyph** (`.pbf` font stacks) and **sprite** URLs in style JSON—missing glyph endpoints cause every street and city label to vanish silently.
20
+
21
+ ```ts
22
+ import maplibregl from 'maplibre-gl';
23
+ import { Protocol } from 'pmtiles';
24
+ import 'maplibre-gl/dist/maplibre-gl.css';
25
+
26
+ const protocol = new Protocol();
27
+ maplibregl.addProtocol('pmtiles', protocol.tile);
28
+
29
+ const map = new maplibregl.Map({
30
+ container: 'map',
31
+ style: {
32
+ version: 8,
33
+ glyphs: 'https://cdn.example.com/fonts/{fontstack}/{range}.pbf',
34
+ sprite: 'https://cdn.example.com/sprites/v4/light',
35
+ sources: {
36
+ protomaps: {
37
+ type: 'vector',
38
+ url: 'pmtiles://https://cdn.example.com/tiles/region.pmtiles',
39
+ attribution: '© OpenStreetMap contributors',
40
+ },
41
+ },
42
+ layers: [/* basemap fill, road, and symbol layers */],
43
+ },
44
+ center: [-122.4, 37.78],
45
+ zoom: 11,
46
+ });
47
+ ```
48
+
49
+ ## MapLibre GL JS + deck.gl interleaved idiom & WebGL2 constraint
50
+
51
+ - Wait for `style.load` / `load` before calling `map.setProjection({ type: 'globe' })`, `map.addSource()`, or `map.addLayer()`, and always call `map.remove()` on unmount to release the WebGL context.
52
+ - **WebGL2 vs WebGPU constraint**: `MapLibreOverlay({ interleaved: true })` shares MapLibre GL JS's **WebGL2** context so deck.gl layers can render *beneath* basemap labels via `beforeId`. Interleaved mode **does not work with WebGPU**—if using deck.gl v9+'s WebGPU backend, run `interleaved: false` (separate overlay canvas) or keep deck.gl on WebGL2 when label interleaving matters.
53
+ - For 100k+ animated or streaming points in deck.gl, pass binary `Float32Array` attribute buffers (`{ length, attributes: { getPosition: { value, size, offset, stride } } }`) instead of allocating JS objects per frame.
54
+
55
+ ```ts
56
+ import { MapLibreOverlay } from '@deck.gl/maplibre';
57
+ import { ScatterplotLayer } from '@deck.gl/layers';
58
+
59
+ await map.once('load');
60
+
61
+ map.addControl(
62
+ new MapLibreOverlay({
63
+ interleaved: true, // requires sharing MapLibre's WebGL2 context (not WebGPU)
64
+ layers: [
65
+ new ScatterplotLayer({
66
+ id: 'sites',
67
+ data: sites,
68
+ getPosition: (d) => d.coords,
69
+ getFillColor: [15, 76, 129, 180],
70
+ getRadius: 200,
71
+ beforeId: 'places_locality', // keep city labels readable above data
72
+ }),
73
+ ],
74
+ }),
75
+ );
76
+ ```
77
+
78
+ ## Client-side spatial operations (`Turf.js`)
79
+
80
+ Use modular **Turf.js** packages (`@turf/bbox`, `@turf/boolean-point-in-polygon`, `@turf/buffer`, `@turf/distance`) for client-side viewport bounds, polygon filtering, geofence checks, and spatial joins on small-to-medium GeoJSON without round-tripping to PostGIS:
81
+
82
+ ```ts
83
+ import bbox from '@turf/bbox';
84
+ import booleanPointInPolygon from '@turf/boolean-point-in-polygon';
85
+
86
+ const visibleSites = sitesGeoJson.features.filter((pt) => booleanPointInPolygon(pt, activeRegionPolygon));
87
+ const [minX, minY, maxX, maxY] = bbox({ type: 'FeatureCollection', features: visibleSites });
88
+ map.fitBounds([[minX, minY], [maxX, maxY]], { padding: 32 });
89
+ ```
90
+
91
+ Import individual `@turf/*` modules instead of the full `@turf/turf` umbrella package to avoid bloating bundles. For >50k complex polygons, offload spatial indexing to PostGIS, DuckDB Spatial, or a Web Worker.
92
+
93
+ ## Leaflet & Mapbox GL JS idioms and traps
94
+
95
+ ### Leaflet (`preferCanvas: true`, clustering, & StrictMode cleanup)
96
+
97
+ - **Vector & marker scale**: pass **`preferCanvas: true`** to `L.map(...)` whenever rendering hundreds of `L.circleMarker` / GeoJSON polygons so Leaflet renders on Canvas 2D instead of saturating the DOM with thousands of SVG nodes; use **`leaflet.markercluster`** (or `supercluster`) once pin counts exceed ~200 so overlapping pins remain tappable and readable.
98
+ - **Lifecycle & accessibility**: ensure the map container has an explicit CSS height (zero height renders a blank tile grid), call **`map.remove()`** on unmount (prevents React StrictMode `Map container is already initialized` crashes), provide explicit keyboard pan/zoom controls, and pair markers with a synchronized searchable/sortable location list so keyboard and screen-reader users can inspect every site.
99
+
100
+ ```ts
101
+ import L from 'leaflet';
102
+ import 'leaflet/dist/leaflet.css';
103
+
104
+ export function mountLeafletMap(el: HTMLElement, sites: { name: string; lat: number; lng: number }[]) {
105
+ const map = L.map(el, { preferCanvas: true }).setView([37.78, -122.4], 11);
106
+ L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
107
+ attribution: '© OpenStreetMap contributors',
108
+ maxZoom: 19,
109
+ }).addTo(map);
110
+
111
+ for (const site of sites) {
112
+ L.circleMarker([site.lat, site.lng], { radius: 6, color: '#0f4c81' })
113
+ .bindPopup(site.name)
114
+ .addTo(map);
115
+ }
116
+ return () => map.remove();
117
+ }
118
+ ```
119
+
120
+ ### Mapbox GL JS (scoped public tokens, contrast, & MapLibre parity)
121
+
122
+ - **Scoped public token only**: restrict browser access tokens (`pk.*`) by HTTP referrer / allowed URLs and public read scopes only—**never** bundle secret `sk.*` tokens into frontend code. Call `map.remove()` on unmount to avoid leaking WebGL contexts and triggering redundant metered map loads.
123
+ - **Projection & style contrast**: test data-overlay contrast across both light and dark Studio styles, `globe` vs `mercator` projections, and 3D terrain/fog settings—low-contrast basemap roads or atmospheric fog easily wash out thematic data layers.
124
+ - **MapLibre GL JS parity**: Mapbox GL JS and MapLibre GL JS share Style Spec roots (`addSource`, `addLayer`, expressions), but diverge on Mapbox v3 proprietary features (Standard Style `import` slots, Mapbox-hosted 3D lighting/config APIs, and commercial telemetry/billing). Keep custom data layers in standard GeoJSON/vector Style Spec expressions whenever preserving a future migration path to open-source MapLibre matters.
125
+
126
+ ## CesiumJS 3D Tiles & lifecycle
127
+
128
+ Load 3D Tiles asynchronously via `await Cesium.Cesium3DTileset.fromUrl(url, { skipLevelOfDetail: true })` (never deprecated synchronous constructors) and call `viewer.destroy()` on unmount.
129
+
130
+ ## Choropleth pitfalls, cartographic truthfulness & accessibility
131
+
132
+ - **Normalization**: Normalize counts by population, households, or area when comparing unequal regions; if mapping raw counts intentionally, label them explicitly as counts and consider proportional symbols instead.
133
+ - **Classification breaks**: Quantile, equal-interval, natural breaks (Jenks), and manual thresholds tell different stories—publish the classification method and break values in the legend.
134
+ - **Area distortion**: Large sparse regions visually overwhelm dense cities in Web Mercator or raw choropleths; use equal-area projections (D3/Observable Plot), globe projection, cartograms, or tile-grid maps when fair regional weight matters.
135
+ - **Missing vs zero data**: Give missing/no-data regions a distinct neutral fill or hatch pattern—never reuse the zero/minimum value color.
136
+ - **Boundaries & attribution**: Territory borders can be politically sensitive; select boundary datasets consciously for the product's legal/user context and display required attributions (OpenStreetMap, tile host, GIS agency) legibly.
137
+ - **Accessible alternative**: WebGL and Canvas maps are opaque to screen readers and hard for keyboard/tremor users—pair every data map with a searchable/sortable location list or ranking table, direct labels for key regions, keyboard pan/zoom controls, and visible focus rings (WCAG 2.1.1 & 2.5.7).
138
+
139
+ ## Do/don't pairs
140
+
141
+ | Do | Don't |
142
+ |---|---|
143
+ | Call `map.remove()` / `viewer.destroy()` on unmount | Leak WebGL contexts (browsers cap ~8–16), double-init Leaflet, or inflate metered Mapbox loads |
144
+ | Set `preferCanvas: true` + marker clustering in Leaflet for >200 features | Mount 2,000 DOM/SVG markers in Leaflet without clustering or a list fallback |
145
+ | Restrict Mapbox GL JS `pk.*` tokens by referrer and verify style/projection contrast | Ship unrestricted/secret `sk.*` tokens or assume dark basemap labels stay legible under 3D fog |
146
+ | Keep deck.gl on WebGL2 when using `MapLibreOverlay({ interleaved: true })` | Assume WebGPU deck.gl layers can interleave into MapLibre's WebGL2 context |
147
+ | Self-host PMTiles with explicit `glyphs` and `sprite` URLs | Omit `glyphs` in style JSON and ship a map with missing labels |
148
+ | Give missing choropleth regions a distinct neutral/hatched treatment | Color missing regions identically to `0` |
149
+ | Import modular `@turf/bbox` / `@turf/boolean-point-in-polygon` | Pull the entire `@turf/turf` monolith for one distance check |
150
+ | Pair every interactive map with a keyboard-accessible ranking table/list | Trap critical location metrics inside hover-only pins |
151
+
152
+ ## Verification commands
153
+
154
+ ```sh
155
+ npm run build
156
+ npx playwright test
157
+ ```
158
+
159
+ Verify lazy bundle splitting and modular `@turf/*` imports (`static`), and inspect WebGL context cleanup across route transitions, glyph/label rendering, mobile touch pan/zoom (`touch-action`), missing-data styling, and keyboard/table fallback in a browser (`rendered`).
@@ -0,0 +1,92 @@
1
+ # Real-time data, node graphs, and rendering scale
2
+
3
+ ## Real-time and streaming data
4
+
5
+ Define the temporal semantics before implementation:
6
+
7
+ | Question | Required design |
8
+ |---|---|
9
+ | What is "now"? | Show event time versus ingestion/clock time; state timezone and latency. |
10
+ | Is data append-only or revised? | Make corrections/backfills visible rather than silently rewriting history. |
11
+ | What cadence matters? | Update at decision cadence, not raw socket cadence. |
12
+ | What happens on burst/backlog? | Aggregate, sample honestly, drop nonessential frames, or pause; never freeze silently. |
13
+ | What happens disconnected? | Mark last-known data stale with timestamp; preserve user context; reconnect/resume deliberately. |
14
+ | Can users inspect history? | Provide pause, time window, scrub/playback, or snapshot semantics. |
15
+
16
+ Implementation rules:
17
+
18
+ - Batch expensive rendering with `requestAnimationFrame` (or platform equivalent); never re-render the full chart on every WebSocket message.
19
+ - Bound memory with explicit ring buffers/sliding windows and document the retention policy.
20
+ - Throttle consumers and pause nonessential rendering when tabs/windows are hidden.
21
+ - Reserve stable numeric widths with `tabular-nums` so streaming counters never jitter layout.
22
+ - Do not flood screen-reader live regions on every tick; summarize consequential state changes at controlled intervals and provide a pause control.
23
+ - Keep badges truthful: "live", "paused", "stale", and "reconnecting" are separate visible states. Avoid pulsing green demo dots and random-walk fake telemetry.
24
+
25
+ ## Node graphs and network diagrams
26
+
27
+ First clarify the **cross-skill boundary**: analytical topology, dependency, and network visualization (read/explore/cluster/trace) belongs in `pixelcraft-dataviz`. Interactive workflow/node-graph **editors** (automation builders, visual pipelines, canvas undo/redo, node inspector forms) coordinate with `pixelcraft-web` (interaction mechanics) and `pixelcraft-patterns` (creative tools, history/undo).
28
+
29
+ A force-directed hairball is rarely the right default—match the graph engine to node count and task:
30
+
31
+ | Graph engine | Rendering | Sweet spot | Best fit | Practical trade-off |
32
+ |---|---|---|---|---|
33
+ | **`@xyflow/react` v12 / `@xyflow/svelte`** | DOM/HTML nodes + SVG edges | < 1,500 visible nodes | Workflow/pipeline editors, custom rich node UIs, architecture diagrams | Rich DOM nodes slow down past ~1–2k simultaneous elements; pair with ELK/dagre layout |
34
+ | **Cytoscape.js** | Canvas 2D | 500–10k elements | Analytical network exploration, bioinformatics, compound graphs (`cose`, `breadthfirst`, `elk`) | Canvas is opaque to screen readers; requires external list/neighborhood text view |
35
+ | **AntV G6 (v5)** | Canvas 2D / WebGL / SVG | 1k–100k elements | Enterprise lineage, combo/nested graphs, radial/dagre/force layouts | Larger API surface; verify bundle splitting and accessibility wrappers |
36
+ | **Sigma.js (v3 + Graphology)** | WebGL | 10k–100k+ nodes/edges | Large interactive network exploration, citation/knowledge graphs | Custom WebGL shaders needed for non-standard node shapes; external search/table required |
37
+ | **Cosmograph** | WebGL / GPU force simulation | 100k–1M+ nodes/edges | Massive graph exploration and GPU-accelerated force layout | High GPU demand; always provide filtered subgraphs and non-visual summaries |
38
+
39
+ ### `@xyflow/react` v12 & `@xyflow/svelte` rules
40
+
41
+ - Migrate legacy `reactflow` imports to `@xyflow/react` v12 (supports `colorMode="system" | "dark" | "light"`, SSR hydration with explicit node dimensions, and computed layout hooks) or `@xyflow/svelte` for Svelte 5 apps.
42
+ - Model controlled state (`nodes`, `edges`, `onNodesChange`, `onEdgesChange`) when selection, persistence, or undo matters.
43
+ - Compute deterministic initial layouts with **ELKjs** or **dagre** before mounting; call `fitView` once on initial load, not on every data mutation.
44
+ - Set `nodesFocusable` and `edgesFocusable`, configure permission-gated editing (`nodesDraggable`, `nodesConnectable`), and verify visible keyboard focus rings inside custom node DOM.
45
+
46
+ ### Universal graph UX rules
47
+
48
+ - Label edge direction and meaning; never add decorative arrows.
49
+ - Cluster or collapse dense neighborhoods with visible member counts and expand/collapse controls.
50
+ - Preserve zoom/pan and user-adjusted node positions across data refreshes.
51
+ - Always supply search/jump-to-node, shortest-path or neighbor highlighting, and explicit empty, disconnected, cyclic, and permission-redacted states.
52
+
53
+ ## Maps and geospatial UI
54
+
55
+ Use a map only when geography itself is the analytical key (otherwise prefer ranked bars, tables, or tile-grid cartograms). For full geospatial engine selection (MapLibre GL JS, Mapbox, Leaflet, OpenLayers, deck.gl WebGL2 interleaving, CesiumJS), self-hosted Protomaps/PMTiles, Turf.js client spatial ops, and choropleth pitfalls (normalization, breaks, missing-data fills, boundaries), read [maps-geospatial.md](maps-geospatial.md).
56
+
57
+ ## Rendering and data-scale tiers
58
+
59
+ There is no single cutoff—measure on target hardware—but use this architectural ladder:
60
+
61
+ 1. **SVG / DOM** (dozens to ~2,000 marks): Default when crisp typography, CSS theming, print export, and native accessibility matter most.
62
+ 2. **Canvas 2D** (~2k to ~100k marks, or high-frequency time series): Use `uPlot`, `ECharts`, `Chart.js`, or `TradingView Lightweight Charts` with an external semantic summary/table.
63
+ 3. **WebGL / GPU** (100k–10M+ points or dense graphs): Use `deck.gl`, `Sigma.js`, `Cosmograph`, `Plotly scattergl`, or `GLMakie` with binary typed arrays (`Float32Array`) and context cleanup on unmount.
64
+ 4. **WASM & SQL pre-aggregation** (multi-million-row interactive filtering & streaming pivots):
65
+ - **UW IDL Mosaic + DuckDB-Wasm**: Materializes pre-aggregated data cubes so brushing/cross-filtering millions of rows stays sub-16ms in the browser.
66
+ - **FINOS Perspective**: C++/Rust WASM streaming engine for high-frequency financial blotters, virtualized pivots, and live views.
67
+ - **Datashader (Python)**: Server/GPU rasterization for billion-point distributions without browser overplotting.
68
+ 5. **3D only when depth carries information** (terrain, molecular structures, physical digital twins, orbital trajectories)—never to embellish a 2D chart.
69
+
70
+ Canvas, WebGL, and WASM layers never waive accessibility: retain an offscreen/external semantic data summary, keyboard controls, and CSV/table access.
71
+
72
+ ## Perceptual time-series downsampling (`LTTB` & `Min-Max` envelopes)
73
+
74
+ Never downsample dense time-series (`10k–1M+` points) onto an `800–1600px` chart using naive `every-Nth` stride slicing (`rows[::step]` or `points.filter((_, i) => i % step === 0)`): stride slicing drops `99%` of samples blind to amplitude, **erasing single-tick P99 latency spikes, voltage transients, and flash crashes**.
75
+
76
+ | Method | Target budget | Guarantee & best fit |
77
+ |---|---|---|
78
+ | **`LTTB` (Largest-Triangle-Three-Buckets)** | `2×`–`4×` chart CSS pixel width (e.g. `1,500–3,000` points for a `1000px` plot) | Selects the actual observed point in each bucket maximizing triangular area with neighbors—preserving local extrema, slopes, and exact hoverable `(t, y)` coordinates without inventing synthetic averages |
79
+ | **Per-pixel `Min-Max` (M4) envelope** | `1` bucket per horizontal pixel (`[first, min, max, last]` or `[min, max]` band) | **Mathematically lossless visual hull**: every spike and drop across millions of rows renders inside the pixel column's vertical stroke; ideal for observability, oscilloscope, and financial tick series |
80
+ | **Zoom-triggered re-query** | Re-run `LTTB` / `Min-Max` on `[t_start, t_end]` in SQL/DuckDB/Polars |Brushing into a 5-minute incident window switches seamlessly from downsampled overview to raw unaggregated events, displaying a badge (`Downsampled · LTTB 2,000 pts` vs `Raw · 840 pts`) |
81
+
82
+ ## Performance verification
83
+
84
+ Measure with realistic cardinality (`10k–1M+` points) and device constraints:
85
+
86
+ - initial parse, `LTTB` / `Min-Max` reduction, WASM/tile fetch, layout, and first-paint time;
87
+ - frame time during pan, zoom re-query, brush, hover, and filter changes;
88
+ - spike-preservation check: inject a single-sample `10×` outlier into a `100k`-point series and verify it remains visible at overview zoom (`rendered`);
89
+ - memory and WebGL context cleanup across route changes and reconnects;
90
+ - bundle, worker, and tile payload size plus mobile thermal/battery behavior.
91
+
92
+ Label measurements honestly as `rendered` or `not-checked`—a 20-row mock dataset proving 60 fps is not scale evidence.
@@ -0,0 +1,93 @@
1
+ ---
2
+ name: pixelcraft-desktop
3
+ description: Translates Pixelcraft direction, tokens, UX, and floor requirements into desktop applications across Tauri, Electron, Electrobun, Qt 6/PySide6/PyQt6/QML, WinUI 3/WPF, AppKit, SwiftUI macOS, GTK4/libadwaita, Avalonia, Rust GUI (GPUI, Dioxus, Iced, libcosmic, Vizia, Slint, egui, AccessKit), JavaFX/Swing, C++/C/Zig GUI (JUCE, GTKmm, FLTK, wxWidgets, Dear ImGui, Nuklear, Ultralight), Go GUI (Wails v3, Fyne, Gio), and Uno Platform. Use for window/menu design, keyboard shortcuts, resizing, multi-monitor restore, high-DPI, native/custom chrome, platform accessibility, and desktop verification.
4
+ license: MIT
5
+ metadata:
6
+ version: 0.1.0
7
+ ---
8
+
9
+ # Pixelcraft desktop
10
+
11
+ Use this skill when the surface is a desktop window rather than a browser page or phone screen. Desktop quality depends on window behavior, input acceleration, persistence, menus, shortcuts, density, and platform chrome as much as visual styling.
12
+
13
+ ## Surface craft
14
+
15
+ Organize persistent navigation, working content and one contextual inspector around the object being edited; hide secondary chrome without hiding state or actions from menus and shortcuts. Resize to the supported minimum, detach or collapse the inspector, then reopen the last workspace and verify selection, keyboard focus and document state.
16
+
17
+ ## Detection signals
18
+
19
+ `src-tauri/tauri.conf.json`, Electron main/preload configs, `electrobun.config.*`, Qt 6 `.pro`/CMake/PySide6/PyQt6/`.ui`/QML/Kirigami imports, `.csproj` WinUI 3/WPF/Avalonia/Uno (`Uno.Sdk`) references, Xcode AppKit or SwiftUI macOS scenes (`WindowGroup`/`DocumentGroup`/`MenuBarExtra`), GTK4/libadwaita/GTKmm/Blueprint (`.blp`) definitions, Rust `gpui`/`egui`/`slint`/`dioxus`/`iced`/`libcosmic`/`vizia`/`floem`/`relm4`/`xilem` dependencies, Go `wails3`/`wails`/`fyne`/`gio` modules, JavaFX/Swing/FlatLaf, C++/C/Zig `JUCE`/`FLTK`/`wxWidgets`/`imgui`/`nuklear`/`ultralight`/`dvui`/`clay`, installers/bundles, menu/shortcut registration, multi-window architecture.
20
+
21
+ ## Translate direction to desktop idioms
22
+
23
+ 1. Map tokens to native or webview theme resources while respecting system light/dark/high-contrast modes and platform accent/vibrancy/glass fallbacks.
24
+ 2. Decide whether chrome is native, custom, or hybrid before layout. Never hide essential window controls or break drag/resize/minimize/Snap Layouts behavior.
25
+ 3. Design for keyboard/mouse precision and acceleration: shortcuts, `F6`/pane focus traversal, context menus, multiple selection, undo, drag/drop, scroll behavior, toolbar density.
26
+ 4. Handle window state: resize, minimum size, split panes, maximized/fullscreen, multiple windows/monitors, invalid-bounds clamping on restore, DPI changes (and Wayland's no-global-positioning model).
27
+ 5. Respect platform conventions: macOS menu bar vs Windows/Linux window menus, close/quit semantics, document modified state, notifications, taskbar/dock/tray integration.
28
+ 6. Use web idioms inside Tauri/Electron/Electrobun/Wails only after honoring desktop shell behavior and security boundaries.
29
+
30
+ ## Platform-wide rules
31
+
32
+ - **Startup, idle CPU & 30-minute active RAM envelope**: hit **`< 300–500 ms`** cold start on Native/Tauri/Rust/C++/Qt/AppKit/WinUI/GTK apps or **`< 1.0–1.2 s`** on Electron (explicitly justifying Chromium's footprint in the brief); hold **`~0%` idle CPU** when minimized or unfocused; **measure RSS/private RAM after 30 minutes of active usage** against the agreed memory ceiling (verifying zero unbounded leaks); and offload heavy I/O to worker threads/processes.
33
+ - **Full workspace session restoration & mixed-DPI clamping**: never trap users in fixed-size windows unless truly modal; restore the **full workspace session across restarts** (open windows, tabs, split ratios, scroll/cursor context, and active/unsaved documents), preserve bounds across mixed-DPI (`100%` ↔ `200%`) monitors, and **clamp off-screen coordinates** onto a connected display's work area when external monitors disconnect (respecting Wayland's size-only model).
34
+ - **OS-standard paths, atomic persistence, clean uninstall & support logs**: store config, caches, DBs, and logs in XDG / `~/Library/Application Support` / `%APPDATA%` (never beside the executable); write files atomically (**write temp → `fsync` → atomic rename**) and run SQLite in **`WAL` mode** with versioned migrations; ship a **clean uninstaller** (leaving zero leftover daemons, LaunchAgents, Services, or registry bloat—with explicit user choice on keeping vs removing user data) and an **opt-in support/diagnostic log export** bundle (PII/token redacted).
35
+ - **Keyboard acceleration, high-contrast modes & multi-window hygiene**: every primary workflow completes without a mouse (`Tab`, `F6` pane cycle, platform `Cmd` vs `Ctrl` accelerators, `Escape`); honor **Windows `forced-colors` / High Contrast themes and macOS `Increase Contrast` + `Reduce Transparency`**; guard dirty documents on close/quit; soften unfocused window chrome so active focus across multiple windows is unmistakable.
36
+ - **2026 code signing, clean-VM install proof & live `v(N-1) -> vN` auto-update rollback**: macOS Developer ID + Hardened Runtime + `xcrun notarytool` + `stapler` + **clean-VM install screenshot** confirming zero Gatekeeper warning; Windows Authenticode via **Azure Artifact Signing (Trusted Signing)** or HSM OV/EV + **clean-VM SmartScreen/install capture** (noting EV certs no longer grant instant SmartScreen bypass since 2024); Linux `.deb`/`.rpm`/Flatpak/GPG AppImage; **`Ed25519`/`minisign`-signed delta auto-updates + rollback verified live across 2 consecutive versions (`v(N-1) -> vN`)**; screen-reader verification across **`NVDA`/`JAWS`/`Narrator`**, **`VoiceOver`**, and **`Orca`** (AT-SPI/AccessKit).
37
+
38
+ ## The 8 WebView Giveaway Killers (mandatory for Tauri / Electron / Wails / WebView2)
39
+
40
+ 1. **`cursor: default`** on buttons, tabs, sidebar rows, menus, and chrome—reserve `cursor: pointer` strictly for external web links.
41
+ 2. **`user-select: none`** on all toolbars, sidebars, tabs, menus, and buttons (selectable strictly inside editor/content/log panes).
42
+ 3. **Block browser tells in production**: suppress raw browser `contextmenu` ("Inspect Element"), `Cmd/Ctrl+R` page reload, `Cmd/Ctrl +`/`-` accidental pinch-zoom, and rubber-band `overscroll-behavior` on outer chrome.
43
+ 4. **Zero white flash on dark cold start**: create hidden native window (`show: false` / `visible: false`) with dark/theme-matched native `backgroundColor` before first paint, revealing on ready.
44
+ 5. **Custom `40–52 px` titlebar geometry**: dedicated drag region (`data-tauri-drag-region` / `-webkit-app-region: drag`) excluding interactive buttons, double-click to maximize/zoom per OS setting, and **`72–80 px` left inset** for macOS traffic lights (collapsed on fullscreen).
45
+ 6. **Native OS materials + inactive-window dimming**: pair `NSVisualEffectView` / `Mica` / `Acrylic` / libadwaita backdrops (plus High Contrast / Reduce Transparency fallbacks) with `:window-inactive` / focus-state dimming on unfocused sidebars/titlebars.
46
+ 7. **Two-way native OS file drag-and-drop & dialogs**: support dropping files from Finder/Explorer with visual drop targets, dragging files out to Desktop/apps, and native OS file open/save dialogs.
47
+ 8. **Native OS menu bar & single-instance deep links**: register real `File/Edit/View/Window/Help` menus with `Cmd`/`Ctrl` shortcuts and single-instance deep-link activation.
48
+
49
+ ## Anti-lazy-default & anti-slop guard
50
+
51
+ - **Never default to plain `Tkinter` on greenfield Python desktop apps**: choose **PySide6 / Qt Quick**, **Flet**, **NiceGUI**, **Tauri** (Python sidecar), or **Textual** instead; apply strict DPI/threading/theme hygiene when inheriting brownfield `CustomTkinter` or `Dear PyGui`.
52
+ - **Reject unjustified ~200 MB Electron web-SPA wrappers**: when targeting a single OS, prefer native **SwiftUI/AppKit** (macOS), **WinUI 3** (Windows), or **GTK4 + libadwaita** (Linux); when cross-platform efficiency matters, evaluate **Tauri v2**, **Qt 6**, **Avalonia**, **Slint**, or **GPUI** before bundling Chromium.
53
+ - **Reject web-page chrome masquerading as a desktop app**: never paste an unadapted browser SPA into a desktop window without all 8 WebView Giveaway Killers, native menus, keyboard shortcuts, dirty-document close confirmation, and multi-monitor restore.
54
+
55
+ ## Common desktop failures
56
+
57
+ - WebView shell leaking `cursor: pointer`, selectable button text, white dark-mode launch flash, `Ctrl+R` reload, or browser "Inspect Element" menus;
58
+ - custom titlebar colliding with macOS traffic lights (`< 72 px` inset or stuck inset in fullscreen), swallowing button clicks, or breaking Windows Snap Layouts;
59
+ - restoring a window at off-screen coordinates after an external monitor is unplugged, losing open tabs/documents on restart, or blurring across `100%` ↔ `200%` mixed-DPI displays;
60
+ - writing `config.json`/SQLite next to the binary, leaving orphan background helpers/registry keys on uninstall, or truncating project files non-atomically without `fsync` + `rename`;
61
+ - assuming Windows EV certs still grant instant SmartScreen bypass or shipping untested auto-updaters.
62
+
63
+ ## Verification options
64
+
65
+ Rendered verification requires running the actual app/windowing stack or platform-specific UI tests (**Rule #0.3**: inner WebView DOM checks or compilation alone never count as `rendered` desktop verification). Attach 30-minute RAM/CPU profiler readings, clean-VM install screenshots, `v(N-1) -> vN` update/rollback logs, and `NVDA`/`JAWS`/`Narrator`/`VoiceOver`/`Orca` + High Contrast captures; label untested OSes `not-checked`.
66
+
67
+ ## Pre-submit checklist
68
+
69
+ - [ ] zero `TODO`s, placeholder stubs, invented copy, or dead menu/toolbar/shortcut handlers;
70
+ - [ ] all 8 WebView Giveaway Killers enforced (if Tauri/Electron/Wails/WebView2), `< 300–500 ms` (`< 1.2 s` Electron) cold start, `~0%` idle CPU when minimized/unfocused, and **RAM measured after 30 minutes of active usage** within budget;
71
+ - [ ] **full workspace session restoration** (open windows, tabs, splits, active documents), `100%` ↔ `200%` mixed-DPI scaling, and unplugged-monitor on-screen clamping verified;
72
+ - [ ] OS-standard storage paths (XDG / `Application Support` / `%APPDATA%`), atomic `temp → fsync → rename` writes, SQLite `WAL` migrations, dirty-close protection, **clean uninstaller** (zero leftover files/daemons/registry), and **opt-in redacted support log export** wired;
73
+ - [ ] every primary workflow completes by keyboard (`Tab`, `F6` pane focus, `Cmd`/`Ctrl` menu shortcuts, `Escape`), and **Windows `forced-colors` / High Contrast + macOS `Increase Contrast`** render cleanly;
74
+ - [ ] 2026 signing/notarization + **clean-VM Gatekeeper/SmartScreen install screenshot**, **live `v(N-1) -> vN` auto-update + rollback**, and `NVDA`/`JAWS`/`Narrator`/`VoiceOver`/`Orca` checked or honestly labeled `not-checked`;
75
+ - [ ] **Checklist-Until-Passing Stop-Gate (`<HARD-GATE>`):** walk every checklist item above + run `slop-scan.mjs --fail-on p2`, `check-contrast.mjs`, desktop UI/build 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`).
76
+
77
+ ## Framework routing
78
+
79
+ - Read [references/working-context.md](references/working-context.md) when designing editors, debuggers, inspectors, linked source/canvas panes, `F6` focus traversal, workspace persistence, or multi-monitor bounds clamping.
80
+ - Read [references/tauri.md](references/tauri.md) when building Tauri v2 desktop apps, Rust IPC/`Channel`/`Response`, capability ACLs, v2 plugins, or macOS Overlay chrome.
81
+ - Read [references/electron.md](references/electron.md) when building Electron (`WebContentsView`, `safeStorage`, `@electron/fuses`, `titleBarOverlay`, Mica) or evaluating **Electrobun** (Bun + Zig + OS WebView).
82
+ - Read [references/qt-pyside-qml.md](references/qt-pyside-qml.md) when building Qt 6 Widgets, PySide6, PyQt6 / Qt Designer (`.ui`), Qt Quick/QML (`FluentWinUI3`/`macOS`, `qmltc`), Kirigami, or maintaining brownfield CustomTkinter/Dear PyGui apps.
83
+ - Read [references/winui-wpf.md](references/winui-wpf.md) when building WinUI 3 (Windows App SDK, `x:Bind`, `MicaBackdrop`) or .NET 9/10 WPF (`ThemeMode="System"` Fluent Theme) Windows apps.
84
+ - Read [references/appkit.md](references/appkit.md) when building **AppKit** (`NSDocument`, `NSStatusItem`, `NSGlassEffectView`) or **SwiftUI for macOS** (`WindowGroup`, `DocumentGroup`, `MenuBarExtra`, `Settings`, macOS 26 Tahoe Liquid Glass).
85
+ - Read [references/gtk.md](references/gtk.md) when building GTK4 / libadwaita 1.4–1.8 Linux UI, Blueprint (`.blp`), XDG Desktop Portals/Flatpak, and Wayland windows.
86
+ - Read [references/avalonia.md](references/avalonia.md) when building Avalonia 11+ apps with `ControlTheme`, `ThemeVariant`, `x:CompileBindings`, `TopLevel` services, and `Avalonia.Headless`.
87
+ - Read [references/rust-gui.md](references/rust-gui.md) when building Rust desktop UIs across **GPUI**, **Dioxus** (Subsecond/Blitz), **Iced**, **`libcosmic`**, **Vizia**, **Slint**, **egui**, **Floem**, **Makepad**, **Xilem**, **Freya**, **Relm4**, and **AccessKit**.
88
+ - Read [references/javafx-swing.md](references/javafx-swing.md) when building JavaFX 22+ (`Platform.Preferences`, AtlantaFX, `jpackage`) or Swing (**FlatLaf**) desktop apps.
89
+ - Read [references/cpp-gui.md](references/cpp-gui.md) when building C++/C/Zig desktop UIs across Qt C++, **JUCE** (VST3/AU/CLAP audio plugins), **GTKmm**, wxWidgets, **FLTK 1.4**, Dear ImGui, **Nuklear**, **Ultralight**, **DVUI**, **Clay**, and **raygui**.
90
+ - Read [references/go-gui.md](references/go-gui.md) when building Go desktop apps with **Wails v3**/v2, **Fyne**, or **Gio**.
91
+ - Read [references/uno-platform.md](references/uno-platform.md) when building Uno Platform 5/6 (`Uno.Sdk` Single Project, Skia Desktop, MVUX, Uno Toolkit) desktop apps.
92
+
93
+ For **Compose Multiplatform Desktop**, **Flutter Desktop**, **Flet**, or **Kivy** desktop targets, use the canonical framework reference in `pixelcraft-mobile` together with the desktop window/menu/high-DPI/multi-monitor rules in this skill; do not duplicate those framework files here.
@@ -0,0 +1,92 @@
1
+ # AppKit & SwiftUI for macOS
2
+
3
+ macOS desktop craft depends on menu-bar architecture, multi-window/document lifecycle, keyboard acceleration, and platform chrome—whether authored in **AppKit**, **SwiftUI for macOS**, or a hybrid (`NSHostingView` / `NSViewRepresentable`).
4
+
5
+ ## Token mapping
6
+
7
+ Store light, dark, and increased-contrast colors in Asset Catalogs and access them via Xcode-generated `ColorResource` symbols (`NSColor(resource: .semanticAction)` / `Color(.semanticAction)`). Respect system vibrancy (`NSVisualEffectView` / `.background(.ultraThinMaterial)`), system accent colors (`NSColor.controlAccentColor`), and **macOS 26 Tahoe Liquid Glass** (`NSGlassEffectView` in AppKit; `.glassEffect(_:in:)` + `GlassEffectContainer` in SwiftUI) for floating toolbars, sidebars, and controls—never apply translucent glass to primary reading/editing canvases.
8
+
9
+ ## SwiftUI for macOS scene & command idioms
10
+
11
+ Use native macOS scene primitives instead of hand-rolling single-window shells:
12
+
13
+ - **`WindowGroup`** (multi-window data views) and **`DocumentGroup`** (file-based apps with open/save/recent-documents/titlebar proxy icon).
14
+ - **`Settings`** scene (`Cmd+,` automatically wired into the app menu).
15
+ - **`MenuBarExtra`** (`.menu` style for quick status menus; `.window` style for compact interactive popovers).
16
+ - **`.commands` + `CommandMenu` + `@FocusedValue` / `@FocusedBinding`** so menu-bar commands route cleanly to whichever document window currently owns focus:
17
+
18
+ ```swift
19
+ @main
20
+ struct InvoiceStudioApp: App {
21
+ var body: some Scene {
22
+ DocumentGroup(newDocument: InvoiceDocument()) { file in
23
+ InvoiceEditorView(document: file.$document)
24
+ }
25
+ .commands {
26
+ CommandGroup(after: .newItem) {
27
+ ExportCommands()
28
+ }
29
+ }
30
+ Settings { SettingsView() }
31
+ MenuBarExtra("Sync Status", systemImage: "arrow.triangle.2.circlepath") {
32
+ SyncPopoverView()
33
+ }
34
+ .menuBarExtraStyle(.window)
35
+ }
36
+ }
37
+ ```
38
+
39
+ On macOS 26 Tahoe, combine `.glassEffect(.regular, in: .capsule)` / `NSGlassEffectView` with explicit Reduce Transparency and Increase Contrast fallbacks so floating controls stay legible over dense documents.
40
+
41
+ ## AppKit idioms (`NSDocument`, `NSStatusItem`, `NSWorkspace`)
42
+
43
+ - Use **`NSDocument` / `NSDocumentController`** for automatic autosave-in-place, Versions browser, dirty close dot (`isDocumentEdited`), and safe Quit/Logout prompting.
44
+ - Use **`NSStatusItem`** (`NSStatusBar.system.statusItem(withLength:)`) with vector SF Symbols (`isTemplate = true`) for menu-bar utility agents; always provide a discoverable Quit item and keyboard shortcut.
45
+ - Read macOS accessibility display preferences directly from **`NSWorkspace.shared`** (and observe `NSWorkspace.accessibilityDisplayOptionsDidChangeNotification`) to adapt motion, glass/vibrancy, and contrast:
46
+
47
+ ```swift
48
+ let ws = NSWorkspace.shared
49
+ let reduceMotion = ws.accessibilityDisplayShouldReduceMotion
50
+ let reduceTransparency = ws.accessibilityDisplayShouldReduceTransparency
51
+ let increaseContrast = ws.accessibilityDisplayShouldIncreaseContrast
52
+ ```
53
+
54
+ In SwiftUI for macOS, read `@Environment(\.accessibilityReduceMotion)`, `@Environment(\.accessibilityReduceTransparency)`, and `@Environment(\.colorSchemeContrast)`.
55
+
56
+ ## Layout, typography, & accessibility specifics
57
+
58
+ - Use `NSSplitViewController` / `NavigationSplitView`, unified `NSToolbar` / `.toolbar`, minimum window sizes (`window.minSize` / `.frame(minWidth:minHeight:)`), `NSWindow.frameAutosaveName`, and Spaces/Fullscreen support. Never transplant an iOS bottom tab bar into a macOS window.
59
+ - Use macOS semantic text styles (`.body`, `.headline`, `.callout`) and verify Retina vector/SF Symbol sharpness.
60
+ - Implement `NSAccessibility` roles, labels, and custom actions on custom AppKit views; never suppress the system keyboard focus ring (`focusRingType = .none`) without a high-contrast replacement. Verify **Full Keyboard Access** (`System Settings → Keyboard → Keyboard navigation`) and **VoiceOver** across toolbars, sidebars, sheets, and modals.
61
+
62
+ ## Storage, notarization, & `Ed25519` auto-updates
63
+
64
+ - **OS-standard paths & atomic writes**: store app support files in `FileManager.default.urls(for: .applicationSupportDirectory, in: .userDomainMask)` (`~/Library/Application Support/<BundleId>`), caches in `~/Library/Caches`, and logs in `~/Library/Logs`—never inside `.app` bundles. Persist project/config files atomically (`try data.write(to: url, options: .atomic)` or temp file + `fsync` + `replaceItemAt`) and configure local SQLite in `WAL` mode with versioned migrations ([working-context.md](working-context.md)).
65
+ - **Two-way Finder drag-and-drop & inactive window dimming**: support dragging files in from and out to Finder/Desktop (`NSDraggingDestination` / `NSDraggingSource`, SwiftUI `.draggable` / `.dropDestination`), dim sidebar/toolbar prominence when `appearsActive == false` (`@Environment(\.controlActiveState)`), and maintain `< 300 ms` cold start + `~0%` idle CPU when occluded (`NSWindow.occlusionState`).
66
+ - **Sandbox, Universal binaries & notarization**: under **App Sandbox**, request minimal entitlements (`com.apple.security.files.user-selected.read-write`) and persist user-granted folder access with **security-scoped bookmarks**. For direct distribution outside the Mac App Store, build Universal (`arm64 + x86_64`) or explicit-arch bundles, enable **Hardened Runtime**, sign with **Developer ID Application**, notarize (`xcrun notarytool submit --wait`), staple (`xcrun stapler staple`), and ship **Sparkle 2** (`Ed25519` / `EdDSA`-signed) background delta updates that roll back cleanly on launch failure.
67
+
68
+ ## Do/don't pairs
69
+
70
+ | Do | Don't |
71
+ |---|---|
72
+ | `DocumentGroup` / `NSDocument` with dirty dot, atomic `.atomic` saves, and Save prompt on close | Overwrite files non-atomically in place or discard edits on close |
73
+ | Wire active-window menu items via `.commands` + `@FocusedValue` or Responder Chain | Hard-code menu actions to a singleton window reference |
74
+ | Check `accessibilityDisplayShouldReduceTransparency` & `IncreaseContrast` around `NSGlassEffectView`/`.glassEffect` | Ship unreadable translucent glass toolbars over high-contrast documents |
75
+ | Sign Developer ID + Hardened Runtime + `notarytool` + `stapler` + Sparkle 2 `Ed25519` updates | Ship unnotarized `.dmg`s blocked by Gatekeeper or unsigned auto-updaters |
76
+ | Persist folder access via security-scoped bookmarks and store app data in `~/Library/Application Support` | Assume raw POSIX paths survive relaunch under App Sandbox |
77
+
78
+ ## Known traps
79
+
80
+ Menu items staying enabled when no document window is key (missing `NSMenuItemValidation` / `@FocusedValue`), AppKit/SwiftUI `NSHostingView` sizing loops inside `NSTableView` cells, custom `NSWindow` titlebar removing drag/double-click zoom, keyboard shortcuts colliding with macOS system/IME bindings, unnotarized binaries failing Gatekeeper, unguarded `NSGlassEffectView` failing Reduce Transparency.
81
+
82
+ ## Verification commands
83
+
84
+ ```sh
85
+ xcodebuild -scheme App -destination 'platform=macOS' build
86
+ xcodebuild test -scheme App -destination 'platform=macOS'
87
+ # For Developer ID release validation:
88
+ codesign --verify --deep --strict build/App.app
89
+ spctl --assess --type execute --verbose build/App.app
90
+ ```
91
+
92
+ `xcodebuild` and unit tests are `static` evidence. Run on real macOS across VoiceOver, Accessibility Inspector, Full Keyboard Access, Dark Mode, Increase Contrast, Reduce Transparency, Reduce Motion, multi-monitor/Retina resize, and document dirty-close flows for `rendered` evidence; label unavailable hardware/macOS versions `not-checked`.
@@ -0,0 +1,95 @@
1
+ # Avalonia (11+)
2
+
3
+ ## Token mapping: `ThemeVariant` & `ControlTheme`
4
+
5
+ Map DTCG semantic tokens into `ResourceDictionary.ThemeDictionaries` keyed by **`ThemeVariant`** (`Default`, `Light`, `Dark`, and custom high-contrast variants) and reference them via `{DynamicResource ...}` so live theme switching updates without restarting windows.
6
+
7
+ In Avalonia 11+, style templated controls with **`ControlTheme`** (explicitly scoped, predictable overrides) rather than cascading global `<Style Selector="...">` hacks, and enforce **`x:CompileBindings="True"`** + `x:DataType` across views so binding typos fail at compile time:
8
+
9
+ ```xml
10
+ <ResourceDictionary xmlns="https://github.com/avaloniaui"
11
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
12
+ <ResourceDictionary.ThemeDictionaries>
13
+ <ResourceDictionary x:Key="Light">
14
+ <SolidColorBrush x:Key="PcActionBrush" Color="#0074CA" />
15
+ </ResourceDictionary>
16
+ <ResourceDictionary x:Key="Dark">
17
+ <SolidColorBrush x:Key="PcActionBrush" Color="#5BB2FF" />
18
+ </ResourceDictionary>
19
+ </ResourceDictionary.ThemeDictionaries>
20
+
21
+ <ControlTheme x:Key="PrimaryButtonTheme" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
22
+ <Setter Property="Background" Value="{DynamicResource PcActionBrush}" />
23
+ <Setter Property="MinHeight" Value="36" />
24
+ </ControlTheme>
25
+ </ResourceDictionary>
26
+ ```
27
+
28
+ ## Layout, `TopLevel` services, & custom window chrome
29
+
30
+ - Use `Grid`, `DockPanel`, `StackPanel`, `SplitView`, `ItemsRepeater` / `ListBox` virtualization, minimum window dimensions (`MinWidth`, `MinHeight`), and cross-platform DPI awareness.
31
+ - **Platform services via `TopLevel`**: never instantiate deprecated `OpenFileDialog` / `SaveFileDialog`. Resolve **`TopLevel.GetTopLevel(this)`** to access **`StorageProvider`** (native file/folder pickers + bookmarks), **`Clipboard`**, **`Launcher`**, and **`InsetsManager`**:
32
+
33
+ ```csharp
34
+ var topLevel = TopLevel.GetTopLevel(this);
35
+ if (topLevel?.StorageProvider is { CanOpen: true } storage)
36
+ {
37
+ var files = await storage.OpenFilePickerAsync(new FilePickerOpenOptions
38
+ {
39
+ Title = "Import invoices",
40
+ AllowMultiple = false,
41
+ });
42
+ }
43
+ ```
44
+
45
+ - **Custom titlebars**: when extending content into chrome with **`ExtendClientAreaToDecorationsHint="True"`**, configure `ExtendClientAreaChromeHints` intentionally and bind header padding to **`WindowDecorationMargin`** / `OffScreenMargin` so macOS traffic lights and Windows caption buttons never overlap interactive controls, and preserve drag + double-click maximize behavior.
46
+
47
+ ## Typography, motion, accessibility, states, & forms
48
+
49
+ Register bundled fonts via `FontManagerOptions` / `avares://` font URIs with explicit fallbacks and verify glyph coverage and DPI rasterization on Windows, macOS, and Linux separately.
50
+
51
+ Keep Avalonia `Transitions` and keyframe animations concise and interruptible; expose an explicit reduced-motion setting where host OS preference propagation is uncertain.
52
+
53
+ Set `AutomationProperties.Name`, `AutomationProperties.LabeledBy`, `AutomationProperties.HelpText`, keyboard `HotKey` / `KeyBindings`, and visible `:focus-visible` styles on real interactive controls. Verify Windows UIA (Narrator), macOS VoiceOver, and Linux AT-SPI separately—shared Skia rendering does not guarantee identical screen-reader behavior across OSes.
54
+
55
+ Drive state via `CommunityToolkit.Mvvm` or `ReactiveUI` with explicit async cancellation and dirty-close interception (`Window.Closing`). In forms, use `DataValidationErrors` + inline recovery text, preserve input across validation errors, and test IME/paste on all target OSes.
56
+
57
+ ## Headless UI verification (`Avalonia.Headless`)
58
+
59
+ Use **`Avalonia.Headless`** (`Avalonia.Headless.XUnit` or `Avalonia.Headless.NUnit`) to run fast deterministic UI tests driving real layout passes, `KeyPressQwerty`, `MouseDown`, focus traversal, and `CaptureRenderedFrame()` without needing an OS display server:
60
+
61
+ ```csharp
62
+ [AvaloniaFact]
63
+ public void Escape_Returns_Focus_From_Inspector()
64
+ {
65
+ var window = new MainWindow { DataContext = new MainViewModel() };
66
+ window.Show();
67
+ window.KeyPressQwerty(PhysicalKey.F6, RawInputModifiers.None);
68
+ window.KeyPressQwerty(PhysicalKey.Escape, RawInputModifiers.None);
69
+ Assert.True(window.CanvasControl.IsFocused);
70
+ }
71
+ ```
72
+
73
+ ## Do/don't pairs
74
+
75
+ | Do | Don't |
76
+ |---|---|
77
+ | Enable `x:CompileBindings="True"` + `x:DataType` and `ControlTheme` + `ThemeVariant` | Rely on untyped runtime bindings and fragile global style selectors |
78
+ | Use `TopLevel.GetTopLevel(this)?.StorageProvider` & `Clipboard` | Call deprecated `OpenFileDialog` or OS-specific Win32/NSOpenPanel hacks |
79
+ | Bind `ExtendClientAreaToDecorationsHint` chrome to `WindowDecorationMargin` | Overlap macOS traffic lights or break Windows maximize/drag regions |
80
+ | Write `Avalonia.Headless` keyboard/focus/layout tests alongside OS runs | Rely solely on `dotnet build` or visual glances on one OS |
81
+ | Guard `Window.Closing` for unsaved documents and cancel async commands | Use `async void` handlers or discard edits silently on close |
82
+
83
+ ## Known traps
84
+
85
+ Silent runtime binding failures when `x:CompileBindings` is omitted, `{StaticResource}` failing to update when `RequestedThemeVariant` switches at runtime, `TopLevel.GetTopLevel(this)` returning `null` before `OnAttachedToVisualTree`, broken window drag/caption buttons under `ExtendClientAreaToDecorationsHint`, OS-divergent screen-reader maturity across Windows/macOS/Linux, missing font fallbacks on minimal Linux distros.
86
+
87
+ ## Verification commands
88
+
89
+ ```sh
90
+ dotnet build
91
+ dotnet test # includes Avalonia.Headless UI tests when configured
92
+ dotnet run --project <AppProject>
93
+ ```
94
+
95
+ `dotnet build` is `static` evidence; `Avalonia.Headless` tests verify layout/focus/input deterministically (`static`/headless). Run native desktop binaries on each shipped OS (Windows/macOS/Linux) for screen-reader, HiDPI, dark/high-contrast, custom-chrome, and multi-monitor restore checks (`rendered`; label untested OSes `not-checked`).