doctor
Audits an existing PagoKit integration in the current project against the generated per-provider checklist, so it covers every provider in the catalog rather…
Covers everything after the subscription is created — trials, proration on upgrade and downgrade, dunning and retry schedules, grace periods, involuntary churn from expired cards, cancellation timing, and the bank-mandate lifecycle for SEPA, Bacs, PAD, UPI AutoPay and Pix
$ npx -y skills add Hainrixz/agente-pagokit --skill subscription-lifecycle --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/subscription-lifecycleContext preview
The summary Claude sees to decide when to auto-load this skill.
Covers everything after the subscription is created — trials, proration on upgrade and downgrade, dunning and retry schedules, grace periods, involuntary churn from expired cards, cancellation timing, and the bank-mandate lifecycle for SEPA, Bacs, PAD, UPI AutoPay and Pix
name: subscription-lifecycle description: Covers everything after the subscription is created — trials, proration on upgrade and downgrade, dunning and retry schedules, grace periods, involuntary churn from expired cards, cancellation timing, and the bank-mandate lifecycle for SEPA, Bacs, PAD, UPI AutoPay and Pix Automatico. Also covers the stored-credential framework and the network transaction id that recurring charges must carry. This is the part every payment tutorial stops short of, and where production subscriptions actually break. when_to_use: | - Generating or reviewing subscription billing - The user asks about trials, proration, dunning, failed payments, cancellation or churn - A recurring integration uses a bank mandate rather than a card allowed-tools: Read, Glob
Creating a subscription is one API call. Everything that follows is where the money is lost.
trialing ──► active ──► past_due ──► canceled
│ │ ▲ │
│ │ └─────────┘ (retry succeeded)
│ ▼
│ paused / grace
└──► canceled (trial abandoned)`past_due` is the state that matters. A subscription there is still delivering value and no longer being paid for. How long you tolerate that, and what the customer sees while it lasts, is a product decision the code has to encode explicitly — the default of "keep serving forever because nobody wrote the branch" is the expensive one.
Most subscription cancellations are not decisions. They are expired cards, changed cards, and issuer declines on a merchant-initiated transaction. Concretely:
over days, and stop before the issuer starts treating you as abusive.
"Stolen card" is not worth retrying at all, and retrying it looks like testing stolen cards.
The first charge is customer-initiated (CIT), with the customer present. Every later charge is merchant-initiated (MIT), and the networks require it to reference the original.
**Persist the network transaction id from the first charge and send it on every subsequent one.** Mastercard requires the stored Trace ID on economically-related MITs from 23 October 2026, and Visa's Original Transaction ID already drives approval rates today. An unlinked MIT is not a warning — it is a decline.
That means a column: `network_transaction_id` on the stored payment method or the subscription. Read `recurring.network_txn_id_required` from the provider entry.
When a plan changes mid-cycle, someone is owed money. The three defensible answers:
the difference now. Correct, and the most confusing to read on a statement.
price difference is small.
Pick one, write it down, and make the checkout say what will be charged **before** the click. The support burden of an unexplained mid-cycle charge exceeds its revenue.
Cancel-at-period-end is almost always right: the customer keeps what they paid for, and you keep the revenue you already earned. Immediate cancellation with a refund is a separate, deliberate choice.
Two things that are not optional: cancellation must be possible **without contacting support** (a legal requirement in several markets, not a UX preference), and the customer must be told exactly when access ends.
For SEPA, Bacs, PAD, UPI AutoPay, Pix Automático and PAC, read `fragments/billing/subscription_mandate.md`. The differences that break card-shaped code:
Direct Debit Guarantee. Money can leave weeks after you counted it.
the next failed debit.
Never model these as a card on file. `supports.subscriptions: true` does not mean the rails behave alike.
1. The full state machine, with `past_due` handled explicitly. 2. A dunning schedule with soft/hard decline branching. 3. `network_transaction_id` persisted and sent. 4. A customer portal, or an in-app equivalent, that can cancel without support. 5. Webhook handlers for payment failure, subscription updated and subscription deleted — a subscription cancelled in the provider dashboard must revoke access in your app. 6. For mandates: the pre-notification job and a reversal handler.
Claude Code plugin that picks and implements the right payment method for your app — from your terminal. 42 providers, 136 payment rails, and deterministic validators that block insecure payment code as it is written.
Repo: Hainrixz/agente-pagokit
Audits an existing PagoKit integration in the current project against the generated per-provider checklist, so it covers every provider in the catalog rather…
Composes a complete payment integration by resolving capability fragments against the chosen provider's catalog entry, then emits a structured file plan for…
Recommends the single best payment provider for the user's project after a short interactive wizard, then hands off to the implementer. Runs a deterministic…
Plans and executes a migration from one payment provider to another without downtime. Establishes what cannot move (stored card tokens usually cannot), maps…
Detects a project's technology stack, framework, deploy target, ORM, primary language, and active payment use cases by reading…
Explains what a merchant owes the tax authority once a payment succeeds, and whether a merchant of record removes that obligation. Covers the…