Skip to content
Development
Command

/doctor

Diagnose PayPal integration issues by scanning your codebase, environment, and API usage patterns — then offer targeted fixes

From plugin
paypal
135 skills5 commands1 hook1 MCP
Install
> /plugin marketplace add paypal/AI-Toolkit
> /plugin install paypal@paypal-ai-toolkit

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/doctor

Context preview

What this command does when you run it.

Diagnose PayPal integration issues by scanning your codebase, environment, and API usage patterns — then offer targeted fixes

Command definition

doctor.md
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) 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://docs.paypal.ai/developer/how-to/apps-scopes-credentials.md` | | Webhooks — verification, idempotency, events | `${CLAUDE_PLUGIN_ROOT}/skills/paypal-best-practices/references/webhooks.md` | PayPal docs (v6): `https://docs.paypal.ai/reference/api/rest/verify-webhook-signature/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/md/docs/subscriptions/` | | 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/expanded-checkout/rules.md` | | Disputes and refunds | `${CLAUDE_PLUGIN_ROOT}/skills/paypal-best-practices/references/disputes-refunds.md` | PayPal docs: `https://docs.paypal.ai/growth/disputes/overview.md` | | Orders API, capture, INSTRUMENT_DECLINED

Read more
Ships withpaypal

A Claude Code plugin that integrates PayPal's APIs and MCP server into your development workflow. Get AI-assisted help with PayPal payments, subscriptions, invoices, disputes, and more — directly in your editor.

Get the whole plugin
Stats
13
Stars
4
Forks
Active
Maintenance
Apache-2.0
License
27d ago
Last commit
2mo ago
Created

Repo: paypal/AI-Toolkit

Other commands on paypal.