skills/latency-budget/SKILL.md
# Latency Budget ## Capability Enforces end-to-end latency budgets for voice interactions, tracking per-stage timing and triggering fallbacks when budgets are exceeded to maintain sub-second response times. ## MCP Tools | Tool | Input Schema | Output | Rate Limit | |------|-------------|--------|------------| | `latency.startTurn` | `z.object({ sessionId: z.string(), turnId: z.string() })` | `{ timerId: string, budget: BudgetConfig }` | 100 RPM | | `latency.checkStage` | `z.object({ timerId:
npx skillsauth add reaatech/voice-agent-kit skills/latency-budgetInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Enforces end-to-end latency budgets for voice interactions, tracking per-stage timing and triggering fallbacks when budgets are exceeded to maintain sub-second response times.
| Tool | Input Schema | Output | Rate Limit |
|------|-------------|--------|------------|
| latency.startTurn | z.object({ sessionId: z.string(), turnId: z.string() }) | { timerId: string, budget: BudgetConfig } | 100 RPM |
| latency.checkStage | z.object({ timerId: z.string(), stage: z.enum(['stt', 'mcp', 'tts']) }) | { withinBudget: boolean, elapsed: number, remaining: number } | 1000 RPM |
| latency.endTurn | z.object({ timerId: z.string() }) | { totalMs: number, stageBreakdown: Record<string, number>, exceeded: boolean } | 100 RPM |
| latency.configure | z.object({ budgets: BudgetConfig }) | { configured: boolean, activeBudget: BudgetConfig } | 10 RPM |
{
"name": "latency.startTurn",
"arguments": {
"sessionId": "sess-abc123",
"turnId": "turn-001"
}
}
{
"timerId": "timer-xyz789",
"budget": {
"total": { "target": 800, "hardCap": 1200 },
"stages": { "stt": 200, "mcp": 400, "tts": 200 }
}
}
{
"name": "latency.checkStage",
"arguments": {
"timerId": "timer-xyz789",
"stage": "mcp"
}
}
{
"withinBudget": true,
"elapsed": 250,
"remaining": 150
}
{
"name": "latency.endTurn",
"arguments": {
"timerId": "timer-xyz789"
}
}
{
"totalMs": 720,
"stageBreakdown": {
"stt": 180,
"mcp": 340,
"tts": 200
},
"exceeded": false
}
| Failure | Cause | Recovery | |---------|-------|----------| | Timer not found | Invalid timerId | Return error, suggest starting new turn | | Stage check after end | Timer already ended | Return error with final metrics | | Budget misconfiguration | Invalid budget values | Validate on configure, reject invalid | | Clock skew | System time change | Use monotonic clock for measurements |
# voice-agent-kit.config.ts
latency:
total:
target: 800ms # Goal for P50
hardCap: 1200ms # Maximum acceptable
stages:
stt: 200ms # Speech-to-text
mcp: 400ms # MCP round-trip
tts: 200ms # TTS first byte
| Provider | STT Budget | TTS Budget | Notes | |----------|------------|------------|-------| | Deepgram | 150ms | 150ms | Ultra-low latency, can tighten | | AWS Transcribe | 250ms | 300ms | Slightly higher latency | | Google Cloud | 200ms | 250ms | Moderate latency |
| Metric | Type | Description |
|--------|------|-------------|
| voice.turn.duration_ms | Histogram | End-to-end turn latency |
| voice.stt.latency_ms | Histogram | STT processing time |
| voice.mcp.latency_ms | Histogram | MCP round-trip time |
| voice.tts.first_byte_ms | Histogram | TTS first audio byte |
| voice.latency_budget.exceeded | Counter | Budget violations by stage |
tools
# Twilio Media Streams ## Capability Handles Twilio Media Streams WebSocket connections for real-time bidirectional audio communication, parsing inbound messages, encoding outbound audio, and managing call lifecycle events. ## MCP Tools | Tool | Input Schema | Output | Rate Limit | |------|-------------|--------|------------| | `twilio.handleStart` | `z.object({ message: z.object({ event: z.literal('start'), callSid: z.string(), streamSid: z.string(), format: z.string(), tracks: z.array(z.st
tools
# TTS Provider Interface ## Capability Provides a unified interface for text-to-speech (TTS) providers, enabling streaming audio synthesis with first-byte latency tracking, voice selection, and output format conversion. ## MCP Tools | Tool | Input Schema | Output | Rate Limit | |------|-------------|--------|------------| | `tts.synthesize` | `z.object({ text: z.string(), config: z.object({ provider: z.string(), voice: z.string().optional(), speed: z.number().optional() }) })` | `{ chunks: A
tools
# Telephony Lifecycle ## Capability Manages the complete lifecycle of voice calls from TwiML webhook initiation through call completion, including call connect, transfer, conference, and disconnect handling with proper session cleanup. ## MCP Tools | Tool | Input Schema | Output | Rate Limit | |------|-------------|--------|------------| | `telephony.generateTwiML` | `z.object({ sessionId: z.string(), wsUrl: z.string().url() })` | `{ twiml: string }` | 100 RPM | | `telephony.handleConnect` |
tools
# STT Provider Interface ## Capability Provides a unified interface for speech-to-text (STT) providers, enabling real-time streaming transcription with interim results, endpoint detection, and automatic reconnection handling. ## MCP Tools | Tool | Input Schema | Output | Rate Limit | |------|-------------|--------|------------| | `stt.connect` | `z.object({ provider: z.enum(['deepgram', 'aws-transcribe', 'google-cloud']), config: z.object({ apiKey: z.string().optional(), sampleRate: z.number