跳到正文
Skillpedia
其他81k · #1610

cost-summary

它能做什么

这项技能把所有已记录的 AI 成本数据汇总为一份摘要,供人或其他工具阅读。适合想快速概览,或想为仪表盘提供数据的人。

适用场景

  • ✓当你想快速查看 AI 总支出和预算状态时。
  • ✓当其他工具或脚本需要稳定的成本摘要来读取时。
  • ✓当你想把最贵的会话和节点合计数据放在一处时。

技能链接

https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-cost-tracker/skills/cost-summary/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-cost-tracker/skills/cost-summary/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请给我一页纸的摘要,列出我所有 AI 支出和预算状态。”

每周 5 个新技能,1 分钟读完。

工作原理

这项技能把成本追踪记录和节点记录中的数据合并为一个输出。默认输出固定格式的 JSON,如果你需要,也可以输出 Markdown 表格。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Cost Summary

A stable single-call interface that other plugins / scripts / dashboards can shell out to and parse. ADR-0002 considered exposing cost_report / cost_summary as proper MCP tools but deferred that — adding MCP tools requires modifying @claude-flow/cli source, out of scope for plugin-local work. This script is the equivalent: same data, exposed via a stdout JSON contract.

When to use

  • Another plugin needs a snapshot of cost state — it shells out to summary.mjs --format json and parses.
  • A dashboard / Slackbot fetches a one-line cost rollup.
  • Quick "where am I right now?" view that pulls from every cost-tracker source (cost-tracking + federation-spend).

Output contract (JSON, stable)

{
  "exportedAt": "<ISO>",
  "total_cost_usd": 1546.36,
  "sessionCount": 1,
  "conversationCount": 1,
  "byTier": { "haiku": 0, "sonnet": 0, "opus": 1546.36, "unknown": 0 },
  "byModel": {
    "claude-opus-4-7": {
      "tier": "opus",
      "cost_usd": 1546.36,
      "messages": 1597,
      "input_tokens": 3090,
      "output_tokens": 3295940,
      "cache_creation_input_tokens": 10659599,
      "cache_read_input_tokens": 732833690
    }
  },
  "topSession": {
    "sessionId": "1dba3b8c-...",
    "total_cost_usd": 1546.36,
    "messageCount": 1597
  },
  "budget": {
    "budget_usd": 2500.00,
    "setAt": "<ISO>",
    "spent_usd": 1546.36,
    "utilization": 0.6185,
    "level": "INFO"
  },
  "federation": {
    "eventCount": 0,
    "peerCount": 0,
    "totalUsd24h": 0
  }
}

Steps

# Markdown (default)
node plugins/ruflo-cost-tracker/scripts/summary.mjs

# JSON for programmatic consumption
node plugins/ruflo-cost-tracker/scripts/summary.mjs --format json

Optional env: SUMMARY_NAMESPACE=cost-tracking, SUMMARY_FED_NAMESPACE=federation-spend, SUMMARY_FORMAT=json.

Cross-references

  • cost-report — narrative report (per-agent / per-model lens; uses same data)
  • cost-export — pushes to Prometheus / webhook (this skill is pull-style; export is push-style)
  • ADR-0002 §"Decision" — explicitly defers proper MCP-tool registration to a future ADR
常见问题

输出格式稳定吗?

稳定。来源将 JSON 格式描述为稳定的约定,因此其他工具可以依赖相同的字段。

它包含哪些数据?

总支出、按等级和按模型的支出、最贵的会话、预算状态和节点合计。

我能在脚本中使用它吗?

可以。脚本可以运行它,并直接读取 JSON 输出。

详情

作者的原始描述

Single-shot programmatic dump of all cost data — total spend, per-tier, top session, budget status, federation aggregate. JSON or markdown.

repo: ruvnet/ruflo

热度

GitHub 星标
81k
排名
#1610
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能