add-audio
БесплатноБез исполняемых скриптовНе проверенAdd music and sound effects to a game using the Web Audio API — background music, gameplay themes, and SFX. Zero dependencies. Use when the user says "add…
от PlayableIntelligence★ 383 звезды на GitHubОб этом скилле
Performance Notes
- Take your time to do this thoroughly
- Quality is more important than speed
- Do not skip validation steps
Add Audio
Add procedural music and sound effects to an existing game. BGM uses a Web Audio API step sequencer for looping patterns. SFX use the Web Audio API directly for true one-shot playback. No audio files or npm packages needed — everything is synthesized in the browser.
Instructions
Analyze the game at $ARGUMENTS (or the current directory if no path given).
First, load the game-audio skill to get the full Web Audio patterns and integration guide.
Step 1: Audit
- Read
src/core/EventBus.jsto see what game events exist (flap, score, death, etc.) - Read all scene files to understand the game flow (gameplay, game over)
- Identify what music and SFX would fit the game's genre and mood
Step 2: Plan
Present a table of planned audio:
| Event / Scene | Audio Type | Style | Description |
|---|---|---|---|
| GameScene | BGM | Chiptune | Upbeat square wave melody + bass + drums |
| GameOverScene | BGM | Somber | Slow descending melody |
| Player action | SFX | Retro | Quick pitch sweep |
| Score | SFX | Retro | Two-tone ding |
| Death | SFX | Retro | Descending crushed notes |
Explain in plain English: "Background music will automatically loop during each scene. Sound effects will play when you do things like jump, score, or die. The first time you click/tap, the audio system will activate (browsers require a user interaction before playing sound)."
Step 3: Implement
- Create
src/audio/AudioManager.js— AudioContext init, master gain node, BGM sequencer play/stop - Create
src/audio/AudioBridge.js— wires EventBus events to AudioManager for BGM, calls SFX functions directly - Create
src/audio/music.jswith BGM patterns for each scene (Web Audio step sequencer — note arrays that loop continuously) - Create
src/audio/sfx.jswith SFX for each event (Web Audio API — OscillatorNode + GainNode + BiquadFilterNode for true one-shot playback) - Add audio events to
EventBus.jsif not present (AUDIO_INIT,MUSIC_GAMEPLAY,MUSIC_GAMEOVER,MUSIC_STOP,AUDIO_TOGGLE_MUTE) - Wire
initAudioBridge()inmain.js - Emit
AUDIO_INITon first user interaction (game starts immediately, no menu) - Emit music events at scene transitions and SFX events at game actions
- Add mute toggle —
AUDIO_TOGGLE_MUTEevent, UI button, M key shortcut
Step 4: Verify
- Run
npm run buildto confirm no errors - List all files created/modified
- Remind the user: "Click/tap once to activate audio, then you'll hear the music"
Example Usage
Full audio pass
/add-audio examples/flappy-bird
Result: Creates src/audio/AudioManager.js, music.js (gameplay + game-over BGM patterns), sfx.js (flap, score, death, button SFX) → wires via AudioBridge → mute toggle on M key. First click activates audio.
Troubleshooting
No sound plays
Cause: AudioContext not resumed after user interaction (browser autoplay policy). Fix: Ensure AudioContext.resume() is called on first user input (click/tap/keydown). Check for AUDIO_INIT event wiring.
Audio causes lag spikes
Cause: Creating new OscillatorNodes every frame. Fix: SFX should be one-shot (create, connect, start, stop). BGM uses a single looping sequencer. Never create nodes in update().
Next Step
Tell the user:
Your game now has music and sound effects! Next, run
/game-creator:qa-gameto add automated tests that verify your game boots correctly, scenes transition properly, scoring works, and visuals haven't broken.Pipeline progress:
/viral-game→/design-game→/add-audio→/qa-game→/review-game(This is the
/viral-gameone-shot pipeline — not the/make-gamemulti-session, milestone-driven workflow.)
Установить add-audio в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл add-audio?
Add music and sound effects to a game using the Web Audio API — background music, gameplay themes, and SFX. Zero dependencies. Use when the user says "add music", "add sound effects", "add audio", "make it sound good", "add BGM", or "add SFX to my game". Do NOT use for gameplay features or visual design.
Как установить скилл add-audio?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл add-audio запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic