@thanhnguyxn/pixelcraft 0.0.0-stage → 0.1.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 (297) hide show
  1. package/.agents/plugins/marketplace.json +20 -0
  2. package/.claude-plugin/marketplace.json +20 -0
  3. package/.claude-plugin/plugin.json +11 -0
  4. package/LICENSE +21 -0
  5. package/README.md +407 -2
  6. package/assets/README.md +28 -0
  7. package/assets/pixelcraft-logo-512.png +0 -0
  8. package/bin/pixelcraft.mjs +444 -0
  9. package/docs/ARCHITECTURE.md +102 -0
  10. package/docs/DESIGN-RATIONALE.md +143 -0
  11. package/evals/README.md +27 -0
  12. package/evals/fixtures/README.md +36 -0
  13. package/evals/fixtures/direction-prototype-complexity.json +29 -0
  14. package/evals/fixtures/finish-gate-anti-slop.json +30 -0
  15. package/evals/fixtures/forms-accessibility-negative.json +29 -0
  16. package/evals/fixtures/handoff-fidelity-tolerance.json +29 -0
  17. package/evals/fixtures/plan-brownfield-evidence.json +28 -0
  18. package/evals/fixtures/visual-qa-task-evidence.json +29 -0
  19. package/evals/fixtures/workflow-checkpoints.json +30 -0
  20. package/evals/pixelcraft-accessibility.md +57 -0
  21. package/evals/pixelcraft-brandkit.md +58 -0
  22. package/evals/pixelcraft-chat-ui.md +55 -0
  23. package/evals/pixelcraft-constrained.md +55 -0
  24. package/evals/pixelcraft-craft.md +60 -0
  25. package/evals/pixelcraft-data-apps.md +55 -0
  26. package/evals/pixelcraft-dataviz.md +59 -0
  27. package/evals/pixelcraft-desktop.md +55 -0
  28. package/evals/pixelcraft-direction.md +60 -0
  29. package/evals/pixelcraft-document.md +55 -0
  30. package/evals/pixelcraft-email.md +55 -0
  31. package/evals/pixelcraft-extensions.md +55 -0
  32. package/evals/pixelcraft-game-ui.md +59 -0
  33. package/evals/pixelcraft-handoff.md +57 -0
  34. package/evals/pixelcraft-media.md +55 -0
  35. package/evals/pixelcraft-mobile.md +59 -0
  36. package/evals/pixelcraft-patterns.md +57 -0
  37. package/evals/pixelcraft-plan.md +65 -0
  38. package/evals/pixelcraft-review.md +63 -0
  39. package/evals/pixelcraft-spatial.md +55 -0
  40. package/evals/pixelcraft-tokens.md +57 -0
  41. package/evals/pixelcraft-tui.md +55 -0
  42. package/evals/pixelcraft-ux.md +59 -0
  43. package/evals/pixelcraft-visual-qa.md +80 -0
  44. package/evals/pixelcraft-web.md +71 -0
  45. package/evals/pixelcraft.md +70 -0
  46. package/gemini-extension.json +5 -0
  47. package/install.ps1 +295 -0
  48. package/install.sh +437 -0
  49. package/package.json +63 -4
  50. package/plugin.json +24 -0
  51. package/scripts/build-adapters.mjs +290 -0
  52. package/scripts/build-release-archives.mjs +61 -0
  53. package/scripts/build-skill-zips.mjs +94 -0
  54. package/scripts/test-build-adapters.mjs +48 -0
  55. package/scripts/test-distribution.mjs +124 -0
  56. package/scripts/test-export-tokens.mjs +105 -0
  57. package/scripts/test-finish-gate.mjs +148 -0
  58. package/scripts/test-installers.mjs +67 -0
  59. package/scripts/test-release-archives.mjs +42 -0
  60. package/scripts/test-shoot.mjs +65 -0
  61. package/scripts/test-slop-scan.mjs +29 -0
  62. package/scripts/test-style-inventory.mjs +211 -0
  63. package/scripts/test-validate-skills.mjs +117 -0
  64. package/scripts/validate-skills.mjs +512 -0
  65. package/skills/pixelcraft/SKILL.md +135 -0
  66. package/skills/pixelcraft/references/design-brief.md +75 -0
  67. package/skills/pixelcraft/references/floor.md +73 -0
  68. package/skills/pixelcraft/references/report-template.md +35 -0
  69. package/skills/pixelcraft/references/stack-detection.md +155 -0
  70. package/skills/pixelcraft/references/surface-acceptance.md +40 -0
  71. package/skills/pixelcraft/references/workflow-checkpoints.md +29 -0
  72. package/skills/pixelcraft-accessibility/SKILL.md +33 -0
  73. package/skills/pixelcraft-accessibility/references/apg-patterns.md +51 -0
  74. package/skills/pixelcraft-accessibility/references/platforms.md +58 -0
  75. package/skills/pixelcraft-accessibility/references/verification.md +59 -0
  76. package/skills/pixelcraft-accessibility/references/wcag22-checks.md +66 -0
  77. package/skills/pixelcraft-brandkit/SKILL.md +115 -0
  78. package/skills/pixelcraft-brandkit/references/asset-pipeline.md +125 -0
  79. package/skills/pixelcraft-brandkit/references/brand-governance.md +80 -0
  80. package/skills/pixelcraft-brandkit/references/layouts.md +88 -0
  81. package/skills/pixelcraft-brandkit/references/logo-concepting.md +83 -0
  82. package/skills/pixelcraft-brandkit/references/logo-methods.md +98 -0
  83. package/skills/pixelcraft-brandkit/references/pixel-art-logos.md +82 -0
  84. package/skills/pixelcraft-brandkit/references/prompt-template.md +85 -0
  85. package/skills/pixelcraft-brandkit/references/qa-checklist.md +88 -0
  86. package/skills/pixelcraft-brandkit/references/visual-modes.md +123 -0
  87. package/skills/pixelcraft-chat-ui/SKILL.md +53 -0
  88. package/skills/pixelcraft-chat-ui/references/conversation-design.md +78 -0
  89. package/skills/pixelcraft-chat-ui/references/mobile-business-platforms.md +87 -0
  90. package/skills/pixelcraft-chat-ui/references/slack-discord.md +96 -0
  91. package/skills/pixelcraft-constrained/SKILL.md +51 -0
  92. package/skills/pixelcraft-constrained/references/specialized-hardware.md +66 -0
  93. package/skills/pixelcraft-constrained/references/tv-wearables.md +84 -0
  94. package/skills/pixelcraft-constrained/references/voice-ui.md +63 -0
  95. package/skills/pixelcraft-craft/SKILL.md +44 -0
  96. package/skills/pixelcraft-craft/references/color.md +69 -0
  97. package/skills/pixelcraft-craft/references/imagery-icons.md +37 -0
  98. package/skills/pixelcraft-craft/references/layout-quality.md +65 -0
  99. package/skills/pixelcraft-craft/references/layout.md +41 -0
  100. package/skills/pixelcraft-craft/references/motion.md +76 -0
  101. package/skills/pixelcraft-craft/references/typography.md +71 -0
  102. package/skills/pixelcraft-data-apps/SKILL.md +67 -0
  103. package/skills/pixelcraft-data-apps/references/dash.md +53 -0
  104. package/skills/pixelcraft-data-apps/references/evidence.md +75 -0
  105. package/skills/pixelcraft-data-apps/references/gradio.md +65 -0
  106. package/skills/pixelcraft-data-apps/references/julia-genie.md +54 -0
  107. package/skills/pixelcraft-data-apps/references/jupyter-widgets.md +53 -0
  108. package/skills/pixelcraft-data-apps/references/nicegui.md +63 -0
  109. package/skills/pixelcraft-data-apps/references/observable-framework.md +67 -0
  110. package/skills/pixelcraft-data-apps/references/panel.md +53 -0
  111. package/skills/pixelcraft-data-apps/references/r-shiny.md +54 -0
  112. package/skills/pixelcraft-data-apps/references/reflex.md +62 -0
  113. package/skills/pixelcraft-data-apps/references/shiny.md +53 -0
  114. package/skills/pixelcraft-data-apps/references/streamlit.md +65 -0
  115. package/skills/pixelcraft-dataviz/SKILL.md +63 -0
  116. package/skills/pixelcraft-dataviz/references/chart-choice.md +55 -0
  117. package/skills/pixelcraft-dataviz/references/color-accessibility.md +112 -0
  118. package/skills/pixelcraft-dataviz/references/encoding-tables-dashboards.md +97 -0
  119. package/skills/pixelcraft-dataviz/references/libraries.md +57 -0
  120. package/skills/pixelcraft-dataviz/references/realtime-graphs-maps-scale.md +99 -0
  121. package/skills/pixelcraft-desktop/SKILL.md +71 -0
  122. package/skills/pixelcraft-desktop/references/appkit.md +58 -0
  123. package/skills/pixelcraft-desktop/references/avalonia.md +59 -0
  124. package/skills/pixelcraft-desktop/references/cpp-gui.md +52 -0
  125. package/skills/pixelcraft-desktop/references/electron.md +54 -0
  126. package/skills/pixelcraft-desktop/references/go-gui.md +54 -0
  127. package/skills/pixelcraft-desktop/references/gtk.md +54 -0
  128. package/skills/pixelcraft-desktop/references/javafx-swing.md +52 -0
  129. package/skills/pixelcraft-desktop/references/qt-pyside-qml.md +61 -0
  130. package/skills/pixelcraft-desktop/references/rust-gui.md +65 -0
  131. package/skills/pixelcraft-desktop/references/tauri.md +54 -0
  132. package/skills/pixelcraft-desktop/references/uno-platform.md +52 -0
  133. package/skills/pixelcraft-desktop/references/winui-wpf.md +58 -0
  134. package/skills/pixelcraft-desktop/references/working-context.md +5 -0
  135. package/skills/pixelcraft-direction/SKILL.md +154 -0
  136. package/skills/pixelcraft-direction/references/composition-library.md +84 -0
  137. package/skills/pixelcraft-direction/references/direction-card.md +54 -0
  138. package/skills/pixelcraft-direction/references/direction-scoring.md +72 -0
  139. package/skills/pixelcraft-direction/references/movements.md +68 -0
  140. package/skills/pixelcraft-direction/references/repetition-history.md +75 -0
  141. package/skills/pixelcraft-direction/references/slop-fingerprints.md +58 -0
  142. package/skills/pixelcraft-direction/references/wildcards.md +47 -0
  143. package/skills/pixelcraft-document/SKILL.md +54 -0
  144. package/skills/pixelcraft-document/references/archetypes.md +83 -0
  145. package/skills/pixelcraft-document/references/pdf-tools.md +154 -0
  146. package/skills/pixelcraft-document/references/print-css.md +134 -0
  147. package/skills/pixelcraft-document/references/slides.md +102 -0
  148. package/skills/pixelcraft-email/SKILL.md +58 -0
  149. package/skills/pixelcraft-email/references/client-quirks.md +45 -0
  150. package/skills/pixelcraft-email/references/html-tables.md +53 -0
  151. package/skills/pixelcraft-email/references/mjml.md +52 -0
  152. package/skills/pixelcraft-email/references/react-email.md +53 -0
  153. package/skills/pixelcraft-extensions/SKILL.md +51 -0
  154. package/skills/pixelcraft-extensions/references/browser-extensions.md +31 -0
  155. package/skills/pixelcraft-extensions/references/figma-office.md +23 -0
  156. package/skills/pixelcraft-extensions/references/raycast.md +19 -0
  157. package/skills/pixelcraft-extensions/references/vscode-webviews.md +26 -0
  158. package/skills/pixelcraft-game-ui/SKILL.md +61 -0
  159. package/skills/pixelcraft-game-ui/references/bevy.md +52 -0
  160. package/skills/pixelcraft-game-ui/references/godot.md +57 -0
  161. package/skills/pixelcraft-game-ui/references/hud-principles.md +38 -0
  162. package/skills/pixelcraft-game-ui/references/love2d.md +51 -0
  163. package/skills/pixelcraft-game-ui/references/monogame.md +52 -0
  164. package/skills/pixelcraft-game-ui/references/unity-ui-toolkit.md +65 -0
  165. package/skills/pixelcraft-game-ui/references/unreal-umg.md +53 -0
  166. package/skills/pixelcraft-handoff/SKILL.md +49 -0
  167. package/skills/pixelcraft-handoff/references/design-translation.md +104 -0
  168. package/skills/pixelcraft-handoff/references/fidelity-tolerance.md +78 -0
  169. package/skills/pixelcraft-media/SKILL.md +52 -0
  170. package/skills/pixelcraft-media/references/banners-video.md +112 -0
  171. package/skills/pixelcraft-media/references/og-generation.md +107 -0
  172. package/skills/pixelcraft-media/references/social-cards.md +72 -0
  173. package/skills/pixelcraft-mobile/SKILL.md +69 -0
  174. package/skills/pixelcraft-mobile/references/dotnet-maui.md +63 -0
  175. package/skills/pixelcraft-mobile/references/flet.md +53 -0
  176. package/skills/pixelcraft-mobile/references/flutter.md +69 -0
  177. package/skills/pixelcraft-mobile/references/ionic-capacitor.md +65 -0
  178. package/skills/pixelcraft-mobile/references/jetpack-compose.md +61 -0
  179. package/skills/pixelcraft-mobile/references/kivy.md +59 -0
  180. package/skills/pixelcraft-mobile/references/kotlin-multiplatform.md +60 -0
  181. package/skills/pixelcraft-mobile/references/react-native-expo.md +71 -0
  182. package/skills/pixelcraft-mobile/references/swiftui.md +70 -0
  183. package/skills/pixelcraft-mobile/references/task-state-composition.md +5 -0
  184. package/skills/pixelcraft-mobile/references/uikit.md +58 -0
  185. package/skills/pixelcraft-patterns/SKILL.md +58 -0
  186. package/skills/pixelcraft-patterns/references/auth-onboarding.md +25 -0
  187. package/skills/pixelcraft-patterns/references/commerce.md +28 -0
  188. package/skills/pixelcraft-patterns/references/communication.md +26 -0
  189. package/skills/pixelcraft-patterns/references/creative-tools.md +29 -0
  190. package/skills/pixelcraft-patterns/references/dashboard-admin.md +31 -0
  191. package/skills/pixelcraft-patterns/references/marketing.md +32 -0
  192. package/skills/pixelcraft-patterns/references/pattern-selection.md +74 -0
  193. package/skills/pixelcraft-patterns/references/search-filtering.md +42 -0
  194. package/skills/pixelcraft-patterns/references/settings.md +23 -0
  195. package/skills/pixelcraft-patterns/references/tables-crud.md +43 -0
  196. package/skills/pixelcraft-plan/SKILL.md +67 -0
  197. package/skills/pixelcraft-plan/references/design-input.md +69 -0
  198. package/skills/pixelcraft-plan/references/plan-template.md +99 -0
  199. package/skills/pixelcraft-plan/references/repo-discovery.md +42 -0
  200. package/skills/pixelcraft-plan/references/stack-freshness.md +50 -0
  201. package/skills/pixelcraft-plan/references/stack-selection.md +42 -0
  202. package/skills/pixelcraft-review/SKILL.md +64 -0
  203. package/skills/pixelcraft-review/references/audit-report.md +50 -0
  204. package/skills/pixelcraft-review/references/critique-protocol.md +89 -0
  205. package/skills/pixelcraft-review/references/heuristics.md +18 -0
  206. package/skills/pixelcraft-review/references/personas.md +26 -0
  207. package/skills/pixelcraft-review/references/polish.md +38 -0
  208. package/skills/pixelcraft-review/scripts/fixtures/brand-critique-waivers.json +14 -0
  209. package/skills/pixelcraft-review/scripts/fixtures/brand-critique.css +18 -0
  210. package/skills/pixelcraft-review/scripts/fixtures/clean.html +43 -0
  211. package/skills/pixelcraft-review/scripts/fixtures/focus-after-block.css +4 -0
  212. package/skills/pixelcraft-review/scripts/fixtures/focus-at-rules.css +17 -0
  213. package/skills/pixelcraft-review/scripts/fixtures/focus-comments.css +10 -0
  214. package/skills/pixelcraft-review/scripts/fixtures/focus-html-quote-leak.html +12 -0
  215. package/skills/pixelcraft-review/scripts/fixtures/focus-invalid-replacements.css +27 -0
  216. package/skills/pixelcraft-review/scripts/fixtures/focus-nested-rules.css +19 -0
  217. package/skills/pixelcraft-review/scripts/fixtures/focus-not-visible-skip.css +8 -0
  218. package/skills/pixelcraft-review/scripts/fixtures/focus-outline-shorthands.css +11 -0
  219. package/skills/pixelcraft-review/scripts/fixtures/focus-unknown-and-border.css +15 -0
  220. package/skills/pixelcraft-review/scripts/fixtures/focus-unknown-last-wins.css +19 -0
  221. package/skills/pixelcraft-review/scripts/fixtures/focus-valid-replacements-extended.css +29 -0
  222. package/skills/pixelcraft-review/scripts/fixtures/focus-visible-no-replacement.css +3 -0
  223. package/skills/pixelcraft-review/scripts/fixtures/focus-visible-valid-replacements.css +9 -0
  224. package/skills/pixelcraft-review/scripts/fixtures/slop.html +28 -0
  225. package/skills/pixelcraft-review/scripts/slop-scan.mjs +586 -0
  226. package/skills/pixelcraft-spatial/SKILL.md +52 -0
  227. package/skills/pixelcraft-spatial/references/comfort-accessibility.md +98 -0
  228. package/skills/pixelcraft-spatial/references/platforms.md +77 -0
  229. package/skills/pixelcraft-tokens/SKILL.md +56 -0
  230. package/skills/pixelcraft-tokens/assets/tokens.example.json +71 -0
  231. package/skills/pixelcraft-tokens/assets/tokens.modes.example.json +47 -0
  232. package/skills/pixelcraft-tokens/references/adoption.md +55 -0
  233. package/skills/pixelcraft-tokens/references/format.md +54 -0
  234. package/skills/pixelcraft-tokens/references/governance.md +80 -0
  235. package/skills/pixelcraft-tokens/references/state-tokens.md +62 -0
  236. package/skills/pixelcraft-tokens/references/theme-presets.md +94 -0
  237. package/skills/pixelcraft-tokens/scripts/export-tokens.mjs +285 -0
  238. package/skills/pixelcraft-tui/SKILL.md +60 -0
  239. package/skills/pixelcraft-tui/references/bubbletea-lipgloss.md +60 -0
  240. package/skills/pixelcraft-tui/references/ink.md +60 -0
  241. package/skills/pixelcraft-tui/references/ratatui.md +62 -0
  242. package/skills/pixelcraft-tui/references/rich.md +62 -0
  243. package/skills/pixelcraft-tui/references/textual.md +67 -0
  244. package/skills/pixelcraft-ux/SKILL.md +46 -0
  245. package/skills/pixelcraft-ux/references/cognitive-walkthrough.md +70 -0
  246. package/skills/pixelcraft-ux/references/feedback-performance.md +30 -0
  247. package/skills/pixelcraft-ux/references/flows-ia.md +44 -0
  248. package/skills/pixelcraft-ux/references/forms.md +97 -0
  249. package/skills/pixelcraft-ux/references/i18n.md +183 -0
  250. package/skills/pixelcraft-ux/references/laws.md +18 -0
  251. package/skills/pixelcraft-ux/references/locale-test-matrix.md +60 -0
  252. package/skills/pixelcraft-ux/references/state-matrix.md +39 -0
  253. package/skills/pixelcraft-ux/references/usability-testing.md +84 -0
  254. package/skills/pixelcraft-ux/references/ux-writing.md +43 -0
  255. package/skills/pixelcraft-visual-qa/SKILL.md +82 -0
  256. package/skills/pixelcraft-visual-qa/references/baseline-governance.md +70 -0
  257. package/skills/pixelcraft-visual-qa/references/capture-desktop-game.md +38 -0
  258. package/skills/pixelcraft-visual-qa/references/capture-email.md +34 -0
  259. package/skills/pixelcraft-visual-qa/references/capture-mobile.md +35 -0
  260. package/skills/pixelcraft-visual-qa/references/capture-terminal.md +31 -0
  261. package/skills/pixelcraft-visual-qa/references/critique-rubric.md +71 -0
  262. package/skills/pixelcraft-visual-qa/references/finish-gate.md +35 -0
  263. package/skills/pixelcraft-visual-qa/references/measured-craft.md +30 -0
  264. package/skills/pixelcraft-visual-qa/references/performance-budgets.md +65 -0
  265. package/skills/pixelcraft-visual-qa/references/task-verification.md +81 -0
  266. package/skills/pixelcraft-visual-qa/scripts/finish-gate.mjs +135 -0
  267. package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-aria-modal.html +19 -0
  268. package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-audit.html +34 -0
  269. package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-modal.html +17 -0
  270. package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory-deferred.js +1 -0
  271. package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory-edge.html +52 -0
  272. package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory.html +80 -0
  273. package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory.js +8 -0
  274. package/skills/pixelcraft-visual-qa/scripts/shoot.mjs +513 -0
  275. package/skills/pixelcraft-visual-qa/scripts/style-inventory.mjs +1154 -0
  276. package/skills/pixelcraft-web/SKILL.md +76 -0
  277. package/skills/pixelcraft-web/references/adaptive-layout.md +25 -0
  278. package/skills/pixelcraft-web/references/angular.md +61 -0
  279. package/skills/pixelcraft-web/references/astro.md +62 -0
  280. package/skills/pixelcraft-web/references/clojurescript.md +53 -0
  281. package/skills/pixelcraft-web/references/elm.md +53 -0
  282. package/skills/pixelcraft-web/references/fsharp-fable.md +53 -0
  283. package/skills/pixelcraft-web/references/html-css.md +88 -0
  284. package/skills/pixelcraft-web/references/htmx-alpine.md +53 -0
  285. package/skills/pixelcraft-web/references/java-web.md +52 -0
  286. package/skills/pixelcraft-web/references/kotlin-web.md +53 -0
  287. package/skills/pixelcraft-web/references/leptos-yew.md +54 -0
  288. package/skills/pixelcraft-web/references/lit-web-components.md +61 -0
  289. package/skills/pixelcraft-web/references/pwa.md +225 -0
  290. package/skills/pixelcraft-web/references/qwik.md +54 -0
  291. package/skills/pixelcraft-web/references/react-next.md +69 -0
  292. package/skills/pixelcraft-web/references/scala-laminar.md +53 -0
  293. package/skills/pixelcraft-web/references/server-rendered.md +71 -0
  294. package/skills/pixelcraft-web/references/solid.md +60 -0
  295. package/skills/pixelcraft-web/references/svelte.md +61 -0
  296. package/skills/pixelcraft-web/references/tailwind.md +73 -0
  297. package/skills/pixelcraft-web/references/vue-nuxt.md +62 -0
