agentleFS
silvioventresilvioventre/lovable-skills/skills/build/payments/SKILL.md

payments

Skill4 starsChanged 4 months agoMITView on GitHub

Use when the user wants to take money in their app or is working on something already taking it — "add payments", "add Stripe", "set up subscriptions", "add a pricing page with checkout", "sell a plan", "test the checkout flow", "go live with payments", "add a manage subscription button", "switch from Paddle to Stripe", "my subscription isn't unlocking features", "handle failed payments". Covers choosing a provider, building the entitlement logic, testing the full subscription lifecycle in the test environment, the go-live checklist, and the irreversible operations. Not for the server-side security of pricing and permissions, which the secure skill owns.

7 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    A project with payments cannot be remixed: If forking the project matters, that door closes when payments are enabled.

    line 38

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Payments

Payment bugs are expensive in a way other bugs are not — they charge people wrongly, or they hand out access nobody paid for, and both are discovered by customers rather than by you. Everything here is built around testing the full lifecycle before real money is involved.

Two environments, always

EnvironmentApplies toCardsMoney
Testthe previewtest cards onlynone
Livethe published appreal cardsreal

Each has its own products, prices, and transaction history. Publishing syncs products and prices from test to live automatically, so test is the source of truth for the catalogue — this is why editing products directly in the provider's dashboard causes ID mismatches and should be avoided.

Both stay active after going live, so new products and changes get tested in the preview before they reach paying customers.

Route the task

The taskPlaybook
Choosing a provider, enabling paymentsreference/setup.md
Products, prices, checkout, entitlementsreference/setup.md
Testing a purchase or the subscription lifecyclereference/testing.md
"Subscription isn't unlocking features"reference/testing.md
Going live, readiness check, verificationreference/go-live.md
Disconnecting, switching providerreference/changing.md

Before doing anything irreversible

Three operations here cannot be undone. Say so plainly before performing any of them, and get explicit confirmation.

  • Disconnecting payments is permanent. The same provider account cannot be reconnected to the same project afterwards. Setting payments up again requires a different provider account.
  • Switching providers loses the catalogue and the subscribers. Products, prices, and existing subscriptions do not migrate. Current subscribers stay on the old provider until they cancel and resubscribe.
  • A project with payments cannot be remixed. If forking the project matters, that door closes when payments are enabled.

Details and the correct sequence in reference/changing.md.

The rules

Never trust an amount that came from the browser. The client sends a request; the server decides the price. A checkout that accepts the amount from the frontend lets anyone pay zero, however the UI restricts the field. This is the secure skill's territory and it is not optional here.

Entitlement is a server-side question. "Does this user have access to this feature" is answered by checking the subscription state on the server, never by a flag in client state or a value the client passed in.

Do not revoke access the moment a subscription is cancelled. The user has paid through the end of their billing period and keeps access until then. Cutting access at cancellation is a support ticket and a chargeback waiting to happen.

Handle a failed renewal gracefully. A past_due subscription should prompt the user to update their payment method, not immediately lock them out. Payments fail for expired cards far more often than for abandonment.

Do not create webhooks manually. They are registered automatically, and duplicates cause problems that are hard to trace.

Report

State which environment the work applies to — test or live — in every message about payments. A change described without its environment is ambiguous in the one area where ambiguity costs money.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.