| name | debug-audio |
| description | Investigate audio glitches, artefacts, device routing failures, and CoreAudio issues |
| context | fork |
| agent | audio-debugger |
| disable-model-invocation | true |
| allowed-tools | Read, Glob, Grep, LSP, Bash(swift build*), Bash(swift test*) |
Investigate the audio issue described in: $ARGUMENTS
Before You Start
Read these knowledge files for context:
- docs/dev/coreaudio.md
- docs/dev/realtime-safety.md
- docs/dev/known-issues.md
Investigation Steps
- Understand the symptom: What exactly is happening? (clicks, pops, silence, distortion, wrong device, latency, crash, permission issue)
- Identify the subsystem: capture, DSP, output, device management, or permissions
- Read the relevant source files: Use Glob and Read to trace the code path
- Check against known issues: Compare with known gotchas in the knowledge files
- Check real-time safety: Verify no allocation, locking, or blocking on the audio thread
- Produce a structured diagnosis: symptom, root cause, affected files, suggested fix
Output
Produce a diagnosis with:
- Symptom: What's happening
- Subsystem: Which part of the pipeline
- Root cause: Why it's happening, with file paths and line numbers
- Suggested fix: Concrete code change
- Related knowledge: References to known-issues or real-time safety rules