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

cost-burn

它能做什么

这项技能按天查看你的 AI 支出变化,检查最近一天是否远高于之前的水平。适合关注费用是否突然上涨的人。

适用场景

  • ✓当你想知道 AI 费用是否在加速上涨时。
  • ✓当每日成本报告看起来高于正常水平,你想加以确认时。
  • ✓当你希望在涨幅超过设定百分比时收到自动提醒时。

技能链接

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

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

使用方法

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

可直接粘贴的消息

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

可以这样问 AI

“我每天的 AI 开支是否比以前涨得更快?”

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

工作原理

这项技能把过去的会话按天分组,将最近一天与之前各天的平均值进行比较,并报告以美元和百分比计的变化。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

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.
常见问题

它查看多长的时间段?

默认回溯 14 天,并按每天一组汇总支出。这两项设置都可以更改。

它能触发提醒吗?

可以。如果你设置了百分比上限,当最近一天超过该上限时,检查就会失败。

它与预算检查有什么不同?

预算检查看的是固定上限,而这项技能看的是支出变化的速度。

详情

作者的原始描述

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

热度

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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能