cost-booster-edit
它能做什么
这项技能使用快速的本地引擎,而不是 AI 模型,来进行简单、可重复的代码编辑。适合需要在大量文件中做同样小改动的开发者。
适用场景
- ✓当你需要在多个文件中做同样的简单修改,例如把 var 替换为 const 时。
- ✓当你希望获得不依赖 AI 推理的可预测编辑结果时。
- ✓当你运行自动化流程,并希望在简单编辑上避免支付 AI 调用费用时。
技能链接
https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-cost-tracker/skills/cost-booster-edit/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请不使用 AI,把这些文件里的每个 var 都改成 const。”
每周 5 个新技能,1 分钟读完。
工作原理
这项技能把文件和所选的编辑类型发送给快速的本地转换引擎。它返回修改后的代码,相同输入每次都得到相同结果。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Cost Booster Edit
Direct wrapper around agent-booster.apply() (npm agent-booster v0.2.x, exposed via agentic-flow/agent-booster). Use when a transform is already classified as Tier 1 eligible — cost-booster-route recommends whether; this skill executes.
When to use
- Bulk transforms across many files (
var → const,add-types,remove-console,add-error-handling,async-await,add-logging). - Any simple, structural edit where an LLM would otherwise be called and billed.
- Inside CI pipelines where determinism + zero-cost matter more than naturalness.
Do NOT use when the transform requires reasoning about intent, naming, or cross-file context — those are Tier 2/3 jobs.
Steps
Take inputs —
intent(one of the 6 booster intents) andfilepath.Read the source to a variable, derive the intended
edittext from the intent (caller supplies).Invoke — run from anywhere under
v3/soagent-boosterresolves:node --input-type=module -e ' import("agent-booster") .then(async ({ AgentBooster }) => { const booster = new AgentBooster(); const r = await booster.apply({ code: process.argv[1], edit: process.argv[2], language: process.argv[3] || "javascript", }); console.log(JSON.stringify({ success: r.success, output: r.output, latency: r.latency, confidence: r.confidence, strategy: r.strategy, tokens: r.tokens, })); }) .catch(e => console.log(JSON.stringify({ success: false, error: String(e.message) }))); ' -- "$CODE" "$EDIT" "$LANG"Check confidence — default threshold is
0.5. Below that, fail closed: do NOT write the file; report and escalate to Tier 2/3.Write back the
outputfield ifsuccess && confidence >= 0.5.Persist outcome —
memory_store --namespace cost-tracking --key "booster-edit-..." --value '{"intent":..., "latency":..., "confidence":..., "strategy":..., "applied":true}'. Feed the routing learner viahooks_model-outcome(use thecost-optimizeskill's step 8).
Measured benchmark (2026-05-04, this checkout)
5 representative intents run through AgentBooster.apply():
| intent | latency (ms) | wall (ms) | confidence | strategy | success |
|---|---|---|---|---|---|
| var-to-const | 5 | 5 | 0.65 | fuzzy_replace | true |
| add-types | 1 | 1 | 0.64 | fuzzy_replace | true |
| remove-console | 0 | 0 | 0.70 | fuzzy_replace | true |
| add-error-handling | 0 | 0 | 0.85 | exact_replace | true |
| async-await | 0 | 0 | 0.85 | exact_replace | true |
Avg measured latency ≈ 1.2 ms. All 5 above the default 0.5 confidence threshold. See docs/benchmarks/0002-baseline.md for the LLM-baseline comparison.
What's verified locally
| Claim | Status here |
|---|---|
| 100% win rate | Verified — 12/12 on bench/booster-corpus.json (see runs/latest.json). Booster AND Gemini 2.0 Flash both score 12/12 — this is a structural-correctness corpus, not a hard adversarial one. |
| Sub-millisecond latency | Verified — avg 0.67 ms, p50 0 ms, p99 6 ms, max 6 ms. |
| $0 per edit | Verified structurally — no API call, no token billing. |
| Deterministic AST-based merge | Verified — same inputs reproduce the same output and strategy. |
| Confidence ≥ 0.5 ⇒ correct | Verified on this corpus — 12/12 above 0.5 (min 0.551), all correct. |
350× speedup vs. LLM |
Verified — exceeded against every tier: 1000.9× vs Gemini 2.0 Flash, 1838.7× vs Claude Sonnet 4.6, 2634.1× vs Claude Opus 4.7. Run BENCH_LLM_BASELINE=1 BENCH_ANTHROPIC=1 node scripts/bench.mjs to refresh. |
| Cost saved per edit | Measured: $0.000020 vs Gemini, $0.000722 vs Sonnet 4.6, $0.004720 vs Opus 4.7 (the booster side is $0 in all cases). |
| Win parity with frontier LLMs | Verified — Booster, |
常见问题
它支持哪些编辑?
来源列出了六种内置类型:var 改为 const、添加类型、删除 console.log、添加错误处理、async-await,以及添加日志。
什么时候不应该使用它?
对于需要理解意图、命名或其他文件的修改,请不要使用它。这类工作需要 AI 模型。
它需要花钱吗?
不需要调用 AI,因此转换本身没有模型费用。
详情
作者的原始描述
Apply a simple code transform via agent-booster's WASM engine — sub-millisecond, deterministic, $0 (no LLM call). Companion to cost-booster-route.
repo: ruvnet/ruflo
热度
- GitHub 星标
- 81k
- 排名
- #1592
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
agent-adaptive-coordinator
81k帮你的智能体在工作量变化时拆分和重新平衡一组 AI 智能体,并选择适合任务的分工方式。
agent-agent
81k教你的智能体把一个大目标拆成有顺序的行动计划,并在情况变化时重新规划。
agent-agentic-payments
81k帮你的智能体管理 AI 购物的消费授权,包括消费上限、时间窗口、商户规则和签名审批。
agent-analyze-code-quality
81k帮你的智能体检查代码质量,找出代码异味、技术债务和重构建议,且不改动文件。