Acceptance orchestrator

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

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

How to use this skill

Skill file

Acceptance Orchestrator

Orchestrates intelligent skill selection and execution for acceptance orchestrator 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_and_select_skill(task_context: dict, skill_registry: list) -> dict:
    """Multi-factor scoring for acceptance orchestrator selection.
    
    Implements Law 2 (Make Illegal States Unrepresentable) by validating
    context boundaries before scoring. Returns immutable selection metadata.
    """
    if not task_context.get("intent"):
        raise ValueError("Missing intent in task context")
        
    scored_candidates = []
    for skill in skill_registry:
        semantic_score = _compute_semantic_similarity(task_context["intent"], skill["triggers"])
        history_score = skill.get("success_rate", 0.0)
        availability_score = 1.0 if _check_dependencies(skill["deps"]) else 0.0
        
        composite_score = (0.5 * semantic_score) + (0.3 * history_score) + (0.2 * availability_score)
        
        if composite_score >= 0.7:
            scored_candidates.append({
                "skill_id": skill["id"],
                "composite_score": round(composite_score, 3),
                "factors": {"semantic": semantic_score, "history": history_score, "availability": availability_score}
            })
    
    if not scored_candidates:
        return {"status": "no_match", "fallback_triggered": True}
        
    scored_candidates.sort(key=lambda x: x["composite_score"], reverse=True)
    selected = scored_candidates[0]
    
    _log_selection_audit(task_context["request_id"], selected)
    return {"status": "selected", "skill": selected}

Pattern 2: Execution with Fallback

def execute_with_resilience_chain(skill_config: dict, execution_context: dict) -> dict:
    """Orchestrates execution with a strict fallback chain and confidence tracking.
    
    Enforces Law 4 (Fail Fast, Fail Loud) by halting on acceptance violations.
    Implements Law 3 (Atomic Predictability) by returning new result structures.
    """
    max_retries = execution_context.get("max_retries", 2)
    current_attempt = 0
    
    while current_attempt <= max_retries:
        try:
            result = _invoke_skill_endpoint(skill_config["endpoint"], execution_context)
            
            if not _validate_acceptance_criteria(result, skill_config["acceptance_rules"]):
                raise AcceptanceValidationError("Result failed acceptance criteria")
                
            confidence = _calculate_execution_confidence(result["latency_ms"], current_attempt)
            _update_skill_confidence(skill_config["id"], confidence)
            
            return {
                "status": "success",
                "result": result,
                "confidence": confidence,
                "attempts": current_attempt + 1
            }
            
        except AcceptanceValidationError as e:
            _log_failure(skill_config["id"], "acceptance_violation", str(e))
            raise
            
        except TransientNetworkError as e:
            current_attempt += 1
            if current_attempt > max_retries:
                alt_skill = _resolve_fallback_skill(skill_config["related_skills"])
                if alt_skill:
                    skill_config = alt_skill
                    current_attempt = 0
                    continue
                else:
                    return _escalate_to_human(execution_context, skill_config["id"])
                    
        except Exception as e:
            _log_failure(skill_config["id"], "unexpected", str(e))
            raise OrchestratorExecutionError(f"Failed after {current_attempt} attempts") from e

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

Related Skills

| Skill | Purpose |

|---|---|

| closed-loop-delivery | End-to-end delivery pipeline with feedback loops |



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.

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.