Agent skill

SDK Design Patterns

by revfactory in revfactory/harness-100

SDK/API client design patterns: builder pattern, interceptor chain, retry strategy, type-safe design, error handling, and pagination wrapper guide.

Apache-2.0Auto-check passedDevelopment

Install SDK Design Patterns

skills CLI
$ npx skills add revfactory/harness-100 --skill sdk-design-patterns -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install revfactory/harness-100 sdk-design-patterns --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/revfactory/harness-100.git skills-src && mkdir -p .claude/skills && cp -r skills-src/en/35-api-client-generator/.claude/skills/sdk-design-patterns .claude/skills/sdk-design-patterns && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
sdk-design-patterns
GitHub stars
1.3k
Token cost
~1.8k tokens
SKILL.md length
45 words
Files
1
Skills in repo
464
Repo updated
First seen
Licence
Apache-2.0

At a glance

SDK/API client design patterns: builder pattern, interceptor chain, retry strategy, type-safe design, error handling, and pagination wrapper guide.

  • Requests involving SDK design
  • SKILL.md covers SDK Architecture, Builder Pattern (Client…, Interceptor / Middleware Chain and Retry Strategy, plus 4 more sections
  • Needs API_KEY
  • Client patterns

What it does

SDK Design Patterns is an agent skill from revfactory/harness-100. SDK/API client design patterns: builder pattern, interceptor chain, retry strategy, type-safe design, error handling, and pagination wrapper guide. Use this skill for requests involving 'SDK design', 'client patterns', 'retry strategy', 'interceptor', 'builder pattern', 'SDK error handling', 'type safety', 'SDK architecture', etc. Enhances sdk-developer's SDK design capabilities. Note: API spec parsing, test authoring, and documentation are outside the scope of this skill.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Design patterns, Type safety and OpenAPI specifications. The licence is Apache-2.0.

When your agent uses it

  • Requests involving SDK design
  • Client patterns
  • Builder pattern
  • SDK error handling

Example prompts

  • “SDK design”
  • “client patterns”
  • “retry strategy”
  • “/sdk-design-patterns”

Requirements

  • Python 3
  • A credential in API_KEY

What it can do on your machine

Read from SKILL.md and the folder at commit 8e8d35c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript, python and markdown).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

SDK Design Patterns loads about 1.8k tokens when it runs. Until then it costs about 124 tokens; SKILL.md has 45 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~124
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from revfactory/harness-100 at commit 8e8d35c, republished under its Apache-2.0 licence (© revfactory). 45 words, ~1,753 tokens.

