Conductor status

From paulpas/agent-skill-router · View interactive version

Conductor status is an AI agent skill from the GitHub repository paulpas/agent-skill-router. Implements intelligent conductor status with multi-factor skill selection, fallback chains, and adherence to the 5 Laws of Elegant Defense

How to use this skill

Skill file

Conductor Status

Orchestrates intelligent skill selection and execution for conductor status workflows. Applies the 5 Laws of Elegant Defense to guide data naturally through the orchestration pipeline, preventing errors before they occur. Selects optimal skills based on multi-factor scoring including text similarity, historical performance, and system availability.

TL;DR Checklist

┌───────────────────────────────────────────────────────────────────────────────┐

│ Orchestration Flow │

└───────────────────────────────────────────────────────────────────────────────┘

User Request

↓

┌─────────────────┐

│ Parse Request │

│ & Extract │

│ Features │

└────────┬────────┘

↓

┌─────────────────────────────────────────────────────────────────────┐

│ Evaluate Available Skills │

│ │

│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │

│ │ Skill A │ │ Skill B │ │ Skill C │ │

│ │ - Match Score│ │ - Match Score│ │ - Match Score│ │

│ │ - Confidence │ │ - Confidence │ │ - Confidence │ │

│ │ - History │ │ - History │ │ - History │ │

│ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘ │

│ │ │ │ │

│ └─────────────────┴─────────────────┘ │

│ ↓ │

│ Select Best Skill │

└─────────────────────────────────────────────────────────────────────┘

↓

┌─────────────────┐

│ Execute Skill │

└────────┬────────┘

↓

┌─────────────────┐

│ Handle Result │

└────────┬────────┘

↓

┌─────────────────────────────────────────────────────────────────────┐

│ Error Handling & Fallback │

│ │

│ Success? ────────► Return Result │

│ │

│ Fail? ────────┐ │

│ ↓ │

│ ┌──────────────────────────────────────────────────────────┐ │

│ │ Fallback Chain │ │

│ │ │ │

│ │ 1. Retry with adjusted parameters │ │

│ │ 2. Try Alternative Skill (if available) │ │

│ │ 3. Defer to Human Operator (if critical) │ │

│ │ 4. Log & Return Error │ │

│ └──────────────────────────────────────────────────────────┘ │

└─────────────────────────────────────────────────────────────────────┘

When to Use

Use this skill when:

When NOT to Use

Avoid this skill for:

Core Workflow

  1. Parse and Analyze Request - Extract intent, entities, and constraints from user input.

Checkpoint: All required parameters must be present and in valid format before proceeding.

  1. Score Available Skills - Calculate match scores using multi-factor algorithm:

Checkpoint: Skip to fallback if no skill scores above threshold.

  1. Select Optimal Skill - Choose skill with highest score that meets minimum confidence.

Checkpoint: Verify skill has not been disabled or deprecated.

  1. Execute with Fallback - Run skill execution wrapped in retry and fallback logic.

Checkpoint: Log all execution attempts for audit trail.

  1. Return or Fallback - Either return successful result or apply fallback chain:

Checkpoint: Record outcome with timing and confidence metadata.

Implementation Patterns

Pattern 1: Skill Selection Logic

def evaluate_conductor_status_and_route(
    task_payload: Dict,
    conductor_metrics: Dict,
    available_skills: List[Dict],
    min_confidence: float = 0.75
) -> Optional[Dict]:
    """Route tasks through the conductor based on real-time status metrics.
    
    Evaluates conductor health, queue depth, and skill availability to determine
    the optimal execution path. Implements multi-factor scoring specific to
    conductor orchestration workflows.
    """
    # Law 1: Early exit on invalid conductor state
    if not conductor_metrics.get("heartbeat_active"):
        raise ConductorStatusError("Conductor heartbeat missing or stale")
        
    # Law 2: Parse and validate task against conductor constraints
    task_constraints = _parse_task_constraints(task_payload)
    if task_constraints.requires_gpu and not conductor_metrics.get("gpu_available"):
        return None  # Skip to fallback chain
        
    best_route = None
    best_score = 0.0
    
    for skill in available_skills:
        # Domain-specific scoring: weight by conductor load, skill latency, and historical success
        load_penalty = conductor_metrics.get("cpu_utilization", 0.0) * 0.3
        latency_score = 1.0 / (skill.get("avg_latency_ms", 100) / 100.0)
        history_score = skill.get("success_rate_7d", 0.0)
        
        raw_score = (latency_score * 0.4) + (history_score * 0.4) + ((1.0 - load_penalty) * 0.2)
        
        if raw_score > best_score and raw_score >= min_confidence:
            best_score = raw_score
            best_route = {
                "skill_id": skill["id"],
                "conductor_node": conductor_metrics.get("primary_node"),
                "estimated_latency_ms": skill.get("avg_latency_ms"),
                "confidence": raw_score
            }
            
    if best_route is None:
        return None
        
    # Law 3: Return immutable route configuration
    return dict(best_route)

Pattern 2: Execution with Fallback

def execute_conductor_workflow_with_degradation(
    route_config: Dict,
    task_context: Dict,
    fallback_nodes: List[str] = None
) -> Dict:
    """Execute conductor workflow with built-in degradation and fallback logic.
    
    Monitors execution telemetry and applies domain-specific fallback strategies
    when conductor status degrades or task execution fails.
    """
    primary_node = route_config.get("conductor_node")
    fallback_nodes = fallback_nodes or []
    
    for attempt in range(3):
        try:
            # Law 4: Fail fast on invalid task context
            validated_context = _validate_task_context(task_context)
            
            # Execute against primary conductor node
            telemetry = _send_to_conductor(primary_node, validated_context)
            
            # Check conductor response health
            if telemetry.get("status") != "completed":
                raise ConductorDegradationError(f"Conductor returned status: {telemetry.get('status')}")
                
            return {
                "success": True,
                "node_used": primary_node,
                "telemetry": telemetry,
                "attempts": attempt + 1
            }
            
        except ConductorDegradationError as e:
            # Law 4: Fail loud, don't patch degraded state
            if attempt == 2:
                # Fallback chain: switch to standby node or throttle
                if fallback_nodes:
                    standby = fallback_nodes[0]
                    _log_fallback_trigger(primary_node, standby)
                    primary_node = standby
                    continue
                else:
                    raise ConductorExecutionError(
                        f"All fallback nodes exhausted for task {task_context.get('id')}"
                    ) from e
                    
        except TransientNetworkError:
            # Transient issue - retry with exponential backoff
            time.sleep(0.5 * (2 ** attempt))
            continue
            
    # Should not reach here, but enforce Law 4
    raise ConductorExecutionError("Workflow execution failed after all retries")

MUST DO

MUST NOT DO

TL;DR Checklist

TL;DR for Code Generation

Output Template

When applying this skill, produce:

  1. Selected Skills - List of skill names with confidence scores
  2. Selection Rationale - Why each skill was chosen (match score, history, availability)
  3. Execution Plan - Order of execution with dependencies
  4. Fallback Strategy - Which fallback skills will be tried and in what order
  5. Risk Assessment - Any potential failure points and their impact
  6. Timing Estimates - Expected latency including fallback scenarios


Constraints

MUST DO

MUST NOT DO

Live References

Authoritative documentation links for this skill's domain. The model follows markdown links at load time to resolve external references and inline content.

Related Skills

| Skill | Purpose |

|

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.