Testing qa

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

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

How to use this skill

Skill file

Testing Qa

Orchestrates intelligent skill selection and execution for testing qa 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 route_test_suite(
    code_changes: List[Dict],
    test_registry: Dict[str, List[str]],
    flaky_history: Dict[str, float]
) -> Dict[str, List[str]]:
    """Route appropriate test suites based on code changes and historical reliability.
    
    Analyzes diff paths to trigger relevant test categories (unit, integration, e2e).
    Applies confidence scoring based on flakiness history and recent failure rates.
    Returns a prioritized mapping of test suites to execute.
    """
    if not code_changes:
        return {"full_regression": test_registry.get("full_regression", [])}
        
    triggered_suites = set()
    confidence_scores = {}
    
    for change in code_changes:
        path = change.get("path", "")
        if "/tests/" in path or "test_" in path:
            triggered_suites.update(test_registry.get("unit", []))
            confidence_scores["unit"] = 0.95
        elif "api/" in path or "server/" in path:
            triggered_suites.update(test_registry.get("integration", []))
            confidence_scores["integration"] = 0.85
        elif "ui/" in path or "frontend/" in path:
            triggered_suites.update(test_registry.get("e2e", []))
            confidence_scores["e2e"] = 0.75
            
    # Filter out high-flakiness suites unless explicitly requested
    prioritized = {}
    for suite in triggered_suites:
        flake_rate = flaky_history.get(suite, 0.0)
        if flake_rate < 0.2:
            prioritized[suite] = test_registry.get(suite, [])
        else:
            prioritized[suite] = test_registry.get(suite, []) + ["--flaky-retry"]
            
    return {"suites": list(prioritized.keys()), "confidence": confidence_scores}

Pattern 2: Execution with Fallback

def execute_qa_pipeline(
    test_suites: List[str],
    env_config: Dict,
    fallback_strategy: str = "parallel_retry"
) -> Dict:
    """Execute QA test pipeline with intelligent fallback for failures.
    
    Runs selected test suites against the target environment.
    Implements fallback chains: retry flaky tests, switch to parallel execution,
    or escalate to manual review if critical paths fail.
    Returns structured results with pass/fail metrics and latency.
    """
    results = {"suites_executed": [], "failures": [], "fallbacks_applied": []}
    
    for suite in test_suites:
        try:
            output = run_test_runner(suite, env_config)
            parsed = parse_test_output(output)
            
            if parsed["status"] == "passed":
                results["suites_executed"].append({"suite": suite, "status": "passed"})
            else:
                # Fallback: Retry flaky tests with increased timeout
                if parsed.get("flaky", False) and fallback_strategy == "parallel_retry":
                    retry_output = run_test_runner(suite, env_config, timeout_multiplier=2.0)
                    retry_parsed = parse_test_output(retry_output)
                    if retry_parsed["status"] == "passed":
                        results["fallbacks_applied"].append(f"{suite}: flaky retry succeeded")
                        results["suites_executed"].append({"suite": suite, "status": "passed"})
                        continue
                
                results["failures"].append({"suite": suite, "errors": parsed["errors"]})
                
        except EnvironmentError as e:
            # Fallback: Switch to isolated container environment
            results["fallbacks_applied"].append(f"{suite}: env fallback to isolated container")
            try:
                isolated_output = run_test_runner(suite, env_config.copy(), isolated=True)
                results["suites_executed"].append({"suite": suite, "status": "passed", "fallback": "isolated"})
            except Exception as fallback_err:
                results["failures"].append({"suite": suite, "errors": [str(fallback_err)], "escalated": True})
                
    return results

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.