Download SKILL.mdSave it as .claude/skills/sdk-design-patterns/SKILL.md (or your agent's skills folder).
name
sdk-design-patterns
description
SDK/API client design patterns: builder pattern, interceptor chain, retry strategy, type-safe design, error handling, and pagination wrapper guide. Use this skill for requests involving 'SDK design', 'client patterns', 'retry strategy', 'interceptor', 'builder pattern', 'SDK error handling', 'type safety', 'SDK architecture', etc. Enhances sdk-developer's SDK design capabilities. Note: API spec parsing, test authoring, and documentation are outside the scope of this skill.

SDK Design Patterns — SDK Design Patterns Guide

A pattern catalog for designing type-safe, developer-friendly API client SDKs.

SDK Architecture

+------------------------------------------+
|              SDK Public API               |
|  client.users.list()                      |
|  client.orders.create({...})              |
+------------------------------------------+
|           Resource Clients                |
|  UsersClient, OrdersClient, ...           |
+------------------------------------------+
|           Middleware Chain                 |
|  Auth -> Retry -> RateLimit -> Logger     |
+------------------------------------------+
|           HTTP Transport                  |
|  fetch / axios / httpx                    |
+------------------------------------------+

Builder Pattern (Client Initialization)

TypeScript
typescript
const client = new ApiClient({
  baseUrl: 'https://api.example.com',
  apiKey: process.env.API_KEY,
  timeout: 30000,
  retries: 3,
  // Optional customization
  fetch: customFetch,
  headers: { 'X-Custom': 'value' },
});

// Resource access
const users = await client.users.list({ page: 1, perPage: 20 });
const user = await client.users.get('user_123');
const newUser = await client.users.create({ name: 'John Doe', email: 'john@test.com' });
Python
python
client = ApiClient(
    base_url="https://api.example.com",
    api_key=os.environ["API_KEY"],
    timeout=30.0,
    max_retries=3,
)

# Context manager support
async with ApiClient(api_key="...") as client:
    users = await client.users.list(page=1, per_page=20)

Interceptor / Middleware Chain

typescript
// Interceptor interface
interface Interceptor {
  beforeRequest(config: RequestConfig): Promise<RequestConfig>;
  afterResponse(response: Response): Promise<Response>;
  onError(error: Error): Promise<never>;
}

// Authentication interceptor
class AuthInterceptor implements Interceptor {
  async beforeRequest(config) {
    config.headers['Authorization'] = `Bearer ${this.token}`;
    return config;
  }
  async onError(error) {
    if (error.status === 401 && this.refreshToken) {
      await this.refresh();
      return this.retry(error.config);
    }
    throw error;
  }
}

// Retry interceptor
class RetryInterceptor implements Interceptor {
  async onError(error) {
    if (this.shouldRetry(error) && this.attempt < this.maxRetries) {
      await this.backoff(this.attempt);
      return this.retry(error.config);
    }
    throw error;
  }
}

Retry Strategy

typescript
class RetryStrategy {
  private maxRetries = 3;
  private baseDelay = 1000; // ms

  shouldRetry(error: ApiError): boolean {
    // Only retry on retryable errors
    return [408, 429, 500, 502, 503, 504].includes(error.status);
  }

  getDelay(attempt: number, error: ApiError): number {
    // 429: Retry-After header takes priority
    if (error.status === 429 && error.headers['retry-after']) {
      return parseInt(error.headers['retry-after']) * 1000;
    }
    // Exponential backoff + jitter
    const exponential = this.baseDelay * Math.pow(2, attempt);
    const jitter = Math.random() * this.baseDelay;
    return Math.min(exponential + jitter, 60000); // Max 60 seconds
  }
}

Type-Safe Design

TypeScript Generic Usage
typescript
// Resource type definitions
interface User {
  id: string;
  name: string;
  email: string;
  createdAt: Date;
}

interface CreateUserRequest {
  name: string;
  email: string;
}

interface ListUsersParams {
  page?: number;
  perPage?: number;
  sort?: 'name' | 'createdAt';
  order?: 'asc' | 'desc';
}

// Generic resource client
class ResourceClient<T, CreateT, UpdateT, ListParams> {
  async list(params?: ListParams): Promise<PaginatedResponse<T>> { ... }
  async get(id: string): Promise<T> { ... }
  async create(data: CreateT): Promise<T> { ... }
  async update(id: string, data: UpdateT): Promise<T> { ... }
  async delete(id: string): Promise<void> { ... }
}

// Concrete client
class UsersClient extends ResourceClient<User, CreateUserRequest, UpdateUserRequest, ListUsersParams> {
  // Additional methods
  async listOrders(userId: string): Promise<Order[]> { ... }
}
Python Pydantic Models
python
from pydantic import BaseModel, Field
from datetime import datetime

class User(BaseModel):
    id: str
    name: str
    email: str
    created_at: datetime = Field(alias="createdAt")

    class Config:
        populate_by_name = True

class CreateUserRequest(BaseModel):
    name: str
    email: str

Pagination Wrapper

typescript
// Auto page traversal
class PaginatedResponse<T> {
  data: T[];
  hasMore: boolean;
  nextCursor?: string;

  // Iterator support
  async *[Symbol.asyncIterator](): AsyncIterator<T> {
    let response: PaginatedResponse<T> = this;
    while (true) {
      for (const item of response.data) {
        yield item;
      }
      if (!response.hasMore) break;
      response = await this.fetchNext(response.nextCursor);
    }
  }
}

// Usage
for await (const user of client.users.list()) {
  console.log(user.name);  // Auto-traverses all pages
}

// Specific page only
const page1 = await client.users.list({ perPage: 20 });

Error Handling

typescript
// Error class hierarchy
class ApiError extends Error {
  status: number;
  code: string;
  details?: any;
}

class BadRequestError extends ApiError { status = 400; }
class AuthenticationError extends ApiError { status = 401; }
class NotFoundError extends ApiError { status = 404; }
class RateLimitError extends ApiError {
  status = 429;
  retryAfter: number;
}
class InternalError extends ApiError { status = 500; }

// Usage
try {
  const user = await client.users.get('invalid_id');
} catch (e) {
  if (e instanceof NotFoundError) {
    console.log('User not found');
  } else if (e instanceof RateLimitError) {
    console.log(`Retry after ${e.retryAfter} seconds`);
  }
}

SDK Quality Checklist

markdown
### Usability
- [ ] Can get started in 3 lines or fewer (Quick Start)
- [ ] 100% IDE autocomplete support (fully typed)
- [ ] Error messages guide toward resolution
- [ ] Supports both sync and async

### Robustness
- [ ] Retry + exponential backoff
- [ ] Auto token refresh
- [ ] Auto rate limit wait
- [ ] Configurable timeouts
- [ ] Custom HTTP client injection supported

### Testing
- [ ] Unit tests for all public APIs
- [ ] Mock server integration tests
- [ ] Error scenario tests
- [ ] Pagination tests

© revfactory, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in en/35-api-client-generator/.claude/skills/sdk-design-patterns of revfactory/harness-100.

Open the folder on GitHubat commit 8e8d35c

Compare with similar skills

SDK Design Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

SDK Design Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
SDK Design Patterns this skillrevfactory/harness-1001.3k—~1.8kAutomated safety check: PassApache-2.0
Effect Client WrapperUsefulSoftwareCo/executor4.1k1 repos~1.4kAutomated safety check: PassMIT
Zodjasonjgardner/blockbench-mcp-plugin4883 repos~1.4kAutomated safety check: PassGPL-3.0
Olore Orpc Latestolorehq/olore103—~488Automated safety check: PassMIT
Backendredis/RedisInsight8.9k—~1.6kAutomated safety check: PassCustom licence
RTK Rust Design Patternsrtk-ai/rtk83k—~1.9kAutomated safety check: PassApache-2.0

Similar skills

  • Effect Client Wrapper

    UsefulSoftwareCo/executor

    Pattern for wrapping third-party SDK clients (Stripe, Resend, AWS, etc.) with Effect.

    4.1k GitHub starsUsed in 1 repo~1.4k tokens
    DevelopmentAuto-check passed
  • Zod

    jasonjgardner/blockbench-mcp-plugin

    Zod schema validation best practices for type safety, parsing, and error handling.

    488 GitHub starsUsed in 3 repos~1.4k tokens
    DevelopmentAuto-check passed
  • Olore Orpc Latest

    olorehq/olore

    Local orpc documentation reference (latest). An agent skill from olorehq/olore.

    103 GitHub stars~488 tokensUpdated today
    Backend & APIsAuto-check passed
  • Backend

    redis/RedisInsight

    Official

    NestJS backend development patterns for the RedisInsight API: module structure, services, controllers, DTOs, dependency injection, and error handling.

    8.9k GitHub stars~1.6k tokensUpdated 2 days ago
    Backend & APIsAuto-check passed
  • Describes seven Rust design patterns for the RTK CLI filter modules, with when to use each, RTK examples, and notes on when a pattern is overkill.

    83k GitHub stars~1.9k tokensUpdated today
    DevelopmentAuto-check passed
  • GitVersion .NET Development

    GitTools/GitVersion

    Gives repository-specific .NET guidance for GitVersion: build and test commands, central package management, project layout and coding conventions.

    3.1k GitHub stars~1.7k tokensUpdated yesterday
    DevelopmentAuto-check passed

More from revfactory/harness-100

All 464 skills in this repo
  • Anti Bot Analyzer

    revfactory/harness-100

    A skill for analyzing website anti-bot defense mechanisms and developing legitimate evasion strategies.

    1.3k GitHub stars~1.1k tokensUpdated 6 mo ago
    Auto-check passed
  • API Error Design Patterns

    revfactory/harness-100

    Reference for designing how an API reports failures: structured error codes, response shapes, client-friendly messages, an error catalog and retry or fallback advice.

    1.3k GitHub stars~1.6k tokensUpdated 6 mo ago
    Auto-check passed
  • API Security Checklist

    revfactory/harness-100

    Walks a backend-dev agent through OWASP API Top 10 checks, authentication and authorization patterns, and defense code during API design.

    1.3k GitHub stars~1.7k tokensUpdated 6 mo ago
    Auto-check passed
  • Arg Parser Generator

    revfactory/harness-100

    Methodology for systematically designing and generating CLI tool argument parser structures.

    1.3k GitHub stars~1.2k tokensUpdated 6 mo ago
    Auto-check passed
  • Audience Segmentation

    revfactory/harness-100

    Audience segmentation skill used by the analyst and curator agents.

    1.3k GitHub stars~1.3k tokensUpdated 6 mo ago
    Auto-check passed
  • Audio Storytelling

    revfactory/harness-100

    Audio storytelling skill used by the podcast scriptwriter and show note editor.

    1.3k GitHub stars~1.6k tokensUpdated 6 mo ago
    Auto-check passed

Categories

Questions about SDK Design Patterns

What does SDK Design Patterns do?

SDK/API client design patterns: builder pattern, interceptor chain, retry strategy, type-safe design, error handling, and pagination wrapper guide. SDK Design Patterns is an agent skill from revfactory/harness-100. SDK/API client design patterns: builder pattern, interceptor chain, retry strategy, type-safe design, error handling, and pagination wrapper guide.

When should I use SDK Design Patterns?

SDK Design Patterns fits situations like: requests involving SDK design; client patterns; builder pattern; SDK error handling.

How do I install SDK Design Patterns in Claude Code?

Run `npx skills add revfactory/harness-100 --skill sdk-design-patterns -a claude-code`. Or copy the skill folder (en/35-api-client-generator/.claude/skills/sdk-design-patterns in revfactory/harness-100) into .claude/skills/sdk-design-patterns in your project. Claude Code loads it when a task matches its description.

How do I install SDK Design Patterns in Codex?

Run `npx skills add revfactory/harness-100 --skill sdk-design-patterns -a codex`. Or copy the skill folder (en/35-api-client-generator/.claude/skills/sdk-design-patterns in revfactory/harness-100) into .agents/skills/sdk-design-patterns in your project. Codex loads it when a task matches its description.

Can I use SDK Design Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add revfactory/harness-100 --skill sdk-design-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sdk-design-patterns, .gemini/skills/sdk-design-patterns, .github/skills/sdk-design-patterns and .opencode/skills/sdk-design-patterns in your project.

What does SDK Design Patterns need to run?

Going by SKILL.md and its folder, SDK Design Patterns needs credentials named API_KEY. Our summary lists: Python 3; A credential in API_KEY.

Does SDK Design Patterns access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is SDK Design Patterns safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does SDK Design Patterns use?

SDK Design Patterns is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does SDK Design Patterns use?

About 1.8k tokens (SKILL.md is roughly 7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to SDK Design Patterns?

Skills that share tags, products or a category with SDK Design Patterns: Effect Client Wrapper (UsefulSoftwareCo/executor, 4.1k stars), Zod (jasonjgardner/blockbench-mcp-plugin, 488 stars), Olore Orpc Latest (olorehq/olore, 103 stars) and Backend (redis/RedisInsight, 8.9k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains SDK Design Patterns?

revfactory (a GitHub user) maintains it in revfactory/harness-100, which has 1,290 GitHub stars. The repository holds 464 skills in this directory. The repository was last updated on March 22, 2026.

Source: revfactory/harness-100 on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.