subscription-billing
Installation
SKILL.md
Subscription & Billing Logic
Overview
Once payments-stripe syncs subscription state into your database, you need to turn that state into behavior: which features are unlocked, which limits apply, what happens when a plan lapses. Model plans as data, store the org's current plan + status, and expose one entitlement(org) check the whole app uses. Enforce limits on the server, where they can't be bypassed.
When to use
- Different plans unlock different features or limits (seats, projects, API calls).
- You need paywalls, usage caps, or "upgrade to continue" gates.
- Handling trials, past-due, and cancelled states gracefully.
Model plans as data
// src/server/billing/plans.ts
export type PlanId = "free" | "pro" | "scale";