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.
git clone --depth 1 https://github.com/jzl-maker/EA-SKILLWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/jzl-maker/ea-skill/size)<a href="https://agentmods.dev/commands/jzl-maker/ea-skill/size"><img src="https://agentmods.dev/badge/commands/jzl-maker/ea-skill/size/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/jzl-maker/ea-skill/size"><img src="https://agentmods.dev/badge/commands/jzl-maker/ea-skill/size.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.01557 |
| Opus 5.5 | $0.00000 | $0.00623 |
| Sonnet 5.5 | $0.00000 | $0.00311 |
| Haiku 4.5 | $0.00000 | $0.00156 |
Grade A, and why
size 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 1mo 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 — 90 lines — stays where its author put it; the contents beside it link to each section on GitHub.
命令: /ea size (固件资源分析)
功能
解析 Keil 编译生成的 .map 文件,统计固件 Flash / RAM / 栈 / 堆 使用情况,并支持超限预警(使用率 ≥ warn 警告,≥ err 超限)。
| 能力 | 数据来源 | 说明 |
|---|---|---|
| Flash 用量 | Total ROM Size(Code + RO Data + RW Data) | 对比 Flash 容量出使用率 |
| RAM 用量 | Total RW Size(RW Data + ZI Data) | 对比 RAM 容量出使用率 |
| 栈/堆 | Global Symbols 里 STACK / HEAP Section | ⚠️ startup 定义的分配量,非运行期峰值 |
| 超限预警 | 使用率 vs --warn/--err 阈值 |
✅ 正常 / ⚠️ 偏高 / ❌ 超限 |
| 容量来源 | Execution Region 的 Max(链接脚本区域上限) |
--flash-kb/--ram-kb 可覆盖 |
适用:Keil MDK 工程(armcc v5 / armclang v6 的 .map 格式)。GCC/其他工具链暂不支持。
调用方式
py <SKILL>/tools/resource/scripts/size_tool.py --project <工程目录>
# 自动扫描工程下最新 .map → 输出 Flash/RAM 使用率 + 栈/堆 + 预警
# 显式指定 .map(编译产物在 Listings/ 或 build/ 下)
py .../size_tool.py --map build/xxx.map
# 覆盖容量 + 收紧阈值(芯片实际容量与链接脚本不一致时)
py .../size_tool.py --map build/xxx.map --flash-kb 512 --ram-kb 144 --warn 85 --err 92
# AI 解析用 JSON
py .../size_tool.py --map build/xxx.map --json
参数表
| 参数 | 必须 | 说明 |
|---|---|---|
--map <file> |
是(动作) | 显式指定 .map 文件 |
--project <dir> |
是(动作) | 工程目录,扫描最新 .map |
--flash-kb N |
否 | Flash 容量 KB(缺省用链接脚本 region Max) |
--ram-kb N |
否 | RAM 容量 KB(缺省用链接脚本 region Max) |
--warn |
否 | 预警阈值 %(默认 90) |
--err |
否 | 超限阈值 %(默认 95) |
--json |
否 | 结构化 JSON 输出 |
--dry-run |
否 | 只打印流程不解析 |
工作流程(AI 执行闭环)
1. 定位 .map --project 扫描,或 --map 显式指定(通常 Listings/ 或 build/ 下)
2. 容量确定 缺省 region Max;芯片手册容量与链接脚本不符时 --flash-kb/--ram-kb 覆盖
3. 读取总量 Flash = Total ROM,RAM = Total RW
4. 计算使用率 used/capacity × 100 → ✅/⚠️/❌
5. 栈/堆 STACK/HEAP 分配量(startup 定义)
6. 预警判断 任一 ≥ warn 提示,≥ err 标超限 → 结论(是否逼近容量上限)
示例闭环:/ea size --project . --flash-kb 512 --ram-kb 144 → Flash 21.8% ✅、RAM 50.4% ✅、栈 32KB → 判断固件内存余量充足。
注意事项
- 栈/堆是分配量:STACK/HEAP 是启动文件里定义的大小(本工具读 .map 符号值),不是运行期实际峰值。实际峰值栈用
/ea debug读 SP(__initial_sp - SP)测量。 - 容量缺省取链接脚本 region Max:
.sct里LOAD_REGION/RW_IRAM1的 Max 就是芯片可用量;若链接脚本人为缩小区域(如给 BootLoader 预留),Max 会小于芯片容量,此时用--flash-kb/--ram-kb覆盖成芯片真实值。 - ZI-data 计入 RAM:Total RW = RW Data + ZI Data(含 bss 未初始化段)。
- GBK 编码兼容:工程路径含中文时 .map 可能是 GBK 编码,解析器自动回退。
- ⚠️ Flash 口径与 Keil 面板可能差几百字节 —— 两个数都对,别当成 bug。
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.
- 1mo ago Changed f0cd40b605ce
- 1mo ago Changed · +12 lines 6c485928d06f
- 1mo ago Changed a31840f630a8
- 1mo ago First seen · 78 lines · 0 tokens per session scan A a81fcbfeb600
size is a command published in the GitHub repository jzl-maker/EA-SKILL (9 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,557 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
rtos
Design a FreeRTOS or Zephyr task structure with sized IPC, a priority inversion walk, stack budgets, and failure-mode timing.
cortex-m
Generate Cortex-M startup code or a linker script, configure a core subsystem, decode a fault, or add DWT timing.
debug-embedded
Attach a debugger, halt and inspect a target, decode fault registers, or configure ITM, SWO, or ETM trace.
embedded-linux
Generate a Yocto or Buildroot config, flashing commands, a kernel module skeleton, or on-target debug commands.
esp-teach
One-time project setup -- discover hardware, find datasheets, persist context to CLAUDE.md.
tapeout-check
Run the tapeout precheck gate on a design before submission.