loop selector

    1

    A task router that selects the optimal iterative pattern and generates the required loop configuration.

    Free

    1 useSecurity scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    loop selector

    Example session with this skill installed

    I have a prompt for classifying support tickets that currently hits 82% accuracy. I want to improve it until it reaches at least 95% accuracy. How should I structure the loop?

    • Read your context and instructions
    • Compiled the loop selector

    The task involves tuning a reusable artifact (a prompt template) against a specific, achievable numeric metric. This is a system optimization task that fits the Prompt Optimization pattern.

    Loop Configuration

    {
      "category": "system-optimization-loops",
      "pattern": "Prompt Optimization",
      "loop_start": {
        "exit_mode": "target",
        "target_value": 0.95,
        "direction": "increase",
        "max_iterations": 8
      },
      "feedback_loop": {
        "metric": "classification_accuracy",
        "companion_tool": "prompt-evolve"
      }
    }
    

    Next steps

    1. Review the system-optimization-loops skill for specific details on wiring the prompt-evolve tool.
    2. Define your held-out evaluation dataset to ensure the target_value is calculated consistently across iterations.
    3. Initialize the loop using the provided loop_start configuration.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Stop wasting tokens on loops that never converge or tasks that shouldn't be loops at all. This agent skill acts as a high-level router for iterative tasks, ensuring you select the right architectural pattern before writing a single line of logic. It evaluates tasks against a strict "loop-shaped" gate and then maps them to a specialized category—Quality, Memory, Planning, Exploration, or System Optimization.

    What it does

    • Pre-loop validation ensures a task has a clear progress signal, requires multiple passes, and possesses a natural stopping point before proceeding.
    • Pattern routing maps ambiguous user requests like "optimize this" or "fix this" to one of twenty specific iterative patterns.
    • Config generation produces immediate loop_start parameters including exit_mode, target_value, and max_iterations tailored to the specific pattern.
    • Composite detection identifies when a task requires a sequence of different loop types rather than forcing a single, ill-fitting pattern.
    • Budget enforcement recommends appropriate iteration limits to prevent infinite loops and manage compute costs.

    How it works

    1. Validation: Run the Step 0 check to confirm the task is actually loop-shaped based on signal availability and necessity.
    2. Classification: Use the decision tree to match the task against five core categories: quality, memory, planning, exploration, or system optimization.
    3. Pattern Selection: Identify the specific sub-pattern (e.g., Adversarial Critique vs. Judge Ensemble) within the chosen category.
    4. Configuration: Generate the concrete loop_start JSON config with the correct exit modes and progress directions.

    Frameworks & tools

    This skill is designed for agents using iterative ledger patterns or loop-based architectures. It integrates with bantamkit for memory-related workflows and utilizes standard iteration controllers like critique-gate and prompt-evolve.

    Why this beats prompting it yourself

    Prompting an agent to "loop until finished" often leads to hallucinated stopping conditions or inefficient iteration. This skill provides a structured decision framework that enforces architectural best practices, ensuring you use the most efficient pattern for the specific problem domain.

    Use cases

    • Quality Control: Routing a content generation task to a Multi-Critic or Adversarial loop.
    • Bug Fixing: Mapping a failing test suite to a Plan-Execute-Replan planning loop.
    • Prompt Engineering: Configuring a System Optimization loop to tune templates against a metric.
    • Design Research: Setting up an Exploration loop to branch and compare multiple UI candidates.

    Known limitations

    This skill is a router and does not contain the full implementation logic for every pattern. Users must refer to the specific category skills for deep wiring rationale and failure-mode notes.

    Requires specific category skills for pattern implementation details. Does not execute loops directly. Convergence checks in dry mode ignore direction, requiring metric negation.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    1 use

    Times used to date

    Free forever

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 28 days ago

    • Free with an Agensi account

    Permissions

    No special permissions declared or detected

    Listed28 days ago

    What's inside

    Frequently Asked Questions

    The Loop Selector acts as a pre-processor for complex workflows, preventing token waste by validating if a task actually requires a loop and then selecting the most efficient architectural pattern (like Adversarial Critique or Plan-Execute-Replan) to handle it.

    You will receive the routing engine, the decision tree logic for all five core categories, and the configuration generator that produces ready-to-use JSON for loop parameters.

    This skill is framework-agnostic but is optimized for agents using iterative ledger patterns; it features native integration with `bantamkit` and standard controllers like `critique-gate`.

    No, this skill functions as a high-level architect that generates the configuration and routing logic; you will still need the specific category skills or custom logic to execute the internal steps of the loop.

    The skill includes a 'Budget Enforcement' feature that calculates and generates strict `max_iterations` and `exit_mode` parameters based on your specific task to prevent infinite loops and runaway compute costs.

    New in Agents & Orchestration