Agent skill · software engineering · jeremylongshore
elevenlabs-reference-architecture
Implement an ElevenLabs reference architecture for production TTS/voice applications. Use when designing new ElevenLabs integrations, reviewing project structure, or building a scalable audio generation service. Trigger with "elevenlabs architecture", "elevenlabs project structure", "how to organize elevenlabs", "TTS service architecture", "elevenlabs design patterns", "voice API architecture".
Why this skill is useful
Provides a detailed reference architecture for ElevenLabs TTS applications, including specific project structures and service layers that the AI wouldn't generate on its own.
What it needs
Requires redis installed locally. Requires elevenlabs account access. About 3k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.
What this skill does
ElevenLabs Reference Architecture Overview Production-ready architecture for ElevenLabs TTS/voice applications. Covers project layout, service layers, caching, streaming, and multi-model orchestration. The full code for each layer lives in references/ so this file stays a navigable map; drill into a reference file when you need the exact implementation. Prerequisites Understanding of layered architecture patterns ElevenLabs SDK knowledge (see elevenlabs-sdk-patterns) TypeScript project with async patterns Redis (optional, for distributed caching) Auth: an ElevenLabs API key exported as ELEVENLABSAPIKEY (read by the config layer). This is the only ElevenLabs credential — your app's own request auth (middleware/auth.ts) is separate and unrelated. Instructions Build the service in six layers. Each step below is the high-level move; the verbatim code and diagrams are in the linked reference files. Step 1: Lay out the project Split the codebase into elevenlabs/ (client, config, models, errors, types), services/ (tts, voice, audio, cache), api/ (routes + middleware), queue/, and monitoring/. See the full project tree. Step 2: Configuration layer Define an environment-aware ElevenLabsConfig — dev uses the cheap/fast elevenflashv25 and small output format; production uses elevenmultilingualv2 at higher quality, more concurrency, and a larger cache. loadConfig() merges the per-environment defaults with ELEVENLABSAPIKEY. Full interface and ENVCONFIGS: implementation walkthrough. Step 3: TTS service layer Wrap the SDK client in a TTSService that owns a singleton client and a p-queue sized to maxConcurrency (this is what prevents 429s). generate() supports both streaming and buffered convert, logs latency, and routes errors through classifyError. generateLongText() splits on sentence boundaries under the 5000-char limit to preserve prosody. Full class: implementation walkthrough. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills jeremylongshore/elevenlabs-reference-architecture--641a96