Skill creator

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

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

How to use this skill

Skill file

Skill Creator

Orchestrates intelligent skill selection and execution for skill creator 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 parse_orchestration_request(user_input: str, system_constraints: Dict) -> Dict:
    """Parse raw user input into structured orchestration features.
    
    Extracts intent, required tools, constraints, and priority signals.
    Validates against system constraints before routing.
    """
    if not user_input or not isinstance(user_input, str):
        raise ValueError("Input must be a non-empty string")
        
    # Extract core intent and entities using NLP pipeline
    intent = _nlp_extract_intent(user_input)
    entities = _nlp_extract_entities(user_input)
    priority = _detect_priority_signals(user_input)
    
    # Validate against system constraints (Law 2: Make illegal states unrepresentable)
    if priority == "critical" and not system_constraints.get("allow_critical"):
        raise PermissionError("Critical priority tasks are disabled in current environment")
        
    # Build structured feature vector for scoring
    features = {
        "raw_input": user_input,
        "intent": intent,
        "entities": entities,
        "priority": priority,
        "token_count": len(user_input.split()),
        "requires_parallel": _detect_parallel_signals(user_input),
        "timestamp": time.time()
    }
    
    return features

Pattern 2: Execution with Fallback

def score_and_route(features: Dict, skill_registry: List[Dict], history_db: Dict) -> Dict:
    """Calculate multi-factor scores and determine optimal routing path.
    
    Combines trigger matching, historical success rates, and dependency checks.
    Returns routing decision with confidence metrics and fallback chain.
    """
    if not features or not skill_registry:
        raise ValueError("Features and skill registry are required for routing")
        
    scored_skills = []
    for skill in skill_registry:
        # Calculate trigger overlap score
        trigger_match = _calculate_trigger_overlap(features["intent"], skill["triggers"])
        
        # Fetch historical performance
        hist_key = f"{features['intent']}:{skill['name']}"
        success_rate = history_db.get(hist_key, {}).get("success_rate", 0.5)
        
        # Check dependency availability
        deps_met = all(_check_dependency_availability(dep) for dep in skill.get("dependencies", []))
        
        # Weighted scoring formula
        raw_score = (trigger_match * 0.5) + (success_rate * 0.3) + (0.2 if deps_met else 0.0)
        
        if raw_score >= 0.6:
            scored_skills.append({
                "skill": skill,
                "score": round(raw_score, 3),
                "fallback_chain": skill.get("fallback_skills", []),
                "estimated_latency_ms": _estimate_execution_time(skill)
            })
            
    # Sort by score descending and select top candidate
    scored_skills.sort(key=lambda x: x["score"], reverse=True)
    selected = scored_skills[0] if scored_skills else None
    
    return {
        "selected_skill": selected["skill"] if selected else None,
        "confidence": selected["score"] if selected else 0.0,
        "fallback_chain": selected["fallback_chain"] if selected else [],
        "routing_timestamp": time.time()
    }

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 |

|---|---|

| skill-engineering | Provides engineering practices that complement skill creation workflows |

| skill-documentation-best-practices | Covers documentation patterns for high-fidelity SKILL.md files |


Constraints

MUST DO

MUST NOT DO

Live References

Authoritative documentation links for this 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.