Chuyển đến nội dung
Skillpedia
Khác81k · #1602

cost-health

Skill này làm gì

Skill này chạy bốn kiểm tra chi phí AI cùng lúc và đưa ra một kết quả đạt hoặc không đạt chung. Nó dành cho nhóm muốn có một cổng kiểm tra chi phí duy nhất trong quy trình tự động.

Khi nào nên dùng

  • ✓Khi bạn muốn một bước kiểm tra chi phí chạy trong quy trình tích hợp liên tục.
  • ✓Khi bạn muốn một kết quả sức khỏe duy nhất gồm ngân sách, xu hướng, bất thường và dự báo.
  • ✓Khi bạn muốn bản build thất bại nếu chi phí AI có dấu hiệu bất thường.

Liên kết skill

https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-cost-tracker/skills/cost-health/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-cost-tracker/skills/cost-health/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Hãy cho tôi một kết quả kiểm tra sức khỏe chi phí tổng thể cho chi tiêu AI của tôi.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Skill khởi chạy đồng thời các kiểm tra ngân sách, tốc độ tiêu, bất thường và dự báo. Nó trả về mã lỗi cao nhất trong số đó và in một bản tóm tắt ngắn cho từng kiểm tra.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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.

  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

- 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

# 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

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.

Câu hỏi thường gặp

Kiểm tra dự báo kiểm tra điều gì?

Nó kiểm tra xem ngân sách có bị dùng hết trong ít hơn 14 ngày hay không, đây là mức mặc định.

Skill chạy những kiểm tra nào?

Ngân sách, tốc độ tiêu, phiên bất thường và dự báo, mỗi kiểm tra có ngưỡng mặc định riêng.

Tôi có thể đổi ngưỡng không?

Có. Các tùy chọn đặt giới hạn tăng tốc, số lượng phiên bất thường và cảnh báo số ngày đến khi cạn ngân sách.

Chi tiết

Mô tả gốc của tác giả

Composite CI gate — runs cost-budget-check + cost-burn + cost-anomaly + cost-projection in parallel and surfaces a single combined health status with max exit code. The operationally-useful entry point — one shell-out covers all four alert ladders.

repo: ruvnet/ruflo

Độ phổ biến

Sao GitHub
81k
Vị trí xếp hạng
#1602
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự