/cost-export
Export cost-tracking telemetry in Prometheus textfile or webhook JSON formats — for external observability (Grafana, Datadog, custom dashboards)
$ npx -y skills add ruvnet/ruflo --skill cost-export --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/cost-export
Context preview
The summary Claude sees to decide when to auto-load this skill.
Export cost-tracking telemetry in Prometheus textfile or webhook JSON formats — for external observability (Grafana, Datadog, custom dashboards)
SKILL.md
cost-export.SKILL.mdname: cost-export
description: Export cost-tracking telemetry in Prometheus textfile or webhook JSON formats — for external observability (Grafana, Datadog, custom dashboards)
argument-hint: "[--prometheus <path>] [--webhook <url>]"
allowed-tools: Bash
Cost Export
Pulls every `session-*` and `budget-config-*` record from `cost-tracking` and emits in formats consumable by external observability systems. Without this, cost data lives only inside the AgentDB namespace; with it, the same data lights up dashboards.
When to use
- After any cost-track run, to refresh metrics for Grafana / Datadog / Prometheus.
- Cron-friendly via `/loop 5m` to keep external dashboards near-real-time.
- One-shot to a webhook for ad-hoc reporting (Slack, custom endpoint).
Steps
1. **Pick a format** — textfile collector for Prometheus / Grafana, or webhook POST for everything else:
# Prometheus node_exporter textfile collector
node plugins/ruflo-cost-tracker/scripts/export.mjs --prometheus /var/lib/node_exporter/textfile_collector/cost_tracker.prom
# Webhook (POSTs JSON; add auth via env)
EXPORT_WEBHOOK_HEADER='Authorization: Bearer $TOKEN' \
node plugins/ruflo-cost-tracker/scripts/export.mjs --webhook https://hooks.example.com/cost-tracker
# Stdout JSON (default if no flag)
node plugins/ruflo-cost-tracker/scripts/export.mjs2. **Inspect what's emitted** — Prometheus output includes:
cost_tracker_total_usd <gauge>
cost_tracker_tier_total_usd{tier="opus|sonnet|haiku"} <gauge>
cost_tracker_session_total_usd{session="<8-char>"} <gauge>
cost_tracker_session_messages{session="<8-char>"} <counter>
cost_tracker_budget_usd <gauge> (if budget configured)
cost_tracker_budget_utilization <gauge> (spent / budget)3. **Webhook payload shape** — the JSON the webhook receives matches the stdout JSON: `{ exportedAt, sessions: [...], budget, totalUsd, byTier }`. Headers may be added via `EXPORT_WEBHOOK_HEADER='K1: V1, K2: V2'` (comma-separated).
Env overrides
| Env | Default | Purpose | |---|---|---| | `EXPORT_NAMESPACE` | `cost-tracking` | Override target namespace | | `EXPORT_WEBHOOK_HEADER` | unset | Comma-separated `K: V` pairs for webhook auth | | `EXPORT_QUIET=1` | unset | Suppress non-error confirmation output |
Cross-references
- `cost-track` — produces the data this skill exports
- `cost-budget-check` — the same `cost_tracker_budget_*` metrics are alertable in Prometheus
- node_exporter textfile collector docs (Prometheus convention) — drop the `.prom` file in the collector directory and Prometheus picks it up
Read more
name: cost-export description: Export cost-tracking telemetry in Prometheus textfile or webhook JSON formats — for external observability (Grafana, Datadog, custom dashboards) argument-hint: "[--prometheus <path>] [--webhook <url>]" allowed-tools: Bash
Cost Export
Pulls every `session-*` and `budget-config-*` record from `cost-tracking` and emits in formats consumable by external observability systems. Without this, cost data lives only inside the AgentDB namespace; with it, the same data lights up dashboards.
When to use
- After any cost-track run, to refresh metrics for Grafana / Datadog / Prometheus.
- Cron-friendly via `/loop 5m` to keep external dashboards near-real-time.
- One-shot to a webhook for ad-hoc reporting (Slack, custom endpoint).
Steps
1. **Pick a format** — textfile collector for Prometheus / Grafana, or webhook POST for everything else:
# Prometheus node_exporter textfile collector
node plugins/ruflo-cost-tracker/scripts/export.mjs --prometheus /var/lib/node_exporter/textfile_collector/cost_tracker.prom
# Webhook (POSTs JSON; add auth via env)
EXPORT_WEBHOOK_HEADER='Authorization: Bearer $TOKEN' \
node plugins/ruflo-cost-tracker/scripts/export.mjs --webhook https://hooks.example.com/cost-tracker
# Stdout JSON (default if no flag)
node plugins/ruflo-cost-tracker/scripts/export.mjs2. **Inspect what's emitted** — Prometheus output includes:
cost_tracker_total_usd <gauge>
cost_tracker_tier_total_usd{tier="opus|sonnet|haiku"} <gauge>
cost_tracker_session_total_usd{session="<8-char>"} <gauge>
cost_tracker_session_messages{session="<8-char>"} <counter>
cost_tracker_budget_usd <gauge> (if budget configured)
cost_tracker_budget_utilization <gauge> (spent / budget)3. **Webhook payload shape** — the JSON the webhook receives matches the stdout JSON: `{ exportedAt, sessions: [...], budget, totalUsd, byTier }`. Headers may be added via `EXPORT_WEBHOOK_HEADER='K1: V1, K2: V2'` (comma-separated).
Env overrides
| Env | Default | Purpose | |---|---|---| | `EXPORT_NAMESPACE` | `cost-tracking` | Override target namespace | | `EXPORT_WEBHOOK_HEADER` | unset | Comma-separated `K: V` pairs for webhook auth | | `EXPORT_QUIET=1` | unset | Suppress non-error confirmation output |
Cross-references
- `cost-track` — produces the data this skill exports
- `cost-budget-check` — the same `cost_tracker_budget_*` metrics are alertable in Prometheus
- node_exporter textfile collector docs (Prometheus convention) — drop the `.prom` file in the collector directory and Prometheus picks it up
An agent meta-harness for Claude Code and Codex. Agent = Model + Harness. The model writes; the harness gives it tools, memory, loops, sandboxes, and controls so it can actually work.
Repo: ruvnet/ruflo
Other skills on claude-flow.
- /agentdb-advanced
Master advanced AgentDB features including QUIC synchronization, multi-database management, custom distance metrics, hybrid search, and distributed systems integration. Use when building distributed AI systems, multi-agent coordination, or advanced vector search applications.
Open skill - /agentdb-learning
Create and train AI learning plugins with AgentDB's 9 reinforcement learning algorithms. Includes Decision Transformer, Q-Learning, SARSA, Actor-Critic, and more. Use when building self-learning agents, implementing RL, or optimizing agent behavior through experience.
Open skill - /agentdb-memory-patterns
Implement persistent memory patterns for AI agents using AgentDB. Includes session memory, long-term storage, pattern learning, and context management. Use when building stateful agents, chat systems, or intelligent assistants.
Open skill - /agentdb-optimization
Optimize AgentDB performance with quantization (4-32x memory reduction), HNSW indexing (150x faster search), caching, and batch operations. Use when optimizing memory usage, improving search speed, or scaling to millions of vectors.
Open skill - /agentdb-vector-search
Implement semantic vector search with AgentDB for intelligent document retrieval, similarity matching, and context-aware querying. Use when building RAG systems, semantic search engines, or intelligent knowledge bases.
Open skill - /agentic-jujutsu
Quantum-resistant, self-learning version control for AI agents with ReasoningBank intelligence and multi-agent coordination
Open skill

