cost-projection
できること
このスキルは、最近の1日あたりの支出から将来のAI支出を予測します。予算を計画していて、いつ使い切るかを知りたい人向けです。
使う場面
- ✓来月や来年のAI支出がどれくらいになるかを知りたいとき。
- ✓予算がどれくらい持つかを計画しているとき。
- ✓予算が使い切られる前に、警告がほしいとき。
スキルのリンク
https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-cost-tracker/skills/cost-projection/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“今のペースだと、AIの予算はいつ尽きますか?”
毎週5つの新しいスキル。1分で読めます。
仕組み
スキルは、直近の一定期間の1日あたりの平均支出を求め、それを各期間まで直線的に延長します。予算が設定されていれば、その各割合に達するまでの残り日数も示します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Forward-looking cost projection that pairs with cost-budget-check:
cost-budget-checkanswers "have we crossed the line?" — reactivecost-projectionanswers "when will we cross the line?" — predictive
Algorithm
- Read all
session-*records from thecost-trackingnamespace (same sourcecost-budget-checkuses). - Filter to a measurement window (default last 7 days on
capturedAt/startedAt). - Compute the per-day burn rate:
windowSpend / windowDays. - Linear-extrapolate to each requested horizon (default 7d/30d/90d/365d).
- If a budget is configured (
budget-configkey set bycost-budget set):- Compute "days until 75% / 90% / 100% consumed" at the current rate.
- Surface as a separate table block with
ALREADY REACHEDmarkers 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
コメント
- …
このリポジトリの他のスキル
agent-adaptive-coordinator
81k作業量の変化に合わせて、エージェントのグループを分割し、再配分する手助けをします。作業に合った配置を選びます。
agent-agent
81k大きな目標を順番に並んだ行動計画にし、状況が変わったときに計画を立て直す方法をエージェントに教えます。
agent-agentic-payments
81kAIの買い物のために、支出の上限、期間、販売店のルール、署名付きの承認を含む支出の委任を管理する手助けをします。
agent-analyze-code-quality
81kコードの品質を確認し、コードの臭い、技術的負債、リファクタリングの案を見つける手助けをします。ファイルは変更しません。