From trtc-agent-skills
Handles Vue 3 Web full/direct chat integration with phase-based state machine for onboarding. Enter only after dispatcher routing; not a standalone entry point.
How this skill is triggered — by the user, by Claude, or both
Slash command
/trtc-agent-skills:trtc-chatThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- **角色**:协同开发者,按 slice 最佳实践生成代码
flows/maintenance.mdflows/onboarding.mdreferences/01-detect-project.mdreferences/02-path-a-questions.mdreferences/02-path-a-scaffold-template.mdreferences/02-path-a-script.mdreferences/02-path-a-templates.mdreferences/03-path-b-script.mdreferences/04-path-c-script.mdreferences/04-uikit-redirect.mdreferences/05-path-d-script.mdreferences/05-slice-loading.mdreferences/06-a-defensive-coding.mdreferences/06-hard-rules.mdreferences/08-state-config.mdreferences/09-troubleshoot.mdreferences/10-references-index.mdreferences/11-what-to-do-next-template.mdreferences/12-page-composition.mdreferences/13-reporting.mdtrtc/SKILL.md 完成 §-1 prompt reporting 与路由后 Read 本文件active_flow=onboarding,slice 在 path references 内python3 -m tools.* 的 cwd 须为 skills/trtc 或 skills/trtc-chat(后者含 tools/ shim,委托到 trtc);禁止在用户项目根执行(避免项目自有 tools/ 抢占)08-state-config.md §8.1.3)13-reporting.md,用 reporting_v2.py sendreporting.py;脚本节点的 reporting_v2.py send 见 13-reporting.md(含 Path B/C 业务 prompt)python3 -m tools.session read / write-batchpython3 -m tools.kb resolve <path> → Read 输出绝对路径(见 08-state-config.md §8.0;禁止 ../knowledge-base)。仅用于 knowledge-base 条目(chat/ slices/ docs/ 等);references/ flows/ 等 skill 自带文件直接 Read,禁止走 kb resolvepython3 -m tools.kb resolve chat/web/index.yaml证据缺失视为未执行。阻断码:BLOCKED: project_root_unresolved / session_not_initialized / phase_gate_not_satisfied / credential_missing / unsupported_platform / BLOCKED: dispatcher_bypass
未获用户输入前禁止默认 integration_mode(full/direct)或凭证。
❗ 本文件不是 dispatcher。仅允许在以下任一条件成立后进入:
| # | 条件 |
|---|---|
| 1 | 本轮已由 trtc/SKILL.md 路由至本文件(正常路径) |
| 2 | .trtc-session.yaml 存在且 product=chat 或 active_domain_skill=trtc-chat,且本轮 Agent 已先 Read ../trtc/SKILL.md 并完成其 §-1 |
若直接 Read 本文件(未经 Root):
../trtc/SKILL.md,从 §-1 重新走 session guard → 分类 → 路由IM 纯咨询(Path D):由 Root 路由至 docs/SKILL.md,不要在本文件 Step 0 偷跑 Path D。
flow_state.chat.phase 是唯一真相(.trtc-session.yaml,经 tools.session)。
| phase | 允许动作 |
|---|---|
detect | 探测 + session 初始化 + A.1 |
collect_credentials | 收集 SDKAppID / SecretKey |
collect_mode | Full / Direct |
scaffold | 脚手架 |
slices | 一轮一 slice |
done | 收尾;新功能→Path B;维护→Path C |
phase=done 时:加法 → Path B;减法/报错 → Path C。
status=active → 按 active_flow / flow_state.chat.phase 续接active_flow=onboarding 覆盖 detect…slicesstatus=completed → 承接 Path B/C/DBash python3 -m tools.kb resolve chat/web/path-d-signals.yaml → Read 输出路径,再对照用户句。
命中条件(知识咨询信号 且):
.trtc-session.yaml,或product=chat 且 flow_state.chat.phase=done / status=completed命中 → STOP 本集成流;应由 Root 已路由至 docs/SKILL.md。若尚未路由,Read ../trtc/SKILL.md §A 后进入 docs/SKILL.md。
❗ 路由至 docs/SKILL.md 后 不要再 Read path-d-signals.yaml(门禁已完成;后续见 docs/SKILL.md → 05-path-d-script.md D.1)。
READ references/01-detect-project.md + references/08-state-config.md → 找根 → 写 project_state.project_root
非 vue3 → BLOCKED: unsupported_platform
READ references/vue3.md(按需)。
cd "<当前 trtc skill 目录>"
# 无 session 时:
python3 -m tools.session create --product chat --platform web --intent integrate-scenario
python3 -m tools.session write-batch --updates '{
"active_domain_skill": "trtc-chat",
"active_flow": "onboarding",
"project_state": {"project_root": "<projectRoot>"},
"flow_state": {"chat": {"phase": "detect", "chat_path": "A"}}
}' --expected-version <N>
已有 session → 保留 phase,仅更新必要字段。
| 优先级 | 条件 | 路径 |
|---|---|---|
| 0 | Step 0 知识咨询 | D(经 Root → docs/SKILL.md) |
| 1 | 减法/维护/报错 | C → READ flows/maintenance.md |
| 2 | phase=done + 有 tuikit 依赖 | B |
| 3 | 已依赖 tuikit-atomicx-vue3 | B |
| 4 | 新项目 / 未依赖 | A |
Path A/B:
python3 -m tools.flow enter --phase onboarding --product chat --platform web
然后 READ flows/onboarding.md → 02-path-a-script.md 或 03-path-b-script.md
禁止 enter --phase topic
Path C → READ references/04-path-c-script.md
Path D(集成流内不应到达)→ 若误达,Read docs/SKILL.md
reopen-add-feature(用 §8.5 write-batch)READ references/06-hard-rules.md + 06-a-defensive-coding.md
{projectRoot}/.trtc-session.yaml(唯一 session,经 tools.session){projectRoot}/WHAT-TO-DO-NEXT.md(A.4 交付物)skills/trtc-chat/.docs-query.yaml(Path D 正交态)本文件 §0/§1/0/1/2 > 路径脚本 > hard rules > 其他
见 references/10-references-index.md
npx claudepluginhub tencent-rtc/agent-skills --plugin trtc-agent-skillsRoutes 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.
Adds WhatsApp as a communication channel with QR code or pairing code authentication. Handles code merge, dependency installation, and environment detection.
Builds production Next.js web chatbots with AI SDK 6 + ai-elements. Covers tool calling with HITL approval, PostgreSQL session persistence, GDPR consent, SQL-first search, per-tool UI rendering, and evals. Use for conversational interfaces needing tool approval, database sessions, or custom tool output components.