serial

A tool for communicating with devices over serial ports, such as USB-to-UART connections. It can find ports, watch incoming data, send messages, save logs, and display raw bytes in hexadecimal form.

In plain words
What is it for?
Use it to monitor microcontroller output, send AT commands, record serial sessions, inspect binary protocols, and check which serial ports are available.
Why use it?
It avoids switching between separate terminal and logging tools when diagnosing device output or testing commands. It also helps handle serial settings such as baud rate, data bits, parity, and stop bits.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/zhinkgit/embeddedskills/serial
Any agent
npx skills add zhinkgit/embeddedskills --skill serial
Clone the repo
git clone --depth 1 https://github.com/zhinkgit/embeddedskills

Made for: Claude Code, Codex.

Per session 137 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,486 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00137 $0.02486
Opus 5 $0.00068 $0.01243
Sonnet 5 $0.00027 $0.00497
Haiku 4.5 $0.00014 $0.00249

Measured 2d ago against content hash beb7cdcaf3a2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

serial scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

The scan reads SKILL.md. This mod also ships 7 executable files (scripts/serial_hex.py, scripts/serial_log.py, scripts/serial_monitor.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

serial/SKILL.md · 219 lines

How it starts

The opening of the file, as written. The whole thing — 219 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Serial — 嵌入式串口调试工具

统一封装端口发现、实时监控、数据发送、日志记录和 Hex 查看能力。

配置

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

serial skill 的环境级配置目前为空对象 {},因为串口参数属于工程级配置,统一在工作区的 .embeddedskills/config.json 中管理。

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

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

{
  "serial": {
    "port": "",
    "baudrate": 115200,
    "bytesize": 8,
    "parity": "none",
    "stopbits": 1,
    "encoding": "utf-8",
    "timeout_sec": 1.0,
    "log_dir": ".embeddedskills/logs/serial"
  }
}
字段 说明 默认值
port 串口号,如 COM3 ""
baudrate 波特率 115200
bytesize 数据位 8
parity 校验位:none/even/odd/mark/space none
stopbits 停止位:1/1.5/2 1
encoding 文本编码 utf-8
timeout_sec 读写超时(秒) 1.0
log_dir 日志输出目录 .embeddedskills/logs/serial

参数解析优先级

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

自动扫描行为

当未指定 port 时,脚本会自动扫描系统串口:

  • 若只找到一个串口,自动使用该端口并写入工程配置
  • 若找到多个串口,返回候选列表让用户选择(通过 --port 指定)
  • 若未找到串口,提示错误

子命令

子命令 用途 风险
scan 扫描可用串口
monitor 实时查看文本输出
send 发送文本或 Hex 数据
hex 实时查看二进制流
log 保存串口日志到文件

执行流程

  1. 检查 pyserial 是否可用,未安装时提示 pip install pyserial
  2. 按优先级解析参数:CLI > 工程级配置 > 状态文件 > 默认值
  3. 无子命令时默认执行 scan
  4. monitor / send / hex / log 使用解析后的连接参数
  5. 若未指定 port,自动扫描系统串口:
    • 唯一候选:自动使用并写入工程配置
    • 多候选:返回列表让用户选择
  6. 成功执行后,将确认的参数写回工程配置
  7. 运行对应脚本并输出结构化结果
  8. 失败时优先反馈端口占用、驱动、波特率和编码问题

脚本调用

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

# 扫描串口
python scripts/serial_scan.py [--filter <关键词>] [--json]

# 实时监控
python scripts/serial_monitor.py [--port <串口>] [--baudrate <波特率>] [--timestamp] [--filter <regex>] [--timeout <秒>] [--json]

# 发送数据
python scripts/serial_send.py [--port <串口>] [--baudrate <波特率>] <data> [--hex] [--crlf] [--repeat <次>] [--wait-response] [--json]

# Hex 查看
python scripts/serial_hex.py [--port <串口>] [--baudrate <波特率>] [--width <列>] [--timeout <秒>] [--json]

# 日志记录
python scripts/serial_log.py [--port <串口>] [--baudrate <波特率>] [--output <文件>] [--duration <秒>] [--format text|csv|json] [--json]

Read the full file on GitHub · 219 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 219 lines · 137 tokens per session scan A beb7cdcaf3a2

Subscribe to this mod's changes

serial is a skill published in the GitHub repository zhinkgit/embeddedskills (610 stars, last pushed 13d ago), licensed MIT. It adds 137 tokens to every session and 2,486 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

browser-qa

Use when you need lightweight browser QA for a web page, local HTML file, or app: inspect console errors, broken assets, keyboard/focus behavior, viewport readability, and publish evidence-backed findings JSON through a local HTML report viewer.

liatrio-labs/ai-prompts · 51 tokens

mastra-api

Interact with Mastra development server API for debugging agents, viewing conversation threads, listing/inspecting tools and workflows, accessing observability data, and managing Mastra resources. Use when working with Mastra agents and need to inspect runtime state, debug agent errors, view thread history, see…

liatrio-labs/ai-prompts · 80 tokens

create-mermaid-diagrams

Create, validate, and repair Mermaid diagrams for technical documentation with a deterministic CLI feedback loop. Use when an AI needs to create Mermaid diagrams, improve Mermaid diagram quality, validate Mermaid fences in markdown, diagnose Mermaid rendering failures, or fix Mermaid syntax and formatting issues.

liatrio-labs/ai-prompts · 58 tokens

create-pull-request

Generate a reviewer-ready pull request or merge request title and description from branch changes. Use when a user asks to draft PR/MR content, summarize branch deltas against a base branch, or optionally create the PR with gh/glab after approval.

liatrio-labs/ai-prompts · 54 tokens

tilt-dev

Manage local development environments with Tilt. Use when working with projects that run services via Tilt (indicated by presence of Tiltfile), including checking service status, viewing logs, troubleshooting connectivity issues, or managing the Tilt stack. Essential for projects using Tiltfile with localresource for…

liatrio-labs/ai-prompts · 68 tokens

uv-usage

Provides concise guidance for using uv (Python package manager), including project workflows, pip-compatible commands, Python version management, and PEP 723 inline script dependencies. Use when users mention uv, uv run, inline dependencies, PEP 723, or Python dependency/project management.

liatrio-labs/ai-prompts · 59 tokens