From mk
Automatically detects the appropriate agent, complexity tier, and model for each user message at Phase 0. Always runs first to route tasks in every workflow.
How this skill is triggered — by the user, by Claude, or both
Slash command
/mk:agent-detectorWhen to use
Auto-invoked at Phase 0 by orchestrator to assign agent + model tier. Not user-callable directly.
haikuThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Priority:** HIGHEST - Runs FIRST for every message. Automatically detects the correct agent, task complexity level, and model tier for each user message using a multi-layer scoring system. No manual agent selection needed -- the detector analyzes task content, explicit technology mentions, user intent, project context, and file patterns to route to the right agent with the right model.
references/after-detection.mdreferences/complexity-detection.mdreferences/detection-process.mdreferences/examples.mdreferences/lifecycle-routing.mdreferences/model-selection.mdreferences/multi-layer-detection.mdreferences/scoring-and-thresholds.mdreferences/skill-domain-routing.mdreferences/team-mode.mdreferences/token-budget-levels.mdPriority: HIGHEST - Runs FIRST for every message. Automatically detects the correct agent, task complexity level, and model tier for each user message using a multi-layer scoring system. No manual agent selection needed -- the detector analyzes task content, explicit technology mentions, user intent, project context, and file patterns to route to the right agent with the right model.
ALWAYS - Every user message, no exceptions. This skill fires before any other skill or agent action. It determines who handles the task, at what complexity level, and with which model.
Safety baseline precheck (HARD GATE). Before any other step, scan the context window for the cached-sentinel marker emitted by safety-sentinel-inject.cjs:
## Safety baseline: verified (cached, session <id>)
If the marker IS present (turns 2..N of the same session): emit
Safety baseline: verified (cached) and SKIP the 5-file Read loop below.
The 5 rules remain in context from the inner harness's CLAUDE.md auto-load;
the sentinel only suppresses redundant re-reads.
If the marker is ABSENT (turn 1 of a new session, OR
MEOWKIT_SKIP_SAFETY_SENTINEL=off): Read each of the 5 always-on
safety/baseline rules:
.claude/rules/security-rules.md.claude/rules/injection-rules.md.claude/rules/gate-rules.md.claude/rules/core-behaviors.md.claude/rules/development-rules.mdIf any Read returns "file does not exist" or equivalent, ABORT IMMEDIATELY with the exact message:
SAFETY BASELINE INCOMPLETE: rule <name> not found at .claude/rules/<name>.md
Refusing to route any task. Restore the rule (git checkout / the installer) before retrying.
Do NOT proceed to detection. Do NOT route to any agent. The 5 rules are the deterministic baseline; their absence indicates either repo corruption or a partial install. Replaces the unverified directory-auto-load assumption with a positive existence check.
0b. Phase-zero rule load. After the safety baseline is confirmed, scan context for the cached-sentinel marker:
## Phase-zero rules: verified (cached, session <id>)
If the marker IS present: emit Phase-zero rules: verified (cached) and SKIP the 6-file Read loop. If ABSENT (turn 1 or env-var override), Read each phase-zero file. These govern Phase 0 routing and are read once per agent-detector invocation:
.claude/rules/phase-contracts.md — what each phase expects/produces.claude/rules/agent-routing.md — agent → role → phase table.claude/rules/model-selection-rules.md — task-type → model-tier mapping.claude/rules/scale-adaptive-rules.md — domain CSV → complexity routing.claude/rules/risk-checklist.md — 9 horizontal-risk flags.claude/skills/agent-detector/references/skill-domain-routing.md — intent → skill dispatch table (used at hand-off, Step 5)If any of the 5 rule Reads fails: ABORT with PHASE-ZERO RULE MISSING: <name> — same fail-fast semantics as Step 0. These rules drive the routing logic in steps 2–4; without them, detection silently degrades to keyword-only. The skill-domain-routing reference is advisory dispatch guidance (not a routing rule): if it is absent, log skill-domain-routing reference absent; skill dispatch falls back to inline judgment and continue — do NOT abort.
Agile context detection (additive — Agile-only load). After the 5 phase-zero Reads succeed:
.claude/rules-conditional/ directory exists. If absent → log agile rules: rules-conditional/ not deployed; skipping load and skip steps 2–4. (Defensive: filesystem may lag pruning-plan status doc.)tasks/contracts/sprint-state-*-sprint-*.md returns ≥1 resultjira_tickets:MEOW_JIRA_BASE_URL env var is set[A-Z]{2,10}-\d+ (Jira-key pattern)Read the 3 conditional rules:
.claude/rules-conditional/agile-story-gates.md.claude/rules-conditional/agile-sprint-commitment.md.claude/rules-conditional/agile-feedback-cycle.md
Per-file Read failure (file absent inside the directory): log and skip THAT rule; do NOT abort Step 0b. The phase-zero baseline is already loaded.sprint_goal: from the newest active sprint-state file (status: active) and surface in the orient banner.Non-Agile sessions skip steps 1–4 silently — zero context cost.
references/detection-process.mdreferences/multi-layer-detection.md, references/scoring-and-thresholds.mdreferences/model-selection.md, references/complexity-detection.md, references/team-mode.md.claude/rules/risk-checklist.md (loaded in Step 0b). For each of the 9 flags (AUTH, AUTHZ, DATA_MODEL, AUDIT_SEC, EXT_SYSTEM, PUBLIC_CONTRACT, CROSS_PLATFORM, EXISTING_BEHAVIOR, WEAK_PROOF), evaluate whether the task description matches its trigger criteria. Emit matched_flags: [<ID>, ...] (default []). If any flag in {AUTH, AUTHZ, DATA_MODEL, AUDIT_SEC, EXT_SYSTEM} matches, escalate the tier to COMPLEX per rules/model-selection-rules.md Rule 2 — regardless of mk:scale-routing outcome.matched_flags line if non-empty), load agent instructions, invoke skill. See references/detection-process.md, references/after-detection.mdreferences/lifecycle-routing.md -- Task signal → phase → skill mapping (advisory, does not change scoring)references/complexity-detection.md -- Complexity levels, auto-detection criteria, detection logicreferences/model-selection.md -- Model mapping tables (complexity, task type, agent defaults)references/multi-layer-detection.md -- Layers 0-4: task content, tech, intent, project context, file patternsreferences/scoring-and-thresholds.md -- Scoring weights, agent thresholds, QA activation rulesreferences/detection-process.md -- Step-by-step process (cache, Steps 0-5, banner format)references/examples.md -- Seven worked examples covering common detection scenariosreferences/team-mode.md -- Team mode gate, composition rules, output format, handoffreferences/after-detection.md -- Post-detection actions, available agents, manual overrideAfter complexity detection, check user depth signals per references/token-budget-levels.md to set response verbosity. Silent by default — do not surface to users.
--quick or use the explicit /mk:fix --quick shorthand to force the right complexity level.npx claudepluginhub ngocsangyem/meowkit --plugin mkAutomatically detects task complexity (quick/standard/deep), agent type, and optimal model (haiku/sonnet/opus) for every message. Guides workflow selection and runs first always.
Activates relevant agents before tasks for multi-agent analysis, time estimation, risk mapping, problem anticipation, and execution planning with contingencies. Triggers on task intelligence or pre-task briefing mentions.
Classifies task complexity by matching domain keywords against a CSV, returning complexity level, workflow intensity, and model tier override for Phase 0 orchestration.