/pagokit:doctor runs instead · from PagoKit — Payment Integration Agent
Audits a PagoKit payment integration against a per-provider checklist. Checks .gitignore, env vars, webhook signatures, event routing, and PAGOKIT_INTEGRATION.md existence. Read-only, invoked via /pagokit:doctor.
This skill never runs in Claude Code
It ships in PagoKit — Payment Integration Agent at skills/, but /pagokit:doctor (a command, or a skill Claude Code finds first) has the same name: typing it, or Claude choosing it, runs that one instead.
You audit an existing PagoKit-generated integration. Read-only. Never write files.
The first thing you read is PAGOKIT_INTEGRATION.md in the project root. It was written by integration-specialist when the integration was generated and contains:
PROVIDER_CHECKS.md for the full list)last_generated_at timestampIf PAGOKIT_INTEGRATION.md does not exist, this is NOT necessarily an error — the user may have an integration that predates PagoKit. In that case, ask the user "I don't see PAGOKIT_INTEGRATION.md. Was this integration generated by PagoKit? If not, I can still audit a known provider — which one are you using?"
Run each check and report a list of [OK] / [WARN] / [FAIL] lines. Group by category. At the end, summarize: "N OK, M warnings, K failures."
| Check | How | Severity |
|---|---|---|
.gitignore exists and includes .env (or .env* minus .env.example) | Read .gitignore from project root; walk up to repo root if necessary | FAIL if not covered |
.env not committed to git | If .git/ exists, check git ls-files .env would be empty | FAIL if committed |
.env.example exists | Glob .env.example | WARN if missing |
.env.example contains only test-mode values (compare each credential's live_prefix from PROVIDER_CHECKS.md) | Read it, grep for live prefixes | FAIL if live keys present |
Read skills/doctor/PROVIDER_CHECKS.md and find the section for the integrated provider.
It lists every credential that provider needs, its expected format, its scope and the severity
of a miss — generated from the catalog, so it covers every provider PagoKit knows about rather
than a handful frozen into this file.
Then read the user's .env (read it, never echo it) and compare.
For each required variable:
[OK] — present and matches pattern[FAIL] — missing[FAIL] — present but doesn't match pattern[WARN] — uses _live_ / _prod_ prefix (production key during audit; the user should know)For each webhook file declared in PAGOKIT_INTEGRATION.md (or detected via expected_filenames in the catalog), check it against the provider's section in PROVIDER_CHECKS.md — which already states the verification family, the correct secret env var, whether the payload is authoritative, and the replay strategy:
[OK/FAIL] — the file imports or calls the provider's canonical verifier (or carries the // @pagokit:signature-verified tag).[OK/FAIL] — the route uses raw body capture appropriate for the stack (per Rule 5 / SECURITY_RULES.md).[OK/FAIL] — the handler's switch covers every event in providers.json.webhook.required_events_minimum. Unhandled events should at least be logged with a TODO comment.[WARN] — if the file contains console.log(event) or similar (Rule 6).[OK/FAIL] — replay protection: if replay_mitigation_strategy requires event-id-dedup, look for a query against webhook_events_processed (or equivalent).[OK/FAIL] — the checkout endpoint generates an idempotency key with crypto.randomUUID() / uuid.uuid4() / SecureRandom.uuid (Rule 4).[OK/FAIL] — the DB has an idempotency_keys table (or equivalent file declared in PAGOKIT_INTEGRATION.md).If the integration declares an ORM (Prisma / Drizzle / SQLAlchemy / Active Record), verify these tables exist in the schema file:
payments (or provider-named, e.g. stripe_payments)subscriptions (if billing_mode == subscription)customersidempotency_keyswebhook_events_processedLast check: does PAGOKIT_PRODUCTION_CHECKLIST.md exist in the project root?
[OK] — exists; remind user to read it before flipping to live keys.[WARN] — missing; suggest re-running /pagokit:start to regenerate it.PagoKit Doctor — <provider> integration audit
Generated <last_generated_at> · stack: <stack> · deploy: <deploy_target>
Environment hygiene
[OK] .gitignore covers .env
[OK] .env not tracked in git
[OK] .env.example uses test prefixes
...
Webhook handler
[OK] app/api/webhook/stripe/route.ts verifies signature
[OK] raw body captured correctly (Next.js App Router pattern)
[FAIL] customer.subscription.updated not routed (expected per Rule providers.json)
...
(continue per category)
Summary: 17 OK · 2 warnings · 1 failure
Next steps:
1. Route the missing event customer.subscription.updated (see templates/stripe/subscription.md).
2. Address the warnings before going live.
.env but report [OK]/[FAIL], never the value).What SKILL.md sets; muted values are Claude Code's defaults
- The user invokes /pagokit:doctor - The user asks "is my payment integration set up correctly?", "did I miss something?", "is this safe to ship?" - The integration-specialist subagent wants a sanity check before declaring an integration complete
npx claudepluginhub hainrixz/agente-pagokit --plugin pagokit8 skills in this plugin
/integration-builderComposes 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./payment-advisorRecommends the single best payment provider for the user's project after a short interactive wizard, then hands off to the implementer. Runs a deterministic local ranking engine instead of scoring by hand, so the same situation always yields the same answer and every rejection has an exact reason. Computes real fees on a concrete transaction, always states whether PagoKit can actually BUILD the integration or only advise on it, discloses when the data was last verified, and refuses sanctioned markets outright. Bilingual ES/EN/PT, language inferred from the user's first prompt./payment-migratorPlans 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.Other plugins' skills for the same job