cost-budget-check
Read accumulated cost-tracking spend + budget config, compute utilization, emit 50/75/90/100% alert ladder
What this skill does
# Cost Budget Check
Reads `cost-tracking:budget-config` for the project's budget limit, sums `total_cost_usd` across `session-*` records produced by `cost-track`, computes utilization, and emits the **measured** 4-tier alert ladder (50% INFO / 75% WARNING / 90% CRITICAL / 100% HARD_STOP).
Until P2 (this skill) landed, the README documented the alert ladder but no code checked it. Now this skill is the gate.
## When to use
- After every cost-track run, to surface the alert level.
- Before spawning a swarm — if utilization ≥ 90%, escalate to `/cost-optimize` first.
- Cron-friendly via `/loop 30m` for continuous monitoring.
## Steps
1. **Run the check**:
```bash
node plugins/ruflo-cost-tracker/scripts/budget.mjs check
```
Filter by period: `BUDGET_PERIOD=today` (default `all`). Use `BUDGET_QUIET=1` for machine-readable JSON.
2. **Inspect the markdown summary** — budget, spent, remaining, utilization percentage, alert level (🟢 OK · 🟡 INFO · 🟠 WARNING · 🔴 CRITICAL · 🛑 HARD_STOP), and the recommended action.
3. **Set / inspect the budget**:
```bash
node plugins/ruflo-cost-tracker/scripts/budget.mjs set 50.00
node plugins/ruflo-cost-tracker/scripts/budget.mjs get
```
4. **HARD_STOP path** — `budget.mjs check` exits with code `1` when utilization ≥ 100%. Wrap critical agent spawns in a `budget.mjs check && spawn …` guard to fail closed.
## Storage shape (`cost-tracking:budget-config`)
```json
{
"budget_usd": 50.00,
"setAt": "2026-05-05T...",
"thresholds": { "info": 0.50, "warning": 0.75, "critical": 0.90, "hard_stop": 1.00 }
}
```
## Alert ladder (from REFERENCE.md, now enforced)
| Threshold | Level | Action |
|---|---|---|
| 50% | INFO 🟡 | log notification, no UX disruption |
| 75% | WARNING 🟠 | display warning, suggest `/cost-optimize` |
| 90% | CRITICAL 🔴 | urgent alert, recommend model downgrades |
| 100% | HARD_STOP 🛑 | halt non-essential spawns; exit code 1 |
## Cross-references
- `cost-track` (producer) — populates `cost-tracking:session-*`
- `cost-report` — same data source, narrative format
- `cost-optimize` — recommended action when WARNING/CRITICAL
- REFERENCE.md "Budget alert thresholds" — the documented ladder this enforces
Related in Data & Analytics
clawarr-suite
IncludedComprehensive management for self-hosted media stacks (Sonarr, Radarr, Lidarr, Readarr, Prowlarr, Bazarr, Overseerr, Plex, Tautulli, SABnzbd, Recyclarr, Unpackerr, Notifiarr, Maintainerr, Kometa, FlareSolverr). Deep library exploration, analytics, dashboard generation, content management, request handling, subtitle management, indexer control, download monitoring, quality profile sync, library cleanup automation, notification routing, collection/overlay management, and media tracker integration (Trakt, Letterboxd, Simkl).
querying-soql
IncludedSOQL query generation, optimization, and analysis with 100-point scoring. Use this skill when the user needs SOQL/SOSL authoring or optimization: natural-language-to-query generation, relationship queries, aggregates, query-plan analysis, and performance or safety improvements for Salesforce queries. TRIGGER when: user writes, optimizes, or debugs SOQL/SOSL queries, touches .soql files, or asks about relationship queries, aggregates, or query performance. DO NOT TRIGGER when: bulk data operations (use handling-sf-data), Apex DML logic (use generating-apex), or report/dashboard queries.
app-store-optimization
IncludedApp Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklists, and tracking ranking changes.
habit-flow
IncludedAI-powered atomic habit tracker with natural language logging, streak tracking, smart reminders, and coaching. Use for creating habits, logging completions naturally ("I meditated today"), viewing progress, and getting personalized coaching.
app-store-optimization
IncludedApp Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklists, and tracking ranking changes.
visualizing-data
IncludedBuilds dashboards, reports, and data-driven interfaces requiring charts, graphs, or visual analytics. Provides systematic framework for selecting appropriate visualizations based on data characteristics and analytical purpose. Includes 24+ visualization types organized by purpose (trends, comparisons, distributions, relationships, flows, hierarchies, geospatial), accessibility patterns (WCAG 2.1 AA compliance), colorblind-safe palettes, and performance optimization strategies. Use when creating visualizations, choosing chart types, displaying data graphically, or designing data interfaces.