$npx -y skills add popmechanic/VibesOS --skill launchSelf-contained SaaS pipeline — invoke directly, do not decompose.
| 1 | > **Plan mode**: If you are planning work, this entire skill is ONE plan step: "Invoke /vibes:launch". Do not decompose the steps below into separate plan tasks. |
| 2 | |
| 3 | **Display this ASCII art immediately when starting:** |
| 4 | |
| 5 | ``` |
| 6 | ░▒▓█▓▒░ ░▒▓████████▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓███████▓▒░░▒▓██████▓▒ ░▒▓█▓▒░░▒▓█▓▒░ |
| 7 | ░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ |
| 8 | ░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓████████▓▒░ |
| 9 | ░▒▓█▓▒░ ░▒▓████████▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ |
| 10 | ░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ |
| 11 | ░▒▓████████▓▒░▒▓█▓▒░░▒▓█▓▒░░▒▓██████▓▒░░▒▓█▓▒░░▒▓█▓▒░░▒▓██████▓▒░▒▓█▓▒░░▒▓█▓▒░ |
| 12 | ``` |
| 13 | |
| 14 | ## Notation |
| 15 | |
| 16 | **Ask [Header]**: "question" means call AskUserQuestion with that header and question. Options listed as bullets. User can always type custom via "Other". |
| 17 | |
| 18 | For architecture context, see `LAUNCH-REFERENCE.md` in this directory. |
| 19 | |
| 20 | --- |
| 21 | |
| 22 | ## FIRST: Terminal or Editor UI? |
| 23 | |
| 24 | **This is the very first question — ask before anything else.** |
| 25 | **DO NOT check .env, credentials, or project state before asking this question.** |
| 26 | **DO NOT invoke any other skill before asking this question.** |
| 27 | **If Editor is chosen, skip ALL remaining steps — the editor handles everything.** |
| 28 | |
| 29 | Ask the user: |
| 30 | > "How do you want to build? **Editor** (opens a browser UI with live preview, chat, and deploy button) or **Terminal** (I'll generate and deploy from here)?" |
| 31 | |
| 32 | Present Editor as the first/recommended option. |
| 33 | |
| 34 | - **If Editor**: Start the editor server and **END YOUR TURN. Do not ask any more questions. Do not continue to Phase 0 or any phase below.** The editor UI handles the entire workflow — setup, generation, preview, deploy. |
| 35 | |
| 36 | Launch the editor server: |
| 37 | ```bash |
| 38 | VIBES_ROOT="${CLAUDE_PLUGIN_ROOT:-$(dirname "$(dirname "${CLAUDE_SKILL_DIR}")")}" |
| 39 | bun "$VIBES_ROOT/scripts/server.ts" --mode=editor --prompt "USER_PROMPT_HERE" |
| 40 | ``` |
| 41 | If no prompt was given, omit `--prompt`: |
| 42 | ```bash |
| 43 | VIBES_ROOT="${CLAUDE_PLUGIN_ROOT:-$(dirname "$(dirname "${CLAUDE_SKILL_DIR}")")}" |
| 44 | bun "$VIBES_ROOT/scripts/server.ts" --mode=editor |
| 45 | ``` |
| 46 | Tell the user: "Open http://localhost:3333 — the editor handles everything from here." |
| 47 | **Your job is done. Stop. Do not read further. Do not proceed to any phase below.** |
| 48 | |
| 49 | - **If Terminal**: Continue with the workflow below. |
| 50 | |
| 51 | --- |
| 52 | |
| 53 | ## ⛔ EVERYTHING BELOW IS TERMINAL MODE ONLY |
| 54 | |
| 55 | **If the user chose Editor above, STOP. Do not read or execute anything below this line.** |
| 56 | **The editor UI handles setup, generation, preview, and deployment.** |
| 57 | |
| 58 | --- |
| 59 | |
| 60 | ## Auth Check (Terminal mode only — silent unless needed) |
| 61 | |
| 62 | Check for cached auth. Editor mode handles auth in the browser, so this only runs for Terminal: |
| 63 | |
| 64 | ```bash |
| 65 | VIBES_ROOT="${CLAUDE_PLUGIN_ROOT:-$(dirname "$(dirname "${CLAUDE_SKILL_DIR}")")}" |
| 66 | bun --input-type=module -e " |
| 67 | import { readCachedTokens, isTokenExpired } from '$VIBES_ROOT/scripts/lib/cli-auth.js'; |
| 68 | const tokens = readCachedTokens(); |
| 69 | if (tokens && !isTokenExpired(tokens.expiresAt)) { |
| 70 | console.log('AUTH_OK'); |
| 71 | } else { |
| 72 | console.log('AUTH_NEEDED'); |
| 73 | } |
| 74 | " |
| 75 | ``` |
| 76 | |
| 77 | - If `AUTH_OK` → proceed silently (do not mention auth) |
| 78 | - If `AUTH_NEEDED` → ask: "To deploy apps, you'll need a Vibes account. Sign in now? (A browser window will open for Pocket ID — takes about 10 seconds.)" |
| 79 | - If yes: |
| 80 | ```bash |
| 81 | VIBES_ROOT="${CLAUDE_PLUGIN_ROOT:-$(dirname "$(dirname "${CLAUDE_SKILL_DIR}")")}" |
| 82 | bun --input-type=module -e " |
| 83 | import { getAccessToken } from '$VIBES_ROOT/scripts/lib/cli-auth.js'; |
| 84 | import { OIDC_AUTHORITY, OIDC_CLIENT_ID } from '$VIBES_ROOT/scripts/lib/auth-constants.js'; |
| 85 | const tokens = await getAccessToken({ authority: OIDC_AUTHORITY, clientId: OIDC_CLIENT_ID }); |
| 86 | if (tokens) console.log('Signed in successfully!'); |
| 87 | " |
| 88 | ``` |
| 89 | Confirm success, then continue. |
| 90 | - If no → proceed anyway (auth will be needed at deploy time) |
| 91 | |
| 92 | --- |
| 93 | |
| 94 | ## Pre-Flight Check |
| 95 | |
| 96 | Only one check before collecting input: |
| 97 | |
| 98 | | # | Check | Command | If True | |
| 99 | |---|-------|---------|---------| |
| 100 | | 1 | app.jsx exists | `test -f app.jsx` | **Ask [Reuse]**: "app.jsx exists. Reuse it or regenerate?" If reuse: skip T1. | |
| 101 | |
| 102 | Auth and deploy credentials are handled automatically — no user setup needed. On first deploy, a browser window opens for Pocket ID login. Tokens are cached at `~/.vibes/auth.json`. |
| 103 | |
| 104 | ## Phase 0: Collect Inputs |
| 105 | |
| 106 | ### 0.1 App Prompt |
| 107 | |
| 108 | * |