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/sizegit 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.01336 |
| Opus 5 | $0.00000 | $0.00668 |
| Sonnet 5 | $0.00000 | $0.00267 |
| Haiku 4.5 | $0.00000 | $0.00134 |
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 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 — 78 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 ~/.claude/skills/ea-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 编码,解析器自动回退。
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 · 78 lines · 0 tokens per session scan A a81fcbfeb600
size 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,336 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
icpg-bootstrap
Infer ReasonNodes from existing git commit history. One-time setup for existing codebases.
version
Display current guide and Claude Code versions.
go-review
Go code review for idiomatic patterns.
review-branch
Review the current branch's diff against base by dispatching atomic-reviewer. No orchestration loop, no spec required — pre-flight before /commit pr or /commit merge.
execute
Executa o plano aprovado em .first-plan/07-state/plans/. Segue o plano à risca, para se algo invalidar premissa, gera relatório ao final.
dispatcher
Pick the next-best repo to work on across the portfolio — rank free repos, recommend one, claim its lease atomically, and route to the entry command.