Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
zhinkgit avatar

Can

  • 450 installs
  • 534 repo stars
  • Updated June 29, 2026
  • zhinkgit/embeddedskills

can is an agent skill that automates CAN/CAN-FD interface scanning, monitoring, transmission, logging, and DBC decoding for embedded bus integration.

About

can is a Claude Code skill for embedded builders who need repeatable CAN and CAN-FD bus workflows without juggling disparate CLI tools. It wraps python-can and cantools behind agent-friendly operations: discover whether pcann, vector, slcan, or other backends are available; apply workspace-level bitrate and channel defaults from .embeddedskills/config.json; and run monitor, send, record, and decode tasks from natural language. Environment config keeps slcan serial port and baud rate separate from per-project interface choices, with a documented parameter priority so overrides behave predictably on the bench. Solo developers shipping automotive, robotics, or industrial firmware can use it during integration to validate frames against a DBC, capture reproducible logs for regressions, and inspect bus load before shipping hardware. It expects Python 3.x and vendor drivers where USB adapters require them, and it is not a replacement for full vehicle simulation or compliance certification tooling.

  • Scans system CAN interfaces and USB-CAN devices with optional slcan serial settings
  • Real-time bus monitor with ID filters, CAN-FD support, and DBC-backed decoding
  • Sends standard, extended, remote, and CAN-FD frames with periodic transmit and loopback
  • Logs traffic to ASC, BLF, or CSV under configurable log_dir
  • Decodes frames and logs using DBC, ARXML, or KCD plus bitrate and bus-load statistics

Can by the numbers

  • 450 all-time installs (skills.sh)
  • +25 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #432 of 2,715 Automation & Workflows skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/zhinkgit/embeddedskills --skill can

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs450
repo stars534
Security audit3 / 3 scanners passed
Last updatedJune 29, 2026
Repositoryzhinkgit/embeddedskills

What it does

Debug embedded CAN and CAN-FD buses from the agent: scan interfaces, monitor traffic, send frames, log ASC/BLF/CSV, and decode with DBC.

Who is it for?

Best when you're debugging on-bench CAN networks with PEAK, Vector, Kvaser, or slcan adapters.

Skip if: Skip if you only need high-level fleet telematics analytics with no direct bus access, or builds with zero Python tooling on the host.

When should I use this skill?

User needs CAN or CAN-FD bus scan, live monitor, framed send, ASC/BLF/CSV logging, or DBC/ARXML/KCD decoding on embedded hardware.

What you get

You get configured monitor/send/log sessions with decoded frames, saved ASC or BLF traces, and bus statistics aligned to your workspace CAN settings.

  • CAN monitor or send session commands and configs
  • Bus log files in ASC, BLF, or CSV format
  • Decoded frame interpretations and bus load summaries

By the numbers

  • Six documented capability areas: scan, monitor, send, log, decode, and bus statistics
  • Three configuration layers: slcan env config, workspace .embeddedskills/config.json, and runtime parameter priority

Files

SKILL.mdMarkdownGitHub ↗

CAN — 嵌入式 CAN / CAN-FD 调试工具

统一封装接口发现、实时监控、报文发送、日志记录、数据库文件解码和统计分析能力。

配置

环境级配置 (skill/config.json)

仅保留 slcan 相关的环境级配置:

{
  "slcan_serial_port": "",
  "slcan_serial_baudrate": 115200
}
字段说明默认值
slcan_serial_portslcan 场景的串口""
slcan_serial_baudrateslcan 场景的串口速率115200

工程级配置 (.embeddedskills/config.json)

工作区下的 .embeddedskills/config.json 存放工程级 CAN 配置:

{
  "can": {
    "interface": "",
    "channel": "",
    "bitrate": 500000,
    "data_bitrate": 2000000,
    "log_dir": ".embeddedskills/logs/can"
  }
}
字段说明默认值
interfaceCAN 后端,如 pcan / vector / slcan""
channel通道名,如 PCAN_USBBUS1""
bitrate仲裁域比特率500000
data_bitrateCAN-FD 数据域比特率2000000
log_dir日志输出目录.embeddedskills/logs/can

参数解析优先级

1. CLI 参数 (--interface, --channel, --bitrate 等) - 最高优先级 2. 工程级配置 (.embeddedskills/config.json 中的 can 部分) 3. 状态文件 (.embeddedskills/state.json 中的历史记录) 4. 默认值 - 最低优先级

自动扫描行为

当未指定 interfacechannel 时,脚本会自动扫描系统 CAN 接口,按以下步骤处理:

