agentleFS
shinzoxDshinzoxD/knackbox/skills/coding/partner-api-integration/SKILL.md

partner-api-integration

Skill0 starsChanged 5 months agoApache-2.0View on GitHub

Plan integrating a third-party or partner HTTP API: auth, retries, idempotency keys, sandbox vs prod keys, versioning, pagination, and field mapping. Use whenever the user wants to integrate Stripe, Twilio, or a partner API, build a third-party API client, compare sandbox vs prod keys, handle partner pagination, or asks "how do we wrap this vendor API" — even if they only share a vendor doc snippet and do not name this skill.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 6 are distinctive, and 1 is 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.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never invent vendor endpoints, query params, or headers.

    line 83
  2. Distinctive:

    Every outbound call has a connect timeout and a request timeout.

    line 88
  3. Distinctive:

    No infinite wait on a hung partner.

    line 89
  4. Distinctive:

    Do not retry non-idempotent POSTs unless an idempotency key (or the vendor's documented equivalent) is sent and stored.

    line 90
  5. Distinctive:

    Never use live keys in CI, shared fixtures, or sample configs.

    line 96
  6. Very specific:

    Pagination: follow their cursor, page token, or Link header.

    line 102
  7. Distinctive:

    Do not assume offset pages are stable under concurrent writes.

    line 103

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

Partner API Integration

Wrap a vendor HTTP API as a reliable internal client. You do not design the partner's surface. Work from their docs; do not invent endpoints, fields, status codes, or auth schemes.

For APIs we publish, use api-design. For specs we author, use openapi-spec-design. For inbound partner callbacks, use webhook-design. For how keys are stored and rotated, use secrets-management.

Workflow

  1. Contract source: vendor docs, sandbox console, or a file they gave you. Quote methods, paths, and fields from that source only.
  2. Auth: the scheme they document (API key, OAuth client credentials, HMAC). Separate sandbox vs production credentials and base URLs.
  3. Surface we need: our operations mapped to their methods and paths. Drop unused vendor endpoints.
  4. Client policy: connect and request timeouts on every call; retries with exponential backoff only when the call is safe to repeat; honor Retry-After and 429.
  5. Idempotency: send their documented idempotency-key header (or equivalent) on creates and money-moving calls; persist the key with our request id so a retry is the same attempt.
  6. Mapping: vendor types → our domain. Money/currency, timestamps, IDs, enums, and nullability get explicit conversion rules.
  7. Pagination and versioning: pin the API version they support; page with their cursor, token, offset, or Link header — not ours.
  8. Failure and ops: map their error codes to ours; metrics for latency, 4xx/5xx, retries, and rate-limit hits. Never log secrets or full payment/PII payloads.

Output format

## Partner integration: <vendor / product>

**Source of truth:** docs URL or file (no invented paths)
**Environments:** sandbox vs prod base URL + key slots (placeholders)
**Auth:** …

### Operations we wrap
| Our use | Their method/path | Idempotent? | Timeout | Retry |

### Mapping
vendor field → ours (money, time, nulls, IDs)

### Client policy
timeouts, backoff, idempotency key, 429 / Retry-After

### Version pin
header or path they document; when we upgrade

### Test plan
sandbox cases; what we will not hit in prod first

### Open questions
only questions that change the wrapper

Rules

  1. Never invent vendor endpoints, query params, or headers. If the doc is missing, say so and ask — do not guess a REST shape.
  2. Secrets stay out of the repo, examples, CI logs, and chat. Use placeholders such as ${PARTNER_SECRET}. Storage, injection, and rotation belong in secrets-management.
  3. Every outbound call has a connect timeout and a request timeout. No infinite wait on a hung partner.
  4. Do not retry non-idempotent POSTs unless an idempotency key (or the vendor's documented equivalent) is sent and stored.
  5. Pin the vendor API version. An unversioned client is a defect.
  6. Inbound webhooks from the partner are webhook-design, not this skill. Point there instead of designing signatures here.
  7. Sandbox and production keys, accounts, and webhooks stay isolated. Never use live keys in CI, shared fixtures, or sample configs.

Edge cases

  • Sandbox drift: features or error shapes that exist only in sandbox. Call them out; test the prod-only path before launch.
  • Pagination: follow their cursor, page token, or Link header. Do not assume offset pages are stable under concurrent writes.
  • Partial success: multi-step vendor flows need a recorded vendor id and a resume or reconcile path, not a blind re-POST.
  • SDK vs raw HTTP: an official SDK is fine if it exposes timeouts, retries, and idempotency; wrap it so we can still pin versions.

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.