Skip to content
Development
Skill

/cmux-billing

Stripe checkout, pricing, subscription, Pro plan, webhook, and entitlement runbook for cmux billing work. Use when editing or debugging billing, pricing, Stripe Checkout, subscription recording, Pro plan status, webhooks, entitlement metadata, or pricing dev/prod tooling.

From plugin
cmux
29k25 skills7 commands

Claude Code

$ npx -y skills add manaflow-ai/cmux --skill cmux-billing --agent claude-code

SKILL.md

cmux-billing.SKILL.md
name: cmux-billing
description: "Stripe checkout, pricing, subscription, Pro plan, webhook, and entitlement runbook for cmux billing work. Use when editing or debugging billing, pricing, Stripe Checkout, subscription recording, Pro plan status, webhooks, entitlement metadata, or pricing dev/prod tooling."

cmux Billing

Read before changing billing, pricing, Stripe, Pro entitlement, checkout, webhook, or subscription code.

Architecture map

  • `/api/billing/checkout` creates Stripe Checkout Sessions for Pro when `STRIPE_SECRET_KEY` is set. It sets `client_reference_id` to the Stack user id, auto-creates an anonymous Stack user for signed-out buyers, and falls back to the legacy Stack purchase path when Stripe is unset or `plan=team`. The "already active" short-circuit lives here.
  • `/api/billing/portal` resolves the current Stack user, looks up their `stripe_customers` row, and creates a Stripe customer portal session returning to `/pricing`.
  • `/api/billing/subscription` cancels or resumes the active Stripe Pro subscription; `/dashboard/billing` renders localized in-dashboard plan state and self-serve actions.
  • `web/services/billing/purchase.ts` is the shared idempotent recorder used by `/api/billing/complete` and `/api/stripe/webhook`. It attaches email to the purchaser, records `billing_email_claims` on conflict, and never cross-grants based on an unverified email.
  • VM code reads the plan from Stack `clientReadOnlyMetadata`: a non-empty `cmuxVmPlan` (operator override) takes precedence, otherwise `cmuxPlan` (the Stripe mirror) supplies the entitlement. `resolveProPlanStatus` reports Pro for an active `stripe_subscriptions` row or a paid `cmuxVmPlan` override (`pro`, `team`, `founders`); `billingManagement` stays Stripe-only, so a granted account shows Pro without a portal link.
  • The staff-only `/api/admin/*` routes let admins (a verified `cmux.com`, `manaflow.ai`, or `manaflow.com` email, or a verified email with an active `admin_members` row) search users, teams, and emails and: grant or remove the user `cmuxVmPlan` override (`/api/admin/users`), grant or remove a team override of `team` (`/api/admin/teams`), grant Pro to an email with no account yet (`/api/admin/email-grants`, stored in `admin_plan_grants` and applied by the after-sign-in callback once the mailbox is verified), and downgrade a paying customer by cancelling the Stripe subscription at period end (`/api/admin/subscriptions`, same service as the self-serve form). `services/admin/routeAuth.ts` `requireAdmin` is the gate (domain check in `services/admin/access.ts`); `members`, `audit`, and `pro-users` routes manage admin invites, the audit log, and the Pro roster. `services/admin/proGrants.ts` writes under the account-mutation lease and records `serverMetadata.cmuxAdminPlanGrant` (who, when, which plan). Non-admins get 403 on the API; the admin UI is not part of this repository and there is no admin page on cmux.com. The `admin_plan_grants` migration is an operator step; until it runs, pending email grants report 503 and search omits them.
  • `/api/stripe/webhook` is signature-verified, insert-first idempotent through `stripe_webhook_events`, safe for foreign events in the shared Stripe account, and gates cmux handling on `metadata.app === "cmux"`. Return 2xx only after durable writes; return 500 to make Stripe retry.

Dev workflow

  • Use `web/scripts/stripe/dev-stack.sh`.
  • Local `bun dev` accounts use the development Stack project and receive a

