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 skills/movebrickschi/harness-engineering-mcp/ai-efficiencynpx skills add movebrickschi/harness-engineering-mcp --skill ai-efficiencygit clone --depth 1 https://github.com/movebrickschi/harness-engineering-mcpWrote 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/skills/movebrickschi/harness-engineering-mcp/ai-efficiency)<a href="https://agentmods.dev/skills/movebrickschi/harness-engineering-mcp/ai-efficiency"><img src="https://agentmods.dev/badge/skills/movebrickschi/harness-engineering-mcp/ai-efficiency.svg" alt="Measured on agentmods" 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 | $0.00034 | $0.01745 |
| Opus 5 | $0.00017 | $0.00873 |
| Sonnet 5 | $0.00007 | $0.00349 |
| Haiku 4.5 | $0.00003 | $0.00175 |
Grade A, and why
ai-efficiency 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 4d 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 — 196 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AI Efficiency · 高效执行 & 省 Token 清单
使用本 skill 的场景:
- 任务规模 ≥ 3 个文件 / ≥ 50 行改动
- 多轮对话已经在 6 轮以上还没完成
- 用户/团队明确关心 token 成本
与
assets/spec/AI_EFFICIENCY.md是「契约 / 执行」对应关系——契约写规则,本 skill 是把规则翻译成当下就能照做的清单。
Phase 0 · 入场 30 秒自检
- 是不是 3 步以内的小事?是 → 直接做,不要拉 skill 链。
- 是不是已经有 plan?没有 → 先
writing-plans出最小计划,再动手。 - 是不是跨 ≥ 3 文件 / 跨模块?是 → 委派 subagent。
- 是不是已经发生过 ≥ 6 轮往返且没收敛?是 → 中止,回到 §6 模式切换。
Phase 1 · 检索(找到正确的几个位置)
1.1 工具优先级
Grep "确切字符串" > Glob "src/path/**/*.ts" > SemanticSearch "意图问句" > Read 全文
1.2 一次问对,少问多次
| 反模式 | 正确做法 |
|---|---|
Grep "user" (命中数百) |
Grep "class UserService " --type ts |
| 在 monorepo 找东西 | Grep ... --path packages/api/src |
| 不知道命中多少 | 先用 output_mode: "count" 看一次 |
1.3 并行批发
独立的 3 个 Grep / Read,一次性发出去:
batch:
Grep "patternA"
Grep "patternB"
Glob "src/**/types.ts"
Phase 2 · 阅读(用最少 token 拿到上下文)
2.1 切片不全读
小文件 < 200 行:直接 Read
中文件 200-800 行:Read offset/limit,分 2-3 段
大文件 > 800 行:先 Grep 定位,再 Read offset/limit
2.2 不重复粘贴
如果 L0(spec / rule)/ L1(项目配置)已经被加载过,不要在回复里复制其中段落。指向资源 URI 即可。
2.3 摘要替代原文
读完后用 1-2 句给主会话摘要,不要把原文塞回。
Phase 3 · 修改(让改动安全 & 可被 cache)
3.1 StrReplace 优先于重写
- 改 ≤ 3 处 → 用
StrReplace - 改 ≥ 整个函数 / 重大重构 → 用
Write重写单个文件 - 跨文件大改 → 拆成 N 次
StrReplace,每次原子
3.2 一次改一个语义单元
反模式:一个 StrReplace 把 Class A 拆成 A + B + C 三个文件
正确 :先 StrReplace 抽出 A 的接口;再 Write 新增 B;再 StrReplace 让 C 引用
每步都让代码处于可编译态,便于回退。
3.3 改完立刻验证
StrReplace → ReadLints → npm test --run (仅本文件相关测试) → 下一步
不要堆 10 个改动一起 commit,回滚成本巨大。
Phase 4 · 验证(最少跑测试拿到 PASS 证据)
4.1 跑被影响的子集
| 反模式 | 正确做法 |
|---|---|
每次都 npm test 全量 |
npm test -- --runRelatedTests src/foo.ts |
| Java 跑全模块 | mvn -pl module-x test |
Python pytest 全 |
pytest tests/test_foo.py -q |
4.2 只在最后做 harness check --strict --run-tests
任务收尾时一次全局门禁,不要每改一行跑一次。
4.3 失败 → root cause first
测试红了优先用 systematic-debugging skill 找根因,而不是「让我再调一下看看」式打补丁。
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.
- 4d ago First seen · 196 lines · 34 tokens per session scan A 21194db82268
ai-efficiency is a skill published in the GitHub repository movebrickschi/harness-engineering-mcp (2 stars, last pushed 3mo ago), licensed MIT. It adds 34 tokens to every session and 1,745 once invoked, about $0.0002 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-31.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.
auto-perf-optimize
Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.
chat-perf
Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.
chat-pet-sprite-creation
Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.
cpu-profile-analysis
Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…