@inneranimalmedia/agentsam-sdk 2.6.5 → 2.6.7

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 (371) hide show
  1. package/AGENTSAM.md +29 -0
  2. package/apps/README.md +5 -0
  3. package/apps/cad-creator/README.md +4 -4
  4. package/apps/cad-creator/shared/cad/package.json +1 -1
  5. package/apps/client-cms-editor/AGENTS.md +12 -7
  6. package/apps/client-cms-editor/README.md +76 -48
  7. package/apps/client-cms-editor/agentsam.app.json +26 -9
  8. package/apps/client-cms-editor/backend/package.json +20 -3
  9. package/apps/client-cms-editor/backend/src/api/client.ts +134 -101
  10. package/apps/client-cms-editor/backend/src/index.ts +1 -1
  11. package/apps/client-cms-editor/backend/src/model.ts +11 -115
  12. package/apps/client-cms-editor/backend/src/preview/bridge.ts +1 -1
  13. package/apps/client-cms-editor/backend/tsconfig.json +6 -1
  14. package/apps/client-cms-editor/bin/agentsam-cms.js +262 -0
  15. package/apps/client-cms-editor/bin/agentsam-cms.mjs +2 -228
  16. package/apps/client-cms-editor/frontend/package.json +16 -7
  17. package/apps/client-cms-editor/frontend/src/AgentSamDrawer.tsx +9 -41
  18. package/apps/client-cms-editor/frontend/src/CmsAgentSurface.tsx +19 -174
  19. package/apps/client-cms-editor/frontend/src/adapters/heuristic.ts +29 -0
  20. package/apps/client-cms-editor/frontend/src/adapters/http.ts +628 -0
  21. package/apps/client-cms-editor/frontend/src/adapters/memory.ts +510 -0
  22. package/apps/client-cms-editor/frontend/src/editor/CmsEditor.tsx +213 -0
  23. package/apps/client-cms-editor/frontend/src/editor/CmsEditorProvider.tsx +20 -0
  24. package/apps/client-cms-editor/frontend/src/editor/canvas/PreviewCanvas.tsx +53 -0
  25. package/apps/client-cms-editor/frontend/src/{CmsEditor.tsx → editor/legacy/CmsEditorPrototype.tsx} +52 -23
  26. package/apps/client-cms-editor/frontend/src/editor/useCmsEditorController.ts +218 -0
  27. package/apps/client-cms-editor/frontend/src/index.ts +19 -5
  28. package/apps/client-cms-editor/frontend/src/lib/agent-host.ts +24 -0
  29. package/apps/client-cms-editor/frontend/src/main.tsx +82 -8
  30. package/apps/client-cms-editor/frontend/src/mount.tsx +92 -30
  31. package/apps/client-cms-editor/frontend/src/styles/agentsam-drawer.css +1 -1
  32. package/apps/client-cms-editor/frontend/src/styles/cmsShell.css +8 -8
  33. package/apps/client-cms-editor/frontend/src/styles/studio.css +55 -3
  34. package/apps/client-cms-editor/frontend/tsconfig.json +12 -1
  35. package/apps/client-cms-editor/frontend/vite.config.ts +12 -0
  36. package/apps/client-cms-editor/package-lock.json +973 -134
  37. package/apps/client-cms-editor/package.json +118 -6
  38. package/apps/client-cms-editor/reference/harvest/HARVEST_RECEIPT.json +201 -0
  39. package/apps/client-cms-editor/reference/harvest/PROVENANCE_HISTORY.txt +10 -0
  40. package/apps/client-cms-editor/reference/harvest/README.md +8 -0
  41. package/apps/client-cms-editor/reference/harvest/plans/ARCHIVE-INTAKE.md +135 -0
  42. package/apps/client-cms-editor/reference/harvest/plans/CHATGPT-IDENTITY-HARVEST.md +83 -0
  43. package/apps/client-cms-editor/reference/harvest/plans/CMS-EDITOR-HARVEST.md +166 -0
  44. package/apps/client-cms-editor/reference/harvest/plans/HARVEST-INDEX.md +196 -0
  45. package/apps/client-cms-editor/reference/harvest/plans/INNERANIMALS-CONTENT-001.md +137 -0
  46. package/apps/client-cms-editor/reference/harvest/plans/NO-IMPLICIT-SIDE-EFFECTS.md +87 -0
  47. package/apps/client-cms-editor/reference/harvest/plans/STOREFRONT-SURFACE-MAP.md +140 -0
  48. package/apps/client-cms-editor/reference/harvest/plans/THEME-INNERANIMALS-HARVEST.md +137 -0
  49. package/apps/client-cms-editor/reference/harvest/plans/TOOLING-LAB.md +63 -0
  50. package/apps/client-cms-editor/reference/harvest/plans/harvest-manifest.json +97 -0
  51. package/apps/client-cms-editor/reference/harvest/plans/local-cms-harvest-schema.sql +328 -0
  52. package/apps/client-cms-editor/shared/cms/package.json +17 -7
  53. package/apps/client-cms-editor/shared/cms/src/adapter.ts +204 -0
  54. package/apps/client-cms-editor/shared/cms/src/agent-context.ts +7 -5
  55. package/apps/client-cms-editor/shared/cms/src/editor-types.ts +32 -0
  56. package/apps/client-cms-editor/shared/cms/src/host.ts +82 -0
  57. package/apps/client-cms-editor/shared/cms/src/index.ts +4 -0
  58. package/apps/client-cms-editor/shared/cms/src/map.ts +115 -0
  59. package/apps/client-cms-editor/shared/cms/src/starter-pack.ts +158 -0
  60. package/contracts/source-types.v1.json +353 -0
  61. package/docs/CMS_CONTEXTUAL_COMPOSER.md +1 -1
  62. package/docs/PRODUCT_LIFECYCLE.md +566 -0
  63. package/docs/THEME_REFINERY.md +2 -2
  64. package/docs/architecture/AGENTSAM_RUNTIME_PROTOCOL.md +40 -20
  65. package/docs/content-studio/REVISION_GATE_2026-09-27.md +1 -1
  66. package/docs/plans/LOCAL_STUDIO_DESKTOP_RELEASE_2026-09-29.md +150 -0
  67. package/migrations/d1/0017_identity_native_oauth.sql +21 -0
  68. package/native/agentsam-machine/Cargo.lock +426 -0
  69. package/native/agentsam-machine/Cargo.toml +9 -0
  70. package/native/agentsam-machine/cli/Cargo.toml +14 -0
  71. package/native/agentsam-machine/cli/src/main.rs +77 -0
  72. package/native/agentsam-machine/core/Cargo.toml +15 -0
  73. package/native/agentsam-machine/core/src/assets.rs +790 -0
  74. package/native/agentsam-machine/core/src/bound.rs +298 -0
  75. package/native/agentsam-machine/core/src/enrich.rs +706 -0
  76. package/native/agentsam-machine/core/src/frontend.rs +442 -0
  77. package/native/agentsam-machine/core/src/lib.rs +1086 -0
  78. package/native/agentsam-machine/core/src/liquid.rs +528 -0
  79. package/native/agentsam-machine/core/src/source_types.rs +78 -0
  80. package/package.json +51 -21
  81. package/packages/agentsam-brand/README.md +1 -1
  82. package/packages/agentsam-brand/package.json +4 -4
  83. package/packages/agentsam-brand/src/index.js +1 -1
  84. package/packages/agentsam-contracts/package.json +13 -3
  85. package/packages/agentsam-contracts/src/tools.ts +22 -0
  86. package/packages/agentsam-errors/package.json +13 -3
  87. package/packages/agentsam-knowledge/package.json +18 -4
  88. package/packages/agentsam-knowledge/src/autorag/index.js +10 -3
  89. package/packages/agentsam-knowledge/src/backends/index.js +33 -1
  90. package/packages/agentsam-knowledge/test/autorag.test.mjs +60 -1
  91. package/packages/agentsam-nav/package.json +24 -6
  92. package/packages/agentsam-queue-control/README.md +1 -1
  93. package/packages/agentsam-queue-control/package.json +7 -2
  94. package/packages/agentsam-rapid-rust/src/main.rs +1 -1
  95. package/packages/agentsam-repository/package.json +13 -3
  96. package/packages/agentsam-repository/src/source-types.js +8 -0
  97. package/packages/agentsam-vault/package.json +14 -4
  98. package/packages/agentsam-workbench/package.json +15 -4
  99. package/packages/agentsam-workbench/src/agent/ToolPermissionRequest.tsx +94 -0
  100. package/packages/agentsam-workbench/src/agent/index.ts +2 -0
  101. package/packages/agentsam-workbench/src/agent/tool-permission.css +134 -0
  102. package/packages/connectors/cloudflare/package.json +13 -3
  103. package/packages/connectors/cloudflare/src/api-client.js +3 -2
  104. package/packages/connectors/cloudflare/src/families/vectorize.js +127 -0
  105. package/packages/connectors/cloudflare/src/index.js +1 -0
  106. package/packages/heuristic-theme/README.md +2 -2
  107. package/packages/heuristic-theme/package.json +8 -3
  108. package/packages/heuristic-theme/src/registry.js +2 -2
  109. package/packages/heuristic-theme/src/theme.js +1 -1
  110. package/packages/heuristic-theme/test/theme.test.mjs +1 -1
  111. package/packages/identity/.agentsam/features/oauth-login-portal/agentsam.feature.json +1 -1
  112. package/packages/identity/.agentsam/features/oauth-login-portal/providers.json +27 -7
  113. package/packages/identity/README.md +2 -2
  114. package/packages/identity/migrations/D1_SCHEMA_MAPPING.md +18 -15
  115. package/packages/identity/migrations/apply-portable.js +109 -0
  116. package/packages/identity/migrations/sqlite/004_identity_oauth_consent_catalog.sql +1 -1
  117. package/packages/identity/migrations/sqlite/005_identity_company_native.sql +52 -0
  118. package/packages/identity/package.json +27 -6
  119. package/packages/identity/schema/agentsam.identity/manifest.json +101 -0
  120. package/packages/identity/scripts/local-identity-bridge.mjs +13 -7
  121. package/packages/identity/scripts/preview-auth-portal.mjs +6 -6
  122. package/packages/identity/src/adapters/cloudflare-d1/index.js +8 -401
  123. package/packages/identity/src/adapters/iam-compat/index.js +540 -0
  124. package/packages/identity/src/adapters/portable-d1/index.js +18 -0
  125. package/packages/identity/src/adapters/portable-store.js +479 -0
  126. package/packages/identity/src/adapters/sqlite/index.js +13 -312
  127. package/packages/identity/src/contracts/auth-config.js +0 -1
  128. package/packages/identity/src/contracts/identity-store.js +56 -5
  129. package/packages/identity/src/contracts/provider.js +1 -0
  130. package/packages/identity/src/contracts/sign-in-options.js +104 -0
  131. package/packages/identity/src/core/constants.js +1 -1
  132. package/packages/identity/src/core/session-policy.js +31 -0
  133. package/packages/identity/src/frontend/auth-portal/pages/login.html +6 -6
  134. package/packages/identity/src/frontend/auth-portal/pages/reset.html +5 -5
  135. package/packages/identity/src/frontend/auth-portal/pages/signup.html +5 -5
  136. package/packages/identity/src/frontend/auth-portal/shared/company-branding.js +1 -1
  137. package/packages/identity/src/frontend/auth-portal/shared/desktop-identity-bridge.js +6 -37
  138. package/packages/identity/src/index.js +28 -1
  139. package/packages/identity/src/migrations/README.md +23 -23
  140. package/packages/identity/src/oauth/README.md +1 -1
  141. package/packages/identity/src/oauth/credentials.js +10 -11
  142. package/packages/identity/src/oauth/google-desktop-exchange.js +195 -27
  143. package/packages/identity/src/oauth/iam-platform.js +21 -9
  144. package/packages/identity/src/oauth/native-handoff.js +136 -0
  145. package/packages/identity/src/providers/chatgpt/headers.js +65 -0
  146. package/packages/identity/src/providers/chatgpt/index.js +86 -0
  147. package/packages/identity/src/providers/chatgpt/mapper.js +43 -0
  148. package/packages/identity/src/providers/chatgpt/paths.js +45 -0
  149. package/packages/identity/src/providers/github/oauth.js +1 -2
  150. package/packages/identity/src/providers/github/profile.js +16 -2
  151. package/packages/identity/src/providers/index.js +11 -3
  152. package/packages/identity/src/server/identity-service.js +2 -1
  153. package/packages/identity/src/server/worker-router.js +71 -18
  154. package/packages/identity/tests/chatgpt-provider.test.mjs +75 -0
  155. package/packages/identity/tests/google-desktop-identity-login.test.mjs +210 -0
  156. package/packages/identity/tests/identity-init-scaffold.test.mjs +15 -4
  157. package/packages/identity/tests/lane1-identity-store-parity.test.mjs +527 -0
  158. package/packages/identity/tests/lane1-packed-consumer.test.mjs +175 -0
  159. package/packages/identity/tests/native-oauth-handoff.test.mjs +292 -0
  160. package/packages/identity/tests/oauth-credentials.test.mjs +4 -4
  161. package/packages/identity/tests/preview-auth-portal.test.mjs +4 -2
  162. package/packages/identity/tests/session-routes-policy.test.mjs +13 -1
  163. package/packages/identity/tests/worker-runtime-boundary.test.mjs +11 -0
  164. package/packages/providers/completeful/package.json +7 -2
  165. package/packages/theme-church-site/package.json +17 -6
  166. package/packages/theme-church-site/src/harvest.json +4 -2
  167. package/packages/theme-church-site/src/index.js +7 -3
  168. package/packages/theme-church-site/test/theme.test.mjs +4 -2
  169. package/packages/theme-companions-site/package.json +17 -6
  170. package/packages/theme-companions-site/src/harvest.json +4 -2
  171. package/packages/theme-companions-site/src/index.js +7 -3
  172. package/packages/theme-companions-site/test/theme.test.mjs +4 -2
  173. package/packages/theme-floors-site/package.json +17 -6
  174. package/packages/theme-floors-site/src/harvest.json +4 -2
  175. package/packages/theme-floors-site/src/index.js +7 -3
  176. package/packages/theme-floors-site/test/theme.test.mjs +4 -2
  177. package/packages/theme-fuelnfree-site/package.json +17 -6
  178. package/packages/theme-fuelnfree-site/src/harvest.json +4 -2
  179. package/packages/theme-fuelnfree-site/src/index.js +7 -3
  180. package/packages/theme-fuelnfree-site/test/theme.test.mjs +4 -2
  181. package/packages/theme-handyman-site/package.json +17 -6
  182. package/packages/theme-handyman-site/src/harvest.json +4 -2
  183. package/packages/theme-handyman-site/src/index.js +7 -3
  184. package/packages/theme-handyman-site/test/theme.test.mjs +4 -2
  185. package/packages/theme-insurance-site/package.json +17 -6
  186. package/packages/theme-insurance-site/src/harvest.json +4 -2
  187. package/packages/theme-insurance-site/src/index.js +7 -3
  188. package/packages/theme-insurance-site/test/theme.test.mjs +4 -2
  189. package/packages/theme-scenes/README.md +1 -1
  190. package/packages/theme-scenes/package.json +4 -3
  191. package/packages/theme-scenes/src/registry.js +187 -0
  192. package/packages/theme-shinshu-site/package.json +17 -6
  193. package/packages/theme-shinshu-site/src/harvest.json +4 -2
  194. package/packages/theme-shinshu-site/src/index.js +7 -3
  195. package/packages/theme-shinshu-site/test/theme.test.mjs +4 -2
  196. package/packages/work-graph/package.json +14 -4
  197. package/protocol/FILEMETA_V1.md +2 -2
  198. package/protocol/capabilities/manifest.json +1 -1
  199. package/protocol/database/agentsam.schema-pack.v1.schema.json +72 -0
  200. package/protocol/presets/catalog.json +2 -2
  201. package/protocol/theme-refinery/lineage-registry.json +105 -0
  202. package/protocol/theme-refinery/product-metadata.schema.json +21 -1
  203. package/skills/grok-auth/SKILL.md +110 -0
  204. package/skills/grok-auth/agentsam.skill.json +25 -0
  205. package/skills/grok-auth/references/grok-identity.md +64 -0
  206. package/skills/grok-auth/references/per-user-data.md +49 -0
  207. package/skills/grok-auth/references/prewired-and-env.md +54 -0
  208. package/skills/grok-auth/references/session-ui.md +133 -0
  209. package/skills/grok-auth/references/sign-in-methods.md +55 -0
  210. package/skills/grok-auth/references/wiring.md +71 -0
  211. package/skills/grok-building-games/SKILL.md +213 -0
  212. package/skills/grok-building-games/agentsam.skill.json +25 -0
  213. package/skills/grok-building-games/references/3d-libs.md +64 -0
  214. package/skills/grok-building-games/references/ai-pathfinding.md +122 -0
  215. package/skills/grok-building-games/references/audio.md +129 -0
  216. package/skills/grok-building-games/references/babylon.md +202 -0
  217. package/skills/grok-building-games/references/collision-physics.md +122 -0
  218. package/skills/grok-building-games/references/ecs-architecture.md +111 -0
  219. package/skills/grok-building-games/references/game-feel-juice.md +110 -0
  220. package/skills/grok-building-games/references/genres/board-card-chess.md +89 -0
  221. package/skills/grok-building-games/references/genres/endless-runner.md +83 -0
  222. package/skills/grok-building-games/references/genres/fps.md +105 -0
  223. package/skills/grok-building-games/references/genres/platformer-2d.md +97 -0
  224. package/skills/grok-building-games/references/genres/puzzle-match3-tetris.md +131 -0
  225. package/skills/grok-building-games/references/genres/racing-kart.md +106 -0
  226. package/skills/grok-building-games/references/genres/topdown-twin-stick.md +97 -0
  227. package/skills/grok-building-games/references/genres/tower-defense.md +84 -0
  228. package/skills/grok-building-games/references/genres/voxel-minecraft.md +89 -0
  229. package/skills/grok-building-games/references/input.md +139 -0
  230. package/skills/grok-building-games/references/phaser.md +277 -0
  231. package/skills/grok-building-games/references/procedural-generation.md +141 -0
  232. package/skills/grok-building-games/references/save-persistence.md +108 -0
  233. package/skills/grok-building-games/references/threejs-foundational.md +148 -0
  234. package/skills/grok-controls/SKILL.md +274 -0
  235. package/skills/grok-controls/agentsam.skill.json +25 -0
  236. package/skills/grok-design-ui/SKILL.md +122 -0
  237. package/skills/grok-design-ui/agentsam.skill.json +25 -0
  238. package/skills/grok-design-ui/references/animations.md +379 -0
  239. package/skills/grok-design-ui/references/performance.md +88 -0
  240. package/skills/grok-design-ui/references/refined-ui.md +384 -0
  241. package/skills/grok-design-ui/references/surfaces.md +247 -0
  242. package/skills/grok-design-ui/references/typography.md +123 -0
  243. package/skills/grok-game-animation-frames/SKILL.md +84 -0
  244. package/skills/grok-game-animation-frames/agentsam.skill.json +25 -0
  245. package/skills/grok-game-asset-core/SKILL.md +69 -0
  246. package/skills/grok-game-asset-core/agentsam.skill.json +25 -0
  247. package/skills/grok-game-character-consistency/SKILL.md +69 -0
  248. package/skills/grok-game-character-consistency/agentsam.skill.json +25 -0
  249. package/skills/grok-game-tilesets/SKILL.md +65 -0
  250. package/skills/grok-game-tilesets/agentsam.skill.json +25 -0
  251. package/skills/grok-game-ui-icons/SKILL.md +56 -0
  252. package/skills/grok-game-ui-icons/agentsam.skill.json +25 -0
  253. package/skills/grok-generate2dmap/LICENSE +21 -0
  254. package/skills/grok-generate2dmap/SKILL.md +120 -0
  255. package/skills/grok-generate2dmap/SOURCE.md +6 -0
  256. package/skills/grok-generate2dmap/agentsam.skill.json +25 -0
  257. package/skills/grok-generate2dmap/references/deliverables.md +101 -0
  258. package/skills/grok-generate2dmap/references/layered-map-contract.md +209 -0
  259. package/skills/grok-generate2dmap/references/map-strategies.md +341 -0
  260. package/skills/grok-generate2dmap/references/object-production-gate.md +24 -0
  261. package/skills/grok-generate2dmap/references/pipeline.md +149 -0
  262. package/skills/grok-generate2dmap/references/prop-pack-contract.md +174 -0
  263. package/skills/grok-generate2dmap/references/side-scroll-stages.md +29 -0
  264. package/skills/grok-generate2dmap/scripts/compose_layered_preview.py +157 -0
  265. package/skills/grok-generate2dmap/scripts/extract_prop_pack.py +369 -0
  266. package/skills/grok-generate2dsprite/LICENSE +21 -0
  267. package/skills/grok-generate2dsprite/SKILL.md +313 -0
  268. package/skills/grok-generate2dsprite/SOURCE.md +6 -0
  269. package/skills/grok-generate2dsprite/agentsam.skill.json +25 -0
  270. package/skills/grok-generate2dsprite/references/modes.md +124 -0
  271. package/skills/grok-generate2dsprite/references/prompt-rules.md +315 -0
  272. package/skills/grok-generate2dsprite/scripts/generate2dsprite.py +1031 -0
  273. package/skills/grok-generate2dsprite/scripts/make_layout_guide.py +109 -0
  274. package/skills/grok-imagine/SKILL.md +201 -0
  275. package/skills/grok-imagine/agentsam.skill.json +25 -0
  276. package/skills/grok-multiplayer-p2p/SKILL.md +111 -0
  277. package/skills/grok-multiplayer-p2p/agentsam.skill.json +25 -0
  278. package/skills/grok-multiplayer-p2p/references/react-binding.md +144 -0
  279. package/skills/grok-multiplayer-p2p/references/signaling-relay.md +269 -0
  280. package/skills/grok-neon/SKILL.md +157 -0
  281. package/skills/grok-neon/agentsam.skill.json +25 -0
  282. package/skills/grok-og/SKILL.md +102 -0
  283. package/skills/grok-og/agentsam.skill.json +25 -0
  284. package/skills/grok-og/references/brand-pass.md +53 -0
  285. package/skills/grok-og/references/custom-card.md +107 -0
  286. package/skills/grok-og/references/favicon-and-icons.md +48 -0
  287. package/skills/grok-og/references/og-type-contract.md +18 -0
  288. package/skills/grok-og/references/placeholder-card.md +21 -0
  289. package/skills/grok-og/references/x-banner.md +41 -0
  290. package/skills/grok-threejs/SKILL.md +67 -0
  291. package/skills/grok-threejs/agentsam.skill.json +25 -0
  292. package/skills/grok-threejs/references/llms-full.txt +2780 -0
  293. package/skills/grok-video2dsprite/LICENSE +21 -0
  294. package/skills/grok-video2dsprite/SKILL.md +236 -0
  295. package/skills/grok-video2dsprite/SOURCE.md +6 -0
  296. package/skills/grok-video2dsprite/agentsam.skill.json +25 -0
  297. package/skills/grok-video2dsprite/references/pipeline.md +90 -0
  298. package/skills/grok-video2dsprite/references/prompt-rules.md +63 -0
  299. package/skills/grok-video2dsprite/scripts/video2dsprite.py +490 -0
  300. package/skills/grok-xai-api/SKILL.md +152 -0
  301. package/skills/grok-xai-api/agentsam.skill.json +25 -0
  302. package/src/cli/command-catalog.js +46 -4
  303. package/src/cli/dispatch.js +1 -0
  304. package/src/cli.js +10 -0
  305. package/src/cloudflare/runtime-status.js +2 -1
  306. package/src/commands/autorag.js +67 -13
  307. package/src/commands/cheat-sheet.js +29 -4
  308. package/src/commands/codebaseindex.js +45 -2
  309. package/src/commands/knowledge.js +59 -2
  310. package/src/commands/machine-binary.js +103 -0
  311. package/src/commands/machine.js +137 -0
  312. package/src/commands/security.js +67 -4
  313. package/src/commands/setup.js +33 -16
  314. package/src/commands/status.js +8 -1
  315. package/src/features/resolve.js +1 -0
  316. package/src/knowledge/engine.js +21 -2
  317. package/src/knowledge/runtime-discovery.js +127 -0
  318. package/src/lib/identity-scaffold.js +53 -13
  319. package/src/lib/setup/recipes.js +1 -1
  320. package/src/models/discovery.js +40 -22
  321. package/src/models/inventory-core.d.ts +105 -0
  322. package/src/models/inventory-core.js +54 -6
  323. package/src/security/logs.js +3 -0
  324. package/src/ui/cli/help.js +41 -0
  325. package/test/apps-scaffold-contract.test.mjs +3 -2
  326. package/test/cli/api-key-env-whoami.test.mjs +2 -2
  327. package/test/cli/catalog-authority.test.mjs +64 -0
  328. package/test/cli/machine-command.test.mjs +34 -0
  329. package/test/fixtures/project-authority/customer-app/.agentsam/app.json +5 -0
  330. package/test/fixtures/project-authority/customer-app/apps/my-product/index.ts +1 -0
  331. package/test/fixtures/project-authority/customer-app/wrangler.toml +17 -0
  332. package/test/integration/autorag-project-authority.integration.test.mjs +51 -0
  333. package/test/integration/autorag-runtime-discovery.test.mjs +107 -0
  334. package/test/integration/cms-app-scaffold.test.mjs +37 -31
  335. package/test/integration/cms-site-tenancy-contract.test.mjs +28 -17
  336. package/test/integration/codebaseindex-ingest.test.mjs +41 -0
  337. package/test/integration/database-hosted-honesty.test.mjs +49 -0
  338. package/test/integration/desktop-keychain-boundary.test.mjs +45 -0
  339. package/test/integration/hosted-work-host-authority.test.mjs +47 -0
  340. package/test/integration/inventory-eligibility.test.mjs +59 -0
  341. package/test/integration/local-provider-bridge.test.mjs +65 -0
  342. package/test/integration/local-studio-settings-production.test.mjs +40 -0
  343. package/test/integration/lockfile-sync.test.mjs +26 -0
  344. package/test/integration/provider-env-cli.test.mjs +13 -3
  345. package/test/integration/runtime-status.integration.test.mjs +16 -1
  346. package/test/integration/theme-package-registry.test.mjs +31 -0
  347. package/test/repository-snapshot-view.test.mjs +2 -2
  348. package/test/security.test.mjs +14 -0
  349. package/test/terminal-machine-identity.test.mjs +2 -2
  350. package/apps/client-cms-editor/backend/src/demo-bootstrap.ts +0 -145
  351. package/packages/agentsam-nav/dist/Nav.d.ts +0 -43
  352. package/packages/agentsam-nav/dist/NavCollapsible.d.ts +0 -10
  353. package/packages/agentsam-nav/dist/NavContent.d.ts +0 -2
  354. package/packages/agentsam-nav/dist/NavFooter.d.ts +0 -2
  355. package/packages/agentsam-nav/dist/NavGroup.d.ts +0 -3
  356. package/packages/agentsam-nav/dist/NavHeader.d.ts +0 -2
  357. package/packages/agentsam-nav/dist/NavMenu.d.ts +0 -22
  358. package/packages/agentsam-nav/dist/NavProvider.d.ts +0 -35
  359. package/packages/agentsam-nav/dist/NavTrigger.d.ts +0 -2
  360. package/packages/agentsam-nav/dist/Surfaces.d.ts +0 -41
  361. package/packages/agentsam-nav/dist/browser.d.ts +0 -11
  362. package/packages/agentsam-nav/dist/browser.global.js +0 -132
  363. package/packages/agentsam-nav/dist/browser.js +0 -613
  364. package/packages/agentsam-nav/dist/contracts.d.ts +0 -76
  365. package/packages/agentsam-nav/dist/index.d.ts +0 -11
  366. package/packages/agentsam-nav/dist/index.js +0 -614
  367. package/packages/agentsam-nav/dist/legacy.css +0 -83
  368. package/packages/agentsam-nav/dist/shell.css +0 -113
  369. package/packages/agentsam-nav/dist/theme.css +0 -113
  370. package/packages/agentsam-nav/dist/utils.d.ts +0 -1
  371. package/packages/agentsam-repository/src/goap.js.bak-20260922011251 +0 -670
