subscription-billing
Skill8 starsChanged 7 months agoMITView on GitHub
Stripe subscription lifecycle, plan upgrades/downgrades, usage metering, and billing portal.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- sadrmanesh/commerce-agent-skillstheir own version, first seen Nov 16, 2026
- peterbamuhigire/chwezi-dev-enginetheir own version, first seen Nov 15, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- peterbamuhigire/chwezi-dev-engine★ 31same name
- sadrmanesh/commerce-agent-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository110 other files it gives its agents.
- yepapiSkill
- ab-testingSkill
- accessibilitySkill
- admin-panelSkill
- ai-agentsSkill
- ai-chatbotSkill
- ai-visibilitySkill
- analyticsSkill
- animationsSkill
- api-designSkill
- api-documentationSkill
- api-securitySkill
- auth-securitySkill
- authSkill
- background-jobsSkill
- backlink-researchSkill
- blog-engineSkill
- caching-strategySkill
- chartsSkill
- cli-toolsSkill
- code-reviewSkill
- command-paletteSkill
- comments-discussionsSkill
- competitor-researchSkill
- content-marketingSkill
- content-researchSkill
- content-strategySkill
- copywritingSkill
- cron-jobsSkill
- csrf-protectionSkill
- dark-modeSkill
- dashboard-designSkill
- databaseSkill
- data-encryptionSkill
- data-pipelinesSkill
- data-visualizationSkill
- dependency-securitySkill
- deploymentSkill
- drag-and-dropSkill
- drizzle-ormSkill
- e2e-testingSkill
- e-commerceSkill
- email-marketingSkill
- emailSkill
- error-handlingSkill
- error-securitySkill
- express-fastifySkill
- feature-flagsSkill
- file-uploadsSkill
- financial-planningSkill
- formsSkill
- funnel-analyticsSkill
- gdpr-complianceSkill
- git-workflowSkill
- i18nSkill
- image-optimizationSkill
- infinite-scrollSkill
- input-validationSkill
- invoice-generatorSkill
- keyword-researchSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 43
Call API route that runs stripe.subscriptions.update({ items: [{ id, price: newPriceId }] })
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Subscription Billing
Rules
- Stripe Subscriptions API for recurring billing — never build custom recurring charge logic
- Webhook-driven: listen to
customer.subscription.created,updated,deleted,invoice.paid,invoice.payment_failed - Plan changes: use
stripe.subscriptions.update()withproration_behavior: 'create_prorations'for upgrades/downgrades - Customer Portal: use Stripe Billing Portal for self-service plan management —
stripe.billingPortal.sessions.create() - Usage metering: report usage with
stripe.subscriptionItems.createUsageRecord()— aggregate locally, report to Stripe hourly or daily - Trial periods: set
trial_period_dayson the subscription — send reminder email 3 days before trial ends - Payment failures: handle
invoice.payment_failed— retry logic is Stripe-managed, update user status after final failure - Sync plan status: store
subscriptionId,planId,status,currentPeriodEndin your database — update on every webhook
Subscription Sync Pattern
// Webhook handler
case "customer.subscription.updated": {
const subscription = event.data.object;
await db.user.update({
where: { stripeCustomerId: subscription.customer },
data: {
plan: subscription.items.data[0].price.lookup_key,
subscriptionStatus: subscription.status,
currentPeriodEnd: new Date(subscription.current_period_end * 1000),
},
});
break;
}Plan Change Flow
- User selects new plan in UI
- Call API route that runs
stripe.subscriptions.update({ items: [{ id, price: newPriceId }] }) - Stripe fires
customer.subscription.updatedwebhook - Webhook handler syncs new plan to database
- UI reflects new plan on next load
Avoid
- Trusting client-side plan status — always check database (synced from webhooks)
- Building custom retry logic for failed payments — Stripe handles retries
- Skipping proration on plan changes — users get confused by billing amounts
- Missing
invoice.payment_failedhandler — users stay on paid plan without paying
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

