Agent skill · Documentation

cost-federation

Consumer-side wiring for ADR-097 Phase 3 federation_spend events — per-peer rolling windows + suspension-threshold check

rUv71,307★ · +1,002/wk · 3 repos on radarProfile →
claude-codecodexcan modify filesMIT
Install
npx skills add ruvnet/ruflo --skill cost-federation --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 2 KB
Bundled scripts: none
Allowed tools: Bash
Path: plugins/ruflo-cost-tracker/skills/cost-federation/SKILL.md
Open the folder on GitHub →
Where it comes from
Source: ruvnet/ruflo
Stars: 67,015 · +629 this week
Language: TypeScript
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 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

What's inside
Steps it walks through
  1. When to use
  2. Steps
  3. Storage contract (consumer side)
  4. Cross-references
Commands it runs
node plugins/ruflo-cost-tracker/scripts/federation.mjs
More from ruflo
All skills →
About this skill
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.

Keep going