@@ -0,0 +1,122 @@
1
+ ---
2
+ name: design-ui
3
+ description: >
4
+ Design and build polished, non-generic UI for this TanStack Start + React +
5
+ Tailwind v4 + shadcn/Radix app. Use whenever you create or restyle any
6
+ interface surface — pages, landing pages, dashboards, forms, modals, nav, and
7
+ game overlays (start screens, HUD, menus). Covers design tokens, layout,
8
+ typography, color, spacing, motion, and the anti-"AI-slop" rules that keep
9
+ output from looking generic. Triggers on "design", "UI", "make it look good",
10
+ "polish", "landing page", "theme", "style", "redesign", "ugly", "clean up".
11
+ metadata:
12
+ short-description: "Polished, non-generic UI: tokens, layout, type, color, motion, anti-slop"
13
+ user-invocable: false
14
+ ---
15
+
16
+ # Design & UI
17
+
18
+ Make interfaces that look intentional and premium, not template-generic. This is
19
+ the single biggest quality lever in the app builder. Apply it to **DOM / overlay
20
+ UI** — pages, chrome, HUD, menus, forms. (For a 3D game's gameplay canvas, see
21
+ the `building-games` skill; this skill governs the DOM UI layered over it.)
22
+
23
+ **Read `references/` for depth** (loaded on demand — don't inline it all):
24
+ - `references/refined-ui.md` — the full product-chrome/overlay design system.
25
+ - `references/typography.md` — type scale, pairing, rhythm.
26
+ - `references/surfaces.md` — elevation, borders, shadows, layering.
27
+ - `references/animations.md` — motion, easing, transitions.
28
+ - `references/performance.md` — keep UI smooth (60fps, no jank).
29
+
30
+ ---
31
+
32
+ ## 1. Design-system-first (do this before styling anything)
33
+
34
+ Define the system once, then compose from it. **Never** sprinkle ad-hoc values.
35
+
36
+ - **Tokens in CSS (Tailwind v4 is CSS-first).** Put the palette, radii, and fonts
37
+ in `src/styles.css` under `@theme` as CSS variables; consume them as Tailwind
38
+ utilities. One source of truth.
39
+ ```css
40
+ @import "tailwindcss";
41
+ @theme {
42
+ --color-bg: #0b0b0f; --color-surface: #16161d;
43
+ --color-fg: #e7e7ea; --color-muted: #a0a0ab;
44
+ --color-primary: #14b8a6; --color-border: #26262f;
45
+ --radius: 0.75rem; --font-sans: "Inter", system-ui, sans-serif;
46
+ }
47
+ ```
48
+ - **Use shadcn/ui components** (Radix primitives + `cva` variants + `tailwind-merge`)
49
+ for buttons, dialogs, dropdowns, inputs, etc. They're accessible and consistent.
50
+ Generate them into `src/components/ui`; style via tokens, not inline hex.
51
+ - **Tailwind v4 base fix — buttons need a pointer cursor.** v4's Preflight makes
52
+ `<button>` use `cursor: default`, which feels broken. Add this once in
53
+ `src/styles.css` so buttons/clickable roles show a pointer:
54
+ ```css
55
+ @layer base {
56
+ button:not(:disabled),
57
+ [role="button"]:not(:disabled) { cursor: pointer; }
58
+ }
59
+ ```
60
+ - **Ban ad-hoc styling:** no raw hex in JSX, no `text-white`/`bg-black` literals,
61
+ no arbitrary values like `p-[16px]` or `text-[13px]`. If you need a value,
62
+ it becomes a token or a scale step.
63
+
64
+ ## 2. The quantified rubric (cheap rules that prevent "ugly")
65
+
66
+ - **≤ 3–5 colors total** (one primary + neutrals + at most one accent). No random
67
+ extra hues. Don't default to purple unless asked.
68
+ - **≤ 2 font families** (often one). Pair a display/heading with a body, or use one.
69
+ - **Line-height 1.4–1.6** for body; tighter for large headings.
70
+ - **When you override a background color, override the foreground/text color too**
71
+ (contrast must hold — check both light and dark).
72
+ - **Mobile-first**: design the ~390px layout first, then scale up. No horizontal
73
+ overflow; tap targets ≥ 44px.
74
+ - **Consistent spacing scale** (4/8-based). Generous whitespace beats cramming.
75
+ - **One accent, used sparingly** for primary actions — not everywhere.
76
+
77
+ ## 3. Anti-AI-slop (the tells that make output look generic — avoid)
78
+
79
+ - **No gradient-blob filler**, no giant hero gradients as a substitute for content.
80
+ - **No emoji as icons** — use a real icon set (`lucide-react`).
81
+ - **No hand-drawn SVG** illustrations/maps/charts — use real libraries (`recharts`
82
+ for charts) or real generated images.
83
+ - **No placeholder images / lorem-gray boxes** in the final product — generate
84
+ real images or use real content; set `crossOrigin="anonymous"` on canvas images.
85
+ - **Avoid the overused-font look** (default system-only, or Comic Sans-tier picks).
86
+ - **Every element earns its place.** Cut decorative noise. Establish a system,
87
+ then vary with intent — not randomness.
88
+ - **Match the existing UI when editing** an app in place; don't introduce a second
89
+ visual language.
90
+
91
+ ## 4. Layout & hierarchy
92
+
93
+ - Clear visual hierarchy: one primary action per view; size/weight/color express
94
+ importance. See `references/typography.md` and `references/surfaces.md`.
95
+ - Use real layout structure (grid/flex, container max-widths), not absolute-position
96
+ hacks. Align to a consistent grid.
97
+ - Empty states, loading states, and error states are part of the design — don't
98
+ ship blank/janky intermediate states.
99
+
100
+ ## 5. Motion (subtle, purposeful)
101
+
102
+ - Short, eased transitions (150–250ms) on hover/press/enter; respect
103
+ `prefers-reduced-motion`. Details in `references/animations.md`.
104
+ - Never animate layout in a way that causes jank; prefer transform/opacity.
105
+
106
+ ## 6. Game overlays (when this pairs with `building-games`)
107
+
108
+ The gameplay canvas is owned by `building-games`. This skill styles the **DOM
109
+ overlay**: start/"click to play" screen, HUD, score, menus, pause, mobile
110
+ controls. Keep overlay readable over the canvas (backdrop, contrast), and keep it
111
+ out of the pointer-lock/gameplay input path.
112
+
113
+ ---
114
+
115
+ ## Finish checklist (before you call UI done)
116
+ - Tokens defined in `@theme`; no ad-hoc hex / arbitrary values in JSX.
117
+ - ≤ 5 colors, ≤ 2 fonts, consistent spacing scale.
118
+ - Contrast holds; foreground overridden wherever background is.
119
+ - Mobile (~390px) has no overflow; targets ≥ 44px.
120
+ - Real icons/images/charts — none of the anti-slop tells.
121
+ - Loading/empty/error states handled; motion subtle and reduced-motion-safe.
122
+ - Rendered and eyeballed in a browser (see AGENTS.md verification), not just curl.
@@ -0,0 +1,25 @@
1
+ {
2
+ "schema": "agentsam.skill.v1",
3
+ "id": "grok-design-ui",
4
+ "name": "Grok \u00b7 design-ui",
5
+ "description": "Polished, non-generic UI: tokens, layout, type, color, motion, anti-slop",
6
+ "icon": "skill",
7
+ "slash": {
8
+ "suggested": "/grok-design-ui"
9
+ },
10
+ "instructions": {
11
+ "source": "local_file",
12
+ "ref": "SKILL.md"
13
+ },
14
+ "execution": {
15
+ "mode": "turn",
16
+ "tools": [],
17
+ "operations": [],
18
+ "capabilities": []
19
+ },
20
+ "provenance": {
21
+ "source": "apps/local-studio/.grok/skills",
22
+ "vendor": "grok",
23
+ "status": "imported"
24
+ }
25
+ }
@@ -0,0 +1,379 @@
1
+ # Animations
2
+
3
+ Interruptible animations, enter/exit transitions, and contextual icon animations.
4
+
5
+ ## Interruptible Animations
6
+
7
+ Users change intent mid-interaction. If animations aren't interruptible, the interface feels broken.
8
+
9
+ ### CSS Transitions vs. Keyframes
10
+
11
+ | | CSS Transitions | CSS Keyframe Animations |
12
+ | --- | --- | --- |
13
+ | **Behavior** | Interpolate toward latest state | Run on a fixed timeline |
14
+ | **Interruptible** | Yes — retargets mid-animation | No — restarts from beginning |
15
+ | **Use for** | Interactive state changes (hover, toggle, open/close) | Staged sequences that run once (enter animations, loading) |
16
+ | **Duration** | Adapts to remaining distance | Fixed regardless of state |
17
+
18
+ ```css
19
+ /* Good — interruptible transition for a toggle */
20
+ .drawer {
21
+ transform: translateX(-100%);
22
+ transition: transform 200ms ease-out;
23
+ }
24
+ .drawer.open {
25
+ transform: translateX(0);
26
+ }
27
+
28
+ /* Clicking again mid-animation smoothly reverses — no jank */
29
+ ```
30
+
31
+ ```css
32
+ /* Bad — keyframe animation for interactive element */
33
+ .drawer.open {
34
+ animation: slideIn 200ms ease-out forwards;
35
+ }
36
+
37
+ /* Closing mid-animation snaps or restarts — feels broken */
38
+ ```
39
+
40
+ **Rule:** Always prefer CSS transitions for interactive elements. Reserve keyframes for one-shot sequences.
41
+
42
+ ## Enter Animations: Split and Stagger
43
+
44
+ Don't animate a single large container. Break content into semantic chunks and animate each individually.
45
+
46
+ ### Step by Step
47
+
48
+ 1. **Split** into logical groups (title, description, buttons)
49
+ 2. **Stagger** with ~100ms delay between groups
50
+ 3. **For titles**, consider splitting into individual words with ~80ms stagger
51
+ 4. **Combine** `opacity`, `blur`, and `translateY` for the enter effect
52
+
53
+ ### Code Example
54
+
55
+ ```tsx
56
+ // Motion (Framer Motion) — staggered enter
57
+ function PageHeader() {
58
+ return (
59
+ <motion.div
60
+ initial="hidden"
61
+ animate="visible"
62
+ variants={{
63
+ visible: { transition: { staggerChildren: 0.1 } },
64
+ }}
65
+ >
66
+ <motion.h1
67
+ variants={{
68
+ hidden: { opacity: 0, y: 12, filter: "blur(4px)" },
69
+ visible: { opacity: 1, y: 0, filter: "blur(0px)" },
70
+ }}
71
+ >
72
+ Welcome
73
+ </motion.h1>
74
+
75
+ <motion.p
76
+ variants={{
77
+ hidden: { opacity: 0, y: 12, filter: "blur(4px)" },
78
+ visible: { opacity: 1, y: 0, filter: "blur(0px)" },
79
+ }}
80
+ >
81
+ A description of the page.
82
+ </motion.p>
83
+
84
+ <motion.div
85
+ variants={{
86
+ hidden: { opacity: 0, y: 12, filter: "blur(4px)" },
87
+ visible: { opacity: 1, y: 0, filter: "blur(0px)" },
88
+ }}
89
+ >
90
+ <Button>Get started</Button>
91
+ </motion.div>
92
+ </motion.div>
93
+ );
94
+ }
95
+ ```
96
+
97
+ ### CSS-Only Stagger
98
+
99
+ ```css
100
+ .stagger-item {
101
+ opacity: 0;
102
+ transform: translateY(12px);
103
+ filter: blur(4px);
104
+ animation: fadeInUp 400ms ease-out forwards;
105
+ }
106
+
107
+ .stagger-item:nth-child(1) { animation-delay: 0ms; }
108
+ .stagger-item:nth-child(2) { animation-delay: 100ms; }
109
+ .stagger-item:nth-child(3) { animation-delay: 200ms; }
110
+
111
+ @keyframes fadeInUp {
112
+ to {
113
+ opacity: 1;
114
+ transform: translateY(0);
115
+ filter: blur(0);
116
+ }
117
+ }
118
+ ```
119
+
120
+ ## Exit Animations
121
+
122
+ Exit animations should be softer and less attention-grabbing than enter animations. The user's focus is moving to the next thing — don't fight for attention.
123
+
124
+ ### Subtle Exit (Recommended)
125
+
126
+ ```tsx
127
+ // Small fixed translateY — indicates direction without drama
128
+ <motion.div
129
+ exit={{
130
+ opacity: 0,
131
+ y: -12,
132
+ filter: "blur(4px)",
133
+ transition: { duration: 0.15, ease: "easeIn" },
134
+ }}
135
+ >
136
+ {content}
137
+ </motion.div>
138
+ ```
139
+
140
+ ### Full Exit (When Context Matters)
141
+
142
+ ```tsx
143
+ // Slide fully out — use when spatial context is important
144
+ // (e.g., a card returning to a list, a drawer closing)
145
+ <motion.div
146
+ exit={{
147
+ opacity: 0,
148
+ x: "-100%",
149
+ transition: { duration: 0.2, ease: "easeIn" },
150
+ }}
151
+ >
152
+ {content}
153
+ </motion.div>
154
+ ```
155
+
156
+ ### Good vs. Bad
157
+
158
+ ```css
159
+ /* Good — subtle exit */
160
+ .item-exit {
161
+ opacity: 0;
162
+ transform: translateY(-12px);
163
+ transition: opacity 150ms ease-in, transform 150ms ease-in;
164
+ }
165
+
166
+ /* Bad — dramatic exit that steals focus */
167
+ .item-exit {
168
+ opacity: 0;
169
+ transform: translateY(-100%) scale(0.5);
170
+ transition: all 400ms ease-in;
171
+ }
172
+
173
+ /* Bad — no exit animation at all (element just vanishes) */
174
+ .item-exit {
175
+ display: none;
176
+ }
177
+ ```
178
+
179
+ **Key points:**
180
+ - Use a small fixed `translateY` (e.g., `-12px`) instead of the full container height
181
+ - Keep some directional movement to indicate where the element went
182
+ - Exit duration should be shorter than enter duration (150ms vs 300ms)
183
+ - Don't remove exit animations entirely — subtle motion preserves context
184
+
185
+ ## Contextual Icon Animations
186
+
187
+ When icons appear or disappear contextually (on hover, on state change), animate them with `opacity`, `scale`, and `blur` rather than just toggling visibility.
188
+
189
+ ### Motion Example
190
+
191
+ ```tsx
192
+ import { AnimatePresence, motion } from "motion/react";
193
+
194
+ function IconButton({ isActive, icon: Icon }) {
195
+ return (
196
+ <button>
197
+ <AnimatePresence mode="popLayout">
198
+ <motion.span
199
+ key={isActive ? "active" : "inactive"}
200
+ initial={{ opacity: 0, scale: 0.25, filter: "blur(4px)" }}
201
+ animate={{ opacity: 1, scale: 1, filter: "blur(0px)" }}
202
+ exit={{ opacity: 0, scale: 0.25, filter: "blur(4px)" }}
203
+ transition={{ type: "spring", duration: 0.3, bounce: 0 }}
204
+ >
205
+ <Icon />
206
+ </motion.span>
207
+ </AnimatePresence>
208
+ </button>
209
+ );
210
+ }
211
+ ```
212
+
213
+ ### CSS Transition Approach (No Motion)
214
+
215
+ If the project doesn't use Motion (Framer Motion), keep both icons in the DOM and cross-fade them with CSS transitions. Because neither icon unmounts, both enter and exit animate smoothly.
216
+
217
+ The trick: one icon is absolutely positioned on top of the other. Toggling state cross-fades them — the entering icon scales up from `0.25` while the exiting icon scales down to `0.25`, both with opacity and blur.
218
+
219
+ ```tsx
220
+ function IconButton({ isActive, ActiveIcon, InactiveIcon }) {
221
+ return (
222
+ <button>
223
+ <div className="relative">
224
+ <div
225
+ className={cn(
226
+ "absolute inset-0 flex items-center justify-center",
227
+ "transition-[opacity,filter,scale] duration-300",
228
+ "ease-[cubic-bezier(0.2,0,0,1)]",
229
+ isActive
230
+ ? "scale-100 opacity-100 blur-none"
231
+ : "scale-[0.25] opacity-0 blur-[4px]"
232
+ )}
233
+ >
234
+ <ActiveIcon />
235
+ </div>
236
+ <div
237
+ className={cn(
238
+ "transition-[opacity,filter,scale] duration-300",
239
+ "ease-[cubic-bezier(0.2,0,0,1)]",
240
+ isActive
241
+ ? "scale-[0.25] opacity-0 blur-[4px]"
242
+ : "scale-100 opacity-100 blur-none"
243
+ )}
244
+ >
245
+ <InactiveIcon />
246
+ </div>
247
+ </div>
248
+ </button>
249
+ );
250
+ }
251
+ ```
252
+
253
+ The non-absolute icon (InactiveIcon) defines the layout size. The absolute icon (ActiveIcon) overlays it without affecting flow.
254
+
255
+ ### Choosing Between Motion and CSS
256
+
257
+ | | Motion (Framer Motion) | CSS transitions (both icons in DOM) |
258
+ | --- | --- | --- |
259
+ | **Enter animation** | Yes | Yes |
260
+ | **Exit animation** | Yes (via `AnimatePresence`) | Yes (cross-fade — icon never unmounts) |
261
+ | **Spring physics** | Yes | No — use `cubic-bezier(0.2, 0, 0, 1)` as approximation |
262
+ | **When to use** | Project already uses `motion/react` | No motion dependency, or keeping bundle small |
263
+
264
+ **Rule:** Check the project's `package.json` for `motion` or `framer-motion`. If present, use the Motion approach. If not, use the CSS cross-fade pattern — don't add a dependency just for icon transitions.
265
+
266
+ ### When to Animate Icons
267
+
268
+ | Animate | Don't animate |
269
+ | --- | --- |
270
+ | Icons that appear on hover (action buttons) | Static navigation icons |
271
+ | State change icons (play → pause, like → liked) | Decorative icons |
272
+ | Icons in contextual toolbars | Icons that are always visible |
273
+ | Loading/success state indicators | Icon labels (text next to icon) |
274
+
275
+ **Important:** Always use exactly these values for contextual icon animations — do not deviate:
276
+ - `scale`: `0.25` → `1` (never use `0.5` or `0.6`)
277
+ - `opacity`: `0` → `1`
278
+ - `filter`: `"blur(4px)"` → `"blur(0px)"`
279
+ - `transition`: `{ type: "spring", duration: 0.3, bounce: 0 }` — **bounce must always be `0`**, never `0.1` or any other value
280
+
281
+ ## Scale on Press
282
+
283
+ A subtle scale-down on click gives buttons tactile feedback. Always use `scale(0.96)`. Never use a value smaller than `0.95` — anything below feels exaggerated. Use CSS transitions for interruptibility — if the user releases mid-press, it should smoothly return.
284
+
285
+ Not every button needs this. Add a `static` prop to your button component that disables the scale effect when the motion would be distracting.
286
+
287
+ ### CSS Example
288
+
289
+ ```css
290
+ .button {
291
+ transition-property: scale;
292
+ transition-duration: 150ms;
293
+ transition-timing-function: ease-out;
294
+ }
295
+
296
+ .button:active {
297
+ scale: 0.96;
298
+ }
299
+ ```
300
+
301
+ ### Tailwind Example
302
+
303
+ ```tsx
304
+ <button className="transition-transform duration-150 ease-out active:scale-[0.96]">
305
+ Click me
306
+ </button>
307
+ ```
308
+
309
+ ### Motion Example
310
+
311
+ ```tsx
312
+ <motion.button whileTap={{ scale: 0.96 }}>
313
+ Click me
314
+ </motion.button>
315
+ ```
316
+
317
+ ### Static Prop Pattern
318
+
319
+ Extract the scale class into a variable and conditionally apply it based on a `static` prop:
320
+
321
+ ```tsx
322
+ const tapScale = "active:not-disabled:scale-[0.96]";
323
+
324
+ function Button({ static: isStatic, className, children, ...props }) {
325
+ return (
326
+ <button
327
+ className={cn(
328
+ "transition-transform duration-150 ease-out",
329
+ !isStatic && tapScale,
330
+ className,
331
+ )}
332
+ {...props}
333
+ >
334
+ {children}
335
+ </button>
336
+ );
337
+ }
338
+
339
+ // Usage
340
+ <Button>Click me</Button> {/* scales on press */}
341
+ <Button static>Submit</Button> {/* no scale */}
342
+ ```
343
+
344
+ ## Skip Animation on Page Load
345
+
346
+ Use `initial={false}` on `AnimatePresence` to prevent enter animations from firing on first render. Elements that are already in their default state shouldn't animate in on page load — only on subsequent state changes.
347
+
348
+ ### When It Works
349
+
350
+ ```tsx
351
+ // Good — icon doesn't animate in on mount, only on state change
352
+ <AnimatePresence initial={false} mode="popLayout">
353
+ <motion.span
354
+ key={isActive ? "active" : "inactive"}
355
+ initial={{ opacity: 0, scale: 0.25, filter: "blur(4px)" }}
356
+ animate={{ opacity: 1, scale: 1, filter: "blur(0px)" }}
357
+ exit={{ opacity: 0, scale: 0.25, filter: "blur(4px)" }}
358
+ >
359
+ <Icon />
360
+ </motion.span>
361
+ </AnimatePresence>
362
+ ```
363
+
364
+ Works well for: icon swaps, toggles, tabs, segmented controls — anything that has a default state on page load.
365
+
366
+ ### When It Breaks
367
+
368
+ Don't use `initial={false}` when the component relies on its `initial` prop to set up a first-time enter animation, like a staggered page hero or a loading state. In those cases, removing the initial animation skips the entire entrance.
369
+
370
+ ```tsx
371
+ // Bad — initial={false} would skip the staggered page enter entirely
372
+ <AnimatePresence initial={false}>
373
+ <motion.div initial="hidden" animate="visible" variants={...}>
374
+ ...
375
+ </motion.div>
376
+ </AnimatePresence>
377
+ ```
378
+
379
+ Verify the component still looks right on a full page refresh before applying this.
@@ -0,0 +1,88 @@
1
+ # Performance
2
+
3
+ Transition specificity and GPU compositing hints.
4
+
5
+ ## Transition Only What Changes
6
+
7
+ Never use `transition: all` or Tailwind's `transition` shorthand (which maps to `transition-property: all`). Always specify the exact properties that change.
8
+
9
+ ### Why
10
+
11
+ - `transition: all` forces the browser to watch every property for changes
12
+ - Causes unexpected transitions on properties you didn't intend to animate (colors, padding, shadows)
13
+ - Prevents browser optimizations
14
+
15
+ ### CSS Example
16
+
17
+ ```css
18
+ /* Good — only transition what changes */
19
+ .button {
20
+ transition-property: scale, background-color;
21
+ transition-duration: 150ms;
22
+ transition-timing-function: ease-out;
23
+ }
24
+
25
+ /* Bad — transition everything */
26
+ .button {
27
+ transition: all 150ms ease-out;
28
+ }
29
+ ```
30
+
31
+ ### Tailwind
32
+
33
+ ```tsx
34
+ // Good — explicit properties
35
+ <button className="transition-[scale,background-color] duration-150 ease-out">
36
+
37
+ // Bad — transition all
38
+ <button className="transition duration-150 ease-out">
39
+ ```
40
+
41
+ ### Tailwind `transition-transform` Note
42
+
43
+ `transition-transform` in Tailwind maps to `transition-property: transform, translate, scale, rotate` — it covers all transform-related properties, not just `transform`. Use this when you're only animating transforms. For multiple non-transform properties, use the bracket syntax: `transition-[scale,opacity,filter]`.
44
+
45
+ ## Use `will-change` Sparingly
46
+
47
+ `will-change` hints the browser to pre-promote an element to its own GPU compositing layer. Without it, the browser promotes the element only when the animation starts — that one-time layer promotion can cause a micro-stutter on the first frame.
48
+
49
+ This particularly helps when an element is changing `scale`, `rotation`, or moving around with `transform`. For other properties, it doesn't help much — the browser can't composite them on the GPU anyway.
50
+
51
+ ### Rules
52
+
53
+ ```css
54
+ /* Good — specific property that benefits from GPU compositing */
55
+ .animated-card {
56
+ will-change: transform;
57
+ }
58
+
59
+ /* Good — multiple compositor-friendly properties */
60
+ .animated-card {
61
+ will-change: transform, opacity;
62
+ }
63
+
64
+ /* Bad — never use will-change: all */
65
+ .animated-card {
66
+ will-change: all;
67
+ }
68
+
69
+ /* Bad — properties that can't be GPU-composited anyway */
70
+ .animated-card {
71
+ will-change: background-color, padding;
72
+ }
73
+ ```
74
+
75
+ ### Useful Properties
76
+
77
+ | Property | GPU-compositable | Worth using `will-change` |
78
+ | --- | --- | --- |
79
+ | `transform` | Yes | Yes |
80
+ | `opacity` | Yes | Yes |
81
+ | `filter` (blur, brightness) | Yes | Yes |
82
+ | `clip-path` | Yes | Yes |
83
+ | `top`, `left`, `width`, `height` | No | No |
84
+ | `background`, `border`, `color` | No | No |
85
+
86
+ ### When to Skip
87
+
88
+ Modern browsers are already good at optimizing on their own. Only add `will-change` when you notice first-frame stutter — Safari in particular benefits from it. Don't add it preemptively to every animated element; each extra compositing layer costs memory.