Loop

Automate bounded loop execution with regex, exit code, or custom stop criteria.

6|3|Updated Apr 22, 2026
One-click install
npx skills add https://github.com/lordmacu/nexo-rs --skill loop-lordmacu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Loop
Source: https://github.com/lordmacu/nexo-rs/tree/main/skills/loop
Command: npx skills add https://github.com/lordmacu/nexo-rs --skill loop-lordmacu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

The Loop Skill solves the challenge of repeatedly running a prompt with explicit stop criteria, facilitating bounded auto-iteration for "try-fix-verify" loops.

Core Features & Use Cases

  • Explicit Stop Criteria: Offers options for stopping iterations based on regex matches, exit codes, or custom criteria.
  • Input Parsing: Automatically interprets user input to determine iteration limits and stop conditions.
  • Use Case: Ideal for running tests repeatedly until a specific condition is met, like "retry until exit code 0" or "iterate 5 times until a regex match is found."

Quick Start

Execute a loop to test your script, with 3 attempts and a regex match as the stop condition: 'loop prompt="cargo test -p core" max_iters=3 until_predicate="regex:tests passed"'

Frequently Asked Questions about Loop

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate repetitive tasks with explicit stop conditions?

You can automate repetitive tasks by configuring a bounded loop that repeatedly executes a prompt until a specific stop condition is met. This handles iterative processes like try-fix-verify workflows with minimal configuration.

How does loop iteration control handle exit codes and regex matches?

Loop iteration control handles exit codes and regex matches by parsing user input to define explicit stop criteria. It automatically stops execution when a specified exit code is returned or a regex pattern is successfully matched.

What is the best way to run a script repeatedly until tests pass?

The best way to run a script repeatedly until tests pass is using a bounded auto-iteration loop. You can execute a command with a defined maximum iteration limit and a regex predicate to stop once a success message is matched.

Can I set a maximum number of iterations for an automated loop?

Yes, you can set a maximum number of iterations for an automated loop. By defining the max_iters parameter, you ensure the loop stops after a specified number of attempts even if the custom stop criteria are never met.

When do I need bounded auto-iteration for my scripts?

You need bounded auto-iteration for scripts requiring repetitive try-fix-verify cycles. It is ideal when you must run tests or commands multiple times until achieving a specific exit code or output match.