@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,55 @@
1
+ # Mobile tactile interactions, sheets, and gestures
2
+
3
+ Use this reference alongside the target mobile framework guide (`swiftui.md`, `uikit.md`, `jetpack-compose.md`, `flutter.md`, `react-native-expo.md`, `lynxjs.md`) for high-craft touch ergonomics, bottom sheets, gestures, haptics, offline queues, and Dynamic Type/`sp` resilience.
4
+
5
+ ## Bottom sheet detents & cross-framework idioms
6
+
7
+ | Concern | Concrete rule |
8
+ |---|---|
9
+ | **Detents** | Define explicit resting heights (`medium`/`peek`, `large`, or content-fit) rather than arbitrary pixel stops; dismiss smoothly on downward velocity fling, backdrop tap, or Escape/Back. |
10
+ | **Scroll handover** | When a sheet wraps a scrollable list, upward drags scroll content once at the top detent, and downward drags at `scrollOffset == 0` hand control back to the sheet without stutter or double-scrolling. |
11
+ | **Keyboard & safe areas** | Pair scroll-coupled interactive keyboard dismissal with soft-keyboard inset tracking so sheet inputs and primary submit actions stay visible above the IME and home indicator / gesture bar. |
12
+ | **Velocity handover (`panVelocity`)** | Spring animations completing a sheet fling, card swipe, or detent snap **must** inherit the finger's release velocity (`initialVelocity` / `panVelocity`)—never restart from zero velocity on finger lift. |
13
+ | **Accessibility** | Always expose a visible Close/Done button (and screen-reader escape gesture) so users who cannot drag are never trapped inside a modal sheet. |
14
+
15
+ | Framework | Sheet & interactive keyboard primitive | Velocity handover & detent idiom |
16
+ |---|---|---|
17
+ | **SwiftUI** | `.sheet(isPresented:)` + `.scrollDismissesKeyboard(.interactively)` | `.presentationDetents([.medium, .large])`, `.presentationDragIndicator(.visible)`, `Spring(duration: 0.35, bounce: 0.1)` seeded with gesture velocity |
18
+ | **UIKit** | `UISheetPresentationController` + `scrollView.keyboardDismissMode = .interactive` | `detents = [.medium(), .large()]`, `UISpringTimingParameters(dampingRatio: 0.85, initialVelocity: velocityVector)` |
19
+ | **Jetpack Compose** | `ModalBottomSheet` + `WindowInsetsAnimationCompat` / `Modifier.imeNestedScroll()` | `rememberModalBottomSheetState()`, `Animatable.animateTo(target, spring(), initialVelocity = panVelocity)` |
20
+ | **Flutter** | `showModalBottomSheet` / `showCupertinoSheet` + `ScrollViewKeyboardDismissBehavior.onDrag` | `SpringSimulation(springDesc, currentPos, targetPos, panVelocity)` via `AnimationController.animateWith` |
21
+ | **React Native / Expo** | `@gorhom/bottom-sheet` + `keyboardDismissMode="interactive"` + `react-native-keyboard-controller` | Reanimated 4 `withSpring(target, { velocity: event.velocityY, damping: 22, stiffness: 240 })` on UI thread |
22
+ | **LynxJS** | Custom sheet `<view>` driven by MTS | Handle `main-thread:bindtouchmove` / `touchend` spring physics with release velocity on main thread; sync state via `runOnBackground` |
23
+
24
+ ## Performance physics: cold start, `120fps` ProMotion, memory leaks & energy
25
+
26
+ - **Cold start & install-size ceiling**: target **`< 800 ms–1.2 s`** (hard ceiling `< 2.0 s` TTID) on mid-tier hardware via Android **Baseline Profiles** (`androidx.profileinstaller`), lazy TurboModules, and deferred analytics/attribution SDK boot; enforce an agreed **install-size ceiling** (e.g., **`<= 50–80 MB`** store download via App Thinning, Android App Bundles `.aab`, and asset stripping).
27
+ - **`120fps` ProMotion & high-refresh parity**: unlock `120 Hz` animations on iOS by setting `<key>CADisableMinimumFrameDurationOnPhone</key><true/>` in `Info.plist`, and keep all scroll, sheet, shared-element, and keyboard-tracking animations strictly on the native UI/Render/Impeller thread (`< 8.33 ms` frame budget)—never couple scroll or pan frames to JS-bridge round-trips or main-thread JSON parsing.
28
+ - **20–30× flow repetition memory-leak & energy checks**: repeat the primary navigation/creation/sheet/camera flow **20–30× consecutively** under **`LeakCanary`** (Android) and **Xcode `Instruments` Allocations/Leaks** (iOS) verifying flat steady-state heap with zero retained `Activity`/`Fragment`/`UIViewController` leaks; verify **Xcode Energy Impact** and **Android Battery Historian / Studio Energy Profiler** show zero runaway wake locks, GPS polling, or background timer drain.
29
+
30
+ ## Thumb-zone ergonomics, gesture safety & cross-platform split
31
+
32
+ - Place high-frequency navigation and primary commitment actions in the lower reachable third on tall phones, reserving top bars for orientation, back navigation, and secondary overflow actions.
33
+ - Keep touch targets ≥ `44×44 pt` (iOS) / `48×48 dp` (Android) with **`>= 8 pt/dp` minimum spacing** between destructive actions and safe sibling controls, and always provide an **explicit visible `Close` button on bottom sheets**.
34
+ - **Zero custom horizontal swipe gestures inside OS back-gesture edge zones** (iOS left-edge swipe back, Android left+right predictive back edge gutters); inset horizontal carousels/sliders or provide explicit Previous/Next buttons.
35
+ - **Documented shared-vs-platform-native UI split**: on cross-platform stacks (Flutter, React Native/Expo, Kotlin Multiplatform, `.NET MAUI`), explicitly document which surfaces share cross-platform UI and which render platform-native chrome (navigation bars, sheets, pickers, share/auth dialogs, haptics, Live Activities/Widgets) so neither OS feels like a foreign port.
36
+
37
+ ## 4-tier contextual haptics (restraint over noise)
38
+
39
+ Trigger haptics strictly across four semantic tiers—**never** buzz on routine button taps, tab switches, or list scrolling:
40
+
41
+ | Tier & moment | SwiftUI | Jetpack Compose | Flutter | React Native / Expo | LynxJS |
42
+ |---|---|---|---|---|---|
43
+ | **1. Light selection tick** (wheel, scrub, detent snap) | `.sensoryFeedback(.selection, trigger:)` | `performHapticFeedback(HapticFeedbackConstants.SEGMENT_TICK)` | `HapticFeedback.selectionClick()` | `Haptics.selectionAsync()` (`expo-haptics`) | Host native selection tick at threshold |
44
+ | **2. Crisp state toggle** (switch flip, pin/lock, long-press) | `.sensoryFeedback(.impact(weight: .light), trigger:)` | `HapticFeedbackConstants.CLOCK_TICK` / `CONTEXT_CLICK` | `HapticFeedback.lightImpact()` | `Haptics.impactAsync(ImpactFeedbackStyle.Light)` | Host native light impact via MTS |
45
+ | **3. Success confirmation** (payment settled, check-in done) | `.sensoryFeedback(.success, trigger:)` | `HapticFeedbackConstants.CONFIRM` | `HapticFeedback.mediumImpact()` | `Haptics.notificationAsync(NotificationFeedbackType.Success)` | Host native confirm notification |
46
+ | **4. Warning / error double-tap** (invalid code, hard limit, failed scan) | `.sensoryFeedback(.warning / .error, trigger:)` | `HapticFeedbackConstants.REJECT` | `HapticFeedback.vibrate()` / distinct double `heavyImpact()` | `Haptics.notificationAsync(NotificationFeedbackType.Warning / Error)` | Host native reject double-pulse |
47
+
48
+ Honor system haptic and reduced-motion preferences; degrade silently on hardware without a linear resonant actuator, and never use haptics as the sole confirmation without visible/accessible feedback.
49
+
50
+ ## Swipe-to-act, OS process-death, rollout gates & 3-tier device deliverables
51
+
52
+ - Every swipe action on a list row (archive, pin, delete) must also be reachable via row detail, context menu, or accessibility custom actions (SwiftUI `.accessibilityAction(named:)`, Compose `CustomAccessibilityAction`, Flutter `Semantics(customSemanticsActions:)`, RN `accessibilityActions`), paired with an immediate `Undo` snackbar above the home indicator / tab bar.
53
+ - **Survive OS background process death**: mobile OSes routinely evict backgrounded apps under camera/game RAM pressure. Test explicitly with `adb shell am kill <package>` (while backgrounded) and Xcode background termination—restoring route stack, selected entity IDs, scroll context, and dirty form drafts via `SavedStateHandle` + `rememberSaveable`, `@SceneStorage` / SwiftData, `NSUserActivity`, `RestorationMixin`, or persisted router state.
54
+ - **Offline queue, crash-free bar & staged rollout / force-update gate**: persist queued offline writes with visible `Pending sync` + retry/conflict UI; maintain **`>= 99.5%` crash-free sessions** and **`0` ANRs** backed by automated CI uploads of iOS **dSYMs** and Android **R8/ProGuard mappings + NDK symbols**; ship **staged store rollouts** (`1% → 5% → 20% → 100%`) plus a server-driven **force-update / minimum-supported-version gate** so breaking API migrations fail safely with an upgrade prompt rather than crashing older binaries.
55
+ - **3-tier real-device matrix & required deliverables**: verify at default and **`200%` (`AX3+`)** font scales across **(iOS)** `compact 4.7–5.4"` + `standard` + `Pro Max/Plus` and **(Android)** `low-RAM 3–4 GB` + `mid-tier` + `flagship` (spanning Pixel + Samsung One UI + Xiaomi/OPPO OEM skins) across **both oldest and newest supported OS versions**, delivering frame/startup/memory/energy profiler traces, install-size report, crash-free symbolication proof, and **VoiceOver + TalkBack** screen-reader walkthrough recordings (`rendered`).
@@ -0,0 +1,85 @@
1
+ # Task-state composition on mobile
2
+
3
+ When an activity carries the screen's identity (workout timer, audio/video recorder, delivery tracker, transit ride, focus session, voice memo), keep **one persistent task-bearing object** recognizable across **setup → active → complete** rather than swapping disconnected ornamental cards at each step.
4
+
5
+ ## Stage progression around one task object
6
+
7
+ | Stage | Persistent object behavior | Controls & hierarchy |
8
+ |---|---|---|
9
+ | **Setup** | Preview the live subject (camera frame, configured duration, selected route, draft waveform) at primary scale. | Limit setup to the 1–3 choices required to start; tuck advanced parameters into a sheet. Put the primary Start control in the lower thumb zone. |
10
+ | **Active** | Keep the same object anchored and legible at a glance; numeric state (elapsed/remaining time, recording indicator, distance, upload progress) must stay readable without relying on animation or illustration. | Swap setup controls for in-flight actions only (Pause/Resume, Lap/Marker, Stop). Guard destructive Discard/Cancel behind a confirmation or hold/slide gesture. |
11
+ | **Complete** | Show the finished artifact or summary in the same visual anchor before secondary rewards. | Put the next meaningful action (Save, Share, Export, Start Next) first. Never trap the user behind a mandatory celebration modal, rating prompt, or upsell before reaching their result. |
12
+
13
+ For live-capture tools (camera, audio, scanner), keep active capture controls and recording status in one-handed reach during capture; reveal the full editing toolset only after capture completes.
14
+
15
+ ## Persistent OS surfaces: Live Activities & Live Updates
16
+
17
+ Long-running tasks leave the foreground constantly. Mirror live state onto OS lock-screen and status surfaces instead of forcing users to unlock and reopen the app:
18
+
19
+ - **iOS Live Activities & Dynamic Island (`ActivityKit`)**: define `ActivityAttributes` (static metadata) and `ContentState` (dynamic state), update via `Activity.update(_:)` with an explicit `staleDate` so expired timers/ETAs visibly mark themselves stale rather than showing frozen lies, and end cleanly with `.immediate` or `.after(Date)` dismissal policy. Provide compact leading/trailing, minimal, expanded, and Lock Screen layouts with text equivalents for VoiceOver.
20
+
21
+ ```swift
22
+ import ActivityKit
23
+
24
+ struct SessionAttributes: ActivityAttributes {
25
+ public struct ContentState: Codable, Hashable {
26
+ var endDate: Date
27
+ var isPaused: Bool
28
+ }
29
+ var label: String
30
+ }
31
+
32
+ let content = ActivityContent(
33
+ state: .init(endDate: targetEnd, isPaused: false),
34
+ staleDate: targetEnd.addingTimeInterval(60)
35
+ )
36
+ let activity = try Activity.request(attributes: .init(label: "Focus"), content: content)
37
+ ```
38
+
39
+ - **Android Foreground Service & Android 16 Live Updates**: run ongoing user-initiated work in a declared `foregroundServiceType` (`microphone`, `location`, `mediaPlayback`, `dataSync`, etc.) with a persistent notification carrying a Pause/Stop `PendingIntent`. On Android 16 (API 36+), use progress-centric **Live Updates** (`Notification.ProgressStyle` + `setRequestPromotedOngoing(true)` with `POST_PROMOTED_NOTIFICATIONS`) for time-bounded user-tracked journeys (rides, deliveries, timers) so progress stays visible on the lock screen and status chip.
40
+
41
+ ```kotlin
42
+ val style = Notification.ProgressStyle()
43
+ .setProgress(elapsedMinutes)
44
+ .setProgressSegments(listOf(Notification.ProgressStyle.Segment(totalMinutes)))
45
+
46
+ val notification = Notification.Builder(context, CHANNEL_ACTIVE_TASK)
47
+ .setSmallIcon(R.drawable.ic_timer)
48
+ .setContentTitle("Focus session")
49
+ .setOngoing(true)
50
+ .setStyle(style)
51
+ .build()
52
+ ```
53
+
54
+ ## Wake-lock & interruption resumption
55
+
56
+ Interruption (phone call, OS memory kill, screen lock, audio route change, switching apps) is normal mobile behavior—not an edge case:
57
+
58
+ - **Persist timestamps, not tick counters**: record monotonic or wall-clock start/pause checkpoints (`SystemClock.elapsedRealtime()` + persisted epoch) and draft media chunks to storage on every state transition. Recompute remaining time on resume so backgrounding or process death never drifts or resets progress.
59
+ - **Scope wake-locks tightly**: acquire `UIApplication.shared.isIdleTimerDisabled = true` (iOS) or `WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON` / timeout-bounded `PowerManager.WakeLock` (Android) only while active foreground monitoring requires it, and always release on pause, completion, or `onStop`.
60
+ - **Idempotent stop & save**: guard Stop/Complete handlers against double-taps, notification action + in-app button races, and background audio interruptions; auto-save partial recordings rather than discarding them on incoming calls.
61
+
62
+ ## One-handed reach & ergonomics
63
+
64
+ - Anchor Start, Pause/Resume, and Stop inside the lower reachable third above the home indicator / gesture bar (`safeAreaInset` / `navigationBarsPadding`).
65
+ - Separate destructive actions (`Discard`) from primary actions (`Pause` / `Done`) by at least `8 pt/dp` or move `Discard` into a confirmation dialog / secondary corner.
66
+ - Keep touch targets ≥ `44×44 pt` (iOS) / `48×48 dp` (Android) even when a timer or waveform shrinks at `200%` text scaling.
67
+
68
+ ## Do/don't pairs
69
+
70
+ | Do | Don't |
71
+ |---|---|
72
+ | Keep one recognizable task object anchored across setup, active, and complete stages | Replace the whole screen with unrelated decorative cards on every state change |
73
+ | Show textual + numeric state (`Recording 02:14`) alongside visual indicators | Rely solely on a pulsing red dot or animated waveform to signal active capture |
74
+ | Persist start checkpoints and draft buffers so process death resumes cleanly | Keep timer/recording state only in view-local `@State` / `remember` |
75
+ | Set `staleDate` on Live Activities and clear foreground notifications on finish | Leave orphaned "2 min left" Lock Screen widgets running hours after completion |
76
+ | Put Save/Share/Next ahead of badges or upsells on completion | Block access to the user's finished recording behind a celebratory paywall modal |
77
+
78
+ ## Verification checks
79
+
80
+ Test on a real device or simulator (`rendered`; mark unavailable hardware checks `not-checked`—App Store/Play Store screenshots never verify interruption, focus, or motion):
81
+
82
+ 1. Complete setup → active → pause → resume → complete **one-handed** on a tall phone at default and `200%` / AX3 text sizes (`rendered`).
83
+ 2. Background the app, trigger a simulated phone call or process death, and return: verify elapsed time, draft file integrity, and Stop/Resume controls match reality (`rendered`).
84
+ 3. Verify Live Activity / Dynamic Island (iOS) or Foreground Service / Live Update notification (Android) updates, responds to Stop/Pause actions, and dismisses cleanly on completion (`rendered`).
85
+ 4. Verify Reduced Motion replaces continuous pulsing/scrolling illustrations with stable numeric/text status (`rendered`).
@@ -0,0 +1,92 @@
1
+ # UIKit
2
+
3
+ ## Token mapping
4
+
5
+ Store light, dark, and high-contrast semantic colors in Asset Catalogs and reference them through generated `ColorResource` symbols (`UIColor(resource: .semanticAction)`) or dynamic trait providers (`UIColor { traits in ... }`). Keep spacing, corner radii, and motion constants in a typed semantic namespace—never duplicate raw RGB values across view controllers or cells.
6
+
7
+ ```swift
8
+ enum PCColor {
9
+ static let action = UIColor(resource: .semanticAction)
10
+ static let surface = UIColor(resource: .semanticSurface)
11
+ }
12
+ ```
13
+
14
+ ## Trait changes & Swift 6 `@MainActor` isolation
15
+
16
+ `traitCollectionDidChange(_:)` is **deprecated (iOS 17+)**. Register explicit trait observers with **`registerForTraitChanges`** so updates run only for the traits you care about, and maintain **Swift 6 `@MainActor`** isolation on UIKit subclasses (avoiding `DispatchQueue.main.async` workarounds or `nonisolated` UI mutations):
17
+
18
+ ```swift
19
+ @MainActor
20
+ final class InvoiceViewController: UIViewController {
21
+ override func viewDidLoad() {
22
+ super.viewDidLoad()
23
+ registerForTraitChanges(
24
+ [UITraitPreferredContentSizeCategory.self, UITraitAccessibilityContrast.self]
25
+ ) { (self: Self, _) in
26
+ self.updateTypographyAndBorders()
27
+ }
28
+ }
29
+ }
30
+ ```
31
+
32
+ ## Layout, sheets, Liquid Glass, & SwiftUI interop
33
+
34
+ - Use Auto Layout constraints against `view.safeAreaLayoutGuide`, `readableContentGuide`, `keyboardLayoutGuide`, `UIStackView`, and `UICollectionViewCompositionalLayout`. Avoid fixed frames except controlled custom drawing.
35
+ - **iOS 26 Liquid Glass (`UIGlassEffect` / `UIGlassContainerEffect`)**: wrap floating controls and bars in `UIVisualEffectView(effect: UIGlassEffect())` (configuring `isInteractive` / `tintColor` where appropriate) and group adjacent glass views inside a `UIGlassContainerEffect` view. Always observe `UIAccessibility.reduceTransparencyStatusDidChangeNotification` and `UIAccessibility.darkerSystemColorsStatusDidChangeNotification` (`UIAccessibility.isReduceTransparencyEnabled` / `isDarkerSystemColorsEnabled`) to fall back to opaque high-contrast surfaces.
36
+ - **Modern modal sheets (`UISheetPresentationController.Detent`)**: declare explicit `.medium()`, `.large()`, or content-fitting `.custom(identifier:) { ctx in ... }` detents, set `prefersGrabberVisible = true`, configure `largestUndimmedDetentIdentifier` when background interaction is intentional, and expose a visible Close/Done button for non-drag accessibility.
37
+ - **Empty & loading states (`UIContentUnavailableConfiguration`)**: assign `contentUnavailableConfiguration` (`.empty()`, `.loading()`, `.search()`, with action button configuration) on `UIViewController` instead of toggling hidden placeholder subviews.
38
+ - **Embedding SwiftUI cells (`UIHostingConfiguration`)**: host complex responsive cell layouts inside `UICollectionViewCell` / `UITableViewCell` via `cell.contentConfiguration = UIHostingConfiguration { ... }` rather than maintaining parallel Auto Layout cell subclasses.
39
+
40
+ ```swift
41
+ var config = UIContentUnavailableConfiguration.empty()
42
+ config.text = "No Pending Invoices"
43
+ config.secondaryText = "New invoices will appear here when synced."
44
+ config.image = UIImage(systemName: "doc.text")
45
+ contentUnavailableConfiguration = config
46
+ ```
47
+
48
+ ## Typography & Dynamic Type
49
+
50
+ Scale every custom and system font via `UIFontMetrics(forTextStyle: .body).scaledFont(for: baseFont)` and set `adjustsFontForContentSizeCategory = true`. Configure `numberOfLines = 0` on essential labels and reflow horizontal `UIStackView` axes to `.vertical` at accessibility content-size categories.
51
+
52
+ ## Motion & reduced motion
53
+
54
+ Use `UIViewPropertyAnimator` for interruptible animations and check `UIAccessibility.isReduceMotionEnabled` (observing `UIAccessibility.reduceMotionStatusDidChangeNotification`). Never rely on animation completion blocks for correctness without handling cancellation or interrupted transitions.
55
+
56
+ ## Accessibility specifics
57
+
58
+ Configure `accessibilityLabel`, `accessibilityValue`, `accessibilityHint` (sparingly), `accessibilityTraits`, `accessibilityCustomActions`, `accessibilityElements` order, and `UIAccessibility.post(notification: .announcement / .screenChanged, argument:)`. Verify touch hit areas are at least `44×44 pt` (expanding via `point(inside:with:)` when a visual glyph is smaller).
59
+
60
+ ## States, forms & 2026 App Store gates
61
+
62
+ Drive tables and collections with `UICollectionViewDiffableDataSource` / `UITableViewDiffableDataSource` using stable item identifiers—never rely on `reloadData()` to hide identity bugs. Reset reused cell state explicitly in `prepareForReuse()` or cell configuration handlers. Preserve route and draft state across OS background memory eviction via `NSUserActivity` and `UIWindowSceneDelegate` state restoration (`stateRestorationActivity(for:)`).
63
+
64
+ In forms and scrollable editors, set **`scrollView.keyboardDismissMode = .interactive`**, configure `keyboardType`, `textContentType`, `returnKeyType`, password autofill/passkeys, and pin bottom actions to `view.keyboardLayoutGuide.topAnchor`. Manage `becomeFirstResponder()` / `resignFirstResponder()` deliberately and validate after field completion rather than interrupting every keystroke.
65
+
66
+ - **App Store privacy, security & compliance**: compile against the **Xcode 26 SDK**, ship `PrivacyInfo.xcprivacy` covering first-party code and every embedded SDK, store tokens solely in **Keychain** (never `UserDefaults`), include **Sign in with Apple** (`ASAuthorizationAppleIDButton`) alongside any third-party social login, ship real **in-app Account Deletion** (never a `mailto:` support link), use **`PHPickerViewController`** (and support `.limited` photo library authorization + `UIApplication.openSettingsURLString` recovery when camera/mic/location is denied), and enable **`CADisableMinimumFrameDurationOnPhone = true`** in `Info.plist` for `120fps` ProMotion responsiveness with `UISpringTimingParameters(dampingRatio:initialVelocity:)` velocity handover.
67
+
68
+ ## Do/don't pairs
69
+
70
+ | Do | Don't |
71
+ |---|---|
72
+ | `registerForTraitChanges([UITraitUserInterfaceStyle.self])` | Overriding deprecated `traitCollectionDidChange(_:)` on iOS 17+ |
73
+ | `UIButton(configuration: .filled())` / `.glass()` | Adding `UITapGestureRecognizer` to a plain `UILabel` |
74
+ | Pin bottom CTA to `view.keyboardLayoutGuide.topAnchor` + `keyboardDismissMode = .interactive` | Manually parsing keyboard frame notifications with magic offsets |
75
+ | Use `PHPickerViewController`, Keychain storage, `PrivacyInfo.xcprivacy`, and real in-app Account Deletion | Use legacy `UIImagePickerController` for photo picking, save tokens in `UserDefaults`, or link account deletion to email |
76
+ | `contentUnavailableConfiguration = UIContentUnavailableConfiguration.empty()` | Toggling ad-hoc hidden empty-state views over a collection view |
77
+ | `UIFontMetrics.default.scaledFont(for:)` + `adjustsFontForContentSizeCategory` | Fixed point `UIFont(name:size:)` ignoring Dynamic Type |
78
+ | Check `isReduceTransparencyEnabled` around `UIGlassEffect` | Leave translucent glass unreadable under Reduce Transparency / Increase Contrast |
79
+
80
+ ## Known traps
81
+
82
+ Auto Layout constraint ambiguity, cell reuse state leakage, retain cycles in trait/button closures (`[weak self]`), Swift 6 `@MainActor` sendability warnings silenced with unsafe `@unchecked Sendable`, keyboard obstruction, modal presentation dismissal skipping `viewWillAppear` on page-sheet parents, missing `UIGlassEffect` accessibility fallbacks, tokens leaked into `UserDefaults`, missing `CADisableMinimumFrameDurationOnPhone`.
83
+
84
+ ## Verification commands
85
+
86
+ ```sh
87
+ xcrun simctl list devices available
88
+ xcodebuild -scheme App -destination 'platform=iOS Simulator,name=<SimulatorName>' build
89
+ xcodebuild test -scheme App -destination 'platform=iOS Simulator,name=<SimulatorName>'
90
+ ```
91
+
92
+ Inspect real simulator and physical-device builds (`>= 2` iOS devices) with View Debugger, Accessibility Inspector, VoiceOver, Dynamic Type (`AX3` / `200%`), Dark Mode, Increase Contrast, Reduce Transparency, background termination restoration, and rotation/split-screen for `rendered` evidence; compilation alone is `static`. Label untested hardware `not-checked`.
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: pixelcraft-patterns
3
+ description: Applies surface-independent product UX patterns without collapsing into generic templates. Use for dashboards/admin, e-commerce PLP/PDP/cart/checkout, SaaS billing/paywalls/usage metering, multi-tenant RBAC/SSO/audit logs, notifications/inbox/activity feeds, calendars/scheduling/Gantt/Kanban, undo/version history/diff viewers, editors/creative tools, chat/collaboration, auth/passkeys/onboarding, marketing/editorial composition, scrollytelling, settings, search/filtering, dense tables/CRUD, command palettes (Cmd+K), embedded AI/copilot UX, and offline-first sync/conflict resolution across any frontend stack.
4
+ license: MIT
5
+ metadata:
6
+ version: 0.1.0
7
+ ---
8
+
9
+ # Pixelcraft patterns
10
+
11
+ Patterns are starting hypotheses, not layouts to copy. Choose one from the user's task and constraints, adapt it to the direction card and platform idioms, and preserve the mandatory floor. Marketing/persuasion rules differ from operational product rules; never mix them unconsciously.
12
+
13
+ ## References
14
+
15
+ - Read [references/pattern-selection.md](references/pattern-selection.md) before choosing workflow, navigation, search/filter, dense-table, or hybrid pattern structure.
16
+ - Read [references/dashboard-admin.md](references/dashboard-admin.md) when designing operational overview, monitoring, admin, triage queues, and drill-down control surfaces.
17
+ - Read [references/commerce.md](references/commerce.md) when designing retail PLP, PDP, cart, checkout, payment errors, and post-purchase flows.
18
+ - Read [references/billing-paywalls.md](references/billing-paywalls.md) when designing SaaS pricing tables, proration previews, soft/hard paywalls, usage meters, dunning banners, or self-serve cancellation.
19
+ - Read [references/multi-tenant-rbac.md](references/multi-tenant-rbac.md) when designing workspace/tenant switchers, RBAC/ABAC permission editors, SSO/SCIM admin setup, API keys/webhooks, or diffable audit logs.
20
+ - Read [references/notifications-activity.md](references/notifications-activity.md) when designing notification centers, inbox triage (snooze/archive/undo), channel × event preference matrices, or live activity feeds.
21
+ - Read [references/scheduling-kanban.md](references/scheduling-kanban.md) when designing calendars, booking pickers, recurrence/DST handling, Gantt timelines, or Kanban boards with WIP limits and WCAG 2.5.7 non-drag moves.
22
+ - Read [references/history-diff-undo.md](references/history-diff-undo.md) when designing atomic undo/redo stacks, multiplayer per-user undo, named version snapshots, or code/rich-text/JSON diff viewers.
23
+ - Read [references/ai-and-offline-patterns.md](references/ai-and-offline-patterns.md) when designing embedded in-app AI workflows (hybrid search, NL-to-filter, inline diffs, approval gates) or offline-first sync status, outboxes, and conflict resolution.
24
+ - Read [references/creative-tools.md](references/creative-tools.md) when designing editors, canvases, layer trees, mixed-value multi-select inspectors, snapping/guides, and creative workspaces.
25
+ - Read [references/communication.md](references/communication.md) when designing human-to-human in-app chat, threads, unread dividers, pins, and collaboration surfaces.
26
+ - Read [references/auth-onboarding.md](references/auth-onboarding.md) when designing sign-in/up, passkeys, OTP/magic links, enterprise SSO discovery, progressive onboarding checklists, and account lifecycle.
27
+ - Read [references/marketing.md](references/marketing.md) when designing conversion architecture, proof, trust rules, and persuasion surfaces.
28
+ - Read [references/creative-web-composition.md](references/creative-web-composition.md) when designing art-directed editorial rhythm, case studies, interactive showcases, and expressive section composition.
29
+ - Read [references/narrative-systems.md](references/narrative-systems.md) when designing multi-chapter scrollytelling outlines, narrative models, and chapter state contracts.
30
+ - Read [references/scroll-implementation.md](references/scroll-implementation.md) when choosing scroll-coupled vs stepped progression models and bounded pinning rules.
31
+ - Read [references/accessibility-resilience.md](references/accessibility-resilience.md) when ensuring scrollytelling focus stability, reduced-motion linear fallback, and zoom/RTL resilience.
32
+ - Read [references/settings.md](references/settings.md) when designing settings, org/workspace/user inheritance, sticky dirty-save bars, and type-to-confirm danger zones.
33
+ - Read [references/search-filtering.md](references/search-filtering.md) when designing query inputs, faceting, empty-result diagnosis, sorting, and large-result recovery.
34
+ - Read [references/tables-crud.md](references/tables-crud.md) when designing dense operational tables, list/detail, CRUD, bulk actions, selection contracts, and import/export.
35
+ - Read [references/command-workspace.md](references/command-workspace.md) when designing surface-independent command palettes (`Cmd+K`/`Ctrl+K`), keyboard-first navigation, optimistic UI with rollback/undo, master-detail split panes, and density modes.
36
+
37
+ ## Selection protocol
38
+
39
+ 1. Identify the user's primary job and frequency. High-frequency operation favors density, predictability, keyboard flow, and recovery; low-frequency persuasion favors narrative, orientation, and memory.
40
+ 2. Choose a primary pattern per screen using the decision matrices in `references/pattern-selection.md`; record user/task evidence and the rejected alternative. Hybrid screens need explicit regions, not blended metaphors.
41
+ 3. Inventory real content/data states before layout: zero/one/many/long/error/offline/permission/slow/conflict.
42
+ 4. Map the pattern into platform idioms using the appropriate surface skill by name. Do not copy DOM assumptions into mobile, TUI, email, game, document, or spatial surfaces.
43
+ 5. Apply the direction card after the workflow is sound. Distinctiveness must not obscure the primary task.
44
+ 6. Verify with the state matrix, keyboard/input path, `pixelcraft-review`, and `pixelcraft-visual-qa` where rendering is possible.
45
+
46
+ ## Universal pattern rules
47
+
48
+ | Concern | Rule |
49
+ |---|---|
50
+ | orientation | Users must know where they are, what changed, and what happens next. |
51
+ | progressive disclosure | Show the next decision, not every control; preserve access to advanced state. |
52
+ | undo/recovery | Prefer reversible actions; when impossible, explain consequences before commitment. |
53
+ | empty state | Teach the next useful action; never use decorative emptiness or dead-end copy. |
54
+ | loading | Preserve layout stability and communicate whether user input/data is safe. |
55
+ | errors | Put recovery near the failure, preserve user input, and distinguish system fault from user action. |
56
+ | density | Density is chosen by frequency and expertise, not by copying admin templates. |
57
+ | navigation | Back/escape/deep links/refresh must restore understandable state. |
58
+ | truthfulness | No fake metrics, activity, reviews, presence, screenshots, or personalization. |
59
+
60
+ ## Sub-Stack Library Escalation
61
+
62
+ Patterns define interaction contracts, never permission to hand-roll fragile widgets from scratch. Whenever a selected pattern requires a complex interactive primitive—**command palette (`Cmd+K`), search/faceting, toast queue, drawer/bottom sheet, rich-text or code editor, >500-row virtualized table, drag-and-drop, calendar/date picker, carousel, chart, map, or node graph**—escalate to a vetted, accessible, purpose-built library via the active surface skill (`pixelcraft-web`, `pixelcraft-mobile`, `pixelcraft-desktop`, `pixelcraft-tui`, `pixelcraft-data-apps`) and record it in `.pixelcraft/plan.md`. Never substitute raw `<div>` modals, `contenteditable` hacks, mouse-only DnD, unvirtualized massive tables, or hardcoded inline SVG charts.
63
+
64
+ ## Pre-submit checklist
65
+
66
+ - [ ] correct primary pattern selected and hybrid boundaries explicit;
67
+ - [ ] complex primitives (command palettes, search/faceting, toasts, drawers, editors, large tables, DnD, calendars, charts) routed to vetted platform libraries—zero DIY hacks;
68
+ - [ ] first-use, returning-use, empty, error, loading, permission, conflict, and long-content states designed;
69
+ - [ ] destructive/irreversible actions use consequence-appropriate friction;
70
+ - [ ] keyboard/controller/touch path and focus restoration match the platform;
71
+ - [ ] copy names concrete user/domain objects rather than generic "items" or "data";
72
+ - [ ] anti-slop check: zero default template cloning (centered hero + 3 tinted-icon cards), fake KPI/activity/review proof, or AI marketing clichés;
73
+ - [ ] adaptation and localization stress cases use real or realistic content;
74
+ - [ ] visual distinctiveness supports rather than overrides task completion;
75
+ - [ ] evidence labels distinguish `rendered` behavior from `static` inspection or `model-judgment`.
@@ -0,0 +1,29 @@
1
+ # Scrollytelling accessibility and resilience
2
+
3
+ Interactive narratives and pinned visuals are progressive enhancements. Every reader—keyboard-only, screen-reader, reduced-motion, magnified, RTL, low-power, or fallback mode—must receive the complete argument and evidence without fighting the layout. For browser ARIA/CSS/reduced-motion implementation specifics, coordinate with `pixelcraft-web`.
4
+
5
+ ## Accessibility & resilience contract
6
+
7
+ | Concern | Mandatory rule | Failure mode prevented |
8
+ |---|---|---|
9
+ | **Logical reading order** | Keep one coherent reading sequence across chapters even while a visual artifact remains pinned or sticky. | Screen readers and keyboard users jumping unpredictably between prose and detached visual regions |
10
+ | **Focus stability** | Keep focus indicators clearly visible and **never move focus programmatically** merely because a scroll threshold was crossed. | Disorienting keyboard/assistive-tech users mid-scroll |
11
+ | **Bypass & orientation** | Provide a table of contents with direct chapter links and a skip-narrative path past long pinned sequences. | Trapping users inside multi-screen visual corridors |
12
+ | **Reduced motion** | Under user reduced-motion preferences, render chapters in normal linear flow with discrete final/static visual states and zero parallax or scroll-scrubbing motion. | Motion sickness, vestibular triggers, and frozen blank opacity-0 sections |
13
+ | **Zoom & text expansion** | Support 200% text scaling, long localized strings, and RTL mirroring without clipping captions or colliding with pinned visuals. | Overlapping text or cropped headlines inside fixed-height scroll frames |
14
+ | **Media & audio safety** | Never autoplay audio; provide captions and transcripts for spoken narration, plus text/table alternatives (with units and sources) for every animated chart or diagram. | Inaccessible insight trapped inside visual transitions or muted video |
15
+ | **Input & history integrity** | Preserve platform scroll keys, scrollbar, touch momentum, and back/forward navigation at every point in the narrative. | Broken browser/app Back button or frozen keyboard scrolling |
16
+ | **Runtime failure fallback** | Ensure core headings, prose, and key static visuals remain readable if interactive scripting, animations, or 3D/GPU renderers fail to initialize. | Empty blank stages hiding the actual content |
17
+
18
+ ## Do/don't pairs
19
+
20
+ | Do | Don't |
21
+ |---|---|
22
+ | Render content visible by default and enhance transitions progressively | Hide chapters at `opacity: 0` waiting for an animation engine to reveal them |
23
+ | Pair every animated chart state with a static text takeaway and data table | Communicate key numbers solely through scrub-triggered tooltips |
24
+ | Release sticky/pinned containers cleanly under reduced-motion or 200% zoom | Clip expanded prose behind `overflow: hidden` pinned frames |
25
+ | Let chapter links move focus cleanly only when explicitly activated by the user | Steal focus automatically on scroll intersection |
26
+
27
+ ## Verification
28
+
29
+ Test with keyboard-only navigation (Tab, Space, PageDown, Home/End), reduced-motion enabled, 200% text scaling, short landscape viewports, narrow mobile widths, RTL layout, disabled/failed enhanced scripting, and screen-reader traversal through table of contents -> chapters -> data alternatives.
@@ -0,0 +1,54 @@
1
+ # In-app AI patterns and offline-first sync UX
2
+
3
+ Modern operational products increasingly blend **embedded AI assistance** (outside standalone chat) with **local-first / offline resilience**. Both fail when automation or background syncing hides system state from the user.
4
+
5
+ ## Part 1: In-app AI and copilot product patterns
6
+
7
+ > **Cross-skill boundary:** Use this reference for **embedded AI capabilities inside product workflows** (search, inline authoring, NL-to-filter, autonomous suggestions, approval gates). For full conversational/agentic chat workspaces, streaming token lifecycles, tool-call traces, artifact split views, and hosted messaging bots, coordinate with `pixelcraft-chat-ui`.
8
+
9
+ ### Embedded AI pattern matrix
10
+
11
+ | Pattern | Best fit | Mandatory trust & UX rules |
12
+ |---|---|---|
13
+ | **Semantic / hybrid search** | Docs, knowledge bases, large catalogs where users describe intent | Combine lexical + semantic results transparently; show *why* a result matched (highlighted snippet or source citation), preserve classic exact-match/filter fallback, and never fabricate answers when zero sources match. |
14
+ | **NL-to-filter / query builder** | Analytics, issue trackers, CRMs with complex query languages | Translate natural language into **visible, editable structured filter chips** (`status:open`, `created:>30d`) rather than running an opaque hidden query; let users inspect, tweak, or clear any chip. |
15
+ | **Inline AI command / authoring** | Document editors, email composers, code/SQL fields | Trigger deliberately (selection toolbar, slash command, or shortcut); stream proposed edits into a **preview/diff state** with explicit `Accept`, `Insert below`, `Refine`, and `Discard` (`Escape`) controls—never silently overwrite user prose. |
16
+ | **Background triage / suggestions** | Auto-categorization, duplicate detection, reply drafts, anomaly summaries | Clearly mark AI-generated labels/summaries with provenance and confidence or source links; keep suggestions reversible and dismissible; allow workspace admins to toggle AI features off cleanly. |
17
+ | **Agentic approval gates (Human-in-the-Loop)** | Any AI action that mutates external state (send email, refund, delete, deploy, run SQL write) | Pause before execution with an explicit action summary (exact parameters, target records, blast radius), require clear `Approve` / `Edit parameters` / `Deny`, and record both prompt and approver in the audit trail. |
18
+
19
+ ### AI truthfulness & failure handling
20
+
21
+ - Distinguish **loading/thinking**, **streaming**, **grounded with sources**, **uncertain/insufficient evidence**, **rate-limited/quota exceeded**, and **model error** states clearly—always preserving the user's original prompt or selection for retry.
22
+ - Never replace deterministic UI controls (date pickers, exact filters, CRUD buttons) with a forced prompt box.
23
+
24
+ ## Part 2: Offline-first, sync status, and conflict resolution UX
25
+
26
+ Products used on flights, field sites, unstable Wi-Fi, or local-first desktop/mobile workspaces must stay calm, predictable, and lossless across connectivity transitions.
27
+
28
+ ### Calm sync indicators and offline outbox
29
+
30
+ - **Calm status indicator**: Stay quiet when healthy ("Saved" unobtrusive or icon-only on hover); surface visible state only on meaningful transitions: `Saving…`, `Offline — edits saved locally (3 pending)`, `Syncing 3 changes…`, or `Sync paused — action required`.
31
+ - **Transparent offline outbox**: Let users inspect queued mutations (pending messages, form submissions, uploads), see which items failed validation on reconnect, and retry or discard individual entries without blocking unrelated work.
32
+ - **Honest capability gating**: Keep cached read views and local-safe edits usable offline; clearly disable or label strictly online-only actions (live payment capture, real-time seat billing, external search) with a plain explanation ("Requires connection") rather than letting clicks spin into generic network errors.
33
+
34
+ ### Conflict resolution and stale-app update prompts
35
+
36
+ | Sync scenario | Required UX behavior |
37
+ |---|---|
38
+ | **Non-overlapping edits** | Merge automatically (CRDT / field-level merge) and preserve both users' changes without interrupting flow. |
39
+ | **Irreconcilable field/file conflict** | Never silently overwrite remote or local data. Present a clear conflict banner or diff view showing **Your local version** vs **Latest server version** (with author and timestamp) and offer `Keep mine`, `Use server`, `Save both (duplicate copy)`, or field-level merge (see [history-diff-undo.md](history-diff-undo.md)). |
40
+ | **Auth expired while offline** | Keep the offline outbox intact locally; prompt re-authentication on reconnect and flush queued changes only after session recovery succeeds. |
41
+ | **Stale client / version update** | Show a non-destructive `"Update available — reload to apply"` banner instead of force-reloading mid-edit; block writes gracefully only if a breaking schema mismatch requires upgrading first, preserving local unsent drafts. |
42
+
43
+ ## Do/don't pairs
44
+
45
+ | Do | Don't |
46
+ |---|---|
47
+ | Render NL-to-filter output as visible, editable filter chips | Run invisible AI-generated filters users cannot inspect or correct |
48
+ | Preview inline AI rewrites as a diff with `Accept` / `Discard` | Silently replace selected user text without undo or preview |
49
+ | Require explicit human approval before AI writes or external sends | Auto-execute destructive or billing-impacting tool calls silently |
50
+ | Queue offline edits visibly and resolve conflicts without data loss | Silently overwrite remote changes with last-write-wins or discard drafts on reconnect |
51
+
52
+ ## Verification
53
+
54
+ Test NL-to-filter chip inspection and failure fallback, inline AI cancel/undo/error retention, approval gate deny/edit/approve flows, airplane-mode edit -> outbox -> reconnect flush, expired-token reconnect without losing queued edits, two-device offline conflict UI, and stale-app update prompts while a draft is dirty.
@@ -0,0 +1,44 @@
1
+ # Auth, onboarding, and account
2
+
3
+ Auth is a trust boundary. Optimize for reliable completion, secure recovery, and zero lockouts rather than branding theater. Platform-specific WebAuthn/browser credential APIs belong in `pixelcraft-web` (and native autofill/passkey APIs in `pixelcraft-mobile` / `pixelcraft-desktop`); this reference defines the surface-independent UX contract.
4
+
5
+ ## Sign-in, passkeys, OTP, and enterprise SSO
6
+
7
+ - **Identifier-first & SSO domain discovery**: Ask for email/username first when enterprise SSO exists; automatically route managed domains to the organization's IdP ("Continue with Okta SSO") while preserving a documented break-glass recovery path for org owners if the IdP is down.
8
+ - **Passkeys / WebAuthn UX**: Offer passkeys as a low-friction primary or autofill-assisted option alongside a clear fallback (magic link, TOTP, password, or cross-device QR) when a user switches devices or cancels the OS prompt. In security settings, label registered passkeys by device/provider and last-used date, and forbid deleting the last auth method without a backup.
9
+ - **OTP & magic links**: Accept paste of the full code into the first input (and support platform one-time-code autofill), show a live resend cooldown timer rather than a silent dead button, explain when a magic link opens in a different browser/device, and provide one-click resend on expired or already-consumed links.
10
+ - **Passwords & error safety**: Use persistent labels, standard autofill hints, full paste support, show-password toggle, and upfront strength rules. Respect anti-enumeration policy on login/reset responses ("If an account exists for this email…") and distinguish temporary rate-limit cooldowns from invalid credentials.
11
+
12
+ ## Progressive onboarding and workspace setup
13
+
14
+ - Teach the next concrete value-delivering action instead of locking users into an unskippable carousel tour.
15
+ - Ask only for fields needed immediately (workspace name, role/goal if it materially tailors setup); defer optional team invites and billing details.
16
+ - Provide a **progressive onboarding checklist** tied to real completed state (dismissible at any time, resumable across sessions, with honest progress counts).
17
+ - Mark any seeded sample/demo workspace content visibly and include a one-action "Clear sample data" control.
18
+
19
+ ## Account lifecycle
20
+
21
+ Cover profile edits, email change verification, active sessions/devices with remote sign-out, MFA enrollment and downloadable recovery codes (confirming user saved them), workspace switching, pending invitations with expiry, account export, and deletion with consequence-specific friction and grace periods.
22
+
23
+ ## State matrix
24
+
25
+ | State | Required behavior |
26
+ |---|---|
27
+ | Passkey prompt dismissed/unsupported | Return cleanly to fallback sign-in options without alarming error copy |
28
+ | Expired/replayed magic link or OTP | Explain expiry plainly and offer one-click new code/link with preserved email |
29
+ | Enterprise SSO misconfigured/unavailable | Identify IdP failure vs wrong password; surface admin contact or break-glass path |
30
+ | Rate-limited / locked out | Display truthful retry window and alternative recovery options |
31
+ | Interrupted onboarding | Resume at the last incomplete step on next sign-in without losing saved workspace config |
32
+
33
+ ## Do/don't pairs
34
+
35
+ | Do | Don't |
36
+ |---|---|
37
+ | Allow pasting full 6-digit OTPs into any digit slot | Force users to type one digit per box and block paste |
38
+ | Email-first SSO discovery with visible IdP redirect state | Hide SSO behind a tiny link while showing invalid password errors |
39
+ | Dismissible onboarding checklist linked to real product tasks | Unskippable 7-step tooltip tour blocking the workspace |
40
+ | Label passkeys by device + creation/last-used date | Show opaque credential IDs users cannot safely revoke |
41
+
42
+ ## Verification
43
+
44
+ Test password managers, passkey cancel/fallback, OTP paste and resend timers, SSO domain routing, expired/replayed links, rate-limit messaging, interrupted onboarding resume, IME/RTL, long email addresses, duplicate submit prevention, assistive technology announcements, and legal/locale consent handling.
@@ -0,0 +1,40 @@
1
+ # SaaS billing, usage metering, and feature paywalls
2
+
3
+ Billing and entitlement UI sits directly on user trust and revenue compliance. Every charge, quota, upgrade, and cancellation path must be transparent, predictable, and free of dark patterns. For retail storefronts and one-time carts, see [commerce.md](commerce.md).
4
+
5
+ ## Pricing tables and plan comparisons
6
+
7
+ - Distinguish **seat-based**, **usage/metered** (tokens, compute minutes, API calls, storage GB), and **hybrid** pricing explicitly—show the unit, billing cadence (monthly vs annual total, not just discounted per-month), currency, and tax/VAT note up front.
8
+ - When toggling Monthly / Annual, update both the unit rate and the billed-today total without hiding the lump-sum commitment.
9
+ - Highlight differences that affect real user decisions (quotas, SSO/RBAC, retention, support SLA) rather than padding 40 identical checkmark rows.
10
+ - Mark the user's **current plan** clearly and show concrete upgrade/downgrade consequences (what unlocks, what becomes read-only or capped).
11
+
12
+ ## Proration, upgrades, and downgrades
13
+
14
+ - Always display a **proration preview** before committing a mid-cycle plan or seat change: unused credit from current period, prorated charge due today, next recurring invoice date, and recurring amount.
15
+ - When adding seats or billable collaborators, show the incremental cost *before* sending the invitation ("Adding 2 editors adds \$32/mo, \$18.40 prorated today").
16
+ - On downgrade, list exact features or quotas exceeding the target tier (e.g., "You currently have 7 active workspaces; Starter allows 3—choose which to archive") instead of failing silently or deleting data.
17
+
18
+ ## Paywalls, trials, usage meters, and dunning
19
+
20
+ | Surface / state | Required UX behavior |
21
+ |---|---|
22
+ | **Soft paywall (in-context gate)** | Let users inspect the workflow or preview results, state which plan unlocks it, explain the specific value, and provide a dismissible path back without trapping navigation. |
23
+ | **Hard paywall (quota/entitlement block)** | Name the exact limit reached, show current consumption vs cap, preserve user work/drafts in place, and link non-admins to a one-click "Request upgrade from billing admin" flow. |
24
+ | **Trial & grace periods** | Show remaining days truthfully without alarming fake countdowns; clearly state whether a card is charged automatically or the workspace gracefully downgrades to read-only/free at expiry. |
25
+ | **Usage meters & overage alerts** | Display current usage, included allowance, reset date, projected trajectory (only if grounded in real run-rate), and configurable spend caps or threshold alerts (80% / 100%). |
26
+ | **Dunning / failed payment** | Show a calm, persistent workspace banner to billing admins (and non-intrusive notice to members only when service impact is imminent), explain exact retry schedule and grace deadline, and link directly to payment-method update without locking users out of exporting their data. |
27
+ | **Cancellation flow** | Make cancellation discoverable in Billing settings with clear effective end date (access kept through paid period), optional pause/downgrade offer at most once, optional non-blocking exit reason, and immediate email/on-screen confirmation. Never hide cancel behind support tickets when signup was self-serve. |
28
+
29
+ ## Do/don't pairs
30
+
31
+ | Do | Don't |
32
+ |---|---|
33
+ | Show prorated charge due today and next invoice total before confirming | Charge a saved card silently when a user toggles a paid add-on or invites a seat |
34
+ | Let non-billing members request an upgrade from their workspace admin | Show a dead-end "Upgrade now" checkout button that errors on permissions |
35
+ | Preserve drafts and data read-only during trial expiry or dunning grace | Delete user data immediately on the first failed renewal attempt |
36
+ | Provide self-serve cancellation with clear end-of-period access date | Bury cancellation in 5 guilt-trip confirmation dialogs or phone-only traps |
37
+
38
+ ## Verification
39
+
40
+ Test monthly/annual toggle math, mid-cycle seat addition proration, downgrade over-quota checks, non-admin paywall paths, usage meter 0%/80%/100%/overage states, failed-payment banner dismissal and recovery, cancellation confirmation and undo-before-period-end, localized currency formatting, and keyboard/screen-reader accessibility of comparison tables.
@@ -0,0 +1,56 @@
1
+ # Command-first and high-velocity workspace patterns
2
+
3
+ Use this reference for expert operational workspaces across **web, desktop, mobile, and terminal (TUI)** surfaces where repeat users prioritize speed, keyboard muscle memory, low perceived latency, and dense scanability over marketing whitespace.
4
+
5
+ ## Command palette (`Cmd+K` / `Ctrl+K`)
6
+
7
+ Treat the command palette as a global action router, not merely a passive search input:
8
+
9
+ | Requirement | Surface-independent rule |
10
+ |---|---|
11
+ | **Invocation** | Bind the platform's primary command shortcut (`Cmd+K` on macOS, `Ctrl+K` on Windows/Linux/TUI, or prominent search/command button on touch/mobile) plus a visible clickable trigger showing the active shortcut hint. |
12
+ | **Scope & parameterized actions** | Support both navigation (`Go to…`) and direct parameterized actions (`Assign to…`, `Change status…`, `Export…`), displaying recent items before the user types. |
13
+ | **Selection & focus restoration** | Expose a modal/overlay list with keyboard selection (`Up`/`Down`), execution (`Enter`), and dismissal (`Escape`) that **restores focus to the exact prior element or pane**. |
14
+ | **Async freshness & empty recovery** | Cancel or ignore stale async query responses so slower earlier results never overwrite newer input; offer actionable fallback when zero commands match (clear filter or jump to full search). |
15
+
16
+ ## Keyboard-first navigation and input-suppression contract
17
+
18
+ Single-key shortcuts (`j`/`k` navigate, `c` create, `/` search, `?` help) dramatically accelerate triage, but they become destructive if fired while editing text. Enforce this surface-independent **input-suppression contract** before dispatching any unmodified single-key hotkey:
19
+
20
+ 1. **Active text input guard**: Suppress when focus is inside any text entry control, editable document region, or combo/select search input.
21
+ 2. **IME composition guard**: Suppress during active CJK/dead-key IME composition so intermediate keystrokes never trigger commands.
22
+ 3. **Modal scope guard**: Suppress background workspace hotkeys whenever a blocking dialog, confirmation sheet, or command palette is open.
23
+ 4. **Modifier clarity**: Keep chords consistent (`Cmd/Ctrl+Enter` to submit inline composers, `Escape` to cancel edits cleanly without losing drafts silently, `?` for a context-grouped shortcut cheat sheet).
24
+ 5. **Composite region navigation**: Use single-tab-stop composite navigation inside dense lists, toolbars, and tab bars (arrow keys move internally; `Tab` moves between major panes).
25
+
26
+ ### Platform mapping
27
+
28
+ | Surface | Palette invocation & focus | Single-key suppression & pane navigation |
29
+ |---|---|---|
30
+ | **Web (`pixelcraft-web`)** | `Meta+K` / `Control+K`; dialog + `combobox`/`listbox` + `aria-activedescendant`; restore focus on `Escape` | Check `event.isComposing` and whether target is inside `input`, `textarea`, `select`, or `[contenteditable]`; roving `tabindex` (`0` / `-1`) |
31
+ | **Desktop (`pixelcraft-desktop`)** | Native menu/command bar (`Cmd+K` macOS, `Ctrl+K`/`Ctrl+Shift+P` Win/Linux); restore first-responder/focus ring | Respect OS text-field responder and IME marked-text state; native `NSSplitView`/WinUI/Qt splitters with keyboard resize |
32
+ | **Mobile (`pixelcraft-mobile`)** | Persistent quick-action/search bar + hardware keyboard `Cmd+K` on iPadOS/Android tablets | Offer thumb-reachable action sheets and swipe shortcuts alongside external keyboard shortcuts |
33
+ | **Terminal (`pixelcraft-tui`)** | `Ctrl+P` / `Ctrl+K` / `:` command mode overlay; restore active pane focus | Separate normal navigation mode from insert/input focus; never shadow terminal escape sequences unintentionally |
34
+
35
+ ## Optimistic UI, rollback, and undo
36
+
37
+ - Apply low-risk, reversible mutations (status toggle, star, archive, reorder, inline rename) immediately using a client mutation ID / idempotency key.
38
+ - Surface a subtle non-blocking pending cue only when the request exceeds ~300 ms; never block the workspace with a modal spinner for a single-row mutation.
39
+ - On server failure, roll back the optimistic state deterministically, preserve user input, and surface an inline or toast error with one-action `Retry`.
40
+ - Pair reversible destructive-feeling actions (archive, move to trash) with an immediate timed `Undo` notification rather than a blocking confirmation dialog; reserve confirmation modals for irreversible mutations.
41
+ - Match loading-placeholder geometry to loaded row/card heights so layout never shifts when data resolves.
42
+
43
+ ## Master-detail split panes and intentional density
44
+
45
+ - Drive density modes (`compact`, `comfortable`, `spacious`) from semantic spacing and row-height tokens rather than one-off component overrides.
46
+ - Persist active filters, sort order, selected tab, and open detail identifier in shareable route/navigation state so reload, Back/Forward, and deep links restore exact context.
47
+ - Keep resizable pane splitters operable via both pointer and keyboard (with clamped min/max widths) and collapse gracefully into stacked navigation on narrow viewports.
48
+
49
+ ## Do/don't pairs
50
+
51
+ | Do | Don't |
52
+ |---|---|
53
+ | Restore focus to the exact triggering row or button when closing the palette | Drop focus to the window root on `Escape` |
54
+ | Suppress single-key hotkeys during text editing and IME composition | Hijack `j`, `k`, or `/` while a user types in a search box or CJK IME |
55
+ | Persist filter, sort, and detail selection in navigation/URL state | Reset workspace filters to defaults on Back or reload |
56
+ | Roll back failed optimistic writes with preserved input and `Retry` | Leave stale optimistic UI pretending a failed mutation succeeded |