Get the FREE Ultimate OpenClaw Setup Guide →

smart-routing

npx machina-cli add skill a5c-ai/babysitter/smart-routing --openclaw
Files (1)
SKILL.md
1.6 KB

Smart Routing

Overview

Intelligent task routing using Q-Learning to select optimal execution paths. Simple tasks route to Agent Booster (WASM, <1ms, $0), medium tasks to efficient models, and complex tasks to Opus + multi-agent swarms.

When to Use

  • Optimizing cost vs. quality tradeoffs for diverse task types
  • When tasks range from simple transforms to complex multi-file changes
  • Reducing latency for common code transformations
  • Learning from routing history to improve future decisions

Routing Tiers

TierTargetLatencyCost
Agent BoosterSimple transforms (var-to-const, add-types)<1ms$0
MediumStandard coding tasks~500msLow
ComplexMulti-agent swarm coordination2-5sHigher

Agent Booster Transforms

  • var-to-const - Variable declaration modernization
  • add-types - TypeScript type annotation insertion
  • add-error-handling - Try/catch wrapper insertion
  • async-await - Promise chain to async/await conversion
  • extract-function - Code block extraction to named functions
  • add-jsdoc - Documentation generation

Agents Used

  • agents/optimizer/ - Performance and cost optimization
  • agents/architect/ - Complex task decomposition

Tool Use

Invoke via babysitter process: methodologies/ruflo/ruflo-task-routing

Source

git clone https://github.com/a5c-ai/babysitter/blob/main/plugins/babysitter/skills/babysit/process/methodologies/ruflo/skills/smart-routing/SKILL.mdView on GitHub

Overview

Smart Routing uses Q-Learning to select optimal execution paths based on task complexity. Simple tasks go to Agent Booster (WASM, <1ms, $0), medium tasks use efficient models, and complex tasks go to Opus with multi-agent swarms, guided by Mixture-of-Experts model selection.

How This Skill Works

A Q-Learning controller analyzes task features and routing history to decide which tier to route to. The system employs three routing tiers (Agent Booster for simple transforms, Medium for standard coding tasks, Complex for multi-agent coordination) and leverages Agent Booster Transforms and dedicated agents to optimize latency and cost. Invocation is performed via the babysitter process at the path methodologies/ruflo/ruflo-task-routing.

When to Use It

  • Optimizing cost vs. quality tradeoffs for diverse task types
  • When tasks range from simple transforms to complex multi-file changes
  • Reducing latency for common code transformations
  • Learning from routing history to improve future decisions
  • Balancing latency and compute resources by tiering to Agent Booster, Medium, or Complex paths

Quick Start

  1. Step 1: Classify the task complexity (simple, medium, or complex) based on transformation scope and files touched
  2. Step 2: Invoke routing via the babysitter path: methodologies/ruflo/ruflo-task-routing to select Agent Booster, Medium, or Complex
  3. Step 3: Collect results and feed performance data back into the routing model to improve future decisions

Best Practices

  • Map task types to the appropriate routing tier (Agent Booster, Medium, Complex) to minimize latency and cost
  • Prioritize simple transforms for the Agent Booster WASM path (<1ms, $0) whenever possible
  • Capture routing feedback and latency data to continually train the Q-Learning model
  • Monitor tier utilization to avoid bottlenecks in Medium or Complex paths
  • Familiarize teams with the supported Agent Booster Transforms to leverage fast-path options

Example Use Cases

  • A project automatically routes var-to-const and add-types transformations to Agent Booster for near-zero latency
  • Frequent TS type annotations are handled by the Medium tier using efficient models
  • Large-scale refactors involving multiple files are coordinated through the Complex tier (Opus + multi-agent swarms)
  • CI pipelines route common code transformations to reduce latency and keep up with rapid iterations
  • Routing history is analyzed to refine Q-Learning decisions and reduce average task completion time

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers