← 返回 Skills 市场
tongli0406

UDS 诊断测试技能

作者 li-tong_aptiv · GitHub ↗ · v2.8.0 · MIT-0
cross-platform ⚠ suspicious
34
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install uds-diagnostic-test
功能描述
UDS 诊断测试技能。Use when: 收到诊断调查表、UDS diagnostic survey table、生成 UDS 测试脚本、基于诊断资料生成测试、执行 UDS 诊断测试、CAN 测试、DID 测试、DTC 测试、IOControl 测试、RoutineControl 测试、诊断服务测试、diagno...
使用说明 (SKILL.md)

UDS 诊断测试技能

目标

这个 skill 只解决三件事:

  1. 用固定 Python 环境解析调查表
  2. 生成并验证 UDS 测试脚本
  3. 在 SocketCAN 环境下执行测试

详细驱动安装、WSL2 USB 透传、SecurityAccess 替代方案、NRC 说明、调查表默认值参考,统一放在 README.md,不要在当前技能主流程里重复展开。

唯一规则

  • 唯一环境入口:先进入 skill 根目录,再执行 bash ./scripts/setup_env.sh
  • 唯一环境来源:~/.uds_env
  • 唯一 CAN 后端:SocketCAN(can0 / can1),不要使用 PCAN_*
  • 唯一正确包名:python-can,不要执行 pip install can
  • 环境修复默认只允许重跑 setup_env.sh;除非用户明确要求,否则不要手工执行 pip uninstall/install
  • 默认工作目录:$HOME/.uds_workspace

高频错误快查

现象 处理
Invalid CAN Bus Type - None 先修 Python 环境,不要先查硬件;先进入 skill 根目录,再执行 bash ./scripts/setup_env.sh
No module named 'can' / can.interfaces.socketcan 先进入 skill 根目录,再执行 bash ./scripts/setup_env.sh
pip 只能装出 can-0.0.0python-can 1.5.x 不要循环重装;这是包源/镜像问题。停止重试,把当前 pip 源异常报告给用户
装成 can-0.0.0 先重跑 bash ./scripts/setup_env.sh;如果脚本仍然报告 can-0.0.0python-can 1.5.x,停止重试并报告包源异常
No such interface: can0 / Network is down 执行 bash "$UDS_SKILL_DIR/scripts/can_init.sh"
Permission denied sudo 执行 can_init.sh
zipfile.BadZipFile 调查表文件损坏或加密,要求用户提供无密码文件
./scripts/setup_env.sh 不存在 / SKILL.md 缺失 技能目录不完整。不要手工补目录或补文件,重新获取完整的 uds-diagnostic-test 目录

会话初始化

每次开始任务前,只做这一段:

source ~/.uds_env 2>/dev/null || { echo "[ERROR] ~/.uds_env 不存在,请先进入 skill 根目录,再执行 bash ./scripts/setup_env.sh"; exit 1; }
PYTHON="$UDS_PYTHON"
SKILL_DIR="$UDS_SKILL_DIR"
UDS_WORK="${UDS_WORK:-$HOME/.uds_workspace}"
test -x "$PYTHON" || { echo "[ERROR] UDS_PYTHON 无效: $UDS_PYTHON"; exit 1; }
[ -f "$SKILL_DIR/SKILL.md" ] || { echo "[ERROR] UDS_SKILL_DIR 无效: $SKILL_DIR"; exit 1; }
mkdir -p "$UDS_WORK"

标准流程

1. 环境准备

前提:当前目录必须是包含 SKILL.mdscripts/uds-diagnostic-test 目录。

执行命令:

bash ./scripts/setup_env.sh

2. 解析调查表

source ~/.uds_env
PYTHON="$UDS_PYTHON"
SKILL_DIR="$UDS_SKILL_DIR"
UDS_WORK="${UDS_WORK:-$HOME/.uds_workspace}"
mkdir -p "$UDS_WORK"

"$PYTHON" "$SKILL_DIR/scripts/uds_survey_parser.py" \
  --input "\x3C调查表文件路径>" \
  --output "$UDS_WORK/uds_parsed.json"

然后读取 $UDS_WORK/uds_parsed.json,只检查这三项:

  • can_config
  • defaults_used
  • missing_attributes

如果 defaults_used 非空,必须展示给用户确认。 用表格给用户确认的内容只保留:TX/RX CAN ID、CAN FD、波特率/采样点、是否需要 $27、安全日志输出。

3. 生成脚本

source ~/.uds_env
PYTHON="$UDS_PYTHON"
SKILL_DIR="$UDS_SKILL_DIR"
UDS_WORK="${UDS_WORK:-$HOME/.uds_workspace}"

"$PYTHON" "$SKILL_DIR/scripts/uds_test_generator.py" \
  --input "$UDS_WORK/uds_parsed.json" \
  --output "$UDS_WORK/uds_test.py"

"$PYTHON" -m py_compile "$UDS_WORK/uds_test.py"

4. 初始化 CAN

Classic CAN:

source ~/.uds_env
bash "$UDS_SKILL_DIR/scripts/can_init.sh"

CAN FD:

