agents/skills/loop/SKILL.md
Run a prompt on a recurring interval using a blocking sleep loop. Use for polling CI, babysitting deploys, monitoring logs, periodic checks, or scheduled task execution.
npx skillsauth add drn/dots loopInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Run a prompt repeatedly at a fixed interval. The main thread stays alive by sleeping between executions, spawning a background agent each cycle to do the work.
$ARGUMENTS - interval and prompt, or a management command (list, cancel)Syntax:
/loop <interval> <prompt or /skill>
/loop list
/loop cancel <id>
/loop cancel all
Examples:
/loop 5m check if CI is green on this PR
/loop 20m /review-pr 1234
/loop 2h check for new Sentry errors in the payments service
/loop 30s tail the deploy logs and report status
/loop list
/loop cancel 2
git branch --show-current 2>/dev/null | head -1git status --short 2>/dev/null | head -10pwdParse $ARGUMENTS to determine the action:
Management commands:
list - Show all active loops with their ID, interval, prompt, and execution count. If no loops are active, say so.cancel <id> - Mark the specified loop as cancelled. On the next sleep cycle, the loop will detect the cancellation and stop.cancel all - Mark all loops as cancelled.New loop:
Interval parsing:
Ns or Nsec - N seconds (minimum 30 seconds, round up if less)Nm or Nmin - N minutesNh or Nhr - N hoursNd - N daysIf the prompt is empty after parsing, ask the user what they want to run.
Present the loop configuration:
## Loop configured
**Interval:** {human-readable interval}
**Prompt:** {the prompt to execute}
**Loop ID:** {sequential integer, starting at 1}
Starting now. First execution is immediate. Use /loop list to check status or /loop cancel {id} to stop.
Initialize tracking state:
loop_id = {next sequential ID}
interval_seconds = {parsed interval in seconds}
prompt = {the prompt to execute}
execution_count = 0
max_executions = 500
cancelled = false
Spawn a background agent to execute the prompt:
Agent(
prompt: "{prompt}\n\nThis is execution #{execution_count + 1} of a recurring loop (ID {loop_id}). Report your findings concisely.",
run_in_background: true,
description: "Loop {loop_id} run {execution_count + 1}"
)
Increment execution_count.
If the prompt starts with /, invoke it as a skill via the Skill tool inside the agent prompt instructions.
This is the critical section that keeps the thread alive.
Loop:
Block the thread:
Bash("sleep {interval_seconds}")
This keeps the lead thread alive in Conductor.
Check cancellation: If the loop has been marked cancelled (via a /loop cancel command in another message, or by tracking state), output:
Loop {loop_id} cancelled after {execution_count} executions.
Stop looping and exit.
Check limits:
execution_count >= max_executions, stop and report.Spawn the next execution as a background agent (same as Step 3).
Output a heartbeat every 3rd execution:
Loop {loop_id}: execution #{execution_count} complete ({elapsed time} elapsed). Next in {interval}.
Increment and repeat.
When the loop ends (cancelled, max reached, or terminal condition), output:
## Loop {loop_id} finished
**Executions:** {count}
**Duration:** {total elapsed time}
**Reason:** {cancelled | max executions reached | terminal condition}
**Last result:** {brief summary of last execution output}
| Failure | Action | |---------|--------| | Background agent fails to spawn | Retry once. If still fails, report error and continue to next iteration. | | Prompt execution errors | Log the error in heartbeat output. Continue looping -- transient errors are expected for monitoring tasks. | | Sleep interrupted | Re-enter the sleep for remaining time. | | User sends a new message | The loop may pause. Resume on next turn. Note: in Conductor, user messages may interrupt the sleep loop. The loop resumes when control returns. |
This skill uses the same blocking-sleep pattern as /swarm to keep the main thread alive in Conductor. Unlike the built-in /loop (which uses CronCreate/CronDelete), this version:
development
Walk every unresolved review thread on a PR, triage each one, reply with a rationale of whether or not the comment will be acted upon, make the code change if warranted, and mark the thread resolved. Use when the user asks to address only the open PR comments without re-running CI, respond to review feedback, resolve review threads, or clear bot comments on a PR.
tools
Iteratively run /rereview, fix the findings, and loop until reviewers approve clean. Use for iterative automated review, when you want /rereview to loop until clean, or for a paranoid pre-merge review that auto-addresses every blocker.
development
Generate self-contained HTML visualizations with Plannotator theming. Use for implementation plans, PR explainers, architecture diagrams, data tables, slide decks, and any visual explanation of technical concepts. Plans and PR explainers follow Plannotator's prescriptive approach; all other visual content delegates to nicobailon/visual-explainer.
development
Create reviewed Codex goal setup packages for long-running /goal work. Use when the user wants to turn an idea, backlog, project mission, or vague objective into durable goal files under a project goals slug folder, with Plannotator review gates for brief, narrative plan with acceptance criteria, verification, blockers, and the final /goal prompt.