budget-health

Installation
SKILL.md

Budget Health Check

Quick answer to the three questions users actually ask about a budget: Am I over? Will I overshoot? Is anything firing?

Steps

  1. List Budgets — Call list_budgets with the user's scope.

    • If no budgets exist on the scope, skip to the No budgets found handoff below.
    • If the call returns an access-denied error, the user lacks Cost Management read access on this scope — surface that distinctly rather than reporting it as "no budgets found."
  2. End-of-Month Forecast — Call forecast_costs with the same scope. It returns one row per day, each tagged CostStatus Actual or Forecast, and the same date can appear as both. For the month-end projection, take one value per date — the Actual if present, otherwise the Forecast — and sum PreTaxCost. Compare that to the budget amount.

    • No Forecast rows? If the response has only Actual rows, a projection isn't available for this scope — report month-to-date actual and say a forecast couldn't be produced; don't present partial actuals as a month-end projection. This happens on multi-currency scopes (below) and where there's too little history to project.
    • Multi-currency caveat: the Cost Management Forecast API doesn't return a forecast for scopes that span multiple currencies — a management group or billing account can mix, e.g., USD and GBP, in which case the response comes back as Actual-only rows per currency. Re-scope to a single-currency subscription to get a forecast, and never sum across currencies.
  3. Current Month Spend — Call query_costs with timeframe=MonthToDate, groupBy=ServiceName, granularity=None for the spend breakdown by service. If it returns no rows (early in the billing cycle, before current-month data is available), say so rather than implying zero spend — optionally repeat with timeframe=TheLastMonth for recent context.

    • Multi-currency caveat: at management-group or billing-account scope, the result may contain multiple Currency values. Group by Currency before summing or comparing — don't combine USD and GBP into one total.
    • Source-of-truth note: for the budget % use list_budgets' currentSpend.amount (this is what Azure evaluates Actual-cost budget alerts against; Forecasted alerts evaluate against forecastSpend). Use the query_costs MTD result only for the service-level drill-down.
  4. Active Alerts — Call list_alerts to surface triggered budget or anomaly alerts. Each alert carries a periodStartDate and stays in Active status until dismissed, so the list can include alerts from earlier months. Check periodStartDate: present only current-period alerts as firing now, and label older ones as prior-period history.

Installs
1
GitHub Stars
1
First Seen
5 days ago