Install
openclaw skills install trtc-config-inspectorTRTC SDK configuration inspection and analysis tool. Downloads scene config template Excel, inspection result Excel, and project code from user-provided URLs, compares inspection results against target scene configurations, locates TRTC parameters in source code, and generates a structured modification report. The AI Agent then applies code changes based on the report. Supports live streaming, voice chat room, video call, and other scenarios. Triggers: TRTC config inspection, compare config and modify code, optimize TRTC scene configuration
openclaw skills install trtc-config-inspectorCompares TRTC scene configuration templates against inspection results, generates a structured diff report, and guides the AI Agent or user to adjust source code accordingly.
This skill implements TRTC SDK configuration inspection analysis and modification suggestion generation:
Note: The scripts themselves do not modify any user code. They only generate analysis reports and modification suggestions. Actual code changes are performed by the AI Agent using standard code editing tools (e.g., replace_in_file), and the user can review each modification step.
Trigger this skill when the user makes requests like:
Confirm the following information with the user (if not fully provided):
| Parameter | Description | Required |
|---|---|---|
| Scene Config Template | URL or local path to scene config Excel | Required |
| Inspection Result | URL or local path to inspection result Excel | Required (if absent, only output target config) |
| Code Download Link | URL to project code zip/tar.gz or local directory path | Required |
Users may provide input in various ways:
Use the download script to fetch remote files:
python3 SKILL_BASE_DIR/scripts/download_files.py \
--config-url "Scene config Excel URL" \
--inspect-url "Inspection result Excel URL" \
--code-url "Code archive URL" \
--output-dir "SKILL_BASE_DIR/workspace"
This script will:
workspace/config.xlsxworkspace/inspect.xlsxworkspace/code/If the user provides a local file path, skip the download for that file and use the local path directly.
Run the diff script to generate a difference report:
python3 SKILL_BASE_DIR/scripts/diff_config.py "inspection_result_excel_path" "scene_config_excel_path"
The JSON report output contains:
diffs — Config items where current value differs from target value (code modification needed)matches — Config items that already match (no modification needed)unable_to_compare — Items that cannot be automatically compared (manual review needed)If only the scene config template is available (no inspection result), parse the template directly:
python3 SKILL_BASE_DIR/scripts/parse_excel.py "scene_config_excel_path" --type config
Based on the diffs array in the diff report, the AI Agent uses code editing tools to find corresponding API calls in the code and modify parameter values. Below are the mappings between config items and code APIs:
Find enterRoom calls, modify the second parameter.
| Config Value | Android Code Constant | iOS Code Constant |
|---|---|---|
Live | TRTCCloudDef.TRTC_APP_SCENE_LIVE | TRTCAppSceneLIVE |
VideoCall | TRTCCloudDef.TRTC_APP_SCENE_VIDEOCALL | TRTCAppSceneVideoCall |
AudioCall | TRTCCloudDef.TRTC_APP_SCENE_AUDIOCALL | TRTCAppSceneAudioCall |
VoiceChatRoom | TRTCCloudDef.TRTC_APP_SCENE_VOICE_CHATROOM | TRTCAppSceneVoiceChatRoom |
Find startLocalAudio calls.
| Config Value | Android Code Constant | iOS Code Constant |
|---|---|---|
MUSIC | TRTCCloudDef.TRTC_AUDIO_QUALITY_MUSIC | TRTCAudioQualityMusic |
DEFAULT | TRTCCloudDef.TRTC_AUDIO_QUALITY_DEFAULT | TRTCAudioQualityDefault |
SPEECH | TRTCCloudDef.TRTC_AUDIO_QUALITY_SPEECH | TRTCAudioQualitySpeech |
Find setSystemVolumeType calls.
| Config Value | Android Code Constant | iOS Code Constant |
|---|---|---|
media | TRTCCloudDef.TRTCSystemVolumeTypeMedia | TRTCSystemVolumeTypeMedia |
voip | TRTCCloudDef.TRTCSystemVolumeTypeVOIP | TRTCSystemVolumeTypeVOIP |
auto | TRTCCloudDef.TRTCSystemVolumeTypeAuto | TRTCSystemVolumeTypeAuto |
Find setVideoEncoderParam calls and TRTCVideoEncParam objects.
CRITICAL — Video encoder params must be compared item by item; do not miss any sub-parameter:
In the scene config Excel, video encoder params (resolution, FPS, bitrate) are split into multiple rows. The diff script outputs independent sub-parameter comparisons. All video encoder sub-parameter diffs must be checked and applied, including:
videoResolutionvideoFps (frequently missed!)videoBitrate| Parameter | Field Name | Description |
|---|---|---|
| Resolution | videoResolution | e.g., TRTC_VIDEO_RESOLUTION_1280_720 (720p) |
| FPS | videoFps | Integer, e.g., 15 or 25 |
| Bitrate | videoBitrate | Integer (kbps), e.g., 1800 |
| Min Bitrate | minVideoBitrate | Integer (kbps) |
| Resolution Mode | videoResolutionMode | PORTRAIT or LANDSCAPE |
| Adaptive Resolution | enableAdjustRes | Boolean |
Resolution constant mapping:
TRTC_VIDEO_RESOLUTION_960_540TRTC_VIDEO_RESOLUTION_1280_720TRTC_VIDEO_RESOLUTION_1920_1080Recommended bitrates:
Find setAudioCaptureVolume and setAudioPlayoutVolume calls.
Find callExperimentalAPI calls with JSON string parameters. The Excel code_example column provides the specific JSON structure.
When the AI Agent modifies code, TRTC API calls must follow this order:
TRTCCloud.sharedInstance() — Create instancesetListener() — Set callback listenersetSystemVolumeType() — Set volume type (before enterRoom)callExperimentalAPI() — Experimental settings (before enterRoom)setVideoEncoderParam() — Set video encoder paramsstartLocalPreview() — Start local camera previewstartLocalAudio() — Start local audio captureenterRoom() — Enter roomAfter completing all modifications, output a summary table:
| Config Item | Before | After | Status |
|---|---|---|---|
| Room Entry Mode | VideoCall | Live | Modified |
| Audio Quality | DEFAULT | MUSIC | Modified |
| System Volume Type | VOIP | Media | Modified |
| Video Resolution | 640x480 | 1280x720 | Modified |
| Video FPS | 15fps | 25fps | Modified |
| Video Bitrate | 900kbps | 1800kbps | Modified |
For items marked as "optional", inform the user and let them decide whether to apply.
openpyxl (auto-installed if missing)requests (auto-installed if missing)| Script | Purpose |
|---|---|
scripts/download_files.py | Download scene config, inspection result, and code archive from URLs and extract |
scripts/parse_excel.py | Parse a single Excel file (scene config or inspection result) and output structured JSON |
scripts/diff_config.py | Compare inspection result against scene config template and output diff report |
scripts/run_inspector.py | End-to-end inspector entry point: download -> parse -> diff -> analyze code -> generate modification plan |
download_files.py::download_and_extract(config_url, inspect_url, code_url, output_dir) — Download and extract all resource filesparse_excel.py::parse_config_excel(filepath) — Parse scene config Excelparse_excel.py::parse_inspect_excel(filepath) — Parse inspection result Exceldiff_config.py::diff_configs(inspect_data, config_data) — Compare and output diffscode_example column provides reference implementations; adapt to the project's actual code styleopenpyxl (Excel parsing) and requests (HTTP download), both standard PyPI packages