Route requests through the domain expert pipeline for maximum quality. TRIGGER when: any request classified as Tier 2 or Tier 3 that requires analysis, strategy, code architecture, multi-step deliverables, research, writing, recommendations, or multi-domain expertise. Also trigger when the user explicitly asks for deep work, a full engagement, or invokes /route. DO NOT TRIGGER when: quick Tier 1 factual questions, git operations, file moves, system maintenance, or meta-questions about the routing system itself.
This skill enforces the full domain expert routing protocol defined in
prompts/ROUTER.md and prompts/AGENTS.md. Every substantive request
passes through this pipeline. No shortcuts. No skipped steps.
Invoke this skill for any request that requires domain expertise. The only exceptions are pure meta-questions about the system itself (e.g., "how does routing work?") or trivial conversational exchanges.
Follow these steps in exact order. Do not skip any step.
Read state/HANDOFF.md in the project root. If it contains real content
(anything beyond the empty template), you are resuming a prior session.
state/HANDOFF-PROTOCOL.md.If HANDOFF.md is empty or contains only the template, proceed fresh.
Read the user's request and classify it on four dimensions. Reference the
Domain Registry table in prompts/ROUTER.md for trigger patterns.
1a. Domain Identification
Match the request to one or more domain files in prompts/domains/.
prompts/TEMPLATE.md. Register it in prompts/ROUTER.md. Run
python -m retrieval index and python -m retrieval viz after creation.
Then resume routing.1b. Complexity Tier
Classify into one of three tiers:
| Tier | Signal | Pipeline Depth |
|---|---|---|
| Tier 1 | Simple factual question, definition, explanation | Stages 1-2 implicit, answer directly |
| Tier 2 | Analysis, recommendation, single deliverable | Stages 1-4 explicit, light QA (5-6) |
| Tier 3 | Complex multi-part project, strategic decision, deep research | All 8 stages with full rigor |
Rules:
1c. Context Needs
Determine what additional context to load from prompts/context/:
context/shared/) only if the domain file references them.context/by-domain/) only for Tier 2-3.python -m retrieval context "query"
or the MCP get_context tool to find relevant chunks.1d. Produce the Routing Decision
Format:
ROUTING DECISION:
Domain: [primary domain file]
Supporting: [additional domain files, or "none"]
Tier: [1 / 2 / 3]
Context: [list of context files to load, or "none"]
Pipeline: [which stages to execute explicitly]
1e. Log the Routing Decision (Training Data)
After producing the routing decision, log it for neural router training.
If the MCP log_routing tool is available, call it with:
This accumulates training data. After 50 logged routing decisions, the neural router can be trained to handle classification automatically. You do not need to ask the user before logging. This is a silent, automatic step.
Check memory files in the project memory directory for anything relevant to
this request. The memory directory is at:
C:\Users\rskrn\.claude\projects\C--Users-rskrn-Desktop-universal-domain-expert---Copy\memory\
Scan MEMORY.md for entries that match the request topic. Common relevant
memories include:
Load the specific memory files referenced in MEMORY.md if they contain details that would change how you approach the request. Do not load all memories for every request. Load only what is relevant.
Read the primary domain file from prompts/domains/{domain}.md.
For supporting domains, load only the sections relevant to the request. Do not load the entire supporting domain file.
For Tier 2-3 requests, also load prompts/AGENTS.md for the full pipeline
stage definitions.
Execute the stages appropriate to the tier classification.
Tier 1 Execution:
Tier 2 Execution:
Tier 3 Execution:
prompts/AGENTS.md.state/HANDOFF.md at major milestones.Before delivering ANY output, run this verification pass. This is mandatory
for all tiers. Reference prompts/context/shared/writing-style.md.
Hard Rejections (rewrite the sentence from scratch if found):
Semicolons. Search the entire output for semicolons. Replace every one with a period and two separate sentences.
Em dashes. Search for the character — (U+2014). Restructure any
sentence that uses one. Use commas or split into separate sentences.
"Not X, but Y" contrast patterns. Search for "not...but" and "not just...rather" constructions. Rewrite to state what something IS. Skip what it isn't.
AI Slop Detection (delete and rewrite if found):
Scan for these banned phrases and patterns:
Positive Standards:
If any violation is found, fix it before delivering. Do not deliver and then note the violations. Fix first.
After completing the request, check: did a domain file exist for every topic that came up? If any topic lacked domain coverage:
prompts/TEMPLATE.md. Register it in prompts/ROUTER.md. Run
python -m retrieval index to update the search index.For Tier 3 engagements or any multi-session work:
state/HANDOFF.md at natural breakpoints.state/HANDOFF-PROTOCOL.md.For Tier 2 engagements: save state only if the user requests it.
For Tier 1: no state persistence needed.
After completing any Tier 2 or Tier 3 engagement, ask yourself:
prompts/context/by-domain/?If yes to any, update the domain file or add context. The system gets better with every use.
Ambiguous request: Do not guess the domain or tier. Ask one clarifying question that resolves the ambiguity. Keep the question specific and closed-ended.
Missing domain file: Create it before proceeding. Load prompts/TEMPLATE.md,
write the domain file, register it, reindex. Then continue.
Multi-domain conflict: When domain perspectives contradict each other, surface the contradiction to the user. Present both perspectives with their reasoning. Let the user decide which takes priority.
Pipeline stage failure: If a stage fails twice on the same issue, escalate to the user with: what was attempted, why it failed (root cause), and 2-3 proposed alternatives ranked by recommendation strength.
Do not load everything for every request. Follow these guidelines:
| Tier | What Gets Loaded |
|---|---|
| Tier 1 | Router classification only. Maybe domain file for accuracy. |
| Tier 2 | Router + primary domain file + relevant memory entries. |
| Tier 3 | Router + domain file(s) + context chunks + memory + AGENTS.md. |
The principle: minimum viable context. Load the minimum needed to answer well. More context does not mean better answers. It means slower responses and wasted tokens.