source ~/.uds_env
bash "$UDS_SKILL_DIR/scripts/can_init.sh" --fd

5. 验证连接

source ~/.uds_env
PYTHON="$UDS_PYTHON"
UDS_WORK="${UDS_WORK:-$HOME/.uds_workspace}"

"$PYTHON" -c "import can, importlib.metadata as md; print('python-can', md.version('python-can'), '@', can.__file__)"
"$PYTHON" "$UDS_WORK/uds_test.py" --test-connection

6. 执行测试

source ~/.uds_env
PYTHON="$UDS_PYTHON"
UDS_WORK="${UDS_WORK:-$HOME/.uds_workspace}"

"$PYTHON" "$UDS_WORK/uds_test.py" \
  --report "$UDS_WORK/uds_report.md" \
  --can-log "$UDS_WORK/can_trace_$(date +%Y%m%d_%H%M%S).asc"

何时使用 pipeline

只有在用户明确要求“直接生成并执行,不需要中间确认”时,才使用:

source ~/.uds_env
PYTHON="$UDS_PYTHON"
SKILL_DIR="$UDS_SKILL_DIR"
UDS_WORK="${UDS_WORK:-$HOME/.uds_workspace}"

"$PYTHON" "$SKILL_DIR/scripts/uds_pcan_runner.py" pipeline \
  --input "\x3C调查表文件路径>" \
  --output-dir "$UDS_WORK/pipeline_output"

默认不要直接走 pipeline。默认流程始终是:解析 → 用户确认 → 生成 → 验证 → 执行。

详细资料

以下内容不要继续堆在当前技能主流程里,统一去 README.md

  • WSL2 USB 透传
  • 原生 Linux 驱动安装
  • SecurityAccess Linux 替代方案
  • NRC 0x78 / P2 / P2* 说明
  • 调查表属性默认值表
  • 深度 CAN 故障排查
  • Agent 在确认阶段如发现 DLL 路径以 .dll 结尾且运行在 Linux,必须主动告知用户此限制
安全使用建议
Install and run this only on an authorized test machine connected to a lab or bench ECU. Review the generated UDS script before execution, especially any reset, clear-DTC, write, IO-control, routine-control, or security-access steps. Do not enable passwordless sudo unless you understand and accept the persistent privilege change, and only load SeedKey DLL/shared libraries from trusted sources.
功能分析
Type: OpenClaw Skill Name: uds-diagnostic-test Version: 2.8.0 The skill bundle provides a comprehensive framework for UDS automotive diagnostics but contains several high-risk behaviors. Key indicators include the extensive use of 'sudo' in 'can_init.sh' and 'uds_test_generator.py' for system-level network and kernel configuration (e.g., ip link, modprobe, and fuser), which the README.md suggests automating via NOPASSWD sudoers entries. Furthermore, the skill follows a high-risk pattern where 'uds_test_generator.py' dynamically generates Python scripts that the agent is then instructed to execute. These generated scripts also utilize 'ctypes' to load external binary libraries (Vector SeedKey DLLs) for security access. While these capabilities are plausibly required for automotive testing, the combination of high-privilege shell access and dynamic code execution meets the threshold for a suspicious classification.
能力评估
Purpose & Capability
The UDS testing purpose is coherent, but the documented coverage includes ECU reset, clearing DTCs, writing identifiers, IO control, routine control, and DTC setting control, which can change or disrupt a real connected ECU.
Instruction Scope
The SKILL.md default flow includes a parse-to-confirm step and only uses pipeline mode on explicit request, which is good; however, it does not clearly require separate approval before generated tests perform mutating UDS services.
Install Mechanism
There is no registry install spec, but the skill provides manual setup scripts that create a Python venv, install dependencies, and README instructions that may build/install external CAN drivers.
Credentials
Privileged system operations are expected for SocketCAN setup, but the README also recommends persistent passwordless sudo rules for CAN-related root commands.
Persistence & Privilege
The skill writes persistent configuration and workspace files under the user's home directory, and the optional sudoers rule persists elevated command access beyond a single test run.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install uds-diagnostic-test
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /uds-diagnostic-test 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v2.8.0
原生 Linux SocketCAN 环境|支持 CAN FD|自动调查表解析
元数据
Slug uds-diagnostic-test
版本 2.8.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

UDS 诊断测试技能 是什么?

UDS 诊断测试技能。Use when: 收到诊断调查表、UDS diagnostic survey table、生成 UDS 测试脚本、基于诊断资料生成测试、执行 UDS 诊断测试、CAN 测试、DID 测试、DTC 测试、IOControl 测试、RoutineControl 测试、诊断服务测试、diagno... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 34 次。

如何安装 UDS 诊断测试技能?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install uds-diagnostic-test」即可一键安装,无需额外配置。

UDS 诊断测试技能 是免费的吗?

是的,UDS 诊断测试技能 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

UDS 诊断测试技能 支持哪些平台?

UDS 诊断测试技能 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 UDS 诊断测试技能?

由 li-tong_aptiv(@tongli0406)开发并维护,当前版本 v2.8.0。

💬 留言讨论