agent-loop

Executes autonomous multi-step agent loops with assessment, tool calls, and progress tracking.

3|Updated Jun 29, 2026
One-click install
npx skills add https://github.com/ruskicoder/system-prompts --skill agent-loop-ruskicoder
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: agent-loop
Source: https://github.com/ruskicoder/system-prompts/tree/main/prompt-orchestrator/.opencode/skills/agent-loop
Command: npx skills add https://github.com/ruskicoder/system-prompts --skill agent-loop-ruskicoder

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Open-ended or complex tasks often stall because agents lose track of state, repeat failed actions, or stop prematurely. This Skill provides a structured continuous execution loop that keeps an AI agent working until the task goal is fully resolved. ## Core Features & Use Cases - Continuous Execution Loop: Iterates through assess, plan, execute, review, and update steps until the task is complete. - Hallucination Watchpoints: Detects tool-call loops, file edit oscillation, scope creep, and analysis paralysis, with defined recovery actions. - Token Budget Management: Tracks token usage with checkpoints and offers session summarization beyond 150K tokens. - Use Case: Ask the agent to implement a new feature across an unfamiliar codebase; it initializes a todo list, explores the code with GitNexus queries, makes incremental verified changes, and only stops after tests confirm completion. ## Quick Start Invoke /agent-loop with a task goal such as "refactor the authentication module and verify all tests pass" and let the loop run to completion.

Frequently Asked Questions about agent-loop

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

FAQPage Schema
How do I run an autonomous agent loop for a complex coding task?▼

Invoke the agent-loop workflow with a task goal as its argument. The agent initializes a todo list, then iterates through assess, plan, execute, and review steps, making one tool call per iteration until the task is fully resolved.

How does the agent loop prevent getting stuck in repeated tool calls?▼

It defines hallucination watchpoints such as repeated identical tool calls, editing the same file more than three times, and scope creep. When triggered, the agent stops all tool calls, summarizes what happened, and asks the user for guidance.

What is the token budget for an autonomous agent loop session?▼

Typical runs use 20K to 100K tokens, with 150K as the recommended maximum. The agent checks token usage after every five tool calls and offers session summarization to the user once usage exceeds 150K tokens.

When should I use the agent loop instead of a single-step workflow?▼

Use it for open-ended intentions, complex features, or new apps where scope is unknown and requirements may be vague or emergent. Single-step workflows fit better when the task is well-defined and needs no iterative exploration.

Does the agent loop verify its work before finishing?▼

Yes. Every three to five iterations it runs a sanity check for regressions and lingering issues, and at completion it verifies with tests and linters plus a change-detection pass before yielding control back to the user.