New to Claude Skills? Learn how to install them →

ruvnet on GitHub

Cost Health

Free

Monitor budget, burn rate, and anomalies in CI.

by ruvnet67.6k stars on ruvnet/ruflo
Updated Aug 10, 2026
Get this skill

Free · Opens the source repo

What Cost Health does

Cost Health is a composite continuous integration (CI) gate skill designed to streamline the monitoring of project financial health by running four essential checks in parallel: budget, burn rate, anomaly detection, and projection. This skill is particularly useful for teams that need to maintain a close watch on their spending and resource allocation, ensuring they stay within budgetary limits while also identifying any potential financial issues early on. By consolidating these checks into a single command, Cost Health reduces overhead and simplifies the CI pipeline.

The skill operates by executing four subchecks simultaneously, each addressing a specific financial question. The budget check verifies whether the configured budget has been exceeded, while the burn check assesses if the daily expenditure is accelerating. The anomaly check identifies any outlier spending that deviates significantly from the norm, and the projection check estimates when the budget will be fully consumed. The results from these checks are summarized in a single output, providing a clear health status that helps teams make informed decisions quickly.

Cost Health is ideal for development teams and project managers who require a straightforward way to monitor financial metrics without the complexity of managing multiple CI gates. By using this skill, teams can avoid the redundancy of wiring separate gates for each financial check, thus optimizing their CI processes. Additionally, the skill allows for customization of thresholds, enabling users to adapt the checks to their specific project needs. This flexibility ensures that the skill can be effectively utilized in various scenarios, whether for routine health checks or more stringent budget reviews.

In summary, Cost Health enhances CI workflows by providing a comprehensive view of financial health through a single command. It is particularly beneficial for teams looking to maintain budget discipline while ensuring that any anomalies or accelerations in spending are promptly addressed.

When to use it

Use this skill when you need to monitor budget adherence, spending acceleration, and detect anomalies in financial data during CI processes.

When not to use it

Avoid this skill if your project does not require detailed financial monitoring or if you prefer to manage checks separately for more granular control.

What you can build with it

Routine Budget Monitoring

Use Cost Health to regularly check if your project is staying within budget during CI runs.

Detecting Spending Anomalies

Quickly identify any outlier spending that could indicate potential issues or mismanagement.

Projecting Budget Exhaustion

Estimate when your budget will be exhausted to proactively manage resources.

How to install Cost Health

View source

1. Install with the skills CLI

npx skills add ruvnet/ruflo/cost-health --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by ruvnet

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.

SubcheckQuestionDefault 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.

  1. Spawn all four subcheck scripts in parallel (Promise.all over child_process.spawn).
  2. Each subcheck emits --format json; parse and capture exit code.
  3. Projection has no built-in exit code — synthesize one from daysUntilReached[100%] < --alert-days-to-exhaust.
  4. Final exit code = max(subcheck exits). Any single failure fails the gate.
  5. 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

ExitMeaning
0All subchecks OK
1At least one subcheck fired an alert (budget HARD_STOP, burn drift, anomaly outlier, projection imminent-exhaust)
2A subcheck had a config/usage error (e.g. invalid CLI args propagated to a subscript)
127A 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.

Frequently asked questions about Cost Health

Similar skills