@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,130 @@
1
+ # SVG banners, programmatic video, and vector motion export
2
+
3
+ Vector banners, video loops, and motion graphics are consumed through crops, scaling, platform recompression, and host UI overlays outside the author's control. Build deterministically from real content and inspect the exported artifact.
4
+
5
+ ## SVG banners and posters
6
+
7
+ SVG is ideal for deterministic banners because it is scalable, inspectable, and diffable—but it is not automatically accessible or portable.
8
+
9
+ Rules:
10
+
11
+ - set an explicit `viewBox` plus width/height and export mapping;
12
+ - include `<title>` and `<desc>` when SVG is inline in HTML; raster exports need platform alt text instead;
13
+ - do not assume viewer fonts—embed/convert text deliberately or export with bundled licensed fonts;
14
+ - verify text wrapping manually because ordinary SVG `<text>` does not reflow like HTML;
15
+ - strip scripts, foreignObject, and untrusted external URLs from crawler-facing or user-supplied SVG;
16
+ - test light and dark embedding contexts (`prefers-color-scheme` or solid backing) so transparent art never disappears or halos.
17
+
18
+ For repository banners/docs, export PNG/WebP fallbacks where inline SVG is blocked, preserving the source SVG and exact export command.
19
+
20
+ ## Aspect-ratio variants
21
+
22
+ Design a system rather than center-cropping one master:
23
+
24
+ | Ratio | Typical frame | Role & mandatory safe inset |
25
+ |---|---:|---|
26
+ | 16:9 | 1920×1080 or 1280×720 | presentation, YouTube, landscape video, docs (`5–10%` edge inset; YouTube bottom-right duration badge clear) |
27
+ | 1:1 | 1080×1080 | square feed/embed (`>= 80 px` edge inset) |
28
+ | 9:16 | 1080×1920 | Reels / TikTok / Shorts: keep titles, faces, and burned-in captions clear of **`top >= 150–220 px`**, **`bottom >= 320–420 px`**, and **`right >= 120–160 px`** (`>= 60 px` left) |
29
+ | 1.91:1 / 2:1 | 1200×630 / 1280×640 | universal OG (`1000×500` center safe zone) / GitHub social preview |
30
+
31
+ Recompose hierarchy per ratio: never center-crop a `16:9` master into `9:16`—vertical feeds require stacking subject + open captions inside the `top 220 px .. bottom 1500 px`, `left 60 px .. right 920 px` clear corridor so TikTok/Reels/Shorts chrome never occludes copy.
32
+
33
+ ## Remotion (v4+)
34
+
35
+ Remotion renders deterministic video from React components using frame-driven state (`useCurrentFrame()`, `useVideoConfig()`, `spring()`, `interpolate()`).
36
+
37
+ ```tsx
38
+ import { Composition, OffthreadVideo, staticFile } from 'remotion';
39
+ import { TransitionSeries, linearTiming } from '@remotion/transitions';
40
+ import { fade } from '@remotion/transitions/fade';
41
+ import { loadFont } from '@remotion/google-fonts/Inter';
42
+
43
+ const { fontFamily } = loadFont('normal', { weights: ['600', '700'], subsets: ['latin'] });
44
+
45
+ export const Root = () => (
46
+ <Composition
47
+ id="ReleaseHighlight"
48
+ component={ReleaseHighlight}
49
+ durationInFrames={180}
50
+ fps={30}
51
+ width={1920}
52
+ height={1080}
53
+ defaultProps={{ title: 'Pixelcraft v2', clip: staticFile('demo.mp4') }}
54
+ />
55
+ );
56
+ ```
57
+
58
+ Remotion v4+ production rules:
59
+
60
+ - **`<OffthreadVideo>` vs `<Video>`**: prefer `<OffthreadVideo>` during headless/server renders—it decodes exact frames via native FFmpeg outside Chromium's `<video>` element, preventing dropped frames, seek drift, and browser codec mismatches; use `<Video>` primarily inside interactive browser `<Player>` previews.
61
+ - **Interactive preview (`@remotion/player`)**: embed `<Player>` in web apps for real-time parameter previewing and scrubbing without invoking server rendering on every edit.
62
+ - **Cloud rendering**: scale batch/user-generated exports with **Remotion Lambda** (AWS Lambda distributed chunk rendering) or **Remotion Cloud Run** rather than blocking web request threads.
63
+ - **Official v4 packages**: use `@remotion/transitions` (`<TransitionSeries>`), `@remotion/captions` (SRT/WebVTT parsing + timed captions), and `@remotion/google-fonts` (deterministic font loading before frame 0).
64
+ - Derive every pixel strictly from `frame` and props; never use `Date.now()`, `Math.random()` without `random(seed)`, or unawaited CSS transitions (`transition: all`) which desync during frame-by-frame capture.
65
+
66
+ ## Motion Canvas and Revideo
67
+
68
+ **Motion Canvas** uses generator-based TypeScript scenes with a visual timeline editor; **Revideo** is the maintained headless-first fork of Motion Canvas built for CLI/server-side programmatic rendering, parameterized scenes, audio tracks, and cloud video pipelines.
69
+
70
+ ```tsx
71
+ import { makeScene2D, Txt } from '@motion-canvas/2d';
72
+ import { createRef, waitFor } from '@motion-canvas/core';
73
+
74
+ export default makeScene2D(function* (view) {
75
+ const title = createRef<Txt>();
76
+ const subtitle = createRef<Txt>();
77
+ // Frame 0 (0.0s) MUST render a legible title/poster immediately when autoplay is disabled
78
+ view.add(
79
+ <>
80
+ <Txt ref={title} fill="#f8fafc" fontSize={84} y={-26} opacity={1}>Pixelcraft v2</Txt>
81
+ <Txt ref={subtitle} fill="#94a3b8" fontSize={36} y={42} opacity={0}>Studio-Grade Motion</Txt>
82
+ </>,
83
+ );
84
+ yield* waitFor(0.2);
85
+ yield* subtitle().opacity(1, 0.45);
86
+ yield* waitFor(1.2);
87
+ });
88
+ ```
89
+
90
+ - Pick **Motion Canvas** for author-driven visual editing and technical explainer animations; pick **Revideo** (`@revideo/2d`, `@revideo/core`, `@revideo/renderer`) when you need headless CI/server video generation from the same generator paradigm;
91
+ - **Never start frame `0` (`0.0s`) empty or at `opacity={0}`**: paused embeds, reduced-motion fallbacks, and social feed scrubbers display `0.0s` whenever no external poster overrides it—render a legible title/poster state at `0.0s` before secondary transitions;
92
+ - use signals/layout references rather than visual guesses, pin project resolution/fps, and verify fonts in both editor and headless render.
93
+
94
+ ## FFmpeg export pipeline
95
+
96
+ Standardize web and social video exports with explicit pixel format, container atom ordering, codec budget, loudness normalization, and caption tracks:
97
+
98
+ ```sh
99
+ # 1. Universal H.264 MP4 (Safari/QuickTime/iOS safe + fast web start + -14 LUFS social/web loudness)
100
+ ffmpeg -i input.mov -i captions.vtt \
101
+ -c:v libx264 -crf 20 -preset slow -pix_fmt yuv420p \
102
+ -c:a aac -b:a 160k -af "loudnorm=I=-14:TP=-1.5:LRA=11" \
103
+ -c:s mov_text -metadata:s:s:0 language=eng \
104
+ -movflags +faststart output.mp4
105
+
106
+ # 2. Compact web loop replacing heavy animated GIFs (VP9 WebM + H.264 MP4 fallback)
107
+ ffmpeg -i source.mov -an -c:v libvpx-vp9 -crf 32 -b:v 0 -pix_fmt yuv420p loop.webm
108
+ ffmpeg -i source.mov -an -c:v libx264 -crf 22 -pix_fmt yuv420p -movflags +faststart loop.mp4
109
+ ```
110
+
111
+ Critical FFmpeg rules:
112
+
113
+ - **`-pix_fmt yuv420p` is mandatory for H.264 compatibility**: default `yuv444p` / 10-bit output renders black or fails to open in Safari, QuickTime, and iOS;
114
+ - **`-movflags +faststart`**: relocates the MP4 `moov` atom to the start of the file so browsers begin playback immediately instead of downloading the entire file first;
115
+ - **Codec ladder**: use H.264 (`libx264`, `-crf 18–23`) as the universal baseline; add VP9 (`libvpx-vp9`) or AV1 (`libsvtav1`) `<source>` variants for bandwidth-heavy loops where target decoders support them;
116
+ - **Audio loudness (`loudnorm`)**: normalize social and web video feeds (YouTube, Reels, TikTok, Shorts, X, LinkedIn) to `loudnorm=I=-14:TP=-1.5:LRA=11` (`-14 LUFS` integrated loudness, `-1.5 dBTP` true-peak ceiling); use `-16 LUFS` only for Apple Podcasts and spoken-word mobile audio;
117
+ - **Captions**: mux WebVTT/SRT soft tracks (`-c:s mov_text` for MP4) AND keep burned-in open captions inside vertical/feed safe zones for muted social autoplay;
118
+ - **MP4/WebM loops over heavy GIFs**: replace multi-megabyte GIFs with muted looping `<video autoplay loop muted playsinline poster="first-frame.webp">` (typically 5–10× smaller with full 24-bit color and 60 fps); use GIF only on surfaces that disallow video embeds.
119
+
120
+ ## Lottie (`dotLottie`) and Rive vector export pipelines
121
+
122
+ - **Lottie (`dotLottie`, `.lottie`)**: package JSON animations + bitmap assets/themes into a compressed `.lottie` archive rather than shipping bloated raw `.json`. Strip unsupported After Effects expressions, merge/track-matte glitches, and verify playback in the exact target player (`@lottiefiles/dotlottie-web`, iOS/Android native).
123
+ - **Rive (`.riv`)**: export compact binary `.riv` files with explicit artboard bounds, state-machine inputs, embedded fonts (or vector outlines), and a static reduced-motion state/poster image. Never hide critical UI copy exclusively inside opaque vector animation files without accessible text equivalents.
124
+
125
+ ## Captions, sound, and export verification
126
+
127
+ - Never rely on sound for essential meaning; avoid flashing/strobing luminance changes (>3 flashes/sec);
128
+ - keep burned-in captions inside platform safe zones and supply sidecar WebVTT/SRT where supported;
129
+ - inspect exported `ffprobe` metadata (dimensions, `pix_fmt`, fps, duration, codecs, bitrate, audio sample rate, byte size) (`static`) and inspect first/middle/last frames plus key transitions on light/dark backgrounds and mobile feed scale (`rendered`);
130
+ - reject endless floating gradients, fake tilted UI fly-throughs, sparkles replacing substance, and unreadable kinetic typography.
@@ -0,0 +1,154 @@
1
+ # OG and programmatic image generation pipelines
2
+
3
+ Choose the generator for layout complexity, script shaping (Latin vs Arabic/Indic/CJK), output format (PNG/WebP/AVIF), latency budget, and runtime environment (Node.js, Rust, Edge, or headless browser).
4
+
5
+ ## Pipeline boundaries
6
+
7
+ | Tool | Output / model | Best for | Critical boundaries |
8
+ |---|---|---|---|
9
+ | **Takumi** (`@takumi-rs/image-response` / Rust) | Rust high-speed JSX/Tailwind → PNG/WebP/AVIF | fast dynamic OG cards needing **CSS Grid**, Flexbox, WOFF2 fonts, and WebP/AVIF output | native Rust binding (Node.js/server runtime or WASM build); verify CSS support per pinned version |
10
+ | **Next.js `ImageResponse` (`next/og`)** | JSX/CSS → PNG via Satori + Resvg | Next.js App Router `opengraph-image.tsx` routes | Next.js 15/16 defaults to **Node.js runtime** (`runtime = 'nodejs'`), lifting the 500 KB Edge limit and enabling `fs.readFile`; Edge Runtime (`runtime = 'edge'`) keeps the 500 KB bundle cap; Flexbox-only + TTF/OTF/WOFF fonts |
11
+ | **`@vercel/og`** | JSX/CSS → PNG via Satori + Resvg | Vercel Edge / serverless functions | 500 KB Edge bundle cap including JSX/fonts/assets; Flexbox-only subset; TTF/OTF/WOFF only (no WOFF2) |
12
+ | **Satori + `@resvg/resvg-js`** | JSX → SVG string → PNG buffer | framework-agnostic Node/CI/Astro/Remix OG generation | explicit font buffers required; no system fallback; handle emoji/CJK via `loadAdditionalAsset` |
13
+ | **Sharp** (`sharp`) | libvips raster compositing, resize, WebP/AVIF/PNG | compositing SVG/PNG badges, multi-crop social variants, strict byte budgets (WhatsApp <300 KB, GitHub <1 MB) | not an HTML/CSS layout engine; pair with SVG/Satori/Takumi |
14
+ | **`@napi-rs/canvas` / `skia-canvas`** | Rust/Skia 2D Canvas API in Node.js | custom generative art, pixel-exact charts, dense data badges without HTML layout | manual text wrapping and coordinate layout |
15
+ | **Playwright HTML-to-screenshot** | full Chromium render → PNG/JPEG/WebP | complex **Arabic/Indic/CJK bidirectional shaping**, full CSS Grid/subgrid, SVG filters, rich web components | high memory/cold-start latency; pre-render at build time or cache aggressively behind CDN |
16
+
17
+ ## Next.js 15/16 `ImageResponse` (Node.js runtime)
18
+
19
+ In Next.js 15/16, `opengraph-image.tsx` and Route Handlers default to the **Node.js runtime** (`export const runtime = 'nodejs'`), which lifts the legacy 500 KB Edge bundle cap and allows reading local font assets directly via `node:fs/promises`:
20
+
21
+ ```tsx
22
+ import { ImageResponse } from 'next/og';
23
+ import { readFile } from 'node:fs/promises';
24
+ import { join } from 'node:path';
25
+
26
+ export const runtime = 'nodejs'; // default in Next.js 15/16; lifts 500 KB Edge cap
27
+ export const size = { width: 1200, height: 630 };
28
+ export const contentType = 'image/png';
29
+
30
+ export default async function Image() {
31
+ const interBold = await readFile(join(process.cwd(), 'assets/fonts/Inter-Bold.ttf'));
32
+
33
+ return new ImageResponse(
34
+ (
35
+ <div
36
+ style={{
37
+ width: '100%',
38
+ height: '100%',
39
+ display: 'flex',
40
+ flexDirection: 'column',
41
+ justifyContent: 'space-between',
42
+ padding: 72,
43
+ background: '#0f172a',
44
+ color: '#f8fafc',
45
+ fontFamily: 'Inter',
46
+ }}
47
+ >
48
+ <div style={{ fontSize: 64, fontWeight: 700, lineHeight: 1.1 }}>Pixelcraft</div>
49
+ <div style={{ fontSize: 28, color: '#cbd5e1' }}>Portable UI craft across every surface</div>
50
+ </div>
51
+ ),
52
+ {
53
+ ...size,
54
+ fonts: [{ name: 'Inter', data: interBold, weight: 700, style: 'normal' }],
55
+ },
56
+ );
57
+ }
58
+ ```
59
+
60
+ If you explicitly opt into `export const runtime = 'edge'`, enforce the 500 KB total bundle cap and load fonts via `fetch(new URL('./Inter-Bold.ttf', import.meta.url))`.
61
+
62
+ ## Satori + `@resvg/resvg-js` (`loadAdditionalAsset` & `tw` caveats)
63
+
64
+ Use Satori directly with `@resvg/resvg-js` when you want deterministic Node/CI generation outside Vercel/Next:
65
+
66
+ ```ts
67
+ import satori from 'satori';
68
+ import { Resvg } from '@resvg/resvg-js';
69
+ import { readFile } from 'node:fs/promises';
70
+
71
+ const interBold = await readFile('./assets/Inter-Bold.ttf');
72
+
73
+ const svg = await satori(element, {
74
+ width: 1200,
75
+ height: 630,
76
+ fonts: [{ name: 'Inter', data: interBold, weight: 700, style: 'normal' }],
77
+ // On-demand emoji (Twemoji SVG data URI) or CJK subset fonts without bloating the base bundle
78
+ loadAdditionalAsset: async (code, segment) => {
79
+ if (code === 'emoji') {
80
+ return await loadLocalTwemojiDataUri(segment);
81
+ }
82
+ return '';
83
+ },
84
+ });
85
+
86
+ // Satori already converts glyphs to vector paths; disable system font scanning for speed & determinism
87
+ const resvg = new Resvg(svg, {
88
+ fitTo: { mode: 'width', value: 1200 },
89
+ font: { loadSystemFonts: false },
90
+ });
91
+ const pngBuffer = resvg.render().asPng();
92
+ ```
93
+
94
+ Satori caveats:
95
+
96
+ - **`tw` prop**: Satori's built-in Tailwind `tw="..."` prop parses a constrained Tailwind v3-era subset (no CSS Grid, no Tailwind v4 `oklch()` / CSS variables, no responsive breakpoints or arbitrary pseudo-selectors). Prefer explicit `style` objects or inspect rendered PNG bytes whenever using `tw`.
97
+ - **`loadAdditionalAsset`**: use for Twemoji/OpenMoji SVG data URIs or on-demand CJK/Arabic subset fonts so missing glyphs never render as tofu boxes; pin local or allowlisted assets rather than making uncached per-request external fetches.
98
+ - **No implicit system fallback**: every weight (`400`, `700`) and style (`normal`, `italic`) used in JSX needs a matching buffer in `fonts`.
99
+
100
+ ## Takumi (Rust JSX/Tailwind → PNG/WebP/AVIF)
101
+
102
+ Use **Takumi** (`@takumi-rs/image-response` or native Rust crate) when you need Satori-style JSX authoring with **CSS Grid**, **WOFF2** font support, native **WebP/AVIF** compression, and multi-millisecond Rust throughput:
103
+
104
+ ```tsx
105
+ import { ImageResponse } from '@takumi-rs/image-response';
106
+
107
+ export async function renderCard(title: string) {
108
+ return new ImageResponse(
109
+ (
110
+ <div className="grid grid-cols-12 h-full w-full bg-[#0f172a] text-white p-16 gap-8">
111
+ <div className="col-span-8 flex flex-col justify-center">
112
+ <h1 className="text-6xl font-bold leading-tight">{title}</h1>
113
+ </div>
114
+ </div>
115
+ ),
116
+ // Use 'png' (or JPEG via Sharp) for universal og:image chat unfurlers (Zalo, iMessage, Slack, LinkedIn); reserve 'webp'/'avif' for in-app <img>/<picture>
117
+ { width: 1200, height: 630, format: 'png' },
118
+ );
119
+ }
120
+ ```
121
+
122
+ ## Sharp composite and unfurler-safe `< 300 KB` pipeline
123
+
124
+ Use **Sharp** to composite generated overlays inside the **center `1000×500` safe zone** of a `1200×630` card and emit universally decodable **JPEG (`mozjpeg`) or palette-quantized PNG** under `< 200–300 KB` so Zalo, WhatsApp, iMessage, Slack, X, and LinkedIn unfurlers never drop the preview:
125
+
126
+ ```ts
127
+ import sharp from 'sharp';
128
+
129
+ await sharp('base-1200x630.png')
130
+ .composite([{ input: svgOverlayBuffer, top: 65, left: 100 }]) // 1000x500 center safe zone
131
+ .jpeg({ quality: 84, mozjpeg: true }) // or .png({ palette: true, compressionLevel: 9 }) for flat UI cards
132
+ .toFile('og-card.jpg');
133
+ ```
134
+
135
+ ## `@napi-rs/canvas` / `skia-canvas` and Playwright HTML-to-screenshot
136
+
137
+ - **`@napi-rs/canvas` / `skia-canvas`**: choose for procedural visualizations, sparklines, and canvas-native graphics where explicit `ctx.measureText` + Skia rendering outperform HTML boxes. Register fonts via `GlobalFonts.registerFromPath(...)` / `FontLibrary.use(...)`.
138
+ - **Playwright HTML-to-screenshot**: choose when cards require **complex Arabic/RTL, Devanagari/Indic, Thai, or mixed CJK bidirectional shaping**, full CSS Grid/subgrid, `backdrop-filter`, or real rendered UI components:
139
+
140
+ ```ts
141
+ await page.setViewportSize({ width: 1200, height: 630 });
142
+ await page.setContent(safeHtml, { waitUntil: 'networkidle' });
143
+ await page.evaluate(() => document.fonts.ready);
144
+ await page.screenshot({ path: 'og-ar.png', type: 'png' });
145
+ ```
146
+
147
+ Never render untrusted user HTML directly in Playwright—escape text strictly, block internal network requests (SSRF protection), and cache by content hash.
148
+
149
+ ## Security, caching, and verification
150
+
151
+ - Treat user-supplied titles/handles as untrusted text; bound character length and sanitize/escape before templating;
152
+ - constrain remote image domains and timeouts (or inline buffers) so slow external hosts never stall crawlers;
153
+ - cache generated OG images immutably by content/version hash (`Cache-Control: public, max-age=31536000, immutable`);
154
+ - inspect generated byte size, exact dimensions, `Content-Type`, thumbnail legibility at 25–33% scale, and target script shaping (`rendered`); record which renderer produced the image.
@@ -0,0 +1,71 @@
1
+ # Social cards, frames, and platform safe zones
2
+
3
+ Platform behavior changes frequently and varies by client. Treat dimensions and constraints below as production baselines, then validate with current platform debuggers/previews before release.
4
+
5
+ ## Working size table
6
+
7
+ | Placement | Working frame | Ratio / constraint | Practical guidance |
8
+ |---|---:|---|---|
9
+ | Open Graph default (`og:image`) | 1200×630 | 1.91:1 | safest general baseline; PNG/JPEG/WebP depending on client support |
10
+ | YouTube thumbnail | 1280×720 | 16:9; JPG/PNG/WebP under 2 MB | keep critical text/faces out of the **bottom-right duration timestamp overlay zone** (~20% width × 15% height); validate legibility at mobile feed width (~160px) |
11
+ | X / Twitter large card | 1200×600 (or 1200×630) | 2:1 / 1.91:1; under 5 MB | set `twitter:card="summary_large_image"` + `twitter:image:alt`; verify crop at 2:1 |
12
+ | Facebook / Meta & LinkedIn | 1200×630 / 1200×627 | ~1.91:1 | use absolute HTTPS URL; minor vertical crop difference makes edge text unsafe |
13
+ | Bluesky | 1200×630 | 1.91:1; blob limit ~1 MB | AT Protocol card crawler fetches `og:image` and re-encodes to JPEG/WebP; requires public unauthenticated fetch |
14
+ | Mastodon / Fediverse | 1200×630 | 1.91:1 | federated instances crawl/cache independently and crop across web/Ivory/Elk clients; set `og:image:alt` and optional `fediverse:creator` |
15
+ | Discord | 1200×630 | 1.91:1 | include `twitter:card="summary_large_image"`—without it Discord often shrinks `og:image` to a small right-aligned square thumbnail; `<meta name="theme-color">` sets the embed accent stripe |
16
+ | Slack | 1200×630 | 1.91:1; `< 1 MB` fast crawl | unfurls `og:title`/`og:description`/`og:image` (PNG/JPEG safest); supports `twitter:label1`/`twitter:data1` metadata rows |
17
+ | **Zalo** (chat & Official Account) | 1200×630 | 1.91:1; **`< 300 KB–500 KB`**, PNG/JPEG | Zalo link crawler caches `og:image` aggressively, requires fast public HTTPS TTFB (`< 2 s`), and frequently drops `svg`/`webp` or oversized PNGs—keep copy in the **center `1000×500` safe zone** so 1:1 / mobile chat list crops survive |
18
+ | WhatsApp | 1200×630 (or 1:1) | **strict `< 300 KB`** (target `< 200 KB`) | exceeding ~300 KB or slow TTFB causes WhatsApp to drop the thumbnail silently; declare `og:image:width`, `og:image:height`, `og:image:type`, and serve optimized **JPEG or indexed PNG** |
19
+ | Telegram | 1200×630 | 1.91:1; `< 1 MB` | uses `og:image` + `twitter:card="summary_large_image"`; refresh stale caches with `@WebpageBot` |
20
+ | iMessage / Apple Rich Links | 1200×630 | 1.91:1; `< 1 MB` PNG/JPEG | Apple `LPLinkMetadata` requires `og:image` (`>= 300px` wide so it does not collapse to a small icon; SVG `og:image` is ignored) plus `apple-touch-icon` |
21
+ | GitHub repository social preview | 1280×640 rec.; 640×320 min | exactly 2:1; PNG/JPG/GIF under 1 MB | upload in Settings → General → Social preview; keep essential content inside the central `1000×500` safe zone |
22
+ | Video / presentation landscape | 1920×1080 | 16:9 | standard video/slide frame; inset edges 5–10% |
23
+ | Vertical short video (`Reels / TikTok / Shorts`) | 1080×1920 | 9:16 | strict UI exclusion margins: **`top >= 150–220 px`**, **`bottom >= 320–420 px`**, **`right >= 120–160 px`** |
24
+ | Square feed / thumbnail fallback | 1080×1080 or 1200×1200 | 1:1 | use only when the platform/card type favors square |
25
+
26
+ ## Safe-area & `9:16` exclusion-zone geometry
27
+
28
+ No single rectangle is universally safe. Lock layout guides to exact pixel coordinates:
29
+
30
+ 1. **`1200×630` (`1.91:1`) universal OG safe zone (`1000×500` center box)**: inset at least **`100 px` left/right and `65 px` top/bottom** (`1000×500` inner box) so X (`2:1` `1200×600`), LinkedIn (`1200×627`), iMessage rounded bubbles, Slack, and Zalo mobile previews never clip headlines or brand marks;
31
+ 2. **`1080×1920` (`9:16`) Reels / TikTok / YouTube Shorts exclusion zones**: host chrome covers three edges simultaneously—keep all headlines, speaker faces, and burned-in captions strictly clear of:
32
+ - **`top >= 150–220 px`** (status bar, notch, search/live header),
33
+ - **`bottom >= 320–420 px`** (account handle, expandable multi-line caption, audio marquee, shop/CTA pill, scrub bar),
34
+ - **`right >= 120–160 px`** (vertical avatar, like, comment, bookmark, and share icon rail), plus `>= 60 px` left margin;
35
+ 3. **YouTube `1280×720` thumbnails**: leave the bottom-right `~260×110 px` clear of words or faces for the duration timestamp badge;
36
+ 4. export a crop & overlay contact sheet (`1200×630` + `1000×500` box, `2:1`, `9:16` UI mask, and `25%` thumbnail scale) rather than inspecting only the raw 100% canvas.
37
+
38
+ ## Thumbnail legibility (`150–300 px` downscale check)
39
+
40
+ Design at final dimensions, then verify scaled down:
41
+
42
+ - one short headline or product name (typically `<= 6–8` words);
43
+ - test readability when downscaled to **`150–300 px` thumbnail width** (`25–33%` scale) in **both light and dark social feeds**;
44
+ - prefer high x-height, sturdy weight, generous tracking, and strong foreground/background contrast;
45
+ - avoid thin strokes, dense code screenshots, tiny chart axes, busy textures behind text, and legal footnotes;
46
+ - use one dominant visual anchor: real product detail, simplified diagram, decisive metric, or recognizable mark;
47
+ - test light and dark host feed backgrounds so transparent PNG edges never halo or vanish.
48
+
49
+ ## Metadata, format fallbacks, byte budgets, and delivery
50
+
51
+ - **Absolute `https://` + PNG/JPEG `og:image` compatibility**: **never point `og:image` or `twitter:image` at an `.svg`** (all major social/chat crawlers reject SVG for security), and **prefer optimized `.png` or `.jpg` over `.webp`/`.avif`** for `og:image` because Zalo, older Outlook/Slack unfurlers, LinkedIn edge scrapers, and enterprise link-preview proxies still drop WebP/AVIF thumbnails silently;
52
+ - include `og:title`, `og:description`, `og:image`, `og:image:secure_url`, `og:image:width` (`1200`), `og:image:height` (`630`), `og:image:type` (`image/png` or `image/jpeg`), `og:image:alt`, `twitter:card="summary_large_image"`, and `twitter:image:alt`;
53
+ - keep **WhatsApp / Zalo** OG assets **`< 200–300 KB`** (`< 1 MB` across Slack/iMessage/X/LinkedIn/Bluesky) with crawler response **`< 1.5–2.0 s`** (no auth wall, `robots.txt` block on `/og/*`, or slow cold-start timeouts);
54
+ - cache-bust via versioned path/query (`/og/v2/post-slug.png`) when updating artwork because Zalo, LinkedIn, Telegram (`@WebpageBot`), Slack, and iMessage cache unfurls aggressively.
55
+
56
+ ## Composition patterns
57
+
58
+ - **artifact-first:** real product interface cropped intentionally and enlarged;
59
+ - **statement-first:** short claim/name in editorial typography with one supporting visual motif;
60
+ - **system-first:** architecture/flow diagram simplified to one readable idea;
61
+ - **identity-first:** bold mark/wordmark only when audience recognition already exists.
62
+
63
+ Anti-slop: centered logo over purple-blue gradient, floating glass browser chrome, random rocket/sparkle clip art, fake avatars, tiny feature checklists, and unrelated stock photos.
64
+
65
+ ## Verification matrix & required deliverables
66
+
67
+ - inspect exported file dimensions, MIME type, exact byte count against target caps (WhatsApp/Zalo `< 300 KB`, GitHub `< 1 MB`, YouTube `< 2 MB`), and attach a complete **asset license table** (fonts, photos, icons, audio/music, AI provenance) (`static`);
68
+ - inspect at `100%` and **`150–300 px` downscaled thumbnail width** on **both light and dark social feed backgrounds** (`rendered`);
69
+ - verify YouTube bottom-right safe zone and `2:1` / `1.91:1` / `1:1` / `9:16` crop overlays (`rendered`);
70
+ - capture **live share-debugger / unfurl previews (`Facebook`, `X`, `LinkedIn`, `Zalo`)** (`rendered`, or explicitly label unhosted/offline platforms `not-checked`);
71
+ - confirm `og:image:alt`, `twitter:card`, absolute HTTPS URLs, and reproducible export preset (`static`).
@@ -0,0 +1,86 @@
1
+ ---
2
+ name: pixelcraft-mobile
3
+ description: Translates Pixelcraft direction, tokens, UX, and floor requirements into idiomatic mobile UI across SwiftUI (incl. TCA), UIKit, Jetpack Compose, Flutter, React Native/Expo, Expo Router, LynxJS, Kotlin Multiplatform, NativeScript, Skip, HarmonyOS ArkUI, Elixir LiveView Native, Taro/uni-app, Ionic/Capacitor, .NET MAUI, Flet, and Kivy. Use for native or cross-platform app screens, iOS 26 Liquid Glass, Material 3 Expressive, safe areas, Dynamic Type/sp scaling, touch targets, bottom sheets, gestures, haptics, Live Activities, forms, states, accessibility, and device verification.
4
+ license: MIT
5
+ metadata:
6
+ version: 0.1.0
7
+ ---
8
+
9
+ # Pixelcraft mobile
10
+
11
+ Use this skill when the surface is a phone/tablet/foldable/watch-adjacent app. Respect the host platform: iOS uses Apple HIG idioms (including iOS 26 Liquid Glass with contrast/transparency fallbacks), Android uses Material 3 / Material 3 Expressive behavior with edge-to-edge and predictive back, and cross-platform runtimes must translate rather than average them.
12
+
13
+ ## Surface craft
14
+
15
+ Give the primary task a short route with native back/dismiss behavior; add delight at a meaningful state transition, not at every tap. Compare Compact and large-text layouts, resume after interruption, and make haptics optional reinforcement rather than the only confirmation. Do not copy a gallery's onboarding screens without following the activation and recovery steps.
16
+
17
+ ## Detection signals
18
+
19
+ `Package.swift`, Xcode projects/workspaces, SwiftUI/UIKit/TCA imports, `build.gradle(.kts)` Compose/Material3 dependencies, `pubspec.yaml`, React Native/Expo config (`app.config.*`, Expo Router `app/_layout.tsx`), LynxJS (`@lynx-js/react`, `lynx.config.*`, `rspeedy`), KMP/Compose Multiplatform (`composeResources/`, `commonMain`), NativeScript (`nativescript.config.ts`), Skip (`Skip/skip.yml`), HarmonyOS (`oh-package.json5`, `build-profile.json5`, `.ets` ArkTS), LiveView Native (`.swiftui.heex`/`.jetpack.heex`), Taro/uni-app (`config/index.*`, `pages.json`, `manifest.json`), Ionic/Capacitor config (`capacitor.config.*`), `.csproj` MAUI references, Flet controls/page setup, Kivy/KivyMD KV/App classes, platform folders (`ios/`, `android/`), and target/device family declarations.
20
+
21
+ ## Translate direction to mobile idioms
22
+
23
+ 1. Map DTCG semantic roles to native theme systems: SwiftUI `ColorResource` Asset Catalogs/`@Entry`, UIKit trait-aware colors, Compose `MaterialExpressiveTheme`/`ColorScheme`, Flutter `ThemeData`/`ThemeExtension`, RN styling engines (`Uniwind`, `unistyles`, `NativeWind`), LynxJS CSS custom properties, HarmonyOS `$r('app.color.*')`, Ionic 8 `light-dark()` variables, NativeScript `.ns-dark` CSS, Skip Asset Catalogs, MAUI `AppThemeBinding`, Flet `ft.Theme`, or KivyMD `theme_cls`.
24
+ 2. Recompose for touch and reach: primary actions in the lower thumb zone, no desktop hover dependence, dense information only where expert use justifies it.
25
+ 3. Use platform navigation rather than web metaphors: `NavigationStack`/`Tab`/`TabSection`/sheets on iOS; Navigation 3 or Compose Navigation + predictive back + Material 3 adaptive panes on Android; Expo Router native stacks/tabs on RN; `GoRouter` `StatefulShellRoute` on Flutter; `Navigation` + `GridRow`/`GridCol` on HarmonyOS.
26
+ 4. Scale type using Dynamic Type (`.font(.custom(..., relativeTo:))`), Android `sp`, or HarmonyOS `fp` scaling; restructure horizontal rows instead of truncating essential content at accessibility sizes.
27
+ 5. Keep targets at least `44×44 pt` iOS and `48×48 dp` Android unless a documented platform exception applies.
28
+ 6. Map motion to native spring/transition idioms (`MotionScheme.expressive()` spatial vs effects springs, Reanimated 4, SwiftUI springs) and honor Reduce Motion/Remove animations/Reduce Transparency. Haptics confirm meaningful physical/input moments only.
29
+
30
+ ## Platform-wide rules
31
+
32
+ - **2026 App Store (iOS / Xcode 26 SDK) gates**: ship `PrivacyInfo.xcprivacy` covering first-party code and every embedded third-party SDK (Required Reason APIs + tracking domains); store tokens exclusively in **Keychain** (never `UserDefaults` / `AsyncStorage`); offer **Sign in with Apple** parity whenever 3rd-party social login exists; provide discoverable **in-app Account Deletion** that actually deletes/schedules deletion (never linking to a support email); and use contextual just-in-time permission priming, zero-permission `PhotosPicker`/`PHPickerViewController` (plus `.limited` photo support), and inline Settings deep-link recovery when denied.
33
+ - **2026 Google Play (`targetSdk 36` / Android 16 `.aab`) gates**: enforce mandatory **Edge-to-Edge** (`enableEdgeToEdge()` / `WindowCompat.setDecorFitsSystemWindows(window, false)` / `WindowInsets.ime`); never hard-lock portrait on `sw >= 600dp` tablets/foldables and survive fold/unfold posture transitions without state loss; compile all native `.so` libraries for **`16 KB` memory page size** (NDK r28+ / `-Wl,-z,max-page-size=16384`, verified via `zipalign -c -P 16`); store secrets in **Android Keystore** (Jetpack Tink / `EncryptedSharedPreferences`, never plaintext `SharedPreferences`); and wire **Predictive Back** (`OnBackInvokedCallback` / `PredictiveBackHandler`).
34
+ - **Tactile safety & cross-platform split**: enforce **`>= 8 pt/dp` minimum spacing** between destructive actions and safe controls, an **explicit visible `Close` button on bottom sheets** for users who cannot drag gestures, **zero custom horizontal swipe gestures inside OS back-gesture edge zones**, and an **explicitly documented shared-vs-platform-native UI split** on cross-platform stacks (Flutter, React Native, KMP, `.NET MAUI`).
35
+ - **Physics, memory/energy, install budget & rollout gates**: hit **`< 800 ms–1.2 s`** cold start on mid-tier hardware (hard ceiling `< 2.0 s`) via **Android Baseline Profiles** and deferred SDK init; unlock **`120fps` ProMotion (`< 8.33 ms`/frame)** via `CADisableMinimumFrameDurationOnPhone = true` with UI/Impeller-thread animations, interactive keyboard dismissal, and `panVelocity` spring handover; pass a **20–30× primary-flow repetition memory-leak check** (`LeakCanary` / Xcode `Instruments`), **Energy / Battery Historian / Xcode Energy Impact** check, and agreed **install-size ceiling** (e.g., `<= 50–80 MB` download); and ship a **staged rollout + force-update / min-supported-version gate** for breaking API changes.
36
+ - **4-tier haptics, process-death & 3-tier real-device matrix**: restrict haptics to 4 semantic tiers; survive OS background RAM eviction (`adb shell am kill <pkg>` / Xcode termination) via `SavedStateHandle`/`rememberSaveable`/`@SceneStorage`/`RestorationMixin`; expose visible offline mutation sync queues; maintain **`>= 99.5%` crash-free sessions** (`0` ANRs) with automated dSYM/R8/ProGuard symbolication; and attach profiler, crash-free, VoiceOver, and TalkBack deliverables across a **3-tier real-device matrix** (**`compact 4.7–5.4" + standard + Pro Max/Plus` iOS** and **`low-RAM 3–4 GB + mid-tier + flagship` Android** across **oldest + newest supported OS** at default and **`200%` (`AX3`)** font scale).
37
+
38
+ ## Anti-lazy-default & anti-slop guard
39
+
40
+ - **Reject lazy wrappers on greenfield mobile apps**: do not wrap a web SPA in Ionic/Capacitor/WebView or default to Python Kivy merely out of habit when native **SwiftUI**, **Jetpack Compose**, **Flutter**, **KMP**, or **React Native New Architecture** fits the product's gesture fidelity, offline durability, and platform expectations. Use Capacitor/Kivy/LiveView Native/Taro only when their trade-offs match explicit team or distribution constraints.
41
+ - **Reject transplanted web slop**: never drop centered web marketing heroes, hover-only tooltips, floating 3-card SaaS grids, or custom fake nav bars onto native mobile screens.
42
+ - **Do not hand-roll native primitives**: use native sheets/detents, date pickers, autofill, predictive back, and swipe-back gestures instead of brittle custom overlays.
43
+
44
+ ## Common mobile-specific failures
45
+
46
+ - fixed-height rows clipping Dynamic Type (`AX3`) or `200%` `sp` scaling, or hard-locked portrait breaking `sw >= 600dp` foldables/tablets on Android 16;
47
+ - bottom CTAs hidden by home indicator, soft keyboard, or Android 15/16 edge-to-edge gesture bar, or bottom sheets missing an explicit `Close` button;
48
+ - `< 8 pt/dp` spacing beside destructive taps, or custom horizontal swipes inside OS back-gesture edge zones;
49
+ - `4 KB`-aligned native `.so` binaries rejected by Google Play, missing `PrivacyInfo.xcprivacy`, tokens in `UserDefaults`/`SharedPreferences`, or fake "email us to delete account" links;
50
+ - animations capped at `60 Hz` on ProMotion iPhones, memory leaks after 20–30× flow repeats, missing min-supported-version gate, or state lost on `adb shell am kill` eviction;
51
+ - Liquid Glass stacked on reading content or unreadable under Reduce Transparency / Increase Contrast;
52
+ - haptics buzzing on every routine tap/scroll rather than the 4 semantic tiers.
53
+
54
+ ## Verification options
55
+
56
+ Rendered verification requires simulator/emulator/device tooling or runtime UI tests (**Rule #0.3**: compilation or preview generation alone is `static`, never `rendered`). Attach profiler traces (`Instruments` / `LeakCanary` / Energy Impact), install-size reports, crash-free/ANR config, and VoiceOver/TalkBack captures across the 3-tier iOS + Android matrix; label unavailable physical devices `not-checked`.
57
+
58
+ ## Pre-submit checklist
59
+
60
+ - [ ] zero `TODO`s, placeholder stubs, invented copy, or dead tap/gesture handlers;
61
+ - [ ] App Store & Google Play gates met: Xcode 26 SDK, `PrivacyInfo.xcprivacy`, Keychain/Keystore-only tokens, Sign in with Apple parity, real in-app Account Deletion, `targetSdk 36` `.aab`, Edge-to-Edge + `WindowInsets.ime`, `sw >= 600dp` foldable posture, `16 KB` `.so` alignment (`zipalign -c -P 16`), Predictive Back;
62
+ - [ ] `>= 8 pt/dp` destructive spacing, explicit visible `Close` button on bottom sheets, zero custom swipes in OS back-gesture edge zones, and documented shared-vs-platform-native UI split (on Flutter/RN/KMP/MAUI) verified;
63
+ - [ ] `< 800 ms–1.2 s` cold start (Baseline Profiles), `120fps` ProMotion, interactive keyboard drag, `panVelocity` spring handover, 4-tier haptics, **20–30× primary-flow memory-leak check** (`LeakCanary`/`Instruments`), **Energy/Battery Historian/Energy Impact** check, agreed **install-size ceiling** (`<= 50–80 MB`), and **staged rollout + force-update/min-version gate** verified;
64
+ - [ ] OS process-death (`adb shell am kill` / background eviction) restoration, visible offline sync queue, dSYM/R8 symbolication (`>= 99.5%` crash-free, `0` ANRs), and `44 pt` / `48 dp` targets at Dynamic Type `AX3` / `200%` `sp` verified;
65
+ - [ ] Dark Mode, Increase Contrast, Reduce Transparency, Reduce Motion, and VoiceOver + TalkBack deliverables across the **3-tier real-device matrix** (`compact 4.7–5.4" + standard + Pro Max/Plus` iOS; `low-RAM 3–4 GB + mid-tier + flagship` Android across oldest + newest OS) checked or labeled `not-checked`;
66
+ - [ ] **Checklist-Until-Passing Stop-Gate (`<HARD-GATE>`):** walk every checklist item above + run `slop-scan.mjs --fail-on p2`, `check-contrast.mjs`, native/simulator 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`).
67
+
68
+ ## Framework routing
69
+
70
+ - Read [references/task-state-composition.md](references/task-state-composition.md) when designing timers, capture/recording flows, delivery/ride trackers, iOS Live Activities, or Android Live Updates with distinct setup/active/complete stages.
71
+ - Read [references/tactile-interactions.md](references/tactile-interactions.md) when implementing bottom sheet detents, scroll handover, thumb-zone ergonomics, semantic haptics, swipe-to-act with undo, offline queues, or Dynamic Type/`sp` reflow.
72
+ - Read [references/swiftui.md](references/swiftui.md) when building SwiftUI iOS/iPadOS/watchOS-adjacent apps, iOS 26 Liquid Glass chrome, iOS 18–26 declarative Apple APIs, or The Composable Architecture (TCA).
73
+ - Read [references/uikit.md](references/uikit.md) when maintaining or building imperative UIKit apps, `UIGlassEffect`, `UIHostingConfiguration`, or Swift 6 `@MainActor` view controllers.
74
+ - Read [references/jetpack-compose.md](references/jetpack-compose.md) when building Android Compose UI, Material 3 Expressive, Android 15/16 edge-to-edge, Predictive Back, Navigation 3, or `TextFieldState`.
75
+ - Read [references/flutter.md](references/flutter.md) when building Flutter/Dart mobile or embedded UI with Impeller, Cupertino adaptive controls, GoRouter, or Riverpod 3.
76
+ - Read [references/react-native-expo.md](references/react-native-expo.md) when building React Native New Architecture or Expo SDK 52–54+ apps with Expo Router, Uniwind/Unistyles/NativeWind, Reanimated 4, Skia, or FlashList v2.
77
+ - Read [references/lynxjs.md](references/lynxjs.md) when building Lynx / LynxJS (`@lynx-js/react`, `@lynx-js/rspeedy`) dual-threaded native mobile UI.
78
+ - Read [references/kotlin-multiplatform.md](references/kotlin-multiplatform.md) when sharing business logic via KMP/SKIE or sharing UI via Compose Multiplatform (iOS Stable 1.8+, Android, Desktop, Wasm).
79
+ - Read [references/nativescript-and-skip.md](references/nativescript-and-skip.md) when building native cross-platform mobile apps with NativeScript (JS/TS direct native APIs) or Skip (`skip.tools` Swift/SwiftUI to Android Compose).
80
+ - Read [references/harmonyos-and-emerging-mobile.md](references/harmonyos-and-emerging-mobile.md) when building HarmonyOS ArkUI/ArkTS apps, Elixir LiveView Native (SwiftUI/Compose over Phoenix), or cross-mini-app Taro / uni-app interfaces.
81
+ - Read [references/ionic-capacitor.md](references/ionic-capacitor.md) when building Ionic 7/8 or Capacitor 6–8 hybrid apps (including Capacitor without Ionic).
82
+ - Read [references/dotnet-maui.md](references/dotnet-maui.md) when building .NET MAUI (`net9.0`/`net10.0`), Blazor Hybrid, or `HybridWebView` mobile/desktop apps.
83
+ - Read [references/flet.md](references/flet.md) when building Python Flet (`0.25–1.0`) cross-platform mobile/desktop UI.
84
+ - Read [references/kivy.md](references/kivy.md) when building Python Kivy or KivyMD cross-platform apps packaged with Buildozer or `kivy-ios`.
85
+
86
+ For watchOS/Wear OS wearables and tvOS/10-foot living-room surfaces, use `pixelcraft-constrained` as the primary surface skill alongside framework idioms here; for visionOS/XR spatial surfaces, use `pixelcraft-spatial`.
@@ -0,0 +1,91 @@
1
+ # .NET MAUI
2
+
3
+ ## Token mapping
4
+
5
+ Define semantic colors, spacing, and styles once in XAML `ResourceDictionary` files and pair them with **`{AppThemeBinding Light=..., Dark=...}`** (or dynamic theme dictionaries) so light, dark, and high-contrast themes resolve cleanly without inline hex literals:
6
+
7
+ ```xml
8
+ <ResourceDictionary xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
9
+ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
10
+ <Color x:Key="ActionLight">#0074CA</Color>
11
+ <Color x:Key="ActionDark">#5BB2FF</Color>
12
+ <Color x:Key="SurfaceLight">#FFFFFF</Color>
13
+ <Color x:Key="SurfaceDark">#121417</Color>
14
+
15
+ <Style TargetType="Button" x:Key="PrimaryActionButton">
16
+ <Setter Property="BackgroundColor"
17
+ Value="{AppThemeBinding Light={StaticResource ActionLight}, Dark={StaticResource ActionDark}}" />
18
+ <Setter Property="MinimumHeightRequest" Value="48" />
19
+ </Style>
20
+ </ResourceDictionary>
21
+ ```
22
+
23
+ Enable compiled bindings (`x:DataType="vm:InvoiceViewModel"`) on every page and `DataTemplate` so binding typos fail at compile time rather than silently failing at runtime.
24
+
25
+ ## Layout, handlers, hybrid surfaces, & desktop chrome
26
+
27
+ - Use `Grid`, `VerticalStackLayout`, `HorizontalStackLayout`, `FlexLayout`, and `Shell` intentionally; Shell's default flyout/tabs are not automatically the right IA for every app. Respect iOS safe areas (`ios:Page.UseSafeArea="True"`), Android edge-to-edge insets, and platform back behavior.
28
+ - **`CollectionViewHandler2`** (.NET 9/10 iOS & Mac Catalyst): use the modernized `UICollectionView`-backed handler (`ConfigureMauiHandlers` on .NET 9 or default on .NET 10) to avoid legacy scroll-sizing, header/footer, and cell-recycling glitches in `CollectionView`.
29
+ - **Desktop `TitleBar` (.NET 9+)**: on Windows and Mac Catalyst, use the native `Window.TitleBar` control (`TitleBar` with `LeadingContent`, `Content`, `TrailingContent`, and `PassthroughElements`) instead of hacking frameless windows or hiding system window buttons.
30
+ - **Hybrid web targets**:
31
+ - Use **`BlazorWebView`** (Blazor Hybrid) to share Razor components across mobile, desktop, and web with native C# access.
32
+ - Use **`HybridWebView`** (.NET 9+) to host existing JS/HTML/CSS SPAs (React/Vue/Svelte) inside MAUI with structured bidirectional JS↔C# `InvokeJavaScriptAsync` / `SendRawMessage` interop.
33
+
34
+ ## State management (`CommunityToolkit.Mvvm` & `CommunityToolkit.Maui`)
35
+
36
+ Adopt **`CommunityToolkit.Mvvm`** (`[ObservableProperty]`, `[RelayCommand(IncludeCancelCommand = true)]`, `ObservableObject`) for zero-reflection source-generated MVVM with explicit cancellation, and **`CommunityToolkit.Maui`** for production behaviors, popups, status-bar styling, converters, and animations:
37
+
38
+ ```csharp
39
+ public partial class InvoiceViewModel(IInvoiceService service) : ObservableObject
40
+ {
41
+ [ObservableProperty] private bool isBusy;
42
+ [ObservableProperty] private string? errorMessage;
43
+
44
+ [RelayCommand(IncludeCancelCommand = true)]
45
+ private async Task SaveAsync(CancellationToken ct)
46
+ {
47
+ ErrorMessage = null;
48
+ IsBusy = true;
49
+ try { await service.SaveAsync(ct); }
50
+ catch (OperationCanceledException) { }
51
+ catch (Exception ex) { ErrorMessage = ex.Message; }
52
+ finally { IsBusy = false; }
53
+ }
54
+ }
55
+ ```
56
+
57
+ Never fire unawaited `async void` mutations from button clicks.
58
+
59
+ ## Typography, motion, accessibility, & forms idioms
60
+
61
+ Register custom fonts via `ConfigureFonts(...)` in `MauiProgram.cs` and keep `FontAutoScalingEnabled="True"` on essential text; avoid fixed `HeightRequest` on labels that clip at `200%` font scale.
62
+
63
+ MAUI animations (`FadeTo`, `TranslateTo`) do not automatically query every OS reduced-motion flag—abstract reduced motion per platform (`UIAccessibility.IsReduceMotionEnabled` on iOS, `ANIMATOR_DURATION_SCALE` on Android, `UISettings.AnimationsEnabled` on Windows) and cancel in-flight animations on `OnDisappearing`.
64
+
65
+ Set `SemanticProperties.Description`, `SemanticProperties.Hint` (sparingly), and `SemanticProperties.HeadingLevel` on interactive and structural controls, and test TalkBack, VoiceOver, and Narrator separately—shared XAML does not guarantee equivalent native accessibility trees. In forms, configure `Keyboard`, `ReturnType`, focus order, validation after completion with text recovery copy (not red borders alone), and preserve input across navigation.
66
+
67
+ ## Do/don't pairs
68
+
69
+ | Do | Don't |
70
+ |---|---|
71
+ | `{AppThemeBinding Light=..., Dark=...}` + `x:DataType` compiled bindings | Inline hex literals and untyped runtime-only bindings |
72
+ | `[RelayCommand(IncludeCancelCommand = true)]` via `CommunityToolkit.Mvvm` | Fire-and-forget `async void` event handlers with silent failures |
73
+ | `CollectionViewHandler2` on iOS/Mac Catalyst for complex lists | Ship legacy iOS `CollectionView` layout glitches without profiling |
74
+ | Native `Window.TitleBar` on Windows/Mac Catalyst (.NET 9+) | Custom borderless titlebar hacks missing drag or window buttons |
75
+ | `SemanticProperties.Description` & `HeadingLevel` verified per OS | Tap gesture recognizer on a `Label` masquerading as a button |
76
+
77
+ ## Known traps
78
+
79
+ EOL target frameworks (`net8.0-*`—upgrade to `net9.0-*` or `net10.0-*`), silent XAML binding errors without `x:DataType`, `async void` crash/lifecycle leaks, legacy iOS `CollectionView` measurement glitches, fixed-height clipping under font scaling, platform-divergent safe-area insets on Android 15/16, unverified accessibility trees across iOS/Android/Windows.
80
+
81
+ ## Verification commands
82
+
83
+ ```sh
84
+ dotnet build
85
+ dotnet test
86
+ # Run target platform builds when matching workloads & simulators/emulators are installed:
87
+ dotnet build -t:Run -f net9.0-android # or net10.0-android
88
+ dotnet build -t:Run -f net9.0-ios # or net10.0-ios
89
+ ```
90
+
91
+ `dotnet build` and `dotnet test` provide `static` evidence. Inspect real Android/iOS/Windows/Mac Catalyst runs with TalkBack/VoiceOver/Narrator, Dark Mode, High Contrast, font scaling, orientation/resize, and offline recovery for `rendered` evidence; label unavailable targets `not-checked`.