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-dynamic-subagents

v0.3.1

Published

OpenCode plugin that generates native model-pinned subagents from config.

Readme

Dynamic Subagents Plugin

npm version

Adds generated model-pinned subagents to OpenCode.

Instead of trying to create truly ad hoc subagents at runtime, this plugin reads dynamicSubAgents.json and generates normal OpenCode subagents for each allowed model and thinking-level combination.

What You Get

  • Native OpenCode subagents with no task override
  • One generated agent per allowed model and variant
  • Model descriptions kept in config and surfaced in agent descriptions
  • Predictable native task/session behavior

Install

{
  "plugin": ["opencode-dynamic-subagents@latest"]
}

Restart OpenCode after installing or updating the plugin.

Quick Start

Create ~/.config/opencode/dynamicSubAgents.json:

{
  "$schema": "https://github.com/cgasgarth/opencode-dynamic-subagents/blob/main/dynamicSubAgents.schema.json",
  "version": 1,
  "defaults": {
    "allowedModels": [
      {
        "id": "openai/gpt-5.4",
        "name": "gpt54",
        "description": "Best default choice for broad reasoning and higher-quality subagent work."
      },
      {
        "id": "openai/gpt-5.3-codex-spark",
        "name": "spark",
        "description": "Faster, cheaper code-focused option for small code implementations or quickly searching for things. Best for tightly scoped, shorter tasks because it has a more limited context window."
      }
    ],
    "allowedVariants": ["low", "high"]
  }
}

This generates native subagents like:

  • @dsa-gpt54-low
  • @dsa-gpt54-high
  • @dsa-spark-low
  • @dsa-spark-high

How It Works

The plugin only runs at config time.

  1. It loads dynamicSubAgents.json.
  2. It expands the allowed model list and allowed variant list into concrete subagent definitions.
  3. It injects those generated agents into config.agent.
  4. OpenCode then treats them like normal named subagents.

If a generated name collides with an existing agent, the existing agent wins and the generated one is skipped.

Configuration

The plugin reads:

  • ~/.config/opencode/dynamicSubAgents.json
  • $OPENCODE_DYNAMIC_SUBAGENTS_CONFIG for testing overrides

Supported config:

{
  "$schema": "https://github.com/cgasgarth/opencode-dynamic-subagents/blob/main/dynamicSubAgents.schema.json",
  "version": 1,
  "defaults": {
    "model": "openai/gpt-5.4",
    "variant": "high",
    "prompt": "Optional shared prompt for generated subagents.",
    "temperature": 0.2,
    "top_p": 0.9,
    "hidden": false,
    "steps": 20,
    "permission": {},
    "options": {},
    "allowedModels": [
      {
        "id": "openai/gpt-5.4",
        "name": "gpt54",
        "description": "Best default choice for broad reasoning and higher-quality subagent work."
      },
      {
        "id": "openai/gpt-5.3-codex-spark",
        "name": "spark",
        "description": "Faster, cheaper code-focused option for small code implementations or quickly searching for things. Best for tightly scoped, shorter tasks because it has a more limited context window."
      }
    ],
    "allowedVariants": ["low", "medium", "high", "xhigh"]
  },
  "limits": {
    "maxSubagentNameLength": 64
  }
}

Notes:

  • allowedModels is the source of truth for which model families get generated.
  • name is optional but recommended when you want short agent names like dsa-spark-high.
  • description is optional and becomes part of the generated agent description.
  • If allowedModels is omitted, the plugin falls back to defaults.model.
  • If allowedVariants is omitted, the plugin generates one agent per model and uses defaults.variant if provided.

Usage

Once generated, use the agents like any other OpenCode subagent:

Use @dsa-spark-high to scan a small part of the codebase.
Use @dsa-gpt54-high to review the final shortlist.

This approach keeps model choice explicit and stable without depending on dynamic runtime task rewriting.

Dev

npm install
npm run check
npm run build