garethpaul/poe-games-procedural-dungeons / .claude/skills/tile-creator
tile-creator
VerifiedScaffold, implement, test, and deploy a new Poe tile from a prompt.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 39.1 KB |
| references/assets.md | markdown | 2.5 KB |
| references/backend-api.md | markdown | 9.6 KB |
| references/cli-limitations.md | markdown | 90 B |
| references/cli.md | markdown | 15.5 KB |
| references/client-api.md | markdown | 101.8 KB |
| references/composing-apps.md | markdown | 12.6 KB |
| references/e2e-tests.md | markdown | 13.3 KB |
| references/game-ux-best-practices.md | markdown | 17.1 KB |
| references/migrating-pre-rename-tiles.md | markdown | 2.3 KB |
| references/running-the-client-api-on-a-server-owned-by-the-user.md | markdown | 4.0 KB |
| references/safe-area-insets.md | markdown | 4.6 KB |
| references/sandbox-limitations.md | markdown | 1.0 KB |
| references/scaffolding-a-new-app.md | markdown | 15.4 KB |
| references/synced-store-client-reference.md | markdown | 3.9 KB |
| references/troubleshooting.md | markdown | 4.2 KB |
| references/unit-tests.md | markdown | 21.0 KB |
| references/vite-plugin.md | markdown | 2.7 KB |
references/vite-plugin.md
View on GitHub<!-- owner: jyoung-q -->
# Vite Plugin
The `poeTile()` Vite plugin handles the Poe-specific build concerns that every bundled iframe app needs. Import it from `poe-tiles-sdk/vite`.
```typescript
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { poeTile } from "poe-tiles-sdk/vite";
export default defineConfig({
root: "tile",
build: {
outDir: "../dist",
emptyOutDir: true,
rollupOptions: {
output: {
entryFileNames: "tile-frontend.js",
assetFileNames: "[name][extname]",
},
},
},
plugins: [react(), poeTile()],
});
```
The plugin handles:
- **Externals** — Prevents bundling platform-provided modules (`poe-tiles-sdk/v1/client.js`) since these are provided at runtime via import map.
- **Code splitting** — Rewrites dynamic `import()` calls to load chunks via `Poe.getBundleAssetUrl()`, which returns blob URLs that work in sandboxed iframes.
- **Vendor extraction** — Shared dependencies (from `node_modules`) are automatically extracted into a `vendor` chunk so they aren't duplicated across lazy chunks.
- **Backend building** — Optionally builds the synced-store backend config as part of the Vite build.
The plugin does **not** set `root`, `outDir`, `entryFileNames`, or `assetFileNames` — consumers control their own directory structure and output naming via standard Vite config.
## Backend Config Building
Pass `backendEntryPoint` to build the synced-store backend config automatically after the Vite build:
```typescript
export default defineConfig({
root: "tile",
build: { outDir: "../dist" },
plugins: [
react(),
poeTile({ backendEntryPoint: "src/backend.ts" }),
],
});
```
The path is resolved relative to the Vite root directory. The output (`synced-store-backend-config.js`) is placed in the Vite output directory. This eliminates the need for a separate `buildBackend()` call in your build script.
## Code Splitting
Dynamic `import()` calls are rewritten so that chunks are loaded via `Poe.getBundleAssetUrl()`. This is more reliable than normal browser-cached imports — the browser's HTTP cache may evict entries at any time, so lazy-loaded chunks fetched over the network can fail offline. Assets loaded via `Poe.getBundleAssetUrl()` are stored in IndexedDB by the top document, so they remain available even without a network connection.
## No-Build vs Bundled
| | No-Build | Bundled |
|---|---|---|
| Import | `poe-tiles-sdk/v1/client.js` | `poe-tiles-sdk/v1/client.js` |
| Schema | Inline mutators | `defineSchema()` + `defineClientConfig()` |
| Config | `{ mutators, schemaVersion }` | Pre-built client config object |
| Types | None (plain JS) | Full type inference from Zod schema |
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |