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.
npx agentmods add commands/jzl-maker/ea-skill/testgit clone --depth 1 https://github.com/jzl-maker/EA-SKILLWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.01131 |
| Opus 5 | $0.00000 | $0.00566 |
| Sonnet 5 | $0.00000 | $0.00226 |
| Haiku 4.5 | $0.00000 | $0.00113 |
Grade A, and why
test 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.
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.
How it starts
The opening of the file, as written. The whole thing — 69 lines — stays where its author put it; the contents beside it link to each section on GitHub.
命令: /ea test (测试生成与执行)
功能
测试双产出:每个测试都生成「测试用例文档 + 可运行测试代码」。
unit:纯函数 host 单元测试(轻量自研:桩函数 + 断言 + main,零框架依赖)board:板级工装验收测试(用例文档 + 板载测试固件/驱动脚本)
触发
/ea test unit <文件> # 对指定 .c 文件的纯函数生成单测
/ea test unit <文件> <函数名> # 只测某个函数
/ea test board <功能描述> # 对功能/需求生成板级工装用例
单元测试(unit)
流程
- 【读 context】 确认工程上下文
- 【扫描目标】
tools/test-runner/scripts/test_gen.py unit <文件>提取函数签名,识别纯函数(无硬件外设调用) - 【生成双产出】 写入
<STATE_DIR>/tests/unit/:- 测试代码
<name>.c:桩函数(mockGPIO_SetBits/USART_SendData等硬件调用)+ 断言测试体 +mainrunner - 测试用例文档
<name>.md:用例ID / 输入 / 预期输出 / 覆盖点
- 测试代码
- 【host 编译运行】
--cc gcc直接编译运行(Windows 用 mingwgcc;也可用arm-none-eabi-gcc纯函数编译) - 【输出结果】 每个用例 PASS/FAIL;生成器产出骨架断言,AI 负责按需求核对输入/预期后再判
调用方式
python ~/.claude/skills/ea-skill/tools/test-runner/scripts/test_gen.py \
unit <目标.c> --cc gcc
# 产物: <STATE_DIR>/tests/unit/<name>.c + <name>.md
硬件耦合处理
- 目标函数直接调用硬件寄存器/外设库且无法桩化 → 提示「该逻辑适合板级测试」→ 走
board - 测试代码中桩函数与真实实现冲突时,用
#ifdef EA_TEST包裹被测模块
板级工装测试(board)
流程
- 【读 context】 芯片/外设/调试接口(串口端口、GPIO、J-Link)
- 【生成用例】 套
templates/board-test-templates.md模板库(上电/LED/按键/串口/外设响应/异常复位),写入<STATE_DIR>/tests/board/:- 用例文档
<case>.md:前置条件 / 操作步骤 / 预期结果 / 判定方法 - 测试代码:板载测试固件
<case>_test.c(调被测逻辑,结果按协议串口输出[TEST] PASS/FAIL)或 host 驱动脚本<case>_driver.py(用 serial/debug 工具自动执行 + 判定)
- 用例文档
- 【执行】 AI 驱动:
- 板载固件:编译→烧录→串口收集
[TEST]输出 - host 脚本:直接驱动 serial/debug 读结果/寄存器
- 板载固件:编译→烧录→串口收集
- 【判定】 按用例预期逐条判定,写入用例文档「实际结果」
输出示例(用例文档)
# 板级用例: 按键 KEY0 触发功能
- 前置: 上电,串口 COM5@115200
- 步骤: 按下 KEY0 → 观察串口输出
- 预期: 串口出现 `[KEY0] pressed`,LED 翻转
- 判定: 串口断言 + 物理观察 LED
设计原则
- ✅ 用例 + 代码双产出:文档给人看、代码给机器跑
- ✅ 零框架依赖:单测用 assert+桩,不引入第三方测试框架
- ✅ 板级贴近真实:工装用例用串口/调试接口做判定锚点
相关文件
tools/test-runner/scripts/test_gen.py— 测试生成器templates/unit-test-runner.c— 单测骨架模板templates/board-test-case.md— 板级用例模板templates/board-test-templates.md— 验收用例模板库commands/build.md/flash.md/serial.md/debug.md— 执行依赖
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.
- 2d ago First seen · 69 lines · 0 tokens per session scan A c744c1dd142f
test is a command published in the GitHub repository jzl-maker/EA-SKILL (6 stars, last pushed 5d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,131 tokens. 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-31.
Other commands, from other repositories
fix_board
Automatically diagnose and fix PlatformIO board upload/monitor issues.
expert_rmt5
ESP-IDF v5.x RMT5 API expert for LED protocols, encoders, and multi-channel control.
go-test
Go TDD workflow with table-driven tests.
esp-teach
One-time project setup -- discover hardware, find datasheets, persist context to CLAUDE.md.
esp-debug
Help debug ESP32 crashes, hangs, and peripheral issues.
comm-bus
You are a bus-driver-engineer agent using deep expertise across I2C, SPI, UART, CAN, and USB. Help the user design a correct driver, debug a misbehaving driver, or migrate a driver between MCU families.