跳到正文
Skillpedia
其他81k · #1607

cost-projection

它能做什么

这项技能根据你近期的每日用量速度,预测未来的 AI 支出。适合规划预算、想知道预算何时可能用完的人。

适用场景

  • ✓当你想知道下个月或明年的 AI 支出可能是多少时。
  • ✓当你在规划预算能维持多久时。
  • ✓当预算即将用完之前,你希望得到提醒时。

技能链接

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

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-cost-tracker/skills/cost-projection/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“按照我目前的速度,我的 AI 预算什么时候会用完?”

每周 5 个新技能,1 分钟读完。

工作原理

这项技能计算近期时间段内的平均每日支出,并将其按直线推算到每个时间段。如果设置了预算,它还会显示每一部分预算还需要多少天会被用完。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

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).

常见问题

预测结果准确吗?

不准确。这是根据近期用量做出的简单直线估算,用量变化会改变结果。

它能显示哪些时间段?

默认为 7、30、90 和 365 天,你也可以选择其他时间段。

“已达到”是什么意思?

它标记当前数据已经超过的预算阈值。

详情

作者的原始描述

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

热度

GitHub 星标
81k
排名
#1607
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能