Use this skill when the user wants Stripe subscription billing for a Rails + Inertia.js + React + TypeScript app: Plan PORO, Account::Subscription, Account::Billing concern, Stripe Checkout, Billing Portal, plan switching (upgrade/downgrade), webhook-driven sync, admin comping, feature limits, admin notification settings, billing mailers, and the related frontend pages/tests.
Install Stripe subscription billing on a Rails 8 + Inertia.js + React + TypeScript project. The asset bundle is the source of truth and should overwrite the matching billing files in the target project.
stripe (via bundle add)Run:
bash $SKILL_DIR/scripts/setup.sh $PROJECT_ROOT
The setup script does all of this:
stripe gem and runs bundle installassets/ into the projectconfig/environments/development.rb to enable perform_deliveries (targeted patch, not overwrite)Enlead/enlead with the target app name (from config/application.rb)CLAUDE.md with the stripe-billing-guide note when that file exists.env entries for Stripe keys when missingThis skill intentionally overwrites the matching billing files. Modified files include the billing-enhanced versions on top of what auth-tenant provides.
The asset files use Enlead/enlead as template placeholders. The setup script replaces them with the target project's module name (extracted from config/application.rb). This covers:
"Your Enlead Pro subscription is active" → "Your MyApp Pro subscription is active")"Enlead <[email protected]>" → "MyApp <noreply@my_app.app>")"[Enlead]" → "[MyApp]")Files that are NOT overwritten (patched instead):
config/environments/development.rb — only adds perform_deliveries = trueCLAUDE.md — only inserts the stripe-billing-guide reference lineThe skill generates only these baseline migrations (consolidated from the implementation history):
CreateAccountSubscriptions — subscription state with scheduled plan change columnsCreateAccountBillingWaivers — admin compingCreateAccountUsageOverrides — admin usage overrides for testingCreateSiteSettings — admin notification settingsThose templates encode the final schema shape:
account_subscriptions: plan_key, stripe_customer_id (unique), stripe_subscription_id (unique, nullable), status, period dates, cancel_at, next_amount_due_in_cents, scheduled_plan_key, scheduled_starts_ataccount_billing_waivers: unique account_id, cascade FKaccount_usage_overrides: contacts, projects, team_members (all nullable integers)site_settings: notification_recipients (string), notify_new_subscription, notify_account_cancellation (booleans)After the script finishes, run:
bin/rails db:migrate
Run:
bin/rubocop --autocorrect
npm run check && npm run lint:fix
bin/rails test test/models test/integration test/mailers
See docs/stripe-billing-guide.md for the complete setup, including:
.env: STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET, STRIPE_MONTHLY_PRICE_ID, STRIPE_YEARLY_PRICE_ID, STRIPE_BILLING_PORTAL_CONFIGURATION_IDstripe listen --forward-to localhost:3000/stripe/webhooksAfter running the skill, customize:
Plan::PLANS in app/models/plan.rb (names, prices, limits, Stripe price IDs)Plan::PLANS limits hash + account_usage_overrides columns + Account::Limited#compute_usage_forapp/frontend/pages/pages/pricing.tsxcomponents/admin/app-sidebar.tsxapp/mailers/ and app/views/{subscription,account,admin_notification}_mailer/SiteSetting model toggles in app/models/site_setting.rbconfig/initializers/stripe.rb — update when upgrading the stripe gemThese files from the pre-billing admin settings structure are deleted:
app/controllers/admin/settings/billings_controller.rbapp/controllers/admin/settings/teams_controller.rbapp/frontend/pages/admin/settings/billing/ (directory)app/frontend/pages/admin/settings/team/ (directory)Treat the files in assets/ as the desired end state for billing behavior in this repo family. The docs/stripe-billing-guide.md is the architecture reference for future billing work.