Chuyển đến nội dung
Skillpedia
Khác81k · #1594

cost-budget-check

Skill này làm gì

Skill này đọc chi tiêu AI đã ghi lại và so sánh với ngân sách bạn đặt. Phù hợp với người muốn được cảnh báo rõ ràng trước khi vượt giới hạn.

Khi nào nên dùng

  • ✓Khi bạn muốn biết còn bao nhiêu ngân sách AI.
  • ✓Khi bạn sắp bắt đầu một loạt tác vụ AI lớn và muốn kiểm tra an toàn trước.
  • ✓Khi bạn muốn một kiểm tra lặp lại chạy theo lịch.

Liên kết skill

https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-cost-tracker/skills/cost-budget-check/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-budget-check/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

“Tôi đã dùng bao nhiêu ngân sách AI cho đến giờ?”

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

Cách hoạt động

Skill cộng chi phí các phiên đã ghi, chia tổng cho ngân sách bạn đặt và hiển thị mức cảnh báo. Ở 100 phần trăm, nó trả về mã lỗi để các script có thể dừng an toà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 Budget Check

Reads cost-tracking:budget-config for the project's budget limit, sums total_cost_usd across session-* records produced by cost-track, computes utilization, and emits the measured 4-tier alert ladder (50% INFO / 75% WARNING / 90% CRITICAL / 100% HARD_STOP).

Until P2 (this skill) landed, the README documented the alert ladder but no code checked it. Now this skill is the gate.

When to use

  • After every cost-track run, to surface the alert level.
  • Before spawning a swarm — if utilization ≥ 90%, escalate to /cost-optimize first.
  • Cron-friendly via /loop 30m for continuous monitoring.

Steps

  1. Run the check:

    node plugins/ruflo-cost-tracker/scripts/budget.mjs check
    

    Filter by period: BUDGET_PERIOD=today (default all). Use BUDGET_QUIET=1 for machine-readable JSON.

  2. Inspect the markdown summary — budget, spent, remaining, utilization percentage, alert level (🟢 OK · 🟡 INFO · 🟠 WARNING · 🔴 CRITICAL · 🛑 HARD_STOP), and the recommended action.

  3. Set / inspect the budget:

    node plugins/ruflo-cost-tracker/scripts/budget.mjs set 50.00
    node plugins/ruflo-cost-tracker/scripts/budget.mjs get
    
  4. HARD_STOP path — budget.mjs check exits with code 1 when utilization ≥ 100%. Wrap critical agent spawns in a budget.mjs check && spawn … guard to fail closed.

Storage shape (cost-tracking:budget-config)

{
  "budget_usd": 50.00,
  "setAt": "2026-05-05T...",
  "thresholds": { "info": 0.50, "warning": 0.75, "critical": 0.90, "hard_stop": 1.00 }
}

Alert ladder (from REFERENCE.md, now enforced)

Threshold Level Action
50% INFO 🟡 log notification, no UX disruption
75% WARNING 🟠 display warning, suggest /cost-optimize
90% CRITICAL 🔴 urgent alert, recommend model downgrades
100% HARD_STOP 🛑 halt non-essential spawns; exit code 1

Cross-references

  • cost-track (producer) — populates cost-tracking:session-*
  • cost-report — same data source, narrative format
  • cost-optimize — recommended action when WARNING/CRITICAL
  • REFERENCE.md "Budget alert thresholds" — the documented ladder this enforces
Câu hỏi thường gặp

Tôi đặt ngân sách như thế nào?

Bạn chạy lệnh đặt ngân sách với số tiền tính bằng đô la. Skill cũng có thể hiển thị ngân sách hiện tại.

Các mức cảnh báo có nghĩa là gì?

Các mức là info ở 50 phần trăm, warning ở 75, critical ở 90 và hard stop ở 100, mỗi mức kèm một hành động gợi ý.

Tôi có thể chỉ kiểm tra chi tiêu hôm nay không?

Có. Đặt khoảng thời gian là hôm nay sẽ giới hạn kiểm tra vào các bản ghi trong ngày.

Chi tiết

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

Read accumulated cost-tracking spend + budget config, compute utilization, emit 50/75/90/100% alert ladder

repo: ruvnet/ruflo

Độ phổ biến

Sao GitHub
81k
Vị trí xếp hạng
#1594
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ự