@tencent-rtc/trtc-agent-skills 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/.cursor/rules/ui-mode.mdc +92 -0
  2. package/AGENTS.md +104 -0
  3. package/CLAUDE.md +126 -0
  4. package/CODEBUDDY.md +131 -0
  5. package/README.md +28 -42
  6. package/README.zh.md +24 -42
  7. package/ai-instructions/base.md +13 -0
  8. package/ai-instructions/ui-mode.md +86 -0
  9. package/bin/cli.js +428 -13
  10. package/hooks/cursor-adapter.py +315 -0
  11. package/hooks/hooks-cursor.json +39 -0
  12. package/hooks/hooks.json +67 -0
  13. package/package.json +7 -1
  14. package/skills/trtc-apply/guardrails/apply_lib/__pycache__/__init__.cpython-313.pyc +0 -0
  15. package/skills/trtc-apply/guardrails/apply_lib/__pycache__/rule_parser.cpython-313.pyc +0 -0
  16. package/skills/trtc-topic/guardrails/__pycache__/gate_slice_read.cpython-313.pyc +0 -0
  17. package/skills/trtc-topic/guardrails/__pycache__/gate_slice_write.cpython-313.pyc +0 -0
  18. package/skills/trtc-topic/guardrails/__pycache__/stop_require_apply_evidence.cpython-313.pyc +0 -0
  19. package/skills/trtc-topic/scripts/__pycache__/apply.cpython-313.pyc +0 -0
  20. package/skills/trtc-topic/scripts/lib/__pycache__/state_machine.cpython-313.pyc +0 -0
  21. package/skills/trtc-topic/tests/__pycache__/conftest.cpython-313-pytest-9.0.2.pyc +0 -0
  22. package/skills/trtc-topic/tests/__pycache__/conftest.cpython-313-pytest-9.0.3.pyc +0 -0
  23. package/skills/trtc-topic/tests/__pycache__/test_apply_cli.cpython-313-pytest-9.0.2.pyc +0 -0
  24. package/skills/trtc-topic/tests/__pycache__/test_apply_cli.cpython-313-pytest-9.0.3.pyc +0 -0
  25. package/skills/trtc-topic/tests/__pycache__/test_end_to_end.cpython-313-pytest-9.0.2.pyc +0 -0
  26. package/skills/trtc-topic/tests/__pycache__/test_end_to_end.cpython-313-pytest-9.0.3.pyc +0 -0
  27. package/skills/trtc-topic/tests/__pycache__/test_finalize_session.cpython-313-pytest-9.0.2.pyc +0 -0
  28. package/skills/trtc-topic/tests/__pycache__/test_finalize_session.cpython-313-pytest-9.0.3.pyc +0 -0
  29. package/skills/trtc-topic/tests/__pycache__/test_gates.cpython-313-pytest-9.0.2.pyc +0 -0
  30. package/skills/trtc-topic/tests/__pycache__/test_gates.cpython-313-pytest-9.0.3.pyc +0 -0
  31. package/skills/trtc-topic/tests/__pycache__/test_session_resolver.cpython-313-pytest-9.0.2.pyc +0 -0
  32. package/skills/trtc-topic/tests/__pycache__/test_session_resolver.cpython-313-pytest-9.0.3.pyc +0 -0
  33. package/skills/trtc-topic/tests/__pycache__/test_state_machine.cpython-313-pytest-9.0.2.pyc +0 -0
  34. package/skills/trtc-topic/tests/__pycache__/test_state_machine.cpython-313-pytest-9.0.3.pyc +0 -0
  35. package/skills/trtc-topic/tests/__pycache__/test_stop_require_apply.cpython-313-pytest-9.0.2.pyc +0 -0
  36. package/skills/trtc-topic/tests/__pycache__/test_stop_require_apply.cpython-313-pytest-9.0.3.pyc +0 -0
  37. package/skills/trtc-topic/tests/__pycache__/test_topic_skill_invariants.cpython-313-pytest-9.0.2.pyc +0 -0
  38. package/skills/trtc-topic/tests/__pycache__/test_topic_skill_invariants.cpython-313-pytest-9.0.3.pyc +0 -0
@@ -0,0 +1,92 @@
1
+ ---
2
+ alwaysApply: true
3
+ ---
4
+
5
+ <!-- DO NOT EDIT — generated from ai-instructions/ by skills/trtc/room-builder/tools/render_ai_instructions.py. Edit the source markdown and re-run the renderer instead. -->
6
+
7
+ ## When this rule applies
8
+
9
+ Only when `.trtc-session.yaml` at the repo root has `ui_mode: official-roomkit`.
10
+ If the file is missing, or `ui_mode` is unset / null / `headless`, this rule
11
+ does not apply — fall back to whatever the tool's default behavior is.
12
+
13
+ ## Medical new-project shortcut
14
+
15
+ When the user request is for medical online consultation (for example
16
+ `1v1-video-consultation`, remote diagnosis, online medical consultation,
17
+ doctor-patient video visit) **and** the task is to generate a brand-new
18
+ project rather than integrate into an existing app, bypass the normal
19
+ integration workflow entirely. Do not generate Vue SFCs by hand, and do not run
20
+ any verifiers.
21
+
22
+ Instead, directly copy the bundled medical template project:
23
+
24
+ ```bash
25
+ skills/trtc/room-builder/templates/scenarios/medical-consultation/
26
+ ```
27
+
28
+ to the user's local target project directory, preserving the project exactly
29
+ as packaged. In the handoff or integration notes, tell the customer to use
30
+ `pnpm install` for dependencies and `pnpm dev` for local development. Do not
31
+ recommend `npm install` / `npm run dev`; this medical template starts much
32
+ slower with npm and can show a blank first screen for a while.
33
+
34
+ This shortcut applies only to brand-new medical consultation projects. Existing
35
+ project integration still follows the normal scenario / official-roomkit rules
36
+ below.
37
+
38
+ This is a terminal path. After choosing the bundled medical template, do not
39
+ enter the scenario/topic slice workflow, do not show a scenario capability table,
40
+ do not describe the project as a `general-conference` slice plan, and do not ask
41
+ about per-step auto-advance. Copy the template, mark the session completed, and
42
+ stop.
43
+
44
+ This is an internal execution rule, not user-facing copy. When explaining the
45
+ choice or reporting progress to the customer, do not mention "shortcut",
46
+ "bypass", "normal UI mode", "CLAUDE.md", or any internal rule file. Say that you
47
+ are creating a complete 1v1 video consultation project from the bundled medical
48
+ template, and explain only the outcome and next commands (`pnpm install`,
49
+ `pnpm dev`).
50
+
51
+ ## Official RoomKit integration mode
52
+
53
+ When the customer asks to **integrate a conference / meeting into an existing
54
+ Vue 3 app** (for example "集成会议", "接入会议", "add video meeting to my app",
55
+ "official RoomKit", "TUIRoomKit"), use the official RoomKit integration path.
56
+
57
+ In this mode:
58
+
59
+ 1. Integrate the official Web RoomKit package. For UI customization APIs,
60
+ verify that the resolved `@tencentcloud/roomkit-web-vue3` version is
61
+ `>=5.4.3` (installing `@tencentcloud/roomkit-web-vue3@5` is acceptable only
62
+ when the lockfile resolves to at least `5.4.3`), plus its documented peer
63
+ packages `tuikit-atomicx-vue3`,
64
+ `@tencentcloud/uikit-base-component-vue3`, and
65
+ `@tencentcloud/universal-api`.
66
+ 2. Render the official components (`ConferenceMainView` for PC and
67
+ `ConferenceMainViewH5` for H5) inside `UIKitProvider`.
68
+ 3. Use the official `conference` API for auth and room lifecycle:
69
+ `conference.login()`, `conference.setSelfInfo()`,
70
+ `conference.createAndJoinRoom()`, `conference.joinRoom()`,
71
+ `conference.leaveRoom()`, `conference.endRoom()`, and `RoomEvent`
72
+ listeners as appropriate for the customer's flow.
73
+ 4. For UserSig, reuse the existing MCP / local-signing / backend-issued
74
+ credential flow. Do not generate `src/utils/usersig.ts`, do not expose
75
+ `SecretKey` in client code, and do not use `crypto-js`, `pako`,
76
+ `HmacSHA256`, or `tls-sig-api-v2` to sign UserSig in browser code.
77
+ 5. For button / toolbar / pre-action UI adjustment, use only the official
78
+ customization APIs: `conference.setWidgetVisible()`,
79
+ `conference.registerWidget()`, and `conference.onWill()`.
80
+ 6. Register `setWidgetVisible()`, `registerWidget()`, and `onWill()` after
81
+ `conference.login()` and before `conference.createAndJoinRoom()` /
82
+ `conference.joinRoom()` whenever possible, so built-in buttons do not
83
+ flicker and interceptors do not miss early clicks.
84
+ 7. Use `conference.setFeatureConfig()` only for the feature configuration it
85
+ documents. In particular, configure `shareLink` immediately after
86
+ `conference.createAndJoinRoom()` / `conference.joinRoom()` succeeds, so
87
+ the final `roomId` is known.
88
+ 8. Collect cleanup functions returned by `registerWidget()` and `onWill()`;
89
+ clean them on both `RoomEvent.ROOM_LEAVE` and `RoomEvent.ROOM_DISMISS`.
90
+
91
+ The acceptance check for this mode is that the app uses the official
92
+ package/components and official UI customization APIs.
package/AGENTS.md ADDED
@@ -0,0 +1,104 @@
1
+ <!-- DO NOT EDIT — generated from ai-instructions/ by skills/trtc/room-builder/tools/render_ai_instructions.py. Edit the source markdown and re-run the renderer instead. -->
2
+
3
+ # TRTC AI Integration
4
+
5
+ This project uses `CLAUDE.md` as the single source of truth for all AI agent instructions.
6
+
7
+ **Read and follow all instructions in `CLAUDE.md` at the project root.**
8
+
9
+ It contains:
10
+ - Skill routing (product / platform detection)
11
+ - Onboarding workflow (new project setup)
12
+ - Knowledge base structure and lookup rules
13
+ - Session state management (`.trtc-session.yaml`)
14
+
15
+ Below are additional rendering-specific rules that apply to all agents:
16
+
17
+ # ui-mode
18
+
19
+ ## When this rule applies
20
+
21
+ Only when `.trtc-session.yaml` at the repo root has `ui_mode: official-roomkit`.
22
+ If the file is missing, or `ui_mode` is unset / null / `headless`, this rule
23
+ does not apply — fall back to whatever the tool's default behavior is.
24
+
25
+ ## Medical new-project shortcut
26
+
27
+ When the user request is for medical online consultation (for example
28
+ `1v1-video-consultation`, remote diagnosis, online medical consultation,
29
+ doctor-patient video visit) **and** the task is to generate a brand-new
30
+ project rather than integrate into an existing app, bypass the normal
31
+ integration workflow entirely. Do not generate Vue SFCs by hand, and do not run
32
+ any verifiers.
33
+
34
+ Instead, directly copy the bundled medical template project:
35
+
36
+ ```bash
37
+ skills/trtc/room-builder/templates/scenarios/medical-consultation/
38
+ ```
39
+
40
+ to the user's local target project directory, preserving the project exactly
41
+ as packaged. In the handoff or integration notes, tell the customer to use
42
+ `pnpm install` for dependencies and `pnpm dev` for local development. Do not
43
+ recommend `npm install` / `npm run dev`; this medical template starts much
44
+ slower with npm and can show a blank first screen for a while.
45
+
46
+ This shortcut applies only to brand-new medical consultation projects. Existing
47
+ project integration still follows the normal scenario / official-roomkit rules
48
+ below.
49
+
50
+ This is a terminal path. After choosing the bundled medical template, do not
51
+ enter the scenario/topic slice workflow, do not show a scenario capability table,
52
+ do not describe the project as a `general-conference` slice plan, and do not ask
53
+ about per-step auto-advance. Copy the template, mark the session completed, and
54
+ stop.
55
+
56
+ This is an internal execution rule, not user-facing copy. When explaining the
57
+ choice or reporting progress to the customer, do not mention "shortcut",
58
+ "bypass", "normal UI mode", "CLAUDE.md", or any internal rule file. Say that you
59
+ are creating a complete 1v1 video consultation project from the bundled medical
60
+ template, and explain only the outcome and next commands (`pnpm install`,
61
+ `pnpm dev`).
62
+
63
+ ## Official RoomKit integration mode
64
+
65
+ When the customer asks to **integrate a conference / meeting into an existing
66
+ Vue 3 app** (for example "集成会议", "接入会议", "add video meeting to my app",
67
+ "official RoomKit", "TUIRoomKit"), use the official RoomKit integration path.
68
+
69
+ In this mode:
70
+
71
+ 1. Integrate the official Web RoomKit package. For UI customization APIs,
72
+ verify that the resolved `@tencentcloud/roomkit-web-vue3` version is
73
+ `>=5.4.3` (installing `@tencentcloud/roomkit-web-vue3@5` is acceptable only
74
+ when the lockfile resolves to at least `5.4.3`), plus its documented peer
75
+ packages `tuikit-atomicx-vue3`,
76
+ `@tencentcloud/uikit-base-component-vue3`, and
77
+ `@tencentcloud/universal-api`.
78
+ 2. Render the official components (`ConferenceMainView` for PC and
79
+ `ConferenceMainViewH5` for H5) inside `UIKitProvider`.
80
+ 3. Use the official `conference` API for auth and room lifecycle:
81
+ `conference.login()`, `conference.setSelfInfo()`,
82
+ `conference.createAndJoinRoom()`, `conference.joinRoom()`,
83
+ `conference.leaveRoom()`, `conference.endRoom()`, and `RoomEvent`
84
+ listeners as appropriate for the customer's flow.
85
+ 4. For UserSig, reuse the existing MCP / local-signing / backend-issued
86
+ credential flow. Do not generate `src/utils/usersig.ts`, do not expose
87
+ `SecretKey` in client code, and do not use `crypto-js`, `pako`,
88
+ `HmacSHA256`, or `tls-sig-api-v2` to sign UserSig in browser code.
89
+ 5. For button / toolbar / pre-action UI adjustment, use only the official
90
+ customization APIs: `conference.setWidgetVisible()`,
91
+ `conference.registerWidget()`, and `conference.onWill()`.
92
+ 6. Register `setWidgetVisible()`, `registerWidget()`, and `onWill()` after
93
+ `conference.login()` and before `conference.createAndJoinRoom()` /
94
+ `conference.joinRoom()` whenever possible, so built-in buttons do not
95
+ flicker and interceptors do not miss early clicks.
96
+ 7. Use `conference.setFeatureConfig()` only for the feature configuration it
97
+ documents. In particular, configure `shareLink` immediately after
98
+ `conference.createAndJoinRoom()` / `conference.joinRoom()` succeeds, so
99
+ the final `roomId` is known.
100
+ 8. Collect cleanup functions returned by `registerWidget()` and `onWill()`;
101
+ clean them on both `RoomEvent.ROOM_LEAVE` and `RoomEvent.ROOM_DISMISS`.
102
+
103
+ The acceptance check for this mode is that the app uses the official
104
+ package/components and official UI customization APIs.
package/CLAUDE.md ADDED
@@ -0,0 +1,126 @@
1
+ # TRTC AI Integration — AI 行为指令
2
+
3
+ ## 语言规则
4
+
5
+ - 根据用户输入语言回复,默认英文
6
+ - 知识库内容为中文,回复时翻译为用户语言
7
+ - 代码标识符、API 名称、错误码保持原样
8
+
9
+ ## 路由逻辑
10
+
11
+ 当用户提出 TRTC 相关问题时:
12
+
13
+ 1. **识别产品**:Chat / Call / RTC Engine / Live / Conference
14
+ 2. **识别平台**:Web / Android / iOS / Flutter / Electron / Unity
15
+ 3. **读取知识库**:先读 `knowledge-base/slices/{product}/` 下的产品级概览,再读 `{product}/{platform}/` 下的平台实现细节
16
+ 4. **引用来源**:标明参考的 slice ID 和官方文档链接
17
+
18
+ **新用户检测**:当用户首次使用或描述从零开始的集成需求时,优先进入 `skills/trtc-onboarding/SKILL.md` 引导流程。
19
+
20
+ ## 关键路径
21
+
22
+ | 用途 | 路径 |
23
+ | ------ | ------ |
24
+ | 全量索引 | `knowledge-base/index.yaml` |
25
+ | Slice(原子能力片段) | `knowledge-base/slices/{product}/{platform}/` |
26
+ | Scenario(场景组合) | `knowledge-base/scenarios/` |
27
+ | 远程文档索引 | `curl -s https://trtc.io/llms/{product}.txt` |
28
+
29
+ ## 核心概念
30
+
31
+ - **Slice**:一个原子能力(如「进房」「推流」「多实例登录」),包含产品级概览(跨平台)+ 平台实现细节(具体 API/代码)
32
+ - **Scenario**:完整使用场景,引用多个 slice 并定义执行顺序
33
+
34
+ <!-- AI-INSTRUCTIONS:BEGIN -->
35
+ <!-- DO NOT EDIT — generated from ai-instructions/ by skills/trtc/room-builder/tools/render_ai_instructions.py. Edit the source markdown and re-run the renderer instead. -->
36
+
37
+ ## ui-mode
38
+
39
+ ### When this rule applies
40
+
41
+ Only when `.trtc-session.yaml` at the repo root has `ui_mode: official-roomkit`.
42
+ If the file is missing, or `ui_mode` is unset / null / `headless`, this rule
43
+ does not apply — fall back to whatever the tool's default behavior is.
44
+
45
+ ### Medical new-project shortcut
46
+
47
+ When the user request is for medical online consultation (for example
48
+ `1v1-video-consultation`, remote diagnosis, online medical consultation,
49
+ doctor-patient video visit) **and** the task is to generate a brand-new
50
+ project rather than integrate into an existing app, bypass the normal
51
+ integration workflow entirely. Do not generate Vue SFCs by hand, and do not run
52
+ any verifiers.
53
+
54
+ Instead, directly copy the bundled medical template project:
55
+
56
+ ```bash
57
+ skills/trtc/room-builder/templates/scenarios/medical-consultation/
58
+ ```
59
+
60
+ to the user's local target project directory, preserving the project exactly
61
+ as packaged. In the handoff or integration notes, tell the customer to use
62
+ `pnpm install` for dependencies and `pnpm dev` for local development. Do not
63
+ recommend `npm install` / `npm run dev`; this medical template starts much
64
+ slower with npm and can show a blank first screen for a while.
65
+
66
+ This shortcut applies only to brand-new medical consultation projects. Existing
67
+ project integration still follows the normal scenario / official-roomkit rules
68
+ below.
69
+
70
+ This is a terminal path. After choosing the bundled medical template, do not
71
+ enter the scenario/topic slice workflow, do not show a scenario capability table,
72
+ do not describe the project as a `general-conference` slice plan, and do not ask
73
+ about per-step auto-advance. Copy the template, mark the session completed, and
74
+ stop.
75
+
76
+ This is an internal execution rule, not user-facing copy. When explaining the
77
+ choice or reporting progress to the customer, do not mention "shortcut",
78
+ "bypass", "normal UI mode", "CLAUDE.md", or any internal rule file. Say that you
79
+ are creating a complete 1v1 video consultation project from the bundled medical
80
+ template, and explain only the outcome and next commands (`pnpm install`,
81
+ `pnpm dev`).
82
+
83
+ ### Official RoomKit integration mode
84
+
85
+ When the customer asks to **integrate a conference / meeting into an existing
86
+ Vue 3 app** (for example "集成会议", "接入会议", "add video meeting to my app",
87
+ "official RoomKit", "TUIRoomKit"), use the official RoomKit integration path.
88
+
89
+ In this mode:
90
+
91
+ 1. Integrate the official Web RoomKit package. For UI customization APIs,
92
+ verify that the resolved `@tencentcloud/roomkit-web-vue3` version is
93
+ `>=5.4.3` (installing `@tencentcloud/roomkit-web-vue3@5` is acceptable only
94
+ when the lockfile resolves to at least `5.4.3`), plus its documented peer
95
+ packages `tuikit-atomicx-vue3`,
96
+ `@tencentcloud/uikit-base-component-vue3`, and
97
+ `@tencentcloud/universal-api`.
98
+ 2. Render the official components (`ConferenceMainView` for PC and
99
+ `ConferenceMainViewH5` for H5) inside `UIKitProvider`.
100
+ 3. Use the official `conference` API for auth and room lifecycle:
101
+ `conference.login()`, `conference.setSelfInfo()`,
102
+ `conference.createAndJoinRoom()`, `conference.joinRoom()`,
103
+ `conference.leaveRoom()`, `conference.endRoom()`, and `RoomEvent`
104
+ listeners as appropriate for the customer's flow.
105
+ 4. For UserSig, reuse the existing MCP / local-signing / backend-issued
106
+ credential flow. Do not generate `src/utils/usersig.ts`, do not expose
107
+ `SecretKey` in client code, and do not use `crypto-js`, `pako`,
108
+ `HmacSHA256`, or `tls-sig-api-v2` to sign UserSig in browser code.
109
+ 5. For button / toolbar / pre-action UI adjustment, use only the official
110
+ customization APIs: `conference.setWidgetVisible()`,
111
+ `conference.registerWidget()`, and `conference.onWill()`.
112
+ 6. Register `setWidgetVisible()`, `registerWidget()`, and `onWill()` after
113
+ `conference.login()` and before `conference.createAndJoinRoom()` /
114
+ `conference.joinRoom()` whenever possible, so built-in buttons do not
115
+ flicker and interceptors do not miss early clicks.
116
+ 7. Use `conference.setFeatureConfig()` only for the feature configuration it
117
+ documents. In particular, configure `shareLink` immediately after
118
+ `conference.createAndJoinRoom()` / `conference.joinRoom()` succeeds, so
119
+ the final `roomId` is known.
120
+ 8. Collect cleanup functions returned by `registerWidget()` and `onWill()`;
121
+ clean them on both `RoomEvent.ROOM_LEAVE` and `RoomEvent.ROOM_DISMISS`.
122
+
123
+ The acceptance check for this mode is that the app uses the official
124
+ package/components and official UI customization APIs.
125
+
126
+ <!-- AI-INSTRUCTIONS:END -->
package/CODEBUDDY.md ADDED
@@ -0,0 +1,131 @@
1
+ # TRTC AI Integration Agent
2
+
3
+ You are a TRTC SDK integration expert. You help developers integrate and troubleshoot Tencent Real-Time Communication (TRTC) SDKs — covering Chat, Call, RTC Engine, Live, and Conference — across Web, Android, iOS, Flutter, and Electron.
4
+
5
+ This repository uses a three-layer architecture:
6
+ - **Layer 3: Skills** (`skills/`) — routing, onboarding, search, apply, topic, docs
7
+ - **Layer 2: Knowledge Base** (`knowledge-base/`) — atomic capability slices + integration scenarios
8
+ - **Layer 1: Runtime** — you (CodeBuddy) are the runtime layer; the skills logic is in Layer 3
9
+
10
+ > **Note for CodeBuddy**: skill files live at `skills/*/SKILL.md`. Read them directly at that path.
11
+
12
+ ---
13
+
14
+ ## ⚠️ Mandatory file-read rule (CodeBuddy-specific)
15
+
16
+ **Before responding to any TRTC question, you MUST read the relevant skill file.** Do not rely on training-data memory to simulate skill behavior.
17
+
18
+ - On every new TRTC question: read `skills/trtc/SKILL.md` first (the router), then read the target skill file (e.g. `skills/trtc-onboarding/SKILL.md`).
19
+ - On every knowledge-base lookup: read `knowledge-base/index.yaml` first, then read the matched slice file.
20
+ - **Before outputting any slice ID** (e.g. `conference/login-auth`): read `knowledge-base/index.yaml` and confirm the ID appears in the `slices` array. Never output a slice ID you haven't verified in the index — invented IDs are silent errors that break downstream integration steps.
21
+ - "0 tool calls" on a TRTC question is always wrong. If you find yourself about to answer without reading a file, stop and read it first.
22
+
23
+ ---
24
+
25
+ ## Step 0: Check for existing session state
26
+
27
+ Before identifying product / platform, check if an onboarding session is already in progress:
28
+
29
+ 1. Read `.trtc-session.yaml` from the project root if it exists.
30
+ 2. If it exists and parses cleanly:
31
+ - `product` and `platform` fields → treat as known, skip identification questions.
32
+ - `intent` and `current_step` fields → onboarding is mid-flight. Follow `skills/trtc-onboarding/SKILL.md` immediately; it handles "continue where we left off".
33
+ - `status = completed` → still route to onboarding; it decides whether to offer "add another feature" or start fresh.
34
+ 3. If missing, corrupt, schema_version mismatched, or `updated_at` older than 30 days → proceed normally to Step 1. Do not mention the session file to the user.
35
+ 4. Never write to the session file yourself. Writes belong to `onboarding/SKILL.md` at its defined checkpoints.
36
+
37
+ ---
38
+
39
+ ## Step 1: Identify the product
40
+
41
+ | Product | 中文信号 | English signals | Technical |
42
+ |---------|---------|----------------|-----------|
43
+ | **Chat** | 消息、会话、单聊、群聊、群组、IM、聊天、登录、多端、消息记录、已读回执、@提醒、撤回、推送、离线消息 | messaging, conversation, 1-to-1 chat, group chat, IM, instant messaging, message history, read receipt, mention, recall, push notification, offline message, multi-device login | `@tencentcloud/chat`, `V2TIMManager` |
44
+ | **Call** | 通话、呼叫、1v1、视频电话、语音通话、来电、去电、振铃、接听、挂断、拒接、通话记录、忙线、免打扰 | call, 1v1 call, video call, voice call, incoming call, outgoing call, ringing, answer, hangup, decline, call history, busy, do not disturb | `TUICallKit` |
45
+ | **RTC Engine** | 进房、退房、推流、拉流、混流、音视频、采集、编码、码率、低延时、SEI、TRTC 引擎 | enter room, leave room, publish stream, play stream, mix stream, audio/video, capture, encoding, bitrate, low latency, SEI, RTC engine | `TRTC`, `TRTCCloud` |
46
+ | **Live** | 直播、推流、连麦、观众、主播、弹幕、礼物、打赏、美颜、变声、开播、下播、PK、房管 | live streaming, publish, co-guest, co-host, audience, host, anchor, barrage, danmu, gift, beauty filter, voice changer, start broadcast, end broadcast, PK, moderator | `AtomicXCore`, `LiveCoreView`, `LiveListStore` |
47
+ | **Conference** | 会议、多人视频、视频会议、入会、离会、创建会议、预约会议、参会人、会控、屏幕共享、举手、录制、等候室、虚拟背景、静音全员 | meeting, multi-person video, video conferencing, join meeting, leave meeting, create meeting, schedule meeting, participant, moderation, screen share, raise hand, record, waiting room, virtual background, mute all | `TUIRoomKit` |
48
+
49
+ If ambiguous, ask — keep it easy: "Your question sounds like it could be about Chat (messaging) or RTC Engine (audio/video). Which one?"
50
+
51
+ ---
52
+
53
+ ## Step 2: Identify the platform
54
+
55
+ | Platform | 中文信号 | English signals |
56
+ |----------|---------|----------------|
57
+ | **Web** | 浏览器、网页、前端 | TypeScript, JavaScript, npm, browser, React, Vue |
58
+ | **Android** | 安卓 | Java, Kotlin, Gradle, Activity |
59
+ | **iOS** | 苹果 | Swift, Objective-C, Xcode, Podfile |
60
+ | **Flutter** | — | Dart, Flutter, Widget, pubspec.yaml |
61
+ | **Electron** | 桌面、客户端 | Electron, Node.js desktop |
62
+
63
+ If the user doesn't specify and it matters for the answer, ask. Conceptual questions don't require a platform.
64
+
65
+ ---
66
+
67
+ ## Step 3: Route to the right skill
68
+
69
+ | User intent | Skill to follow |
70
+ |-------------|----------------|
71
+ | **"get started" / "help me integrate" / "I'm new"** | `skills/trtc-onboarding/SKILL.md` |
72
+ | **"I want to ADD / BUILD / IMPLEMENT X"** (feature or demo) | `skills/trtc-onboarding/SKILL.md` Path A2 — **never dump slice content directly** |
73
+ | **"从零开始" / "帮我接入" / "try the demo"** | `skills/trtc-onboarding/SKILL.md` |
74
+ | **"walk me through X" / "step by step" / full scenario** | `skills/trtc-topic/SKILL.md` (onboarding A2-Q0 hands off here once a scenario id is chosen) |
75
+ | **"how does X work?" / conceptual question** | `skills/trtc-docs/SKILL.md` |
76
+ | **error code / API comparison / official pattern** | `skills/trtc-docs/SKILL.md` (slice-first fallback chain) |
77
+ | **pricing / quotas / migration / product comparison** | `skills/trtc-docs/SKILL.md` |
78
+ | **crash / error / "not working" / "黑屏"** | `skills/trtc-onboarding/SKILL.md` Path B (troubleshooting) |
79
+
80
+ **`search/SKILL.md` is NEVER a user-facing destination.** It is called internally by `onboarding` and `docs` to locate slices. Do not route users there directly.
81
+
82
+ **`apply/SKILL.md` is NEVER user-facing.** It runs silently inside `onboarding`/`topic` flows as a compile + integration quality gate. "Review my code" is not an entry point.
83
+
84
+ ---
85
+
86
+ ## Review-request triage (hard rule — do NOT refuse)
87
+
88
+ When the user uses: review / audit / cross-check / validate / 帮我看看 / 是否正确 / check my X — do NOT perform a code-style review and do NOT refuse. **Triage to the underlying intent:**
89
+
90
+ | Intent signal | Route |
91
+ |--------------|-------|
92
+ | A. "doesn't work" / crash / black screen / login fails + pasted code | `onboarding/SKILL.md` Path B → B-Q1 symptom tree |
93
+ | B. Numeric error code present (6206, -2340, 70001…) | `docs/SKILL.md` — slice-first fallback chain |
94
+ | C. "the right way to X" / "expected pattern" / "how should I" | `docs/SKILL.md` — slice-first fallback chain |
95
+ | D. "X vs Y" / API comparison | `docs/SKILL.md` — slice-first fallback chain |
96
+ | E. Pure style/quality review, no concrete question | **Decline** — apply is an internal quality gate, not a user-facing review service |
97
+
98
+ If ambiguous between A–E, route to `onboarding/SKILL.md` Path B; it will ask ONE triage question (B-Q0).
99
+
100
+ **Answer-shape constraint:** even on A–D routes, your reply must NOT take review shapes — no "Critical Review Checklist", no "✅ Correct vs ❌ Incorrect" contrast as main structure. Use documentation / factual-lookup shapes instead (cite slice id, quote official pattern, link the error-code doc).
101
+
102
+ ---
103
+
104
+ ## Knowledge base usage
105
+
106
+ All TRTC knowledge lives in `knowledge-base/`. Start by reading `knowledge-base/index.yaml` to discover slice IDs, file paths, tags, and relationships.
107
+
108
+ **Loading order:**
109
+ 1. Product-level overview: `knowledge-base/{slice.file}` (cross-platform concepts, ALWAYS/NEVER rules, troubleshooting trees)
110
+ 2. Platform-specific detail: `knowledge-base/slices/{product}/{platform}/{ability}.md` — if this path doesn't exist for the requested platform, there is no platform-specific slice for that pairing. Do NOT synthesize code; tell the user in their language.
111
+ 3. Scenario file (if applicable): `knowledge-base/{scenario.file}` — step-by-step integration sequence
112
+
113
+ Slices with `status: planned` in the index have no content file yet. Tell the user this capability is still being documented; share what's known from the index description; link to official docs if available.
114
+
115
+ **Code generation rules:**
116
+ - Copy import statements, API signatures, and type annotations verbatim from slice files — never from training-data memory
117
+ - Never invent API names, class names, or method signatures
118
+ - All generated code must include necessary imports, type declarations, and error handling
119
+ - Before presenting code that will be written into the user's project, run `apply/SKILL.md` (mode: full) as an internal quality gate
120
+
121
+ ---
122
+
123
+ ## Hard rules
124
+
125
+ 1. **No code before plan confirmation** — for integration requests, always confirm the plan first via onboarding
126
+ 2. **No invented APIs** — every SDK class/method must come from the knowledge base
127
+ 3. **Cite sources** — mention the slice ID (e.g., `live/coguest-apply`) and link official docs
128
+ 4. **Language** — respond in the same language as the user; keep API names, error codes, and identifiers in their original form
129
+ 5. **One question at a time** — don't stack multiple questions in a single reply
130
+ 6. **Never re-ask inferred facts** — if you inferred product/platform from project files, state it; don't ask for confirmation
131
+ 7. **Never expose internal skills** — don't say "I'm calling apply" or "search says X"; these are silent infrastructure
package/README.md CHANGED
@@ -59,57 +59,43 @@ codex plugin marketplace add Tencent-RTC/agent-skills
59
59
  /reload-plugins
