$npx -y skills add butterbase-ai/butterbase-skills --skill journey-planUse as stage 2 of the Butterbase journey, after journey-idea has written 01-idea.md. Translates the idea + capability map into a concrete Butterbase plan — tables (with columns/types/RLS shape), auth providers, function list (name + trigger), storage buckets, AI/RAG/realtime/dura
| 1 | # Journey: Plan |
| 2 | |
| 3 | Stage 2 of the guided journey. Turn the idea brief into an actionable Butterbase plan. |
| 4 | |
| 5 | ## When to use |
| 6 | |
| 7 | - Dispatched by `journey` when `current_stage: plan`. |
| 8 | - Directly via `/butterbase-skills:plan`. |
| 9 | |
| 10 | ## Inputs |
| 11 | |
| 12 | - `docs/butterbase/01-idea.md` (must exist — if absent, bounce back to `journey-idea`). |
| 13 | - `docs/butterbase/00-state.md` (for `hackathon_mode`, `hackathon_deadline`). |
| 14 | |
| 15 | ### External services — check built-ins first |
| 16 | |
| 17 | When the plan needs email, messaging, calendar, CRM, docs, or project-management integration: |
| 18 | |
| 19 | 1. Invoke `butterbase-skills:integrations` and call `manage_integrations` `action: "list_available"` to see what Composio covers for this app. |
| 20 | 2. If a toolkit fits, the plan should record "via manage_integrations (toolkit: <name>)" instead of naming an external SDK. |
| 21 | |
| 22 | When the plan needs payments: |
| 23 | |
| 24 | 1. Invoke `butterbase-skills:payments`. |
| 25 | 2. Default to Stripe Connect via `manage_billing` unless the user's region forces a fallback (see the payments skill). |
| 26 | 3. Record the choice ("Stripe Connect" or "<regional gateway> via function proxy") in the plan's Payments section. |
| 27 | |
| 28 | ## Procedure |
| 29 | |
| 30 | Work through these sections in order. After each section, write the result to `02-plan.md` before moving on. One question at a time per the spec's questioning discipline. |
| 31 | |
| 32 | 1. **Tables.** Read the capability map. Propose a starter table list with columns and types — recommend, don't ask blank. Example: `"Tables I'm seeing: users, orders, items. Missing any?"` Then for each table: `"<table>.<column>: should this be a uuid / text / int / timestamp / enum?"`. Confirm primary keys, foreign keys, indexes that are obvious (foreign-key columns). |
| 33 | |
| 34 | 2. **RLS model.** For each table: `"Can user A see user B's <table> rows? ① no, strict isolation ② yes, public-read ③ only shared via explicit grant."` Decide policy shape. In hackathon mode, prefer option ① and recommend `manage_rls action: create_user_isolation`. |
| 35 | |
| 36 | 3. **Auth.** `"OAuth providers: ① Google only ② Google + GitHub ③ email/password too ④ none (anonymous app)."` Also ask: `"Need a demo / judge account seeded? (hackathon mode only)"`. |
| 37 | |
| 38 | 4. **Functions.** For each function from the capability map: `"<name>: trigger = HTTP / cron / WebSocket? If cron: schedule? If HTTP: idempotency needed?"`. |
| 39 | |
| 40 | 5. **Storage.** If used: `"Which objects (avatars, attachments, …)? Public-read or per-user?"`. |
| 41 | |
| 42 | 6. **AI / RAG / realtime / durable.** Only if used. Capture model choice (AI), collections (RAG), tables to subscribe to (realtime), object kinds (durable). |
| 43 | |
| 44 | 6b. **Agents.** Only if `create_agent` is tagged in the idea. For each agent, capture: |
| 45 | - `name` (slug), one-line purpose. |
| 46 | - Tool surface: which builtins (`query_table`, `insert_row`, …), which functions (must exist in the Functions section), which MCP servers (URL + transport). |
| 47 | - Visibility: private | authenticated | public. If public AND any write tool is reachable, mark `safety_acknowledged_needed: true` and set per-IP / per-user / per-app rate limits + `daily_budget_usd`. |
| 48 | - Default model. |
| 49 | - Note that the agent record will **not** be carried by clone replay — the spec JSON (under `agents/<name>.json`) rides along in the repo snapshot, so this matters for the publish stage too. |
| 50 | |
| 51 | 7. **Frontend stack.** `"Frontend: ① Vite + React ② Next.js ③ static HTML ④ none (API-only)."` Write to `00-state.md` `frontend_stack`. |
| 52 | |
| 53 | 7b. **Publish-as-template.** Read `publish_as_template` from `00-state.md` front-matter (set by `journey-idea`). If `yes` or `unlisted`, plan for it now: |
| 54 | - README outline (one-liner, env-var-per-function list, OAuth setup, agent re-import, MCP server registration, seed data, first-run smoke). |
| 55 | - Which env vars use the auto-mint convention (`butterbase_api_key`) vs. require manual user input on clone. |
| 56 | - Whether `agents/*.json` files need to be exported and committed (yes if Agents section is non-empty). |
| 57 | - Note that publishing requires `butterbase repo push` to upload the source tree as a snapshot — without it, cloners get an empty file tree. |
| 58 | |
| 59 | ### Toolchain question |
| 60 | |
| 61 | Ask: "Will your app's code use `@butterbase/sdk` only in the frontend, only server-side (functions, scripts), or both?" Record under Toolchain → SDK surfaces. |
| 62 | |
| 63 | Ask: "Want to install `@butterbase/cli` for the local dev loop (logs, scaffolding, key rotation)? (yes/no — default yes)" Record under Toolchain → CLI usage. |
| 64 | |
| 65 | 8. **Scope cut (hackathon mode).** Re-read the must-haves list. For each, ask: `"Ship now or post-hackathon?"` Write the cut list int |