skill-router
Skill588 starsChanged 4 months agoMITView on GitHub
Repo-aware recommendation manager for ctx. Scans the active repository, identifies stack and workflow signals, recommends a capped set of skills, agents, and MCP servers, and unloads helpers that no longer match the current work after user confirmation. Harnesses are recommended by the custom-model onboarding flow or loop adapters and then attach to the same recommendation layer.
30 other projects use a version of this.
Adopted by
Most recently taken up by
- aprameyak/coding-skillstheir own version, first seen Oct 2, 2026
- tomwangowa/agent-skillstheir own version, first seen Sep 30, 2026
- rohitg00/pro-workflowtheir own version, first seen Sep 29, 2026
- lldwb/lldwb-claude-skillstheir own version, first seen Sep 28, 2026
- martinbouvet2000-tech/claude-code-stage-4their own version, first seen Sep 25, 2026
- iuliandita/skillstheir own version, first seen Sep 24, 2026
Used with
Projects with it also use mcp-builder.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MicrosoftSkillmcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
Also in 3 projects that use this
Other versions30 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 30
- rohitg00/pro-workflow★ 2.9ksame name
- Rune-kit/rune★ 88same name
- booklib-ai/booklib★ 38same name
- Fandry96/k3-agentic-skills★ 27same name
- hussi9/skill-router★ 26same name
- pcx-wave/skill-router★ 26same name
- radustefandumitru/overdrive★ 19same name
- Hassaan146/claude-skills★ 18same name
- AnamKwon/agent-skill-router★ 9same name
- iuliandita/skills★ 7same name
20 more not listed
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.
In this repository30 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- ask-mattSkill
- codebase-designSkill
- code-reviewSkill
- diagnosing-bugsSkill
- domain-modelingSkill
- grillingSkill
- grill-meSkill
- grill-with-docsSkill
- handoffSkill
- implementSkill
- improve-codebase-architectureSkill
- prototypeSkill
- researchSkill
- resolving-merge-conflictsSkill
- setup-matt-pocock-skillsSkill
- tddSkill
- teachSkill
- to-specSkill
- to-ticketsSkill
- triageSkill
- wayfinderSkill
- writing-great-skillsSkill
- ctx-dispatchSkill
- ctx-verifySkill
- find-skillsSkill
- repo-stats-autoupdateSkill
- skill-routerSkill
- toolboxSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
22 rules. 0 are common, 20 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 25 edited versions we read keep these.
20
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
Every loaded helper costs tokens, attention, and operational surface area.
- Distinctive: line 55
Read the shipped graph/wiki metadata and local user overrides.
- Very specific: line 56
Run ctx-scan-repo --repo .
- Distinctive: line 82
Start with filenames and config files.
- Distinctive: line 84
Do not include speculative signals below the configured confidence floor.
- Distinctive: line 87
Keep initial scans bounded for large repos.
- Distinctive: line 193
Search the shipped graph/wiki first.
- Distinctive: line 194
Use additional sources only when the local graph is missing or stale.
- Distinctive: line 196
If an entity exists, emit an update review instead of replacing it.
- Distinctive: line 197
Run security checks before promotion.
- Distinctive: line 202
Every added or updated skill must pass the configured line-count gate before it is packed into the shipped wiki.
- Distinctive: line 215
Read wiki orientation and local overrides.
- Distinctive: line 228
If a helper is no longer useful, ctx should suggest unloading it and ask for confirmation.
- Distinctive: line 241
When the user asks what exists for a task:
- Distinctive: line 243
Search graph/wiki entity pages by tags and text.
- Very specific: line 244
Use find-skills and configured sources for remote freshness when needed.
- Distinctive: line 261
After a scan, report only actionable details:
- Distinctive: line 299
Never load all helpers just in case.
- Distinctive: line 300
Never replace an existing entity without an update review.
- Distinctive: line 301
Never execute external repo scripts while cataloging.
- Distinctive: line 302
Never treat conversation history as the source of workflow state.
- Distinctive: line 303
Never ship graph/wiki artifacts before validation passes.
“Common” is measured: kept by at least 6 in 10 of the 25 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skill Router
Scan a repo. Know what the current work needs. Recommend only that. Keep the wiki and graph as the durable catalog behind the decision.
Scope
The router manages runtime recommendations for:
- skills
- agents
- MCP servers
Harnesses are separate catalog entities. They are recommended when a user wants to run ctx with a non-Claude-Code host, local model, API model, or external loop adapter. Once attached, the harness calls the same skills/agents/MCP recommendation engine.
Problem
Every loaded helper costs tokens, attention, and operational surface area. Most sessions need a small top-scored bundle from the shipped graph, not every entity ctx knows about. Loading too much:
- wastes context on irrelevant instructions,
- causes misfires when a helper matches the wrong task,
- slows the agent loop, and
- creates conflicting instructions.
Architecture
ctx/
|-- src/scan_repo.py # Repo scanner -> stack profile
|-- src/ctx/core/resolve/resolve_skills.py # Profile -> load/unload manifest
|-- src/ctx/core/resolve/recommendations.py # Shared scoring/ranking engine
|-- src/ctx/adapters/ # Host adapters + generic tools
|-- src/harness_install.py # Custom-model harness install flow
`-- graph/wiki-graph-runtime.tar.gz # Shipped graph/wiki runtimeThe router has three halves:
- Scanner - analyzes a repo and produces stack/task evidence.
- Resolver - scores graph/wiki entities and emits a capped manifest.
- Wiki/graph - persistent catalog of entities, usage, quality, and links.
Startup Flow
- Read the shipped graph/wiki metadata and local user overrides.
- Run
ctx-scan-repo --repo . --recommendfor the active repo. - Resolve a load/unload manifest with the shared recommendation engine.
- Present changes with reasons and require confirmation unless the user enabled automatic mode.
- Record usage/quality changes after the user accepts or rejects suggestions.
Scanner
The scanner reads repo structure and files to produce a stack profile. Detection is evidence-based: every claim should map to a file, dependency, config value, or import pattern.
Detection Categories
- Languages - file extensions, shebangs, lock files.
- Frameworks and libraries - package manifests, imports, config files.
- Infrastructure and DevOps - Docker, CI/CD, IaC, cloud, Kubernetes.
- Data and storage - databases, migrations, queues, pipelines.
- Documentation and content - MkDocs, Docusaurus, Sphinx, API specs.
- Testing and quality - pytest, Jest, Playwright, Ruff, mypy, TypeScript.
- AI and agent tooling - MCP configs, LangGraph, CrewAI, prompt dirs, model config names.
- Build and package - package managers, build tools, monorepos.
Scanning Rules
- Start with filenames and config files. Read source only when needed to disambiguate.
- Do not include speculative signals below the configured confidence floor.
- Skip generated/vendor directories such as
.git,node_modules,__pycache__,venv, and.venv. - Keep initial scans bounded for large repos.
- Redact secret values; only record secret/key names as evidence.
Resolver
The resolver produces a manifest containing the exact helper set to load or unload.
{
"generated_at": "ISO-8601",
"repo_path": "/absolute/path",
"profile_hash": "sha256 of stack profile",
"load": [
{
"name": "fastapi",
"type": "skill",
"reason": "FastAPI detected in pyproject.toml dependencies",
"score": 0.94
}
],
"unload": [
{
"name": "react",
"type": "skill",
"reason": "No active frontend signal in the current repo window"
}
],
"suggestions": [
{
"name": "github",
"type": "mcp",
"reason": ".github/workflows exists and the repo uses GitHub Actions",
"install_command": "python -m mcp_add ..."
}
],
"warnings": []
}Ranking Signals
Candidates can be scored by:
- tag/category/subcategory match
- semantic similarity edge weight
- direct wiki links
- source overlap
- type affinity
- usage score
- quality/security score
- user overrides (
always_load,never_load) - configured caps and minimum score gates
Recommendations are capped. ctx should not recommend at all costs; below-threshold candidates should be withheld and the gap should be explained.
Wiki And Graph Contract
The wiki follows a Karpathy-style durable memory pattern: schema, purpose, index, log, lint, review items, and entity pages that are machine-readable.
llm-wiki/
|-- SCHEMA.md
|-- index.md
|-- log.md
|-- raw/
| |-- scans/
| `-- external-catalogs/
|-- entities/
| |-- skills/
| |-- agents/
| |-- mcp-servers/
| `-- harnesses/
|-- concepts/
|-- comparisons/
`-- queries/Entity pages use YAML frontmatter with at least:
title: Entity Name
type: skill | agent | mcp-server | harness | external-catalog
status: installed | available | deprecated | broken
tags: []
source: local | shipped | github | curated
source_url: ""
path: ""
quality_score: null
usage_score: 0
last_used: null
always_load: false
never_load: falseEntity Sources
Entity sources include shipped skill/MCP/harness sources, GitHub
entity repositories, and local user assets. The public reference page is
marketplace-registry.md, kept under that filename
for backwards-compatible links.
Source rules:
- Search the shipped graph/wiki first.
- Use additional sources only when the local graph is missing or stale.
- Deduplicate before adding.
- If an entity exists, emit an update review instead of replacing it.
- Run security checks before promotion.
- Rebuild and validate graph/wiki artifacts before shipping.
Micro-Skill Gate
Every added or updated skill must pass the configured line-count gate before it
is packed into the shipped wiki. The default threshold is 180 lines, read from
ctx config. Skills above the threshold are converted into a short orchestrator
plus staged reference files. Local .original backups may be preserved for
traceability, but packaged runtime archives must omit those backups.
Core Operations
Full Scan
Triggers: repo open, repo switch, ctx-scan-repo --repo . --recommend, or explicit user
request.
- Read wiki orientation and local overrides.
- Scan the target repo.
- Save the scan result.
- Resolve load/unload recommendations.
- Present reasons, scores, and install/update commands.
- Apply only after confirmation unless configured otherwise.
- Record usage and decisions.
Incremental Scan
Triggers: changed config files, new dependencies, new MCP config, new tests, new infrastructure files, or user task change.
If a helper is no longer useful, ctx should suggest unloading it and ask for confirmation. If the user asks to skip unload prompts, ctx should respect that preference.
Manual Override
- "Always load the docker skill" -> set
always_load: true. - "Never load the react skill" -> set
never_load: true. - "Load the terraform skill for this session" -> temporary load.
- "What is loaded?" -> show current manifest with reasons.
Discovery
When the user asks what exists for a task:
- Search graph/wiki entity pages by tags and text.
- Use
find-skillsand configured sources for remote freshness when needed. - Show status, score, source, and risk notes.
- Suggest install/update commands, not silent installs.
- Log the query.
Maintenance Checks
- Stale installed helpers - used rarely or not used recently.
- Ghost helpers - installed status but missing local path.
- Orphan local helpers - present locally but missing entity page.
- Skill index freshness - shipped skill snapshot older than policy.
- Conflicts - overlapping helpers both marked
always_load. - Usage cold spots - low usage/quality score candidates for unload review.
- Wiki lint - broken links, missing frontmatter, index drift.
Reporting
After a scan, report only actionable details:
Skill Router Report - repo-name
Scanned: YYYY-MM-DD HH:MM
Loaded:
1. fastapi skill - score 0.94 - pyproject.toml dependency
2. github MCP - score 0.91 - GitHub Actions workflows detected
Unload candidates:
1. react skill - no active frontend signal
Suggestions:
1. openapi-generator skill - OpenAPI spec found
Warnings:
NoneConfiguration
Router behavior is controlled by ctx config and user overrides. Important knobs:
recommendations:
max_total: 5
min_score: 0.85
micro_skills:
max_lines: 180
router:
auto_scan: true
auto_apply: false
ask_before_unload: truePitfalls
- Never load all helpers just in case.
- Never replace an existing entity without an update review.
- Never execute external repo scripts while cataloging.
- Never treat conversation history as the source of workflow state.
- Never ship graph/wiki artifacts before validation passes.
- Respect
never_loadand user rejection history.
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.

