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-cabinet

v0.2.0

Published

Five Ming-cabinet-style role agents for opencode: a Grand Secretary who frames and dispatches the task, plus a Researcher, an Executor, a Reviewer and an Inspector with a hard acceptance loop.

Readme

opencode-cabinet

Five Ming-cabinet-style role agents for opencode, modeled on the cabinet workflow used in Qoder. Works on both runtimes from one package:

  • OpenCode 2 — the default export's setup(ctx) registers an agent.transform that upserts the five roles and sets the default agent.
  • opencode 1.x — the server(input, options) export returns a config hook that injects agent definitions into the merged config (the oh-my-openagent pattern).

User-defined entries always win over the shipped defaults, key by key, on both runtimes.

The roster

| Agent | Mode | Role | |---|---|---| | grand-secretary | primary | Captain. Frames the task, breaks it into subtasks, dispatches members with the task tool, adjudicates conflicts, consolidates the deliverable. | | hanlin-researcher | subagent | Research and drafting. Gathers and screens sources, separates facts from inference, writes the report draft. | | works-executor | subagent | Hands-on work. Runs code, experiments and data collection, produces output files — the only member allowed to edit the workspace. | | court-reviewer | subagent | Verification. Audits evidence chains, logic and counterexamples; rejects substandard conclusions with concrete remediation requirements. | | censor-inspector | subagent | Final acceptance. Checks subtask completion, conclusion/evidence separation and open issues; the task is done only when it passes. |

The workflow is a closed loop: the Grand Secretary dispatches, members report back, the Court Reviewer bounces anything weak, and the Censor Inspector gives the final verdict. The Grand Secretary's prompt mandates acceptance before declaring completion.

The plugin also sets default_agent to grand-secretary, so opencode opens in the captain instead of build — every session starts with him framing and dispatching the work. An explicit default_agent in your config wins over the plugin.

Install

From npm (recommended)

Add the package name to the plugin array in opencode.json (global ~/.config/opencode/opencode.json or per-project .opencode/opencode.json):

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

That's it. opencode installs npm plugins automatically with Bun at startup (cached under ~/.cache/opencode/node_modules/) — no manual npm install. Restart opencode, then confirm:

opencode plugin list           # shows opencode-cabinet

One-command alternative (writes the config for you):

opencode plugin add opencode-cabinet    # OpenCode 2
opencode plugin opencode-cabinet -g     # opencode 1.x

With the installer script

The package ships scripts/install.js, which wires the plugin into the config file for you — idempotent, backs up before writing, and refuses to touch a file it cannot parse (e.g. JSONC):

cd opencode-cabinet
npm install                      # postinstall runs the installer
# or run it directly:
node scripts/install.js          # global ~/.config/opencode/opencode.json
node scripts/install.js --project /path/to/project   # <project>/.opencode/opencode.json
node scripts/install.js --config /path/to/opencode.json
node scripts/install.js --dry-run                    # show, don't write

Local path plugin

Point opencode at the directory in opencode.json:

{
  "plugin": ["/absolute/path/to/opencode-cabinet"]
}

Restart opencode after changing the config, then check:

opencode agent list

Options

Per-agent model overrides, in case you want a different model for different roles:

{
  "plugin": [
    [
      "opencode-cabinet",
      {
        "models": {
          "grand-secretary": "anthropic/claude-sonnet-5",
          "works-executor": "openai/gpt-6.1-mini"
        }
      }
    ]
  ]
}

Agents without an override inherit opencode's default model.

Permissions

Permissions are part of the design, not decoration:

  • The Grand Secretary may read, search the web and dispatch to the four members, but cannot edit files or run shell commands — hands-on work goes through the Works Executor.
  • The Works Executor is the only member with edit: allow.
  • The Court Reviewer, Hanlin Researcher and Censor Inspector can read, search and run read-only shell commands for reproduction, but cannot edit.
  • No subagent can fan out to further subagents (task: deny); only the captain dispatches.

A user-defined entry for the same agent name in opencode.json overrides these defaults key by key, so you can widen or tighten any rule without forking the plugin. The key is agents on OpenCode 2 ("agents": { "grand-secretary": { ... } }) and agent on opencode 1.x; OpenCode 2 also renamed two permission actions — bash becomes shell and task becomes subagent — which this plugin maps automatically.

Layout

opencode-cabinet/
├── package.json        # entrypoint (main / exports["./server"]), postinstall wiring
├── index.js            # plugin: default export { id, setup, server }; v2 agent.transform + v1 config hook
├── scripts/
│   └── install.js      # install-time config wiring (idempotent, backup, JSONC-safe)
├── agents/             # one prompt file per role, English
│   ├── grand-secretary.md
│   ├── hanlin-researcher.md
│   ├── works-executor.md
│   ├── court-reviewer.md
│   └── censor-inspector.md
├── test/sandbox/       # minimal opencode.json loading the plugin by path
└── test/sandbox-npm/   # minimal opencode.json loading the plugin by npm name

Verify

# OpenCode 2
opencode debug agents         # lists all agents (JSON)
opencode api GET /api/agent   # first id = the resolved default agent

# opencode 1.x
opencode agent list           # should show the five cabinet agents
opencode agent list --pure    # baseline without external plugins

# full resolved config of one agent (prompt, description, color, permissions)
opencode debug agent grand-secretary     # 1.x

To verify the online npm path exactly as another user would experience it, isolate the global config so only the sandbox's "plugin": ["opencode-cabinet"] applies:

cd test/sandbox-npm
XDG_CONFIG_HOME=$(mktemp -d) opencode debug agents   # five agents = auto-install worked

test/sandbox-override additionally exercises the models option and a user-defined agent entry overriding the shipped defaults key by key.

Credits

Registration pattern follows oh-my-openagent (config-hook agent injection); the role design follows the Qoder cabinet setup.