RoboMaster Referee System Communication Protocol intelligent query skill.Zero dependencies, ready to use out of the box。
Trigger
Activated when the user mentions the following:
/dji-refereecommand- Query RoboMaster protocol, referee system, communication protocol
- Ask about command codes (e.g., "what is 0x0001")
- Ask about data formats, communication links, and other protocol-related questions
Capabilities
- Intelligent document slicing - Precisely split by command code, chapter, and protocol type (104 slices)
- Intelligent keyword matching - Fast retrieval based on a scoring algorithm
- Exact command code lookup - Quickly locate by command code ID
- Zero dependencies - Pure Python standard library, no packages need to be installed
- Ready to use out of the box - No initialization required, query directly
Setup
No setup required! Use it directly.
All data has been pre-generated in the chunks.json file (152KB).
Usage in Claude Code
When the skill is activated (the user uses /dji-referee or asks protocol-related questions), Claude should:
1. Execute a query to obtain relevant content
Important: use query_simple.py, not query.py!
# 自然语言查询
python3 ~/.claude/skills/dji-referee/query_simple.py "如何获取机器人血量"
# 命令码精确查询
python3 ~/.claude/skills/dji-referee/query_simple.py 0x0003
# 列出所有命令码
python3 ~/.claude/skills/dji-referee/query_simple.py --list
# JSON 格式输出(用于程序化处理)
python3 ~/.claude/skills/dji-referee/query_simple.py --json "图传链路波特率"
2. Post-process and answer precisely
After the query tool returns relevant slices, Claude needs to:
- Understand the user's real needs
- Extract key information from multiple results
- Answer concisely and precisely
- Provide usage examples and suggestions
3. Answer examples
User asks: /dji-referee 如何获取机器人血量?
Claude executes:
python3 ~/.claude/skills/dji-referee/query_simple.py "如何获取机器人血量"
Tool returns: the complete definition of command code 0x0003 (including the data format table)
Claude answers: "To obtain robot HP, use command code 0x0003. This command is sent at 3Hz and includes:
- HP of each robot on your side (2 bytes each)
- Outpost HP (2 bytes)
- Base HP (2 bytes)
Note: If a robot is not on the field or has been penalized, its HP is 0."
Examples
Example 1: Query a command code
User: /dji-referee 0x0201 是什么命令?
Claude executes:
python3 ~/.claude/skills/dji-referee/query_simple.py 0x0201
Output:
📋 命令码: 0X0201
📝 描述: 机器人性能体系数据,固定以 10Hz 频率发送
📏 数据长度: 13 字节
📡 链路类型: 常规链路
🔄 发送方/接收方: 主控模块→对应机器人
[详细数据格式表格...]
Claude answers: "0x0201 is the robot performance system data command code, sent at 10Hz from the main control module to the corresponding robot. The data length is 13 bytes and includes the robot ID and level information. [Explain each field in detail according to the table...]"
Example 2: Natural language query
User: /dji-referee 图传链路的波特率是多少
Claude executes:
python3 ~/.claude/skills/dji-referee/query_simple.py "图传链路波特率"
Output:
🔍 查询: 图传链路波特率
📊 找到 3 个相关结果
[包含串口协议格式章节,说明图传链路波特率为 921600]
Claude answers: "The baud rate of the image transmission link is 921600。
According to the protocol document, the referee system serial port has three data links:
- Regular link: baud rate 115200
- Image transmission link: baud rate 921600 ← what you asked about
- Radar wireless link: transmitted via electromagnetic waves
The image transmission link forwards data through the referee system player station and the image transmission module."
Example 3: List all command codes
User: /dji-referee 列出所有命令码
Claude executes:
python3 ~/.claude/skills/dji-referee/query_simple.py --list
Output:
📋 共有 19 个命令码:
0X0001: 比赛状态数据,固定以 1Hz 频率发送...
0X0002: 比赛结果数据,比赛结束触发发送...
0X0003: 机器人血量数据,固定以 3Hz 频率发送...
...
Document Structure
The knowledge base contains the following types of slices:
-
Command code slices (command_code) - 19
- Metadata: cmd_id, data_length, description, sender_receiver, link_type
- Content: Complete data format table and description
-
Section chunks (section) - 50 items
- Metadata: title, level, section
- Content: Section text content
-
Custom protocol chunks (custom_protocol) - 35 items
- Metadata: protocol_name, section
- Content: Protocol definitions and data structures
Command Line Options
python3 query_simple.py [选项] <查询内容>
选项:
--list 列出所有命令码
--stats 显示知识库统计
--json 以 JSON 格式输出
-n, --num-results N 返回 N 个结果(默认 3)
Technical Details
Architecture design
用户问题
↓
Claude Code (你)
↓
query_simple.py (关键词检索)
↓
返回相关切片
↓
Claude Code (分析和回答)
↓
用户得到答案
Advantages:
- ✅ No additional dependencies
- ✅ No model download required
- ✅ No initialization time
- ✅ Leverages Claude Code's semantic understanding capabilities
- ✅ More flexible response approach
Query flow
- User input → keyword extraction
- Score matching → retrieve top-k chunks
- Return structured results
- Claude Code analyzes and generates a response
Performance
- Startup time: <100ms (no initialization required)
- Query latency: <50ms (pure in-memory operations)
- Storage space: 152KB (only chunks.json)
- Dependencies: 0 (pure Python standard library)
Troubleshooting
Problem: Cannot find query_simple.py
Solution:
# 重新安装 referee skill
npx skills add unnc-aim/aim-common-agentic-skills --skill dji-referee -g
Problem: Query results are inaccurate
Solution:
- Increase the number of returned results:
-n 5 - Use more specific query terms
- Query directly using the command code
allowed-tools
Bash(*)- Execute the query script