cost-federation
Consumer-side wiring for ADR-097 Phase 3 federation_spend events — per-peer rolling windows + suspension-threshold check
npx skills add ruvnet/ruflo --skill cost-federation --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Cost Federation 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. ## When to use - Before opening federation traffic to a new peer — establish baseline. - Periodically (e.g. `/loop 5m`) to monitor per-peer spend across windows. - After ADR-097 Phase 2/3 lands — to verify breaker suspension reasoning. ## Steps 1. **Run the script**: ```bash node plugins/ruflo-cost-tracker/scripts/federation.mjs ``` Optional env: - `FED_FORMAT=json` — JSON instead of markdown - `FED_NAMESPACE=federation-spend` — override target namespace - `FED_SUSPEND_THRESHOLD_USD=5.0` — breaker threshold (ADR-097 default) 2. **Inspect** — per-peer 1h/24h/7d windows of count + USD spe
- When to use
- Steps
- Storage contract (consumer side)
- Cross-references
node plugins/ruflo-cost-tracker/scripts/federation.mjs
What does the cost-federation skill do?
Consumer-side wiring for ADR-097 Phase 3 federation_spend events — per-peer rolling windows + suspension-threshold check
How do I install it?
Run `npx skills add ruvnet/ruflo --skill cost-federation --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ruvnet/ruflo, a repository with 67,015 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.