Generates game audio with ElevenLabs (voice lines, sound effects, music) and Google Lyria 2 (instrumental clips), then plays it in the browser via an audio state machine with crossfades, per-layer volume, and mobile unlock on first tap.
Ships in game-dev. 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.
Generate audio assets offline with the vendor SDKs, then play them through one state machine that the game drives.
| Asset | Use | Model id (set explicitly) |
|---|---|---|
| Pre-recorded dialogue | ElevenLabs Text to Speech | eleven_multilingual_v2 |
| Lines generated while the player waits | ElevenLabs Text to Speech | eleven_flash_v2_5 (about 100 ms median latency) |
| Sound effects, ambient loops | ElevenLabs Sound Effects, 0.5 to 30 s, loop: true for seamless ambience | eleven_text_to_sound_v3 |
| Music of any length (3 s to 10 min), optional vocals, section control through a composition plan | ElevenLabs Music (paid plans only) | music_v2_5 |
| Instrumental clips of about 30 s, up to 4 variations per prompt, billed to Google Cloud | Vertex AI Lyria 2 | lyria-002 |
Lyria 3 is in preview on Vertex AI: lyria-3-pro-preview (up to 184 s, vocals, MP3) and lyria-3-clip-preview (30 s). It uses the interactions endpoint, not the predict call in boilerplate/lyria-client.ts. See https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/lyria/lyria-3.
ElevenLabs lists eleven_v4 under the Text to Dialogue API, which this skill does not cover.
From https://elevenlabs.io/docs/overview/models#deprecated-models:
eleven_text_to_sound_v2 is removed on 2027-03-01. It is still the Sound Effects default when model_id is unset.music_v1 is removed on 2027-01-31. It is still the Music default when model_id is unset.eleven_turbo_v2_5 and eleven_turbo_v2 are deprecated in favour of the Flash models (no removal date given).templates/sound-config.ts. Map each state to a music track, an optional ambient loop, and a crossfade time per transition.templates/prompt-catalog.md. Answer genre, mood, instruments, tempo and era in each music prompt.AudioManager, call unlockMobile() at startup, call transition() on every game-state change, and preload() the tracks the next state is likely to need.import { ElevenLabsClient } from '@elevenlabs/elevenlabs-js';
import {
composeFromPlan,
composeMusic,
createMusicPlan,
generateSfx,
generateVoiceLine,
saveAudio,
} from './elevenlabs-audio';
const client = new ElevenLabsClient(); // reads ELEVENLABS_API_KEY
const greeting = await generateVoiceLine(client, {
text: 'Welcome, traveler. The road ahead is dangerous.',
voiceId: 'your-merchant-voice-id',
});
await saveAudio('public/audio/voice/merchant/greeting.mp3', greeting);
const rain = await generateSfx(client, {
text: 'Soft rain on a tin roof, distant thunder',
durationSeconds: 30,
loop: true,
});
await saveAudio('public/audio/ambient/rain.mp3', rain);
const combat = await composeMusic(client, {
prompt: 'Intense battle music, driving and urgent, 150 BPM in D minor, electric guitar riffs, pounding drums, brass stabs',
musicLengthMs: 60_000,
});
await saveAudio('public/audio/music/combat.mp3', combat);
// Section-level control: inspect or edit the plan, then render it with a seed.
const plan = await createMusicPlan(client, 'Epic boss battle, 160 BPM, full orchestra', 90_000);
const boss = await composeFromPlan(client, plan, 42);
await saveAudio('public/audio/music/boss.mp3', boss);
import { createLyriaClient, generateMusic, saveClips } from './lyria-client';
const target = { projectId: process.env.GCP_PROJECT_ID ?? '', location: 'us-central1' };
const lyria = createLyriaClient(target);
const clips = await generateMusic(lyria, target, {
prompt: 'Intense battle music, driving and urgent, 150 BPM, electric guitar riffs, pounding drums, brass stabs',
negativePrompt: 'vocals, calm sections, silence',
sampleCount: 2, // or `seed`, never both
});
await saveClips(clips, 'combat_standard', './output/music/combat');
import { AudioManager } from './audio-manager';
import { AUDIO_CONFIG, type GameAudioState } from './sound-config';
const audio = new AudioManager<GameAudioState>(AUDIO_CONFIG);
audio.unlockMobile();
audio.preload();
audio.transition('menu'); // starts once the player taps, clicks or presses a key
audio.transition('exploration'); // crossfade, ambient starts
audio.preload(['/audio/music/battle.ogg', '/audio/music/boss.ogg']);
audio.transition('combat'); // 500 ms crossfade from the config
audio.playSfx('/audio/sfx/sword_clash.mp3');
audio.playVoice('/audio/voice/merchant/greeting.mp3'); // ducks the music
play() with NotAllowedError until the user interacts. touchend, click and keydown count as user activation; touchstart does not. unlockMobile() listens for the first three and restarts the music that was blocked.HTMLMediaElement.volume, so the manager's crossfade, ducking, sliders and mute make no audible change there: during a crossfade both tracks play at full volume until the old one stops. If you move playback to the Web Audio API, note that an AudioContext created outside a user gesture starts suspended; call resume() inside the first click handler.model_id unset. Sound effects and music then use the deprecated eleven_text_to_sound_v2 and music_v1. The boilerplate sets every model id.forceInstrumental: true (the boilerplate default). Lyria 2 is instrumental only; its negative prompt names what to leave out ("vocals"), not "no vocals".seed or sampleCount, not both.bad_prompt with a suggested rewrite.localStorage.sound-config.ts so swapping a track is one edit.boilerplate/elevenlabs-audio.ts.boilerplate/lyria-client.ts. It needs @google-cloud/aiplatform and Application Default Credentials.boilerplate/audio-manager.ts.templates/sound-config.ts.templates/prompt-catalog.md.references/sources.md.Vendor docs for anything beyond these files:
text-to-speech skill if it is installed, otherwise https://elevenlabs.io/docs/api-reference/text-to-speech/convert.sound-effects skill if it is installed, otherwise https://elevenlabs.io/docs/api-reference/text-to-sound-effects/convert.music skill if it is installed, otherwise https://elevenlabs.io/docs/eleven-api/guides/cookbooks/music.The three ElevenLabs skills come from https://github.com/elevenlabs/skills.
game-design-fundamentals (audio as player feedback)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/game-dev:elevenlabs-sound-musicfrom game-dev
npx claudepluginhub fcsouza/agent-skills --plugin game-dev39 skills in this plugin
/betterauth-integrationCovers the game-specific layer of Better Auth: player, moderator and admin roles, session checks on game routes and WebSocket handshakes, and keeping the auth session apart from the game session. Use when a game needs player login, moderator or admin powers, or authenticated real-time connections, and the project uses Better Auth./bullmq-game-queuesBackground job design for game backends on BullMQ and Redis: one queue per game domain, idempotent reward fulfilment, and cron schedulers for daily rewards and season ends. Use when a game needs matchmaking requests, reward grants, match results, notifications or analytics processed off the request path, or recurring and timed jobs such as daily login rewards, leaderboard snapshots and season rollovers./Other plugins' skills for the same job