
Cost Federation
Monitors per-peer federation spending in 1h/24h/7d rolling windows and checks against circuit breaker thresholds defined in ADR-097 Phase 3. The wiring is ready but sits idle until upstream federation_spend events start flowing. Run it before adding new federation peers to establish baselines, or loop it every five minutes to catch peers burning through your budget. The suspension threshold logic is baked in, so when a peer crosses the line you'll see exactly why the breaker tripped. Worth noting this is consumer-side only: it reads events, doesn't produce them, so you're safe to install it before Phase 3 actually lands.
- skills.sh installs
- 684
- GitHub stars
- 81.4K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add ruvnet/ruflo --skill cost-federation --agent claude-codeInstalls into .claude/skills of the current project.
Files
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
-
Run the script:
node plugins/ruflo-cost-tracker/scripts/federation.mjsOptional env:
FED_FORMAT=json— JSON instead of markdownFED_NAMESPACE=federation-spend— override target namespaceFED_SUSPEND_THRESHOLD_USD=5.0— breaker threshold (ADR-097 default)
Sponsors
Details
- Repository
- github.com/ruvnet/ruflo
- First seen
- Jun 3, 2026
More from ruvnet/ruflo
All 236- Cost Summary684
- Intelligence Transfer684
- Vector Setup684
- Cost Trend683
- Cost Conversation682
- Cost Export681
- Cost Benchmark679
- Cost Booster Edit679
- Browser674
- Witness656
- AgentDB Advanced Features
- AgentDB Learning Plugins
- AgentDB Memory Patterns
- AgentDB Performance Optimization
- AgentDB Vector Search
- Hooks Automation
- Pair Programming
- ReasoningBank Intelligence
- ReasoningBank With AgentDB
- Skill Builder
- V3 CLI Modernization
- V3 Core Implementation
- V3 DDD Architecture
- V3 Deep Integration