npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

opencode-skill-usage

v1.3.0

Published

OpenCode plugin that records skill invocations and auto-registers a /skill-usage command for querying stats

Downloads

734

Readme

opencode-skill-usage

npm version License: MIT Node

OpenCode plugin that records skill invocations and auto-registers a /skill-usage slash command for querying the stats.

  • Write: tool.execute.before + command.execute.before hooks record every skill invocation — both agent-initiated calls and user slash-commands.
  • Query: a config hook auto-registers the bundled skill-usage command so it is available as /skill-usage with zero extra configuration.

Zero runtime dependencies, plain JavaScript ESM.

Install

Add the plugin to ~/.config/opencode/opencode.json:

{
  "plugin": ["file:///absolute/path/to/opencode-skill-usage"]
}

For npm installs:

{
  "plugin": ["opencode-skill-usage"]
}

Restart OpenCode. The /skill-usage command is registered automatically by the plugin's config hook — no skills.paths or manual skill setup needed.

Usage

Run /skill-usage in the TUI, or just ask the agent:

  • "Show me skill call stats"
  • "Which skill was called the most in the last 7 days"
  • "How many skill calls happened inside the opencode-image-vision project"

The command injects the skill body (query templates + log format docs) into the session, and the agent aggregates the log as requested.

The agent also triggers the query automatically when the conversation mentions skill usage statistics or reports — even content that looks like plain context or notes — since the injected skill body instructs it to treat such content as an active request.

Log location

The skill-usage.jsonl file is written to the opencode config directory, independent of where the plugin is installed:

  • ~/.config/opencode/skill-usage.jsonl

Because the log lives outside the plugin package directory, upgrading or reinstalling the plugin never deletes it. On upgrade from older versions, a legacy TSV skill-usage.log is converted to JSONL once at plugin startup, then removed.

Each line is one JSON object (JSONL):

{"timestamp":"2026/08/10 23:28:22","skill":"tech-briefing","directory":"/Users/showlotus/Desktop/MyCode/xxx","call_type":"manual"}

The timestamp is local time in YYYY/MM/DD HH:MM:SS format. The call_type is manual (user slash-command) or auto (agent-initiated).

Manual aggregation

node -e 'const r=require("fs").readFileSync(process.env.HOME+"/.config/opencode/skill-usage.jsonl","utf8").trim().split("\n").filter(Boolean).map(JSON.parse),c={};r.forEach(x=>c[x.skill]=(c[x.skill]||0)+1);console.log(Object.entries(c).sort((a,b)=>b[1]-a[1]).map(([k,v])=>v+"\t"+k).join("\n"))'

How it works

opencode.json plugin entry
        ↓
plugin loaded → config hook fires
        ↓
registers /skill-usage command (template = bundled SKILL.md body)
        ↓
tool.execute.before / command.execute.before hooks
append JSONL lines to skill-usage.jsonl on every skill invocation

The config hook works because Command init runs after Plugin config hooks (the Command layer depends on the Skill layer, which finishes before Command starts).

Project layout

opencode-skill-usage/
├── package.json          # npm manifest, files includes plugin/ and skills/
├── plugin/
│   └── index.js          # config hook (register command) + tool/command execute hooks (write log)
├── skills/
│   └── skill-usage/
│       └── SKILL.md      # query templates, used as the command template
└── README.md

License

MIT