--- name: studio-setup description: "Set up a Homie studio (one repository with games/, apps/, music/, videos/ and posts/, and a site with public game rooms on the studio's own Cloudflare) with the AI handling setup and defaults: setup status first (accounts and tools, what each unlocks, the exact fix), choose editable defaults, plan the requested game or app, build it with progress the person can watch, playtest, put it online and list it in the homie.rocks directory. Use when someone asks to set up, create or start a studio or a game studio, asks what they need or whether they are set up, or says \"set up a game studio called X\" (with or without \"and make a multiplayer game\")." compatibility: Node 22. Reads, and offers only when a feature needs them, each provider's own tools (Wrangler (Cloudflare, pinned in the studio), the GitHub CLI, official fal and ElevenLabs MCP connections, Cloudflare's official plugin, Stripe for the optional shop, and Ollama for Clef on this computer). The plugin's providers.json lists them. metadata: providers: cloudflare github elevenlabs fal stripe ollama --- **Apps:** For a business, venue, cause or customer app, follow the `app` skill: `apps//app.json`, one morphing screen, roles and parts. Reuse these engines and workflows; do not impose game rounds, scores, bots, a game demo or page navigation. The app check proves shared actions and reconnect; app stores use the same standalone command. # Set up a studio A Homie studio is ONE folder the person can see and open: `AGENTS.md` (+ `CLAUDE.md` importing it), `games/`, `apps/`, `music/`, `videos/`, `posts/`, and a site: a Cloudflare Worker with a D1 database and the Table/Lobby Durable Objects that serve the studio's pages and its public game rooms from the studio's **own** Cloudflare account, on Cloudflare. The code comes from `@homie-rocks/studio`, pinned in the studio's `package.json`. The person never types a command: you run everything, and they approve what matters (Cloudflare, once, in their browser). Homie for studios is in **beta**. ## The new-studio checklist Carry the request through without waiting between setup, planning, building and checking. Show brief progress, not a form. Choose the name from the request, otherwise "My Studio". The demo and small-change lesson below are optional, only for someone who asks for a tutorial. Plan from the premise with sensible engineering and design defaults; the person changes them later by asking. A business or non-profit may need an app or site: do not force a game or game interview. Use phone and computer controls, a small first version, local sound and CC0 art. New games use rules plus view with the server as host; read the game skill and RULES.md before coding. Build with one agent unless parallel work was requested. Keep provider approvals, paid budgets and required host holds. An existing request to go live or list is authorization; do not ask again outside those holds. **An app first:** For an app request, run `app new ` in the empty studio, build the requested roles and shared action, and run its app check. Give the `//open` link as soon as it passes; continue to the requested publish flow without a game demo or interview. The same keyless shop is optional, with its visible Shop control when something is for sale. **A Play link first.** Build the game to the point where it plays, run the two-browser `check`, and the moment it passes tell the person, with the link they can open now (`http://127.0.0.1:8787//play`, two tabs for two players): a first run should have someone playing in minutes, not after an hour of polish. Only then go on to sound, art, the playtest's fixes and the landing page, saying in a line what you are doing next. ## 0. Setup status, first Before anything is made, and whenever the person asks what they need, whether they are set up, or is waiting (a usage limit resetting is a good time), run the setup status. It only reads, takes a few seconds, and never prints a key: 1. With the Homie connector (the Homie MCP tool `studio_scaffold` is in your tool list), call it with the studio's name (if they have not named it yet, use "My Studio" for now; it only reads). It returns the exact pinned command, like `npx -y @homie-rocks/studio@ new "" --name "" --homie https://homie.rocks`, and a numbered list of next steps: this checklist decides the order, not that list. **Without the connector, go on** ("Without the connector" below): the toolkit is `@homie-rocks/studio` on npm, and `@latest` is its version here. 2. Run that same package with `setup status` instead of `new ...`: `npx -y @homie-rocks/studio@ setup status --connector yes --json` (inside a studio: `npx --no-install homie-studio setup status --connector yes --json`). If it does not know `setup status` (a toolkit older than 0.11.0 calls it unknown, or asks for a studio first), run `npx -y @homie-rocks/studio@latest setup status --connector yes --json` for the status only (it only reads). `--connector yes` because the Homie tools are in your tool list; if `studio_scaffold` is not there, say `--connector no` and run it from `@latest`. In Codex add `--client codex`, in Grok Build `--client grok`: the status then says whether Homie's holds are on (item 6), and when another MCP server has taken the connector's name. 3. Use the status internally. Report the current work in plain words and only the single next action that actually needs the person. You run `fix.run`; a provider sign-in is their browser approval. Do not make them understand runtimes, connectors, ids or optional providers. 4. **Never block on an optional row.** Say what it unlocks and that it can wait until that feature is wanted; the skill that needs it (`music`, `art`, `video`) offers it then. A "do this now" row you can do (`fix.run`, like `npx wrangler login` or `brew install ffmpeg`): run it yourself as part of setup. A row the person does on their own (`fix.open`) can be done any time, even while they wait for something else: give them the link. The optional "Clef on this computer" row is a large download: run it when they want Clef, saying its size in the same line (`ollama pull clef-flash`, about 11 GB). 5. Run it again whenever they say they did something, and tick the row. 6. **Homie's holds (Codex, Grok Build).** With `--client` the status has a `holds` row: whether Homie's hooks ran just now in this app (`"on": true`). When it is off, say so in one sentence in this first reply, with the row's fix. In Codex: "Homie's holds are off in this session: open `/hooks` and trust Homie's three hooks. Until then I'll ask you before a deploy you didn't ask for, a Cloudflare change or a paid call." In Grok Build: "Homie's holds are off in this session: install the Homie plugin again with `--trust` and start a new session. Until then I'll ask you before a deploy you didn't ask for, a Cloudflare change or a paid call." Then do ask, also when the app approves commands for you; a deploy the person asked for is already approved. When it is on, say nothing about it and change nothing: the hooks hold what they hold. A status with no `holds` row in Codex or Grok (a toolkit before 0.30.2) cannot tell: say the sentence anyway. **Without the connector, with a shell: go on.** A studio is made, checked, put online and listed with the studio's own commands; the connector is not needed for any of it. When the Homie tools are not in your tool list and you can run commands: - Say it once, in one line: "The Homie connector is not connected in this app, so I'm making the studio with its own commands. Connected, it adds the homie.rocks directory search, the cards where an app draws them, and notes to Homie." - The status is `npx -y @homie-rocks/studio@latest setup status --connector no --json`. Its connector row says why when it can tell: another MCP server named `homie` is set up in this app and has taken the name the plugin's connector uses. Its `fix.run` adds Homie's connector under its own name: run it yourself and never wait for it. - The studio is `npx -y @homie-rocks/studio@latest new --name ""` (step 1), and from then on `npx --no-install homie-studio …` inside it. - Where a step names a Homie MCP tool, run the command the same step names beside it (`game new`, `deploy`, `publish`, `stats`). Tell Homie is the connector's `homie_feedback` (in Claude Code also `/feedback`): where neither is here, make no offer. **Stop only when there is neither** the Homie tools nor a way to run a command. Then say exactly how to add the connector in that app, and stop: Claude Code, `/plugin`, install or enable "homie" (marketplace `homie-rocks/homie`), and `/mcp` shows it connected; Codex, `codex plugin marketplace add homie-rocks/homie` then `codex plugin add homie@homie` and a new session; Grok Build, `grok plugin install homie-rocks/homie#plugins/homie` and a new session; the Claude app, Grok chat or another app with connectors, a custom connector at `https://homie.rocks/mcp`. **Each provider's own tools, lazily.** Homie works through each provider's own CLI, plugin or MCP server (Wrangler for Cloudflare, the GitHub CLI, ElevenLabs' CLI, fal's MCP server), never a copy of their code: the plugin's `providers.json` lists them, with what stays Homie's (budgets and receipts, the kids rules, the owner's one-tap asks, secrets never in the chat, the rights notes). Offer one only when the person wants what it unlocks, in the skill that needs it; you install required tools and they sign in on the provider's own page. **The status line (Claude Code only).** When requested: `npx --no-install homie-studio statusline --install` (`--remove` takes it away). Claude Code reads the setting from the folder it was started in: if that is the folder above the studio (you made the studio as a subfolder), add `--project `. It never replaces a status line they already have; if it says so, leave theirs. Never turn it on unasked. In Claude Code 2.1.287 or later the Homie mod (part of this plugin) already draws the studio's band above the prompt and the Studio pane (`/studio`), so offer the status line only to someone who wants the line under the prompt as well. **Homie's holds in Codex.** In Codex, Homie's hooks hold what the mod holds in Claude Code: an edit to a file `studio.json` `"protect"` lists, a production deploy, a change to the studio's Cloudflare account outside its deploy, and a paid call past the budget or whose cost cannot be read first (a big file into git and a Clef model download only get a one-line warning); they refuse what the mod refuses, and take secrets out of what you read. Codex runs a plugin's hooks only after the person trusts them once: after installing Homie, tell them to open `/hooks` and trust Homie's three (until then nothing is held, so ask before each of those yourself). Never assume they are on: the setup status says which it is (item 6 above). A held call comes back refused with a code, and the person sees what it holds: say in a sentence what it would do and ask. They answer in their own message, `proceed ` (that exact call goes through once) or `cancel `; then run exactly the same call again, or not at all. Never write that answer yourself, in a command or a file: only the person's own message counts. `node /hooks/codex.mjs check -- ` (the folder above `skills/`) says what Homie would do with a command, and runs nothing. **Homie's holds in Grok.** In Grok Build, Homie's hooks (`hooks/grok.json`, deciding with the module the mod and the Codex hooks ask, `hooks/lib/holds.mjs`) hold and refuse the same calls as in Codex, and take secrets out of what you read. Grok runs a plugin's hooks only once the person has trusted the plugin (`grok plugin install homie-rocks/homie#plugins/homie --trust`, then a new session; `/hooks` lists them). Never assume they are on: the setup status with `--client grok` says which it is (item 6 above), and while it says off, before a production deploy, a Cloudflare change outside that deploy, a paid call or an edit to a file `studio.json` `"protect"` lists, say what it would do in one sentence and wait for the person's yes, also when Grok approves commands by itself; and never repeat a key or a token you read. A held call comes back denied with a code, and the person answers `proceed ` or `cancel ` in their own message, as in Codex; then run exactly the same call again, or not at all. Never write that answer yourself. In Grok chat (the connector only, no plugin) there are no hooks: ask, every time. `node /hooks/grok.mjs check -- ` says what Homie would hold, and runs nothing. ## Grok and Grok Bot In Grok Build the Homie plugin brings the connector (its tools read `homie__studio_scaffold` and the like); its hooks hold once the plugin is trusted (above). Say `--client grok` to the setup status. In Grok chat the connector is `https://homie.rocks/mcp`, once the person has added it. Use the one that is here; with neither, and a shell, go on without it (step 0). Do not send the person to Claude's GitHub app, to claude.ai/code, or to a button that only says "Connect to Claude". The studio's first-run band says **Connect this chat**. - **Cloudflare** stays one tap on Cloudflare's own page. Grok has no Cloudflare connector and must never ask for a token. On a phone, the setup card's "Make the studio on Cloudflare" is that tap. On a computer, `npx wrangler login` opens the same approval. - **This computer** is a Grok Bot, or Grok Build with a folder. Run the checklist here. When the chat has a setup id `hs_…`, check in once from the studio's own repository: `npx --no-install homie-studio setup attach --client grok`. That tells the directory Grok works in this repository. It does not need Claude's GitHub app. GitHub, when this chat already has it, is enough to push the branch and open the pull request. - **A build** the chat opened (`hb_…`): `npx --no-install homie-studio handoff --client grok`. The session fetches the brief itself. There is no Claude Code window to open, and no second session to start. ## 1. The studio Use the requested name, their business name, or "My Studio"; it can change later. Then say in two or three lines what will happen, and go on: you make the studio folder here (no game in it yet: its home page says "First game coming soon" until the first one is made); later, when it goes online, Cloudflare opens in their browser **once** to approve (a free account); on their account you will create one Worker, one D1 database and two Durable Objects, all free on the Workers Free plan; the homie.rocks directory lists the games (only the site's address, the studio's name, each game's name, blurb and Play link). 1. Call `studio_scaffold` with the name (and a folder if the person named one) and run the command it returns; without the connector, run `npx -y @homie-rocks/studio@latest new --name ""`. Either lists every file it writes and installs the pinned toolkit and `wrangler` (about 20 s). 2. Folder: the one the person named; otherwise a NEW folder named after the studio's slug inside the current directory (e.g. `./night-owls`). Never in a folder that already holds other files, never in the home folder, never outside the current directory. **Other studios in the same folder** (a folder beside this one with its own `studio.json`) are other people's work: never read them or copy from them, not even as a model for this studio or its game, unless the person asks. **An earlier attempt:** if a folder of this name already exists and is not a studio (notes, a plan, a charter from before), say so and ASK whether to fold its premise in: with a yes, copy its notes into the studio's `notes/earlier//` and use them in the plan; remove the old folder only with a second yes (to the Trash, so it can come back). Never delete or overwrite it unasked. 3. From here on run the studio's own copy: `npm run