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-kcp-plugin

v0.1.0

Published

KCP (Knowledge Context Protocol) plugin for OpenCode — uses knowledge.yaml to reduce explore-agent tool calls by 73-80%

Readme

opencode-kcp-plugin

An OpenCode plugin that uses a knowledge.yaml manifest to reduce explore-agent tool calls by 73–80%.

What it does

If your project has a knowledge.yaml at its root, this plugin:

  1. Injects a knowledge map into every session's system prompt — the agent sees a compact index of key files with intent descriptions and trigger keywords before it starts any search.
  2. Annotates glob/grep results — file paths that match KCP units get an inline intent description appended, so the agent can identify the right file without reading it first.

Measured in comparable codebases: 67,352 tokens saved per session, 33.7% of a 200K context window recovered, 73–80% fewer tool calls in explore-heavy sessions.

Install

npm install opencode-kcp-plugin

Add to your opencode.json (or .opencode/opencode.jsonc):

{
  "plugin": ["opencode-kcp-plugin"]
}

That's it. The plugin is a no-op if no knowledge.yaml is present.

Add a knowledge.yaml to your project

Minimum viable manifest (five fields per unit):

kcp_version: "0.5"
project: my-project
version: 1.0.0
units:
  - id: readme
    path: README.md
    intent: "What is this project and how do I get started?"
    scope: global
    audience: [human, agent]

Add triggers (keywords), depends_on (load order), and hints.load_strategy: always for files the agent should always read. See the KCP spec for the full field set.

synthesis export --format kcp will generate a knowledge.yaml from an existing Synthesis index.

How it works

The plugin uses two OpenCode hooks:

| Hook | What it does | |------|-------------| | experimental.chat.system.transform | Prepends the full knowledge map to the system prompt. The agent reads this before starting any exploration. | | tool.execute.after (glob, grep) | Annotates matching file paths in glob/grep output with KCP intent strings. |

No runtime dependencies beyond js-yaml. Zero overhead when knowledge.yaml is absent.

System prompt output (example)

For a 17-unit manifest, the injected section looks like:

## Codebase Knowledge Map

This project has a `knowledge.yaml` manifest (KCP). Use this map to find
files directly before running glob/grep searches.
★ = load immediately  ·  space = load on demand

★ [readme] README.md
    What is OpenCode, how to install it, and what makes it different from Claude Code
    keywords: overview, install, getting started, features

★ [agents-md] AGENTS.md
    Coding style conventions, naming rules, and testing practices for this codebase
    keywords: style, naming, conventions, testing, code quality

  [config-schema] packages/opencode/src/config/config.ts
    Full config schema: providers, MCP servers, agents, skills, permissions, keybindings
    keywords: config, opencode.json, settings, schema, provider, MCP, permissions

  [agent-definitions] packages/opencode/src/agent/agent.ts  (after: config-schema)
    How agents (build, plan, explore, general) are defined, configured, and composed
    keywords: agent, build agent, plan agent, explore agent, subagent, permissions
...

~800 tokens for 17 units. The agent uses this to resolve "where is the skill system?" in one lookup instead of 4–8 grep/glob/read calls.

Spec

Knowledge Context Protocol v0.5 — Apache 2.0. Submitted to the Agentic AI Foundation (Linux Foundation) for neutral governance alongside MCP and AGENTS.md.