skills-router
Skill0 starsChanged 5 months agoMITView on GitHub
Automatic skill routing hook for Claude Code. Matches user prompts to relevant skills using TF-IDF scoring, bigram matching, and configurable intent mapping. Install as a UserPromptSubmit hook to get skill suggestions on every prompt.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- ShenQingchuan/skillstheir own version, first seen Nov 1, 2026
- liushikuan63/Qoder-Optimizationtheir own version, first seen Nov 1, 2026
- 2867203296/hermes-agenttheir own version, first seen Aug 19, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- liushikuan63/Qoder-Optimization★ 2same name
- ShenQingchuan/skills★ 1same name
- 2867203296/hermes-agent★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Scores: every skill in the index using TF-IDF-weighted term matching and bigram proximity
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skills Router
A UserPromptSubmit hook for Claude Code that automatically matches user prompts to relevant skills using a combination of TF-IDF scoring, bigram matching, and configurable intent mapping.
How it works
- On every prompt, the hook receives the user's message
- Tokenizes the prompt (supports Latin + German umlauts/ß)
- Scores every skill in the index using TF-IDF-weighted term matching and bigram proximity
- Checks the configurable intent map for explicit trigger → skill overrides
- Outputs matched skills to stderr for Claude to pick up
Scoring Algorithm
| Signal | Weight | Description |
| Name exact match | 4× IDF | Token appears in skill name |
| Name partial match | 2× IDF | Token is substring of name token (min 4 chars) |
| Description exact match | 1.5× IDF | Token appears in description |
| Description partial match | 0.5× IDF | Token is substring of description token |
| Name bigram match | +8 flat | Two consecutive prompt tokens match name bigram |
| Description bigram match | +3 flat | Two consecutive prompt tokens match description bigram |
| Intent override | Score 99 | Configurable trigger phrase → skill mapping |
Scores are normalized by √(token count) to prevent long prompts from inflating scores.
Setup
# 1. Clone or copy to your machine
git clone <repo-url> ~/.claude/skills/skills-router
# 2. Build the skills index
node ~/.claude/skills/skills-router/src/build-index.js -v
# 3. Install the hook
node ~/.claude/skills/skills-router/src/install.js
# 4. (Optional) Customize config
cp ~/.claude/skills/skills-router/config.example.json ~/.claude/skills-router.config.json
# Edit ~/.claude/skills-router.config.json to add your own intents, stopwords, etc.Configuration
Copy config.example.json to ~/.claude/skills-router.config.json and customize:
{
"skillsDirs": ["~/.claude/skills"],
"archiveDirs": ["~/.claude/skills-archive"],
"indexPath": "~/.claude/skills-index.json",
"maxResults": 5,
"minScore": 1.5,
"cacheTTL": 300000,
"debug": false,
"intents": {
"bug": ["systematic-debugging"],
"deploy": ["deploy-to-vercel"]
}
}| Field | Default | Description |
skillsDirs | ["~/.claude/skills"] | Directories containing active skills |
archiveDirs | ["~/.claude/skills-archive"] | Directories containing archived skills |
indexPath | ~/.claude/skills-index.json | Where the built index is stored |
maxResults | 5 | Maximum skills to suggest per prompt |
minScore | 1.5 | Minimum TF-IDF score to include a skill |
cacheTTL | 300000 | Cache lifetime in ms (5 min default) |
debug | false | Log debug info to stderr |
intents | {} | Trigger phrase → skill name mapping |
stopwords | {en: [...], de: [...]} | Words to ignore during scoring |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

