# shimo4228/jev-skill-router architecture

> Architecture diagram of the GitHub repository shimo4228/jev-skill-router, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shimo4228/jev-skill-router
- Repository: https://github.com/shimo4228/jev-skill-router

## Overview

jev-skill-router is a Claude Code prompt-hook experiment: it gathers the available skill roster, asks Jev to rank candidates, then logs the result and, in inject mode, provides a hint. Claude Code still makes the final skill choice. A separate evaluation script compares logged suggestions with session activity. The graph follows documented workflow and sampled calls; some router-to-client and plugin-hook wiring is supported by the README rather than a shown call site.

Main entry points: [`scripts/route.py`](https://github.com/shimo4228/jev-skill-router/blob/main/scripts/route.py) (Prompt route), [`scripts/router.py`](https://github.com/shimo4228/jev-skill-router/blob/main/scripts/router.py) (Skill ranking), [`scripts/jev_client.py`](https://github.com/shimo4228/jev-skill-router/blob/main/scripts/jev_client.py) (Jev API client), [`evals/shadow_join.py`](https://github.com/shimo4228/jev-skill-router/blob/main/evals/shadow_join.py) (Shadow join)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_hook["Hook workflow"]
  node_hook_config["Hook registration<br/>[hooks.json]"]
  node_route["Prompt route<br/>[route.py]"]
  node_skill_sources["Installed skills"]
  node_roster["Roster builder<br/>[roster.py]"]
  node_hint["Prompt hint<br/>[route.py]"]
end

subgraph group_judgment["Jev judgment"]
  node_router["Skill ranking<br/>[router.py]"]
  node_client["Jev API client<br/>[jev_client.py]"]
end

subgraph group_measurement["Outcome measurement"]
  node_decision_log[("Decision log<br/>[decision_log.py]")]
  node_eval["Shadow join<br/>[shadow_join.py]"]
  node_skill_outcome["Skill-use outcome<br/>[shadow_join.py]"]
end

node_claude(("Claude Code"))
node_jev{{"TypeSafe Jev"}}
node_transcripts["Session transcripts"]

node_claude -->|"submits prompt"| node_hook_config
node_hook_config -.->|"runs hook"| node_route
node_route -->|"builds roster"| node_roster
node_skill_sources -->|"scans skills"| node_roster
node_route -->|"requests suggestion"| node_router
node_router -->|"asks Jev"| node_client
node_client -->|"sends questions"| node_jev
node_jev -->|"returns probabilities"| node_client
node_router -->|"returns suggestion"| node_route
node_route -->|"builds and appends row"| node_decision_log
node_route -->|"formats inject hint"| node_hint
node_hint -->|"adds hint"| node_claude
node_decision_log -->|"reads decisions"| node_eval
node_transcripts -->|"reads skill calls"| node_eval
node_eval -->|"joins and counts"| node_skill_outcome

click node_hook_config "https://github.com/shimo4228/jev-skill-router/blob/main/hooks/hooks.json"
click node_route "https://github.com/shimo4228/jev-skill-router/blob/main/scripts/route.py"
click node_roster "https://github.com/shimo4228/jev-skill-router/blob/main/scripts/roster.py"
click node_hint "https://github.com/shimo4228/jev-skill-router/blob/main/scripts/route.py"
click node_router "https://github.com/shimo4228/jev-skill-router/blob/main/scripts/router.py"
click node_client "https://github.com/shimo4228/jev-skill-router/blob/main/scripts/jev_client.py"
click node_decision_log "https://github.com/shimo4228/jev-skill-router/blob/main/scripts/decision_log.py"
click node_eval "https://github.com/shimo4228/jev-skill-router/blob/main/evals/shadow_join.py"
click node_skill_outcome "https://github.com/shimo4228/jev-skill-router/blob/main/evals/shadow_join.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_hook_config,node_route,node_skill_sources,node_roster,node_hint toneBlue
class node_router,node_client toneAmber
class node_decision_log,node_eval,node_skill_outcome toneMint
class node_claude,node_jev,node_transcripts toneIndigo
```

## Components

### Hook workflow

- [Hook registration](https://github.com/shimo4228/jev-skill-router/blob/main/hooks/hooks.json): `hooks/hooks.json`
- [Prompt route](https://github.com/shimo4228/jev-skill-router/blob/main/scripts/route.py): `scripts/route.py`
- **Installed skills**
- [Roster builder](https://github.com/shimo4228/jev-skill-router/blob/main/scripts/roster.py): `scripts/roster.py`
- [Prompt hint](https://github.com/shimo4228/jev-skill-router/blob/main/scripts/route.py): `scripts/route.py`

### Jev judgment

- [Skill ranking](https://github.com/shimo4228/jev-skill-router/blob/main/scripts/router.py): `scripts/router.py`
- [Jev API client](https://github.com/shimo4228/jev-skill-router/blob/main/scripts/jev_client.py): `scripts/jev_client.py`

### Outcome measurement

- [Decision log](https://github.com/shimo4228/jev-skill-router/blob/main/scripts/decision_log.py): `scripts/decision_log.py`
- [Shadow join](https://github.com/shimo4228/jev-skill-router/blob/main/evals/shadow_join.py): `evals/shadow_join.py`
- [Skill-use outcome](https://github.com/shimo4228/jev-skill-router/blob/main/evals/shadow_join.py): `evals/shadow_join.py`

### Other components

- **Claude Code**
- **TypeSafe Jev**
- **Session transcripts**

## Connections

- Claude Code → Hook registration: submits prompt (evidence: `README.md`)
- Hook registration → Prompt route: runs hook
- Prompt route → Roster builder: builds roster (evidence: `scripts/route.py`)
- Installed skills → Roster builder: scans skills (evidence: `scripts/roster.py`)
- Prompt route → Skill ranking: requests suggestion (evidence: `scripts/route.py`)
- Skill ranking → Jev API client: asks Jev (evidence: `README.md`)
- Jev API client → TypeSafe Jev: sends questions (evidence: `scripts/jev_client.py`)
- TypeSafe Jev → Jev API client: returns probabilities (evidence: `scripts/jev_client.py`)
- Skill ranking → Prompt route: returns suggestion (evidence: `scripts/route.py`)
- Prompt route → Decision log: builds and appends row (evidence: `scripts/route.py`)
- Prompt route → Prompt hint: formats inject hint (evidence: `README.md`)
- Prompt hint → Claude Code: adds hint (evidence: `README.md`)
- Decision log → Shadow join: reads decisions (evidence: `README.md`)
- Session transcripts → Shadow join: reads skill calls (evidence: `evals/shadow_join.py`)
- Shadow join → Skill-use outcome: joins and counts (evidence: `evals/shadow_join.py`)
