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

cost-burn

Skill này làm gì

Skill này xem chi tiêu AI của bạn theo thời gian, từng ngày, và kiểm tra xem ngày mới nhất có cao hơn nhiều so với trước không. Phù hợp với người theo dõi các đợt tăng chi phí đột ngột.

Khi nào nên dùng

  • ✓Khi bạn muốn biết chi phí AI có đang tăng nhanh hơn không.
  • ✓Khi một báo cáo chi phí hằng ngày cao hơn bình thường và bạn muốn xác nhận.
  • ✓Khi bạn muốn cảnh báo tự động nếu mức tăng vượt một tỷ lệ phần trăm đã đặt.

Liên kết skill

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

“Chi tiêu AI hằng ngày của tôi có đang tăng nhanh hơn trước đây không?”

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

Cách hoạt động

Skill xếp các phiên trước đó theo nhóm từng ngày, so sánh nhóm mới nhất với trung bình của những ngày trước và báo cáo thay đổi bằng đô la và phần trăm.

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.

Burn-rate trend observability. The fourth leg of the cost-tracker forward-cost stack:

Question Skill
"Have we crossed a threshold?" (reactive) cost-budget-check
"When will we cross a threshold?" (predictive) cost-projection
"Could we have spent less?" (comparative) cost-counterfactual
"Is daily burn ACCELERATING?" (trend) cost-burn ← this

Algorithm

Implementation: scripts/burn.mjs.

  1. Read all session-* records from cost-tracking namespace.
  2. Bin into --bucket duration windows (default 1d) over --lookback (default 14d).
  3. For each bucket: {n: sessions, spendUsd: sum(total_cost_usd)}.
  4. Compute delta = latest.spendUsd - mean(prior non-empty buckets).
  5. If --alert-on-acceleration-pct N is set: exit 1 when deltaPct > N.

Smoke transcript (5 days @ $0.10/day, today $0.50 — 400% acceleration)

| Latest bucket spend | $0.500000 (1 sessions) |
| Prior bucket mean | $0.100000 (4 non-empty buckets) |
| **Delta (latest vs prior mean)** | **+$0.400000 (400.00%)** |

# | Window                              | Sessions | Spend
0 | 2026-06-15 14:16 → 2026-06-16 14:16 | 1        | $0.500000
1 | 2026-06-14 14:16 → 2026-06-15 14:16 | 0        | $0.000000
2 | 2026-06-13 14:16 → 2026-06-14 14:16 | 1        | $0.100000
3 | 2026-06-12 14:16 → 2026-06-13 14:16 | 1        | $0.100000
...

Drift alert exit code

$ cost burn --bucket 1d --lookback 7d --alert-on-acceleration-pct 50 ⚠ ALERT: latest bucket $0.500000 is 400.0% above prior mean $0.100000 (threshold +50%) exit 1

$ cost burn --bucket 1d --lookback 7d --alert-on-acceleration-pct 500 ✓ latest bucket within +500% of prior mean (actual delta: 400.0%) — OK exit 0

CI integration

# Fail the build if today's spend accelerated > 100% over the weekly mean
cost burn --bucket 1d --lookback 7d --alert-on-acceleration-pct 100 || alert-oncall

The alert is independent of budget — it triggers on rate ACCELERATION even when total spend is well under budget. Catches "we shipped a hot loop that burns 10× normal" before the budget alarm goes off.

Distinct from cost-trend

Skill Data source Question
cost-trend docs/benchmarks/runs/*.json "Is the benchmark drifting (win rate, latency)?"
cost-burn cost-tracking namespace "Is production spend accelerating?"

Both useful; they answer different questions on different data.

Edge cases

  • Sparse history (no prior non-empty buckets): alert is SKIPPED with a reason string, exit 0. Operators don't get spurious alerts on cold-start.
  • Prior buckets all $0 but latest > $0: delta is Infinity/null in JSON, marked new in the table. No alert fires (no baseline to compare against).
  • --bucket > --lookback: hard error, exit 2.
Câu hỏi thường gặp

Nó xem xét khoảng thời gian nào?

Mặc định nó xem lại 14 ngày và gom chi tiêu thành các nhóm một ngày. Bạn có thể đổi cả hai cài đặt.

Nó có thể kích hoạt cảnh báo không?

Có. Nếu bạn đặt giới hạn phần trăm, kiểm tra sẽ thất bại khi ngày mới nhất vượt giới hạn đó.

Khác gì với kiểm tra ngân sách?

Kiểm tra ngân sách xem một giới hạn cố định. Skill này xem chi tiêu đang thay đổi nhanh đến mức nào.

Chi tiết

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

Burn-rate trend over time with optional drift-alert exit code. Bins session spend into buckets, surfaces window-over-window delta, and can exit 1 when latest bucket exceeds prior mean by a configurable %. Distinct from `cost-trend` (benchmark drift); this tracks PRODUCTION spend trajectory.

repo: ruvnet/ruflo

Độ phổ biến

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