# Domain Detection Routing

> Auto-detect task domain from user message and route to correct Hermes profile via delegate_task.

- Skill: `theheavenlyd3mon/domain-detection-routing` (Agent Skill)
- Install (CLI): `npx skillmds add theheavenlyd3mon/domain-detection-routing`
- Raw SKILL.md: https://api.skillmd.com/api/skills/theheavenlyd3mon/domain-detection-routing/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: theheavenlyd3mon (https://skillmd.com/u/theheavenlyd3mon)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/theheavenlyd3mon/domain-detection-routing

---

# Domain Detection for Multi-Profile Routing

## Body
Senna uses a keyword-based domain detection script to route tasks to the correct specialized profile. The script is at `~/.hermes/profiles/senna/scripts/domain-detect.py`.

### Usage
```bash
python3 ~/.hermes/profiles/senna/scripts/domain-detect.py "<user_message>"
```

### Output
JSON: `{profile, domain, confidence, matched_keywords, reason}`

### Domain → Profile Mapping
| Domain | Profile | Environment |
|--------|---------|-------------|
| ue5 | ue5 | Windows PC (your GPU, UE 5.7) |
| book-writing | book-writer | Windows PC (Darwin 36B) |
| trading | finance | macOS current session |
| code | code | macOS current session |
| research | research | macOS current session |
| hermes-ops | senna | macOS current session (default) |

### Delegation Pattern
When domain ≠ hermes-ops and confidence > 0.5:
```python
delegate_task(
    goal="<task_description>",
    context="<workspace_paths, relevant_context. Use the {profile} profile.>",
    role="leaf"
)
```

## Pitfalls
- Low confidence (<0.5) means ambiguous input — ask the user instead of guessing
- UE5 and book-writer profiles run on Windows PC only — tasks routed there wait for the PC
- finance and code profiles run on this macOS session