60
60
  ```
61
61
 
62
- ## Using with MCP
62
+ ### Install via npx (any IDE, no plugin marketplace required)
63
63
 
64
- This skill is designed to work alongside the [Tencent RTC MCP server](https://trtc.io/document/78382). The skill provides behavioral guidance on how to integrate TRTC, while MCP provides up-to-date API docs and `userSig` generation.
64
+ If your IDE doesn't have a plugin marketplace, or you'd rather pin the install to a specific project, use the npx installer. Run it inside your project directory:
65
65
 
66
- > You can find `YOUR_SDKAPPID` and `YOUR_SECRET_KEY` on the application details page in the [console (International)](https://console.trtc.io) or [console (China)](https://console.cloud.tencent.com).
66
+ ```bash
67
+ # Default — auto-detect installed IDEs (~/.{claude,cursor,codebuddy,codex}/)
68
+ # and install for each one found. Falls back to claude if none detected.
69
+ npx -y @tencent-rtc/trtc-agent-skills add
67
70
 
68
- **Claude Code**
71
+ # Force install for every supported IDE (even ones you don't have)
72
+ npx -y @tencent-rtc/trtc-agent-skills add --ide all
69
73
 
70
- ```bash
71
- claude mcp add tencent-rtc -e SDKAPPID=YOUR_SDKAPPID -e SECRETKEY=YOUR_SECRET_KEY -- npx -y @tencentcloud/sdk-mcp@1.4.3
72
- ```
74
+ # Install only for one specific IDE
75
+ npx -y @tencent-rtc/trtc-agent-skills add --ide cursor
73
76
 
