Skill Insight 🦞
By Hal Labs — Part of the Hal Stack
What it does: Analyzes skill usage data you already have. Generates reports, tracks success/failure, identifies dead weight. It does not automatically collect data for you.
The Honest Scope
This skill is a data analysis and reporting tool. It assumes usage data already exists. If you don't collect any, the reports will be empty.
What it CAN do well:
- - Generate readable usage reports (daily/weekly/monthly)
- Track success vs failure rates per skill
- Recommend which zero-use skills to uninstall
- Work fully automatically for
script-type skills (cron scan)
What it CANNOT do automatically:
- - Detect
route-type skill calls — these happen inside the AI's reasoning, never appearing in session text - Know which skills you actually use without you telling it
Setup is required. See the section below.
Quick Setup (3 steps)
Step 1 — Add skills to your registry
CODEBLOCK0
Step 2 — Choose a data collection method
This is the critical part. Pick one that matches your workflow:
Option A: For script-type skills only (easiest, automatic)
# Add to crontab -e:
0 9 * * * cd ~/.openclaw/workspace/skills/skill-insight && bash scripts/cron_wrapper.sh >> ~/.local/log/skill-insight.log 2>&1
This runs daily and scans your session history for skill scripts that were executed via
exec commands. Works for
script access_type skills.
Will NOT detect route-type skills.
Option B: For route-type skills (requires agent cooperation)
Add to your agent's HEARTBEAT.md or equivalent:
CODEBLOCK2
Option C: Manual (lowest effort, most incomplete)
CODEBLOCK3
Step 3 — Generate reports
CODEBLOCK4
How Data Collection Works
Understanding access_type helps you know what's covered:
| access_type | Example | Auto-scan works? | Manual record needed? |
|---|
| INLINECODE9 | INLINECODE10 , INLINECODE11 | ✅ Yes (cron scan) | ✅ Appreciated |
| INLINECODE12 |
Skill triggered by description match | ❌ No | ✅
Required |
|
tool | MCP tool, built-in tool | ❌ No | ❌ Not applicable |
If most of your skills are route-type (most OpenClaw skills), Option B is the only way to get meaningful data.
Setting Up Auto-Record for Route-Type Skills
If your agent supports HEARTBEAT.md or similar periodic scripts, add this:
CODEBLOCK5
For OpenClaw agents with proactive agent protocols (WAL/Working Buffer), the record call can be inserted after the WAL write step.
Commands Reference
CODEBLOCK6
Output Language
Use --lang en for English, --lang zh for Chinese. Falls back to English if unset.
Architecture
CODEBLOCK7
Philosophy
You can't optimize what you don't measure.
This skill answers: which skills am I actually using? Which ones are dead weight? Is this skill reliable?
The goal isn't to use every skill — it's to know which ones earn their place.
技能洞察 🦞
由 Hal Labs 开发 — Hal Stack 系列组件
功能说明:分析您已有的技能使用数据。生成报告、追踪成功/失败情况、识别无效技能。它不会自动为您收集数据。
诚实的能力范围
本技能是一个数据分析与报告工具。它假设使用数据已经存在。如果您不收集任何数据,报告将为空。
它能出色完成的工作:
- - 生成可读的使用报告(日/周/月)
- 追踪每个技能的成功与失败比率
- 推荐卸载零使用率的技能
- 对脚本类型技能完全自动化运行(定时扫描)
它无法自动完成的工作:
- - 检测路由类型技能调用——这些发生在AI推理过程中,不会出现在会话文本中
- 在您告知之前知道您实际使用了哪些技能
需要进行设置。 请参见下方章节。
快速设置(3步)
第1步 — 将技能添加到注册表
bash
从您已安装的技能开始:
bash scripts/add_skill.sh <技能名称> <分类> <描述>
示例:bash scripts/add_skill.sh fullstack-dev development 后端架构
第2步 — 选择数据收集方法
这是关键部分。选择一种符合您工作流程的方法:
选项A:仅适用于脚本类型技能(最简单,自动)
bash
添加到 crontab -e:
0 9
* cd ~/.openclaw/workspace/skills/skill-insight && bash scripts/cron_wrapper.sh >> ~/.local/log/skill-insight.log 2>&1
这将每天运行并扫描您的会话历史,查找通过exec命令执行的技能脚本。适用于script访问类型的技能。不会检测路由类型技能。
选项B:适用于路由类型技能(需要代理配合)
添加到您的代理的HEARTBEAT.md或等效文件中:
bash
在任何技能成功执行后:
bash scripts/record.sh <技能名称> <使用场景> --lang zh
如果执行失败:
bash scripts/record_outcome.sh --skill <技能名称> --scene <场景> failed <原因> --lang zh
选项C:手动(最省力,最不完整)
bash
在任何技能调用后,运行:
bash scripts/record.sh <技能名称> <场景>
第3步 — 生成报告
bash
bash scripts/report.sh --period week --lang zh # 中文
bash scripts/report.sh --period week --lang en # 英文
bash scripts/analyze.sh --period 7 # 未使用技能分析
数据收集工作原理
了解access_type有助于您知道覆盖范围:
| accesstype | 示例 | 自动扫描有效? | 需要手动记录? |
|---|
| script | bash meeting.sh, bash ainews_cron.sh | ✅ 是(定时扫描) | ✅ 建议 |
| route |
通过描述匹配触发的技能 | ❌ 否 | ✅
必需 |
| tool | MCP工具,内置工具 | ❌ 否 | ❌ 不适用 |
如果您的大部分技能是路由类型(大多数OpenClaw技能),选项B是获取有意义数据的唯一方式。
为路由类型技能设置自动记录
如果您的代理支持HEARTBEAT.md或类似的定期脚本,请添加以下内容:
技能使用追踪
- - 任何技能使用后:bash scripts/record.sh <技能名称> <场景> --lang zh
- 如果技能失败:bash scripts/record_outcome.sh --skill <技能名称> --scene <场景> failed --lang zh
- 每日:bash scripts/report.sh --period today --lang zh
对于具有主动代理协议(WAL/工作缓冲区)的OpenClaw代理,可以在WAL写入步骤之后插入记录调用。
命令参考
bash
记录技能调用
bash scripts/record.sh <技能> <场景> # 默认为成功
bash scripts/record.sh <技能> <场景> skipped # 明确跳过
更新结果
bash scripts/record_outcome.sh
failed <原因>
bash scripts/record_outcome.sh --skill <名称> --scene <模式> failed <原因>
报告
bash scripts/report.sh --period today|week|month|all [--lang zh|en]
bash scripts/analyze.sh --period 7|30 [--lang zh|en]
注册表
bash scripts/add_skill.sh <名称> <分类> <描述> [installed]
会话扫描(仅脚本类型)
bash scripts/scan_sessions.py [--lang zh|en]
输出语言
使用--lang zh输出中文,--lang en输出英文。未设置时默认使用英文。
架构
skill-insight/
├── scripts/
│ ├── record.sh / .py # 记录调用
│ ├── record_outcome.sh / .py # 更新结果
│ ├── report.sh / .py # 使用报告
│ ├── analyze.sh / .py # 未使用技能分析
│ ├── scan_sessions.sh / .py # 会话扫描器(仅脚本类型)
│ ├── add_skill.sh / .py # 添加到注册表
│ ├── cron_wrapper.sh # 每日定时任务包装器
│ ├── i18n.py # 翻译
│ └── path_utils.py # 路径解析
├── data/ # ← 您的数据(不发布)
│ ├── skill_registry.json
│ └── usage.json
├── sample/ # 示例数据
└── SKILL.md
理念
你无法优化你无法衡量的东西。
这个技能回答的问题是:我实际在使用哪些技能?哪些是无效的?这个技能可靠吗?
目标不是使用每一个技能——而是知道哪些技能值得保留。