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

@moterodiaz/agent-router

v0.1.0

Published

Lightweight task routing for Claude, Codex, and Devin

Readme

agent-router

agent-route classifies a task description into a routing category using Span-01 Lite via OpenRouter. The dispatch wrappers (claude-dispatch, codex-dispatch) launch the right agent with matching prompt framing; Devin picks up the same routing guidance from AGENTS.md (see Devin). Without an API key, it falls back to the first rubric entry with zero cost and exits 0.

task description
      |
  agent-route
      |
   category
   /       \
claude-    codex-      AGENTS.md guidance
dispatch   dispatch    (Devin reads this)

Prerequisites

  • Python 3.10+ (stdlib only — no pip dependencies)
  • Node 18+ (for agent-route-setup)
  • claude and codex CLIs are optional; install only the ones you use
  • Devin is optional and needs no CLI here; it reads AGENTS.md (see Devin)

Install

npm i -g @moterodiaz/agent-router
agent-route-setup           # global: writes to ~ paths, for any Claude/Codex session
agent-route-setup --project # per-repo: writes to ./ paths, for this repo only

What each mode writes

| Path | --global (default) | --project | |------|----------------------|-------------| | Skill file | ~/.claude/skills/agent-route/SKILL.md | ./.claude/skills/agent-route/SKILL.md | | Registry | ~/.config/agent-router/registry.json | ./.agent-router/registry.json | | Routing block | ~/.codex/AGENTS.md (only if ~/.codex exists) | ./AGENTS.md | | Routing block | ~/CLAUDE.md (if it exists) | ./CLAUDE.md (if it exists) |

Registry is seeded from the bundled default only if the target file does not exist. Running setup again is safe — it replaces the marker block, not duplicates it.

Flags

| Flag | Effect | |------|--------| | (none) | Global install (same as --global) | | --project | Per-repo install into ./ | | --dry-run | Print what would happen, write nothing | | --uninstall | Remove skill dir and routing block |

Uninstall

agent-route-setup --uninstall           # removes global paths
agent-route-setup --project --uninstall # removes project paths

Uninstall removes the installed SKILL.md (the skill directory is removed only if nothing else is inside — files you added are preserved) and the routing block from AGENTS.md and CLAUDE.md. Files are removed only when proven both setup-created and untouched: setup writes .setup-seeded markers recording the installed content's hash (and inode metadata for the registry), so a pre-existing file, an edited file, or a file you recreated yourself is always kept — and a message says so.

From source

bash scripts/install.sh

Installs agent-route, claude-dispatch, codex-dispatch to ~/.local/bin and seeds ~/.config/agent-router/registry.json. The agent-route wrapper uses PYTHONPATH to point at the checkout, so keep the clone in place. Re-run after editing dispatch scripts.

Usage

agent-route claude_dev "task"
agent-route claude_dev "task" --raw
agent-route codex_review "diff summary" --config /path/to/registry.json
claude-dispatch "task"
codex-dispatch "diff summary"

agent-route takes <domain> <context> with optional --raw and --config PATH. claude-dispatch classifies under claude_dev and calls claude with category-specific framing. codex-dispatch classifies under codex_review and calls codex review --uncommitted with matching focus. An explicit --config path must exist, otherwise it exits 2. Devin has no dispatcher; it reads the routing instructions in AGENTS.md and takes the Devin pane when selected by your workflow.

Output

{"category": "routine_implementation", "target": {"model": "deepseek/deepseek-coder", "temperature": 0.0}, "latency_ms": 18}

With --raw, prints only the category key. An unknown domain exits 2.

Devin

Devin is a routing target alongside Claude and Codex, but has no dispatcher script. Integration is guidance-only:

  1. Run agent-route-setup --project in the repo. It writes the routing block into ./AGENTS.md, which Devin reads when it works in that repo. (The global install writes ~/.codex/AGENTS.md, only if ~/.codex exists; that file is for Codex, not Devin.)
  2. The block tells agents to run agent-route to pick a category, use claude-dispatch / codex-dispatch where they apply, and let Devin take the Devin pane when your workflow selects it.
  3. Your workflow decides when to hand a task to Devin — the router never launches it.

Devin can also run agent-route <domain> "task" itself to classify work. agent-route-setup --project --uninstall removes the block.

Registry

Shape: {domain: {rubrics: {key: description}, targets: {key: {model, temperature}}}}. The first rubric key is the fallback for that domain. targets is informational metadata; dispatchers act on the category key.

Lookup order (first file found wins):

  1. ./.agent-router/registry.json (project override — opt-in only, requires AGENT_ROUTER_PROJECT_REGISTRY=1)
  2. ~/.config/agent-router/registry.json (user config)
  3. Bundled registry.default.json (always present)

An explicit --config PATH skips the lookup and uses that path directly (~ is expanded).

Project registry opt-in: set AGENT_ROUTER_PROJECT_REGISTRY=1 to enable the project override. When enabled, agent-route walks from the current directory up the tree, stopping at the first ancestor that contains a .git directory or at $HOME (whichever comes first), and uses the nearest ancestor containing .agent-router/registry.json. A registry inside $HOME itself is checked only when the cwd is $HOME. This lookup is opt-in because a project-controlled registry can reorder rubrics and redirect claude-dispatch to any model — only enable it in repos you trust. The per-repo canonical way to enable it is via direnv: add export AGENT_ROUTER_PROJECT_REGISTRY=1 to the repo's .envrc and run direnv allow. Devin and other agents that run inside the repo are unaffected unless they inherit this env var.

Discovery hint: when agent-route is invoked without --config and finds a project registry but the env var is not set, it prints to stderr:

agent-route: found <path>; set AGENT_ROUTER_PROJECT_REGISTRY=1 to use it

agent-route-setup --project prints the same hint after seeding or keeping the registry.

Environment

Set OPENROUTER_API_KEY to enable classification through OpenRouter's Decisions endpoint (https://openrouter.ai/api/alpha/decisions) using respan/span-01-lite:free. One yes/no (noul) question is asked per rubric key; the key with the highest probability wins.

Fallback

Without OPENROUTER_API_KEY, or on any network failure (4 s timeout), agent-route prints a warning to stderr, outputs the domain's first rubric key, and exits 0. Empty context uses the fallback without a network request. A malformed registry or a domain entry with no rubrics exits 2.

Tests

python3 -m unittest discover tests

The test suite runs without network access.