1. 扫描系统中所有可用 CAN 接口 2. 若只找到一个接口 → 自动使用并写入工程配置 3. 若找到多个接口 → 返回候选列表,等待用户选择 4. 若未找到接口 → 提示错误,停止执行

子命令

子命令用途风险
scan扫描可用 CAN 接口与 USB-CAN 设备
monitor实时监控总线报文
send发送标准帧 / 扩展帧 / 远程帧 / CAN-FD 帧
log记录总线报文到 ASC / BLF / CSV 文件
decode用 DBC 等数据库文件解码报文或日志
stats统计总线负载、ID 分布和帧率

执行流程

1. 检查 python-can 是否可用,未安装时提示 pip install python-can 2. 按优先级解析参数:CLI > 工程级配置 > 状态文件 > 默认值 3. 无子命令时默认执行 scan 4. monitor / send / log / stats 使用解析后的连接参数 5. decode 先确认数据库文件和输入源存在 6. 若未指定 interface/channel,自动扫描系统 CAN 接口:

  • 唯一候选:自动使用并写入工程配置
  • 多候选:返回列表让用户选择

7. 成功执行后,将确认的参数写回工程配置 8. send 只要配置可连接就直接执行,不二次确认 9. 运行对应脚本并输出结构化结果 10. 失败时优先反馈接口、驱动、比特率和过滤条件问题

脚本调用

所有脚本位于 skill 目录的 scripts/ 下,通过 python 直接调用。 脚本会按优先级从 CLI 参数、工程级配置、状态文件中读取参数。

# 扫描接口
python scripts/can_scan.py [--json]

# 实时监控
python scripts/can_monitor.py [--interface <接口>] [--channel <通道>] [--bitrate <速率>] [--fd] [--filter-id <ID列表>] [--exclude-id <ID列表>] [--dbc <DBC文件>] [--timeout <秒>] [--json]

# 发送报文
python scripts/can_send.py [--interface <接口>] [--channel <通道>] [--bitrate <速率>] <id> <data> [--extended] [--remote] [--fd] [--repeat <次>] [--interval <秒>] [--periodic <毫秒>] [--listen] [--json]

# 日志记录
python scripts/can_log.py [--interface <接口>] [--channel <通道>] [--bitrate <速率>] [--output <文件>] [--duration <秒>] [--max-count <数量>] [--filter-id <ID列表>] [--console] [--json]

# 数据库解码
python scripts/can_decode.py <db_file> [--db-format <auto|dbc|arxml|kcd|sym|cdd>] [--id <CAN_ID>] [--data <HEX数据>] [--log <日志文件>] [--signal <信号名>] [--list] [--json]

# 总线统计
python scripts/can_stats.py [--interface <接口>] [--channel <通道>] [--bitrate <速率>] [--duration <秒>] [--top <数量>] [--watch <ID列表>] [--json]

输出格式

单次命令返回标准 JSON:

{
  "status": "ok",
  "action": "scan",
  "summary": "发现 2 个 CAN 接口",
  "details": { ... }
}

持续命令(monitor --json、send --listen --json)输出 JSON Lines,结束摘要写入 stderr。

错误输出:

{
  "status": "error",
  "action": "send",
  "error": { "code": "interface_open_failed", "message": "无法打开指定 CAN 接口" }
}

核心规则

  • 不自动猜测 interface、channel、bitrate,多接口时不自动选择
  • 参数解析优先级:CLI > 工程级配置 > 状态文件 > 默认值;自动扫描结果仅在未提供 CLI 参数时生效
  • 未指定 interface/channel 时自动扫描,唯一候选自动写入配置,多候选需用户选择
  • 成功执行后,确认的参数自动写回 .embeddedskills/config.json
  • 未明确说明用途时不主动发送任何报文
  • --json 输出的持续流使用 JSON Lines,摘要写 stderr 不污染数据流
  • DBC 解码失败不应导致监控中断
  • 找不到帧定义时返回明确错误,不静默吞掉

参考

  • references/common_interfaces.json:常见 USB-CAN 设备信息

Related skills

How it compares

Skill-orchestrated python-can workflow, not a standalone desktop CAN analyzer replacement.

FAQ

Who is can for?

It is for embedded and automotive-oriented developers who already use Python and need agent-guided CAN bus debug on real hardware.

When should I use can?

Use it during Build integrations when scanning channels, watching live frames, regression-logging bus traffic, or validating signals against a DBC before Ship testing.

Is can safe to install?

Check the Security Audits panel on this Prism page; the skill drives local bus I/O and file logging, so confirm scripts only touch interfaces and paths you intend on lab machines.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.