@joiner-platform/cli 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (303) hide show
  1. package/README.md +30 -2
  2. package/bundled-resources/poe-tile-templates/base/CLAUDE.md +72 -0
  3. package/bundled-resources/poe-tile-templates/base/README.md +7 -0
  4. package/bundled-resources/poe-tile-templates/base/_bunfig.toml +8 -0
  5. package/bundled-resources/poe-tile-templates/base/_gitignore +18 -0
  6. package/bundled-resources/poe-tile-templates/base/client.ts +12 -0
  7. package/bundled-resources/poe-tile-templates/base/package.json +36 -0
  8. package/bundled-resources/poe-tile-templates/base/playwright.config.ts +38 -0
  9. package/bundled-resources/poe-tile-templates/base/scripts/check-source.ts +148 -0
  10. package/bundled-resources/poe-tile-templates/base/scripts/dev.ts +19 -0
  11. package/bundled-resources/poe-tile-templates/base/scripts/doctor.sh +29 -0
  12. package/bundled-resources/poe-tile-templates/base/scripts/visual-check.ts +64 -0
  13. package/bundled-resources/poe-tile-templates/base/synced-store/backend-config.ts +9 -0
  14. package/bundled-resources/poe-tile-templates/base/synced-store/client-config.ts +8 -0
  15. package/bundled-resources/poe-tile-templates/base/synced-store/data/items.ts +16 -0
  16. package/bundled-resources/poe-tile-templates/base/synced-store/mutators/index.ts +10 -0
  17. package/bundled-resources/poe-tile-templates/base/synced-store/mutators/remove-todo.ts +5 -0
  18. package/bundled-resources/poe-tile-templates/base/synced-store/mutators/set-todo.ts +20 -0
  19. package/bundled-resources/poe-tile-templates/base/synced-store/mutators/types.ts +5 -0
  20. package/bundled-resources/poe-tile-templates/base/synced-store/mutators.test.ts +138 -0
  21. package/bundled-resources/poe-tile-templates/base/synced-store/schema.ts +40 -0
  22. package/bundled-resources/poe-tile-templates/base/tests/e2e.test.playwright.ts +92 -0
  23. package/bundled-resources/poe-tile-templates/base/tests/mobile-viewport.test.playwright.ts +111 -0
  24. package/bundled-resources/poe-tile-templates/base/tests/render-check.test.playwright.ts +128 -0
  25. package/bundled-resources/poe-tile-templates/base/tests/screenshot.test.playwright.ts +86 -0
  26. package/bundled-resources/poe-tile-templates/base/tests/setup-dom.ts +70 -0
  27. package/bundled-resources/poe-tile-templates/base/tile/src/backend.ts +3 -0
  28. package/bundled-resources/poe-tile-templates/base/tile/styles.css +47 -0
  29. package/bundled-resources/poe-tile-templates/base/tsconfig.json +13 -0
  30. package/bundled-resources/poe-tile-templates/coverage.config.json +6 -0
  31. package/bundled-resources/poe-tile-templates/index.ts +27 -0
  32. package/bundled-resources/poe-tile-templates/package.json +31 -0
  33. package/bundled-resources/poe-tile-templates/phaserjs/package.partial.json +6 -0
  34. package/bundled-resources/poe-tile-templates/phaserjs/tile/index.html +14 -0
  35. package/bundled-resources/poe-tile-templates/phaserjs/tile/src/entry.ts +35 -0
  36. package/bundled-resources/poe-tile-templates/phaserjs/ui/App.test.happydom.tsx +98 -0
  37. package/bundled-resources/poe-tile-templates/phaserjs/ui/App.ts +180 -0
  38. package/bundled-resources/poe-tile-templates/phaserjs/ui/phaser-scene.ts +174 -0
  39. package/bundled-resources/poe-tile-templates/phaserjs/vite.config.ts +28 -0
  40. package/bundled-resources/poe-tile-templates/preact/package.partial.json +9 -0
  41. package/bundled-resources/poe-tile-templates/preact/postcss.config.js +5 -0
  42. package/bundled-resources/poe-tile-templates/preact/tile/index.html +14 -0
  43. package/bundled-resources/poe-tile-templates/preact/tile/src/entry.tsx +36 -0
  44. package/bundled-resources/poe-tile-templates/preact/tile/styles.css +51 -0
  45. package/bundled-resources/poe-tile-templates/preact/tsconfig.json +15 -0
  46. package/bundled-resources/poe-tile-templates/preact/ui/App.test.happydom.tsx +69 -0
  47. package/bundled-resources/poe-tile-templates/preact/ui/App.tsx +116 -0
  48. package/bundled-resources/poe-tile-templates/preact/vite.config.ts +18 -0
  49. package/bundled-resources/poe-tile-templates/react/package.partial.json +12 -0
  50. package/bundled-resources/poe-tile-templates/react/postcss.config.js +5 -0
  51. package/bundled-resources/poe-tile-templates/react/tile/index.html +14 -0
  52. package/bundled-resources/poe-tile-templates/react/tile/src/entry.tsx +38 -0
  53. package/bundled-resources/poe-tile-templates/react/tile/styles.css +51 -0
  54. package/bundled-resources/poe-tile-templates/react/tsconfig.json +14 -0
  55. package/bundled-resources/poe-tile-templates/react/ui/App.test.happydom.tsx +71 -0
  56. package/bundled-resources/poe-tile-templates/react/ui/App.tsx +110 -0
  57. package/bundled-resources/poe-tile-templates/react/vite.config.ts +21 -0
  58. package/bundled-resources/poe-tile-templates/scripts/cleanup.ts +10 -0
  59. package/bundled-resources/poe-tile-templates/scripts/generate.ts +57 -0
  60. package/bundled-resources/poe-tile-templates/scripts/install-diagnostics.ts +52 -0
  61. package/bundled-resources/poe-tile-templates/scripts/paths.ts +7 -0
  62. package/bundled-resources/poe-tile-templates/scripts/sdk-dependency-key.ts +288 -0
  63. package/bundled-resources/poe-tile-templates/scripts/verify-all-sdks.ts +132 -0
  64. package/bundled-resources/poe-tile-templates/scripts/verify-local-sdk-command.ts +30 -0
  65. package/bundled-resources/poe-tile-templates/scripts/verify-local-sdk-tarball.ts +397 -0
  66. package/bundled-resources/poe-tile-templates/solidjs/_bunfig.toml +14 -0
  67. package/bundled-resources/poe-tile-templates/solidjs/package.partial.json +13 -0
  68. package/bundled-resources/poe-tile-templates/solidjs/postcss.config.js +5 -0
  69. package/bundled-resources/poe-tile-templates/solidjs/tests/solid-plugin.ts +49 -0
  70. package/bundled-resources/poe-tile-templates/solidjs/tile/index.html +14 -0
  71. package/bundled-resources/poe-tile-templates/solidjs/tile/src/entry.tsx +36 -0
  72. package/bundled-resources/poe-tile-templates/solidjs/tile/styles.css +51 -0
  73. package/bundled-resources/poe-tile-templates/solidjs/tsconfig.json +15 -0
  74. package/bundled-resources/poe-tile-templates/solidjs/ui/App.test.happydom.tsx +70 -0
  75. package/bundled-resources/poe-tile-templates/solidjs/ui/App.tsx +129 -0
  76. package/bundled-resources/poe-tile-templates/solidjs/vite.config.ts +18 -0
  77. package/bundled-resources/poe-tile-templates/tests/check-source.test.ts +131 -0
  78. package/bundled-resources/poe-tile-templates/tests/dev-script.test.slow.ts +166 -0
  79. package/bundled-resources/poe-tile-templates/tests/fixtures/customized-manager.ts +67 -0
  80. package/bundled-resources/poe-tile-templates/tests/fixtures/extended-mutators.ts.txt +106 -0
  81. package/bundled-resources/poe-tile-templates/tests/fixtures/multiplayer-verification.test.playwright.ts.txt +103 -0
  82. package/bundled-resources/poe-tile-templates/tests/fixtures/replace-starter-schema.ts +67 -0
  83. package/bundled-resources/poe-tile-templates/tests/fixtures/starter-demo/phaserjs.tsx.txt +85 -0
  84. package/bundled-resources/poe-tile-templates/tests/fixtures/starter-demo/preact.tsx.txt +69 -0
  85. package/bundled-resources/poe-tile-templates/tests/fixtures/starter-demo/react.tsx.txt +73 -0
  86. package/bundled-resources/poe-tile-templates/tests/fixtures/starter-demo/seating.ts.txt +54 -0
  87. package/bundled-resources/poe-tile-templates/tests/fixtures/starter-demo/solidjs.tsx.txt +70 -0
  88. package/bundled-resources/poe-tile-templates/tests/fixtures/starter-demo/vanilla-js.tsx.txt +85 -0
  89. package/bundled-resources/poe-tile-templates/tests/generated-templates.test.ts +278 -0
  90. package/bundled-resources/poe-tile-templates/tests/happy-dom-version.test.ts +27 -0
  91. package/bundled-resources/poe-tile-templates/tests/install-diagnostics.test.ts +99 -0
  92. package/bundled-resources/poe-tile-templates/tests/native-gesture-defaults.test.ts +23 -0
  93. package/bundled-resources/poe-tile-templates/tests/playwright-version.test.ts +84 -0
  94. package/bundled-resources/poe-tile-templates/tests/render-check-scaffold.test.ts +56 -0
  95. package/bundled-resources/poe-tile-templates/tests/sdk-dependency-key.test.ts +129 -0
  96. package/bundled-resources/poe-tile-templates/tests/visual-check.test.ts +90 -0
  97. package/bundled-resources/poe-tile-templates/vanilla-js/package.partial.json +3 -0
  98. package/bundled-resources/poe-tile-templates/vanilla-js/tile/index.html +14 -0
  99. package/bundled-resources/poe-tile-templates/vanilla-js/tile/src/entry.ts +35 -0
  100. package/bundled-resources/poe-tile-templates/vanilla-js/ui/App.test.happydom.tsx +96 -0
  101. package/bundled-resources/poe-tile-templates/vanilla-js/ui/App.ts +113 -0
  102. package/bundled-resources/poe-tile-templates/vanilla-js/vite.config.ts +17 -0
  103. package/cli.ts +134 -0
  104. package/index.ts +96 -0
  105. package/package.json +48 -5
  106. package/skills/audio-generation/.generated-by-poe-templated-docs +0 -0
  107. package/skills/audio-generation/SKILL.md +125 -0
  108. package/skills/finish-prototype/.generated-by-poe-templated-docs +0 -0
  109. package/skills/finish-prototype/SKILL.md +22 -0
  110. package/skills/help-me-build/.generated-by-poe-templated-docs +0 -0
  111. package/skills/help-me-build/SKILL.md +56 -0
  112. package/skills/image-generation/.generated-by-poe-templated-docs +0 -0
  113. package/skills/image-generation/SKILL.md +128 -0
  114. package/skills/one-shot/.generated-by-poe-templated-docs +0 -0
  115. package/skills/one-shot/SKILL.md +22 -0
  116. package/skills/platform-prototype/.generated-by-poe-templated-docs +0 -0
  117. package/skills/platform-prototype/SKILL.md +60 -0
  118. package/skills/platform-subagent/.generated-by-poe-templated-docs +0 -0
  119. package/skills/platform-subagent/SKILL.md +16 -0
  120. package/skills/poe-tiles-cli/.generated-by-poe-templated-docs +0 -0
  121. package/skills/poe-tiles-cli/SKILL.md +609 -0
  122. package/skills/poe-tiles-cli/references/device-motion.md +40 -0
  123. package/skills/poe-tiles-cli/references/player-updates.md +41 -0
  124. package/skills/prototype/.generated-by-poe-templated-docs +0 -0
  125. package/skills/prototype/SKILL.md +148 -0
  126. package/skills/publish/.generated-by-poe-templated-docs +0 -0
  127. package/skills/publish/SKILL.md +73 -0
  128. package/skills/synced-store/.generated-by-poe-templated-docs +0 -0
  129. package/skills/synced-store/SKILL.md +583 -0
  130. package/skills/synced-store/references/actions.md +85 -0
  131. package/skills/synced-store/references/api-patterns.md +245 -0
  132. package/skills/synced-store/references/architecture-scaling-and-performance.md +280 -0
  133. package/skills/synced-store/references/client-api-reference.md +263 -0
  134. package/skills/synced-store/references/data-visibility.md +95 -0
  135. package/skills/synced-store/references/external-stores.md +162 -0
  136. package/skills/synced-store/references/file-uploads.md +216 -0
  137. package/skills/synced-store/references/getting-user-info-of-members.md +228 -0
  138. package/skills/synced-store/references/limitations.md +72 -0
  139. package/skills/synced-store/references/live-data-limit-hook.md +131 -0
  140. package/skills/synced-store/references/mutator-rules.md +169 -0
  141. package/skills/synced-store/references/platform.md +49 -0
  142. package/skills/synced-store/references/schema-and-bindings.md +85 -0
  143. package/skills/synced-store/references/schema-libraries.md +57 -0
  144. package/skills/synced-store/references/schema-migrations.md +119 -0
  145. package/skills/synced-store/references/searchable-tables.md +27 -0
  146. package/skills/synced-store/references/server-forking.md +115 -0
  147. package/skills/synced-store/references/singleton-tables.md +61 -0
  148. package/skills/synced-store/references/sort-keys.md +253 -0
  149. package/skills/synced-store/references/ui-patterns.md +95 -0
  150. package/skills/tile-creator/.generated-by-poe-templated-docs +0 -0
  151. package/skills/tile-creator/SKILL.md +196 -0
  152. package/skills/tile-creator/references/assets.md +124 -0
  153. package/skills/tile-creator/references/backend-api.md +308 -0
  154. package/skills/tile-creator/references/cli-limitations.md +64 -0
  155. package/skills/tile-creator/references/cli.md +604 -0
  156. package/skills/tile-creator/references/client-api.md +2407 -0
  157. package/skills/tile-creator/references/composing-apps.md +166 -0
  158. package/skills/tile-creator/references/e2e-tests.md +55 -0
  159. package/skills/tile-creator/references/game-ux-best-practices.md +57 -0
  160. package/skills/tile-creator/references/migrating-pre-rename-tiles.md +79 -0
  161. package/skills/tile-creator/references/multiplayer-api-recipe.md +205 -0
  162. package/skills/tile-creator/references/native-results.md +100 -0
  163. package/skills/tile-creator/references/platform-integration.md +201 -0
  164. package/skills/tile-creator/references/power-report.md +199 -0
  165. package/skills/tile-creator/references/publish-rollout.md +166 -0
  166. package/skills/tile-creator/references/publishing.md +33 -0
  167. package/skills/tile-creator/references/push-notification-guidelines.md +58 -0
  168. package/skills/tile-creator/references/render-check.md +266 -0
  169. package/skills/tile-creator/references/running-the-client-api-on-a-server-owned-by-the-user.md +95 -0
  170. package/skills/tile-creator/references/safe-area-insets.md +79 -0
  171. package/skills/tile-creator/references/sandbox-limitations.md +32 -0
  172. package/skills/tile-creator/references/scaffolded-tile-folder-structure.md +48 -0
  173. package/skills/tile-creator/references/scaffolding-a-new-app.md +202 -0
  174. package/skills/tile-creator/references/simulations.md +125 -0
  175. package/skills/tile-creator/references/synced-store-client-reference.md +92 -0
  176. package/skills/tile-creator/references/troubleshooting.md +22 -0
  177. package/skills/tile-creator/references/turn-based-mutator.md +43 -0
  178. package/skills/tile-creator/references/user-erasure.md +14 -0
  179. package/skills/tile-creator/references/vite-plugin.md +166 -0
  180. package/skills/tile-creator/references/workspace-retention.md +72 -0
  181. package/src/admin-conversions-client.ts +28 -0
  182. package/src/admin-reviews-client.ts +36 -0
  183. package/src/api.generated.ts +1527 -0
  184. package/src/auth-token.ts +198 -0
  185. package/src/bounded-read.ts +35 -0
  186. package/src/bun-version.ts +33 -0
  187. package/src/checkout-base.ts +207 -0
  188. package/src/cli-bun-version.ts +16 -0
  189. package/src/cli-env.ts +28 -0
  190. package/src/cli-name.ts +23 -0
  191. package/src/client.ts +2474 -0
  192. package/src/collect-files.ts +226 -0
  193. package/src/commands/accounts.ts +55 -0
  194. package/src/commands/admin-abandon-conversion.ts +60 -0
  195. package/src/commands/admin-reviews.ts +66 -0
  196. package/src/commands/admin.ts +219 -0
  197. package/src/commands/auth.ts +89 -0
  198. package/src/commands/checkout-prototype.ts +67 -0
  199. package/src/commands/creator-source-capability.ts +11 -0
  200. package/src/commands/doctor-bun.ts +145 -0
  201. package/src/commands/doctor-command.ts +64 -0
  202. package/src/commands/doctor-package-json.ts +47 -0
  203. package/src/commands/doctor-sdk-pin.ts +156 -0
  204. package/src/commands/doctor-store-keys-lexer.ts +213 -0
  205. package/src/commands/doctor-store-keys-scan.ts +262 -0
  206. package/src/commands/doctor-store-keys.ts +196 -0
  207. package/src/commands/doctor.ts +371 -0
  208. package/src/commands/init/blank-scaffold-templates.ts +397 -0
  209. package/src/commands/init/index.ts +170 -0
  210. package/src/commands/init/internal-toolchain.ts +49 -0
  211. package/src/commands/init/manager-test-template.ts +107 -0
  212. package/src/commands/init/multiplayer-test-template.ts +217 -0
  213. package/src/commands/init/name-input.tsx +167 -0
  214. package/src/commands/init/no-store-scaffold-templates.ts +281 -0
  215. package/src/commands/init/no-store-scaffold.ts +134 -0
  216. package/src/commands/init/package-json-scripts.ts +72 -0
  217. package/src/commands/init/scaffold.ts +960 -0
  218. package/src/commands/init/sdk-tarball-url.generated.ts +4 -0
  219. package/src/commands/init/sdk-tarball-url.ts +31 -0
  220. package/src/commands/init/template-picker.tsx +147 -0
  221. package/src/commands/inspect-child-entry.ts +107 -0
  222. package/src/commands/inspect-contract.ts +87 -0
  223. package/src/commands/inspect-freshness.ts +217 -0
  224. package/src/commands/inspect-lock.ts +201 -0
  225. package/src/commands/inspect-options.ts +360 -0
  226. package/src/commands/inspect-orchestrate.ts +375 -0
  227. package/src/commands/inspect-process.ts +172 -0
  228. package/src/commands/inspect-ready.ts +65 -0
  229. package/src/commands/inspect-report.ts +235 -0
  230. package/src/commands/inspect-run-state.ts +296 -0
  231. package/src/commands/inspect-run.ts +157 -0
  232. package/src/commands/inspect-watchdog.ts +74 -0
  233. package/src/commands/install-joiner.ts +208 -0
  234. package/src/commands/login.ts +308 -0
  235. package/src/commands/models.ts +40 -0
  236. package/src/commands/parse-options.ts +36 -0
  237. package/src/commands/remix-package-json.ts +64 -0
  238. package/src/commands/remix.ts +379 -0
  239. package/src/commands/sdk-url.ts +141 -0
  240. package/src/commands/simulations.ts +133 -0
  241. package/src/commands/skills.ts +108 -0
  242. package/src/commands/store-files.ts +92 -0
  243. package/src/commands/stores.ts +703 -0
  244. package/src/commands/tiles-channel-commands.ts +115 -0
  245. package/src/commands/tiles-checkout.ts +351 -0
  246. package/src/commands/tiles-gallery-command.ts +95 -0
  247. package/src/commands/tiles-get-helpers.ts +27 -0
  248. package/src/commands/tiles-inspect.ts +276 -0
  249. package/src/commands/tiles-power-command.ts +308 -0
  250. package/src/commands/tiles-power-format.ts +396 -0
  251. package/src/commands/tiles-power-versions.ts +299 -0
  252. package/src/commands/tiles-publish-helpers.ts +145 -0
  253. package/src/commands/tiles-upload-command.ts +277 -0
  254. package/src/commands/tiles-version-commands.ts +201 -0
  255. package/src/commands/tiles-visibility-command.ts +103 -0
  256. package/src/commands/tiles.ts +257 -0
  257. package/src/commands/upgrade.ts +307 -0
  258. package/src/commit-in-progress.ts +42 -0
  259. package/src/creator-source-context.ts +97 -0
  260. package/src/creator-source-publish.ts +52 -0
  261. package/src/deferred-assets.ts +125 -0
  262. package/src/distribution.ts +28 -0
  263. package/src/errors.ts +61 -0
  264. package/src/install-command.ts +43 -0
  265. package/src/output.ts +62 -0
  266. package/src/poe-tile-config-files.ts +100 -0
  267. package/src/poe-tile-config-players.ts +168 -0
  268. package/src/poe-tile-config-remix.ts +166 -0
  269. package/src/poe-tile-config.ts +831 -0
  270. package/src/power-report-client.ts +55 -0
  271. package/src/prototype-startup.ts +21 -0
  272. package/src/publish-change-summary.ts +55 -0
  273. package/src/publish-overrides-validation.ts +49 -0
  274. package/src/publish-pack.ts +167 -0
  275. package/src/publish-phases.ts +57 -0
  276. package/src/publish-retry.ts +51 -0
  277. package/src/publish-tile-from-config.ts +434 -0
  278. package/src/recorder-stream.ts +169 -0
  279. package/src/remix-provenance.ts +156 -0
  280. package/src/resolve-client-credential.ts +71 -0
  281. package/src/resolve-media-uploads.ts +147 -0
  282. package/src/sdk-dependency.ts +54 -0
  283. package/src/sdk-skills.ts +85 -0
  284. package/src/should-skip-client-setup.ts +20 -0
  285. package/src/simulation-snapshot.ts +123 -0
  286. package/src/simulation-types.ts +74 -0
  287. package/src/simulations-client.ts +112 -0
  288. package/src/source-bundle.ts +466 -0
  289. package/src/staged-publish-cleanup.ts +44 -0
  290. package/src/staged-publish-deferred.ts +160 -0
  291. package/src/staged-publish.ts +401 -0
  292. package/src/store-file-upload.ts +268 -0
  293. package/src/store-request.ts +168 -0
  294. package/src/tar-canonical.ts +41 -0
  295. package/src/tar-extensions.ts +159 -0
  296. package/src/tar-extract.ts +193 -0
  297. package/src/tar-parse.ts +224 -0
  298. package/src/tar.ts +231 -0
  299. package/src/template-check-scripts.ts +18 -0
  300. package/src/tile-gallery-client.ts +82 -0
  301. package/src/types.ts +258 -0
  302. package/src/upload-concurrency.ts +54 -0
  303. package/src/whole-tile.ts +52 -0