non-persistent Pro entitlement automatically. This applies only when `CMUX_LOCAL_DEV_PRO=1`, `NODE_ENV=development`, `VERCEL_ENV` is unset, and `NEXT_PUBLIC_STACK_PROJECT_ID` is the development project. Release and preview deployments remain billing-backed. Use `dev-grant.sh` only when testing an explicit manual grant or a non-local deployment.

  • The tagged app bakes `CMUX_PORT` into `Info.plist`; run the dev server on the tag's printed port, never a hardcoded one.
  • Per-branch Docker Postgres ports collide with other agents' containers. Use `--db-port` and never stop containers you did not create.
  • `/app-pricing` requires `cmux_app=1`. `cmux_scheme` threads the native deeplink return scheme; `cmux-dev-*` schemes are honored only for localhost requests.
  • Repeat dogfood: use a private window for a fresh anonymous buyer, and `web/scripts/stripe/dev-reset.sh <email>` to un-Pro a signed-in dev account before retesting checkout.
  • Fake payment, two ways: `web/scripts/stripe/dev-grant.sh <email>` writes `cmuxVmPlan: "pro"` directly (same override as `/api/admin/users`) (instant, no checkout; undo with dev-reset). For the full checkout path at $0, enter promotion code `CMUXDEV100` in test-mode checkout: a 100%-off forever coupon in the test account; `allow_promotion_codes` is already set on checkout sessions.
  • Newer Stripe CLI prints `stripe config --list` as `key=value` (older builds used `key = 'value'`); dev-stack.sh and dev-reset.sh accept both. If key extraction fails, re-run `stripe login`.

Catalog

Prices live in `web/services/billing/plans.ts` and are provisioned by `web/scripts/stripe/provision-catalog.sh`. Current checkout keys: `cmux-starter-monthly-15` ($15/mo, Plus; internal plan ID `go`), `cmux-pro-monthly-50` ($50/mo), `cmux-pro-yearly-480` ($480/yr, $40/mo equivalent), `cmux-max-monthly-200` ($200/mo), `cmux-max-yearly-1920` ($1,920/yr, $160/mo equivalent), and `cmux-team-monthly-60` ($60/user/mo). Pro and Max use the same 20% annual discount. Go and Team remain monthly-only. Go and Max are personal plans like Pro: the user-scoped subscription row's `plan` column is derived from its Price lookup key (`personalPlanIdForSubscription`), `cmuxPlan` mirrors the exact purchased plan, and every `isPro` check passes. Every Max and Pro CTA links `/api/billing/checkout`, and `web/services/billing/personalSwitchRoute.ts` decides where an existing subscription goes (the portal route uses the same function for old `flow=switch_plan` links, so the tw

Read more
@manaflow-ai
Ships withcmux

Open source Ghostty-based macOS terminal with vertical tabs and notifications for AI coding agents. Built for multitasking, organization, and programmability.

Stars on GitHub

Momentum

stars in total
28.6k
Star history of manaflow-ai/cmux on GitHub, a chart by star-history.com

Other skills on cmux.

cmux-architecture

cmux-architecture

cmux package architecture, refactor layering, dependency inversion, file organization, DocC documentation, package design…

@manaflow-ai@manaflow-aiInstall Skill
cmux-backend

cmux-backend

Backend TypeScript and Cloud VM development rules for cmux. Use when editing web/app/api, web/services, backend scripts, Cloud VM…

@manaflow-ai@manaflow-aiInstall Skill
cmux-browser

cmux-browser

End-user browser automation with cmux. Use when you need to open sites, inspect or interact with browser surfaces, wait for page…

@manaflow-ai@manaflow-aiInstall Skill
cmux-capture

cmux-capture

Screenshot or record a cmux window from the CLI, for a pull request, a bug report, or to see what the app actually looks like…

@manaflow-ai@manaflow-aiInstall Skill
cmux-cloud-vm

cmux-cloud-vm

Operate cmux Cloud machines, run durable remote commands or agents, and present their workspaces or services. Use for cmux…

@manaflow-ai@manaflow-aiInstall Skill
cmux-cua

cmux-cua

Use only after the user explicitly asks for cmux Computer Use through the cmux-cua skill: drive real macOS apps from a cmux agent…

@manaflow-ai@manaflow-aiInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills11d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about cmux-billing.

Which coding agents can use cmux-billing?
cmux-billing installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.