Agent skill · software engineering · jeremylongshore

castai-sdk-patterns

Build a production REST adapter for CAST AI from the current OpenAPI contract without inventing an unofficial SDK surface. Use when wrapping CAST AI operations in TypeScript, Python, or another service. Trigger with: "build a CAST AI client", "wrap the CAST AI API", "integrate CAST AI in code".

Why this skill is useful

Adds a complete TypeScript and Python SDK wrapper for the CAST AI API, including retry logic and singleton patterns, which are not available in public documentation.

What it needs

Requires python, typescript installed locally. Requires castai account access. About 2k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.

What this skill does

CAST AI Contract-First API Adapter Overview Create a narrow adapter around approved CAST AI operations. Treat the OpenAPI description, regional base URL, organization scope, response schemas, and endpoint-specific rate behavior as explicit dependencies. Prerequisites Named operations and business purpose CAST AI region, organization boundary, and least-privilege service identity Current OpenAPI contract pinned or checksummed for generation Error, retry, telemetry, and secret-handling policy Instructions Step 1: Choose API versus Terraform Use Read and Grep to determine whether the work is declarative infrastructure or runtime integration. Prefer the supported Terraform provider for owned desired state; use REST for bounded runtime reads or operations that the chosen provider does not own. Step 2: Pin the contract Record the current API specification origin, retrieval time, checksum, selected operation IDs, and generated-client tool version. Do not copy guessed paths from examples or expose the entire generated surface to application code. Step 3: Build the transport boundary Use Write or Edit to implement injected regional base URL, X-API-Key header handling, optional enterprise organization header, request timeout, cancellation, bounded response size, structured redaction, and correlation metadata. Never place keys in URLs or exception messages. Step 4: Normalize domain operations Expose small intent-oriented methods with validated identifiers and typed results. Keep raw provider payloads behind the adapter, retain unknown fields safely, and distinguish absent data from zero values. Step 5: Classify failures Map transport failures, 401, 403, 404, 409, endpoint-specific 429, 5xx, schema mismatch, deadline exhaustion, and uncertain mutation outcome. Retry only proven idempotent operations within a shared request budget. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills jeremylongshore/castai-sdk-patterns

View the source on GitHub

Browse the @skills marketplace