Loop Library
When to use
Use this skill for loop library when you need to design a repeatable agent loop. The expected result is a loop design with control points.
Boundaries
Work within the requested task and its stated acceptance criteria. Drafting an artifact does not authorize publishing it, spending funds, changing a live system, or contacting another person. Identify any such action separately before taking it.
Inputs
Inspect the trigger, inputs, permitted actions, verification signal, and stop condition. Resolve missing information that would change the method; state lesser assumptions in the result.
Method
- Diagnose. Describe the trigger, stored state, unit of work, review condition, retry count, and effect of a duplicate run.
- Decide. Bound retries and define what happens when progress stalls.
- Produce. Build a loop design with control points from the inspected material; keep assumptions distinguishable from observed facts.
Decision rules
- Make each iteration observable and idempotent where possible. Stop on repeated failure, exhausted budget, or an unresolved external dependency.
- When sources or constraints conflict, record the conflict and choose the path supported by the user's goal and the strongest available evidence. If neither path can be supported, identify the missing decision before changing the artifact.
Domain rules
- Specify the trigger, state carried between steps, retry budget, and terminal conditions.
- Ensure the loop cannot silently repeat a failed action or duplicate an external side effect.
Verification
Simulate a normal run and a failure run. Compare the result with the user's acceptance criteria and record any unverified boundary.
Provide a state diagram or step table and test one successful path, one partial failure, and one restart after interruption.
Approval and stop conditions
- Before recurring or external actions, identify the owner, tool permissions, spending limit, approval gate, and disable path.
- Stop when the agent cannot determine whether an action succeeded, reaches its retry or budget limit, or would exceed an agreed boundary.
- Pilot with human review before scheduling unattended execution. Report unresolved failures and who can disable the workflow.
Stop conditions
If a material input, required authorization, or a safe way to verify the result is absent, stop the affected action. Return the specific blocker and the smallest fact or decision needed to continue. Do not report an unrun check as passed.
Output
Provide a loop design with control points. Include the decisive evidence and actual verification result. Name any artifact location and unresolved issue that affects its use.