← 返回
未分类 中文

Skill Analytics

Track skill usage across all agent sessions. Logs every skill invocation to a JSONL file, generates daily summaries with top skills, unused skills, and trend...
跨所有 Agent 会话追踪技能使用情况。将每次技能调用记录到 JSONL 文件,生成每日摘要,展示热门技能、未使用技能及趋势。
netanel-abergel
未分类 clawhub v1.0.0 1 版本 99633.7 Key: 无需
★ 0
Stars
📥 272
下载
💾 0
安装
1
版本
#latest

概述

Skill Analytics

Track which skills are used, when, and why. Turns the skill library into a feedback loop.


Log Format

Every skill invocation should append one line to data/skill-analytics.jsonl:

echo '{"ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","skill":"SKILL_NAME","trigger":"TRIGGER_PHRASE","context":"GROUP_OR_DM"}' \
  >> /opt/ocana/openclaw/workspace/data/skill-analytics.jsonl

Fields:

  • ts — ISO 8601 UTC timestamp
  • skill — skill name (e.g. meetings, supervisor)
  • trigger — short phrase that caused selection (e.g. "schedule meeting", "מה הסטטוס")
  • contextdm, group:, or cron

How to Log (for agents)

Add this at the TOP of any skill (after reading SKILL.md, before doing work):

mkdir -p /opt/ocana/openclaw/workspace/data
echo "{\"ts\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\"skill\":\"SKILL_NAME\",\"trigger\":\"TRIGGER\",\"context\":\"CONTEXT\"}" \
  >> /opt/ocana/openclaw/workspace/data/skill-analytics.jsonl

Replace SKILL_NAME, TRIGGER, CONTEXT with real values.


Triggers for This Skill

  • "skill usage" / "skill stats" / "skill report"
  • "which skills am I using" / "what skills are popular"
  • "analytics report" / "daily skill summary"
  • "unused skills" / "what skills are never used"

Generate Daily Report

#!/bin/bash
LOG="/opt/ocana/openclaw/workspace/data/skill-analytics.jsonl"
TODAY=$(date -u +%Y-%m-%d)
YESTERDAY=$(date -u -d "yesterday" +%Y-%m-%d 2>/dev/null || date -u -v-1d +%Y-%m-%d)

echo "## 📊 Skill Usage Report — $TODAY"
echo ""

# Total invocations (last 24h)
TOTAL=$(grep "$TODAY\|$YESTERDAY" "$LOG" 2>/dev/null | wc -l)
echo "**Total invocations (last 24h):** $TOTAL"
echo ""

# Top skills
echo "### Top Skills"
grep "$TODAY\|$YESTERDAY" "$LOG" 2>/dev/null \
  | jq -r '.skill' \
  | sort | uniq -c | sort -rn \
  | head -10 \
  | awk '{printf "- **%s** — %d uses\n", $2, $1}'
echo ""

# All-time top skills
echo "### All-Time Top Skills"
jq -r '.skill' "$LOG" 2>/dev/null \
  | sort | uniq -c | sort -rn \
  | head -10 \
  | awk '{printf "- **%s** — %d uses\n", $2, $1}'
echo ""

# Unused skills (compare against known list)
KNOWN_SKILLS="ai-pa billing-monitor calendar-setup eval hebrew-nikud maintenance meetings memory-tiering monday-for-agents owner-briefing pa-onboarding self-learning self-monitor skill-master skill-scout supervisor whatsapp youtube-watcher skill-analytics"
echo "### Unused Skills (all-time)"
for skill in $KNOWN_SKILLS; do
  COUNT=$(jq -r '.skill' "$LOG" 2>/dev/null | grep -c "^${skill}$" || echo 0)
  [ "$COUNT" -eq 0 ] && echo "- $skill"
done
echo ""

# Usage by context
echo "### Usage by Context"
jq -r '.context' "$LOG" 2>/dev/null \
  | sort | uniq -c | sort -rn \
  | awk '{printf "- %s: %d\n", $2, $1}'
echo ""

# Recent activity (last 5)
echo "### Recent Activity"
tail -5 "$LOG" 2>/dev/null \
  | jq -r '"- \(.ts | .[11:16]) — \(.skill) [\(.trigger)]"'

Daily Cron (optional)

Add to crontab to auto-send report every morning:

# Skill analytics report — 7:25 AM Israel (before morning briefing)
25 5 * * * /opt/ocana/openclaw/workspace/scripts/skill-report.sh

Report Format (output)

## 📊 Skill Usage Report — 2026-04-03

**Total invocations (last 24h):** 14

### Top Skills
- **supervisor** — 4 uses
- **meetings** — 3 uses
- **whatsapp** — 2 uses
- **owner-briefing** — 2 uses
- **self-monitor** — 1 use

### All-Time Top Skills
- **supervisor** — 28 uses
- **meetings** — 19 uses
...

### Unused Skills (all-time)
- hebrew-nikud
- youtube-watcher

### Usage by Context
- dm: 8
- group:monday-internal-ai: 4
- cron: 2

### Recent Activity
- 07:14 — owner-briefing [morning briefing]
- 07:30 — supervisor [מה הסטטוס]
- 09:02 — meetings [schedule meeting with Daniel]

Reset / Archive

# Archive current log (monthly)
mv /opt/ocana/openclaw/workspace/data/skill-analytics.jsonl \
   /opt/ocana/openclaw/workspace/data/skill-analytics-$(date +%Y-%m).jsonl

# Start fresh
touch /opt/ocana/openclaw/workspace/data/skill-analytics.jsonl

Notes

  • Log file grows ~1KB/day at normal usage — no rotation needed for months
  • If jq not available: python3 -c "import json,sys; [print(json.loads(l)['skill']) for l in sys.stdin]"
  • Log is local only — never sent externally

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 20:19 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Monday For Agents

netanel-abergel
为OpenClaw代理配置monday.com账户,使用GraphQL API或MCP服务器操作看板、条目与更新。适用场景:创建...
★ 1 📥 502

Supervisor

netanel-abergel
PA助手的中央状态仪表盘。当用户询问“状态如何”“你在做什么”“发生了什么”等任何状态或概览问题时使用。
★ 1 📥 414

Calendar Setup

netanel-abergel
逐步向导,将所有者的Google 日历连接至 OpenClaw PA 代理,并授予写权限。使用场景:设置日历。
★ 1 📥 408