Skill Router
Analyze tasks and recommend optimal skill workflows.
How It Works
- Analyze the task - Understand what user is trying to accomplish
- Match to workflow pattern - Find best skill sequence for the task type
- Present with rationale - Explain why each skill and in what order
- Let user modify - Accept, modify, or skip to specific step
- Execute sequentially - Run skills in order, passing context between them
Workflow Pattern Library
Design & UI
| Task Type |
Workflow |
When to Use |
| Design from reference |
ai-multimodal → brainstorming → writing-plans → aesthetic → frontend-design → code-review |
User has a screenshot/reference they want to build from |
| Build UI from scratch |
brainstorming → writing-plans → frontend-design → code-review |
Building new UI without reference |
| Improve existing UI |
chrome-devtools (screenshot) → ai-multimodal → aesthetic → frontend-design |
Enhancing current design |
| Design system work |
aesthetic → frontend-development → code-review |
Component libraries, tokens, themes |
Development
| Task Type |
Workflow |
When to Use |
| New feature |
brainstorming → writing-plans → executing-plans → code-review |
Adding significant functionality |
| API development |
brainstorming → backend-development → code-review |
Building APIs, services |
| Research & build |
docs-seeker → brainstorming → writing-plans → executing-plans |
Need to learn before implementing |
| Quick implementation |
writing-plans → executing-plans |
Clear requirements, just need to build |
Debugging & Quality
| Task Type |
Workflow |
When to Use |
| Bug fixing |
systematic-debugging → code-review |
Finding and fixing bugs |
| Flaky tests |
systematic-debugging → condition-based-waiting → code-review |
Tests pass sometimes, fail others |
| Performance issues |
chrome-devtools → systematic-debugging → code-review |
Slow app, need profiling |
| Security review |
code-review → defense-in-depth |
Checking for vulnerabilities |
Content & Documentation
| Task Type |
Workflow |
When to Use |
| Content creation |
content-research-writer |
Writing articles, docs with research |
| LLM prompts |
prompt-engineering |
Writing prompts for AI systems |
| Technical docs |
docs-seeker → content-research-writer |
Documentation with research |
Infrastructure
| Task Type |
Workflow |
When to Use |
| Deploy app |
devops |
Cloudflare, Docker, GCP deployment |
| Database work |
databases |
MongoDB, PostgreSQL operations |
| MCP server |
mcp-builder → code-review |
Building MCP integrations |
| MCP tools |
mcp-management |
Discovering/using existing MCP tools |
Task Recognition Signals
Look for these keywords to identify task type:
| Keywords |
Task Type |
| "screenshot", "like this", "reference", "inspiration", "similar to" |
Design from reference |
| "UI", "component", "page", "interface", "design" |
Build UI |
| "bug", "error", "broken", "not working", "fix" |
Bug fixing |
| "flaky", "sometimes fails", "intermittent" |
Flaky tests |
| "slow", "performance", "optimize", "speed" |
Performance issues |
| "feature", "add", "implement", "build" |
New feature |
| "API", "endpoint", "backend", "server" |
API development |
| "how to", "docs", "documentation", "learn" |
Research & build |
| "write", "article", "content", "blog" |
Content creation |
| "prompt", "LLM", "Claude", "GPT" |
LLM prompts |
| "deploy", "hosting", "production" |
Deploy app |
| "database", "query", "migration" |
Database work |
| "MCP", "tool", "integration" |
MCP work |
Presenting the Workflow
Use AskUserQuestion to present the recommended workflow:
**Recommended Workflow for:** [task description]
1. **[skill-name]** - [what it does for this task]
2. **[skill-name]** - [what it does for this task]
3. **[skill-name]** - [what it does for this task]
**Why this order:** [brief rationale]
Question format:
- header: "Workflow"
- multiSelect: false
- options:
- "Accept workflow" - Run all steps in sequence
- "Modify workflow" - Let me adjust the steps
- "Skip to step" - Jump to a specific skill
- "Just show skills" - Show individual options instead
Workflow Execution
When user accepts:
- Run Mandatory Quality Gate first - Think through data flow, async, race conditions
- Invoke first skill
- After completion, pass relevant context to next skill
- Continue through workflow
- Self-roast before claiming done - Actively try to break your own code
- Offer to run
code-review at end if not included
When user wants to modify:
- Present all skills in workflow as multiSelect list
- Let them remove/reorder
- Ask if they want to add any other skills
- Execute modified workflow
Context Passing
Maintain a workflow context that includes:
- Original task description
- Outputs/decisions from each completed skill
- Any user feedback during execution
Pass this context when invoking each skill so they build on previous work.
Rules
- Always present workflow first - Never auto-execute without approval
- Explain the rationale - Help user understand why this sequence
- Allow modification - User knows their needs best
- Pass context forward - Each skill should know what came before
- Offer code-review - Suggest at end of any coding workflow
- Handle unknowns - If task doesn't match patterns, ask clarifying questions first
- ⚠️ MANDATORY: Run Quality Gate - Before ANY code, think through data/async/race conditions
- ⚠️ MANDATORY: Self-Roast - Before claiming done, actively try to break your code
- No half-assed work - If you find issues, fix them. Don't ship with known problems.
Google-Engineer Production Checklist (MANDATORY)
Every implementation MUST include solutions for ALL of these:
| Concern |
Required Solution |
| DRY Violations |
Centralized config modules for any value used in 2+ places |
| Error Handling |
Error boundaries (React), try-catch with proper logging, graceful degradation |
| Loading States |
Skeleton loaders that match content structure (NOT spinners) |
| User Feedback |
Toast/notification for ALL mutations (success AND failure) |
| Optimistic Updates |
TanStack Query pattern with snapshot/rollback for instant UX |
| Mobile UX |
Min 44px touch targets, responsive grids, thumb-zone placement |
| Type Safety |
Strict TypeScript, Zod validation at boundaries, no any |
| Testing |
E2E tests for critical paths, unit tests for business logic |
| Accessibility |
ARIA labels, keyboard navigation, color contrast |
| Performance |
Lazy loading, code splitting, memoization where needed |
Defensive Programming Patterns:
- Validate inputs at system boundaries (API routes, form submissions)
- Never trust client data on the server
- Use TypeScript strict mode
- Prefer immutable updates
- Handle null/undefined explicitly
- Log errors with context (not just the error message)
Mandatory Quality Gate (ALL TASKS)
⚠️ THIS IS NOT OPTIONAL - APPLIES TO EVERY TASK, EVERY FIX, EVERY FEATURE
BEFORE writing ANY code, ask yourself:
Understand the data flow
- Where does the data come from?
- What updates the data?
- What depends on fresh data?
Check async/await ordering
- Does this code depend on data that's fetched asynchronously?
- Am I updating UI state BEFORE or AFTER the data is ready?
- Will the user see stale data flash before the update?
Race condition checklist
- Can the user trigger this action multiple times rapidly?
- What happens if async operation A completes after operation B started?
- Is there shared state that could be corrupted?
State timing questions
- When I call
setState, what data will the next render see?
- Am I reading from state that was JUST updated (it won't be fresh yet)?
- Should I
await something before showing UI?
Red flags that indicate duct tape:
- "It works but might flash wrong data briefly" → NOT DONE
- "The data updates on the next render" → FIX THE ORDERING
- "User just needs to refresh" → BUILD IT PROPERLY
- "Works if you don't click too fast" → HANDLE THE RACE CONDITION
- Setting state then immediately reading from array that state updates → AWAIT FIRST
Proper pattern for UI that depends on fresh data:
// WRONG - duct tape
doAsyncThing();
setShowModal(true); // Modal sees stale data
// RIGHT - proper
await doAsyncThing();
setShowModal(true); // Modal sees fresh data
Self-Roast Protocol (MANDATORY BEFORE "DONE")
After implementing ANY change, BEFORE claiming it's done:
Actively try to break it - Don't just test the happy path
- What if user clicks twice rapidly?
- What if the network is slow?
- What if data is missing/null?
- What if user does things out of order?
Question your assumptions
- "Will this always be true?" (probably not)
- "What if this state is stale?"
- "What happens on first load vs subsequent loads?"
Roast your own code
- Look at what you wrote and ask: "What's wrong with this?"
- If you can't find anything wrong, you're not looking hard enough
- Pretend a senior dev is reviewing - what would they critique?
Check these specific things:
If you find issues during self-roast → FIX THEM FIRST
Don't tell the user "it works" and then list caveats. Fix the caveats.
Build It Right Protocol
BEFORE starting any feature implementation:
Define "done" - Write a brief spec listing all user-facing touchpoints:
- What can users CREATE?
- What can users READ/VIEW?
- What can users UPDATE?
- What can users DELETE?
- What can users CONFIGURE?
Ask clarifying questions - If any part is ambiguous, ask BEFORE coding:
- "Should users be able to view X later?"
- "How should users configure this?"
- "What happens when Y occurs?"
Get approval on the spec - Present the full scope and confirm before implementing
DURING implementation:
No duct tape - If you find yourself saying:
- "You can run this SQL command to..." → Build the UI instead
- "We can add that later..." → Add it now or explicitly descope it
- "For now, just..." → Either do it properly or don't do it
Complete the loop - Every feature needs:
- The core functionality
- A way to view/access it
- A way to configure it (if applicable)
- Error handling for edge cases
AFTER implementation:
Verify completeness - Answer these before marking done:
- "What can a user do now that they couldn't before?"
- "Walk me through the complete user flow"
- "Is there any manual step required?" (if yes, not done)
Never claim "done" if:
- Tests are failing
- Implementation is partial
- Any workarounds are required
- Configuration requires raw SQL/CLI commands
Fallback: Individual Skill Selection
If user prefers to pick individual skills or task doesn't match patterns:
Skill Categories
Development & Coding
frontend-design - Production-grade UI with high design quality
frontend-development - React/TypeScript patterns, performance
backend-development - APIs, databases, auth, microservices
code-review - Security, quality, best practices
systematic-debugging - Root cause analysis and fixes
Planning & Thinking
brainstorming - Refine ideas through collaborative questioning
writing-plans - Design implementation strategies
executing-plans - Execute plans in controlled batches
Design & Media
aesthetic - Beautiful interfaces, design principles
canvas-design - Posters, art, static visual designs
ai-multimodal - Analyze/generate audio, video, images, PDFs
chrome-devtools - Browser automation, screenshots
Testing & Quality
webapp-testing - End-to-end testing
condition-based-waiting - Fix flaky tests
defense-in-depth - Multi-layer validation
Documentation & Research
docs-seeker - Find technical docs
prompt-engineering - Write LLM prompts
content-research-writer - Research and write with citations
Infrastructure & Tools
mcp-builder - Create MCP servers
mcp-management - Discover/execute MCP tools
devops - Cloudflare, Docker, GCP
databases - MongoDB, PostgreSQL
1---2name: skill-router-23description: Analyzes tasks to find the optimal workflow of skills, presents the recommended sequence with rationale, and lets user approve/modify before execution. Use when starting any complex task, wanting help finding the right tools, or needing a structured approach.4---5
6# Skill Router
7
8Analyze tasks and recommend optimal skill workflows.
9
10## How It Works
11
121. **Analyze the task** - Understand what user is trying to accomplish
132. **Match to workflow pattern** - Find best skill sequence for the task type
143. **Present with rationale** - Explain why each skill and in what order
154. **Let user modify** - Accept, modify, or skip to specific step
165. **Execute sequentially** - Run skills in order, passing context between them
17
18## Workflow Pattern Library
19
20### Design & UI
21
22| Task Type | Workflow | When to Use |
23|-----------|----------|-------------|
24| **Design from reference** | `ai-multimodal` → `brainstorming` → `writing-plans` → `aesthetic` → `frontend-design` → `code-review` | User has a screenshot/reference they want to build from |
25| **Build UI from scratch** | `brainstorming` → `writing-plans` → `frontend-design` → `code-review` | Building new UI without reference |
26| **Improve existing UI** | `chrome-devtools` (screenshot) → `ai-multimodal` → `aesthetic` → `frontend-design` | Enhancing current design |
27| **Design system work** | `aesthetic` → `frontend-development` → `code-review` | Component libraries, tokens, themes |
28
29### Development
30
31| Task Type | Workflow | When to Use |
32|-----------|----------|-------------|
33| **New feature** | `brainstorming` → `writing-plans` → `executing-plans` → `code-review` | Adding significant functionality |
34| **API development** | `brainstorming` → `backend-development` → `code-review` | Building APIs, services |
35| **Research & build** | `docs-seeker` → `brainstorming` → `writing-plans` → `executing-plans` | Need to learn before implementing |
36| **Quick implementation** | `writing-plans` → `executing-plans` | Clear requirements, just need to build |
37
38### Debugging & Quality
39
40| Task Type | Workflow | When to Use |
41|-----------|----------|-------------|
42| **Bug fixing** | `systematic-debugging` → `code-review` | Finding and fixing bugs |
43| **Flaky tests** | `systematic-debugging` → `condition-based-waiting` → `code-review` | Tests pass sometimes, fail others |
44| **Performance issues** | `chrome-devtools` → `systematic-debugging` → `code-review` | Slow app, need profiling |
45| **Security review** | `code-review` → `defense-in-depth` | Checking for vulnerabilities |
46
47### Content & Documentation
48
49| Task Type | Workflow | When to Use |
50|-----------|----------|-------------|
51| **Content creation** | `content-research-writer` | Writing articles, docs with research |
52| **LLM prompts** | `prompt-engineering` | Writing prompts for AI systems |
53| **Technical docs** | `docs-seeker` → `content-research-writer` | Documentation with research |
54
55### Infrastructure
56
57| Task Type | Workflow | When to Use |
58|-----------|----------|-------------|
59| **Deploy app** | `devops` | Cloudflare, Docker, GCP deployment |
60| **Database work** | `databases` | MongoDB, PostgreSQL operations |
61| **MCP server** | `mcp-builder` → `code-review` | Building MCP integrations |
62| **MCP tools** | `mcp-management` | Discovering/using existing MCP tools |
63
64## Task Recognition Signals
65
66Look for these keywords to identify task type:
67
68| Keywords | Task Type |
69|----------|-----------|
70| "screenshot", "like this", "reference", "inspiration", "similar to" | Design from reference |
71| "UI", "component", "page", "interface", "design" | Build UI |
72| "bug", "error", "broken", "not working", "fix" | Bug fixing |
73| "flaky", "sometimes fails", "intermittent" | Flaky tests |
74| "slow", "performance", "optimize", "speed" | Performance issues |
75| "feature", "add", "implement", "build" | New feature |
76| "API", "endpoint", "backend", "server" | API development |
77| "how to", "docs", "documentation", "learn" | Research & build |
78| "write", "article", "content", "blog" | Content creation |
79| "prompt", "LLM", "Claude", "GPT" | LLM prompts |
80| "deploy", "hosting", "production" | Deploy app |
81| "database", "query", "migration" | Database work |
82| "MCP", "tool", "integration" | MCP work |
83
84## Presenting the Workflow
85
86Use `AskUserQuestion` to present the recommended workflow:
87
88```markdown
89**Recommended Workflow for:** [task description]
90
911. **[skill-name]** - [what it does for this task]
922. **[skill-name]** - [what it does for this task]
933. **[skill-name]** - [what it does for this task]
94
95**Why this order:** [brief rationale]
96```
97
98**Question format:**
99- header: "Workflow"
100- multiSelect: false
101- options:
102 - "Accept workflow" - Run all steps in sequence
103 - "Modify workflow" - Let me adjust the steps
104 - "Skip to step" - Jump to a specific skill
105 - "Just show skills" - Show individual options instead
106
107## Workflow Execution
108
109When user accepts:
1101. **Run Mandatory Quality Gate first** - Think through data flow, async, race conditions
1112. Invoke first skill
1123. After completion, pass relevant context to next skill
1134. Continue through workflow
1145. **Self-roast before claiming done** - Actively try to break your own code
1156. Offer to run `code-review` at end if not included
116
117When user wants to modify:
1181. Present all skills in workflow as multiSelect list
1192. Let them remove/reorder
1203. Ask if they want to add any other skills
1214. Execute modified workflow
122
123## Context Passing
124
125Maintain a workflow context that includes:
126- Original task description
127- Outputs/decisions from each completed skill
128- Any user feedback during execution
129
130Pass this context when invoking each skill so they build on previous work.
131
132## Rules
133
134- **Always present workflow first** - Never auto-execute without approval
135- **Explain the rationale** - Help user understand why this sequence
136- **Allow modification** - User knows their needs best
137- **Pass context forward** - Each skill should know what came before
138- **Offer code-review** - Suggest at end of any coding workflow
139- **Handle unknowns** - If task doesn't match patterns, ask clarifying questions first
140- **⚠️ MANDATORY: Run Quality Gate** - Before ANY code, think through data/async/race conditions
141- **⚠️ MANDATORY: Self-Roast** - Before claiming done, actively try to break your code
142- **No half-assed work** - If you find issues, fix them. Don't ship with known problems.
143
144## Google-Engineer Production Checklist (MANDATORY)
145
146**Every implementation MUST include solutions for ALL of these:**
147
148| Concern | Required Solution |
149|---------|-------------------|
150| **DRY Violations** | Centralized config modules for any value used in 2+ places |
151| **Error Handling** | Error boundaries (React), try-catch with proper logging, graceful degradation |
152| **Loading States** | Skeleton loaders that match content structure (NOT spinners) |
153| **User Feedback** | Toast/notification for ALL mutations (success AND failure) |
154| **Optimistic Updates** | TanStack Query pattern with snapshot/rollback for instant UX |
155| **Mobile UX** | Min 44px touch targets, responsive grids, thumb-zone placement |
156| **Type Safety** | Strict TypeScript, Zod validation at boundaries, no `any` |
157| **Testing** | E2E tests for critical paths, unit tests for business logic |
158| **Accessibility** | ARIA labels, keyboard navigation, color contrast |
159| **Performance** | Lazy loading, code splitting, memoization where needed |
160
161**Defensive Programming Patterns:**
162- Validate inputs at system boundaries (API routes, form submissions)
163- Never trust client data on the server
164- Use TypeScript strict mode
165- Prefer immutable updates
166- Handle null/undefined explicitly
167- Log errors with context (not just the error message)
168
169---
170
171## Mandatory Quality Gate (ALL TASKS)
172
173**⚠️ THIS IS NOT OPTIONAL - APPLIES TO EVERY TASK, EVERY FIX, EVERY FEATURE**
174
175**BEFORE writing ANY code, ask yourself:**
176
1771. **Understand the data flow**
178 - Where does the data come from?
179 - What updates the data?
180 - What depends on fresh data?
181
1822. **Check async/await ordering**
183 - Does this code depend on data that's fetched asynchronously?
184 - Am I updating UI state BEFORE or AFTER the data is ready?
185 - Will the user see stale data flash before the update?
186
1873. **Race condition checklist**
188 - Can the user trigger this action multiple times rapidly?
189 - What happens if async operation A completes after operation B started?
190 - Is there shared state that could be corrupted?
191
1924. **State timing questions**
193 - When I call `setState`, what data will the next render see?
194 - Am I reading from state that was JUST updated (it won't be fresh yet)?
195 - Should I `await` something before showing UI?
196
197**Red flags that indicate duct tape:**
198- "It works but might flash wrong data briefly" → NOT DONE
199- "The data updates on the next render" → FIX THE ORDERING
200- "User just needs to refresh" → BUILD IT PROPERLY
201- "Works if you don't click too fast" → HANDLE THE RACE CONDITION
202- Setting state then immediately reading from array that state updates → AWAIT FIRST
203
204**Proper pattern for UI that depends on fresh data:**
205```typescript
206// WRONG - duct tape
207doAsyncThing();
208setShowModal(true); // Modal sees stale data
209
210// RIGHT - proper
211await doAsyncThing();
212setShowModal(true); // Modal sees fresh data
213```
214
215---
216
217## Self-Roast Protocol (MANDATORY BEFORE "DONE")
218
219**After implementing ANY change, BEFORE claiming it's done:**
220
2211. **Actively try to break it** - Don't just test the happy path
222 - What if user clicks twice rapidly?
223 - What if the network is slow?
224 - What if data is missing/null?
225 - What if user does things out of order?
226
2272. **Question your assumptions**
228 - "Will this always be true?" (probably not)
229 - "What if this state is stale?"
230 - "What happens on first load vs subsequent loads?"
231
2323. **Roast your own code**
233 - Look at what you wrote and ask: "What's wrong with this?"
234 - If you can't find anything wrong, you're not looking hard enough
235 - Pretend a senior dev is reviewing - what would they critique?
236
2374. **Check these specific things:**
238 - [ ] Async operations complete before dependent code runs
239 - [ ] State updates are awaited before UI reads from them
240 - [ ] Error cases are handled (not just logged)
241 - [ ] Loading states exist where needed
242 - [ ] User can't break it with rapid clicks
243 - [ ] Works on first load, not just after refresh
244
245**If you find issues during self-roast → FIX THEM FIRST**
246
247Don't tell the user "it works" and then list caveats. Fix the caveats.
248
249---
250
251## Build It Right Protocol
252
253**BEFORE starting any feature implementation:**
254
2551. **Define "done"** - Write a brief spec listing all user-facing touchpoints:
256 - What can users CREATE?
257 - What can users READ/VIEW?
258 - What can users UPDATE?
259 - What can users DELETE?
260 - What can users CONFIGURE?
261
2622. **Ask clarifying questions** - If any part is ambiguous, ask BEFORE coding:
263 - "Should users be able to view X later?"
264 - "How should users configure this?"
265 - "What happens when Y occurs?"
266
2673. **Get approval on the spec** - Present the full scope and confirm before implementing
268
269**DURING implementation:**
270
2714. **No duct tape** - If you find yourself saying:
272 - "You can run this SQL command to..." → Build the UI instead
273 - "We can add that later..." → Add it now or explicitly descope it
274 - "For now, just..." → Either do it properly or don't do it
275
2765. **Complete the loop** - Every feature needs:
277 - The core functionality
278 - A way to view/access it
279 - A way to configure it (if applicable)
280 - Error handling for edge cases
281
282**AFTER implementation:**
283
2846. **Verify completeness** - Answer these before marking done:
285 - "What can a user do now that they couldn't before?"
286 - "Walk me through the complete user flow"
287 - "Is there any manual step required?" (if yes, not done)
288
2897. **Never claim "done" if:**
290 - Tests are failing
291 - Implementation is partial
292 - Any workarounds are required
293 - Configuration requires raw SQL/CLI commands
294
295## Fallback: Individual Skill Selection
296
297If user prefers to pick individual skills or task doesn't match patterns:
298
299### Skill Categories
300
301**Development & Coding**
302- `frontend-design` - Production-grade UI with high design quality
303- `frontend-development` - React/TypeScript patterns, performance
304- `backend-development` - APIs, databases, auth, microservices
305- `code-review` - Security, quality, best practices
306- `systematic-debugging` - Root cause analysis and fixes
307
308**Planning & Thinking**
309- `brainstorming` - Refine ideas through collaborative questioning
310- `writing-plans` - Design implementation strategies
311- `executing-plans` - Execute plans in controlled batches
312
313**Design & Media**
314- `aesthetic` - Beautiful interfaces, design principles
315- `canvas-design` - Posters, art, static visual designs
316- `ai-multimodal` - Analyze/generate audio, video, images, PDFs
317- `chrome-devtools` - Browser automation, screenshots
318
319**Testing & Quality**
320- `webapp-testing` - End-to-end testing
321- `condition-based-waiting` - Fix flaky tests
322- `defense-in-depth` - Multi-layer validation
323
324**Documentation & Research**
325- `docs-seeker` - Find technical docs
326- `prompt-engineering` - Write LLM prompts
327- `content-research-writer` - Research and write with citations
328
329**Infrastructure & Tools**
330- `mcp-builder` - Create MCP servers
331- `mcp-management` - Discover/execute MCP tools
332- `devops` - Cloudflare, Docker, GCP
333- `databases` - MongoDB, PostgreSQL