sdk-scaffolder
SDK Scaffolder Protocol
This skill focuses on Developer Experience (DX). Auto-generated clients (via standard Swagger/OpenAPI generators) are notoriously ugly, verbose, and lack domain-specific resilience. This skill generates idiomatic code tailored to a specific language's best practices.
Core assumption: If your SDK is hard to use, developers won't use your API. An SDK is a product in itself.
1. Context & Language Analysis (Static)
Read the API OpenAPI specification and target language (e.g., Python httpx vs requests, or TypeScript fetch vs axios).
2. Idiomatic Design Enforcement
Generate an SDK structure that includes:
- Resilient Core: A base
HttpClientthat automatically handles retries (with exponential backoff) for429and5xxerrors. - Timeouts: A mandatory default timeout (e.g., 10s) to prevent hanging sockets.
- Pagination Helpers: Abstract away
limit/offsetor cursor logic into generator functions or async iterators. - Strong Typing: Fully typed request/response models (e.g., Pydantic for Python, Zod for TypeScript).
3. Output Generation
Required Outputs (Must write BOTH to docs/api-report/):
- Human-Readable Markdown (
docs/api-report/sdk-scaffold-report.md)
### 🧰 SDK Scaffolder: TypeScript/Node.js
**Architecture:** Fetch API + Native Types
**Features:** Auto-retry on 429, Typed Responses.
#### 📝 Usage Example
```typescript
import { MyApiClient } from '@myorg/api';
const client = new MyApiClient({ apiKey: 'sk_test...' });
// The iterator abstracts away pagination cursors!
for await (const order of client.orders.list()) {
console.log(order.id);
}
🏗️ Implementation Guidelines
- Create a
BaseClientthat intercepts fetch calls to add theAuthorizationheader and manage timeouts. - Group API endpoints logically into sub-classes (
client.orders.create(), notclient.createOrder()).
2. **Machine-Readable JSON (`docs/api-report/sdk-scaffold-output.json`)**
```json
{
"skill": "sdk-scaffolder",
"target_language": "TypeScript",
"recommended_libraries": ["zod", "undici"],
"features_included": ["pagination_iterators", "retry_backoff"],
"structure_tree": ["src/", "src/index.ts", "src/client.ts", "src/resources/orders.ts"]
}
Guardrails
- No God Objects: Do not generate a single 10,000-line
ApiClientclass containing 200 methods. Separate them by resource domains (e.g.,client.billing,client.users). - Dependencies: Keep third-party dependencies to an absolute minimum to reduce supply-chain risk for consumers. Prefer standard libraries (e.g.,
fetchin Node 18+).
More from fatih-developer/fth-skills
task-decomposer
Break down large, complex, or ambiguous tasks into independent subtasks with dependency maps, execution order, and success criteria. Plan first, then execute step by step. Triggers on 'how should I do this', 'where do I start', 'plan the project', 'break it down', 'implement' or whenever a task involves multiple phases.
24context-compressor
Compress long conversation histories, large code files, research results, and documents by 70% without losing critical information. Triggers when context window fills up, when summarizing previous steps in multi-step tasks, before loading large files into context, or on 'summarize', 'compress', 'reduce context', 'save tokens'.
18multi-brain-debate
Two-round debate protocol where perspectives challenge each other before consensus. Round 1 presents independent positions, Round 2 allows counter-arguments and rebuttals. Produces battle-tested decisions for high-stakes choices.
17multi-brain-score
Confidence scoring overlay for multi-brain decisions. Each perspective rates its own confidence (1-10) with justification. Consensus uses scores as weights, flags low-confidence areas, and surfaces uncertainty explicitly.
15checkpoint-guardian
Automatic risk assessment before every critical action in agentic workflows. Detects irreversible operations (file deletion, database writes, deployments, payments), classifies risk level, and requires confirmation before proceeding. Triggers on destructive keywords like deploy, delete, send, publish, update database, process payment.
14parallel-planner
Analyze multi-step tasks to identify which steps can run in parallel, build dependency graphs, detect conflicts (write-write, read-write, resource contention), and produce optimized execution plans. Triggers on 3+ independent steps, 'speed up', 'run simultaneously', 'parallelize', 'optimize' or any task where sequential execution wastes time.
14