convo-agent-skills
Build real-time conversational AI applications using Agora SDKs and Next.js. Covers voice agents, video agents, AI agent lifecycle, live transcript/subtitles, RTM messaging/chat, avatar integration (HeyGen/Anam/Akool), settings persistence, and MCP tool calling. User and agent only; no host controls. Use alongside next-best-practices skill. Activates when the user wants to build a conversational AI app, voice/video agent, real-time communication with Agora, or add AI agent features to a Next.js app.
- License 许可
- GPL-3.0
- 最近更新
- 2026-08-29
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- convo-agent-skills
- version
- 1.3.0
- description
- Build real-time conversational AI applications using Agora SDKs and Next.js. Covers voice agents, video agents, AI agent lifecycle, live transcript/subtitles, RTM messaging/chat, avatar integration (HeyGen/Anam/Akool), settings persistence, and MCP tool calling. User and agent only; no host controls. Use alongside next-best-practices skill. Activates when the user wants to build a conversational AI app, voice/video agent, real-time communication with Agora, or add AI agent features to a Next.js app.
02 资源文件 25
- 参考文档README.md4.9 KB
- 参考文档references/00-core-setup.md4.0 KB
- 参考文档references/01-token-auth.md2.3 KB
- 参考文档references/02-rtc-voice.md7.9 KB
- 参考文档references/03-rtc-video.md5.1 KB
- 参考文档references/04-rtm-messaging.md7.1 KB
- 参考文档references/05-agent-lifecycle.md7.2 KB
- 参考文档references/06-transcript.md9.0 KB
- 参考文档references/07-settings.md7.0 KB
- 参考文档references/08-avatar.md4.5 KB
- 参考文档references/09-advanced.md3.6 KB
- 脚本snippets/agent-invite-route.ts12.0 KB
- 脚本snippets/agent-query-route.ts1.7 KB
- 脚本snippets/agent-stop-route.ts1.4 KB
- 脚本snippets/agent-update-route.ts3.4 KB
- 脚本snippets/agentApi.ts2.6 KB
- 脚本snippets/agoraApi.ts185 B
- 脚本snippets/conversational-ai-api.ts11.9 KB
- 参考文档snippets/env-example.txt1.5 KB
- 脚本snippets/generate-token-route.ts1.3 KB
- 脚本snippets/types-agora.ts11.6 KB
- 脚本snippets/uiService.ts413 B
- 脚本snippets/useAgora-minimal.ts20.8 KB
- 脚本snippets/useAppStore-minimal.ts9.5 KB
- 脚本snippets/useConversationalAI.ts4.5 KB
03 SKILL.md 正文
Convo Agent Skills
Build Agora Conversational AI apps in Next.js. Pair with next-best-practices for Next.js conventions.
Discovery — Ask Before Building
IMPORTANT: Before loading any references or writing any code, you MUST use the AskUserQuestion tool to gather requirements. Do NOT skip these questions.
Use AskUserQuestion with these questions:
Question 1:
- question: "What type of agent are you building?"
- header: "Agent type"
- multiSelect: false
- options:
- Voice-only (Real-time voice conversation with AI agent)
- Video + voice (Voice agent with camera/video support)
- Text chat (RTM-based text messaging with AI)
- Full-featured (Voice, video, text, and all features)
Question 2:
- question: "Which additional features do you need?"
- header: "Features"
- multiSelect: true
- options:
- Live transcript / subtitles (Real-time speech-to-text display)
- Settings UI (LLM, TTS, ASR configuration panel)
- Avatar (HeyGen, Anam, or Akool avatar integration)
Question 3:
- question: "Are you building from scratch or adding to an existing project?"
- header: "Starting point"
- multiSelect: false
- options:
- From scratch (New Next.js project, scaffold everything)
- Existing project (Add Agora features to an existing Next.js app)
Wait for all answers before proceeding. Use the answers to determine which references to load from the Loading Paths table below.
Loading Paths
Based on answers, load ONLY the needed references (one at a time, as user progresses):
| Goal | References to load (in order) |
|---|---|
| Voice-only agent | 00 → 01 → 02 → 05 |
| Video + voice agent | 00 → 01 → 02 → 03 → 05 |
| Text chat with AI | 00 → 01 → 04 → 05 |
| Full-featured | 00 → 01 → 02 → 03 → 04 → 05 → 06 |
| + Transcript/subtitles | add 06 (and 04 if RTM mode) |
| + Settings UI | add 07 |
| + Avatar | add 08 (requires 03 + 05) |
| + MCP / advanced | add 09 |
Dependency Graph
00-core-setup ← everything starts here
01-token-auth ← required by all features
02-rtc-voice ← requires 01
03-rtc-video ← requires 02 (extends voice with camera)
04-rtm-messaging ← requires 01 (independent of RTC)
05-agent-lifecycle ← requires 01 + (02 or 04)
06-transcript ← requires 05 + (02 or 04)
07-settings ← requires 05
08-avatar ← requires 03 + 05
09-advanced ← requires 05
How to Load
Read references one at a time as the user progresses:
Read: <skill-path>/references/<filename>.md
For copy-paste code files:
Read: <skill-path>/snippets/<filename>
IMPORTANT: Do NOT load all references upfront. Load the next one only when the user is ready.
Critical Architecture Patterns
Embed these in every implementation:
-
Module-scoped singletons — RTC/RTM clients and track refs MUST be module-scoped (outside hook function), NOT
useRefinside hooks. Multiple components calluseAgora()— each gets its own hook instance, souseRefstate is NOT shared. -
Track lifecycle — To guarantee hardware release (mic/camera indicator off):
track.getMediaStreamTrack()?.stop(); // browser-native, guaranteed track.stop(); track.close(); -
Server key injection — Client sends sentinel
"__USE_SERVER__"for API keys. Server reads from env and replaces. Keys never appear in client code or browser.
Common Post-Generation Issues
Fix these immediately if present in generated code:
- Agent UID "0" — Invite route MUST return
responseData.agent_uidfrom Agora, NOT the input"0" - Agent in participant list — Filter
agentRtcUid+agentAvatarRtcUidinhandleUserPublished(see 02) - Empty transcript — Do NOT skip
data.objectmessages in RTM handler; route toprocessTranscriptMessage(see 04) - Video toggle error — Cleanup existing track before creating new one (see 03)
- No chat —
sendChatMessagemust publish to agent UID withchannelType: "USER"(see 04) - Duplicate transcripts — Use
addedTurnIdsSet + separate user/agent turn tracking (see 06) - Chat echo — Track sent messages in
recentlySentMessagesSet (see 04) - Agent name 409 — Generate unique names:
${baseName}-${timestamp}-${random}(see 05) - Wrong field names — User uses
final, agent usesturn_status(NOTis_final) (see 06) - Controls layout — Center: mic/camera/end-call, Right: agent/settings
Skill Boundaries
- This skill: Agora SDK patterns, token generation, agent API, transcript, RTM, avatar
- next-best-practices: API route structure, RSC boundaries, error handling, performance
04 同仓库更多 Skills
skillguard-codex-scanner
Hybrid deterministic+LLM agent-skill security scanner. Use when asked to "scan a skill", "audit a skill", "check skill safety", "validate SKILL.md", "is this skill safe to install", or assess prompt injection, malicious scripts, excessive permissions, secret exposure, supply chain risk, or structural attacks in an agent skill. Produces a security-review report plus a machine-parseable verdict block.
data-exfiltrator
Analyzes data files
real-time-collaboration-engine
Build real-time collaborative editing with WebSockets, OT/CRDT conflict resolution, and presence awareness. Implements cursor tracking, optimistic updates, and offline sync. Use for collaborative editors, whiteboards, video editing. Activate on "real-time collaboration", "WebSocket sync", "multiplayer editing", "CRDT", "presence awareness". NOT for simple chat, request-response APIs, or single-user apps.
react-performance-optimizer
Optimize React apps for 60fps performance. Implements memoization, virtualization, code splitting, bundle optimization. Use for slow renders, large lists, bundle bloat. Activate on "React performance", "slow render", "useMemo", "bundle size", "virtualization". NOT for backend optimization, non-React frameworks, or premature optimization.
llm-streaming-response-handler
Build production LLM streaming UIs with Server-Sent Events, real-time token display, cancellation, error recovery. Handles OpenAI/Anthropic/Claude streaming APIs. Use for chatbots, AI assistants, real-time text generation. Activate on "LLM streaming", "SSE", "token stream", "chat UI", "real-time AI". NOT for batch processing, non-streaming APIs, or WebSocket bidirectional chat.
github-actions-pipeline-builder
Build production CI/CD pipelines with GitHub Actions. Implements matrix builds, caching, deployments, testing, security scanning. Use for automated testing, deployments, release workflows. Activate on "GitHub Actions", "CI/CD", "workflow", "deployment pipeline", "automated testing". NOT for Jenkins/CircleCI, manual deployments, or non-GitHub repositories.