Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Consumer-side wiring for ADR-097 Phase 3 federation_spend events — per-peer rolling windows + suspension-threshold check
.claude/skills/ruvnet-cost-federation/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-20 | ✗→✓ | ▲ Improved | -33% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -73% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -51% | 0% |
| case-07 | ✗→✓ | ▲ Improved | -37% | 0% |
| case-08 | ✗→✓ | ▲ Improved | -43% | 0% |
ADR-097 Phase 3 specifies a federation_spend event bus that publishes one event per federation_send completion: {peerId, taskId, tokensUsed, usdSpent, ts}. Cost-tracker is the declared consumer — it aggregates per-peer rolling windows (1h / 24h / 7d) and the federation breaker queries that aggregate to suspend peers exceeding the configured threshold.
Phase 3 isn't landed upstream yet. This skill is the consumer-side wiring; it activates the moment upstream publishes events to the federation-spend namespace. Until then it reports cleanly with a "no events found" notice.
/loop 5m) to monitor per-peer spend across windows.bash node plugins/ruflo-cost-tracker/scripts/federation.mjs
Optional env:
FED_FORMAT=json — JSON instead of markdownFED_NAMESPACE=federation-spend — override target namespaceFED_SUSPEND_THRESHOLD_USD=5.0 — breaker threshold (ADR-097 default)When Phase 3 lands, events should be persisted to namespace federation-spend with key prefix fed-spend- and JSON value matching:
json{ "peerId": "<peer-uuid>", "taskId": "<task-uuid>", "tokensUsed": 12345, "usdSpent": 0.0287, "ts": "2026-05-05T..." }
The script reads any record matching that prefix, regardless of how upstream produces them. Multiple events per peer accumulate cleanly into the rolling-window sums.
cost-report — same data, different lens (cost-report focuses on local agent spend; this skill on per-peer federated spend)ruflo-federation plugin — the producer side (when Phase 3 lands)| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-20 | fail→pass | 14,102 | 5,374 | -62% | 1 | 1 | 0% | 2,292 | 1,545 | -33% | 0 | 0 | — |
case-01 | fail→fail | 3,716 | 4,036 | +9% | 1 | 1 | 0% | 620 | 829 | +34% | 0 | 0 | — |
case-02 | fail→pass | 11,556 | 1,168 | -90% | 1 | 1 | 0% | 2,983 | 796 | -73% | 0 | 0 | — |
case-03 | fail→pass | 8,093 | 3,756 | -54% | 1 | 1 | 0% | 1,633 | 795 | -51% | 0 | 0 | — |
case-04 | pass→pass | 13,349 | 5,467 | -59% | 1 | 1 | 0% | 2,225 | 1,641 | -26% | 0 | 0 | — |
case-05 | pass→fail | 12,512 | 7,541 | -40% | 1 | 1 | 0% | 2,488 | 2,037 | -18% | 0 | 0 | — |
case-06 | pass→fail | 15,835 | 5,400 | -66% | 1 | 1 | 0% | 3,405 | 1,555 | -54% | 0 | 0 | — |
case-07 | fail→pass | 7,114 | 2,941 | -59% | 1 | 1 | 0% | 1,415 | 894 | -37% | 0 | 0 | — |
case-08 | fail→pass | 10,230 | 2,343 | -77% | 1 | 1 | 0% | 1,868 | 1,067 | -43% | 0 | 0 | — |
case-09 | fail→pass | 9,867 | 1,645 | -83% | 1 | 1 | 0% | 1,776 | 901 | -49% | 0 | 0 | — |
case-10 | fail→pass | 17,110 | 2,556 | -85% | 1 | 1 | 0% | 886 | 1,040 | +17% | 0 | 0 | — |
case-11 | fail→pass | 12,258 | 3,272 | -73% | 1 | 1 | 0% | 2,364 | 1,231 | -48% | 0 | 0 | — |
case-12 | fail→pass | 7,614 | 1,808 | -76% | 1 | 1 | 0% | 1,298 | 905 | -30% | 0 | 0 | — |
case-13 | pass→pass | 10,226 | 3,504 | -66% | 1 | 1 | 0% | 1,723 | 1,195 | -31% | 0 | 0 | — |
case-14 | fail→pass | 26,515 | 2,990 | -89% | 1 | 1 | 0% | 2,785 | 823 | -70% | 0 | 0 | — |
case-15 | fail→fail | 11,804 | 5,225 | -56% | 1 | 1 | 0% | 2,301 | 1,640 | -29% | 0 | 0 | — |
case-16 | fail→pass | 7,864 | 3,226 | -59% | 1 | 1 | 0% | 1,310 | 1,217 | -7% | 0 | 0 | — |
case-17 | fail→pass | 8,421 | 2,581 | -69% | 1 | 1 | 0% | 1,284 | 1,148 | -11% | 0 | 0 | — |
case-18 | fail→pass | 11,357 | 1,720 | -85% | 1 | 1 | 0% | 2,017 | 858 | -57% | 0 | 0 | — |
case-19 | fail→pass | 14,466 | 1,404 | -90% | 1 | 1 | 0% | 2,382 | 798 | -66% | 0 | 0 | — |
case-21 | fail→pass | 13,905 | 5,759 | -59% | 1 | 1 | 0% | 2,070 | 1,672 | -19% | 0 | 0 | — |
case-22 | fail→pass | 18,862 | 1,260 | -93% | 1 | 1 | 0% | 3,133 | 765 | -76% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 19 counted toward the lift figure. The other 3 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +64 percentage points is the difference between those two pass rates over the 19 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.