Loop

From x-cmd/x-cmd · View interactive version

Loop is an AI agent skill from the GitHub repository x-cmd/x-cmd. Schedule recurring tasks with notifications. Triggered by "/loop <interval> <prompt>" to set up periodic monitoring.

How to use this skill

Skill file

Loop Runner

Trigger

Use when:

Steps

Step 1: Parse Arguments

/loop <interval> <prompt>

Interval patterns:

| Pattern | Cron Expression |

|---------|----------------|

| Nm (N ≤ 59) | */N * * * * |

| Nh (N ≤ 23) | 0 */N * * * |

| Nd | 0 0 */N * * |

Round non-dividing intervals to nearest clean value.

Step 2: Clarify Intent

Ask user:

  1. What to monitor (parse prompt)
  2. How to execute (which x-cmd module or command)
  3. Where to store results

Step 3: Configure Notification

Ask before creating:

Step 4: Create Cron Job

x cron add \
    --name "loop-$(date +%Y%m%d%H%M%S)" \
    --desc "<description>" \
    "<cron-expression>" \
    "<full-command>"

Step 5: Execute Immediately

Run the command now; do not wait for first cron fire.

Step 6: Confirm

Report to user:

Constraints

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.