$npx -y skills add popmechanic/VibesOS --skill factorySelf-contained SaaS pipeline — invoke directly, do not decompose. Generates a factory app with landing page, Stripe subscription checkout, Vibe Token economics, and deploys to Cloudflare Workers. Use when the user wants to monetize an app, add billing, create token-backed revenue
| 1 | > **Plan mode**: If you are planning work, this entire skill is ONE plan step: "Invoke /vibes:factory". 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 | |
| 15 | ## Quick Navigation |
| 16 | |
| 17 | - [Critical Rules](#-critical-rules---read-first-) - Read this first |
| 18 | - [Step 1: Pre-Flight](#step-1-pre-flight) - Verify prerequisites |
| 19 | - [Step 2: Subscription Pricing](#step-2-subscription-pricing) - Set monthly price |
| 20 | - [Step 3: AI Token Billing](#step-3-ai-token-billing) - Configure AI margins |
| 21 | - [Step 4: Vibe Token Config](#step-4-vibe-token-configuration) - Set revenue share |
| 22 | - [Step 5: Stripe Connect](#step-5-stripe-connect-onboarding) - Developer onboarding |
| 23 | - [Step 6: Deploy](#step-6-deploy) - Build and deploy |
| 24 | - [Step 7: Generate Invite Codes](#step-7-generate-invite-codes-optional) - Invite partners |
| 25 | |
| 26 | --- |
| 27 | |
| 28 | ## CRITICAL RULES - READ FIRST |
| 29 | |
| 30 | **DO NOT generate code manually.** This skill uses pre-built scripts and API calls: |
| 31 | |
| 32 | | Step | Tool | What it does | |
| 33 | |------|------|--------------| |
| 34 | | Assembly | `assemble-factory.js` | Generates unified index.html | |
| 35 | | Deploy | `deploy-cloudflare.js` | Deploys to Cloudflare Workers | |
| 36 | | Configure | `POST /app/configure` | Stores billing config in KV | |
| 37 | | Initialize | `POST /token/:appName/initialize` | Sets up Vibe Token economics | |
| 38 | | Grant | `POST /token/:appName/grant` | Grants tokens to partners | |
| 39 | |
| 40 | **Script location:** |
| 41 | ```bash |
| 42 | VIBES_ROOT="${CLAUDE_PLUGIN_ROOT:-$(dirname "$(dirname "${CLAUDE_SKILL_DIR}")")}" |
| 43 | ``` |
| 44 | |
| 45 | **Factory API base:** `https://factory.vibesos.com` |
| 46 | |
| 47 | --- |
| 48 | |
| 49 | # Factory - App Monetization Pipeline |
| 50 | |
| 51 | Transform your Vibes app into a revenue-generating SaaS with token-backed contributor rewards. |
| 52 | |
| 53 | ## Architecture |
| 54 | |
| 55 | The factory skill sets up: |
| 56 | - **Stripe Subscriptions** — flat monthly price + metered AI token billing |
| 57 | - **Vibe Token Economics** — revenue-sharing tokens for distribution partners |
| 58 | - **Factory Dashboard** — manage tokens, view revenue, process payouts |
| 59 | |
| 60 | All configuration is stored in the factory worker. Token state lives in a Durable Object per app. |
| 61 | |
| 62 | --- |
| 63 | |
| 64 | ### Terminal or Editor UI? |
| 65 | |
| 66 | Detect whether you're running in a terminal (Claude Code CLI) or an editor. **Terminal agents** use `AskUserQuestion` for all input. **Editor agents** present requirements as a checklist comment, wait for user edits, then proceed. See the vibes skill for the full detection and interaction pattern. |
| 67 | |
| 68 | ## Step 1: Pre-Flight |
| 69 | |
| 70 | **Before starting, verify these prerequisites. STOP if any check fails.** |
| 71 | |
| 72 | ### 1.1 Auth Check |
| 73 | |
| 74 | Auth is automatic — on first deploy, a browser window opens for Pocket ID login. Tokens are cached at `~/.vibes/auth.json` for subsequent deploys. |
| 75 | |
| 76 | ### 1.2 Detect Existing App |
| 77 | |
| 78 | ```bash |
| 79 | ls -la app.jsx 2>/dev/null || echo "NOT_FOUND" |
| 80 | ``` |
| 81 | |
| 82 | **Decision tree:** |
| 83 | - Found `app.jsx` -> Proceed to Step 2 |
| 84 | - Found multiple `riff-*/app.jsx` -> Ask user to select one |
| 85 | - Found nothing -> Tell user to run `/vibes:vibes` first |
| 86 | |
| 87 | ### 1.3 Check Existing Config |
| 88 | |
| 89 | ```bash |
| 90 | VIBES_ROOT="${CLAUDE_PLUGIN_ROOT:-$(dirname "$(dirname "${CLAUDE_SKILL_DIR}")")}" |
| 91 | APP_NAME="${1:-}" |
| 92 | if [ -n "$APP_NAME" ]; then |
| 93 | curl -s "https://factory.vibesos.com/connect/status/$APP_NAME" \ |
| 94 | -H "Authorization: Bearer $(cat ~/.vibes/auth.json | python3 -c "import sys,json; print(json.load(sys.stdin)['accessToken'])")" 2>/dev/null |
| 95 | fi |
| 96 | ``` |
| 97 | |
| 98 | If the app already has billing configured, offer to update or show current config. |
| 99 | |
| 100 | ### 1.4 Pre-Flight Summary |
| 101 | |
| 102 | > "Pre-flight checks passed: |
| 103 | > - App found (app.jsx) |
| 104 | > - Auth is automatic via Pocket ID |
| 105 | > |
| 106 | > Ready to configure your app factory." |
| 107 | |
| 108 | --- |
| 109 | |
| 110 | ## Step 2: Subscription Pricing |
| 111 | |
| 112 | Use AskUserQuestion: |
| 113 | |
| 114 | ``` |
| 115 | Question 1: "What should your app cost per month?" |
| 116 | Header: "Monthly Price" |
| 117 | Options: |
| 118 | - "$5/month" |
| 119 | - "$10/month" |
| 120 | - "$25/month" |
| 121 | - Other (enter custom amount) |
| 122 | Description: "This is the flat monthly subscription price. AI token usage is billed sepa |