Self-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 sharing, or turn an app into a business.
npx skills add https://github.com/popmechanic/VibesOS --skill factory
> 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.
Display this ASCII art immediately when starting:
░▒▓████████▓▒░░▒▓██████▓▒░ ░▒▓██████▓▒░▒▓████████▓▒░░▒▓██████▓▒░░▒▓███████▓▒░░▒▓█▓▒░░▒▓█▓▒░
░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░
░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░
░▒▓██████▓▒░ ░▒▓████████▓▒░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓███████▓▒░ ░▒▓██████▓▒░
░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░░▒▓██████▓▒░ ░▒▓█▓▒░ ░▒▓██████▓▒░░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
DO NOT generate code manually. This skill uses pre-built scripts and API calls:
| Step | Tool | What it does |
|------|------|--------------|
| Assembly | assemble-factory.js | Generates unified index.html |
| Deploy | deploy-cloudflare.js | Deploys to Cloudflare Workers |
| Configure | POST /app/configure | Stores billing config in KV |
| Initialize | POST /token/:appName/initialize | Sets up Vibe Token economics |
| Grant | POST /token/:appName/grant | Grants tokens to partners |
Script location:
VIBES_ROOT="${CLAUDE_PLUGIN_ROOT:-$(dirname "$(dirname "${CLAUDE_SKILL_DIR}")")}"
Factory API base: https://factory.vibesos.com
Transform your Vibes app into a revenue-generating SaaS with token-backed contributor rewards.
The factory skill sets up:
All configuration is stored in the factory worker. Token state lives in a Durable Object per app.
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.
Before starting, verify these prerequisites. STOP if any check fails.
Auth is automatic — on first deploy, a browser window opens for Pocket ID login. Tokens are cached at ~/.vibes/auth.json for subsequent deploys.
ls -la app.jsx 2>/dev/null || echo "NOT_FOUND"
Decision tree:
app.jsx -> Proceed to Step 2riff-*/app.jsx -> Ask user to select one/vibes:vibes firstVIBES_ROOT="${CLAUDE_PLUGIN_ROOT:-$(dirname "$(dirname "${CLAUDE_SKILL_DIR}")")}"
APP_NAME="${1:-}"
if [ -n "$APP_NAME" ]; then
curl -s "https://factory.vibesos.com/connect/status/$APP_NAME" \
-H "Authorization: Bearer $(cat ~/.vibes/auth.json | python3 -c "import sys,json; print(json.load(sys.stdin)['accessToken'])")" 2>/dev/null
fi
If the app already has billing configured, offer to update or show current config.
> "Pre-flight checks passed:
> - App found (app.jsx)
> - Auth is automatic via Pocket ID
>
> Ready to configure your app factory."
Use AskUserQuestion:
Question 1: "What should your app cost per month?"
Header: "Monthly Price"
Options:
- "$5/month"
- "$10/month"
- "$25/month"
- Other (enter custom amount)
Description: "This is the flat monthly subscription price. AI token usage is billed separately."
Question 2: "Offer a free trial?"
Header: "Free Trial"
Options:
- "No trial"
- "7-day trial"
- "14-day trial"
Description: "Trial lets users try before paying. Stripe handles the trial period automatically."
Store: price (number, dollars), trialDays (number, 0/7/14)
Use AskUserQuestion:
Question: "Does your app use AI features?"
Header: "AI Billing"
Options:
- Label: "No AI features"
Description: "Skip AI billing setup"
- Label: "Yes, 2x margin (recommended)"
Description: "Customers pay 2x the model cost. You keep the difference."
- Label: "Yes, 3x margin"
Description: "Higher margin, customers pay 3x model cost."
- Label: "Yes, custom margin"
Description: "Enter your own multiplier."
If AI is enabled, explain:
> "OpenRouter routes to the underlying provider; the factory worker meters token usage per customer and posts events to a shared Stripe Billing Meter. Your customers will see AI usage as a line item on their monthly invoice alongside the flat subscription fee."
Store: aiMarginPercent (number: 0 for no AI, 200 for 2x, 300 for 3x, etc.)
Use AskUserQuestion:
Question: "What percentage of revenue should flow to token holders? This is locked forever."
Header: "Revenue Share (Alpha)"
Options:
- "10% — Conservative"
- "15% — Balanced"
- "20% — Generous (recommended)"
- "25% — Very generous"
- Other (enter custom %)
Description: "Alpha determines how much of each invoice goes to Vibe Token holders. Higher alpha = more attractive to partners, but less developer take-home. This cannot be changed after launch."
Store: alpha (number, 0.10-0.50)
Auto-calculate remaining parameters:
const k = Math.max((price * 12) / 10_000_000, 0.005);
const preMint = Math.round(100 * price * 12);
const initialPrice = k * Math.sqrt(1000); // price at s_min
Show summary and confirm:
Use AskUserQuestion:
Question: "Confirm these token economics? (This is permanent)"
Header: "Token Summary"
Options:
- "Confirm and proceed"
- "Go back and adjust"
Description: |
Revenue Share: {alpha*100}%
Pricing Constant (k): {k}
Treasury Size: {preMint} tokens
Initial Token Price: ${initialPrice.toFixed(4)}
Formula: P = {k} * sqrt(supply)
At 100 subscribers ($X/mo each):
- Monthly revenue: ${price * 100}
- Token holder pool: ${Math.floor(alpha * price * 100 * 100)/100}
- Token price: ${(k * Math.sqrt(1000 + preMint * 0.1)).toFixed(4)}
Get the auth token:
TOKEN=$(cat ~/.vibes/auth.json | python3 -c "import sys,json; print(json.load(sys.stdin)['accessToken'])" 2>/dev/null || echo "")
Create Stripe Connect account:
curl -s -X POST "https://factory.vibesos.com/connect/onboard" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d "{\"appName\": \"$APP_NAME\"}"
Expected response: { "ok": true, "url": "https://connect.stripe.com/...", "accountId": "acct_..." }
Open the onboarding URL in the user's browser:
open "$ONBOARD_URL" # macOS
Poll for completion:
while true; do
STATUS=$(curl -s "https://factory.vibesos.com/connect/status/$APP_NAME" \
-H "Authorization: Bearer $TOKEN")
COMPLETE=$(echo "$STATUS" | python3 -c "import sys,json; print(json.load(sys.stdin).get('complete', False))")
if [ "$COMPLETE" = "True" ]; then
echo "Stripe Connect onboarding complete!"
break
fi
sleep 5
done
Store: stripeConnectAccountId from the response
curl -s -X POST "https://factory.vibesos.com/app/configure" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d "{
\"appName\": \"$APP_NAME\",
\"stripeConnectAccountId\": \"$ACCOUNT_ID\",
\"price\": $PRICE,
\"aiMarginPercent\": $AI_MARGIN,
\"vibeToken\": {
\"alpha\": $ALPHA,
\"k\": $K,
\"preMint\": $PREMINT
}
}"
VIBES_ROOT="${CLAUDE_PLUGIN_ROOT:-$(dirname "$(dirname "${CLAUDE_SKILL_DIR}")")}"
bun "$VIBES_ROOT/scripts/assemble-factory.js" app.jsx index.html \
--app-name "$APP_NAME" \
--app-title "$APP_TITLE" \
--domain "$APP_NAME.vibesos.com" \
--tagline "$TAGLINE" \
--subtitle "$SUBTITLE" \
--billing-mode "required" \
--features "$FEATURES_JSON" \
--admin-ids '[]'
VIBES_ROOT="${CLAUDE_PLUGIN_ROOT:-$(dirname "$(dirname "${CLAUDE_SKILL_DIR}")")}"
bun "$VIBES_ROOT/scripts/deploy-cloudflare.js" \
--name "$APP_NAME" \
--file index.html
curl -s -X POST "https://factory.vibesos.com/token/$APP_NAME/initialize" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"
The initialize endpoint reads the billing config from KV and creates the VibeTokenDO with the correct alpha, k, and preMint values.
curl -s -o /dev/null -w "%{http_code}" "https://$APP_NAME.vibesos.com"
Expected: 200
Use AskUserQuestion:
Question: "Would you like to generate invite codes for distribution partners now?"
Header: "Distribution Partners"
Options:
- Label: "Yes, generate invites"
Description: "Create shareable codes that grant Vibe Tokens to whoever claims them."
- Label: "Skip for now"
Description: "You can generate codes later from the dashboard."
If generating invites:
Use AskUserQuestion (repeatable):
Question: "How many tokens should this invite grant?"
Header: "Invite tokens"
Options:
- "500 tokens"
- "1000 tokens"
- "2500 tokens"
- Other (enter amount)
For each invite, call the API:
RESULT=$(curl -s -X POST "https://factory.vibesos.com/invite/create" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d "{\"appName\": \"$APP_NAME\", \"tokens\": $TOKEN_AMOUNT}")
CODE=$(echo "$RESULT" | python3 -c "import sys,json; print(json.load(sys.stdin)['code'])")
URL=$(echo "$RESULT" | python3 -c "import sys,json; print(json.load(sys.stdin)['url'])")
echo "Share this URL: $URL"
Output:
Invite 1: {CODE} — {TOKENS} tokens
Claim URL: {URL}
Present the final summary:
> Your app factory is live!
>
> App URL: https://{appName}.vibesos.com
> Dashboard: https://factory.vibesos.com/dashboard/apps/{appName}
>
> Configuration:
> - Monthly price: ${price}/mo
> - AI margin: {aiMarginPercent}%
> - Revenue share (alpha): {alpha*100}%
> - Treasury: {preMint} tokens
> - Token price: ${initialPrice.toFixed(4)}
>
> What happens next:
> - Customers subscribe at your landing page
> - Revenue auto-distributes to token holders
> - Referrers earn new tokens from customers they bring
> - Monthly payouts transfer earnings to Stripe Connect accounts
> - Manage everything at the dashboard
Question: "Your factory is deployed! What would you like to do?"
Header: "Next"
Options:
- Label: "Open dashboard"
Description: "View your app at factory.vibesos.com/dashboard"
- Label: "Grant more tokens"
Description: "Invite additional distribution partners"
- Label: "Customize landing page"
Description: "Adjust colors, tagline, and features"
- Label: "I'm done for now"
Description: "Your factory is live and accepting customers"
Assess Kubernetes workloads and cluster configuration for AKS Automatic compatibility. Identifies incompatibilities, generates fixes, and guides migration from AKS Standard to AKS Automatic. WHEN: migrate to AKS Automatic, check AKS Automatic readiness, validate manifests for Automatic, assess cluster for Automatic compatibility, fix deployment for Automatic compatibility, identify AKS Automatic migration blockers, is my cluster ready for AKS Automatic.
Discovers available Azure OpenAI model capacity across regions and projects. Analyzes quota limits, compares availability, and recommends optimal deployment locations based on capacity requirements. USE FOR: find capacity, check quota, where can I deploy, capacity discovery, best region for capacity, multi-project capacity search, quota analysis, model availability, region comparison, check TPM availability. DO NOT USE FOR: actual deployment (hand off to preset or customize after discovery), quota increase requests (direct user to Azure Portal), listing existing deployments.
Interactive guided deployment flow for Azure OpenAI models with full customization control. Step-by-step selection of model version, SKU (GlobalStandard/Standard/ProvisionedManaged), capacity, RAI policy (content filter), and advanced options (dynamic quota, priority processing, spillover). USE FOR: custom deployment, customize model deployment, choose version, select SKU, set capacity, configure content filter, RAI policy, deployment options, detailed deployment, advanced deployment, PTU deployment, provisioned throughput. DO NOT USE FOR: quick deployment to optimal region (use preset).
Unified Azure OpenAI model deployment skill with intelligent intent-based routing. Handles quick preset deployments, fully customized deployments (version/SKU/capacity/RAI policy), and capacity discovery across regions and projects. USE FOR: deploy model, deploy gpt, create deployment, model deployment, deploy openai model, set up model, provision model, find capacity, check model availability, where can I deploy, best region for model, capacity analysis. DO NOT USE FOR: listing existing deployments (use foundry_models_deployments_list MCP tool), deleting deployments, agent creation (use agent/create), project creation (use project/create).
Intelligently deploys Azure OpenAI models to optimal regions by analyzing capacity across all available regions. Automatically checks current region first and shows alternatives if needed. USE FOR: quick deployment, optimal region, best region, automatic region selection, fast setup, multi-region capacity check, high availability deployment, deploy to best location. DO NOT USE FOR: custom SKU selection (use customize), specific version selection (use customize), custom capacity configuration (use customize), PTU deployments (use customize).
This skill should be used when working with LaminDB, an open-source data framework for biology that makes data queryable, traceable, reproducible, and FAIR. Use when managing biological datasets (scRNA-seq, spatial, flow cytometry, etc.), tracking computational workflows, curating and validating data with biological ontologies, building data lakehouses, or ensuring data lineage and reproducibility in biological research. Covers data management, annotation, ontologies (genes, cell types, diseases, tissues), schema validation, integrations with workflow managers (Nextflow, Snakemake) and MLOps platforms (W&B, MLflow), and deployment strategies.
Latch platform for bioinformatics workflows. Build pipelines with Latch SDK, @workflow/@task decorators, deploy serverless workflows, LatchFile/LatchDir, Nextflow/Snakemake integration.
Run Python code in the cloud with serverless containers, GPUs, and autoscaling. Use when deploying ML models, running batch processing jobs, scheduling compute-intensive tasks, or serving APIs that require GPU acceleration or dynamic scaling.
Take popmechanic/factory from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.