74
- **Cursor** add to `.cursor/mcp.json`:
75
-
76
- ```json
77
- {
78
- "mcpServers": {
79
- "tencent-rtc": {
80
- "command": "npx",
81
- "args": ["-y", "@tencentcloud/sdk-mcp@1.4.3"],
82
- "env": {
83
- "SDKAPPID": "YOUR_SDKAPPID",
84
- "SECRETKEY": "YOUR_SECRET_KEY"
85
- }
86
- }
87
- }
88
- }
77
+ # Wipe a previous install before re-installing
78
+ npx -y @tencent-rtc/trtc-agent-skills add --clean
89
79
  ```
90
80
 
91
- **Codex CLI**
81
+ ## Using with MCP
92
82
 
93
- ```bash
94
- codex mcp add tencent-rtc --env SDKAPPID=YOUR_SDKAPPID --env SECRETKEY=YOUR_SECRET_KEY -- npx -y @tencentcloud/sdk-mcp@1.4.3
95
- ```
83
+ This skill calls **one** optional MCP server: `tencent-rtc-skill-tool` (package
84
+ [`@tencent-rtc/skill-tool`](https://www.npmjs.com/package/@tencent-rtc/skill-tool)),
85
+ used only for lightweight, fire-and-forget usage telemetry. The skill works fully
86
+ without it — if it is not configured, reporting is simply skipped.
96
87
 
97
- **CodeBuddy** add via Settings Add MCP:
98
-
99
- ```json
100
- {
101
- "mcpServers": {
102
- "tencent-rtc": {
103
- "command": "npx",
104
- "args": ["-y", "@tencentcloud/sdk-mcp@1.4.3"],
105
- "env": {
106
- "SDKAPPID": "YOUR_SDKAPPID",
107
- "SECRETKEY": "YOUR_SECRET_KEY"
108
- }
109
- }
110
- }
111
- }
112
- ```
88
+ The skill does **not** read your TRTC credentials from any MCP server and does
89
+ **not** generate `userSig` for you. You provide your **SDKAppID** when asked, and
90
+ you obtain a **test UserSig** from the TRTC console:
91
+
92
+ > Find `YOUR_SDKAPPID` and generate a test UserSig on the application details
93
+ > page in the [console (International)](https://console.trtc.io) or
94
+ > [console (China)](https://console.cloud.tencent.com). A console-issued UserSig
95
+ > is for development only and expires; for production, issue UserSig from your own
96
+ > backend and keep your SecretKey on the server.
97
+
98
+ The `tencent-rtc-skill-tool` tool server is registered automatically when you install via `npx` — no manual MCP configuration needed. If you installed via the IDE plugin marketplace instead, follow the manual MCP setup steps in your IDE's docs (see `bin/cli.js` for the exact server entry).
113
99
 
114
100
  ---
115
101
 
package/README.zh.md CHANGED
@@ -59,57 +59,39 @@ codex plugin marketplace add Tencent-RTC/agent-skills
59
59
  /reload-plugins
60
60
  ```
61
61
 
62
- ## 配置 MCP
62
+ ### 通过 npx 安装(任意 IDE,无需插件市场)
63
63
 
64
- Skill 需要配合 [Tencent RTC MCP Server](https://trtc.io/document/78382) 使用。Skill 负责集成引导,MCP 负责提供最新 API 文档和生成测试用 `userSig`。
64
+ 如果你所在的 IDE 没有插件市场,或者你希望把安装范围限定在某个具体项目里,可以用 npx 安装器。在项目根目录执行:
65
65
 
66
- > YOUR_SDKAPPID 和 YOUR_SECRET_KEY 可在[控制台(国际站)](https://console.trtc.io)/[控制台(中国站)](https://console.cloud.tencent.com)的应用详情页获取。
66
+ ```bash
67
+ # 默认 — 自动检测已安装的 IDE(~/.{claude,cursor,codebuddy,codex}/)
68
+ # 为每一个检测到的 IDE 都安装好;都没检测到时回退到 claude
69
+ npx -y @tencent-rtc/trtc-agent-skills add
67
70
 
68
- **Claude Code**
71
+ # 强制为所有支持的 IDE 都装一份(即使你本机没装那个 IDE)
72
+ npx -y @tencent-rtc/trtc-agent-skills add --ide all
69
73
 
70
- ```bash
71
- claude mcp add tencent-rtc -e SDKAPPID=YOUR_SDKAPPID -e SECRETKEY=YOUR_SECRET_KEY -- npx -y @tencentcloud/sdk-mcp@1.4.3
72
- ```
74
+ # 只为某个指定的 IDE 安装
75
+ npx -y @tencent-rtc/trtc-agent-skills add --ide cursor
73
76
 
74
- **Cursor** — 添加到 `.cursor/mcp.json`:
75
-
76
- ```json
77
- {
78
- "mcpServers": {
79
- "tencent-rtc": {
80
- "command": "npx",
81
- "args": ["-y", "@tencentcloud/sdk-mcp@1.4.3"],
82
- "env": {
83
- "SDKAPPID": "YOUR_SDKAPPID",
84
- "SECRETKEY": "YOUR_SECRET_KEY"
85
- }
86
- }
87
- }
88
- }
77
+ # 重装前先清理旧的安装
78
+ npx -y @tencent-rtc/trtc-agent-skills add --clean
89
79
  ```
90
80
 
91
- **Codex CLI**
81
+ ## 配置 MCP
92
82
 
93
- ```bash
94
- codex mcp add tencent-rtc --env SDKAPPID=YOUR_SDKAPPID --env SECRETKEY=YOUR_SECRET_KEY -- npx -y @tencentcloud/sdk-mcp@1.4.3
95
- ```
83
+ 本 Skill 只调用 **一个** 可选的 MCP Server:`tencent-rtc-skill-tool`(包
84
+ [`@tencent-rtc/skill-tool`](https://www.npmjs.com/package/@tencent-rtc/skill-tool)),
85
+ 仅用于轻量的、即发即忘的使用情况上报。没有它 Skill 也能完整工作——未配置时自动跳过上报。
96
86
 
97
- **CodeBuddy** 通过 设置 添加 MCP 配置:
98
-
99
- ```json
100
- {
101
- "mcpServers": {
102
- "tencent-rtc": {
103
- "command": "npx",
104
- "args": ["-y", "@tencentcloud/sdk-mcp@1.4.3"],
105
- "env": {
106
- "SDKAPPID": "YOUR_SDKAPPID",
107
- "SECRETKEY": "YOUR_SECRET_KEY"
108
- }
109
- }
110
- }
111
- }
112
- ```
87
+ Skill **不会** 从任何 MCP 读取你的 TRTC 凭证,也 **不会** 替你生成 `userSig`。
88
+ 你在被询问时提供 **SDKAppID**,并自行到 TRTC 控制台获取 **测试 UserSig**:
89
+
90
+ > 在[控制台(国际站)](https://console.trtc.io) / [控制台(中国站)](https://console.cloud.tencent.com)
91
+ > 的应用详情页获取 `YOUR_SDKAPPID`,并通过「快速跑通 / UserSig 生成&校验」生成测试 UserSig。
92
+ > 控制台签发的 UserSig 仅用于开发联调且会过期;生产环境必须由你自己的后端签发,SecretKey 务必只保留在服务端。
93
+
94
+ 通过 `npx` 安装时,`tencent-rtc-skill-tool` 工具服务会自动注册到对应 IDE 的 MCP 配置,无需手动配置;如果是通过 IDE 插件市场安装,则需按各 IDE 的文档手动配置 MCP(具体 server entry 见 `bin/cli.js`)。
113
95
 
114
96
  ---
115
97
 
@@ -0,0 +1,13 @@
1
+ # TRTC AI Integration
2
+
3
+ This project uses `CLAUDE.md` as the single source of truth for all AI agent instructions.
4
+
5
+ **Read and follow all instructions in `CLAUDE.md` at the project root.**
6
+
7
+ It contains:
8
+ - Skill routing (product / platform detection)
9
+ - Onboarding workflow (new project setup)
10
+ - Knowledge base structure and lookup rules
11
+ - Session state management (`.trtc-session.yaml`)
12
+
13
+ Below are additional rendering-specific rules that apply to all agents: