agentleFS
HainrixzHainrixz/agente-pagokit/skills/integration-builder/SKILL.md

integration-builder

Skill68 starsChanged 6 months agoMITView on GitHub

Composes a complete payment integration by resolving capability fragments against the chosen provider's catalog entry, then emits a structured file plan for integration-specialist to execute. Selects fragments by verification family, notification model and checkout pattern rather than by provider name, so a provider new to the catalog composes correctly without new templates. Refuses to emit a signature verifier when the provider's scheme is not verified, emitting re-fetch and an explicit TODO instead.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. NAVANEETHVVINOD/agent-orchestrator★ 0same 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 repository7 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

17 rules. About 0 are common, 6 are distinctive, and 11 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 11

    Very specific

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

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

    If integration_level is advise, stop.

    line 58
  2. Very specific:

    Read skills/payment-advisor/data/providers/<provider>.json — the full entry, not the index.

    line 64
  3. Very specific:

    Read recipes/default.json (or the use-case overlay, when one applies).

    line 65
  4. Very specific:

    Check the evidence gate: If webhook.evidence.confidence is not "high", you must not emit a signature verifier.

    line 66
  5. Very specific:

    Refunds are not universal: If every method in required_methods has reversibility: "irreversible_no_refund", a refund endpoint is fiction.

    line 87
  6. Very specific:

    Amounts follow the currency, not the provider: Read the exponent from currencies.json.

    line 92
  7. Very specific:

    Weak crypto stays weak: If webhook.weak_crypto is set, implement the documented algorithm and emit the warning.

    line 97
  8. Very specific:

    Use crypto.randomUUID() literally on the idempotency line.

    line 133
  9. Distinctive:

    Never clobber. If a table or route already exists, namespace the new one and record the collision in the audit trail.

    line 135
  10. Very specific:

    Every line that exists to satisfy a security rule carries // Rule N: <short reason>.

    line 137
  11. Distinctive:

    Do not write files. Emit the plan.

    line 144
  12. Distinctive:

    Do not emit a signature verifier when the evidence gate fails.

    line 145
  13. Distinctive:

    Do not select a fragment by provider name when a family fragment exists — that is how 960 compiled files grow back.

    line 146
  14. Very specific:

    Do not emit a webhook route for a provider whose notification_model is not webhook.

    line 148
  15. Distinctive:

    Do not skip the customer portal for a subscription.

    line 149
  16. Very specific:

    Do not log whole event payloads (Rule 6) — event.id, type and created only.

    line 151
  17. Distinctive:

    Do not post card data to the merchant's own server (Rule 12).

    line 152

≈ “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 -->

integration-builder

You are the composition algorithm. You do not write to the user's project — you read fragments and emit a plan. integration-specialist executes it.

The idea that makes this scale

Providers differ in a small number of ways, and those ways repeat. There are roughly fourteen webhook verification families across every payment provider in the world, five checkout patterns and five notification models. So a fragment is written once per family, not once per provider.

That is why this skill contains no provider names. You resolve fragments from the provider's catalog entry:

Choose byFieldFragment
How the callback is authenticatedwebhook.verification_familyfragments/webhook/<family>.md
How the merchant learns of the paymentnotification_modelfragments/notify/<model>.md
How the payment is createdcheckout_spec.patternfragments/checkout/<pattern>.md
One-off vs recurring vs mandate vs meteredbilling_mode + recurring.railsfragments/billing/<slot>.md
Framework plumbingthe detected stacktemplates/_stack-adapters/<stack>.md
Persistencethe detected ORMtemplates/_db-adapters/<orm>.md
Deploymentthe detected targettemplates/_deploy-targets/<target>.md

Providers at integration_level: build also have hand-written material in templates/<provider>/ and quirks in overrides/<provider>/notes.md. Provider-specific material always wins over the family fragment — it exists precisely because the family default is wrong for that provider.

Inputs

{
  "provider": "<catalog id>",
  "integration_level": "build|generic|advise",
  "stack": "...", "orm": "...", "deploy_target": "...",
  "billing_mode": "one_time|subscription",
  "frontend_style": "hosted|embedded|widget|...",
  "required_methods": ["..."],
  "use_cases_detected": ["..."],
  "language": "es|en|pt",
  "example_transaction_amount": 0,
  "example_currency": "XXX"
}

If integration_level is advise, stop. Emit a research checklist and the provider's documentation links, and state that PagoKit will not write this integration. Do not improvise a scaffold from a scheme nobody verified.

Algorithm

  1. Read skills/payment-advisor/data/providers/<provider>.json — the full entry, not the index.
  2. Read recipes/default.json (or the use-case overlay, when one applies).
  3. Check the evidence gate. If webhook.evidence.confidence is not "high", you must not emit a signature verifier. Emit the re-fetch path, event-id dedup, and a loud TODO citing docs_url. A verifier built on an unverified scheme is worse than no verifier: it looks correct and accepts forged events.
  4. For each slot in the recipe, in order, evaluate skip_if and resolve fragments, substituting {provider}, {stack}, {orm}, {verification_family}, {notification_model}, {checkout_pattern}, {billing_slot}.
  5. Layer provider-specific material on top of the family fragment where it exists.
  6. Emit the plan.

Conditions worth getting right

notification_model is not always webhook. A return_url_commit provider never calls you; it hands control back through the browser and expects a commit call. Emit the commit slot and do not emit a webhook route. Omitting the commit means the transaction auto-reverses — silent, and it looks like the payment simply failed.

payload_authoritative: false means the payload is a rumour. Emit the re-fetch before any state change, whatever the signature says. When signature_covers_body is false, this is not optional: fields outside the signed set are attacker-controlled.

Refunds are not universal. If every method in required_methods has reversibility: "irreversible_no_refund", a refund endpoint is fiction. Emit the payout-based alternative and say so in the audit trail. For mandate_indemnity rails, note that a "successful" charge can be clawed back weeks later.

Amounts follow the currency, not the provider. Read the exponent from currencies.json. JPY, KRW and CLP take integers; KWD, BHD and OMR take three decimals. A reflexive × 100 overcharges by 100× in the first group — and in the second it also breaks any provider that hashes the amount at its ISO exponent, so the developer debugs the signature instead.

Weak crypto stays weak. If webhook.weak_crypto is set, implement the documented algorithm and emit the warning. Silently "upgrading" MD5 to SHA-256 produces a verifier that rejects every genuine event.

The plan you emit

A fenced ```json block:

{
  "provider": "...", "integration_level": "build|generic",
  "verification_family": "...", "notification_model": "...",
  "evidence_confidence": "high|medium|unverified",
  "files_to_create": [
    {
      "path": "app/api/webhook/<provider>/route.ts",
      "purpose": "Authenticate and dispatch provider notifications",
      "fragments": ["fragments/webhook/_preamble.md", "fragments/webhook/<family>.md", "templates/_stack-adapters/<stack>.md"],
      "must_include_rule_tags": ["// Rule 3: signature", "// Rule 5: raw body", "// Rule 9: replay"],
      "events_routed": ["..."],
      "operation": "create",
      "skip_if": null
    }
  ],
  "commands_to_run": ["<pinned SDK install>", "<migration>"],
  "frontend_style_chosen": "...",
  "post_install_hint": "Run /pagokit:test — it sends a valid, a forged and a replayed event.",
  "warnings": ["anything the developer must know that the code cannot express"]
}

Composition rules

  1. Webhook routes are always namespaced /api/webhook/<provider>. Multi-provider coexistence is the default, not the exception — /pagokit:add depends on it.
  2. Pin the SDK version, and pin the API version where api_versioning.pin_required is true.
  3. Use crypto.randomUUID() literally on the idempotency line. The validator matches that canonical string.
  4. Never clobber. If a table or route already exists, namespace the new one and record the collision in the audit trail.
  5. Every line that exists to satisfy a security rule carries // Rule N: <short reason>. Without the tag, the next person deletes it as noise.
  6. PAGOKIT_INTEGRATION.md is mandatory. /pagokit:doctor cannot audit an integration it cannot identify.

Anti-patterns

  • Do not write files. Emit the plan.
  • Do not emit a signature verifier when the evidence gate fails.
  • Do not select a fragment by provider name when a family fragment exists — that is how 960 compiled files grow back.
  • Do not emit a webhook route for a provider whose notification_model is not webhook.
  • Do not skip the customer portal for a subscription; without it the user has no cancellation flow, which is a legal problem in several markets, not just a UX gap.
  • Do not log whole event payloads (Rule 6) — event.id, type and created only.
  • Do not post card data to the merchant's own server (Rule 12). Use the provider's element.

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.