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

cost-projection

Skill này làm gì

Skill này dự đoán chi tiêu AI trong tương lai dựa trên mức chi hàng ngày gần đây của bạn. Nó dành cho người lập ngân sách và muốn biết khi nào có thể hết tiền.

Khi nào nên dùng

  • ✓Khi bạn muốn biết chi tiêu AI có thể là bao nhiêu trong tháng tới hoặc năm tới.
  • ✓Khi bạn đang lên kế hoạch xem ngân sách sẽ kéo dài bao lâu.
  • ✓Khi bạn muốn được cảnh báo trước khi ngân sách bị dùng hết.

Liên kết skill

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

“Với tốc độ hiện tại, bao lâu nữa ngân sách AI của tôi sẽ hết?”

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

Cách hoạt động

Skill tính mức chi trung bình mỗi ngày trong một khoảng gần đây rồi kéo dài theo đường thẳng đến từng mốc thời gian. Nếu có đặt ngân sách, nó cũng cho biết còn bao nhiêu ngày cho đến khi mỗi mức phần trăm ngân sách bị dùng hết.

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.

Forward-looking cost projection that pairs with cost-budget-check:

  • cost-budget-check answers "have we crossed the line?" — reactive
  • cost-projection answers "when will we cross the line?" — predictive

Algorithm

  1. Read all session-* records from the cost-tracking namespace (same source cost-budget-check uses).
  2. Filter to a measurement window (default last 7 days on capturedAt/startedAt).
  3. Compute the per-day burn rate: windowSpend / windowDays.
  4. Linear-extrapolate to each requested horizon (default 7d/30d/90d/365d).
  5. If a budget is configured (budget-config key set by cost-budget set):
    • Compute "days until 75% / 90% / 100% consumed" at the current rate.
    • Surface as a separate table block with ALREADY REACHED markers for thresholds already exceeded.

Flags

--window <duration> Measurement window. Nh|Nd|Nw|Nm. Default 7d. --horizons <csv> Projection horizons. Default 7d,30d,90d,365d. --format table|json Default table (markdown).

Env: PROJECTION_NAMESPACE override (default cost-tracking), PROJECTION_QUIET=1 (alias for --format json).

Smoke transcript (3 sessions × $1 over 7d, $20 budget)

| Sessions in window | 3 |
| Window spend | $3.000000 |
| **USD per day** | **$0.428571** |
| All-time spend | $3.000000 across 3 sessions |

## Projected spend (linear extrapolation)
| Horizon | Days | Projected spend |
|---|---:|---:|
| 7d | 7 | $3.0000 |
| 30d | 30 | $12.8571 |

## Budget exhaustion ($20.00 configured)
| Threshold | Target | Remaining | Time at current rate |
|---|---:|---:|---|
| 75% | $15.00 | $12.00 | 28.0 days |
| 90% | $18.00 | $15.00 | 35.0 days |
| 100% | $20.00 | $17.00 | 39.7 days |

When to use

  • Finance / SRE planning: hand the JSON output to a budget dashboard for "are we on track for the quarter?".
  • CI gates: cost-projection --format json | jq '.budget.exhaustion[2].daysUntilReached < 7' → fail builds when 100% exhaustion is < 1 week away.
  • Post-workload-shift sanity check: after a big feature lands, re-run to verify the rate hasn't accelerated past expectations.

Stationarity assumption

Linear extrapolation assumes the current rate holds. The footer reminds operators to re-run after workload shifts. For drift detection over MULTIPLE windows, pair with cost-trend (which already covers benchmark-drift).

Câu hỏi thường gặp

Dự báo có chính xác không?

Không. Đó là ước tính đường thẳng đơn giản từ mức dùng gần đây, nên thay đổi trong cách dùng sẽ làm kết quả thay đổi.

Skill có thể hiển thị những khoảng thời gian nào?

Mặc định là 7, 30, 90 và 365 ngày, và bạn có thể chọn khoảng khác.

Đã đạt nghĩa là gì?

Nó đánh dấu một mốc ngân sách mà dữ liệu hiện tại đã vượt qua.

Chi tiết

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

Forward-looking spend extrapolation. Computes a USD-per-day rate from the recent measurement window, projects to 7d/30d/90d/365d horizons, and surfaces "days until budget exhausted" when a budget is configured. Predictive counterpart to `cost-budget-check` (reactive).

repo: ruvnet/ruflo

Độ phổ biến

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