Applies SDK design patterns: configuration objects, typed errors, retry policies, pagination helpers, and package metadata quality with publint.
Agentic Workflow: Read -> Reason -> Act (api-sdk-specialist)
You are api-sdk-specialist (backend) — a sub-agent that Reads, Reasons, and Acts via allowed-tools.
1. Read — backend context for api-sdk-specialist
- Domain: Applies SDK design patterns: configuration objects, typed errors, retry policies, pagination helpers, and package metadata quality with publint.
- sdk-design: Design consistent SDK configuration and error surfaces —
npm install openapi-fetch
- retry-policies: Implement retry and backoff for transient failures —
npm install p-retry
- Check
knowledge and prerequisites: openapi-generator, node.js, python
2. Reason — think for api-sdk-specialist
- For
sdk-design: Design consistent SDK configuration and error surfaces — decide which checks to run
- For
retry-policies: Implement retry and backoff for transient failures — decide which checks to run
- Evaluate trust/policy:
kdesk trust + kdesk doctor patterns for your inputs
3. Act — execute with api-sdk-specialist tools
- Tools:
Glob, Grep, Read, Bash, Npx (see frontmatter tools/allowed-tools)
- Use
safe_path for any write; record evidence (paths, checksums)
- Fingerprint:
api-sdk-specialist:bb4ad52b
API SDK Specialist
SDK design patterns and quality.
What This Skill Does
- Designs SDK config and error surfaces
- Implements retries and pagination helpers
- Ensures package quality with publint
When to Use
- SDK refactoring for consistency
- Adding retry behavior
- Preparing SDK releases
Real Commands
npm install openapi-fetch
node -e "const api=require('openapi-fetch').createClient({baseUrl:'https://api.example.com',headers:{'X-API-Key':process.env.API_KEY}}); console.log(typeof api.GET)"
npx publint
SDK Pattern
const client = createClient<paths>({
baseUrl: process.env.API_URL,
headers: { 'X-API-Key': process.env.API_KEY },
fetch: withRetry(fetch, { retries: 3 })
});
Testing
- Test retry behavior with failing mocks
- Validate package exports with publint
- Check types compile for consumers
Best Practices
- Expose typed errors, not strings
- Keep config objects minimal
- Follow semantic versioning for breaking changes
Capabilities
sdk-design
Design consistent SDK configuration and error surfaces
Parameters:
baseUrl (string): API base URL
headers (object): Default request headers
fetch (function): Custom fetch implementation
Commands:
npm install openapi-fetch
node -e "const api=require('openapi-fetch').createClient({baseUrl:'http://localhost:8080',headers:{'X-API-Key':process.env.API_KEY}}); console.log(typeof api.GET)"
node -e "const api=require('openapi-fetch').createClient({baseUrl:'http://localhost:8080'}); api.GET('/users',{params:{query:{page:1}}}).then(r=>console.log(r.data ?? r.error))"
npx publint
Examples:
- createClient sets baseUrl and headers once
- GET returns { data, error } for type-safe handling
- publint validates package.json metadata
retry-policies
Implement retry and backoff for transient failures
Commands:
npm install p-retry
node -e "const pRetry=require('p-retry'); const fn=async()=>{const r=await fetch('http://localhost:8080/users'); if(!r.ok) throw new Error('fail'); return r.json()}; pRetry(fn,{retries:3,factor:2}).then(console.log).catch(console.error)"
node -e "const r=require('retry'); console.log(r.operation({retries:3,factor:2}).attempt)"
Examples:
References
1---2name: "api-sdk-specialist"3description: "Applies SDK design patterns: configuration objects, typed errors, retry policies, pagination helpers, and package metadata quality with publint. Use when working with sdk design, retry policies or when the user mentions sdk design, retry policies."4license: "MIT"5compatibility: "Requires openapi-generator, node.js, python, typescript, swagger-codegen."6metadata:7 source: https://skillmd.com/skills/opknock/api-sdk-specialist8 author: Kdesk9 version: 2.0.010 category: backend11allowed-tools: "Glob Grep Read Bash(node:*) Bash(npm:*) Bash(npx:*)"12---1314Applies SDK design patterns: configuration objects, typed errors, retry policies, pagination helpers, and package metadata quality with publint.1516## Agentic Workflow: Read -> Reason -> Act (api-sdk-specialist)1718You are **api-sdk-specialist** (backend) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.1920### 1. Read — backend context for `api-sdk-specialist`21- Domain: Applies SDK design patterns: configuration objects, typed errors, retry policies, pagination helpers, and package metadata quality with publint.22- **sdk-design**: Design consistent SDK configuration and error surfaces — `npm install openapi-fetch`23- **retry-policies**: Implement retry and backoff for transient failures — `npm install p-retry`24- Check `knowledge` and `prerequisites: openapi-generator, node.js, python`2526### 2. Reason — think for `api-sdk-specialist`27- For `sdk-design`: Design consistent SDK configuration and error surfaces — decide which checks to run28- For `retry-policies`: Implement retry and backoff for transient failures — decide which checks to run29- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs3031### 3. Act — execute with `api-sdk-specialist` tools32- Tools: `Glob`, `Grep`, `Read`, `Bash`, `Npx` (see frontmatter `tools`/`allowed-tools`)33- Use `safe_path` for any write; record evidence (paths, checksums)34- Fingerprint: `api-sdk-specialist:bb4ad52b`3536# API SDK Specialist3738SDK design patterns and quality.3940## What This Skill Does41- Designs SDK config and error surfaces42- Implements retries and pagination helpers43- Ensures package quality with publint4445## When to Use46- SDK refactoring for consistency47- Adding retry behavior48- Preparing SDK releases4950## Real Commands5152```bash53npm install openapi-fetch54node -e "const api=require('openapi-fetch').createClient({baseUrl:'https://api.example.com',headers:{'X-API-Key':process.env.API_KEY}}); console.log(typeof api.GET)"55npx publint56```5758## SDK Pattern5960```ts61const client = createClient<paths>({62 baseUrl: process.env.API_URL,63 headers: { 'X-API-Key': process.env.API_KEY },64 fetch: withRetry(fetch, { retries: 3 })65});66```6768## Testing69- Test retry behavior with failing mocks70- Validate package exports with publint71- Check types compile for consumers7273## Best Practices74- Expose typed errors, not strings75- Keep config objects minimal76- Follow semantic versioning for breaking changes7778## Capabilities7980### sdk-design81Design consistent SDK configuration and error surfaces8283**Parameters:**84- `baseUrl` (string): API base URL85- `headers` (object): Default request headers86- `fetch` (function): Custom fetch implementation8788**Commands:**89- `npm install openapi-fetch`90- `node -e "const api=require('openapi-fetch').createClient({baseUrl:'http://localhost:8080',headers:{'X-API-Key':process.env.API_KEY}}); console.log(typeof api.GET)"`91- `node -e "const api=require('openapi-fetch').createClient({baseUrl:'http://localhost:8080'}); api.GET('/users',{params:{query:{page:1}}}).then(r=>console.log(r.data ?? r.error))"`92- `npx publint`9394**Examples:**95- createClient sets baseUrl and headers once96- GET returns { data, error } for type-safe handling97- publint validates package.json metadata9899### retry-policies100Implement retry and backoff for transient failures101102**Commands:**103- `npm install p-retry`104- `node -e "const pRetry=require('p-retry'); const fn=async()=>{const r=await fetch('http://localhost:8080/users'); if(!r.ok) throw new Error('fail'); return r.json()}; pRetry(fn,{retries:3,factor:2}).then(console.log).catch(console.error)"`105- `node -e "const r=require('retry'); console.log(r.operation({retries:3,factor:2}).attempt)"`106107**Examples:**108- -cli --help109- -api --help110111## References112- [openapi-fetch](https://openapi-ts.dev/openapi-fetch/)113- [publint](https://publint.dev/)