Track and visualize skill invocation frequency across your OpenCode sessions. Automatically discovers installed skills, logs every skill() call, and renders an ASCII bar chart on demand.
Skill 调用统计 (week)
────────────────────────────────────────────────
bilibili ████████████████████████████ 42次 41%
pdf ████████████████ 26次 25%
docx ██████ 10次 10%
xlsx █████ 8次 8%
mcp-builder ████ 7次 7%
mcp-nutstore ███ 5次 5%
[removed] chrome-cdp █ 2次 2%
────────────────────────────────────────────────
总计: 100 次 | 收录 skill: 12 个
- Automatic tracking — each
skill()call is logged with timestamp and session ID - Flexible time windows —
today,week,month,all, or customlast:Nd - File system scan — auto-discovers installed skills from standard directories
- Removed detection — marks skills that were previously installed but have been removed
- Zero-config — works out of the box, optional config file for customization
- Automatic log trimming — keeps the last 1000 records to prevent unbounded growth
{
"plugin": ["opencode-skill-stats"]
}Add a command entry so you can type /skill-stats in chat:
{
"plugin": ["opencode-skill-stats"],
"command": {
"skill-stats": {
"template": "Call skill_stats tool to show skill invocation statistics.",
"description": "查询 skill 调用频率统计"
}
}
}If you skip this step, you can still use the plugin by asking the AI to "show skill stats" — the AI will call the skill_stats tool automatically.
Restart OpenCode after making changes.
/skill-stats → show stats for default period (configurable, default: week)
/skill-stats month → show stats for the last 30 days
/skill-stats last:7d → show stats for the last 7 days
/skill-stats all → show all-time stats
Say "统计 skill 调用" or "查看 skill 使用情况" — the AI will call the skill_stats tool automatically.
Create ~/.config/opencode/skill-stats.json:
{
"default_period": "week"
}Supported periods: today, week, month, all, last:Nd
- Logging: The plugin hooks into
tool.execute.after, interceptsskill()calls, and writes a JSONL record to~/.config/opencode/skill-stats.jsonl - Discovery: On query, it scans standard skill directories (
~/.config/opencode/skills/,~/.agents/skills/,~/.claude/skills/) and maintains a persistent registry snapshot - Query: Filters records by time window, groups by skill name, sorts by frequency, and renders an ASCII bar chart
| File | Purpose |
|---|---|
~/.config/opencode/skill-stats.jsonl |
Rolling log (max 1000 entries) |
~/.config/opencode/skill-stats.json |
Optional user config |
~/.config/opencode/skill-stats-registry.json |
Auto-maintained skill snapshot |
MIT