cost-health

Runs four cost CI-gate checks in parallel and returns a combined health status with max exit code.

70.1k|8.4k|Updated Jun 2, 2025
One-click install
npx skills add https://github.com/ruvnet/claude-flow --skill cost-health
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cost-health
Source: https://github.com/ruvnet/claude-flow/tree/main/plugins/ruflo-cost-tracker/skills/cost-health
Command: npx skills add https://github.com/ruvnet/claude-flow --skill cost-health

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Wiring four separate CI gates for cost budget, burn rate, anomaly detection, and budget projection duplicates setup overhead and slows pipelines. This Skill composes all four checks into a single shell-out that runs them in parallel and surfaces one combined health status.

Core Features & Use Cases

  • Parallel Composite Gate: Spawns budget, burn, anomaly, and projection subchecks concurrently and returns the maximum exit code so any single failure fails the gate.
  • Configurable Alert Thresholds: Tune acceleration percentage, outlier count, and days-to-exhaust limits, or skip individual subchecks for fast smoke runs.
  • One-Line Summaries: Prints a per-check status table plus an overall HEALTHY/UNHEALTHY badge for quick CI log review.
  • Use Case: Add a single step to your CI pipeline that fails the build when daily spend accelerates over 100%, a session becomes a >3.5σ cost outlier, or the budget is projected to exhaust within 14 days.

Quick Start

Run the cost health gate with default thresholds to check budget, burn, anomaly, and projection status in one command.

Frequently Asked Questions about cost-health

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a cost budget gate to my CI pipeline?

Add a single CI step that runs the cost health command with your alert thresholds. It executes budget, burn, anomaly, and projection checks in parallel and fails the build if any subcheck exceeds its limit.

How do I detect anomalous spending sessions automatically?

The anomaly subcheck flags any session whose cost is a statistical outlier with |z| greater than 3.5. The gate alerts when the outlier count meets your configured threshold, which defaults to one outlier.

Can I skip individual cost checks in a smoke test run?

Yes, pass the --skip flag with comma-separated subcheck names such as burn or projection. This is useful when a check is too slow for fast-feedback runs or does not apply because no budget is configured.

What do the exit codes from the cost health gate mean?

Exit 0 means all subchecks passed, exit 1 means at least one alert fired, exit 2 indicates a configuration or usage error, and 127 means a subcheck script failed to launch. The final code is the maximum across subchecks, so config errors dominate alerts.

When should I not use a composite cost health check?

Avoid it when you need independent gating per check with separate thresholds and notifications, or when a subcheck lacks required inputs such as a configured budget for projection. In those cases wire the individual gates separately.