cost-budget-check
できること
このスキルは、記録されたAIの支出を読み取り、設定した予算と比べます。上限を超える前に、明確な警告がほしい人向けです。
使う場面
- ✓AIの予算がどれくらい残っているか知りたいとき。
- ✓大量のAIタスクを始める前に、安全確認をしたいとき。
- ✓スケジュールに従って定期的に確認を繰り返したいとき。
スキルのリンク
https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-cost-tracker/skills/cost-budget-check/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“これまでにAIの予算をどれくらい使ったか教えてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
スキルは、記録されたセッションのコストを合計し、その合計を設定した予算で割って、警告レベルを表示します。100%に達すると、スクリプトが安全に止まれるように、エラーコードを返します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Cost Budget Check
Reads cost-tracking:budget-config for the project's budget limit, sums total_cost_usd across session-* records produced by cost-track, computes utilization, and emits the measured 4-tier alert ladder (50% INFO / 75% WARNING / 90% CRITICAL / 100% HARD_STOP).
Until P2 (this skill) landed, the README documented the alert ladder but no code checked it. Now this skill is the gate.
When to use
- After every cost-track run, to surface the alert level.
- Before spawning a swarm — if utilization ≥ 90%, escalate to
/cost-optimizefirst. - Cron-friendly via
/loop 30mfor continuous monitoring.
Steps
Run the check:
node plugins/ruflo-cost-tracker/scripts/budget.mjs checkFilter by period:
BUDGET_PERIOD=today(defaultall). UseBUDGET_QUIET=1for machine-readable JSON.Inspect the markdown summary — budget, spent, remaining, utilization percentage, alert level (🟢 OK · 🟡 INFO · 🟠 WARNING · 🔴 CRITICAL · 🛑 HARD_STOP), and the recommended action.
Set / inspect the budget:
node plugins/ruflo-cost-tracker/scripts/budget.mjs set 50.00 node plugins/ruflo-cost-tracker/scripts/budget.mjs getHARD_STOP path —
budget.mjs checkexits with code1when utilization ≥ 100%. Wrap critical agent spawns in abudget.mjs check && spawn …guard to fail closed.
Storage shape (cost-tracking:budget-config)
{
"budget_usd": 50.00,
"setAt": "2026-05-05T...",
"thresholds": { "info": 0.50, "warning": 0.75, "critical": 0.90, "hard_stop": 1.00 }
}
Alert ladder (from REFERENCE.md, now enforced)
| Threshold | Level | Action |
|---|---|---|
| 50% | INFO 🟡 | log notification, no UX disruption |
| 75% | WARNING 🟠 | display warning, suggest /cost-optimize |
| 90% | CRITICAL 🔴 | urgent alert, recommend model downgrades |
| 100% | HARD_STOP 🛑 | halt non-essential spawns; exit code 1 |
Cross-references
cost-track(producer) — populatescost-tracking:session-*cost-report— same data source, narrative formatcost-optimize— recommended action when WARNING/CRITICAL- REFERENCE.md "Budget alert thresholds" — the documented ladder this enforces
よくある質問
予算はどのように設定しますか?
金額をドルで指定して、予算設定コマンドを実行します。スキルは現在の予算を表示することもできます。
警告レベルは何を意味しますか?
50%で情報、75%で警告、90%で重大、100%で強制停止です。それぞれに推奨の対応が付いています。
今日の支出だけを確認できますか?
はい。期間を今日に設定すると、確認は今日の記録だけに限られます。
詳細
作者による元の説明
Read accumulated cost-tracking spend + budget config, compute utilization, emit 50/75/90/100% alert ladder
repo: ruvnet/ruflo
人気
- GitHubのスター
- 81k
- ランキング
- #1594
- ライセンス
- MIT
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
agent-adaptive-coordinator
81k作業量の変化に合わせて、エージェントのグループを分割し、再配分する手助けをします。作業に合った配置を選びます。
agent-agent
81k大きな目標を順番に並んだ行動計画にし、状況が変わったときに計画を立て直す方法をエージェントに教えます。
agent-agentic-payments
81kAIの買い物のために、支出の上限、期間、販売店のルール、署名付きの承認を含む支出の委任を管理する手助けをします。
agent-analyze-code-quality
81kコードの品質を確認し、コードの臭い、技術的負債、リファクタリングの案を見つける手助けをします。ファイルは変更しません。