@@ -0,0 +1,41 @@
1
+ # When players receive a tile update
2
+
3
+ Use this reference to explain which version a player sees; it does not authorize an upload or a promotion. Follow the host's publishing rules. For a preview pinned to an exact version, first check that the player opened the latest preview link: that link stays on its recorded version. The live-version behavior below applies when the player opens a tile that follows live.
4
+
5
+ Promoting to live doesn't switch everyone at the same instant — a tile always
6
+ opens from whatever is already on the player's device so it starts instantly,
7
+ instead of making them wait while it checks for a newer version. So the update
8
+ reaches people quickly, not instantly. Never tell a creator "everyone has it now"
9
+ after an upload, deploy, or promotion.
10
+
11
+ | The player's situation | When they get the newly-live version |
12
+ |---|---|
13
+ | They have never opened your tile on this device | **Right away.** Nothing is saved on their device yet, so it downloads the live version. |
14
+ | They have opened your tile on this device before | **On their next open after this one.** To start instantly, the tile opens the copy already saved on their device — the old version — and downloads the live one in the background while they play. The following open uses it. |
15
+ | Your tile is open on their screen right now | **Only when they go get it, and only once their session notices.** Nothing interrupts them and no prompt appears; they keep playing the version they opened. Once their running session detects the new version (a `client_bundle_id_mismatch` on the synced-store connection — not immediate), they can tap the tile's title to open its settings and tap **Reload tile**. Until then that row isn't there. They can also just leave the tile and open it again, which puts them back on row two above. |
16
+
17
+ A few things that are always true:
18
+
19
+ - **A compatible update never swaps versions out from under someone mid-play.**
20
+ When the saved-data shape is unchanged, players finish what they're doing and
21
+ reload when they choose.
22
+ - **One exception, and it's the important one:** if the newly-live version changed
23
+ the shape of saved data (you bumped `TILE_SCHEMA_VERSION`), the old version
24
+ can't keep syncing, so the tile updates itself without waiting for a tap. The
25
+ player sees an **"Update required"** dialog over just your tile while it
26
+ reloads into the new version — including on that first open in row two
27
+ above. Anything on screen that isn't saved in the store (a half-typed draft,
28
+ say) is lost in that reload. If the reload still lands on an old version, the
29
+ dialog offers **Try again** instead of reloading in a loop. This is why a
30
+ [migration](../../synced-store/references/schema-migrations.md) matters: it's
31
+ what carries their existing games and rooms across the change instead of
32
+ wiping them.
33
+ - **If the tile is closed, or open but sitting in the background**, nothing
34
+ happens until they come back to it. That's why a promote at night doesn't start
35
+ reaching people until they open the tile again the next day.
36
+ - **Your own device is a special case.** Promoting tells your own devices right
37
+ away, so your next open is always the live version. While you have the tile open,
38
+ a **Reload to update** button also appears in the top bar — that one is
39
+ creator-only, so don't read it as something your players get: their only
40
+ in-session path is the **Reload tile** row in tile settings, and only once their
41
+ session has noticed the new version.
@@ -0,0 +1,148 @@
1
+ ---
2
+ name: prototype
3
+ description: Default workflow for a new Joiner tile. Build a store-less, single-device prototype that publishes as a preview at the end of the first turn, iterate on how it feels, then integrate it with the Joiner platform when the creator asks. Applies automatically when a creator session inlines it or when the workspace holds a `.poe-prototype` marker. Requests for platform integration or to skip prototyping go to its Integrate with Joiner section.
4
+ allowed-tools: Bash, Glob, Grep, Read, Edit, Write
5
+ user-invocable: false
6
+ ---
7
+
8
+ # Prototype
9
+
10
+
11
+ **User Argument:** {{user_input}}
12
+
13
+ This is the default workflow for new Creator v2 tiles. The creator can choose `/one-shot` to build directly on Joiner instead, or `/platform-prototype` to build directly on Joiner; ordinary creator skills customize the prototype without changing its workflow.
14
+
15
+ **SDK and CLI names.** The SDK package is `joiner-sdk` and the CLI command is `joiner`. Tiles and installs from before the rename use `poe-tiles-sdk` and `poe-tiles`. The old names still work, so an existing tile needs no change. In a tile whose `package.json` has the `poe-tiles-sdk` key, write `poe-tiles-sdk/...` where these docs show `joiner-sdk/...`, and never add the second key. If the shell has no `joiner` command, run `poe-tiles install-joiner`, or use `poe-tiles` in its place. If `remix` of a published tile warns about an unresolved workspace dependency, run `poe-tiles upgrade`, delete the folder that remix made (or pass `--dir` with a new name), then remix again.
16
+
17
+ The request is the text after this skill block (or the argument above). If the conversation shows a `/help-me-build` interview the creator has not confirmed yet, continue the interview instead of building; once they confirm, the request is the design they confirmed. **Start immediately** for a new idea: say what you'll build in a few lines — the idea, not the plan — then write the files; the file is the draft, so do not write the code in your head first (see Working with the creator in your system prompt). Keep editing the prototype when `.poe-prototype` exists. When Creator inlines this workflow, it has already checked workspace eligibility and the required capabilities. Trust that selection: do not run a separate workspace or capability preflight, add a path-selection step to the plan, or announce which path you chose. For a new tile, go straight to writing the prototype files below; for an edit, read the relevant existing files as part of implementing the change. Progress updates should describe what you are building.
18
+
19
+ Depart from this default only when the request or session context calls for it:
20
+
21
+ - **Loaded outside Creator's workflow selection.** Before following this workflow, check that your tool list has both `begin_conversion` and `promote_conversion`, and your system prompt or a platform notice says durable workspace checkpoints (workspace backups) are enabled. If either is missing, say in one line that the prototype workflow is unavailable in this session, do not write `.poe-prototype`, and follow `tile-creator` for the request as it stands. Locate existing work before writing so an integrated tile is preserved.
22
+ - **A tile with platform integration already exists.** A `.poe-tile.json` in the workspace with no `.poe-prototype` beside it is a tile with Joiner platform integration. Continue with `tile-creator`. Do not call `begin_conversion`; keep working on the existing tile.
23
+ - **Integrate with Joiner.** The request asks to finish the prototyping phase and build the full version on the Joiner platform ("I'm done prototyping", "finish prototyping", "build the real version", "connect it to Joiner", "save progress", "make it multiplayer", "make it real", "convert the prototype"), or asks to build directly on Joiner with no prototype step ("skip the prototype", "build the multiplayer version now"). The `finish-prototype` skill, inlined when the creator presses Finish prototyping or types `/finish-prototype`, is this request. Go to Integrate with Joiner, even in a session whose workflow setting is direct.
24
+
25
+ Describe this step to the creator as finishing the prototyping phase and building the full version, in terms of what it adds: saved progress, shared state, and multiplayer features as appropriate to the tile. Use "finish prototyping" and "build the full version" in progress updates and invitations to take this step, not "integrate with the Joiner platform".
26
+
27
+ While a prototype exists, `tile-creator` and `synced-store` are not part of your job: do not read them (the only exception is the reference files that What tiles can do links to, when the creator asks what tiles can do), and do not scaffold, install, or add a store. The bash, write, and edit tools refuse those actions in this phase, and each refusal is counted. Integrate with Joiner is where they come back.
28
+
29
+ ## Prototype
30
+
31
+ Goal: a preview the creator can open at the end of this turn, written so that the later split into project files is mechanical.
32
+
33
+ **Start writing immediately; there is no scaffolding or dependency setup.** Create the prototype directory and write the files below directly. Do not look for a starter project or run `joiner tiles init` or a framework generator.
34
+
35
+ ### Files
36
+
37
+ Write exactly three files under `/workspace/<name>/`. `<name>` is a kebab-case base from the request plus a 12-character random hex suffix (`cat-flap-8c41e67ba203`); it becomes the handle, and nobody has to see it. Generate the suffix by running `bun -e 'console.log(require("node:crypto").randomBytes(6).toString("hex"))'`; use the output, never an invented suffix or the example. Keep the complete handle at most 100 characters. Once a manifest exists, preserve its handle; the host may have changed it to resolve a collision during the first preview publish.
38
+
39
+ - `.poe-tile.json`:
40
+
41
+ ```json
42
+ {
43
+ "$schema": "https://joiner-docs.pages.dev/schemas/poe-tile/v10.json",
44
+ "handle": "cat-flap-8c41e67ba203",
45
+ "displayName": "New Arcade Tile",
46
+ "shortDescription": "One sentence about what this does, under 140 characters.",
47
+ "runtimeBundle": { "dir": "." }
48
+ }
49
+ ```
50
+
51
+ `displayName` follows the placeholder rule: "New" plus the kind of tile (`New Word Tile`, or plain `New Tile` when the request names no theme). A name the creator supplied wins over the placeholder. No `sourceBundle`. Discovery categories are platform-assigned; never add a top-level `categories` field to `.poe-tile.json`.
52
+ - `.poe-prototype`: empty. Its presence is the phase; every boot re-derives the phase from disk, not from memory.
53
+ - `index.html`: the whole prototype.
54
+
55
+ No `package.json`, no `bun install`, no build, no `joiner-sdk` import. There is no project to install.
56
+
57
+ ### index.html
58
+
59
+ - `<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">` and `<meta name="color-scheme" content="light dark">`.
60
+ - A **static shell in the body before any script**: the play surface, already sized to the screen, and the HUD (score, status). No title. The host lifts its loading overlay on the first contentful paint, so this markup, not the script, is what makes the preview appear at once.
61
+ - One `<style>` block and one `<script type="module">`, each divided by header comments into these six labelled modules, in this order: `state`, `rules`, `render`, `input`, `loop`, `styles`. The `styles` module is the `<style>` block; label its sections with the same names. Integration ports one module to one file, so keep each module's cross-module reads narrow: `rules` is pure functions over `state`; `render` reads state and draws; `input` translates events into `rules` calls; `loop` owns time.
62
+ - **Memory only.** State lives in module variables. No `localStorage`, no network, no external scripts, fonts, or images: the bundle runs from a `blob:` URL and cannot fetch files beside it, so draw with canvas, CSS, and inline SVG. One exception is generated art: an image the creator asked for, or a specific animal, character, or object the request names (a dog, a knight, a teapot), which code-drawn shapes rarely make recognizable. For either, read the `image-generation` skill before you call `generate_image`; it embeds generated images as `data:` URLs. Requested music and every sound effect follow the same exception: read the `audio-generation` skill before calling `generate_music` or `generate_sound_effect`, then embed the saved MP3 using its data-only script. When `generate_sound_effect` is available, generate each sound effect with it instead of synthesizing it with Web Audio.
63
+ - **Single device.** A second player is hot-seat or simulated; rooms, turns, and invitations arrive with Joiner platform integration.
64
+ - **Tilt and shake are input, with touch first.** When the request mentions tilt, steer, lean, balance, shake, motion, gyro, or accelerometer, read the shared device-motion guidance (`device-motion.md`, beside `player-updates.md` in the `poe-tiles-cli` skill; it is readable in this phase) before designing input and follow its controls model. Non-negotiable: Touch is the default and Tilt is opt-in behind a tap; never motion-only. In the prototype the toggle's choice lives in memory and there is no motion claim to call; integration adds the `privateOfUser` row and the `Poe.motion.claim()` call alongside the store.
65
+ - **No third-party APIs, now or after integration.** The no-network rule above also holds for the integrated tile's server code: neither a prototype nor an integrated tile can call a third-party API or a creator-owned server. If the creator asks for live outside data (weather, scores, their own backend), say that tiles cannot do that today and keep the data inside the tile. The same holds for AI: tiles cannot call AI models or generate images while running, before or after integration, so do not promise it. Build-time art from `generate_image` (above) is unaffected.
66
+
67
+ ## How a prototype should feel
68
+
69
+ The prototype exists to answer "does this feel right?", so these are requirements, not polish:
70
+
71
+ - Mobile first: a 390×760 phone viewport is the design target. Pointer events, `touch-action: none` on the play surface, tap targets at least 44 px, no hover-only affordances.
72
+ - Pad against device chrome with `var(--poe-safe-area-inset-top, env(safe-area-inset-top))` and the other three sides. Never use raw `env(safe-area-inset-*)` alone.
73
+ - For anything with motion: drive simulation from a fixed or clamped timestep so identical inputs give an identical run at 30 Hz and at 120 Hz. Never scale movement by a raw frame delta.
74
+ - For a skill or scored game: generate the challenge per run from a seed kept in state; bound the step between consecutive elements by what the movement constants allow; ramp from a forgiving opening to a floor; score once per obstacle and only after it is fully cleared; match every collision shape to the shape drawn. Unscoreable and unmissable are both failures, so tune both ends.
75
+ - For timing-judged input (rhythm, reaction): time each press and release from `event.timeStamp`, but use `performance.now()` whenever the stamp is more than about 50 ms old. iOS WebKit sometimes stamps a touch with the time another, held finger went down, up to seconds early, which makes two-thumb taps and hold notes misjudge at random.
76
+ - For a game, put the rules one tap away. A `?` button in the top-right corner, inside the safe area and at least 44 px, opens a short "How to play" panel over the game: the goal, each control named by its gesture ("Swipe to steer", "Drag a card onto the pile"), and how a round scores or ends. Closing it returns to the same game state. Never open it automatically or require it before the first move: the hint at the point of action teaches the first move, and the panel is for the player who wants the full rules.
77
+ - Where the player embodies a character, draw one: an assembled silhouette that reacts to input and to what happens to it, not a rectangle or a lone emoji.
78
+ - Decorative motion in bursts, not loops: a few items moving at a time for about a second, then a quiet gap of several seconds in which no animation runs; no infinite particle layers (rain, snow, petals as dozens of looping elements); blend modes and filters off moving content. The integrated tile inherits the prototype's look, and continuous ambient motion on a screen players leave open is what heats phones in production.
79
+ - Show failures in the UI, not only in the console.
80
+
81
+ ## Screen and look
82
+
83
+ These decide whether a tile reads as a game or as a web page, so they are requirements:
84
+
85
+ - **The game is the screen.** The play surface (board, canvas, world, table) fills the tile edge to edge; the HUD and controls sit on top of it or in thin bands at its edges. Never put the game in a card, panel, or centered column with page margins around it.
86
+ - **Edge to edge for the picture, not for input.** In the native apps a swipe that starts at a side edge navigates back instead of reaching the game. In the Android app that is a band of roughly 24 px on either side (wider at a higher back-sensitivity setting), and the OS consumes the swipe before the page sees a touch, so no `touch-action` or `preventDefault()` stops it. In the iOS app it is a swipe from the left edge (and from the right edge when there is forward history). Desktop previews never show it. Never require a swipe, drag, or flick to start in that band; a stroke that starts further in and crosses it is fine. Keep tappable controls at least 24 px plus the side safe-area inset from either edge by insetting the control row, not the canvas. A game that accepts a horizontal swipe anywhere on screen is the at-risk class: prefer taps, vertical swipes, or a swipe zone inset from both sides.
87
+ - **One screen, no scroll.** Size the root to the tile (`height: 100dvh; overflow: hidden`) and the play surface to the space that remains: keep its aspect ratio and fill the leftover band with the world's own color. All controls and game state stay visible without scrolling at 350×509 and 390×760 (phone) and 780×414 (desktop). Put primary phone controls in the bottom third. Only list or document content scrolls, inside its own container.
88
+ - **No website chrome.** No title or logo in a corner, no tagline, subtitle, slogan, feature list, or footer: the platform already shows the name. Every word on screen is something the player needs now: score, state, the next action. Teach with one short hint at the point of action that disappears after the first move.
89
+ - **Dark mode dims the world; it does not invert it.** The world keeps its palette in both schemes; under `prefers-color-scheme: dark`, lower the lightness of its brightest surfaces, same hues, so it does not glare inside a dark app. The chrome (HUD text, buttons, dialogs, hints) follows `prefers-color-scheme` through CSS variables. Never hardcode one scheme, and never read the device appearance any other way.
90
+
91
+ ## Finishing a prototype turn
92
+
93
+ **One quick look, then finish.** The creator trying the preview is the check that matters, and every minute you spend testing delays it. Before you end a prototype turn, you may load the page once, at 390×760 in one color scheme, and read one screenshot saved under `/tmp`, to catch a blank screen, a script error, or a broken layout. If it shows one, fix it and look once more. Do not script a playthrough, play a full round, drive the game with a bot, or capture other sizes or color schemes; design for the sizes above, but do not render each one. Say only what that one look showed, never that the tile passed checks you did not run.
94
+
95
+ Write `.poe-tile-change-summary` beside `.poe-tile.json`: one plain sentence a person would want to read in Version History. Then end the turn. The platform publishes the directory as an unlisted preview and posts the link; you run no publish command and paste no link.
96
+
97
+ The next step after prototyping is finishing the prototyping phase and building the full version. Close with one sentence inviting changes or that step once it feels right, for example: "Try the prototype and let me know what you'd like changed, or when you're ready to finish prototyping and build the full version with saved progress and multiplayer." Mention only the capabilities this tile needs. On the first turn, also say that the prototype does not save: its state resets on reload. Do not ask whether to publish the prototype, offer public listing, or describe publishing as its next step. The automatic preview needs no decision from the creator; public listing comes after the full version is built. A request to build the full version authorizes that work, not public listing.
98
+
99
+ If a creator reports seeing an older preview, read [player update behavior](../poe-tiles-cli/references/player-updates.md). It is shared guidance outside the blocked full-project skills and does not require platform integration.
100
+
101
+ On a later turn while `.poe-prototype` exists: make the change, write a fresh change summary, end the turn. Keep the module labels intact.
102
+
103
+ ## What tiles can do
104
+
105
+ When the creator asks whether tiles can do something ("can it take pictures?"), answer from this table. **Prototype** is this phase's `index.html`; **Full version** is the tile after they finish prototyping. For detail, read only the linked section: grep for its heading, then read around that line with `offset` and `limit`. `client-api.md` is too large to read whole. These linked files are the only parts of `tile-creator` and `synced-store` you may read in this phase. A capability that is not in this table or in those files is not available: say so, and do not guess.
106
+
107
+ | Capability | Prototype | Full version | Details |
108
+ | --- | --- | --- | --- |
109
+ | Upload a photo or file from the device | No | Yes | [file uploads](../synced-store/references/file-uploads.md) |
110
+ | Live camera (face, hand, or pose tracking), microphone, speech input, location, contacts, Bluetooth, payments, share sheet, fullscreen | No | No | [sandbox](../tile-creator/references/sandbox-limitations.md#sandbox-restrictions) |
111
+ | Tilt, shake, motion sensors | Phones only, touch first; desktop has none | Phones only, touch first, with `Poe.motion.claim()` | [sensors](../tile-creator/references/sandbox-limitations.md#device-sensors) |
112
+ | Copy to the clipboard | Yes (write only) | Yes (write only) | [sandbox](../tile-creator/references/sandbox-limitations.md#sandbox-restrictions) |
113
+ | Sound and music (Web Audio, started from a tap) | Yes | Yes | [audio](../tile-creator/references/client-api.md#resumeaudiocontext) |
114
+ | Haptics (vibration) | No | Yes | [haptics](../tile-creator/references/client-api.md#poe-haptics) |
115
+ | Saved progress after a reload | No, state resets | Yes | [storage](../tile-creator/references/sandbox-limitations.md#sandbox-restrictions) |
116
+ | Multiplayer, invites, turns | Hot-seat or simulated only | Yes, real time | [invites](../tile-creator/references/client-api.md#poe-room-openinvitepicker), [turns](../tile-creator/references/client-api.md#setturn-clearturn) |
117
+ | Fast real-time multiplayer: shooters, racing, fighting, synced physics | Hot-seat or simulated only | Works, but other players' moves arrive with visible delay; say so before building and offer a design that holds up | [limits](../synced-store/references/limitations.md) |
118
+ | Hidden or private information per player | No | Yes | [visibility](../synced-store/references/data-visibility.md#the-three-tiers) |
119
+ | Player names and profile pictures | No | Yes | [member info](../synced-store/references/getting-user-info-of-members.md) |
120
+ | Leaderboards and end-of-round results | Local only | Yes | [results](../tile-creator/references/client-api.md#poe-room-tileend-input) |
121
+ | Push notifications, unread badges, "your turn" | No | Yes | [notify](../tile-creator/references/client-api.md#notifyactivity) |
122
+ | AI text or image generation while playing | No | No | |
123
+ | Music made while building | Yes, with `generate_music` | Yes | `audio-generation` skill |
124
+ | Sound effects made while building | Yes, with `generate_sound_effect` | Yes | `audio-generation` skill |
125
+ | Art made while building | Yes, with `generate_image` | Yes | `image-generation` skill |
126
+ | AI agents as room members | No | Yes | [agents](../tile-creator/references/client-api.md#poe-agents-create-agentid-name-model-tools-room) |
127
+ | Open a web link | No | Yes, the player confirms | [links](../tile-creator/references/client-api.md#poe-openexternalurl-url) |
128
+ | Open or embed another tile | No | Yes | [open](../tile-creator/references/client-api.md#poe-open-typeid-instanceid-openprops-anchorsortkey-placement-viewwidth), [embed](../tile-creator/references/client-api.md#poe-tile-custom-element) |
129
+ | Scheduled server work (timers, cron, events while nobody plays) | No | No; server code runs when a player acts | [limits](../synced-store/references/limitations.md) |
130
+ | Live outside data, third-party APIs, the creator's own server | No | No | [network](../tile-creator/references/sandbox-limitations.md#network-access) |
131
+ | Remote scripts, fonts, or images | No | No; bundle them | [network](../tile-creator/references/sandbox-limitations.md#network-access) |
132
+ | `localStorage`, `IndexedDB`, cookies | No | No | [sandbox](../tile-creator/references/sandbox-limitations.md#sandbox-restrictions) |
133
+
134
+ When the answer is "Full version", say that it arrives when they finish prototyping and build the full version, and offer that step. Do not fake it in the prototype. When the answer is "No" in both columns, say that tiles cannot do that today, and offer the closest design that works. When the creator's idea depends on fast real-time multiplayer, tell them before you build, in the first reply, that other players' moves will look delayed in the full version, and offer the alternatives the linked limits list; build what they choose.
135
+
136
+ ## Integrate with Joiner
137
+
138
+ Goal: preserve the prototype's experience while connecting it to the Joiner platform for saved progress, shared state, and multiplayer features where needed. Keep the same handle and live directory, and preserve the prototype until the tile with platform integration has published once.
139
+
140
+ 1. **Call `begin_conversion` first**, with no arguments, before any other command. It checkpoints the workspace durably, posts the notice the creator sees, lifts the phase guard, and returns `conversionId`, `source` (`prototype` or `empty`), `handle`, `livePath`, and `stagingPath`. Use those values; do not invent paths or a handle. If it returns an error, report it in one line and end the turn: the workspace stays closed to changes, and the creator's next message retries the checkpoint through the platform. After a restart, call it again; it resumes the same integration. If the result says a background agent's candidate is ready, follow the result instead of steps 2–5: it is already ported. That does not apply when this integration merges a full tile published outside Creator: the candidate was ported from the prototype alone, so follow steps 2–5 and step 3's merge instruction. Otherwise, once it succeeds, tell the creator in one line that they can leave this page: you keep building, and they'll get a notification when it's ready.
141
+ 2. **Read `tile-creator` and `synced-store` now.** They govern the staging work from here.
142
+ 3. **Scaffold into staging:** `cd /workspace/.staging && joiner tiles init <name> --template <react|preact|solidjs|vanilla-js|phaserjs>` (store on), where `<name>` is the last segment of `stagingPath`, then `bun install` in the new directory. Confirm it is `stagingPath`. `<name>` is usually `handle`; for a reserved handle such as `dist` it is not (`dist-tile`), so then set `handle` in the new `.poe-tile.json` to `handle`. When this integration merges a full tile published outside Creator, do not scaffold: empty `stagingPath` if a background agent's candidate is there, copy that downloaded source into it, keep the prototype's `handle` in its manifest, and run `bun install` there; in step 4, port only the prototype changes that version lacks. `.staging` is outside the publish scan, so nothing publishes from it, and the staged manifest's handle equals the prototype's, which is what the promotion needs.
143
+ 4. **Port.** For `source: prototype`, one module to one place: `state` splits into synced-store schema (everything durable or shared: progress, scores, seats, turns) and local UI state; `rules` becomes pure functions plus a mutator for every shared transition; `render`, `input`, and `styles` go to the UI; `loop` stays client-side and drives simulation from store state. A hot-seat "second player" becomes a real member and `setTurn`. The prototype has no iOS magnifier suppression, and the full version must never show the loupe: as you port `input` and `render`, call the SDK's `suppressLongPressMagnifier` on every non-scrolling surface a finger can rest on (play surface, HUD, buttons, menus, overlays), as `tile-creator` requires. Copy `displayName` and `shortDescription` from the prototype manifest into the staged `.poe-tile.json` and keep its `handle`. Copy the prototype's generated image files from its `assets/` into the staged `assets/` and load them with `?url` imports, and its audio files into the staged `tile/public/audio/` and load them with `Poe.bundle.loadAsset`, as the `image-generation` and `audio-generation` skills describe; do not carry the data-only `.js` scripts over, and never replace a generated sound effect with a synthesized one. For `source: empty`, there is no prototype to read or port: build from the creator's request. **The port must be modular TypeScript. This is required, not a preference:** each prototype module becomes its own `.ts` file (or a folder of them), no source file is over 1500 lines, no game code stays in `.js`, and nothing uses `@ts-nocheck`, `@ts-ignore` or `@ts-expect-error`. Copying the prototype's script into one file is not a port. Before `promote_conversion`, run `bun run type-check` in the staging directory: it first runs the scaffold's `scripts/check-source.ts`, which fails on each of these, and then `tsc`. The new scaffold passes it. If it fails, keep splitting and fixing types; do not promote, and do not edit the check or the `type-check` script.
144
+ 5. **Give the candidate its icon** when you have the `generate_image` tool: read the `image-generation` skill and follow its **Icon** section, with `<tileDir>` the staging directory relative to `/workspace` (`stagingPath` without `/workspace/`). Without the tool, skip this and continue; a later turn or `publish` makes the icon. **Write `.poe-tile-change-summary` in staging**, beside the candidate manifest, before calling promotion; the bridge carries it into the live directory with the candidate.
145
+ 6. **Call `promote_conversion({ conversionId })`.** When this integration answers the creator's request to merge newer changes published outside Creator, call `finish_source_merge` immediately before it: the workspace closes during promotion, and until the merge is recorded the platform refuses the integrated tile's publish as outdated. The bridge verifies the candidate, checkpoints it, and performs the renames itself: for a prototype, live to `.staging/<name>.prev` and then staging to live; for an empty source, staging to live. Never `mv` or `rm` those directories and never edit `.staging/conversion.json`. Only candidate-validation failures reopen staging: repair the named problem and call the tool again with the same `conversionId`. Bridge-owned checkpoint, rename, or publication failures keep workspace mutations closed; follow the tool's recovery instructions without editing files or running workspace commands.
146
+ 7. **End the turn** with no further workspace commands. The change summary is already in the promoted candidate. The publish under the recorded handle, the `.prev` cleanup, and the record cleanup belong to the bridge.
147
+
148
+ Two manifests with the same handle must never be visible to the publish scan at a turn boundary. The bridge's renames are the only way the integrated tile becomes live.
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: publish
3
+ description: Publish a Joiner tile from a Creator session. List an unlisted tile publicly, or push the current test version to its players. Use when the creator presses a publish button or types /publish.
4
+ allowed-tools: Bash, Glob, Grep, Read, Edit, Write
5
+ user-invocable: true
6
+ ---
7
+
8
+ # Publish
9
+
10
+ The creator asked to publish. That request authorizes exactly one of the two actions below, chosen by the tile's current state — never both, and never anything else. Text after the command is part of the request: a title, a version number, or a condition. Honor it.
11
+
12
+ This skill is for a Creator session on Joiner, where the host publishes an unlisted preview at the end of every turn that changed files and owns listing and release. If you are not in one — there is no `request_listing` tool and `$CREATOR_V2_BOUND_TILE_ID` is unset — say that this command does not apply here and follow `tile-creator`'s publishing reference instead.
13
+
14
+ Nothing here is a build step: the preview the creator is looking at is already built and uploaded. The only new work is the icon and the gallery screenshots that players see. Capturing screenshots can take several minutes.
15
+
16
+ ## Decide what "publish" means right now
17
+
18
+ Read the tile's state before acting; do not infer it from earlier in the conversation, because the creator can change visibility from the UI while you work:
19
+
20
+ ```
21
+ joiner tiles get "$CREATOR_V2_BOUND_TILE_ID"
22
+ ```
23
+
24
+ - **A `.poe-prototype` marker exists in the workspace.** The tile is a prototype, and the next step is finishing the prototyping phase and building the full version, not publishing. Say so in one sentence and invite that step; do not list or promote anything, and do not treat this as a request to integrate.
25
+ - **`visibility` is `unlisted` or `dev`.** Nobody can find the tile yet. Follow **List the tile** below.
26
+ - **`visibility` is `public`.** People are playing the pinned live version, and the creator wants the current test version to reach them. Follow **Publish a version to players** below.
27
+ - **Any other value.** This host does not recognize it; the tile may already be listed. Report the value and stop rather than guess.
28
+
29
+ An empty `$CREATOR_V2_BOUND_TILE_ID` in a Creator session means the tile has no preview yet; a preview must exist before anything can be listed or promoted. Say so and end the turn.
30
+
31
+ ## List the tile
32
+
33
+ Listing puts the tile in front of people who did not go looking for it. It is also when the tile gets its real name.
34
+
35
+ 1. **Settle the title.** A listing request does not authorize an invented name. Use the title the creator supplied or accepted in this conversation, including a title given after `/publish`. If there is none, use `ask_user` to propose one they can accept or replace, then end the turn. When step 4 also has a question, check the gallery first and put both questions in the same `ask_user` call. Do not rename or request listing before their answer; their answer resumes this request, and asking for the missing title is a complete response to a publish request.
36
+ 2. **Apply the accepted title.** Set `.poe-tile.json → displayName` to that exact title. Set the handle to a slug of the same title (lowercase, digits, single hyphens — `Texas Hold'em` → `texas-holdem`). Set it with the rename command, not by editing the manifest — `joiner tiles rename "$CREATOR_V2_BOUND_TILE_ID" <slug>` — then put the same value in `.poe-tile.json → handle`. If the slug is taken, take the closest free variant, say which one you used, and never report a rename you did not see succeed. Set the handle only on this first naming; changing it later breaks shared links.
37
+ 3. **Give it an icon.** Read the `image-generation` skill from the Skills section and follow its **Icon** section, with `<tileDir>` the directory of the `.poe-tile.json` that step 2 edited: `.` for a root tile, or for example `chess` for `/workspace/chess/`. The icon usually exists already from the turn that invited listing; that section keeps it. If the `generate_image` tool is absent, take that section's failure action wherever its table says generate. This step never blocks listing.
38
+ 4. **Check the gallery.** Follow **Gallery screenshots** below. A question there ends the turn the same way the title question does: do not request listing before the answer, and the answer resumes this request.
39
+ 5. **Finish with `request_listing`, passing the accepted title, and end your turn.** Do not run public visibility yourself. The host builds and uploads the accepted identity first, confirms the new version reached live, pins it, and only then lists it. This also runs when no source changed. A build, upload, or release-verification failure leaves visibility unchanged and produces a notice without another creator message; the one-shot request is consumed so a later edit cannot unexpectedly list the tile. Fix the reported issue and request listing again when the creator asks. If the tool is unavailable, explain that listing is unavailable in this session and keep the tile unlisted; do not fall back to changing visibility before an upload.
40
+
41
+ ## Publish a version to players
42
+
43
+ The people playing the tile are on the pinned `live` version. Every turn since has produced a test version they do not have, and the creator wants the newest one to reach them.
44
+
45
+ 1. **Warn first if there is anything they should know.** You know what is in the version and the button does not: a half-finished change, a schema change that saved data has not migrated past, a feature they described as experimental. If a warning is warranted, give it and end the turn without promoting; they can ask again. If nothing warrants one, do not turn the request into a question — they already said what they want.
46
+ 2. **Name the version.** Run `joiner tiles channels "$CREATOR_V2_BOUND_TILE_ID"`. The `test` channel's version is the build the creator has been previewing; `live` is what players have. Pick the target first: the version the creator named, after `/publish` or in their request, when they gave one — the command rolls back as well as forward, so a named older version is a deliberate rollback — and otherwise the `test` channel's version. If the target is already what `live` points at, there is nothing to publish: say so and stop, since the promote command has no same-version guard and would report a publish that moved nothing. A rollback is not that case, even when `test` and `live` match.
47
+ 3. **Promote it.** Run `joiner tiles promote "$CREATOR_V2_BOUND_TILE_ID" <version>` and leave live pinned afterwards so the next edit stays a test version. Never run `auto-advance` or `set-channel`: pinning live and maintaining the test channel belong to the platform. Report the command's result, and never report a promotion you did not see succeed. Players receive the new version on their next open, not instantly; do not say everyone has it now.
48
+ 4. **Check the gallery after the promotion.** Do this only when you promoted the `test` channel's version, which is the build of the current workspace. Then follow **Gallery screenshots** below. It never delays or replaces the promotion, so ask any question there after you report the result. On a rollback to an older version, skip the gallery check: the workspace does not show that version, so its screenshots cannot be checked against it. Say that the gallery was left alone.
49
+ 5. **Put a changed gallery on the live listing.** Players see the listing of the `live` version, and the version you promoted was uploaded with its old gallery. So when step 4 changed `.poe-tile.json → screenshots`, run `joiner tiles set-gallery "$CREATOR_V2_BOUND_TILE_ID" --dir <tileDir>`, with `<tileDir>` the directory of that `.poe-tile.json`. It sends the manifest's images to the live version, keeps the preview video, and needs no upload. Skip it when step 4 kept the images, and when no image remained after a capture: the command replaces the whole gallery, so an empty list would clear it. Report its result, and never report a gallery change you did not see succeed. If it fails, say that players keep the old gallery until the next publish; the promotion still stands.
50
+
51
+ ## Gallery screenshots
52
+
53
+ The gallery is the 1–3 images on the tile's detail card in discovery. Both actions put it in front of players, so check it every time, except after a rollback (see step 4 of **Publish a version to players**). Read `.poe-tile.json → screenshots` and open each image it lists. Then pick the one case that applies:
54
+
55
+ - **No screenshots are declared.** Capture them now. Do not ask. Run the tile and capture 1–3 images (PNG, JPG or WEBP, each ≤512 KB). At least one must show real play or a well-populated main state. A title screen, empty lobby, untouched starting board or first frame is not enough. Save them in the tile directory, but not under `.visual-checks/`, because uploads exclude that folder and it is temporary. Measure each file in bytes (`wc -c < <path>`). Re-encode any file over 524,288 bytes as WEBP, or downscale it, and measure it again. Delete a file that stays over 524,288 bytes. The upload rejects it and fails the whole publish, which also consumes a listing request. Then add the paths of the files that remain, in order, to `.poe-tile.json → screenshots`. Never add a path to a file over 524,288 bytes. `tile-creator`'s scaffolding reference, Step 5.5 item 7, has the full method. A capture that fails, or that stays over the size limit, does not block the action. Add no path for it. If no image remains, say that the tile still has no gallery.
56
+ - **The screenshots probably show a different tile than players will get.** Compare the images with what the tile looks like now: its current UI code and what changed in this conversation. Treat them as stale when the art, theme or palette changed, the layout was rebuilt, the main screen or core mechanic is different, or an image shows UI that no longer exists. Then use `ask_user` to ask whether to capture new ones. Name what changed. Capture again only if they say yes, the same way as above, including the size check. Replace a listed path only with a new image that is within the limit; keep the old image when its replacement is not. If they say no, keep the current images.
57
+ - **The screenshots still match.** Keep them and do not ask. Copy edits, balance changes, bug fixes and small style changes do not make screenshots stale.
58
+
59
+ Before you capture, in either case, call `update_plan` with the steps that remain in this turn. Capturing takes minutes, and without a plan the creator sees only command rows and cannot tell what is taking so long. For example: run the tile, capture the screenshots, add them to `.poe-tile.json`, then request listing. After a promotion you already reported the result, so that plan ends with `tiles set-gallery`. Update the plan as each step finishes.
60
+
61
+ Keep each capture run short. Playing the tile in real time, one player after another, can take ten minutes or more per run, and 3D renders slowly in a sandbox with no graphics card:
62
+
63
+ - Write one script that opens every player at the same time and captures all the images in one run. For two players, use `openTwoUserTile` from the scaffold's `tests/multiplayer.ts` when the tile has it. To retake one image, do not play the whole flow again for the others.
64
+ - Get to each state you show with the fewest actions that produce it. When the tile waits on a timer that runs in the browser, such as a round countdown or a walk animation, advance it with Playwright's `page.clock` instead of waiting in real time. The clock controls only timers that start after `page.clock.install()`. It belongs to the browser context, not the page: every page in one context shares one clock, so each player needs a context of their own. `openTwoUserTile` opens one per player; call `install()` on each page it returns, after it resolves and before the action that starts the timer, then call `page.clock.runFor()`. A timer that starts when the page loads needs pages you open yourself. Create one `browser.newContext()` per player, admit each player with `server.addUserToInstance` (a shared instance ID alone does not admit the second player), then for each player run `context.newPage()`, then `page.clock.install()`, then `page.goto()`. `tile-creator`'s e2e-tests reference, **Multi-User Sync Tests**, has this two-context recipe. Do not add capture-only code to the tile.
65
+ - Wait for the state you expect, with a short timeout for each step (about 15 seconds). Never use fixed sleeps or a timeout of minutes. Listen for page errors, and stop at the first one and read it instead of waiting for a timeout.
66
+
67
+ New images reach players this way: when you list, the host uploads them in the version `request_listing` puts live; after a promotion, `tiles set-gallery` (step 5 of **Publish a version to players**) puts them on the live version, and the end-of-turn preview records them in the next test version as well. Do not upload a build yourself.
68
+
69
+ ## What this command never does
70
+
71
+ - It never changes visibility on its own. Listing goes through `request_listing`; a promotion moves a version, not a listing. Offer no visibility choice at any point — a publish cannot set one.
72
+ - It never uploads a build. The host has already published the preview; running the upload yourself records a second version for the same work. `tiles set-gallery` is not an upload: it changes only the live gallery.
73
+ - It never promotes or lists because the work looks finished. Only this explicit request authorizes an action, and it authorizes one.