Skip to content

mikeoptimax/task-router

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Task Router

Intelligent task routing and orchestration for OpenClaw agents.

Turns any agent into a proper orchestrator by scoring request complexity, routing to the right execution mode, and spawning sub-agents for heavy work β€” automatically.

What It Does

Every incoming request gets scored across four dimensions:

Dimension Weight What It Measures
Multi-step logic 35% How many operations, how intertwined
Ambiguity 25% How much interpretation is needed
Stakes 20% Blast radius if something goes wrong
Novelty 20% How far outside well-known patterns

The composite score (0-10) routes to one of three execution modes:

Score Route What Happens
0-3 Inline Execute immediately, no overhead
3.1-6 Enhanced Structured reasoning, then step-by-step execution
6.1-10 Sub-agent Decompose into parallel tracks, spawn sub-agents

Why This Exists

Existing skills like task-decomposer and adaptive-reasoning can score or decompose tasks, but they never execute. They hand you a plan and leave.

task-router makes the routing decision AND acts on it:

  • Scores the request (4-dimension weighted rubric)
  • Routes to the right execution mode (inline / enhanced / sub-agent)
  • Decomposes complex tasks into parallel subtasks with dependency graphs
  • Spawns sub-agents with complete structured briefings
  • Selects models per subtask (cheap for boilerplate, powerful for hard problems)
  • Coordinates multi-wave execution and integrates results
  • Tracks outcomes for calibration over time

Installation

openclaw skill install mikeoptimax/task-router

Or clone and install locally:

git clone https://github.com/mikeoptimax/task-router.git
openclaw skill install ./task-router

How It Works

The skill activates automatically (always: true) and runs its routing protocol on every incoming request. No slash command needed.

Example Output

For a simple request:

[TaskRouter] Score: 1.4 (steps:2 ambiguity:1 stakes:1 novelty:1) β†’ inline

For a complex request:

[TaskRouter] Score: 7.3 (steps:8 ambiguity:6 stakes:7 novelty:7) β†’ sub-agent

TASK: Add user authentication with OAuth, JWT, and role-based access control

SUBTASK 1: OAuth Provider Integration
  Dependencies: none

SUBTASK 2: JWT Token Service
  Dependencies: none

SUBTASK 3: Role-Based Access Control
  Dependencies: Subtask 1, Subtask 2

EXECUTION PLAN:
  Wave 1 (parallel): Subtask 1, Subtask 2
  Wave 2 (after wave 1): Subtask 3

Sub-agents get complete structured briefings (mission, context, steps, inputs, outputs, constraints, done-when criteria) β€” not just a one-liner.

Key Features

Parallel Execution

Independent subtasks launch simultaneously. The skill builds a dependency graph and groups work into waves β€” no serial execution when parallel is possible.

Model Selection

Each sub-agent gets the right model for its job. Boilerplate generation uses cheap models. Complex architecture gets top-tier reasoning. No wasted spend.

Anti-Pattern Detection

Built-in guardrails prevent common mistakes:

  • Over-spawning (using sub-agents for trivial tasks)
  • Under-spawning (burning context on complex tasks)
  • Serial execution when parallel is possible
  • Incomplete sub-agent briefings
  • Decomposition theater (breaking simple work into unnecessary subtasks)

Outcome Tracking

Logs routing decisions and results for calibration. Over time, the scoring gets better calibrated to your specific workload patterns.

Requirements

  • OpenClaw with sessions_spawn and subagents tools
  • No external dependencies, APIs, or databases
  • Works out of the box with just the SKILL.md file

License

MIT

About

πŸš€ Intelligent task routing for OpenClaw. Scores complexity, routes inline or to sub-agents, decomposes big tasks into parallel tracks. Turns a chatbot into an orchestrator.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors