add-stripelisted
Install: claude install-skill brabos-ai/code-addiction
# Stripe Integration
<!-- uses:
- skill: add-stripe/stripe-doc.md
-->
Stripe integration for SaaS.
**Principle:** Never edit an existing price. Create a new one and keep existing customers on the previous price (grandfathering).
## When NOT to use
- Non-Stripe payment processors (PayPal, Paddle, Lemon Squeezy)
- One-time payments without subscriptions
- Pure frontend Stripe.js setup (Elements, Checkout redirects)
## Database Schema
**Migration:** `libs/app-database/migrations/20250101001_create_initial_schema.js`
```
plans → plan_prices → subscriptions → payment_history
```
## Quick Reference
{"api":{"createPlan":"stripe.products.create()","createPrice":"stripe.prices.create()","deactivatePrice":"stripe.prices.update({active:false})","createSub":"stripe.subscriptions.create()","cancelSub":"stripe.subscriptions.cancel()"}}
Query docs: `Grep pattern="<term>" path="{{skill:add-stripe/stripe-doc.md}}"`
## Essential Flows
### Create Plan + Price
```typescript
// 1. Product (plan)
const product = await stripe.products.create({
name: 'Pro',
metadata: { plan_code: 'pro' }
});
// 2. Price (amount)
const price = await stripe.prices.create({
product: product.id,
unit_amount: 9900, // $99.00
currency: 'usd',
recurring: { interval: 'month' }
});
// 3. Save locally
await db.insertInto('plans').values({ stripe_product_id: product.id, code: 'pro', name: 'Pro' });
await db.insertInto('plan_prices').values({ plan_id, stripe_price_id: price.id, amount: 9900, is_curre