api-connector
Design REST and SOAP API connector specifications with authentication, pagination, and error handling for insurance and financial services system integrations.
What this skill does
# API Connector Designer
Produce a complete API connector specification for a system-to-system integration. This document is the technical blueprint a developer uses to build the connector. Every decision about authentication, pagination, retries, and configuration is made explicitly.
## API Documentation Review
Before designing the connector, document what is known about the target API:
| Field | Value |
|-------|-------|
| API Name | [System name] REST/SOAP API |
| Base URL (sandbox) | https://sandbox.api.[system].com/v2 |
| Base URL (production) | https://api.[system].com/v2 |
| Authentication method | [OAuth 2.0 / API Key / Basic Auth / Mutual TLS] |
| API version | v2 (or current stable version) |
| Rate limit | 100 requests/minute per API key |
| Pagination style | Cursor / Offset / Page-based |
| Response format | JSON (application/json) |
| API documentation URL | [URL] |
| Sandbox availability | Yes / No |
| Support contact | [vendor support email or portal] |
## Authentication Flow Specification
Choose one of the following patterns based on the API's authentication method:
### OAuth 2.0 — Client Credentials (Machine-to-Machine)
Used when the integration runs as a background service without a user context:
```
Token endpoint: POST https://auth.[system].com/oauth/token
Request body (application/x-www-form-urlencoded):
grant_type=client_credentials
client_id={CLIENT_ID} [from environment variable CLIENT_ID]
client_secret={CLIENT_SECRET} [from Azure Key Vault]
scope=policies:read claims:read clients:write
Response:
{
"access_token": "eyJ...",
"token_type": "Bearer",
"expires_in": 3600
}
Usage: Add to every request header:
Authorization: Bearer {access_token}
Token storage:
- Store in memory (process/worker scope) — never persist to disk or database
- Refresh when: expires_in - 60 seconds (refresh 60 seconds before expiry)
- Refresh mechanism: Re-POST to token endpoint with same credentials
Token refresh pseudocode:
on startup: fetch_token()
before each API call: if token_expires_at < now + 60s then fetch_token()
on 401 response: fetch_token() then retry request once
```
### OAuth 2.0 — Authorization Code (User-Delegated, if required)
Used only if the API requires a specific user's identity for authorization:
```
Authorization endpoint: GET https://auth.[system].com/authorize
?response_type=code
&client_id={CLIENT_ID}
&redirect_uri=https://[your-app].com/callback
&scope=policies:read
&state={random-state-value} [CSRF protection]
Token exchange: POST https://auth.[system].com/oauth/token
grant_type=authorization_code
code={code}
redirect_uri=https://[your-app].com/callback
client_id={CLIENT_ID}
client_secret={CLIENT_SECRET}
Refresh token handling:
Store refresh token in encrypted database field (not plaintext)
Rotate refresh token on each use if API supports refresh token rotation
```
### API Key Authentication
```
Key placement: Header (preferred) or Query parameter
Header name: X-API-Key (or as specified by vendor)
Header format:
X-API-Key: {API_KEY}
Storage:
- Development: Local environment variable (never in source code)
- Production: Azure Key Vault secret named "[system-name]-api-key"
- Rotation: Rotate every 90 days; update Key Vault value without code change
Key per environment: Use separate API keys for sandbox and production. Never use the production API key in development or testing.
```
### Mutual TLS (mTLS)
For APIs requiring certificate-based authentication (common in regulated financial data APIs):
```
Client certificate: .pfx format stored in Azure Key Vault Certificate store
Certificate subject: CN=[firm-name]-integration, O=[Firm], C=US
Certificate validity: 1 year — calendar reminder 60 days before expiry
Renewal process: Generate CSR → vendor signs → import new cert to Key Vault → update connector config
TLS configuration:
TLS version: 1.2 minimum (1.3 preferred)
Certificate pinning: Enable if vendor provides a fixed certificate fingerprint
```
## Endpoint Inventory
Document every API endpoint the connector uses:
| # | Method | Path | Purpose | Request Parameters | Response |
|---|--------|------|---------|-------------------|----------|
| 1 | GET | /policies | List all policies | `?status=active&page_token={cursor}&limit=100` | Policy array + next_page_token |
| 2 | GET | /policies/{id} | Get single policy by ID | Path: `id` = policy ID | Policy object |
| 3 | POST | /policies | Create new policy | Request body: PolicyCreateRequest | Created policy object |
| 4 | PUT | /policies/{id} | Update policy | Path: `id`, Body: PolicyUpdateRequest | Updated policy object |
| 5 | GET | /clients/{clientId}/policies | Get policies for a client | Path: `clientId` | Policy array |
| 6 | POST | /claims | Submit a claim | Body: ClaimSubmitRequest | Claim object with claimId |
**Request schema** (for each POST/PUT endpoint, document the full schema):
```json
PolicyCreateRequest:
{
"client_id": "string (required) — must match AMS client ID format",
"effective_date": "string (required) — ISO 8601 date: YYYY-MM-DD",
"expiration_date": "string (required) — ISO 8601 date, must be after effective_date",
"line_of_business": "string (required) — enum: AUTO, HOME, LIFE, COMMERCIAL",
"carrier_code": "string (required) — 6-character carrier code",
"written_premium": "number (required) — decimal, 2 places, USD",
"producer_id": "string (required) — must match producer record in system",
"endorsements": "array (optional) — array of EndorsementRequest objects",
"notes": "string (optional) — max 500 characters"
}
```
**Response schema** (for each endpoint, document key response fields used by the connector):
```json
PolicyObject:
{
"policy_id": "string — system-assigned unique ID",
"policy_number": "string — human-readable policy number",
"status": "string — enum: ACTIVE, CANCELLED, EXPIRED, PENDING",
"client_id": "string",
"created_at": "string — ISO 8601 datetime",
"updated_at": "string — ISO 8601 datetime",
...
}
```
**HTTP status codes and meanings** (specific to this API):
| Status Code | Meaning | Connector Action |
|------------|---------|-----------------|
| 200 | Success | Process response body |
| 201 | Created | Extract `policy_id` from response |
| 400 | Bad request — validation error | Parse error details, log, send to DLQ |
| 401 | Unauthorized | Refresh token, retry once |
| 403 | Forbidden — permission issue | Do not retry, alert admin |
| 404 | Record not found | Log as warning, skip record |
| 409 | Conflict — duplicate record | Check for existing record, update instead |
| 422 | Unprocessable entity | Validation failure — log field errors, send to DLQ |
| 429 | Rate limited | Respect Retry-After header, implement backoff (see rate-limiter skill) |
| 500 | Server error | Retry with backoff up to 3 times, then alert |
| 503 | Service unavailable | Retry with backoff, alert if > 5 minutes |
## Pagination Handling
**Cursor-based pagination** (most modern APIs):
```
First request: GET /policies?limit=100
Response: { "data": [...100 items...], "next_page_token": "abc123", "has_more": true }
Subsequent request: GET /policies?limit=100&page_token=abc123
Continue until: "has_more": false OR "next_page_token" is null/absent
Safety limit: Maximum 1000 pages (100,000 records). If limit reached, log a warning and alert operations — this indicates an unexpectedly large dataset.
```
**Offset-based pagination**:
```
Request: GET /policies?offset=0&limit=100
Next: GET /policies?offset=100&limit=100
Stop when: response array length < limit (last page)
Safety limit: offset <= 100000
```
**Page-number pagination**:
```
Request: GET /policies?page=1&per_page=100
Next: increment page by 1
Stop when: response contains "total_pages" and current page >= total_pages, OR response array is empty
```
## Connector Configuration Schema
Define the configuration fields that can be set per deployment (per cliRelated in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.