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。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 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.
- Read all
session-*records fromcost-trackingnamespace. - Bin into
--bucketduration windows (default1d) over--lookback(default14d). - For each bucket:
{n: sessions, spendUsd: sum(total_cost_usd)}. - Compute
delta = latest.spendUsd - mean(prior non-empty buckets). - If
--alert-on-acceleration-pct Nis set: exit 1 whendeltaPct > 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/nullin JSON, markednewin 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
评论
- …
同一仓库的更多技能
agent-adaptive-coordinator
81k帮你的智能体在工作量变化时拆分和重新平衡一组 AI 智能体,并选择适合任务的分工方式。
agent-agent
81k教你的智能体把一个大目标拆成有顺序的行动计划,并在情况变化时重新规划。
agent-agentic-payments
81k帮你的智能体管理 AI 购物的消费授权,包括消费上限、时间窗口、商户规则和签名审批。
agent-analyze-code-quality
81k帮你的智能体检查代码质量,找出代码异味、技术债务和重构建议,且不改动文件。