cost-health
What it does
This skill runs four AI cost checks together and gives one combined pass or fail result. It is for teams who want a single cost gate in an automated pipeline.
When to use it
- βWhen you want one cost check to run in a continuous integration step.
- βWhen you want a single health result covering budget, trend, outliers and forecast.
- βWhen you want a build to fail if AI costs look unhealthy.
Skill link
https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-cost-tracker/skills/cost-health/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βGive me one overall cost health check for my AI spending.β
5 new skills a week. 1 minute to read.
How it works
The skill starts the budget, burn, outlier and projection checks at the same time. It returns the highest error code among them and prints a short summary for each one.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
The four CI-gate skills (budget / burn / anomaly / projection) each answer
a different question. This skill composes them β runs all four IN PARALLEL,
returns max(exit_codes), prints a one-line summary per check.
| Subcheck | Question | Default threshold |
|---|---|---|
budget |
"Have we crossed the configured budget?" | HARD_STOP at 100% |
burn |
"Is daily burn accelerating?" | +100% vs prior-week mean |
anomaly |
"Is any specific session a >3.5Ο outlier?" | β₯1 outlier |
projection |
"When will we hit 100% of budget?" | <14 days |
Algorithm
Implementation: scripts/health.mjs.
- Spawn all four subcheck scripts in parallel (
Promise.alloverchild_process.spawn). - Each subcheck emits
--format json; parse and capture exit code. - Projection has no built-in exit code β synthesize one from
daysUntilReached[100%] < --alert-days-to-exhaust. - Final exit code =
max(subcheck exits). Any single failure fails the gate. - Print one-line summary per check + overall HEALTHY/UNHEALTHY badge.
CI integration
- name: Cost health gate
run: cost health --alert-acceleration 100 --alert-outliers 1
A single step covers four alert ladders. Before this skill you'd wire four separate gates that each duplicated the npx + memory-list overhead; now it's one shell-out (and the four subcheck npx calls run in parallel internally).
Customizing thresholds
# Quarterly review β stricter thresholds
cost health --alert-acceleration 50 --alert-outliers 1 --alert-days-to-exhaust 30
# Production drift gate β only fire on egregious changes
cost health --alert-acceleration 200 --alert-outliers 3 --alert-days-to-exhaust 7
# Skip the slow burn check during a smoke run
cost health --skip burn
Smoke transcript (5 healthy sessions, then add 1 outlier)
# Healthy
Overall: β HEALTHY (max exit code 0)
| Check | Status | Detail |
| budget | β | unknown β no budget configured |
| burn | β | delta within Β±100% |
| anomaly | β | 0 outliers β under threshold β₯1 |
| projection | β | no budget configured β skipping |
# After adding $5 outlier (vs $0.10 baseline)
Overall: β UNHEALTHY (max exit code 1)
| burn | β | ALERT 5163.2% acceleration: latest bucket $5.00 is 5163.2% above prior mean $0.095 |
| anomaly | β | ALERT 1 outlier (|z|>3.5) |
Skipping subchecks
cost health --skip burn,projection # only budget + anomaly
Useful when:
- A subcheck doesn't apply (no budget set β skip projection)
- A subcheck is too slow for fast-feedback contexts (smoke runs)
- A subcheck is being independently CI-gated already
Exit code semantics
| Exit | Meaning |
|---|---|
| 0 | All subchecks OK |
| 1 | At least one subcheck fired an alert (budget HARD_STOP, burn drift, anomaly outlier, projection imminent-exhaust) |
| 2 | A subcheck had a config/usage error (e.g. invalid CLI args propagated to a subscript) |
| 127 | A subcheck failed to launch (script missing, etc.) |
max() means the worst signal wins β exit 2 (config error) always dominates
exit 1 (alert), so you spot misconfigured pipelines before they masquerade
as healthy.
FAQ
What does the projection check test?
It checks whether the budget would be fully used in fewer than 14 days, which is the default.
Which checks does it run?
Budget, burn rate, outlier sessions and projection, each with its own default threshold.
Can I change the thresholds?
Yes. Options set the acceleration limit, the outlier count and the days-to-exhaust alert.
Details
Original description by the author
Composite CI gate β runs cost-budget-check + cost-burn + cost-anomaly + cost-projection in parallel and surfaces a single combined health status with max exit code. The operationally-useful entry point β one shell-out covers all four alert ladders.
repo: ruvnet/ruflo
Popularity
- GitHub stars
- 81k
- Ranking position
- #1602
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
agent-adaptive-coordinator
81kHelps your agent split and rebalance a group of AI agents as the workload changes, choosing a layout that fits the task.
agent-agent
81kTeaches your agent to turn a big goal into an ordered plan of actions, and to replan when conditions change.
agent-agentic-payments
81kHelps your agent manage spending mandates for AI shopping, with spend caps, time windows, merchant rules and signed approvals.
agent-analyze-code-quality
81kHelps your agent review code for quality, finding code smells, technical debt and refactoring ideas without changing the files.
Similar skills
blucli
394kHelps your agent find, play, pause, group, and adjust the volume of Bluesound and NAD speakers through the blu command.
camsnap
394kHelps your agent grab snapshots, short clips, or motion events from network cameras and local webcams that you have set up.
eightctl
394kHelps your agent check and control an Eight Sleep pod, including its temperature, alarms, and sleep schedules.