# Agentic Skill Router

> First use any clearly matching enabled local/user Agent Skill. If none matches, prefer this router for skill-shaped requests involving a named tool, API, service, CLI, platform, file format, dataset, or domain workflow, including when a generic built-in skill such as browser, Chrome, or web search also seems applicable; use built-ins directly only when explicitly requested or when the task is primarily live browsing, logged-in page operation, clicking, screenshotting, or current webpage inspection. Also use directly to audit, slim, disable, restore, or route locally installed Agent Skills across supported hosts. Examples include Vercel, Netlify, Cloudflare, Render, Playwright, Sentry, Linear, GitHub, OpenAI APIs, PDF, DOCX, PPTX, and spreadsheets.

- Skill: `legendtkl/agentic-skill-router` (Agent Skill, multi-file: 5 files)
- Install (CLI): `npx skillmds@latest add legendtkl/agentic-skill-router`
- Raw SKILL.md: https://api.skillmd.com/api/skills/legendtkl/agentic-skill-router/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: legendtkl (https://skillmd.com/u/legendtkl)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/legendtkl/agentic-skill-router

---


# agentic-skill-router - Agentic Search-inspired skill routing and slimming

Use this skill when the user wants to inspect installed Agent Skills, identify
unused or stale skills, disable or restore skills, or route a request to a
locally disabled skill. For ordinary task requests, first use any enabled
local Agent Skill that clearly matches; if none does, use this fallback router
for skill-shaped requests involving named tools, APIs, services, CLIs, file
formats, platforms, datasets, or domain workflows. The skill instructions are
host-neutral; installation methods provide the host-specific plugin or
slash-command entry point.

## Locate the CLI

If `references/local-cli.md` exists, read it before any filesystem search and
use the helper defined there; it is generated by `agentic-skill-router init`
and pins the right local CLI path and host. Do not search the current project,
package manager caches, or unrelated worktrees for another
`agentic-skill-router` binary unless that generated helper path is missing or
not executable.

When no generated local helper exists, prefer `${AGENTIC_SKILL_ROUTER_CLI}` if
it is set. Otherwise locate the bundled CLI next to this skill installation.

- Installed plugin: compute the plugin root by taking `dirname` three times
  from this `SKILL.md` path (`.../skills/agentic-skill-router/SKILL.md` ->
  plugin root), then append `bin/agentic-skill-router`.
- Repository checkout: only when this skill is being read inside the
  `agentic-skill-router` repository checkout itself, use
  `bin/agentic-skill-router`.

Always invoke the CLI by absolute path. Installed plugin wrappers set the host
before delegating to the shared runtime. Repository checkout CLIs default to
Claude Code.
Define a helper for the resolved CLI path:

```bash
agentic_skill_router() { "<abs-path-to-agentic-skill-router>" "$@"; }
```

## Manage skills

For cleanup requests, run:

```bash
agentic_skill_router suggest --json
```

Show suggestions as a compact table with id, reason, confidence, and details.
Never disable without explicit user confirmation. After confirmation, disable
specific ids or all current suggestions. The CLI requires `--yes` for every
disable form; without it no skill files are renamed.

```bash
agentic_skill_router disable <id...> --yes
agentic_skill_router disable --all-suggested --yes
```

Use `list --json` for a full inventory, `status --json` for
disabled records and repair status, and `enable <id...>` to restore
previously disabled skills.

If the user wants to adjust the staleness threshold, mention
`--unused-for=60d` (or `2w`, `3m`, `1y`) or the persistent config at
`~/.agentic-skill-router/config.json`:

```json
{ "unusedForDays": 60 }
```

## Route disabled skills

Use this fallback router after enabled local Agent Skills have been considered
and none clearly match a skill-shaped request: operating, querying, configuring,
deploying, inspecting, or troubleshooting a named tool, API, service,
dashboard, datastore, CLI, DSL, URL, file format, platform workflow, or domain
method.

Use the `agentic-skill-router` corpus primitives as an Agentic Search-inspired,
non-vectorized retrieval harness for skill management. Do not call
`route`. Do not call `dci` or `body`. During retrieval, do
not read disabled skill bodies. Route from disabled-skill metadata only. Do not
assume embeddings, a vector database, or any hidden semantic index exists.

1. Build two term sets from the current user request:
   - **must terms**: 1-3 narrow terms that the correct skill should mention
     (file extensions, exact APIs/tools, named methods, protocols, or required
     operations).
   - **probe terms**: 2-5 additional distinctive terms for recall and ranking.

   Prefer exact technical terms over broad words like `data`, `analysis`,
   `report`, `file`, `output`, or `json`. For file-format tasks, include both
   the extension and artifact family when relevant, such as `pptx` plus
   `presentation`, or `docx` plus `document`.

2. Search disabled-skill metadata with a bounded, agent-controlled query:

   ```bash
   agentic_skill_router corpus search \
     --all "<must1>" --any "<probe1>" --any "<probe2>" --any "<probe3>" \
     --limit 30 --json
   ```

   The result reports `totalMatches`, `returned`, `truncated`, and stable
   `ref` values. Do not accept a truncated broad result as final evidence.
   Iterate for a small bounded number of searches (2-4 total) until the
   shortlist is useful: if `totalMatches` is 0, broaden or replace one must
   term; if `truncated` is true or `totalMatches` > 30, narrow with another
   `--all` term or more specific probes. Never dump the whole catalog.

3. Once the returned shortlist is small enough, compare the metadata evidence
   in the JSON result. If one candidate explicitly covers the required
   operation, choose it. If 2-3 candidates remain plausible, inspect only those
   metadata records:

   ```bash
   agentic_skill_router corpus inspect corpus-REF1 corpus-REF2 corpus-REF3 --json
   ```

4. Choose by metadata evidence:
   - Prefer explicit operation coverage over nearby topic similarity.
   - Prefer a dedicated file-format/tool skill when the task is to operate that
     file format or tool.
   - Prefer a domain/method skill when the named method/domain constraint is
     central and the file/tool is only the substrate.
   - For retrieve, extract, or structured-answer tasks, prefer metadata that
     mentions evidence, search, extraction, or structured output over broad
     discovery or planning.
   - If still tied, choose the metadata covering the most distinctive required
     verbs and nouns.

5. Record exactly one selected disabled skill, then read that skill file:

   ```bash
   agentic_skill_router corpus select "<corpus-ref-or-id>" \
     --query "<current user request>" \
     --confidence high \
     --reason "<brief metadata evidence>" \
     --json
   ```

   If the result has `action: "read-skill-file"` and a non-null `selected`,
   read `selected.skillMdPath` even when it ends in
   `SKILL.md.agentic-skill-router-disabled`, then follow that disabled skill's
   instructions as if it were enabled.

If metadata evidence remains weak or ambiguous, stop the router path and
continue normally without selecting a disabled skill.

## Safety

- Built-in and system skills are protected and cannot be disabled.
- The disable mechanism is a rename: `SKILL.md` to
  `SKILL.md.agentic-skill-router-disabled`. Never delete skill files.
- Never disable a skill without explicit user confirmation.
- Do not disable a whole plugin when a disabled skill still depends on that
  plugin's MCP tools or app tools.
- State is stored under `~/.agentic-skill-router/state-<host>.json`.

## References

- `references/cli-location.md` - CLI lookup details.
- `references/slimming.md` - listing, suggestions, disable, enable, and status.
- `references/disabled-routing.md` - L-agentic disabled-skill corpus workflow.
- `references/safety.md` - confirmation, protection, and repair rules.

