Workflow Router
Unified entry point that intelligently routes tasks to specialized workflows based on intent detection.
Usage
/workflow <task description>
Intent Detection Matrix
| Intent | Indicators | Route To |
|---|---|---|
| Quick Fix | Traceback, line numbers, typo, "fix this", specific error | /issue --quick |
| Complex Issue | "Should we...", multiple options, cross-cutting concerns | /issue --plan |
| Feature | "Add", "Create", "Build", new functionality | /feature |
| Frontend/UI | "page", "component", "UI", "website", "landing", "form", "button", "dashboard" | /frontend-design (plugin) |
| Testing | "write tests", "add tests", "test coverage", "unit tests" | /tdd |
| Data Analysis | Database, SQL, DataFrame, "analyze", "report" | /analyze |
| Code Review | "Review", "PR #", "check this code" | /review |
| Refactor | "Refactor", "clean up", "restructure", "reorganize" | /refactor |
| Debug | "Debug", "not working", "unexpected behavior" | /debug |
| Documentation | "Document", "write docs", "API reference" | /docs |
Routing Logic
Step 1: Parse Intent
Extract keywords and patterns from the task description:
Keywords:
- FIX: traceback, error, fix, bug, typo, broken, fails, crash
- FEATURE: add, create, build, implement, new, develop
- FRONTEND: page, component, UI, website, landing, form, button, dashboard, frontend, interface, design, layout, style, CSS, HTML
- TESTING: write tests, add tests, test coverage, unit tests, integration tests, pytest, coverage
- ANALYZE: analyze, report, data, sql, query, metrics
- REVIEW: review, PR, check, audit, examine
- REFACTOR: refactor, clean, restructure, reorganize, simplify
- DEBUG: debug, not working, unexpected, investigate, why
- DOCS: document, docs, readme, api reference, explain
Patterns:
- PROJECT-123, #123 → Issue/ticket reference
- error: ..., Exception: ... → Error context
- "should we", "what if", "options" → Complex decision
Step 2: Complexity Assessment
Score complexity (1-10):
Low complexity (1-3):
- Single file affected
- Clear error message
- Specific fix requested
- No architectural implications
Medium complexity (4-6):
- 2-5 files affected
- Some ambiguity in approach
- May require investigation first
High complexity (7-10):
- Cross-cutting concerns
- Architectural implications
- Multiple valid approaches
- Requires planning phase
Step 3: Route Decision
IF complexity <= 3 AND intent == FIX:
→ /issue --quick
IF complexity > 3 OR intent == FEATURE:
→ /feature (for new functionality)
→ /issue --plan (for complex fixes)
IF intent == FRONTEND:
→ /frontend-design (plugin skill)
IF intent == TESTING:
→ /tdd
IF intent == ANALYZE:
→ /analyze
IF intent == REVIEW:
→ /review
IF intent == REFACTOR:
→ /refactor
IF intent == DEBUG:
→ /debug
IF intent == DOCS:
→ /docs
Step 4: User Override
If uncertain, present options:
Detected Intent: [INTENT]
Complexity Score: [N]/10
Recommended: /[skill]
Options:
1. Proceed with /[skill]
2. Use /[alternative] instead
3. Just fix it directly (skip workflow)
Examples
Input: "Fix the typo in utils.py line 42"
Route: /issue --quick (low complexity, specific fix)
Input: "Add user authentication to the app"
Route: /feature (new functionality, high complexity)
Input: "The API is returning 500 errors sometimes"
Route: /debug (investigation needed)
Input: "Analyze the Q4 sales data and create a report"
Route: /analyze (data analysis intent)
Input: "Review PR #123"
Route: /review (explicit review request)
Input: "Refactor the authentication module"
Route: /refactor (explicit refactor request)
Input: "Document the REST API endpoints"
Route: /docs (documentation request)
Input: "Should we use Redis or Memcached for caching?"
Route: /issue --plan (decision needed, plan mode)
Input: "Create a landing page for the product"
Route: /frontend-design (UI/frontend work)
Input: "Build a dashboard with charts"
Route: /frontend-design (UI component)
Input: "Write tests for the user service"
Route: /tdd (explicit test request)
Input: "Add test coverage for the API endpoints"
Route: /tdd (testing intent)
Integration Notes
- All routed skills should invoke
/tddfor implementation - All implementations end with
/verifybefore commit - Expert thinking is auto-injected via
expert-mode.mdrules - Language detection happens within each skill based on project files
Plugin Integration
frontend-design plugin: When routing to /frontend-design, invoke the plugin skill:
Skill(skill="frontend-design:frontend-design")
This plugin provides enhanced design guidance for creating distinctive, non-generic UI components.
Language Detection
Detect language from project files and adjust commands:
| Language | Test Command | Lint Command | Format Command |
|---|---|---|---|
| Python (.py) | pytest -v | ruff check . | ruff format . |
| JavaScript (.js) | npm test | eslint . | prettier --write . |
| TypeScript (.ts/.tsx) | npm test | eslint . | prettier --write . |
Detection priority:
- Check for
pyproject.toml→ Python - Check for
package.json→ JavaScript/TypeScript - Check file extensions in
src/
