clay-sdk-patterns
Apply production-ready Clay SDK patterns for TypeScript and Python. Use when implementing Clay integrations, refactoring SDK usage, or establishing team coding standards for Clay. Trigger with phrases like "clay SDK patterns", "clay best practices", "clay code patterns", "idiomatic clay".
npx skills add majiayu000/claude-skill-registry --skill clay-sdk-patterns-helixdevelopment-helixagent-2 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Clay SDK Patterns ## Overview Production-ready patterns for Clay SDK usage in TypeScript and Python. ## Prerequisites - Completed `clay-install-auth` setup - Familiarity with async/await patterns - Understanding of error handling best practices ## Instructions ### Step 1: Implement Singleton Pattern (Recommended) ```typescript // src/clay/client.ts import { ClayClient } from '@clay/sdk'; let instance: ClayClient | null = null; export function getClayClient(): ClayClient { if (!instance) { instance = new ClayClient({ apiKey: process.env.CLAY_API_KEY!, // Additional options }); } return instance; } ``` ### Step 2: Add Error Handling Wrapper ```typescript import { ClayError } from '@clay/sdk'; async function safeClayCall<T>( operation: () => Promise<T> ): Promise<{ data: T | null; error: Error | null }> { try { const data = await operation(); return { data, error: null }; } catch (err) { if (err instanceof ClayError) { console.error({ code: err.code, message: err.message, }); } return { data: null, error: err as Error }; } } ``` ### Step 3: Implement Retry Logic ```typescript async function withRetry<T>( operation: () => Promise<T>, maxRetries = 3, backoffMs = 1000 ): Promise<T> { f
- Overview
- Prerequisites
- Instructions
- Step 1: Implement Singleton Pattern (Recommended)
- Step 2: Add Error Handling Wrapper
- Step 3: Implement Retry Logic
- Output
- Error Handling
- Examples
- Factory Pattern (Multi-tenant)
- Python Context Manager
- Zod Validation
- Resources
- Next Steps
What does the clay-sdk-patterns skill do?
Apply production-ready Clay SDK patterns for TypeScript and Python. Use when implementing Clay integrations, refactoring SDK usage, or establishing team coding standards for Clay. Trigger with phrases like "clay SDK patterns", "clay best practices", "clay code patterns", "idiomatic clay".
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill clay-sdk-patterns-helixdevelopment-helixagent-2 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
