agent-router-setup

Installation
SKILL.md

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):

Installs
6
GitHub Stars
41
First Seen
Aug 14, 2026