# Cost Health > Gate compuesto de CI: corre cost-budget-check + cost-burn + cost-anomaly + cost-projection en paralelo y muestra un estado de salud combinado con el código de salida máximo. El punto de entrada más útil operativamente. Fuente: https://skillsagentes.com/skills/ruvnet/ruflo/cost-health Markdown: https://skillsagentes.com/skills/ruvnet/ruflo/cost-health.md Repositorio: https://github.com/ruvnet/ruflo Autor: ruvnet Licencia: MIT Actualizado: hace 2 meses Coste de contexto: 63 tok instalada, 912 tok al activarse, 912 tok con todos los archivos del bundle Bundle: 1 archivo, 4 KB Permisos que pide: bash ## Instalación Un skill son archivos markdown: los mismos archivos valen para cualquier agente y lo único que cambia es el directorio de destino, es decir la bandera `--agent`. Añade `-g` para instalarlo en todos los proyectos de la máquina. ```bash # Claude Code npx -y skills add ruvnet/ruflo --skill cost-health --agent claude-code # Cursor npx -y skills add ruvnet/ruflo --skill cost-health --agent cursor # Codex npx -y skills add ruvnet/ruflo --skill cost-health --agent codex # Gemini CLI npx -y skills add ruvnet/ruflo --skill cost-health --agent gemini # Windsurf npx -y skills add ruvnet/ruflo --skill cost-health --agent windsurf # Cline npx -y skills add ruvnet/ruflo --skill cost-health --agent cline ``` ## Qué hace - Corre en paralelo cost-budget-check, cost-burn, cost-anomaly y cost-projection, y devuelve el código de salida máximo entre los cuatro. - Imprime un resumen de una línea por chequeo más un badge general HEALTHY/UNHEALTHY. - Permite personalizar umbrales de aceleración, outliers y días hasta agotar presupuesto, o saltarse chequeos concretos. ## Cuándo usarla - Como entrada única de CI que cubre las cuatro escaleras de alerta de costo en un solo paso. ## Qué la activa - "Corre el chequeo de salud de costos completo" - "¿Está todo saludable en el gasto de este proyecto?" ## Antes de instalar - Depende de los datos que producen cost-track y, si aplica, cost-budget-check. - runs shell commands ## Archivos - SKILL.md — 4 KB ## SKILL.md Reproducido tal cual desde ruvnet/ruflo bajo MIT. Esta sección es el documento original y está en inglés. 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. | Subcheck | Question | Default 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`](../../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 ```yaml - 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 ```bash # 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 ```bash 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 | Exit | Meaning | |---|---| | 0 | All subchecks OK | | 1 | At least one subcheck fired an alert (budget HARD_STOP, burn drift, anomaly outlier, projection imminent-exhaust) | | 2 | A subcheck had a config/usage error (e.g. invalid CLI args propagated to a subscript) | | 127 | A 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. ## Dónde encaja - Categoría: [DevOps e infraestructura](https://skillsagentes.com/categorias/devops-infraestructura.md) — Despliegues, contenedores, IaC y flujos de gestión de incidentes. - Creador: [ruvnet](https://skillsagentes.com/creators/ruvnet.md) — 275 skills en el directorio - [Todas las skills](https://skillsagentes.com/skills.md) - [Ranking de instalaciones](https://skillsagentes.com/ranking.md) ## Otras skills del mismo repositorio - [Harness Gepa](https://skillsagentes.com/skills/ruvnet/ruflo/harness-gepa.md): Inspecciona y audita genomas GEPA: carga y valida un genoma, renderiza el system prompt que compila, o clasifica los modos de fallo de una transcripción de ejecución. - [Deepseek Reason](https://skillsagentes.com/skills/ruvnet/ruflo/deepseek-reason.md): Completion en modo razonamiento contra deepseek-reasoner (R1) de DeepSeek. Devuelve el chain-of-thought por separado de la respuesta final. Lee DEEPSEEK_API_KEY y degrada si falta o la API no responde. - [Deepseek Chat](https://skillsagentes.com/skills/ruvnet/ruflo/deepseek-chat.md): Completion de un solo turno contra el modelo deepseek-chat de DeepSeek vía /v1/chat/completions. Lee DEEPSEEK_API_KEY y degrada con status:degraded si falta o la API no responde. Para tareas sin razonamiento. - [Adr Index](https://skillsagentes.com/skills/ruvnet/ruflo/adr-index.md): Construye o reconstruye el índice de ADRs y su grafo de dependencias ejecutando scripts/import.mjs, en vez de cientos de llamadas MCP. - [Agntcy Status](https://skillsagentes.com/skills/ruvnet/ruflo/agntcy-status.md): Muestra el estado de la integración AGNTCY/SLIM/CASA: si los paquetes están instalados, qué transporte está activo y si el enforcement de CASA está habilitado. --- Skills Agentes · [Índice de páginas en markdown](https://skillsagentes.com/sitemap.md) · [Inicio](https://skillsagentes.com/index.md)