fcakyon/claude-codex-settings / plugins/cloudflare-skills/skills/agents-sdk
agents-sdk
VerifiedBuild, debug, or review Cloudflare Agents SDK applications using the agents package.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 12.0 KB |
| references/browse-the-web.md | markdown | 1.6 KB |
| references/callable.md | markdown | 2.1 KB |
| references/client-sdk.md | markdown | 1.2 KB |
| references/codemode.md | markdown | 2.8 KB |
| references/configuration.md | markdown | 1.8 KB |
| references/durable-execution.md | markdown | 1.7 KB |
| references/email.md | markdown | 3.5 KB |
| references/human-in-the-loop.md | markdown | 929 B |
| references/mcp.md | markdown | 1.3 KB |
| references/observability.md | markdown | 1.3 KB |
| references/queue-retries.md | markdown | 1.4 KB |
| references/routing.md | markdown | 1.8 KB |
| references/server-driven-messages.md | markdown | 868 B |
| references/skill-feedback.md | markdown | 2.7 KB |
| references/state-scheduling.md | markdown | 1.5 KB |
| references/streaming-chat.md | markdown | 1.4 KB |
| references/think.md | markdown | 2.9 KB |
| references/voice.md | markdown | 1.9 KB |
| references/webhooks-push.md | markdown | 2.4 KB |
| references/workflows.md | markdown | 2.3 KB |
references/voice.md
View on GitHub# Voice (Experimental)
Fetch https://developers.cloudflare.com/agents/communication-channels/voice/index.md for complete documentation.
`@cloudflare/voice` — real-time speech-to-text and text-to-speech for agents. Audio streams over WebSocket.
```bash
npm install @cloudflare/voice
```
## Server
```typescript
import { Agent } from "agents";
import { withVoice, WorkersAITTS, WorkersAINova3STT } from "@cloudflare/voice";
export class VoiceAgent extends withVoice(Agent)<Env> {
transcriber = new WorkersAINova3STT(this);
tts = new WorkersAITTS(this);
async onTurn(transcript: string, context: VoiceTurnContext) {
const result = streamText({
model: createWorkersAI({ binding: this.env.AI })("@cf/meta/llama-4-scout-17b-16e-instruct"),
messages: [
{ role: "system", content: "You are a voice assistant." },
...context.conversationHistory,
{ role: "user", content: transcript }
]
});
for await (const chunk of result.textStream) {
if (context.signal.aborted) break;
context.speak(chunk);
}
}
}
```
## Lifecycle Hooks
| Hook | Purpose |
|------|---------|
| `onTurn(transcript, ctx)` | Handle transcribed speech (required) |
| `beforeCallStart(conn)` | Auth/validation before call starts |
| `onCallStart(conn)` | Call connected |
| `onCallEnd(conn)` | Call disconnected |
| `onInterrupt()` | User interrupted agent speech |
## Client (React)
```tsx
import { useVoiceAgent } from "@cloudflare/voice/react";
function VoiceUI() {
const { isConnected, isSpeaking, connect, disconnect } = useVoiceAgent({
agent: "VoiceAgent",
name: "session-1"
});
return <button onClick={isConnected ? disconnect : connect}>
{isConnected ? "End Call" : "Start Call"}
</button>;
}
```
## STT/TTS Providers
Workers AI (default), Deepgram, ElevenLabs — install the provider package and swap the `transcriber`/`tts` properties.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |