cost-projection

Projects future API spend by extrapolating recent usage rates to budget exhaustion dates.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Teams running AI workloads often discover budget overruns only after the money is spent. This Skill answers "when will we cross the line?" by computing a USD-per-day burn rate from recent session records and projecting spend across future horizons, so finance and SRE teams can act before budgets are exhausted.

Core Features & Use Cases

  • Burn-rate computation: Reads session records from the cost-tracking namespace, filters to a configurable measurement window (default 7 days), and derives a per-day spend rate.
  • Multi-horizon projection: Linearly extrapolates spend to 7d/30d/90d/365d horizons and reports days until 75%, 90%, and 100% of a configured budget is consumed.
  • CI and dashboard integration: JSON output mode lets you gate builds (e.g., fail when full exhaustion is under 7 days away) or feed a budget dashboard for quarterly planning.
  • Use Case: After shipping a large feature, re-run the projection to verify the daily spend rate has not accelerated beyond expectations, and alert if the 100% budget threshold is less than a week away.

Quick Start

Ask the AI to project my API spend for the next 30 and 90 days based on the last 7 days of usage and tell me when my configured budget will run out.

Frequently Asked Questions about cost-projection

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

FAQPage Schema
How do I project future API costs from recent usage?

Run the projection with a measurement window such as the last 7 days. It computes a USD-per-day rate from session records in the cost-tracking namespace and linearly extrapolates spend to 7d, 30d, 90d, and 365d horizons.

How to estimate when my budget will run out?

Set a budget first with the cost-budget configuration, then run the projection. It reports days until 75%, 90%, and 100% of the budget is consumed at the current burn rate, marking thresholds already reached.

What is the difference between cost-projection and cost-budget-check?

cost-budget-check is reactive and answers whether you have already crossed a budget line. cost-projection is predictive and answers when you will cross it, based on the current per-day spend rate.

Can I use cost projection output in CI pipelines?

Yes. Use --format json and pipe the output to jq, for example failing a build when the 100% budget exhaustion estimate is less than 7 days away. PROJECTION_QUIET=1 is an alias for JSON output.

What are the limitations of linear cost extrapolation?

Linear extrapolation assumes the current spend rate stays constant, so it becomes inaccurate after workload shifts. Re-run after major changes, and pair with trend analysis over multiple windows for drift detection.