Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Token Reporter

ASecurity

每日自动统计 OpenClaw 实例 Token 消耗和工作产出,上报到飞书多维表格。扫描 JSONL 日志按模型聚合 token,收集各

92 stars
0 votes
0 copies
0 views
Added 9/22/2026
ai-agentspythonbashapi

Works with

apimcp

Security Analysis

A100/100

Scanned 9/22/2026

Install to Claude Code

$npx -y skills add aAAaqwq/AGI-Super-Team --skill token-reporter --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Token Reporter?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Token Reporter
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/aaaaqwq-token-reporter-agi-super-team/badge)](https://www.skillsdirectory.com/skills/aaaaqwq-token-reporter-agi-super-team)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: token-reporter
description: 每日自动统计 OpenClaw 实例 Token 消耗和工作产出,上报到飞书多维表格。扫描 JSONL 日志按模型聚合 token,收集各
  agent 当日工作摘要,写入飞书 Bitable。触发:'token报告'、'token report'、'日报'、'每日汇报'、'飞书上报'。
author: Daniel Li
---
# Token Reporter — 每日 Token 消耗 + 产出上报

- Author: Daniel Li
- Copyright © Daniel Li. All rights reserved.

## 功能概述

每天自动统计本机 OpenClaw 实例的 Token 消耗和 Agent 工作产出,格式化后写入飞书多维表格。

## 实例对应关系

| 实例 | CEO Agent | 上报人 |
|------|-----------|--------|
| aa (本机) | 小a (main) | Daniel |
| Peter Mini | 小兔 (xiaotu) | Peter |
| 小m | 小m bot | 小m |

## 执行流程

### Step 1: 扫描 JSONL 日志

扫描 `~/.openclaw/agents/*/sessions/*.jsonl` 中当日增量数据。

每条 assistant 消息携带 `usage` 对象:
```json
{
  "usage": {
    "input": 27813,
    "output": 246,
    "cacheRead": 6720,
    "cacheWrite": 0,
    "totalTokens": 34779,
    "cost": {
      "input": 0, "output": 0,
      "cacheRead": 0, "cacheWrite": 0,
      "total": 0
    }
  }
}
```

### Step 2: 按 Agent + Model 聚合

重点追踪 4 个模型(其他模型归入"其他"):

| 模型 | 匹配规则 |
|------|---------|
| opus4.6 | `claude-opus-4-6` (xingsuancode, xingjiabiapi) |
| glm-5 | `zai/glm-5` |
| minimax-M2.5 | `minimax/MiniMax-M2.5` |
| gemini-3-pro | `gemini-3-pro` (xingjiabiapi) |

### Step 3: 格式化 Token 明细

```
opus4.6: input 320K / output 18K / cache 82% / $4.2
glm-5: input 1.2M / output 85K / cache 78% / $0.3
minimax-M2.5: input 200K / output 12K / cache 0% / $0.1
gemini: — (当日未使用)
```

cache% = cacheRead / (input + cacheRead + cacheWrite) × 100

### Step 4: 收集产出

汇总各 agent 当日工作摘要,格式:
```
code: KGKB工厂30/30完成, 5平台发布脚本 | content: 小红书×2, 选题推荐 | ops: cron改造, 服务器巡检
```

产出收集方式:
1. 读取当日 memory 文件 `~/clawd/memory/$(date +%Y-%m-%d).md`
2. 解析 `## Agent名` 段落或关键词匹配
3. 如无 memory 文件,从 JSONL 最后一条 user/assistant 消息摘要推断

### Step 5: 写入飞书多维表格

使用 `lark-mcp` 工具写入 Bitable:

| 字段 | 类型 | 填写者 | 说明 |
|------|------|--------|------|
| 员工名称 | 文本 | config | config.json 写死 `person` |
| Token明细 | 文本 | 脚本统计 | 4模型格式化文本 |
| 产出 | 文本 | 脚本统计 | 各agent当日工作摘要 |
| 个人总结 | 文本 | 人填 | 员工手动填写(留空) |
| 评分 | 单选 | 高层选 | 优秀/良好/不及格(留空) |
| 时间 | 日期 | 脚本自动 | 当天日期 |

### 飞书 API

- 参考 skill: `~/clawd/skills/feishu-automation/SKILL.md`
- 工具前缀: `mcp__lark-mcp_*`
- 新增记录: `mcp__lark-mcp_createRecord`
- 查询记录: `mcp__lark-mcp_listRecords`

## 脚本用法

```bash
# 统计当日 Token(只看数据,不上报)
python scripts/report.py --scan-only

# 统计 + 上报飞书
python scripts/report.py --report

# 指定日期
python scripts/report.py --date 2026-03-17 --scan-only

# 使用指定配置
python scripts/report.py --config /path/to/config.json --report
```

## Cron 配置建议

```json
{
  "name": "📊 每日 Token 报告 + 飞书上报",
  "schedule": { "kind": "cron", "expr": "0 23 * * *", "tz": "Asia/Shanghai" },
  "payload": {
    "kind": "agentTurn",
    "message": "执行每日 Token 报告任务:\n1. 运行 python3 ~/clawd/skills/token-reporter/scripts/report.py --scan-only\n2. 查看输出,确认数据合理\n3. 运行 python3 ~/clawd/skills/token-reporter/scripts/report.py --report\n4. 确认飞书写入成功后,用 message(action=send, channel=telegram, target=-1003890797239) 简要汇报\n5. 如果失败,报告错误原因"
  }
}
```

## 配置

安装时复制 `config.example.json` → `config.json` 并填写:

```json
{
  "person": "Daniel",
  "instance": "aa",
  "lark_app_id": "REDACTED_LARK_APP_ID_1",
  "bitable_app_token": "your_bitable_token",
  "bitable_table_id": "your_table_id"
}
```

## 文件结构

```
token-reporter/
├── SKILL.md
├── config.example.json    # 配置模板(安装时复制为 config.json)
├── scripts/
│   └── report.py          # 核心统计脚本
└── references/
    └── jsonl-structure.md # JSONL 数据结构参考
```

## 错误处理

| 错误 | 处理 |
|------|------|
| JSONL 文件损坏 | 跳过该行,记录警告 |
| 无当日数据 | 报告"当日无数据" |
| 飞书 API 失败 | 重试3次,失败后本地缓存结果 |
| config.json 不存在 | 提示复制 config.example.json |
| Memory 文件不存在 | 产出标记为"无记录" |

Attribution

aAAaqwqaAAaqwq
View sourceMore from aAAaqwq →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Ultra-compressed communication mode that cuts output tokens while keeping technical accuracy. Levels: lite, full, ultra and the wenyan variants. Use for /caveman, "caveman mode", "talk like caveman", "be brief" or "less tokens".

1066601 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

686011 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3351 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

651 votes

math-skill

A comprehensive mathematical reasoning skill for AI assistants — handles arithmetic to research-level problems with rigorous step-by-step reasoning, systematic verification, and transparent uncertainty handling

381 votes
View all in ai-agents →