Chuyển đến nội dung
Skillpedia
Lập trình chung81k · #1592

cost-booster-edit

Skill này làm gì

Skill này áp dụng các chỉnh sửa mã đơn giản, lặp lại được bằng một bộ máy cục bộ nhanh thay vì mô hình AI. Phù hợp với lập trình viên cần cùng một thay đổi nhỏ được áp dụng cho nhiều file.

Khi nào nên dùng

  • ✓Khi bạn cần cùng một thay đổi đơn giản trên nhiều file, như thay var bằng const.
  • ✓Khi bạn muốn một chỉnh sửa có thể dự đoán và không phụ thuộc vào suy luận của AI.
  • ✓Khi bạn chạy một pipeline tự động và muốn không trả tiền cho các lệnh gọi AI với chỉnh sửa đơn giản.

Liên kết skill

https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-cost-tracker/skills/cost-booster-edit/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-cost-tracker/skills/cost-booster-edit/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Làm ơn đổi mọi var thành const trong các file này cho tôi, mà không dùng AI.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Skill gửi file và loại chỉnh sửa đã chọn đến một bộ máy biến đổi cục bộ nhanh. Nó trả về mã đã thay đổi, và cùng một đầu vào cho cùng một kết quả mỗi lần.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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

  1. Take inputs — intent (one of the 6 booster intents) and file path.

  2. Read the source to a variable, derive the intended edit text from the intent (caller supplies).

  3. Invoke — run from anywhere under v3/ so agent-booster resolves:

    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"
    
  4. Check confidence — default threshold is 0.5. Below that, fail closed: do NOT write the file; report and escalate to Tier 2/3.

  5. Write back the output field if success && confidence >= 0.5.

  6. Persist outcome — memory_store --namespace cost-tracking --key "booster-edit-..." --value '{"intent":..., "latency":..., "confidence":..., "strategy":..., "applied":true}'. Feed the routing learner via hooks_model-outcome (use the cost-optimize skill'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,
Câu hỏi thường gặp

Nó hỗ trợ những chỉnh sửa nào?

Nguồn liệt kê sáu loại có sẵn: var sang const, thêm kiểu, xóa console log, thêm xử lý lỗi, async-await và thêm ghi nhật ký.

Khi nào tôi không nên dùng nó?

Đừng dùng cho các thay đổi cần hiểu ý định, đặt tên hoặc các file khác. Những việc đó cần một mô hình AI.

Nó có tốn tiền không?

Không có lệnh gọi AI nào được thực hiện, nên bản thân việc biến đổi không tốn chi phí mô hình.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
81k
Vị trí xếp hạng
#1592
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự