/elevenlabs-pack:elevenlabs-ci-integrationfrom elevenlabs-pack
Configures CI/CD pipelines for ElevenLabs with mocked unit tests and gated integration tests to avoid burning character quota on every PR.
Ships in elevenlabs-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Set up CI/CD pipelines that test ElevenLabs integrations without burning
character quota on every PR. Uses a two-tier strategy: mocked unit tests on
every push (no API key, zero quota), and gated integration tests that hit
the real API only on main or a manual dispatch, behind a quota guard.
The full workflow YAML and secret setup live in references/implementation.md; the complete test code lives in references/examples.md. This file walks the strategy end to end, then drills into either reference for copy-paste source.
Create .github/workflows/elevenlabs-tests.yml with two jobs. unit-tests
runs on every push/PR with a mock key. integration-tests runs only on main
or workflow_dispatch, needs: unit-tests, and checks remaining quota before
spending any:
jobs:
unit-tests: # every push/PR — mock key, 0 quota
runs-on: ubuntu-latest
steps: [checkout, setup-node, npm ci, npm test -- --coverage]
# env: ELEVENLABS_API_KEY: "sk_test_mock_key_for_ci"
integration-tests: # main / manual only — real key
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
needs: unit-tests
# 1) GET /v1/user → skip if remaining characters < 5000
# 2) npm run test:integration behind that guard
Copy the complete, runnable workflow from references/implementation.md.
gh secret set ELEVENLABS_API_KEY --body "sk_your_test_key_here"
# optional, for webhook tests:
gh secret set ELEVENLABS_WEBHOOK_SECRET --body "whsec_your_secret_here"
Mock the entire SDK so unit tests never call the API or spend quota. Minimal skeleton:
vi.mock("@elevenlabs/elevenlabs-js", () => ({
ElevenLabsClient: vi.fn().mockImplementation(() => ({
textToSpeech: { convert: vi.fn().mockResolvedValue(/* mock MP3 stream */) },
voices: { getAll: vi.fn().mockResolvedValue({ voices: [/* Rachel */] }) },
})),
}));
Full mock (streaming, voices, user/subscription) and assertions: references/examples.md.
Skip integration tests unless ELEVENLABS_INTEGRATION is set, and keep them
cheap — Flash model, short text, low bitrate:
const SKIP = !process.env.ELEVENLABS_INTEGRATION;
describe.skipIf(SKIP)("ElevenLabs Integration", () => { /* smoke tests */ });
Full smoke suite: references/examples.md.
Add test, test:integration, and test:ci scripts so CI and local runs
share one entry point. See
references/examples.md.
Once configured, the pipeline produces:
.github/workflows/elevenlabs-tests.yml — two-tier CI pipelineELEVENLABS_API_KEY (and optional webhook secret) stored in GitHub secretstests/unit/ mocked tests that run on every push at 0 character costtests/integration/ smoke tests gated to main/manual behind a quota guardtest, test:integration, test:ci) shared by CI and local| Tier | When | API Key | Quota Cost | Coverage |
|---|---|---|---|---|
| Unit tests | Every push/PR | Mock key | 0 characters | SDK integration patterns |
| Integration | Main + manual | Real test key | ~50 chars | End-to-end TTS verification |
| Quota check | Before integration | Real test key | 0 (GET only) | Prevents surprise billing |
| Issue | Cause | Solution |
|---|---|---|
| Secret not found in CI | Missing repository secret | gh secret set ELEVENLABS_API_KEY |
| Integration tests timeout | Slow TTS generation | Increase test timeout to 30s; use Flash model |
| Quota depleted in CI | Too many integration runs | Use quota guard; limit to main branch only |
| Mock drift | SDK API changed | Update mocks when upgrading SDK |
Run only the cheap tier locally (no API key, no quota):
npm test -- --coverage
Trigger the gated integration tier by hand (from the Actions tab or CLI):
gh workflow run elevenlabs-tests.yml
Run integration tests locally against a real test key:
ELEVENLABS_INTEGRATION=1 npm run test:integration
Full worked examples — complete SDK mock, gated smoke suite, and package scripts — are in references/examples.md.
For deployment patterns, see the elevenlabs-deploy-integration skill, which
covers promoting validated TTS builds through staging and production.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
18 skills in this plugin
/elevenlabs-common-errorsDiagnose and fix ElevenLabs API errors by HTTP status code.
Use when encountering ElevenLabs errors, debugging failed TTS/STS requests,
or troubleshooting voice cloning and streaming issues.
Trigger with "elevenlabs error", "fix elevenlabs", "elevenlabs not working",
"debug elevenlabs", "elevenlabs 401", "elevenlabs 429", "elevenlabs 400".
/elevenlabs-core-workflow-aImplement ElevenLabs text-to-speech and voice cloning workflows.
Use when building TTS features, cloning voices from audio samples, streaming
speech to a chatbot, or implementing the primary ElevenLabs money-path: voice
generation.
Trigger with "elevenlabs TTS", "text to speech", "voice cloning elevenlabs",
"clone a voice", "generate speech", "elevenlabs voice".
/elevenlabs-core-workflow-bImplement ElevenLabs speech-to-speech, sound effects, audio isolation, and
speech-to-text.
Use when converting one voice to another, generating sound effects from a text
description, removing background noise from a recording, or transcribing audio.
Trigger with "elevenlabs speech to speech", "voice changer", "sound effects",
"audio isolation", "remove background noise", "elevenlabs transcribe".
/elevenlabs-cost-tuningOptimize ElevenLabs costs through model selection, character-efficient patterns,
caching, and usage monitoring with budget alerts.
Use when analyzing ElevenLabs billing, reducing character usage, hunting down bill
shock, or implementing quota monitoring for TTS workloads.
Trigger with "elevenlabs cost", "elevenlabs billing", "reduce elevenlabs costs",
"elevenlabs pricing", "elevenlabs expensive", "elevenlabs budget",
"elevenlabs characters", "elevenlabs quota".
/elevenlabs-debug-bundleCollect ElevenLabs debug evidence for support tickets and troubleshooting.
Use when encountering persistent issues, preparing a support ticket, or
gathering diagnostic information (SDK version, API connectivity, quota, voice
inventory, model availability) for an ElevenLabs problem, with secrets
redacted automatically. Trigger with "elevenlabs debug", "elevenlabs support
bundle", "collect elevenlabs logs", "elevenlabs diagnostic", "elevenlabs
support ticket".
/elevenlabs-deploy-integrationDeploy ElevenLabs TTS applications to Vercel, Fly.io, and Cloud Run.
Use when deploying ElevenLabs-powered apps to production, configuring
platform-specific secrets, or setting up serverless TTS.
Trigger with "deploy elevenlabs", "elevenlabs Vercel", "elevenlabs Cloud Run",
"elevenlabs Fly.io", "elevenlabs serverless", "host TTS API".
npx claudepluginhub jeremylongshore/tons-of-skills-marketplace --plugin elevenlabs-packOther plugins' skills for the same job