agentleFS
HainrixzHainrixz/agente-pagokit/skills/payment-migrator/SKILL.md

payment-migrator

Skill68 starsChanged 6 months agoMITView on GitHub

Plans and executes a migration from one payment provider to another without downtime. Establishes what cannot move (stored card tokens usually cannot), maps the two providers' event vocabularies, flags architectural differences such as a change of notification model or a move to a merchant of record, and sequences a coexistence period rather than an atomic switch. Powers /pagokit:migrate.

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 10 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    Read PAGOKIT_INTEGRATION.md, then verify it against the code.

    line 19
  2. Distinctive:

    Every place a provider id or provider-shaped identifier is persisted.

    line 24
  3. Distinctive:

    Read both catalog entries and name every difference that changes the architecture:

    line 39
  4. Distinctive:

    Add the new provider alongside the old one.

    line 53
  5. Distinctive:

    Keep the old handler alive for as long as the old provider can still send disputes and refunds — months, not days.

    line 58
  6. Very specific:

    Keep the provider column on every payment row permanently.

    line 60
  7. Distinctive:

    Before the first payment routes to the new provider, make these observable: success rate by provider, decline reasons by provider, webhook …

    line 70
  8. Distinctive:

    Do not switch atomically.

    line 77
  9. Distinctive:

    Do not migrate and refactor in the same change.

    line 78
  10. Distinctive:

    Do not delete the old webhook handler when the last payment is created — disputes arrive weeks later.

    line 79
  11. Distinctive:

    Do not promise that stored cards will migrate before both providers have confirmed it in writing.

    line 80
  12. Distinctive:

    Do not migrate a subscription mid-cycle without deciding what happens to the unused portion.

    line 81

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md
<!-- Copyright (c) 2026 Enrique Rocha (@soyenriquerocha) · tododeia.com · id er-fee52fa9 -->

payment-migrator

There is no moment at which flipping every payment from one provider to another is safe. A migration is a period during which both run, and the job is to make that period short, observable and reversible.

Step 1 — Inventory what exists

Read PAGOKIT_INTEGRATION.md, then verify it against the code; it goes stale. You need:

  • Routed events and what each one does.
  • Customers with a stored payment method, and how many.
  • Active subscriptions and their next billing dates.
  • Every place a provider id or provider-shaped identifier is persisted.

Step 2 — Establish what cannot move

Say this before planning anything, because it determines whether the migration is a technical task or a customer-facing event.

Stored card tokens usually cannot migrate. They belong to the provider that vaulted them. Some providers support a PCI-scoped token export or a network-token migration on request; most do not, and the ones that do require a written agreement between both parties. Until that is confirmed in writing, plan for existing subscribers to re-enter a card — which is a churn event, not a detail.

Step 3 — Diff the two providers

Read both catalog entries and name every difference that changes the architecture:

CompareIf it differs
notification_modelMoving to return_url_commit or ping_then_poll is a different architecture, not a swapped SDK
webhook.required_events_minimumMap them explicitly. Flag every event with no equivalent
mor.is_morA merchant of record becomes the seller. Invoices, tax handling and the statement descriptor all change
methods and their reversibilityNew irreversible rails mean the refund path changes shape
settlement.payout_delay_daysCash flow changes, and someone in finance needs to know
recurring.railsCard-to-mandate is a different lifecycle entirely
pci.scopeMoving to a direct-API integration can push the merchant from SAQ A to SAQ D

Step 4 — Sequence the coexistence

  1. Add the new provider alongside the old one. Both webhook routes live; they are namespaced already.
  2. Route new payments to the new provider. Leave everything existing where it is.
  3. Migrate subscriptions at their natural renewal, not in a batch. A batch migration turns one bad assumption into every customer's problem simultaneously.
  4. Keep the old handler alive for as long as the old provider can still send disputes and refunds — months, not days.
  5. Keep the provider column on every payment row permanently. Reconciliation needs it long after the old provider is gone.

Step 5 — Write it down

PAGOKIT_MIGRATION.md: what moves when, what cannot move, what the customer sees, how to tell whether it is working, and the rollback. A migration without a written rollback is a bet.

Instrument it

Before the first payment routes to the new provider, make these observable: success rate by provider, decline reasons by provider, webhook delivery failures, and time from checkout to confirmed payment. A migration that quietly halves your approval rate looks exactly like a successful one until the end of the month.

Anti-patterns

  • Do not switch atomically.
  • Do not migrate and refactor in the same change. When it breaks you will not know which did it.
  • Do not delete the old webhook handler when the last payment is created — disputes arrive weeks later.
  • Do not promise that stored cards will migrate before both providers have confirmed it in writing.
  • Do not migrate a subscription mid-cycle without deciding what happens to the unused portion.

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.