@@ -0,0 +1,52 @@
1
+ # MonoGame (C#)
2
+
3
+ ## Token mapping
4
+
5
+ MonoGame has no standard high-level UI theme system. Centralize colors/fonts/spacing/scale in a semantic C# settings object and asset pipeline plan. Do not scatter raw `Color` literals across draw/update code.
6
+
7
+ ## Layout and responsive idioms
8
+
9
+ Implement explicit layout regions/state scaling; handle backbuffer/window resize, aspect ratio, pixel-perfect versus scaled art, safe margins, mouse/touch/controller input. Separate HUD, menu, dialog, and world rendering layers.
10
+
11
+ ## Typography/custom fonts
12
+
13
+ Use SpriteFont/font assets deliberately; validate glyph coverage/localization, scaling, hinting, measurement, and licensing. Fixed bitmap typography is a commitment with accessibility/localization costs.
14
+
15
+ ## Motion/reduced motion
16
+
17
+ Game-loop motion must expose reduced-motion/flash options, respect pause/interruption, clamp frame spikes where appropriate, and avoid masking critical HUD state. Do not tie correctness to visual tween completion.
18
+
19
+ ## Accessibility specifics
20
+
21
+ No meaningful built-in UI automation/focus system should be assumed. Keyboard/controller remapping, focus model, colorblind differentiation, subtitle/caption scaling/background, contrast, reduced flash/motion, and platform-specific accessibility integration are explicit engineering scope.
22
+
23
+ ## States idiom
24
+
25
+ Use explicit state machines for loading/menu/pause/error/empty/death/network/settings/remap/interruption/resume. Preserve selection/focus across state transitions. Loading IO/asset failure needs visible recovery rather than crash-only behavior.
26
+
27
+ ## Forms idiom
28
+
29
+ Text input is low-level. Validate caret/selection/clipboard/IME/platform keyboard behavior before using text fields. Prefer constrained menus where text is not essential. Remapping UI must detect conflicts/chords/multiple devices.
30
+
31
+ ## Do/don't pairs
32
+
33
+ | Do | Don't |
34
+ |---|---|
35
+ | semantic theme object/assets | `Color.OrangeRed` hard-coded everywhere |
36
+ | explicit controller focus navigation | mouse-only hit testing in menus |
37
+ | resolution/aspect-aware layout | fixed pixel UI at one backbuffer size |
38
+ | scalable readable SpriteFont strategy | assuming bitmap font supports every locale |
39
+
40
+ ## Known traps
41
+
42
+ No standard UI/accessibility layer, SpriteFont glyph limitations, input device complexity, scaling artifacts, state/focus loss, asset pipeline/platform differences, over-scoping custom UI engine.
43
+
44
+ ## Verification commands
45
+
46
+ ```sh
47
+ dotnet test
48
+ dotnet build
49
+ dotnet run --project <GameProject>
50
+ ```
51
+
52
+ Run platform/input/resolution matrix, controller-only flow, localization glyph checks, pause/interruption/resume, reduced motion/flash settings, screenshots on target devices, packaging validation.
@@ -0,0 +1,65 @@
1
+ # Unity UI Toolkit
2
+
3
+ Evidence: current Unity docs confirm USS custom properties use `--name` and `var(--name)` with optional defaults.
4
+
5
+ ## Token mapping
6
+
7
+ Use USS variables/selectors as the semantic token layer:
8
+
9
+ ```css
10
+ :root {
11
+ --semantic-color-action: rgb(0, 116, 202);
12
+ }
13
+ .primary-action { background-color: var(--semantic-color-action); }
14
+ ```
15
+
16
+ Map generated colors/units once. VisualTreeAsset/USS/C# style overrides should consume named classes/variables rather than scattering inline styles.
17
+
18
+ ## Layout and responsive idioms
19
+
20
+ Use UXML hierarchy, flexbox-like layout semantics, percentage/min/max sizing, safe-area/container logic at runtime, aspect-ratio awareness, scaling modes, and device/platform target matrices. Separate HUD overlay, menu screens, world-space UI, and editor UI constraints.
21
+
22
+ ## Typography/custom fonts
23
+
24
+ Configure font assets/TextCore assets and localization glyph coverage deliberately. Verify dynamic text scaling, fallback glyphs, SDf/atlas memory, line breaking, truncation, and expansion. Fixed-size labels are a localization hazard.
25
+
26
+ ## Motion/reduced motion
27
+
28
+ Use UI Toolkit transitions/animation or runtime animation intentionally. Unity lacks one universal cross-platform reduced-motion guarantee; expose accessibility/game setting and map platform capabilities where available. Do not hide critical state behind animation completion.
29
+
30
+ ## Accessibility specifics
31
+
32
+ Focus/navigation behavior depends on runtime/input system/version. Define focus order/navigation explicitly, use real buttons/labels where available, verify controller/keyboard traversal, screen-reader/platform integration honestly, colorblind-safe states, subtitles/captions, remapping, and scalable HUD/text options.
33
+
34
+ ## States idiom
35
+
36
+ Model menu/HUD states explicitly: loading/connecting/error/empty inventory/permission/pause/offline/reconnect/death/respawn/optimistic purchase/cancellation. Runtime gameplay interruption is normal. Preserve navigation focus after modal/popup/scene transitions.
37
+
38
+ ## Forms idiom
39
+
40
+ Game UI forms (login/search/settings/create/loadout) need correct virtual keyboard/platform input integration, validation timing, paste/text entry constraints, focus order, input preservation, and error recovery. Never require cognitive-memory authentication patterns or block manager/paste equivalents where platform permits.
41
+
42
+ ## Do/don't pairs
43
+
44
+ | Do | Don't |
45
+ |---|---|
46
+ | USS semantic custom properties | hard-coded inline colors throughout UXML/C# |
47
+ | explicit focus restore after popup close | focus disappearing into hidden visual element |
48
+ | safe-area/aspect matrix verification | designing only in editor 16:9 preview |
49
+ | real localized/glyph-covered font assets | missing glyph boxes in CJK/Arabic/localized builds |
50
+ | text/icon/shape redundancy for critical state | color-only enemy/ally/rarity coding |
51
+
52
+ ## Known traps
53
+
54
+ Editor-vs-runtime rendering mismatch, USS feature subset differences from browser CSS, atlas/glyph memory cost, focus navigation gaps, input system conflicts, safe-area/device variation, localization expansion clipping, scene unload/lifecycle state loss, certification constraints discovered late.
55
+
56
+ ## Verification commands
57
+
58
+ Run the Unity CLI test runner configured for the repository (do not suppress exit codes with `|| true`):
59
+
60
+ ```sh
61
+ Unity -batchmode -projectPath . -runTests -testPlatform EditMode && \
62
+ Unity -batchmode -projectPath . -runTests -testPlatform PlayMode
63
+ ```
64
+
65
+ Use playmode/device screenshots, UI Builder plus runtime inspection, controller-only navigation, resolution/aspect/safe-area matrix, localization pseudo-text/glyph tests, accessibility settings, and platform validation checklists where available.
@@ -0,0 +1,53 @@
1
+ # Unreal UMG
2
+
3
+ ## Token mapping
4
+
5
+ Use shared styles/brushes/materials/data assets/project style guides where available rather than copying colors/fonts per widget. Map semantic colors/type/spacing into centralized widget styles or design-system wrapper widgets. UMG inheritance/retainer/material behavior must be understood before creating parallel constants.
6
+
7
+ ## Layout and responsive idioms
8
+
9
+ Use panels (`VerticalBox`, `HorizontalBox`, `GridPanel`, `CanvasPanel`, `SizeBox`, `ScaleBox`, `SafeZone`) intentionally. Separate HUD widget, menu screens, world-space widgets, overlays, scaling/resolution behavior, split screen, aspect ratios, safe zones, and platform-specific UI layers.
10
+
11
+ ## Typography/custom fonts
12
+
13
+ Configure font assets/localization/font fallback carefully. Verify glyph coverage/memory, scaling/DPI, line breaking, expansion, and readability at distance. Bitmap/font atlas constraints matter for localized games; do not treat editor English as coverage.
14
+
15
+ ## Motion/reduced motion
16
+
17
+ Use UMG animations/sequencer/material motion intentionally. Provide reduced-motion/flash/camera-motion settings as game accessibility options; platform-level hooks may not cover all gameplay motion. Never hide critical HUD state behind cinematic animation timing.
18
+
19
+ ## Accessibility specifics
20
+
21
+ Use navigation/focus behavior explicitly, controller/keyboard input routing, visible focus state, text scaling/HUD scaling/subtitles/captions/colorblind-safe coding/remapping. Unreal/platform screen-reader support varies; label uncertainty honestly. CommonUI/input routing plugins can help but introduce their own constraints.
22
+
23
+ ## States idiom
24
+
25
+ Model game state and UI lifecycle together: loading/connecting/error/offline/permission/death/respawn/pause/cutscene/inventory-empty/matchmaking/cancelled/purchase-pending. Input mode (game-only/UI-only/game-and-UI) is UX state; mistakes trap input or leak gameplay actions.
26
+
27
+ ## Forms idiom
28
+
29
+ Editable text/widgets need labels/instructions, virtual keyboard/platform integration, validation timing, paste/input constraints, focus navigation, preservation after error/menu interruption, and recovery copy. Account linking/authentication must not force redundant manual entry when platform identity exists.
30
+
31
+ ## Do/don't pairs
32
+
33
+ | Do | Don't |
34
+ |---|---|
35
+ | centralized semantic style assets/wrappers | copying colors/fonts per widget instance |
36
+ | explicit input mode/focus ownership | modal that traps controller input or leaks firing/movement |
37
+ | safe-zone/aspect matrix testing | validating only editor PIE 16:9 window |
38
+ | HUD scaling/subtitle/colorblind options | fixed tiny monochrome HUD treated as hardcore aesthetic |
39
+ | restore focus after popup/menu close | focus lost to hidden/removed widget |
40
+
41
+ ## Known traps
42
+
43
+ Blueprint visual-script sprawl hiding state ownership, input mode mistakes, focus/navigation inconsistency, hard references/memory cost, localized glyph coverage, editor/runtime scaling mismatch, safe-area/platform differences, retainer/material rendering artifacts, certification constraints discovered late.
44
+
45
+ ## Verification commands
46
+
47
+ Run the project's Unreal Automation / UAT build command against the repo `.uproject` without suppressing failures:
48
+
49
+ ```sh
50
+ RunUAT BuildCookRun -project="<PathToProject>.uproject" -build -unattended
51
+ ```
52
+
53
+ Use PIE/device/console-like target screenshots, controller-only navigation, resolution/aspect/safe-zone matrix, localization pseudo-text/glyph checks, accessibility option tests, input-mode/menu interruption flows, automation tests, and current platform certification checklists where applicable.
@@ -0,0 +1,49 @@
1
+ ---
2
+ name: pixelcraft-handoff
3
+ description: Translates approved designs, Figma selections, screenshots, mockups, and design-system artifacts into faithful implementation without losing existing architecture. Use for design-to-code translation, variable-to-token mapping, existing-component reuse, missing-state resolution, cross-stack implementation, ambiguity handling, and visual-fidelity checking with pixelcraft-visual-qa.
4
+ license: MIT
5
+ metadata:
6
+ version: 0.1.0
7
+ ---
8
+
9
+ # Pixelcraft handoff
10
+
11
+ Design handoff is translation under uncertainty, not screenshot copying. Visual source material is evidence about intent; it is not automatically correct production architecture. Preserve existing components, tokens, state behavior, accessibility, localization, data contracts, and framework idioms before visual novelty.
12
+
13
+ **Approved-design rule:** when the user asks to implement an approved design, do not run divergence or change visual direction. Handoff preserves design intent. Divergence applies only to undecided parts such as missing states, missing breakpoints, unspecified behavior, token gaps, accessibility gaps, or regions explicitly labeled inspiration.
14
+
15
+ ## References
16
+
17
+ - Read [references/design-translation.md](references/design-translation.md) for the translation contract, evidence hierarchy, component reuse, token mapping, stack-specific translation, missing states, accessibility preservation, and the visual-qa fidelity loop.
18
+ - Read [references/fidelity-tolerance.md](references/fidelity-tolerance.md) before declaring acceptance tolerance, freezing fixtures, or interpreting visual diffs.
19
+
20
+ ## Required workflow
21
+
22
+ 1. **Establish the contract.** Record provenance/version/frame or asset, approval state, target stack, breakpoint/mode/locale/input, exact scope, deterministic fixture requirements, and region-aware acceptance tolerance.
23
+ 2. **Inspect implementation first.** Inventory existing components/tokens/routes/state/data ownership. Reuse is the default; divergence from architecture must be justified.
24
+ 3. **Gather structured evidence.** Prefer semantic variables, component metadata, variants, constraints, comments, and production mappings over screenshot inference; use screenshots as visual evidence rather than sole truth.
25
+ 4. **Map before generating.** Match elements to existing components, variables, assets, and platform primitives. Resolve missing hover/focus/disabled/loading/empty/error/overflow/localization states or label them assumptions.
26
+ 5. **Translate idiomatically.** Map design variables into semantic project tokens through `pixelcraft-tokens`; implement in the actual target stack rather than copying generated markup or absolute geometry.
27
+ 6. **Verify fidelity.** Hand off rendered evidence to `pixelcraft-visual-qa` for screenshot/crop/overlay/diff comparison within a declared tolerance; repair meaningful divergence and report residual uncertainty.
28
+
29
+ ## Non-negotiable rules
30
+
31
+ | Concern | Rule |
32
+ |---|---|
33
+ | evidence hierarchy | existing production behavior + semantic design metadata outrank generated code guesses; screenshots outrank nothing by themselves. |
34
+ | reuse | do not duplicate an existing component because Figma output emitted literal markup. |
35
+ | architecture | preserve framework conventions, state ownership, accessibility semantics, routing, data loading, and localization. |
36
+ | ambiguity | unknown interaction/state/token meaning is a question or explicit assumption—not silent invention. |
37
+ | fidelity | visual similarity never excuses broken keyboard behavior, contrast, overflow, empty/error/loading states, or content scaling. |
38
+ | privacy/security | do not expose proprietary design files, assets, tokens, or MCP endpoints beyond the intended client/session. |
39
+ | anti-slop | do not flatten design into static absolute positioning, rasterize text, copy placeholder copy, or mimic visual noise without semantic structure. |
40
+
41
+ ## Pre-submit checklist
42
+
43
+ - [ ] exact frame/component/version and target breakpoint/mode are recorded;
44
+ - [ ] existing component/token reuse decisions are documented;
45
+ - [ ] semantic variables/modes map to project tokens or deliberate overrides;
46
+ - [ ] missing hover/focus/disabled/loading/error/empty/overflow states are resolved or labeled assumptions;
47
+ - [ ] implementation uses real data/state behavior rather than static screenshot structure;
48
+ - [ ] rendered output was compared at target sizes using the `pixelcraft-visual-qa` skill where available, with normalized fixture/scale and declared region tolerances;
49
+ - [ ] intentional deviations and residual uncertainty are reported.
@@ -0,0 +1,104 @@
1
+ # Design translation
2
+
3
+ Use this reference when implementing an approved or supplied design: Figma frame/component, exported mockup, screenshot, prototype, existing UI rebuild, or design-system artifact. The task is faithful translation into the project's real architecture—not visual direction generation.
4
+
5
+ ## Authority rule
6
+
7
+ When the user asks to implement an approved design, do **not** run divergence or redesign the visual direction. Preserve layout intent, hierarchy, spacing rhythm, color/type decisions, imagery, and interaction meaning. Divergence applies only to parts the design leaves undecided: missing states, missing breakpoints, unspecified behavior, implementation tokens, accessibility gaps, or places where the source is explicitly marked inspiration rather than specification.
8
+
9
+ Approved visual intent is preserved, but the accessibility floor, platform/legal requirements, existing component/token constraints, data ownership, security/privacy requirements, and architecture are never overridden silently. Resolve tension through existing components and platform idioms first. If faithful implementation genuinely requires an exception, record the conflict and obtain an explicit user override. Report intentional deviations; never silently “improve” the design.
10
+
11
+ ## 1. Establish the translation contract
12
+
13
+ Record before coding:
14
+
15
+ - exact source provenance: file/link/version/frame/component/node or screenshot asset, date, owner, and approval state;
16
+ - target platform/framework/runtime and existing route/component ownership;
17
+ - breakpoint, orientation, density, theme/mode, locale/text direction, input modality;
18
+ - whether each source region is specification, inspiration, or out of scope;
19
+ - required states/data fixtures and acceptance tolerance;
20
+ - whether visual-qa rendering is available in the environment.
21
+
22
+ Do not treat an entire page capture as a precise component contract when only one region was approved.
23
+
24
+ ## 2. Inventory implementation before generation
25
+
26
+ Reuse is the default. Build a mapping table before writing UI:
27
+
28
+ | Design element | Existing equivalent | Translation decision |
29
+ |---|---|---|
30
+ | exact semantic component | production component exists | reuse; map props/variants/slots |
31
+ | near match | existing component missing state/variant | extend the existing API without breaking consumers |
32
+ | repeated structure | no component but recurrence is real | propose a primitive consistent with project taxonomy |
33
+ | one-off visual artifact | no reusable meaning | implement locally and contain the exception |
34
+ | raster/text/effect | platform support uncertain | choose semantic text/SVG/canvas/image deliberately |
35
+
36
+ Use layer metadata, Auto Layout/constraints, design variables, component variants, and screenshots as evidence. Generated code from a design tool is a hint, not architecture. Never flatten a screen into absolute positioning, rasterize text, duplicate an existing component, or copy placeholder content.
37
+
38
+ ## 3. Map design variables to project tokens
39
+
40
+ Translate variables/styles through the `pixelcraft-tokens` skill rather than copying leaf values:
41
+
42
+ 1. exact semantic token exists → use it;
43
+ 2. primitive exists but semantic intent differs → choose or add the correct semantic role;
44
+ 3. alias/mode exists → preserve alias and mode behavior instead of flattening values;
45
+ 4. duplicate/near duplicate caused by design drift → flag and reconcile;
46
+ 5. optical exception is repeatable → document/encode intentionally;
47
+ 6. genuinely new scale step → extend the scale with provenance.
48
+
49
+ Capture collections/modes such as light/dark/brand/density/locale as explicit theme axes. Validate contrast and component states in every required mode. Do not create hundreds of one-off tokens for noise.
50
+
51
+ ## 4. Translate to the actual stack
52
+
53
+ Preserve the target platform's architecture and idioms:
54
+
55
+ | Stack | Translation posture |
56
+ |---|---|
57
+ | React/Next/Solid/Qwik | compose existing components/hooks; preserve state ownership, server/client boundaries, routing, accessibility semantics, and CSS architecture |
58
+ | Vue/Nuxt | map props/slots/composables and template structure; preserve reactivity ownership rather than copying DOM literalism |
59
+ | Svelte/Angular/Lit/server-rendered web | use framework-native component contracts, control flow, form behavior, hydration boundaries, and CSS scoping |
60
+ | Flutter | translate layout intent into widget composition/constraints, ThemeData/tokens, MediaQuery/size classes, semantic widgets, and immutable state flow |
61
+ | SwiftUI/UIKit | use view composition/modifiers or existing view controllers, Dynamic Type, safe areas, trait/size classes, environment/theme propagation |
62
+ | Jetpack Compose/Multiplatform | use composables/slots/Modifier chains, Material or project theme tokens, density/insets, state hoisting, semantics |
63
+ | React Native/Expo | preserve native navigation/gesture expectations, StyleSheet/theme tokens, safe areas, platform splitting only when justified |
64
+ | TUI/email/document/game/constrained | translate visual meaning into the medium's constraints; never pretend DOM/CSS capabilities exist |
65
+
66
+ Responsive behavior must be inferred from constraints and breakpoint evidence, not guessed from one desktop capture. If missing, implement the smallest defensible adaptation and label it an assumption.
67
+
68
+ ## 5. Resolve missing states before delivery
69
+
70
+ The design is incomplete until these are resolved or explicitly assigned as assumptions:
71
+
72
+ - hover/focus/active/disabled/selected/pressed/visited;
73
+ - loading/skeleton/optimistic/error/empty/offline/permission;
74
+ - zero/one/many/long/overflowing data and missing media/fonts;
75
+ - validation, destructive confirmation, undo/cancel/escape;
76
+ - narrow/wide/resize/orientation/split-screen behavior;
77
+ - keyboard/screen reader/touch/controller/pointer input;
78
+ - localization expansion, bidi text, numerals, plural/date/currency boundaries;
79
+ - dark/light/high-contrast/reduced-motion/forced-colors modes.
80
+
81
+ Preserve architecture: state ownership, data loading, caching, mutation, routing, focus management, error recovery, and security/privacy constraints take precedence over screenshot literalism.
82
+
83
+ ## 6. Accessibility and content fidelity
84
+
85
+ Visual fidelity never excuses broken semantics. Preserve accessible names, roles, labels, keyboard order, focus visibility, contrast, target size, text scaling/reflow, reduced motion, screen-reader announcements, input types/autocomplete, and platform-specific accessibility idioms. Copy must come from approved content or existing product truth; design placeholder text is not production copy unless the owner explicitly says so.
86
+
87
+ ## 7. Fidelity loop with `pixelcraft-visual-qa`
88
+
89
+ Declare tolerance before comparing. Use the `pixelcraft-visual-qa` skill for the render → screenshot → crop/overlay/diff → repair loop:
90
+
91
+ 1. capture/reference the approved design at the same breakpoint, scale, mode, locale, and data state;
92
+ 2. render implementation with real fonts/assets/state;
93
+ 3. align viewport/device scale and capture region exactly;
94
+ 4. compare full frame plus meaningful crops;
95
+ 5. inspect overlay/difference heatmap and structural evidence—never rely on one global pixel score;
96
+ 6. classify divergence as layout geometry, typography/rasterization, color/theme, asset rendering, dynamic content, state mismatch, accessibility regression, or intentional deviation;
97
+ 7. repair semantic/accessibility defects before pixel geometry;
98
+ 8. rerun only changed comparisons.
99
+
100
+ Antialiasing, font shaping, platform rendering, and dynamic content make exact byte equality inappropriate. Use the region-aware tolerance schema, hard-failure rules, normalization requirements, and deterministic fixture contract in `references/fidelity-tolerance.md`. Record tolerances before inspecting the diff.
101
+
102
+ ## Acceptance report
103
+
104
+ Report: source/version/frame/mode/breakpoint; classification of specification versus inspiration; reused versus new components; token substitutions/exceptions; missing-state assumptions; rendered comparison evidence and tolerance; intentional deviations; and remaining `not-checked` surfaces.
@@ -0,0 +1,78 @@
1
+ # Fidelity tolerance schema
2
+
3
+ Use this reference before comparing an implementation with an approved design. Declare tolerances before looking at the diff; otherwise every difference becomes either noise or a taste argument.
4
+
5
+ ## Compare only normalized inputs
6
+
7
+ Before measurement:
8
+
9
+ - same source version/frame/component and approval state;
10
+ - same breakpoint/orientation/density/theme/mode/locale/direction;
11
+ - same viewport dimensions and device scale factor;
12
+ - same data fixture and time-dependent state;
13
+ - same fonts/assets or explicitly documented substitutions;
14
+ - same scroll position and capture crop;
15
+ - animations frozen at a deterministic state or replaced by reduced/static equivalents.
16
+
17
+ If these cannot be matched, label the comparison partial rather than inflating tolerance until nothing can fail.
18
+
19
+ ## Region classes
20
+
21
+ Assign each visual region a class before diffing:
22
+
23
+ | Class | Examples | Comparison posture |
24
+ |---|---|---|
25
+ | critical geometry | navigation shell, form controls, primary content boundaries, touch targets, focus rings | strict offset/size/clipping checks |
26
+ | text and typography | headings, body copy, labels, numerals | font/shaping/measurement comparison; exact pixels not required across rasterizers |
27
+ | color/theme | semantic surfaces, accents, state colors, focus/selection | compare sampled role values and contrast behavior, not isolated pixels |
28
+ | asset/media | icons, illustrations, product imagery | compare placement/crop/aspect/provenance; dynamic compression noise may be tolerated |
29
+ | dynamic content | timestamps, avatars, random ordering, ads, live data, localization expansions | freeze fixture or mark exempt with reason |
30
+ | decorative noise | grain, shadows, shader texture, motion blur | compare presence/intent; broad tolerance unless it harms legibility |
31
+ | platform chrome | scrollbars, status bars, native picker chrome, window controls | normalize/exclude unless product controls it |
32
+
33
+ ## Tolerance record
34
+
35
+ ```markdown
36
+ | Region | Class | Max x/y offset | Max size delta | Color/alpha tolerance | Clipping/overlap | Contrast/state rule | Exemptions |
37
+ |---|---|---:|---:|---:|---|---|---|
38
+ | header nav | critical geometry | 1px | 1px | semantic exact or documented rounding | none allowed | focus visible; no overlap | none |
39
+ | hero illustration | asset/media | 2px | 2% | perceptual/asset compression | crop must match intent | no text contrast loss | compression noise |
40
+ ```
41
+
42
+ Use measurements appropriate to the surface: CSS px, dp/pt/sp, terminal cells, print units, texture coordinates, or physical-window pixels. State the unit. Do not copy web pixel tolerances into native/print/game contexts.
43
+
44
+ ## Hard failures independent of tolerance
45
+
46
+ Tolerance never excuses:
47
+
48
+ - clipped/truncated essential text or control labels;
49
+ - invisible/obscured focus or missing keyboard/controller path;
50
+ - contrast/state failure, color-only meaning, or wrong semantic exposure;
51
+ - control overlap, accidental horizontal scrolling, unsafe-area/system-chrome collision;
52
+ - missing required state, mode, locale, breakpoint, or input modality;
53
+ - wrong content/provenance, invented assets, or placeholder copy presented as final;
54
+ - broken layout constraints hidden by scaling/cropping the capture;
55
+ - intentional deviation that was never recorded/approved.
56
+
57
+ ## Diff interpretation procedure
58
+
59
+ 1. normalize scale/viewport/fixture;
60
+ 2. compare full-frame geometry first, then high-value crops;
61
+ 3. inspect alignment edges and clipping boundaries before aggregate color difference;
62
+ 4. classify every meaningful difference by cause: layout geometry, typography/rasterization, color/theme, asset rendering, dynamic content, state mismatch, accessibility regression, platform idiomatic adaptation, or intentional deviation;
63
+ 5. repair semantic/accessibility/state defects before pixel geometry;
64
+ 6. rerun only affected comparisons and preserve artifacts/version metadata.
65
+
66
+ A low pixel difference is not fidelity if behavior or meaning changed. A high pixel difference is not automatically failure if fonts rasterize differently or a deliberate platform adaptation was approved.
67
+
68
+ ## Deterministic fixture requirements
69
+
70
+ For repeatable handoff verification, maintain fixture descriptions in the project where feasible:
71
+
72
+ ```markdown
73
+ | Fixture | Data/time/locale/theme/viewport/network/input | Expected end state |
74
+ |---|---|---|
75
+ | checkout-error | expired card fixture; frozen timestamp; en-LTR; light; 390×844; offline then online; keyboard/touch | preserved inputs, field error, summary focus, retry enabled |
76
+ ```
77
+
78
+ Freeze clocks, random seeds, ordering, feature flags, permissions, network responses, and user state where the stack permits. Use synthetic/redacted data. A fixture that cannot be reproduced by another agent is documentation, not a deterministic verification fixture.
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: pixelcraft-media
3
+ description: Designs and verifies social cards, Open Graph/Twitter images, repository banners, SVG posters, video frames, and motion graphics for external platforms. Use for OG/social preview generation, 1200×630 cards, GitHub 1280×640 social previews, 16:9/9:16/1:1 media, platform safe zones, thumbnail legibility, Satori/@vercel/og/ImageResponse constraints, SVG banners, Remotion or Motion Canvas video, caching/export behavior, and media-specific accessibility/truthfulness review.
4
+ license: MIT
5
+ metadata:
6
+ version: 0.1.0
7
+ ---
8
+
9
+ # Pixelcraft media
10
+
11
+ Media assets are constrained interfaces viewed outside your product. Platform cropping, compression, overlay UI, dark/light contexts, feed scale, caching, and screen density are part of the design. A beautiful full-size export that is illegible as a thumbnail is failed media.
12
+
13
+ ## Surface craft
14
+
15
+ Design the focal subject and minimum readable message for the smallest real crop, then place secondary text inside a measured safe zone. Inspect platform recompression, dark/light surroundings and the static first frame/poster. Never promise thumbnail legibility from the full-size canvas.
16
+
17
+ ## References
18
+
19
+ - Read [references/social-cards.md](references/social-cards.md) for OG/platform dimensions, safe areas, crop behavior, thumbnail legibility, metadata, caching, and validation.
20
+ - Read [references/og-generation.md](references/og-generation.md) for Satori, `@vercel/og`, and Next.js `ImageResponse` constraints, font loading, supported CSS, bundle limits, and implementation patterns.
21
+ - Read [references/banners-video.md](references/banners-video.md) for SVG banners/posters, Remotion, Motion Canvas, aspect-ratio variants, captions, motion, and export verification.
22
+
23
+ ## Required workflow
24
+
25
+ 1. **Define placement.** Identify exact platforms/clients, card type, feed context, static or animated media, localization, accessibility/caption requirements, cache/update cadence, and whether clicks are expected.
26
+ 2. **Choose frame and safe area.** Start from the platform table; preserve critical content inside conservative central regions. Never assume one crop fits every client.
27
+ 3. **Reduce the message.** Use the minimum truthful content: product/name, one concrete promise or artifact, recognizable visual evidence. Remove anything unreadable at thumbnail scale.
28
+ 4. **Implement with renderer constraints.** Static SVG/PNG generation, browser capture, Satori/ImageResponse, Remotion, or Motion Canvas each impose different layout/font/security limits.
29
+ 5. **Verify in context.** Inspect at actual pixel size, scaled thumbnail, dark/light embed context, compression, crop variants, screen reader/alt metadata where applicable, and platform preview/debugger when available.
30
+
31
+ ## Non-negotiable rules
32
+
33
+ | Concern | Rule |
34
+ |---|---|
35
+ | truthfulness | No invented user counts, screenshots, awards, logos, testimonials, benchmarks, or product capabilities. |
36
+ | legibility | Text must survive thumbnail scale and platform compression; if a detail cannot be read, remove or enlarge it. |
37
+ | safe area | Essential text/logos never touch edges or platform overlay/crop zones. |
38
+ | renderer truth | Do not use unsupported CSS/font/asset behavior because browser JSX looks similar. Validate the actual renderer/version. |
39
+ | accessibility | Provide meaningful alt text/link context where platforms support it; video needs captions/subtitles and must not autoplay sound by default. |
40
+ | cache awareness | Social platforms cache aggressively. Use validation/cache-busting/deployment sequencing consciously. |
41
+ | anti-slop | Avoid purple-blue gradients, floating browser chrome mockups, generic rocket/sparkle art, unreadable code screenshots, and badge clutter unrelated to the subject. |
42
+
43
+ ## Pre-submit checklist
44
+
45
+ - [ ] target platforms/card types/frame ratios/safe zones are explicit;
46
+ - [ ] core message is readable at actual thumbnail size;
47
+ - [ ] text contrast is checked against real background/compression;
48
+ - [ ] fonts are licensed/embedded/loaded in the format required by the renderer;
49
+ - [ ] generated image/video dimensions, file type, and file size match the target;
50
+ - [ ] absolute metadata URLs and cache behavior are correct;
51
+ - [ ] alt/caption/accessibility path exists where the platform supports it;
52
+ - [ ] final evidence states which platform previews were actually inspected versus `not-checked`.
@@ -0,0 +1,112 @@
1
+ # SVG banners and motion media
2
+
3
+ Vector banners and video frames share one problem: they are consumed through crops, scaling, compression, and platform UI outside the author's control. Build from real content and validate 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
+ - use a correct `viewBox` and explicit width/height/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 ship/export with licensed font assets;
14
+ - verify text wrapping yourself—ordinary SVG text does not flow like HTML;
15
+ - avoid external images/fonts/scripts in untrusted or crawler-facing SVG; SVG can carry active content depending on serving context;
16
+ - sanitize user-controlled SVG before serving it;
17
+ - simplify paths enough for file size but preserve sharp edges at target scale;
18
+ - test light/dark embedding contexts; transparent art can disappear or halo.
19
+
20
+ For repository banners/docs, export PNG/WebP fallbacks where inline SVG is not supported. Preserve the source SVG and exact export preset.
21
+
22
+ ## Aspect-ratio variants
23
+
24
+ Design a system, not one cropped master:
25
+
26
+ | Ratio | Typical frame | Role |
27
+ |---|---:|---|
28
+ | 16:9 | 1920×1080 or 1280×720 | presentation, landscape video, docs |
29
+ | 1:1 | 1080×1080 | square feed/embed |
30
+ | 9:16 | 1080×1920 | story/short vertical video |
31
+ | 2:1 | 1280×640 | GitHub social-preview baseline |
32
+
33
+ Recompose hierarchy for each ratio: square favors centered single-anchor compositions; vertical needs stacked hierarchy and platform-overlay awareness; landscape supports lateral sequencing. Do not blindly center-crop every frame.
34
+
35
+ ## Remotion
36
+
37
+ Remotion renders videos from React components using frames and composition metadata. Core shape:
38
+
39
+ ```jsx
40
+ import { Composition } from 'remotion';
41
+
42
+ export const Root = () => (
43
+ <Composition
44
+ id="LaunchCard"
45
+ component={LaunchCard}
46
+ durationInFrames={150}
47
+ fps={30}
48
+ width={1920}
49
+ height={1080}
50
+ defaultProps={{ title: 'Pixelcraft' }}
51
+ />
52
+ );
53
+ ```
54
+
55
+ Inside a component use hooks/utilities such as `useCurrentFrame()`, `useVideoConfig()`, `spring()`, `interpolate()`, `Sequence`, `Img`, `Audio`, `Video`/`OffthreadVideo`, and `staticFile()` according to the installed version. Render locally/CI through the documented CLI or `renderMedia()` programmatic API.
56
+
57
+ Rules:
58
+
59
+ - derive every visual state deterministically from frame/config/props;
60
+ - pin `fps`, duration, dimensions, and output codec/container;
61
+ - use `calculateMetadata` when dimensions/duration depend on props/data;
62
+ - avoid browser-only APIs/random time/network state unless explicitly controlled;
63
+ - preload or bundle fonts/assets; do not depend on unstable remote media;
64
+ - test audio sync, dropped frames, alpha/transparent output, color space, and render concurrency;
65
+ - keep captions as timed data rather than burned-in decoration only; supply caption files where platform supports them.
66
+
67
+ ## Motion Canvas
68
+
69
+ Motion Canvas uses generator-based TypeScript scenes and a visual editor/player model. Typical scene style:
70
+
71
+ ```tsx
72
+ import { makeScene2D, Rect, Txt } from '@motion-canvas/2d';
73
+ import { all, createRef, waitFor } from '@motion-canvas/core';
74
+
75
+ export default makeScene2D(function* (view) {
76
+ const title = createRef<Txt>();
77
+ view.add(<Txt ref={title} fill="white" fontSize={96}>Pixelcraft</Txt>);
78
+ yield* title().opacity(1, 0.5);
79
+ yield* waitFor(1);
80
+ });
81
+ ```
82
+
83
+ Exact imports/animation helpers depend on version. Rules:
84
+
85
+ - use signals/layout references rather than visual guesses for alignment;
86
+ - treat project settings (resolution/framerate/duration) as the artifact contract;
87
+ - verify fonts in both editor preview and final render;
88
+ - test deterministic output by rerendering the same revision;
89
+ - use motion to establish object constancy or sequence—not constant floating decoration.
90
+
91
+ ## Captions, sound, and accessibility
92
+
93
+ - never rely on sound for essential meaning;
94
+ - provide captions/subtitles where the platform supports them; burned-in text must remain inside safe zones;
95
+ - avoid flashing/strobing content and rapid full-screen luminance changes;
96
+ - preserve color-independent meaning and sufficient contrast;
97
+ - provide meaningful title/alt/context where the host platform supports it;
98
+ - respect reduced-motion expectations in embeds and avoid autoplay sound.
99
+
100
+ ## Export verification
101
+
102
+ - inspect exact dimensions/frame rate/duration/codec/container/file size/audio sample rate;
103
+ - inspect first/middle/last frames and motion-critical transitions;
104
+ - test on device/feed scale and in light/dark contexts;
105
+ - validate transparency/background behavior;
106
+ - compare audio loudness/sync when audio exists;
107
+ - test compression artifacts in the target platform or label platform verification `not-checked`;
108
+ - keep deterministic seeds/settings and source assets under version control where licensing permits.
109
+
110
+ ## Anti-slop warnings
111
+
112
+ Reject endless floating gradients, fake product UI flying in depth without purpose, particles/sparkles replacing content, unreadable kinetic typography, cinematic trailers for mundane documentation updates, and logo animations with no information value. Motion should answer: what changed, where did it come from, what should the viewer understand next?