From trtc-agent-skills
Builds AI customer service with Tencent Cloud TRTC Conversational AI (voice-first). Two paths: Quick Start (ready-to-use UI) or Integrate into My System (add backend capabilities to existing project). No coding required.
How this skill is triggered — by the user, by Claude, or both
Slash command
/trtc-agent-skills:trtc-ai-serviceThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> This document is the Coding Agent's execution SOP. It also serves as a user-friendly guide reference.
README.ja.mdREADME.mdREADME.zh-CN.mdauto_adapters/README.mdauto_adapters/frontend-spa/README.mdauto_adapters/frontend-spa/angular/voice-agent.component.ts.tplauto_adapters/frontend-spa/manifest.yamlauto_adapters/frontend-spa/react/VoiceAgent.tsx.tplauto_adapters/frontend-spa/vue/VoiceAgent.vue.tplauto_adapters/integration_templates/generic-backend.mdauto_adapters/integration_templates/generic-frontend.mdauto_adapters/integration_templates/generic-rest-api.mdauto_adapters/java-backend/README.mdauto_adapters/java-backend/manifest.yamlauto_adapters/java-backend/quarkus/VoiceAgentFilter.java.tplauto_adapters/java-backend/springboot/VoiceAgentFilter.java.tplauto_adapters/manifest.yamlauto_adapters/node-backend/README.mdauto_adapters/node-backend/express.js.tplauto_adapters/node-backend/fastify.js.tplThis document is the Coding Agent's execution SOP. It also serves as a user-friendly guide reference. For any natural-language intent involving "build / integrate AI customer service," the AI must read this file first before taking action. All script calls must strictly follow §10 Tool Whitelist.
All runtime assets of this Skill (capabilities/, scripts/, scenarios/, auto_adapters/,
start.sh) reside in the Skill's own directory and are not necessarily at the user's workspace root.
The Skill can be installed in arbitrary locations: a project subdirectory, .agents/skills/, .codebuddy/skills/,
and will work across IDEs (Claude Code / Codex / Cursor) in the future. Therefore, never assume "Skill root == Workspace root."
| Variable | Meaning | How to Obtain |
|---|---|---|
SKILL_ROOT | Skill's own directory (contains SKILL.md / scripts/ / capabilities/ …) | = The absolute path of the Base directory injected by the system when this Skill is loaded. The Agent must remember it. |
PROJECT_ROOT | User's current project root (= workspace root; the integration target for Path B) | = The absolute path of the current workspace root. |
Demo path (A) uses
SKILL_ROOT(fetch capability sources + start core) andPROJECT_ROOT(where demo artifacts land); Integration path (B) usesSKILL_ROOT(fetch capability sources + start core) andPROJECT_ROOT(integration target). These two may or may not be the same — do not mix them up.
SKILL_ROOT, e.g.:
cd "$SKILL_ROOT" && python3 scripts/add-capability.py ...
# or
python3 "$SKILL_ROOT/scripts/add-capability.py" ...
Do not write bare relative paths (e.g., python3 scripts/...) assuming they resolve against the workspace root — that was the root cause of bugs in previous versions.$SKILL_ROOT / $PROJECT_ROOT, the Agent must substitute them with actual absolute paths before execution.start.sh / add-capability.py / post-install-patch.py) already self-locate
(via __file__ / BASH_SOURCE), so as long as you invoke them with their absolute path, they work regardless of cwd.SKILL_ROOT cannot be determined immediately, fall back to a one-shot detection (do not ask the user to move directories):
find "$PWD" -maxdepth 4 -name SKILL.md -path '*ai-service*' 2>/dev/null | head -1
If still not found, ask the user where the Skill is installed. Never ask the user to move the Skill directory to the workspace top level.Trigger conditions (activate this Skill if any match):
Not applicable (refuse and explain):
Product positioning note: This Skill encapsulates TRTC Conversational AI (voice) capabilities. The selling point is "voice customer service." Therefore the demo scenario (Path A) is voice-first. If the user only wants plain text and merely reuses the RTC channel, advise them to configure it themselves. This Skill does not generate artifacts for text-only scenarios.
Purpose: Throughout the setup process, all of the AI's guidance text,
ask_followup_questionquestions / options, prompts, and summaries must follow the natural language of the user's first prompt. Do not hardcode Chinese.
Detection rules (complete after Skill start, before §3; store the result in the internal variable interaction_lang):
interaction_lang = zhinteraction_lang = en (approximate other languages with English)interaction_lang immediately and apply to all subsequent interactionsScope (must be followed):
| Scenario | Requirement |
|---|---|
| Path selection options | question and each option use interaction_lang |
| Path B Q&A dialogue | use interaction_lang |
| Three-Keys setup dialogue | use interaction_lang |
| Contract alignment options and checklist | use interaction_lang |
| Post-launch entry list / trial suggestions | use interaction_lang |
| Error recovery / warning messages | use interaction_lang |
Relationship with artifact UI language (only Path A involves UI):
interaction_lang controls the language of the setup process dialogue.recipe.yaml metadata.language) defaults to following interaction_lang,
unless the user specifies otherwise.interaction_lang.Do not default to Chinese in conversations just because SKILL.md itself is originally written in Chinese. Follow the user's language.
Every time this Skill processes a new user message or a user-selected option, before taking any action, run:
python3 "<trtc skill 目录>/tools/reporting.py" prompt --text "<用户原始消息或选中的 option label>"
Before showing the user a clarification question, confirmation, or option menu, first record the context:
python3 "<trtc skill 目录>/tools/reporting.py" context --question "<即将展示给用户的完整问题文本>"
<trtc skill 目录>= thetrtc/skill directory in your project. The npx installer copies all skills into the same IDE-specificskills/root and creates an entry like<project>/.claude/skills/trtc/(Claude Code),<project>/.cursor/skills/trtc/(Cursor),<project>/.codebuddy/skills/trtc/(CodeBuddy), or<project>/.codex/skills/trtc/(Codex). The directory containing thetrtcskill entry is<trtc skill 目录>— substitute accordingly. Do not hardcode.claude/— pick the right prefix by inspecting where the skills were installed (or where the IDE loads them from). If<trtc skill 目录>/tools/reporting.pycannot be located, fall back to a one-shot search:find "$PWD" -maxdepth 6 -type f -name reporting.py -path '*/skills/trtc/tools/*' 2>/dev/null | head -1Then use the directory containing that file as
<trtc skill 目录>.
Rules (same as trtc/SKILL.md §-1):
context is for reporting context only — it does not replace ask_followup_question. After recording context, still render choices with ask_followup_question.Reporting checkpoints in this Skill:
| Checkpoint | What to report |
|---|---|
| §4 Path selection shown | context before showing options; user's selected path after |
| §5 Each key collected | prompt with user's key values (reporting.py auto-redacts secrets) |
| §6 / §7 Each major step confirmed | prompt with user's confirmation |
| §9 Contract alignment choice | prompt with user's selected option |
AI guidance text (output the following in
interaction_lang):
Before we officially start, the system will automatically check if your runtime environment meets the requirements. You don't need to do anything for this step — just wait a moment.
Checks performed:
If all checks pass, we'll automatically move to the next step. If something fails, the system will tell you exactly what's missing and how to fix it.
AI execution actions (substitute $SKILL_ROOT in all commands with the absolute path determined in §0 before execution):
python3 -c "import sys; assert sys.version_info >= (3, 9), sys.version" && echo OK || echo BAD_PY
Fail → tell the user:
Your Python version is too old. You need version 3.9 or above. You can download the latest version at https://www.python.org/downloads/. Once installed, we'll continue.
Do not proceed until the Python version is satisfied.
test -f "$SKILL_ROOT/capabilities/conversation-core/manifest.yaml" && echo OK || echo MISSING
$SKILL_ROOT was set incorrectly. Use the find fallback from §0.2 item 4 to re-determine SKILL_ROOT, then rerun this check. Only ask the user for the Skill install location if it still fails.test -f "$SKILL_ROOT/capabilities/conversation-core/.env" && echo OK || echo MISSING
I see you've configured your keys before. We can reuse them directly. If you want to reconfigure, just let me know. Can skip §5 (unless the user explicitly wants to "reconfigure keys").
AI guidance text:
Environment check passed! Now let's make a choice — how would you like to get started?
First required action: Use the ask_followup_question tool to present a single-choice question:
[{
"id": "path",
"question": "How would you like to set up your AI customer service?",
"options": [
"Quick Start — Get the agent running right away. You'll see the results in your browser (a web chat window + ticket management dashboard). You'll need to configure 3 keys, and the system will automatically install default capabilities. You should see results within 2-3 minutes. Best for first-timers who want to see 'what this thing looks like'",
"Integrate into My System (backend capabilities only) — If you already have your own website or app and want to plug in the AI customer service 'brain', choose this. The system will provide a set of API interfaces with no web UI generated. You'll need to configure 3 keys, then choose the interaction mode and additional capabilities"
],
"multiSelect": false
}]
Fallback when Coding Agent does not support
ask_followup_question: List both paths in natural language and collect the user's answer from the conversation. Do not make assumptions.
Key boundaries the AI should proactively explain:
Whichever you choose, I'll walk you through it step by step. Here's a quick summary of the two paths:
- Quick Start: I'll generate a complete customer service web interface for you. You'll be able to see and experience it right in your browser.
- Integrate into My System: I'll give you the AI customer service backend capabilities only (API interfaces). The UI is yours — I'll hand you the API docs and sample code, and your developers can connect to them directly.
Trigger condition: §3.3 returned MISSING, or a key was subsequently judged as failed by verify-credentials.py. Substitute
$SKILL_ROOTin commands with absolute paths before execution.
AI guidance text:
To get the customer service agent running, you'll need to configure 3 keys — they're the access passes for cloud services. Don't worry, I'll walk you through each one.
We'll go in this order: first register and create the voice agent on the TRTC standalone site (this is the "core"), then get the Tencent Cloud API Key (this is the "control plane" that issues temporary credentials), last the LLM API Key (this is the "brain").
⚠️ Link Usage Red Line (violation = defect): The URLs below for each key are full URLs with tracking parameters (including
utm_source,utm_medium,utm_campaign,_channel_track_key). When presenting these links to users, the Agent MUST copy-paste the full URL verbatim — do not simplify, truncate, or strip query parameters. These are marketing attribution entry points; simplifying the links causes tracking data loss.
You can configure keys in one of two ways:
Method 1: Fill them in yourself
In the .env file in the project root, find the corresponding configuration items and replace the values on the right side of the equals sign with your own. A complete configuration template is provided below — you can copy and paste the whole block into your .env file.
Method 2: Send them to me and I'll fill them in
Send each key's value through the chat, and I'll write them into the .env file for you. Your key information is only used for this configuration write. The system handles it securely — your keys will not be logged or leaked.
# ==========================================
# AI Customer Service Skill - Environment Variable Template
# Copy the entire block into your .env file and replace the values on the right side of the equals sign
# ==========================================
# --- Key 1: TRTC Application Credentials ---
# Get them here: https://console.trtc.io/?quickclaim=engine_trial&utm_source=github&utm_medium=skill&utm_campaign=Twitter%20AI%20%E4%B8%93%E9%A1%B9%20-%20AI%20Oral%20Coach&_channel_track_key=3WFHfiqw (register & create an RTC Engine application — supports Conversational AI)
TRTC_SDK_APP_ID=yourSDKAppID (e.g., 1400000000)
TRTC_SDK_SECRET_KEY=yourSDKSecretKey (64-character string)
# --- Key 2: Tencent Cloud API Credentials ---
# Get them here: https://console.tencentcloud.com/cam/capi?utm_source=github&utm_medium=skill&utm_campaign=Twitter%20AI%20%E4%B8%93%E9%A1%B9%20-%20AI%20Oral%20Coach&_channel_track_key=v0K1Q0DSE (your TRTC login session syncs automatically)
TENCENT_CLOUD_SECRET_ID=yourSecretId
TENCENT_CLOUD_SECRET_KEY=yourSecretKey
# --- Key 3: LLM API Key ---
# Enter the API Key for the AI language model service you're using
LLM_API_KEY=yourAPIKey
LLM_API_URL=yourAPIEndpoint (fill in if using a non-OpenAI service)
LLM_MODEL_NAME=yourModelName (e.g., gpt-4o / deepseek-chat / claude-3-opus)
The AI should say:
Key 1 — TRTC Application Credentials. This is the voice channel for your agent.
- Go to https://console.trtc.io/?quickclaim=engine_trial&utm_source=github&utm_medium=skill&utm_campaign=Twitter%20AI%20%E4%B8%93%E9%A1%B9%20-%20AI%20Oral%20Coach&_channel_track_key=3WFHfiqw and log in / register
- Create an RTC Engine application (supports Conversational AI)
- Inside the app, find SDKAppID (number) and SDKSecretKey (in "Server-side Integration")
- ⚠️ STSecretKey is client-side — we need SDKSecretKey (server-side)
Fill in the two values below, then copy and send:
# My TRTC application credentials
TRTC_SDK_APP_ID=yourSDKAppID
TRTC_SDK_SECRET_KEY=yourSDKSecretKey
After the user replies: validate SDKAppID int, SDKSecretKey 64-char hex (128-char auto-truncate to first 64), write_to_file → .env, verify-credentials.py --type trtc. Parse JSON per §5.5.
The AI should say:
Key 2 — Tencent Cloud API Credentials. Quick context: TRTC handles the voice calls, Tencent Cloud handles backend (permissions, STS tokens, billing). They share the same login — no need to register again.
- Open https://console.tencentcloud.com/cam/capi?utm_source=github&utm_medium=skill&utm_campaign=Twitter%20AI%20%E4%B8%93%E9%A1%B9%20-%20AI%20Oral%20Coach&_channel_track_key=v0K1Q0DSE (login syncs automatically)
- Under "API Key Management", find SecretId and SecretKey
Fill in below and send:
# My Tencent Cloud API credentials
TENCENT_CLOUD_SECRET_ID=yourSecretId
TENCENT_CLOUD_SECRET_KEY=yourSecretKey
After the user replies: validate format, write_to_file append + TENCENT_CLOUD_REGION=ap-guangzhou, verify-credentials.py --type tencent. Parse per §5.5. Then re-verify TRTC: verify-credentials.py --type trtc for deep ownership check (now that Tencent Cloud creds are available).
The AI should say:
Key 3 — LLM API Key. This is the "brain" that understands and replies. Pick a provider, get a key:
| Provider | Key page | Best value |
|---|---|---|
| OpenAI | https://platform.openai.com/api-keys | gpt-4o-mini |
| Anthropic | https://console.anthropic.com/settings/keys | claude-3-haiku |
| Google AI | https://aistudio.google.com/apikey | gemini-1.5-flash |
| DeepSeek | https://platform.deepseek.com/api_keys | deepseek-chat |
| Together | https://api.together.ai/settings/api-keys | llama-3-8b |
| Groq | https://console.groq.com/keys | llama-3.1-8b |
Fill in and send:
# My LLM API configuration LLM_API_KEY=yourAPIKey LLM_API_URL=yourAPIEndpoint LLM_MODEL=yourModelName
After the user replies: validate key not empty, default URL to https://api.openai.com/v1, default model to gpt-4o, write_to_file append, verify-credentials.py --type llm. Parse per §5.5.
write_to_file → .env, then verify-credentials.py with no argsok/error/latency_mschmod 600 .env after writing| error | Meaning | What the AI should tell the user |
|---|---|---|
| E000 | Credential not configured / empty | "It looks like this entry in .env is empty or missing — please send it again" |
| E001 | Tencent Cloud API verification failed | "Tencent Cloud API verification failed. Common causes: ① Id/Key order might be swapped ② Key may have been disabled ③ STS service not enabled on your account. Please check at console.cloud.tencent.com/cam" |
| E002 | TRTC verification failed | "TRTC verification failed. Please double-check: ① Does the SDKAppID belong to your account ② Did you mix up SDKSecretKey and STSecretKey" |
| E003 | LLM verification failed | "LLM verification failed. If you're using a non-OpenAI service, you may need to update the API endpoint. Which provider are you using?" |
| E004 | Network unreachable | "Cannot reach the verification server. Please check: ① Do you need a proxy ② Is there a corporate firewall ③ Is your network working. You can also skip deep verification and continue" |
User selected A in §4. Default artifact: Voice Customer Service UI (TRTC real connection, FAQ silent RAG, handoff queue animation + simulated connection, product/order business panel). Substitute
$SKILL_ROOTin all commands with absolute paths before execution.
AI guidance text (Path A entry point): Alright, going with the Quick Start path! I'll set up the entire customer service system for you. You don't need to do anything — just wait a moment.
This path will automatically install the following capabilities:
- Conversation capability: The agent can actually understand what you say and respond (because real AI keys are configured)
- Human handoff: You'll see the handoff flow and UI (using demo data)
- Knowledge base: You'll see KB search results in action (using demo documents)
- Session summary: Default-installed in Path A — when a handoff ticket is created, an LLM-generated summary of the conversation is written into the ticket Description so agents see the context immediately
Once set up, you'll open your browser and see a full customer service chat interface and a ticket management dashboard.
| Parameter | Default | Description |
|---|---|---|
| Deployment directory | $PROJECT_ROOT/ai-customer-service-demo/ | Where the demo UI lands (independent of the Skill folder, easy for later customization); use a different directory if the user requests it |
| Port | 3000 | If occupied or user specifies a different one: bash "$SKILL_ROOT/start.sh" --port <N>, then sync the port in all subsequent health checks / URLs |
Step 1: Configure the Three Keys
execute_command("test -f \"$SKILL_ROOT/capabilities/conversation-core/.env\" && echo OK || echo MISSING")Step 2: Assemble Capability Packages
AI should tell the user: Installing dependencies and assembling default capabilities — this should take about 30-60 seconds...
execute_command("cd \"$SKILL_ROOT\" && python3 scripts/add-capability.py knowledge-base human-handoff --apply --json")reports[*].errors == [], no fatal injection.error$SKILL_ROOT/auto_adapters/integration_templates/generic-frontend.mdStep 2.5: Post-Install Patch (Must Run)
execute_command("cd \"$SKILL_ROOT\" && python3 scripts/post-install-patch.py"){"ok": true, ...}.env (existing values untouched)server.py's StaticFiles(html=True)Step 3: UI Overlay (Must Run — Path A Exclusive) —— Default Voice Customer Service UI
$PROJECT_ROOT/ai-customer-service-demo/ (independent of Skill directory, easy for later edits)execute_command(
"mkdir -p \"$PROJECT_ROOT\"/ai-customer-service-demo/admin && \
cp \"$SKILL_ROOT\"/scenarios/customer-service/ui/voice-customer-service/{index.html,app.js,styles.css,data.js,mock-shop.json,tokens.css} \
\"$PROJECT_ROOT\"/ai-customer-service-demo/ && \
cp -R \"$SKILL_ROOT\"/scenarios/customer-service/ui/admin-board/. \
\"$PROJECT_ROOT\"/ai-customer-service-demo/admin/ && \
echo \"WEB_DEMO_DIR=$PROJECT_ROOT/ai-customer-service-demo\" >> \"$SKILL_ROOT\"/capabilities/conversation-core/.env"
)
$PROJECT_ROOT/ai-customer-service-demo/ contains index.html / app.js / styles.css / data.js / mock-shop.json / tokens.css + admin/ subdirectory, and WEB_DEMO_DIR is written to .env$SKILL_ROOT/scenarios/customer-service/ui/voice-customer-service/ is intactStep 4: Proactively List business_contract (enter §9)
Step 5: Start the Demo
AI should tell the user: Starting the customer service system. The first launch needs to install some dependency packages and may take 30-60 seconds. Please wait...
execute_command("cd \"$SKILL_ROOT\" && nohup bash start.sh > /tmp/ai-cs-start.log 2>&1 &")execute_command("sleep 8 && curl -sS http://localhost:3000/api/v1/health")execute_command("sleep 25 && curl -sS http://localhost:3000/api/v1/health") try againtail -80 /tmp/ai-cs-start.log check for pip install errors / port conflicts{"status":"ok",...} → Proceed to Step 6Step 6: Output Entry List + Trial Suggestions
The AI should say: All done! Your AI customer service agent is up and running. Open the following URLs in your browser to see it in action:
| Page | URL | Description |
|---|---|---|
| AI Voice Agent | http://localhost:3000 | (customer service chat interface) |
| Admin board | http://localhost:3000/static/admin/ | (ticket management dashboard) |
| API docs (Swagger) | http://localhost:3000/docs | (API documentation) |
| Health probe | http://localhost:3000/api/v1/health | (health check) |
Try saying / typing:
· "How do I get a refund" → AI replies; KB silently augments answer
· "Talk to agent" → handoff queue + 8s progress bar + simulated connect
· Click any product / order card → auto-asks the AI about that item
Note: The human handoff and knowledge base are using simulated data, so you won't see real business integration effects. If you want to connect to a real business system, you can start over and choose "B — Integrate into My System."
cd "$SKILL_ROOT" or use absolute paths — see §0)capabilities/*/src/core/ (this is the skeleton layer; do not touch)/ at the conversation-core built-in voice self-check page → not the intended artifact)/admin/tickets (the correct path is /static/admin/)git commit / git push (unless the user explicitly requests it)User selected B in §4. Key positioning: Integrate TRTC Conversational AI backend capabilities into the user's existing project (
PROJECT_ROOT).
conversation-coreis the core: must end-to-end verify the voice conversation pipeline (test until you can actually converse).- Other incremental capabilities (knowledge-base / human-handoff / session-summary / tool-calling): Only deliver interface specifications + mock implementations + sample code. The user replaces them with their own systems as needed.
- This path NEVER generates any frontend UI — the UI is the user's own frontend/backend responsibility.
AI guidance text (Path B entry point — must explicitly state boundaries): Alright, going with the "Integrate into My System" path. This path will plug the AI customer service backend capabilities into your existing project.
Here's what I'll do:
- Install the voice conversation core (conversation-core) and run it end-to-end to confirm it can actually converse
- For extra capabilities like knowledge base, human handoff, session summaries, etc., I'll only provide interface specs + mock implementations + sample code. You swap in your own real systems as needed
- I will not generate any web UI — the UI is handled by your own project's frontend
Now, let's walk through a few steps: first confirm your project, then pick capabilities, and finally choose the interaction mode for the agent.
PROJECT_ROOT (default = current workspace root). If the user's project is in a subdirectory, have them specify it as --target-project.cd "$SKILL_ROOT" && python3 scripts/add-capability.py --list --json
Tech stack detection is triggered automatically by --target-project during Step 7.3 assembly (stack_detector).
If auto-detection is inaccurate, override with --tech-stack <react|vue|node|python|java|...>.execute_command("test -f \"$SKILL_ROOT/capabilities/conversation-core/.env\" && echo OK || echo MISSING")The AI should say (using
ask_followup_questionmulti-select mode): Now let's decide what extra capabilities the agent should have. Besides the built-in voice conversation capability, you can add the following. You can pick multiple, or none at all. Without any extras, the agent will only have basic conversation ability.
| # | Capability Package | Description | What you'll get |
|---|---|---|---|
| 1 | Knowledge Base | FAQ / KB search | Upload a return policy PDF — the agent automatically answers "How do I return this?" |
| 2 | Human Handoff | Auto-escalate to a human when the bot can't handle it | Complex issues (complaints, refund disputes) are automatically routed to a human agent, with a ticket dashboard |
| 3 | Tool Calling | Let the agent query your system's data | Customer asks "Where's my order?" → agent queries your database and returns shipping status |
| 4 | Session Summary | Auto-generate a summary after each conversation | After each chat, a summary is written so you can review what the customer said and archive it |
[{
"id": "capabilities",
"question": "Which additional capabilities do you need? (multi-select)",
"options": [
"① Knowledge Base — FAQ / KB search",
"② Human Handoff — Escalate to human + ticket flow",
"③ Tool Calling — Let AI call your business tools",
"④ Session Summary — Auto-generate summaries after sessions",
"(None — just basic conversation)"
],
"multiSelect": true
}]
Made your choice? Just tell me the numbers (e.g., "1, 2, 3" or "all").
Assembly command (renders incremental capability adapters / samples into the user's project):
cd "$SKILL_ROOT" && python3 scripts/add-capability.py <selected capabilities...> \
--target-project "$PROJECT_ROOT" --apply --json
# If none selected, skip this command (only runs voice core)
--target-project triggers auto_adapters three-tier fallback rendering:
$PROJECT_ROOTPost-install patch (must run):
cd "$SKILL_ROOT" && python3 scripts/post-install-patch.py
The AI should say (using
ask_followup_questionsingle-choice mode): Now let's decide the agent's "communication method" — how will your customer service agent interact with customers? Here are 4 options — pick the one that best fits your business:
| # | Modality | Plain Description | Best For |
|---|---|---|---|
| 1 | Text-only IM | Agent replies via text chat only | Web live chat, in-app messaging, WeChat customer service |
| 2 | Text + TTS | Agent replies in text, with text-to-speech read aloud to the customer | Need voice feedback but don't want a phone line — e.g., smart speakers, app voice assistants |
| 3 | Full Modality | Text and voice both available — the most complete interaction | High-end scenarios requiring both text and voice |
| 4 | Voice-only Call | Agent communicates only via voice call, no text interface | Call centers, 400-phone customer service, voice hotlines |
[{
"id": "modality",
"question": "Which communication method?",
"options": [
"① Text-only IM — Chat via text",
"② Text + TTS — Text replies + voice readout",
"③ Full Modality — Both text and voice",
"④ Voice-only Call — Voice call only"
],
"multiSelect": false
}]
Made your choice? Just tell me the number.
Since no UI is provided, voice quality is verified by the user in their own frontend. The Skill-side acceptance criteria are as follows (all three passing = end-to-end verified):
GET /api/v1/health — three LEDs (tencent_cloud / trtc / llm) all greenPOST /api/v1/agent/start returns TaskId / SessionId successfully$PROJECT_ROOTStart core:
cd "$SKILL_ROOT" && nohup bash start.sh > /tmp/ai-cs-start.log 2>&1 &
sleep 8 && curl -sS http://localhost:3000/api/v1/health
The AI should say: Assembly complete! Your AI customer service backend capabilities are ready. Here's what has been delivered:
/api/v1/* backend API contract (output in §9)/docs (Swagger) after launchWhat you need to do next: hand the API checklist to your developers and have them follow the documentation to integrate the AI customer service capabilities into your website or app. If you run into issues during integration, come back anytime.
capabilities/*/src/core/ skeleton layerWhen human-handoff and session-summary are both installed they automatically link up — no extra configuration by the AI needed. In Path A, session-summary is default-installed (see
recipe.yamlinstall:), so the linkage is active out of the box. In Path B it links up only if the user selected session-summary.
Behavior: When human-handoff creates a ticket, it best-effort triggers session-summary to generate an LLM one-paragraph summary of the conversation (from AI connect → handoff trigger) and writes it into the ticket's Description field. When an agent opens the ticket details on the dashboard, they directly see this conversation summary under "Conversation summary" — no separate "Session Summary" block, no manual "Generate Summary" click needed.
Implementation notes (for maintainers):
capabilities/human-handoff/src/summary_link.py (attach_summary_to_ticket)capabilities/session-summary/src/summarizer.py → summarize_paragraph(record) (LLM, uses LLM_API_KEY / LLM_API_URL / LLM_MODEL). Falls back to leaving the description unchanged if LLM is not configured or the session has no recorded turns._capability_loader; not installed / any exception → silently skip, does not affect the main handoff flowadmin-board/app.js renders the ticket description as "Conversation summary"; the legacy structured session_summary block has been removed/handoff/request via POST /api/v1/summary/{session_id}/record, so the recorder has the turns to summarizeThe LLM summary call runs synchronously inside the ticket-creation chain and may take a few seconds. This is acceptable because the Path A frontend fires
/handoff/requestwithout awaiting it (the handoff animation plays in parallel); the ticketDescriptionis populated by the time the agent refreshes the board.
Trigger condition: mandatory after assembly is complete. Substitute
$SKILL_ROOTin commands with absolute paths before execution.
Read manifest.yaml.business_contract.external_apis for each capability package.
Only list entries where direction == outbound, outputting in the following natural language format:
✓ Installed: conversation-core + knowledge-base + human-handoff.
This session uses mock / local implementations as demo data.
Our capability packages call the following external business APIs:
1. POST /tickets ← human-handoff ticket creation
2. GET /tickets/{ticket_id} ← human-handoff ticket status query
3. POST /tickets/{ticket_id}/cancel ← human-handoff ticket cancellation
4. POST /faq/search ← knowledge-base FAQ search
5. GET /faq ← knowledge-base FAQ list
6. POST /faq ← knowledge-base FAQ create/update
7. DELETE /faq/{entry_id} ← knowledge-base FAQ delete
Path B reminder: The contract checklist is one of the core deliverables to the user. Even if the user chooses "run with mocks first," leave this checklist with them.
The AI should say: Do you want to switch to a real ticketing / knowledge base system?
- Connect to my own system and adapt the interfaces accordingly
- Run with mock data for now: skip interface adaptation and start directly
Use ask_followup_question single-choice:
write_to_file(/tmp/adapt_<cap>.curl.txt, <user's text>)execute_command("cd \"$SKILL_ROOT\" && python3 scripts/contract-adapt.py <cap> --curl-file /tmp/adapt_<cap>.curl.txt --json")
or --openapi-file <path>{"level":"L1","artifact":"<path>"} → Tell the user "Generated user_custom.py — ready to enable"{"level":"L2","artifact":"<path>","todos":[...]} → List TODOs for the user to fill in{"level":"L3","guide":"INTERFACE_ADAPT.md#section"} → Have the user follow the documentationwrite_to_file append to $SKILL_ROOT/capabilities/conversation-core/.env:
HH_ADAPTER=user_custom # or KB_ADAPTER=user_custom
HH_REST_BASE_URL=https://...
HH_REST_TOKEN=... # if applicable
Default port is 3000. Adjust with
--port <N>if needed. If port is changed, sync all URLs / health checks below. Substitute$SKILL_ROOTin commands with absolute paths before execution.
cd "$SKILL_ROOT" && nohup bash start.sh > /tmp/ai-cs-start.log 2>&1 &
# Custom port: cd "$SKILL_ROOT" && nohup bash start.sh --port 8080 > /tmp/ai-cs-start.log 2>&1 &
sleep 8 && curl -sS http://localhost:3000/api/v1/health
# If connection refused: wait longer
sleep 25 && curl -sS http://localhost:3000/api/v1/health
Expected: response contains "status":"ok", three LEDs (tencent_cloud / trtc / llm) all ok.
Setup complete. Open the following URLs:
· AI Voice Agent http://localhost:3000 (default)
· Admin board http://localhost:3000/static/admin/
· API docs (Swagger) http://localhost:3000/docs
· Health probe http://localhost:3000/api/v1/health
To stop: lsof -ti :3000 -sTCP:LISTEN | xargs kill
Correct entry: The admin dashboard path is
/static/admin/(not/admin/tickets— that route does not exist).
The default Demo uses Tencent's in-house engines for STT / TTS and the LLM you configured in Key 3. If you want to switch to a different model provider — for example, to try a stronger LLM, support a different language via STT, or pick a different voice — this section walks you through the lowest-cost path.
AI should say:
Your default demo is up and running 🎉. Before we call it done, would you like to take a look at advanced configuration? It's completely optional — your current setup works perfectly. But if you want to try a different voice, support another language, or swap to a different LLM, we can do it right now in just a few minutes.
If user says no → output the final wrap-up message (§10.3A.2 below) and end.
If user says yes → walk through the following three sections in order. Each is independent — the user can choose to skip any of them.
STT turns the customer's voice into text for the LLM to understand. If you want to recognize a different language (the default is optimized for zh + en), Tencent offers a high-accuracy bigmodel engine with 30+ languages.
AI should say:
Let's start with STT — the speech-to-text engine. Tencent's default is fine for Chinese and English. If you want to support more languages, switch to the
bigmodelengine (doc: https://trtc.io/document/69592?product=conversationalai).Supported languages when
engine_model_type=bigmodel:zh(Chinese),en(English),yue(Cantonese),ar(Arabic),de(German),fr(French),es(Spanish),pt(Portuguese),id(Indonesian),it(Italian),ko(Korean),ru(Russian),th(Thai),vi(Vietnamese),ja(Japanese),tr(Turkish),hi(Hindi),ms(Malay),nl(Dutch),sv(Swedish),da(Danish),fi(Finnish),pl(Polish),cs(Czech),fil(Filipino),fa(Persian),el(Greek),ro(Romanian),hu(Hungarian),mk(Macedonian). To switch STT engine, append these two lines to your.envand restart the service (no new keys needed):# STT engine — set engine_model_type=bigmodel to enable multi-language STT_ENGINE_MODEL_TYPE=bigmodel STT_ENGINE_LANGUAGE=zh # pick from the table aboveThen restart:
lsof -ti :3000 -sTCP:LISTEN | xargs kill && cd "$SKILL_ROOT" && nohup bash start.sh > /tmp/ai-cs-start.log 2>&1 &
The LLM is the "brain" of your customer service agent. You already configured one in Key 3 — if you want to try a different one, the cheapest path is to use the same .env values, just point to a different provider.
AI should say:
For the LLM, swap providers by changing 3 lines in
.env— no code change:
| Provider | Cost-effective pick | Get API Key |
|---|---|---|
| DeepSeek | deepseek-chat (best for Chinese, ~30x cheaper than gpt-4o) | https://platform.deepseek.com/api_keys |
| OpenAI | gpt-4o-mini | https://platform.openai.com/api-keys |
| Anthropic | claude-3-haiku | https://console.anthropic.com/settings/keys |
| Google AI | gemini-1.5-flash | https://aistudio.google.com/apikey |
| Together | meta-llama/Llama-3-8b-chat-hf | https://api.together.ai/settings/api-keys |
| Groq | llama-3.1-8b-instant | https://console.groq.com/keys |
Example (DeepSeek — cheapest for Chinese):
LLM_API_KEY=sk-your-key LLM_API_URL=https://api.deepseek.com/v1/chat/completions LLM_MODEL_NAME=deepseek-chatThen restart:
lsof -ti :3000 -sTCP:LISTEN | xargs kill && cd "$SKILL_ROOT" && nohup bash start.sh > /tmp/ai-cs-start.log 2>&1 &
TTS turns the LLM's text replies into voice. Tencent's default voices are good for most cases. If you want a different voice (e.g., a specific timbre, accent, or language), browse the TTS voice library.
AI should say:
For TTS, browse the voice library: https://trtc.io/document/68340?product=conversationalai
To switch TTS voice, add to
.envand restart:TTS_VOICE_TYPE=Chinese_Female_Shuanger ```> 💡 **Tip**: If you want a non-Chinese voice, make sure you also set `STT_ENGINE_MODEL_TYPE=bigmodel` and `STT_ENGINE_LANGUAGE=<matching code>` in §10.3A.1.1, otherwise the customer's speech and the agent's voice will be in different languages.
All set! Your AI customer service agent is fully configured and running. 🎉
Quick recap of what you have:
· AI Voice Agent http://localhost:3000 (default)
· Admin board http://localhost:3000/static/admin/
· API docs (Swagger) http://localhost:3000/docs
· Health probe http://localhost:3000/api/v1/health
You can switch STT / LLM / TTS models at any time by editing `.env` and restarting. Have fun! 🚀
To stop: lsof -ti :3000 -sTCP:LISTEN | xargs kill
Backend capabilities integrated. Verification:
· Health probe http://localhost:3000/api/v1/health (3 LEDs green)
· Control-plane POST /api/v1/agent/start → returns TaskId / SessionId
· API docs (Swagger) http://localhost:3000/docs (integration entry point)
Delivered to your project ($PROJECT_ROOT):
· Integration sample code (room entry / control), invocation order: get_config → enter room → agent/start → agent/control → agent/stop
· Outbound contract checklist + mock descriptions for each incremental capability (swap with your real system as needed)
UI is implemented by your own frontend. Verify voice quality from your frontend after entering a room.
To stop: lsof -ti :3000 -sTCP:LISTEN | xargs kill
If you encounter any of the following issues, here are the corresponding solutions:
| Issue | Cause | Solution |
|---|---|---|
| Key verification failed | Configured key expired or incorrect | Go back to §5 and recheck each key value. You can re-enter only the one that failed |
| Port is occupied | Port 3000 is in use by another program | Switch to a different port (e.g., --port 8080), or stop the program using port 3000 |
| Network unreachable | Corporate network or firewall restriction | Check if you need a proxy, or contact your network administrator to open the relevant domains |
| Python version too old | Python < 3.9 | Download the latest version from https://www.python.org/downloads/ |
| Error on startup | Dependency version conflict | The system will auto-fix it. If errors persist, send me the error message |
| Browser shows old UI (Path A) | Browser cached the old page | Cmd+Shift+R (Mac) or Ctrl+Shift+R (Windows) to force refresh |
/admin/tickets returns 404 (Path A) | That route doesn't exist | The correct entry is http://localhost:3000/static/admin/ |
SKILL_ROOT (most common issue in older versions).SKILL_ROOT per §0. All commands must cd "$SKILL_ROOT" or use absolute paths. Rerun.execute_command("lsof -ti :3000 -sTCP:LISTEN")cd "$SKILL_ROOT" && bash start.sh --port 8080kill <PID> (requires explicit user consent)LLM_API_URL and LLM_MODEL:
https://api.deepseek.com/chat/completions, model: deepseek-chatcd "$SKILL_ROOT" && python3 scripts/verify-credentials.py --type llmHTTPS_PROXY=... to .env--no-deep for local UserSig self-consistency check onlyNameError: name 'session_id' is not defined after startupcd "$SKILL_ROOT" && python3 scripts/post-install-patch.py{"level":"L3", ...} → Guide the user to read the corresponding capability package's INTERFACE_ADAPT.mdSubstitute all
$SKILL_ROOT/$PROJECT_ROOTwith absolute paths before execution. Alwayscd "$SKILL_ROOT"or use absolute paths when calling scripts.
| Command | Purpose |
|---|---|
python3 -c "import sys; assert sys.version_info >= (3,9)" | Prerequisite check |
test -f "$SKILL_ROOT/<path>" && echo OK || echo MISSING | File existence check |
find "$PWD" -maxdepth 4 -name SKILL.md -path '*ai-service*' | SKILL_ROOT fallback detection |
cd "$SKILL_ROOT" && python3 scripts/verify-credentials.py [--type tencent|trtc|llm] [--no-deep] | Key verification |
cd "$SKILL_ROOT" && python3 scripts/add-capability.py <names> --apply --json [--target-project "$PROJECT_ROOT"] [--tech-stack ...] | Capability assembly |
cd "$SKILL_ROOT" && python3 scripts/post-install-patch.py | Post-install patch |
cd "$SKILL_ROOT" && python3 scripts/contract-adapt.py <name> [--curl-file ... | --openapi-file ...] --json | API contract adaptation |
cp "$SKILL_ROOT"/scenarios/customer-service/ui/voice-customer-service/{index.html,app.js,styles.css,data.js,mock-shop.json,tokens.css} "$PROJECT_ROOT"/ai-customer-service-demo/ | UI overlay (Path A only) |
cp -R "$SKILL_ROOT"/scenarios/customer-service/ui/admin-board/. "$PROJECT_ROOT"/ai-customer-service-demo/admin/ | Admin board mount (Path A only) |
mkdir -p "$PROJECT_ROOT"/ai-customer-service-demo/admin | Create demo deployment directory (Path A only) |
echo "WEB_DEMO_DIR=<path>" >> "$SKILL_ROOT"/capabilities/conversation-core/.env | Write demo directory path (Path A only) |
cd "$SKILL_ROOT" && bash start.sh [--port N] [--https] | Launch |
cd "$SKILL_ROOT" && nohup bash start.sh > /tmp/ai-cs-start.log 2>&1 & | Background launch |
sleep N && curl -sS http://localhost:3000/api/v1/health | Health check |
tail -80 /tmp/ai-cs-start.log | Startup failure diagnostics |
lsof -ti :3000 -sTCP:LISTEN | Check port usage |
chmod 600 "$SKILL_ROOT/capabilities/conversation-core/.env" | Tighten permissions |
| Command | Reason Prohibited |
|---|---|
python3 scripts/setup-credentials.py validate-tencent-cloud --secret-id ... | Key passed via command line → shell history leak |
echo $TENCENT_CLOUD_SECRET_ID | shell history leak |
cat "$SKILL_ROOT/capabilities/conversation-core/.env" | May leak via terminal recording / screenshots |
git add . && git commit | Credentials may be committed by mistake |
| Any command with plaintext keys as arguments | Same as above |
Bare relative paths to call scripts (python3 scripts/... without cd "$SKILL_ROOT") | Wrong cwd assumption → can't find assets |
| Path | Purpose |
|---|---|
$SKILL_ROOT/capabilities/conversation-core/.env | Key write |
$PROJECT_ROOT/<adapter rendered artifact> | Path B: integration samples (written by script, not AI) |
$SKILL_ROOT/capabilities/<cap>/src/adapters/user_custom.py | Generated by contract-adapt.py |
/tmp/adapt_<cap>.curl.txt | Temporary storage for user's curl |
/tmp/ai-cs-start.log | nohup startup log |
Other file writes require explicit user confirmation before writing.
Special note: capabilities/conversation-core/src/agent.py and capabilities/conversation-core/src/server.py are the skeleton layer. The AI should not directly edit them by hand.
Path B generates no UI. This section does not apply to Path B.
Path A UI must follow $SKILL_ROOT/scenarios/customer-service/ui/design-system/DESIGN_GUIDELINES.md:
| Item | Mandatory Requirement |
|---|---|
| Theme | Light glassmorphism locked (soft purple + light pink + pale blue ambient over #f7f3ff; no dark mode toggle) |
| Colors | Everything via CSS variables from tokens.css; no hardcoded hex values |
| Font | SF Pro / Inter / Helvetica Neue, Chinese fallback to system default |
| Icons | Lucide / Phosphor style monoline SVG icons, sizes: 16/20/24/32 |
| Emoji | Completely disabled in the UI rendering layer (use SVG icons + text instead) |
| Glassmorphism panels | backdrop-filter: blur(20px) + @supports fallback |
The 3 LEDs in the top right each show a tooltip on hover:
| LED | Title | Explanation |
|---|---|---|
| Cloud | Tencent Cloud API | Control-plane (CAM/STS); used to issue temporary credentials |
| TRTC | TRTC (Real-Time Communication) | Data-plane media channel; carries voice streams / subtitles / custom messages |
| LLM | LLM provider | Inference engine; OpenAI-compatible protocol; swappable with DeepSeek / GPT / Claude, etc. |
Final Reminders (for the Coding Agent to internalize):
- 🔴 Path baseline first: Determine
SKILL_ROOT(= injected Base directory) andPROJECT_ROOTper §0 before anything else. Alwayscd "$SKILL_ROOT"or use absolute paths for all script/asset commands. Never ask the user to move directories.- At each step, first call the tool to get facts, then explain to the user (don't answer from memory)
- Tool call failure → give the user a stderr summary; do not hide errors
- Uncertain field / path → use
read_fileto check the manifest, then answer- Strictly follow §12 Tool Whitelist and §5.4 Security Red Lines throughout
- This Skill's selling point is voice; text-only requests → advise the user to configure it themselves; do not generate artifacts
- Path A must run all 6 steps. Never skip Step 2.5 (post-install-patch) or Step 3 (UI overlay)
- Path B never generates any UI; core end-to-end verified + incremental capabilities provide specs/mocks/samples only
- human-handoff legacy API field is
state(values:waiting/connected/closed/canceled/timeout), notstatus/queued/cancelled
npx claudepluginhub tencent-rtc/agent-skills --plugin trtc-agent-skillsQualifies use cases for Twilio AI conversational agents and recommends the right architecture and implementation approach.
Routes TRTC integration requests to the correct sub-skill based on product (Conference, Chat, Call, Live, Conversational AI, TIMPush), platform, and intent. Dispatches to specialized pipelines for SDK usage, error codes, pricing, and API docs.
Builds voice AI agents with LiveKit Cloud and Agents SDK. Provides opinionated guidance for LiveKit Cloud + LiveKit Inference, including setup, agent workflows, and mandatory testing.