cowork-router
Skill46 starsChanged 9 months agoMITView on GitHub
Meta-router for dynamic skill routing. Use when: cowork, skill management, router generation, Skills.toml, plugin configuration
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
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 123
All plugin routers should follow this pattern:
- Distinctive: line 144
When a question spans multiple domains:
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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
CoWork Router
Meta-router that guides dynamic generation of project-specific skill routers
Purpose
This is a meta-skill that:
- Explains how the cowork dynamic routing system works
- Guides AI to generate project-specific routers via
cowork config router - Provides the routing architecture pattern for all skill plugins
This skill does NOT hardcode specific plugins - it describes the system for dynamically discovering and routing to installed plugins.
Dynamic Router Generation
┌─────────────────────────────────────────────────────────────────────────┐
│ Skills.toml (User Config) │
│ [skills.install] │
│ rust-skills = "user/rust-skills" │
│ dora-skills = { path = "/local/dora-skills", plugin = true } │
└─────────────────────────────────────────────────────────────────────────┘
│
▼
┌───────────────────────┐
│ cowork config install │
└───────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────────┐
│ Skills.lock (Generated) │
│ - Tracks installed plugins, versions, paths │
│ - Records extracted trigger keywords │
└─────────────────────────────────────────────────────────────────────────┘
│
▼
┌───────────────────────┐
│ cowork config router │
└───────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────────┐
│ .claude/skills/cowork-router/SKILL.md (Dynamic) │
│ - Auto-generated from installed plugins │
│ - Merged trigger keywords from all plugins │
│ - Domain detection table based on actual installations │
└─────────────────────────────────────────────────────────────────────────┘How It Works
1. Plugin Discovery
Each plugin contains skills with SKILL.md files. The frontmatter description field contains trigger keywords:
---
name: rust-router
description: "Triggers on: E0xxx, ownership, borrow, lifetime, async, trait"
---2. Keyword Extraction
cowork config router scans all installed plugins and extracts:
- Trigger keywords from each skill's description
- Router skill names (e.g.,
rust-router,dora-router) - Skill counts per plugin
3. Unified Router Generation
Generates a project-specific cowork-router that:
- Combines all trigger keywords into one description
- Creates a domain detection table
- Maps keywords → plugin routers
CLI Commands
# Initialize project configuration
cowork config init
# Add plugin dependencies
cowork config add rust-skills ZhangHanDong/rust-skills --plugin
cowork config add dora-dev /path/to/dora-skills --dev --plugin
# Install all dependencies
cowork config install
# Generate dynamic router from installed plugins
cowork config router
# Generate router with auto-trigger hooks
cowork config router --hooksGenerated Router Structure
The dynamically generated router will contain:
---
name: cowork-router
description: "Triggers on: [merged keywords from all plugins]"
---
## Domain Detection
| Domain | Keywords | Route To |
|--------|----------|----------|
| [plugin-1] | [extracted keywords] | [plugin-1-router] |
| [plugin-2] | [extracted keywords] | [plugin-2-router] |
| ... | ... | ... |Routing Architecture Pattern
All plugin routers should follow this pattern:
┌─────────────────────────────────────┐
│ cowork-router (Meta) │
│ Unified entry - Domain detection │
└───────────────┬─────────────────────┘
│
┌────────────────────────┼────────────────────────┐
▼ ▼ ▼
┌───────────────┐ ┌───────────────┐ ┌───────────────┐
│ plugin-router │ │ plugin-router │ │ plugin-router │
│ (Domain A) │ │ (Domain B) │ │ (Domain C) │
└───────┬───────┘ └───────┬───────┘ └───────┬───────┘
│ │ │
▼ ▼ ▼
plugin-skills plugin-skills plugin-skillsCross-Domain Routing
When a question spans multiple domains:
- Detect all matching domains from keywords
- Load primary domain router (most specific match)
- Cross-reference other domains as needed
- Combine context for comprehensive answer
Example: "Dora node 中 E0382 错误"
- Primary:
dora-router(dataflow context) - Cross-ref:
rust-skills:m01-ownership(ownership mechanics)
Configuration Files
| File | Location | Purpose |
Skills.toml | .cowork/Skills.toml | User configuration |
Skills.lock | .cowork/Skills.lock | Installed state (auto-generated) |
cowork-router | .claude/skills/cowork-router/ | Dynamic router (auto-generated) |
hooks.json | .claude/skills/cowork-router/ | Auto-trigger hooks (optional) |
When to Regenerate Router
Run cowork config router after:
- Adding new plugin dependencies
- Removing plugins
- Updating plugin versions
- Modifying trigger priority in Skills.toml
Trigger Priority Configuration
In Skills.toml:
[triggers]
priority = ["dora-router", "rust-router", "makepad-router"]
[triggers.overrides]
"async" = "rust-router"
"widget" = "makepad-router"Higher priority routers win when keywords conflict.
In this repository7 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- cowork-guideSkill
- code-reviewSkill
- cowork-guideSkill
- github-generateSkill
- github-searchSkill
- memory-skillsSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

