skills/skill-router/SKILL.md
Use when facing many skills and unsure which to choose. Provides intelligent skill discovery via search, routing, and categorization.
npx skillsauth add mingyouagi/myskills skill-routerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
A meta-skill that helps agents efficiently discover and select the right skills from a large skill library.
Use the CLI tool directly via Bash - this is the recommended way:
# Search for skills
skill-router search "debug"
# Auto-route to best skill based on intent
skill-router route "fix a bug"
# List all skill categories
skill-router list
# Get skill details
skill-router detail superpowers:brainstorming
# Specify project skills directory
skill-router search "test" -p ./.claude/skills
# JSON output for programmatic use
skill-router list --json
When skill libraries grow large (10+ skills), agents face:
Skill Router provides 4 meta-tools that handle skill discovery efficiently:
| Tool | Purpose | Token Cost |
|------|---------|------------|
| route_skill | Auto-select best skill for intent | Very Low |
| search_skills | Search with ranking and filters | Low |
| list_skill_categories | Browse by category | Very Low |
| get_skill_details | Load full skill content | Medium |
When you know what you want to do:
route_skill("debug a failing test")
→ Returns: superpowers:systematic-debugging (85% confidence)
→ Action: use_skill("superpowers:systematic-debugging")
When exploring options:
search_skills("create new feature", limit=3)
→ Returns ranked list:
1. superpowers:brainstorming (HIGH)
2. superpowers:writing-plans (MEDIUM)
3. superpowers:test-driven-development (LOW)
When learning available skills:
list_skill_categories()
→ Returns:
- process (3 skills): brainstorming, writing-plans, executing-plans
- technique (2 skills): systematic-debugging, condition-based-waiting
- discipline (3 skills): test-driven-development, verification-before-completion, ...
Before loading a skill, check details:
get_skill_details("superpowers:brainstorming")
→ Returns full skill content + metadata
Agent receives task
│
▼
Has clear skill in mind? ──YES──► use_skill() directly
│
NO
│
▼
route_skill(intent)
│
├── HIGH confidence (>70%) ──► use recommended skill
│
├── MEDIUM confidence (40-70%) ──► search_skills() for alternatives
│
└── LOW/NO match ──► list_skill_categories() to explore
On first use, builds an inverted index from all skills:
{
skills: { "superpowers:debugging": {...}, ... },
keywords: { "debug": ["superpowers:debugging"], "test": [...], ... },
categories: { "technique": [...], "process": [...], ... }
}
Index is cached for 5 minutes to avoid repeated filesystem scans.
Each skill is scored against the query:
| Signal | Score | |--------|-------| | Exact name match | +100 | | Partial name match | +50 | | Trigger word match | +30 | | Keyword overlap | +10 per keyword | | Description contains query | +20 | | Description contains keyword | +5 per keyword |
| Score Range | Confidence | Recommendation | |-------------|------------|----------------| | 70+ | HIGH | Load immediately | | 40-69 | MEDIUM | Consider, maybe search alternatives | | 10-39 | LOW | Weak match, explore more | | <10 | NONE | No relevant skill found |
For better routing, enhance your skill frontmatter:
---
name: systematic-debugging
description: Use when encountering bugs, test failures, or unexpected behavior
category: technique
triggers: [debug, bug, test failure, error, unexpected, broken, fix]
---
| Field | Purpose | Example |
|-------|---------|---------|
| name | Display name | systematic-debugging |
| description | When to use (imperative) | Use when encountering bugs... |
| category | Grouping for browsing | technique, process, discipline |
| triggers | Keywords for matching | [debug, bug, test failure] |
Agent → find_skills() → 2000 tokens of skill list → reasoning → use_skill()
Total: ~2500 tokens
Agent → route_skill(intent) → 50 tokens response → use_skill()
Total: ~100 tokens
Savings: 96% token reduction for skill selection
import { SkillRouterPlugin } from './src/plugin.js';
export default SkillRouterPlugin;
import { searchSkills, routeSkill } from './src/index.js';
const results = searchSkills("debug issue", { limit: 3 });
const best = routeSkill("fix failing tests");
const { searchSkills, routeSkill } = require('./src/router.js');
const results = searchSkills("debug issue", { limit: 3 });
const best = routeSkill("fix failing tests");
search_skills(query, options)| Param | Type | Default | Description |
|-------|------|---------|-------------|
| query | string | required | Intent or keywords |
| limit | number | 5 | Max results |
| category | string | null | Filter by category |
Returns: Array of { id, name, description, category, score, path }
route_skill(intent)| Param | Type | Description |
|-------|------|-------------|
| intent | string | What you want to accomplish |
Returns: { skill, confidence, action, command } or null
list_skill_categories()Returns: Array of { category, count, skills }
get_skill_details(skill_id)Returns: Full skill object with content, or null
Skill Router automatically detects when skills are added, modified, or removed.
| Mechanism | Trigger | Latency | Use Case | Default | |-----------|---------|---------|----------|---------| | Content Hash | Polling | ~60s | Background detection (always on) | ✅ Enabled | | File Watch | fs.watch events | ~1s | Real-time during development | ✅ Enabled | | Git Check | Polling | ~60s | Remote repository notifications | ❌ Disabled |
Problem: Git Check only detects remote updates but doesn't apply them.
git pullcd ~/.claude && git pullResult: Creates friction instead of solving it.
When to Enable:
Better Approach: Let CI/deployment handle git pulls, skill-router focuses on detecting local changes.
┌─────────────────────────────────────────────────────────────┐
│ Skill Watcher │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ File Watch │ │ Hash Poll │ │ Git Check │ │
│ │ (fs.watch) │ │ (interval) │ │ (optional) │ │
│ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ │
│ │ │ │ │
│ └────────────────┼────────────────┘ │
│ ▼ │
│ ┌─────────────┐ │
│ │ Debounce │ (500ms default) │
│ └──────┬──────┘ │
│ ▼ │
│ ┌─────────────┐ │
│ │ Compare │ │
│ │ Manifests │ │
│ └──────┬──────┘ │
│ ▼ │
│ ┌────────────────┼────────────────┐ │
│ ▼ ▼ ▼ │
│ ┌─────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Added │ │ Updated │ │ Removed │ │
│ └────┬────┘ └────┬─────┘ └────┬─────┘ │
│ └───────────────┼────────────────┘ │
│ ▼ │
│ ┌─────────────┐ │
│ │ Invalidate │ │
│ │ Cache │ │
│ └──────┬──────┘ │
│ ▼ │
│ ┌─────────────┐ │
│ │ Emit Event │ │
│ │ 'change' │ │
│ └─────────────┘ │
└─────────────────────────────────────────────────────────────┘
import { startWatching, stopWatching } from './src/index.js';
const watcher = startWatching({
projectSkillsDir: '.claude/skills',
pollInterval: 60000, // Check every 60s
enableFileWatch: true, // Real-time fs.watch
enableGitCheck: false, // Optional: check for remote updates
debounceMs: 500, // Debounce rapid changes
onChange: (changes) => {
console.log('Skills changed:', changes);
// changes = { added: [...], updated: [...], removed: [...] }
},
onGitUpdates: (updates) => {
console.log('Git updates available:', updates);
// updates = [{ namespace, path, behindCount, message }]
}
});
// Later: stop watching
stopWatching();
{
added: [
{ id: "project:new-skill", path: "/path/to/new-skill" }
],
updated: [
{
id: "superpowers:brainstorming",
path: "/path/to/brainstorming",
oldHash: "abc123",
newHash: "def456"
}
],
removed: [
{ id: "deprecated-skill", path: "/path/to/deprecated" }
],
timestamp: "2024-01-15T10:30:00.000Z"
}
If you need immediate refresh without waiting:
import { invalidateCache, getIndex } from './src/index.js';
invalidateCache(); // Clear cached index
const freshIndex = getIndex(); // Rebuilds from filesystem
The watcher stores a manifest file (.skill-manifest.json) to track skill states across restarts:
{
"version": 1,
"skills": {
"superpowers:brainstorming": {
"path": "/Users/me/.claude/superpowers/skills/brainstorming",
"hash": "abc123def456",
"namespace": "superpowers"
}
},
"lastCheck": "2024-01-15T10:30:00.000Z"
}
| Scenario | Configuration |
|----------|---------------|
| Local Development | enableFileWatch: true, enableGitCheck: false |
| Production/CI | enableFileWatch: false, pollInterval: 300000 |
| Long-running Service | enableGitCheck: true (for notifications only) |
Don't do this ❌:
// Waiting for watcher to notify you
onGitUpdates: (updates) => {
console.log('有更新,快去 git pull!'); // User still needs manual action
}
Do this instead ✅:
# In your deployment/update script
cd ~/.claude/superpowers && git pull
# skill-router will auto-detect the changes via File Watch / Hash Poll
Or for automated services ✅:
// Only if you need alerting for long-running services
onGitUpdates: (updates) => {
sendSlackNotification(`Skills outdated: ${updates[0].message}`);
// Admin can decide when to update
}
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.
development
Run, watch, debug, and extend OpenClaw QA testing with qa-lab and qa-channel. Use when Codex needs to execute the repo-backed QA suite, inspect live QA artifacts, debug failing scenarios, add new QA scenarios, or explain the OpenClaw QA workflow. Prefer the live OpenAI lane with regular openai/gpt-5.4 in fast mode; do not use gpt-5.4-pro or gpt-5.4-mini unless the user explicitly overrides that policy.
development
End-to-end Parallels smoke, upgrade, and rerun workflow for OpenClaw across macOS, Windows, and Linux guests. Use when Codex needs to run, rerun, debug, or interpret VM-based install, onboarding, gateway smoke tests, latest-release-to-main upgrade checks, fresh snapshot retests, or optional Discord roundtrip verification under Parallels.