skills/stripe/SKILL.md
Use when adding payments, billing, checkout, subscriptions, invoices, webhooks, customer portal, Stripe Connect, metered/usage billing, tax, fraud/Radar, pricing page, payment intents, refunds, coupons, promo codes, or any Stripe integration in Next.js. Triggers: stripe, payment, checkout, subscribe, billing, invoice, webhook, portal, connect, marketplace, payout, metered, usage-based, SaaS pricing, paywall, plan, tier.
npx skillsauth add clownnvd/claude-code-skills stripeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Complete Stripe integration patterns for Next.js App Router with Server Actions and Route Handlers.
npm install stripe @stripe/stripe-js @stripe/react-stripe-js
Copy templates/env-example.txt → .env.local and fill in your keys from Stripe Dashboard.
| Env Variable | Value | Exposed to Client |
|-------------|-------|-------------------|
| STRIPE_SECRET_KEY | sk_test_... or sk_live_... | NO |
| NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY | pk_test_... or pk_live_... | Yes |
| STRIPE_WEBHOOK_SECRET | whsec_... | NO |
| NEXT_PUBLIC_APP_URL | http://localhost:3000 | Yes |
Copy templates/stripe-server.ts → lib/stripe.ts and templates/stripe-client.ts → lib/stripe-client.ts.
Load references/setup.md for details.
| Task | Approach | Reference |
|------|----------|-----------|
| One-time payment | Checkout Session → redirect to Stripe | references/checkout.md |
| Custom payment UI | Payment Intents + Stripe Elements | references/payment-intents.md |
| Recurring billing | Subscriptions + Invoices | references/subscriptions.md |
| Receive events | Webhook Route Handler | references/webhooks.md |
| Self-service billing | Customer Portal session | references/customer-portal.md |
| Products & pricing | Products + Prices API | references/products-prices.md |
| Marketplace splits | Stripe Connect | references/connect.md |
| Auto tax calc | Stripe Tax | references/tax.md |
| Fraud prevention | Radar rules + 3D Secure | references/radar-fraud.md |
| Usage-based billing | Billing Meter + usage records | references/billing-meter.md |
| Pricing page | Server-fetched prices + checkout button | references/pricing-page.md |
| Stripe ↔ DB sync | Webhook → database update patterns | references/database-sync.md |
| Paywall / auth guard | Middleware + Server Component guards | references/middleware-guard.md |
| Event | When | Action |
|-------|------|--------|
| checkout.session.completed | Payment captured | Fulfill order |
| invoice.paid | Subscription renewed | Extend access |
| invoice.payment_failed | Payment failed | Notify user, retry |
| customer.subscription.updated | Plan changed | Update entitlements |
| customer.subscription.deleted | Cancelled | Revoke access |
| payment_intent.succeeded | Custom flow completed | Confirm order |
| charge.dispute.created | Dispute opened | Alert + evidence |
Load references/webhooks.md for handler implementation.
| Number | Result |
|--------|--------|
| 4242 4242 4242 4242 | Success |
| 4000 0000 0000 0002 | Generic decline |
| 4000 0000 0000 9995 | Insufficient funds |
| 4000 0000 0000 0069 | Expired card |
| 4000 0025 0000 3155 | 3D Secure required |
| 4000 0000 0000 3220 | 3D Secure 2 required |
Load references/testing.md for full test cards + Stripe CLI workflow.
stripe login
stripe listen --forward-to localhost:3000/api/webhooks/stripe
stripe trigger checkout.session.completed
stripe trigger invoice.payment_failed
stripe logs tail --filter status:400
| Template | Copy To | Description |
|----------|---------|-------------|
| templates/stripe-server.ts | lib/stripe.ts | Server-side Stripe instance |
| templates/stripe-client.ts | lib/stripe-client.ts | Client-side Stripe.js (lazy) |
| templates/webhook-handler.ts | app/api/webhooks/stripe/route.ts | Webhook Route Handler |
| templates/checkout-action.ts | app/actions/checkout.ts | Server Action: Checkout Session |
| templates/subscription-action.ts | app/actions/subscription.ts | Server Actions: subscription CRUD |
| templates/customer-portal-action.ts | app/actions/portal.ts | Server Action: portal session |
| templates/env-example.txt | .env.local | Environment variables |
Load references/error-handling.md for Stripe error types and retry patterns.
Load references/security.md for PCI compliance, idempotency, and key management.
references/setup.md — SDK init, singleton, TypeScript configreferences/checkout.md — Checkout Sessions, hosted vs embeddedreferences/payment-intents.md — Payment Intents, 3D Secure, capturereferences/subscriptions.md — Recurring billing, trials, prorationreferences/webhooks.md — Signature verification, event routing, idempotencyreferences/customer-portal.md — Self-service portal setupreferences/products-prices.md — Products, Prices, coupons, promo codesreferences/connect.md — Marketplace, platform fees, payoutsreferences/tax.md — Automatic tax calculationreferences/radar-fraud.md — Fraud detection, disputesreferences/billing-meter.md — Usage-based billingreferences/error-handling.md — Error types, retry logicreferences/testing.md — Test cards, CLI, test clocksreferences/security.md — PCI, keys, idempotency, CSPreferences/pricing-page.md — Pricing page component patternreferences/database-sync.md — Stripe ↔ DB sync patternsreferences/middleware-guard.md — Auth middleware for paid routestesting
Battle-tested SEO+GEO playbook to rank on page 1 and get cited by AI answer engines. Use when writing or optimizing posts, adding JSON-LD schema, fixing technical SEO, or diagnosing rankings.
tools
Zustand v5 state management for Next.js 16. Store patterns, middleware (persist/immer/devtools), SSR hydration, CV editor multi-step wizard, 20 documented errors. Triggers: zustand, store, state management, useState replacement, global state, persist, immer.
development
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
development
Ultimate UI/UX design intelligence with real app flow knowledge. 93 styles, 121 palettes, 81 font pairings, 35 charts, 79 components, 62 animations, 65 WCAG criteria, 46 responsive patterns, 46 dark mode rules, 60 design tokens, 13 stacks. PLUS: Claude.ai full UI blueprint (19 flows, all screens), PageFlows app patterns. Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check, clone, recreate, rebuild. Styles: glassmorphism, brutalism, neumorphism, bento, dark mode, view transitions, scroll-driven, container queries, AI-native, liquid glass, neo-minimalism, mesh gradient, geometric abstraction. Topics: color, accessibility, animation, layout, typography, spacing, shadow, gradient, responsive, dark mode, WCAG 2.2, design tokens, components, spring physics, kinetic typography, container queries, popover API, semantic tokens. Apps: claude.ai, ChatGPT-style, AI chat UI, SaaS dashboard.