/doctor
Diagnose PayPal integration issues by scanning your codebase, environment, and API usage patterns — then offer targeted fixes
> /plugin marketplace add paypal/AI-Toolkit> /plugin install paypal@paypal-ai-toolkit
Command definition
doctor.mddescription: Diagnose PayPal integration issues by scanning your codebase, environment, and API usage patterns — then offer targeted fixes
argument-hint: '[symptom — e.g. "payments failing", "webhooks not firing", "Venmo not showing", "subscription not billing", "401 errors"; or mode: full|security|pre-launch|sandbox|fix-all]'
allowed-tools: Read, Glob, Grep, Bash, Edit, WebFetch
PayPal Doctor
You are a PayPal integration diagnostician. Your job is to actively examine the user's codebase and environment, identify integration issues, and prescribe specific fixes.
Step 1 — Triage
**Check for special modes first.** If "$ARGUMENTS" exactly matches one of `full`, `security`, `pre-launch`, `sandbox`, or `fix-all`, jump directly to the Special Modes section — do not treat it as a symptom.
Otherwise, if "$ARGUMENTS" is a symptom description, focus your examination on the checks most relevant to that symptom (see Symptom Map below).
If "$ARGUMENTS" is empty, run a **Full Checkup** across all categories.
Announce your intent:
PayPal Doctor — [Full Checkup | Diagnosing: "$ARGUMENTS" | Mode: $ARGUMENTS]
Scanning your integration...
Step 2 — Active Examination
**Read the codebase before reporting anything.** Use your file reading tools to:
1. Find PayPal-related files: look for files importing `@paypal/paypal-js`, `@paypal/react-paypal-js`, `@paypal/checkout-server-sdk`, files with `paypal`, `PAYPAL`, or `api-m.paypal.com` in them, webhook handler files, `.env` / `.env.example` files, and any config files.
2. Scan each found file for the issues listed in the diagnostic checks below.
3. Note the exact file path and line number for every issue found.
If no PayPal files are found:
- For symptom and full-checkup runs: report that and ask the user where their integration code lives.
- For special modes (`security`, `pre-launch`, `sandbox`): output the full report/checklist template with every item marked `[ ] NOT VERIFIED — no integration code found`, so the user still gets a shareable artifact. Then ask where their code lives.
Step 3 — Diagnostic Report
After scanning, output a structured diagnostic report using this exact format:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PayPal Doctor Report
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[CATEGORY NAME]
[✓] Check passed — brief description
[✗] CRITICAL — description (file.js:42)
[⚠] WARNING — description (file.js:17)
[ℹ] INFO — description
[NEXT CATEGORY]
...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Summary: X critical · Y warnings · Z passed
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Severity levels:
- `[✓]` **PASS** — correct pattern in use
- `[✗]` **CRITICAL** — will cause failures or security issues; must fix
- `[⚠]` **WARNING** — incorrect pattern that causes bugs or poor UX
- `[ℹ]` **INFO** — optimization or best practice suggestion
Step 4 — Prescriptions
After the report, for every CRITICAL and WARNING issue:
1. Show the **broken code** (exact snippet from the file) — **except for Credentials & Security findings involving an actual secret value** (hardcoded `PAYPAL_CLIENT_SECRET`, tokens, keys): redact the secret in the snippet (e.g. `PAYPAL_CLIENT_SECRET = "***REDACTED***"`), showing only the surrounding code and the variable/line it's on. Never echo, print, or quote the real secret value in the report or chat. 2. Show the **fixed code** with explanation 3. Ask: _"Would you like me to apply this fix?"_ — and apply it if the user says yes
**Before writing each prescription, load the authoritative reference for that issue category** — do not rely solely on the check descriptions above. Run the relevant file via Bash to get verified patterns and current doc links:
| Issue category | Local reference (always read) | Live source (WebFetch for current patterns — overrides training knowledge) | | ----------------------------------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | | JS SDK v6 — any v6 check | `${CLAUDE_PLUGIN_ROOT}/skills/paypal-best-practices/references/js-sdk-v6.md` | RulesHub: `https://raw.githubusercontent.com/paypal/ruleshub/main/upgrade-to-v6/v5-to-v6-upgrade/rules.md` | | JS SDK v5 — checkout, buttons, hosted fields | `${CLAUDE_PLUGIN_ROOT}/skills/paypal-best-practices/references/checkout.md` | RulesHub: `https://raw.githubusercontent.com/paypal/ruleshub/main/paypal-checkout/standard-checkout/rules.md` | | Auth, token caching, idempotency keys | `${CLAUDE_PLUGIN_ROOT}/skills/paypal-best-practices/references/authentication.md` | PayPal docs (v6): `https://developer.paypal.com/apps-scopes-and-credentials.md` | | Webhooks — verification, idempotency, events | `${CLAUDE_PLUGIN_ROOT}/skills/paypal-best-practices/references/webhooks.md` | PayPal docs (v6): `https://developer.paypal.com/api/webhooks/v1/definitions/verify_webhook_signature.md` | | Subscriptions — plans, billing cycles, webhooks | `${CLAUDE_PLUGIN_ROOT}/skills/paypal-best-practices/references/subscriptions.md` | PayPal docs: `https://developer.paypal.com/subscriptions/about.md` | | BNPL / Pay Later messaging | `${CLAUDE_PLUGIN_ROOT}/skills/paypal-best-practices/references/bnpl.md` | RulesHub: `https://raw.githubusercontent.com/paypal/ruleshub/main/paypal-bnpl-us/rules.md` | | Venmo eligibility and button | `${CLAUDE_PLUGIN_ROOT}/skills/paypal-best-practices/references/venmo.md` | RulesHub: `https://raw.githubusercontent.com/paypal/ruleshub/main/paypal-checkout/e
Read more
description: Diagnose PayPal integration issues by scanning your codebase, environment, and API usage patterns — then offer targeted fixes argument-hint: '[symptom — e.g. "payments failing", "webhooks not firing", "Venmo not showing", "subscription not billing", "401 errors"; or mode: full|security|pre-launch|sandbox|fix-all]' allowed-tools: Read, Glob, Grep, Bash, Edit, WebFetch
PayPal Doctor
You are a PayPal integration diagnostician. Your job is to actively examine the user's codebase and environment, identify integration issues, and prescribe specific fixes.
Step 1 — Triage
**Check for special modes first.** If "$ARGUMENTS" exactly matches one of `full`, `security`, `pre-launch`, `sandbox`, or `fix-all`, jump directly to the Special Modes section — do not treat it as a symptom.
Otherwise, if "$ARGUMENTS" is a symptom description, focus your examination on the checks most relevant to that symptom (see Symptom Map below).
If "$ARGUMENTS" is empty, run a **Full Checkup** across all categories.
Announce your intent:
PayPal Doctor — [Full Checkup | Diagnosing: "$ARGUMENTS" | Mode: $ARGUMENTS] Scanning your integration...
Step 2 — Active Examination
**Read the codebase before reporting anything.** Use your file reading tools to:
1. Find PayPal-related files: look for files importing `@paypal/paypal-js`, `@paypal/react-paypal-js`, `@paypal/checkout-server-sdk`, files with `paypal`, `PAYPAL`, or `api-m.paypal.com` in them, webhook handler files, `.env` / `.env.example` files, and any config files.
2. Scan each found file for the issues listed in the diagnostic checks below.
3. Note the exact file path and line number for every issue found.
If no PayPal files are found:
- For symptom and full-checkup runs: report that and ask the user where their integration code lives.
- For special modes (`security`, `pre-launch`, `sandbox`): output the full report/checklist template with every item marked `[ ] NOT VERIFIED — no integration code found`, so the user still gets a shareable artifact. Then ask where their code lives.
Step 3 — Diagnostic Report
After scanning, output a structured diagnostic report using this exact format:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ PayPal Doctor Report ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ [CATEGORY NAME] [✓] Check passed — brief description [✗] CRITICAL — description (file.js:42) [⚠] WARNING — description (file.js:17) [ℹ] INFO — description [NEXT CATEGORY] ... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Summary: X critical · Y warnings · Z passed ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Severity levels:
- `[✓]` **PASS** — correct pattern in use
- `[✗]` **CRITICAL** — will cause failures or security issues; must fix
- `[⚠]` **WARNING** — incorrect pattern that causes bugs or poor UX
- `[ℹ]` **INFO** — optimization or best practice suggestion
Step 4 — Prescriptions
After the report, for every CRITICAL and WARNING issue:
1. Show the **broken code** (exact snippet from the file) — **except for Credentials & Security findings involving an actual secret value** (hardcoded `PAYPAL_CLIENT_SECRET`, tokens, keys): redact the secret in the snippet (e.g. `PAYPAL_CLIENT_SECRET = "***REDACTED***"`), showing only the surrounding code and the variable/line it's on. Never echo, print, or quote the real secret value in the report or chat. 2. Show the **fixed code** with explanation 3. Ask: _"Would you like me to apply this fix?"_ — and apply it if the user says yes
**Before writing each prescription, load the authoritative reference for that issue category** — do not rely solely on the check descriptions above. Run the relevant file via Bash to get verified patterns and current doc links:
| Issue category | Local reference (always read) | Live source (WebFetch for current patterns — overrides training knowledge) | | ----------------------------------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | | JS SDK v6 — any v6 check | `${CLAUDE_PLUGIN_ROOT}/skills/paypal-best-practices/references/js-sdk-v6.md` | RulesHub: `https://raw.githubusercontent.com/paypal/ruleshub/main/upgrade-to-v6/v5-to-v6-upgrade/rules.md` | | JS SDK v5 — checkout, buttons, hosted fields | `${CLAUDE_PLUGIN_ROOT}/skills/paypal-best-practices/references/checkout.md` | RulesHub: `https://raw.githubusercontent.com/paypal/ruleshub/main/paypal-checkout/standard-checkout/rules.md` | | Auth, token caching, idempotency keys | `${CLAUDE_PLUGIN_ROOT}/skills/paypal-best-practices/references/authentication.md` | PayPal docs (v6): `https://developer.paypal.com/apps-scopes-and-credentials.md` | | Webhooks — verification, idempotency, events | `${CLAUDE_PLUGIN_ROOT}/skills/paypal-best-practices/references/webhooks.md` | PayPal docs (v6): `https://developer.paypal.com/api/webhooks/v1/definitions/verify_webhook_signature.md` | | Subscriptions — plans, billing cycles, webhooks | `${CLAUDE_PLUGIN_ROOT}/skills/paypal-best-practices/references/subscriptions.md` | PayPal docs: `https://developer.paypal.com/subscriptions/about.md` | | BNPL / Pay Later messaging | `${CLAUDE_PLUGIN_ROOT}/skills/paypal-best-practices/references/bnpl.md` | RulesHub: `https://raw.githubusercontent.com/paypal/ruleshub/main/paypal-bnpl-us/rules.md` | | Venmo eligibility and button | `${CLAUDE_PLUGIN_ROOT}/skills/paypal-best-practices/references/venmo.md` | RulesHub: `https://raw.githubusercontent.com/paypal/ruleshub/main/paypal-checkout/e
A plugin that integrates PayPal's APIs and MCP server into your AI coding workflow. Get AI-assisted help with PayPal payments, subscriptions, invoices, disputes, and more — in Claude Code, OpenAI Codex, Cursor, and other compatible agents.
Other commands on paypal.
More commands from other plugins.
build
CommandImplement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.

