Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

agent-router-setup

БесплатноЗапускает вложенные скриптыНе проверен

Installs, configures or removes the agent-router hook (routes a generic Agent spawn to the real project/plugin expert). Triggers: agent-router, wrong agent…

kochetkov-maот kochetkov-ma★ 41 звезда на GitHub

Об этом скилле

Agent Router

EXPERIMENTAL. Installs one self-contained PreToolUse hook on the Agent tool. When the main loop spawns a generic agent although a real expert owns the task — a project agent from .claude/agents/, or an installed brewcode specialist — the hook denies the spawn and names the expert; an uncertain fit is only a nudge. Runtime behavior lives in the hook file and a JSON config; this skill resolves mode and level, then delegates the file work to the brewcode:hook-creator agent, which follows the runbook.

Prompt contract

$ARGUMENTS is one free-form RU/EN prompt; mode tokens and flags (--unattended) may sit anywhere in it.

  1. Mode: strip --unattended first: a flag, never a mode, level or name (Modes, Unattended). Then an explicit mode token wins outright; else the most distinct whole-word keyword hits (table in Step 2). Tie with a destructive mode (purge) or of install with a removal mode (uninstall) -> AskUserQuestion; with status -> status; of two other mutating modes -> the keyword that comes first. No hit or empty -> status.
  2. Scope: prose that is not a mode/id/path is still input: take the id, path or target from it.
  3. Ask: at most ONE AskUserQuestion (max 4 questions) to resolve mode and scope, before any work, only when the answer changes what gets written. A read-only run asks nothing. --unattended asks nothing: an open question there ends in RESULT skipped (Modes, Unattended).

Print once, before the first action (labels literal, values in the conversation language):

PLAN — brewtools:agent-router-setup
INPUT:  <arguments verbatim, or "(empty)">
MODE:   <resolved> — <explicit | matched keyword: X | default>
SCOPE:  <resolved paths / target / level / flags>
DO:     <2-5 imperative bullets>
RESULT: <what the user ends up holding>

What the hook does (informational — skill does NOT implement)

Tier hooks.PreToolUse entry (timeouts in seconds) Behavior
1 — always on matcher Agent: {"type":"command","command":"node","args":["<PD>/.claude/hooks/agent-router.mjs"],"timeout":5}, where <PD> is the dollar-brace CLAUDE_PROJECT_DIR token, stored unexpanded (written out here it would be replaced by a path at load) deterministic, <100 ms incl. node startup, zero tokens
2 — opt-in (level strict) matcher Agent: {"type":"agent","prompt":"<inlined judge-prompt.md>","timeout":30,"statusMessage":"agent-router: checking agent fit"}. No model key: Claude Code then runs its default small model (claude-haiku-5-5 on 2.1.296), and any explicit model is reported as drift an LLM judges a generic spawn against the project roster
heartbeat — with tier 2 matcher StructuredOutput: the tier-1 command handler again counts the judge's verdicts for --judge-health

Tier 1 decision order — it allows as early as it can:

# Check Result
1 tool is not Agent allow
2 agent_id present: a subagent's spawn, or a hook verifier (hook-agent-*) allow; only the main loop is policed
3 enabled:false, or a config file that exists but does not parse allow
4 the picked type is a project agent (.claude/agents/**/*.md, by frontmatter name) allow
5 the picked type is not on genericTypes allow. An omitted subagent_type counts as general-purpose (the Agent-tool default) and is policed
6 agent-router: override (also allow / skip) in the description or prompt allow, silently: the escape hatch, matched on the untruncated text before any rule and named in every deny message
7 STRONG intent: an authoring verb aimed at the artifact (skill -> brewcode:skill-creator, agent -> brewcode:agent-creator, hooks -> brewcode:hook-creator, bash/sh -> brewcode:bash-expert), not behind do not / never / how to / instead of deny naming the expert: the first ranked project agent that scores and covers the intent (its frontmatter matches the rule's domain regex), else the plugin specialist, and that one only when found on disk (project agents, user agents, plugin cache). Not found -> a notice, never a deny
8 roster scoring: every .claude/agents/**/*.md frontmatter (name + Triggers:), each agent's own name struck from the text unless it lists that name in Triggers: one clear winner (minScore + margin over the runner-up) -> deny naming it; several plausible -> additionalContext nudge with the top 3; nothing -> silent allow
9 WEAK intent: a bare artifact mention (SKILL.md, .claude/agents/, hooks.json, an event name, a shebang) never denies; nudges, merged with a step-8 nudge into one message
10 anti-loop guard a (session, project root, task) is denied at most once; the retry passes with a nudge. task = the description, or the prompt's first 300 normalized chars when there is none
11 any error fail open

neverFlag (types ne

Полный SKILL.md на GitHub

Установить agent-router-setup в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Bash
AskUserQuestion
Agent

Вложенные файлы

README.mdassets/INSTALL.mdassets/agent-router.mjsassets/judge-prompt.md

FAQ

Что делает скилл agent-router-setup?

Installs, configures or removes the agent-router hook (routes a generic Agent spawn to the real project/plugin expert). Triggers: agent-router, wrong agent, route to expert, роутер агентов, не тот агент.

Как установить скилл agent-router-setup?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл agent-router-setup запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить agent-router-setup с