Integrate a third-party API
Implements a typed client for a third-party HTTP API from its docs, with auth, pagination, retries, rate limits and a test fake. Use when wiring an external service into your code.
Integrations break in production, not in the demo. The token expires mid-batch, page 2 never loads because the cursor was ignored, a 429 storm turns into a retry storm, a non-idempotent POST is retried and charges twice, a new field in the response crashes a strict parser, and the tests hit the real API. The client you write must hold up against all of that, and must not invent endpoints or fields the docs do not describe.
Build a client for the operations below in (if empty, use the repo's main language and its existing HTTP library).
Documentation: Operations needed:
- Read the docs (fetch them if given a URL). Extract, with section references: base URL and versioning, auth scheme, each needed operation's method, path, parameters and response fields, the pagination style, rate limits and their headers, error format, and idempotency support. List anything the docs leave unclear under Doc gaps; do not fill gaps with guesses.
- Look for an existing HTTP wrapper, config loader, logger and error types in the repo and reuse them.
- Design a small interface: one method per operation, typed inputs, typed results, and a typed error hierarchy (auth, not found, validation, rate limited, server, transport) that keeps the status code and the provider's request id.
- Implement:
- Auth: credentials from configuration, never hard-coded or logged. For OAuth, refresh before expiry and let only one refresh run at a time.
- Timeouts on every request, for both connect and read.
- Retries only for transport errors, 429, 502, 503 and 504, and only for idempotent methods or requests carrying an idempotency key. Use exponential backoff with full jitter, honour
Retry-After, and cap both the attempts and the total time. - Rate limits: a client-side limiter sized to the documented limit, plus backing off when the rate-limit headers say so.
- Pagination: a lazy iterator that follows the documented cursor, link header or offset, with a stop condition and a guard against a cursor that repeats.
- Parsing: model only the fields you use, ignore unknown fields, and parse dates and money explicitly (money as decimal or minor units, never float).
- Write a test fake implementing the same interface for callers' tests, and transport-level tests with canned responses for: success, multi-page listing, 429 with
Retry-Afterthen success, a 5xx retried then succeeding, a non-retryable 4xx, 401, and a malformed body. - Run the tests. Unit tests must make no real network calls.
- Every endpoint, field and header you use must appear in the docs. If one you need does not, stop and report it.
- Redact authorization headers, tokens and personal data from logs and error messages.
- Do not add an SDK or HTTP dependency the repo does not already use unless the docs require it. If the provider publishes an official SDK, mention it in one line under Operational notes.
- Read the relevant code before making a claim about it. Do not guess what a file, function or config contains.
- If the information you need is not available, say what is missing and how to get it instead of inventing it.
- Before saying the work is done, run the check that proves it (tests, build, type check or the command the user gave) and report the real result.
- If you could not run a check, say so plainly and say which one.
Doc gaps
What the docs leave unclear and the assumption you made for each, or "None".
Interface
The public methods with signatures, one line of purpose each.
Changes
One line per file.
Tests
One line per test: the scenario it covers.
Configuration
| Setting | Env var | Default | Required |
Operational notes
Rate limits, retry budget and worst-case latency per call, and what to monitor.
2 required values still a placeholder; the assistant will ask for them.
details
- kind
- Prompt: a task you run by name to get one finished thing back
- domain
- Software engineering
- category
- Implementation
- level
- Intermediate
- made for
- Backend engineer, Software engineer, Full-stack engineer
- needs
- repo-read, file-write, shell, web
- risk
- network
- version
- v1.0.0 · incubating
- reviewed
- 2026-10-02
- works in
- Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Antigravity, OpenCode, Windsurf, Zed, Continue, AGENTS.md
use in
npx @hermes-hq/hodios install integrate-third-party-api --target claude-codenpx skills add hermes-hq/hodios-dist --skill integrate-third-party-api -a claude-codeclaude plugin marketplace add hermes-hq/hodios-distclaude plugin install hodios-software-engineering@hodiosThe plugin brings every entry in this domain at once.
more in implementation
All of ImplementationPut a change behind a feature flag
Wraps new behaviour behind a feature flag with a safe default, a kill switch, tests for both paths and a cleanup ticket. Use when shipping a risky change incrementally.
add-feature-flagAdd rate limiting to an API
Adds rate limiting to API endpoints with a fitting algorithm, keys, per-tier limits, standard headers, 429 responses and tests. Use when protecting endpoints from abuse or overload.
add-rate-limitingBackend engineer
Acts as a backend engineer focused on correct data handling, clear API contracts, explicit failure modes and services that are easy to operate. Use as a builder or reviewer persona for server code.
backend-engineerBuild a REST endpoint end to end
Implements one HTTP endpoint with route, input validation, handler, error mapping and tests in the project's own framework and conventions. Use when adding an API route.
build-rest-endpointBuild a reusable UI component
Builds a typed, accessible UI component from a description or screenshot, with loading, empty and error states and a usage example. Use when adding a component to a frontend.
build-ui-componentBuild a webhook handler
Implements a webhook receiver with signature checks, replay protection, idempotent processing, fast acknowledgement, async work, retries and tests. Use when integrating Stripe, GitHub or similar.
build-webhook-handler