agentleFS
chatquillchatquill/claude-code-websites/.claude/skills/add-payments/SKILL.md

add-payments

Skill1 starsChanged 24 days agoMITView on GitHub

Adds payments and billing (one-off checkout, subscriptions, trials, plan changes, usage billing, customer portal, invoices, tax) with Stripe, Paddle or Lemon Squeezy, in test mode only, with verified idempotent webhooks and entitlement checks. Use when the product charges money.

  • Reads credentials

3 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

4 rules. 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If stack.payments is null, ask with trade-offs:

    line 27
  2. Very specific:

    Write an ADR (template adr).

    line 30
  3. Very specific:

    Ask: "Create stories (recommended) or implement directly?" Then /create-stories or /dev-story.

    line 59
  4. Distinctive:

    Use live keys; trust client-sent prices, plans or quantities.

    line 63

“Common” is measured: kept by at least 6 in 10 of the 3 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

Add Payments

The provider is the source of truth for billing state; the app mirrors it from webhooks and gates features by entitlements. Test mode keys only. It never creates live products, prices or charges, and never decides prices.

Inputs

  • project.yaml → stack.payments, project.type, privacy.regions
  • PRD pricing and packaging section (plans, limits, trials); if missing, ask product-director to frame it and the user to decide
  • .claude/docs/stack-matrix.md

Phases

Phase 1: Provider

If stack.payments is null, ask with trade-offs:

  • Stripe: most flexible, you handle sales tax/VAT registration (Stripe Tax helps)
  • Paddle / Lemon Squeezy: merchant of record; they handle global tax, higher fees Write an ADR (template adr); after approval run config-set.sh stack.payments=<value>.

Phase 2: Model

Confirm with the user: one-off vs subscription vs usage; plans and their limits; trial (card upfront or not); proration on upgrade/downgrade; cancellation at period end; dunning; refunds; currencies; tax. Record in the feature spec (docs/specs/features/billing.md, template feature-spec).

Phase 3: Threats and data

security-lead: webhook spoofing/replay, price tampering from the client, race conditions on plan changes, IDOR on invoices. privacy-compliance-specialist if regions require it. Card data never touches the app (hosted checkout/elements, PCI SAQ A).

Phase 4: Plan

payments-specialist with the backend specialist proposes:

  • products/prices created in test mode via a seed script or dashboard steps the user runs
  • checkout session / overlay creation server-side, price looked up server-side
  • webhook endpoint: raw-body signature verification, event ID stored for idempotency, out-of-order handling, retries; events handled at least: checkout completed, subscription created/updated/deleted, payment failed, refund, dispute
  • subscriptions table mirroring provider state; can(user, feature) entitlements helper
  • customer portal link; billing settings UI
  • .env.example placeholders (STRIPE_SECRET_KEY=sk_test_..., webhook secret)
  • tests: unit for entitlements, integration for the webhook handler with signed fixture payloads, the provider CLI or test clocks for lifecycles

Ask: "Create stories (recommended) or implement directly?" Then /create-stories or /dev-story.

Never

Use live keys; trust client-sent prices, plans or quantities; change pricing without the user; send real receipts.

Next step

/security-audit payments, then /email-flows for receipts and dunning.

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.