Stop stuffing hundreds of tools into your LLM prompt. Route to the right ones.
LLM agents break when you load every tool into the prompt. Token counts explode, accuracy drops, and cost scales linearly with your catalog size. Teams with 50+ skills end up with bloated system prompts that confuse the model and burn budget.
SkillMesh solves this with retrieval-based routing: given a user query, it selects only the top-K most relevant expert cards and injects them into the prompt — keeping context small, accurate, and cheap.
| Without SkillMesh | With SkillMesh | |
|---|---|---|
| Prompt tokens | ~50,000+ (all tools loaded) | ~3,000 (top-K only) |
| Tool selection | Model guesses from a huge list | BM25+Dense retrieval picks the best match |
| Cost per call | High (full catalog every time) | Low (only relevant cards) |
| Accuracy | Degrades as catalog grows | Stays consistent |
| Multi-domain tasks | Confusing for the model | Routed precisely (clean + train + deploy) |
User Query
│
▼
┌─────────────────────┐
│ BM25 + Dense Index │ ← Scores every card in your registry
└─────────┬───────────┘
│
▼
┌─────────────────────┐
│ RRF Fusion Rank │ ← Merges sparse + dense rankings
└─────────┬───────────┘
│
▼
┌─────────────────────┐
│ Top-K Card Select │ ← Returns the K best expert cards
└─────────┬───────────┘
│
▼
┌─────────────────────┐
│ Agent acts as expert │ ← Full instructions injected into prompt
└─────────────────────┘
Each card contains: execution behavior, decision trees, anti-patterns, output contracts, and composability hints — everything the agent needs to act as a domain expert.
git clone https://github.com/varunreddy/SkillMesh.git
cd SkillMesh
pip install -e .
skillmesh emit \
--provider claude \
--registry examples/registry/tools.json \
--query "clean messy sales data, train a baseline model, and generate charts" \
--top-k 5Output (truncated):
<context>
<card id="data.data-cleaning" title="Data Cleaning and Validation Expert">
# Data Cleaning and Validation Expert
Specialist in detecting and correcting data quality issues...
</card>
<card id="ml.sklearn-modeling" title="Scikit-learn Modeling and Evaluation">
...
</card>
<card id="viz.matplotlib-seaborn" title="Visualization with Matplotlib and Seaborn">
...
</card>
</context>
Only the relevant experts are injected — the rest of the 90+ card catalog stays out of the prompt.
| Platform | Method | Status | Docs |
|---|---|---|---|
| Claude Code | MCP server | Supported | Setup guide |
| Claude Desktop | MCP server | Supported | Setup guide |
| Codex | Skill bundle | Supported | Setup guide |
pip install -e .[mcp]
export SKILLMESH_REGISTRY=/path/to/tools.json
skillmesh-mcpExposes two tools via MCP:
route_with_skillmesh(query, top_k)— provider-formatted context blockretrieve_skillmesh_cards(query, top_k)— structured JSON payload
Copy-ready config templates in examples/mcp/.
$skill-installer install https://github.com/varunreddy/SkillMesh/tree/main/skills/skillmeshpython -m venv .venv && source .venv/bin/activate
pip install -e .[dev]Optional extras:
pip install -e .[dense] # Dense reranking with sentence-transformers
pip install -e .[mcp] # Claude MCP serverskillmesh retrieve \
--registry examples/registry/tools.json \
--query "set up nginx reverse proxy with SSL" \
--top-k 3skillmesh emit \
--provider claude \
--registry examples/registry/tools.json \
--query "deploy container to GCP Cloud Run" \
--top-k 5Use domain-specific registries for tighter routing:
| Registry | Domain | Cards |
|---|---|---|
tools.json / tools.yaml |
Full catalog | 90+ |
ml-engineering.registry.yaml |
ML training & evaluation | 15 |
data-engineering.registry.yaml |
Pipelines & data platforms | 10 |
bi-analytics.registry.yaml |
BI & dashboards | 10 |
devops.registry.yaml |
DevOps & infrastructure | 8 |
web-apis.registry.yaml |
API design & patterns | 7 |
cloud-gcp.registry.yaml |
Google Cloud Platform | 7 |
cloud-bi.registry.yaml |
Cloud BI | 5 |
roles.registry.yaml |
Role orchestrators | 10 |
skillmesh emit \
--provider claude \
--registry examples/registry/devops.registry.yaml \
--query "configure prometheus alerting and grafana dashboards" \
--top-k 3| Command | Description |
|---|---|
skillmesh retrieve |
Top-K retrieval payload (JSON) |
skillmesh emit |
Provider-formatted context block |
skillmesh index |
Index registry into Chroma for persistent retrieval |
skillmesh-mcp |
Stdio MCP server for Claude |
skillmesh --helpsrc/skill_registry_rag/
├── models.py # Tool/role card models
├── registry.py # Registry loading + validation
├── retriever.py # BM25 + optional dense retrieval
├── adapters/ # Provider formatters (codex, claude)
└── cli.py # skillmesh CLI
examples/registry/
├── tools.json # Full tool catalog
├── tools.yaml # YAML version of full catalog
├── instructions/ # Expert instruction files (90+)
├── roles/ # Role orchestrator files
└── *.registry.yaml # Domain-specific registries
skills/skillmesh/ # Codex-installable skill
See CONTRIBUTING.md for how to add expert cards, create registries, and submit PRs.
pip install -e .export SKILLMESH_REGISTRY=/path/to/tools.json
# or pass --registry on every commandpip install -e .[mcp]Restart Codex after running $skill-installer.
ruff check src tests
pytestMIT — see LICENSE.
If SkillMesh helps your team, please star the repo — it directly improves discoverability and helps others find the project.