cordsjon

agentflow-orchestrator

0
0
# Install this skill:
npx skills add cordsjon/agentflow --skill "agentflow-orchestrator"

Install specific skill from multi-skill repository

# Description

Route tasks to agents using capability scoring, detect stalls, and manage dependency cascades. Use when assigning work to agents, investigating stalled tasks, or managing multi-agent coordination.

# SKILL.md


name: agentflow-orchestrator
description: Route tasks to agents using capability scoring, detect stalls, and manage dependency cascades. Use when assigning work to agents, investigating stalled tasks, or managing multi-agent coordination.
user-invocable: false


Orchestrator β€” Lightweight Routing Layer

Removes the human as the routing bottleneck between triage and execution.
The orchestrator is a phase, not a daemon β€” it runs at defined trigger points inside the autopilot loop.

When It Runs

1. Autopilot Cycle Start

After reading next [ ] item, before DOR check:
1. Stall check β€” is the current/last item stuck?
2. Assignment check β€” does item have @agent? If not, route it
3. Unblock scan β€” did a recently completed item satisfy any needs: dependency?
4. Context preload β€” assemble file refs, risk flags, prior art into _Context:_ line

2. Task Completion

After moving item to DONE-Today:
1. Dependency cascade β€” check BACKLOG for items with needs: <completed_item>. If found and Ready, suggest queuing
2. Stall reset β€” clear stall:N counter
3. Planning trigger β€” if queue has <= 1 unchecked item, suggest planning round

Routing Scoring

For each registered agent:

score = sum(keyword_match(task_keywords, agent.strengths))
      + context_bonus(task_files, agent.context_access)    (+2)
      - constraint_penalty(task_requirements, agent.constraints)  (-10)

Confidence Thresholds

  • > 0.7 β€” auto-route to best agent
  • 0.3 - 0.7 β€” suggest agent, human confirms
  • < 0.3 β€” tag as @unrouted, skip to next routable item

Stall Detection

A task is stalled when:
1. Time-based: no activity file changes for > 10min (30min for requirements sessions)
2. Error-loop: same error pattern 3+ times in console tail
3. Explicit: agent writes STALLED: <reason>

Escalation Ladder

Level Trigger Action
stall:1 First detection Log warning, increment counter
stall:2 Second consecutive check Write stall warning
stall:3 Third consecutive check Pause autopilot, escalate to human

On multi-agent setup: if another agent has capability, suggest re-routing.

Context Preloading

The orchestrator assembles:
1. File references β€” files mentioned in task description or spec
2. Related threads β€” if task originated from a message, include thread
3. Prior art β€” related completed items from DONE-Today or archives
4. Risk flags β€” if task touches a known risk, surface the risk entry

Result Validation

After execution, before commit:
1. Greenlight β€” project test suite must pass
2. Known patterns scan β€” check diff against anti-patterns
3. Constraint check β€” verify no project constraint violations

See routing.md for detailed scoring examples.

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.