Skills

Loop

Create a loop that runs a prompt now and follows up either on a fixed schedule or...

Install

npx skills add QwenLM/qwen-code --skill loop -g -a claude-code -y
Repository
QwenLM/qwen-code28.9k
Category
AI and agents
Updated
3d ago
License
Apache-2.0
Context cost
Mediumabout 2,428 tokens
Runs scripts
Yes, review before use

What it does

Create a loop that runs a prompt now and follows up either on a fixed schedule or through self-paced wakeups. Usage - /loop check the build, /loop 5m check the build, /loop check the PR every 30m. /loop list to show jobs, /loop clear to cancel all.

/loop, run a prompt repeatedly

Subcommands

If the input (after stripping the /loop prefix) is exactly one of these keywords, run the subcommand instead of scheduling:

  • list, call CronList and display the results. Done.
  • clear, call CronList, then call CronDelete for every job returned. Confirm how many were cancelled. Done.

Parsing

Parse the input after removing the /loop prefix:

  1. Empty input (no prompt, no interval): the autonomous path, run a self-paced autonomous loop. See the Autonomous mode section.
  2. Leading interval token: if the first whitespace-delimited token matches ^\d+[smhd]$ (e.g. 5m, 2h), this is the fixed-interval recurring path. The rest is the prompt.
  3. Trailing "every" clause: otherwise, if the input ends with every <N><unit> or every <N> <unit-word> (e.g. every 20m, every 5 minutes, every 2 hours), this is the fixed-interval recurring path. Extract that interval and strip it from the prompt. Only match when what follows "every" is a time expression, check every PR has no interval.
  4. Prompt-only input: otherwise, the entire input is the prompt and this is the prompt-only self-paced path.

If an interval was given but the prompt is empty (e.g. /loop 5m), this is a fixed-interval autonomous loop, see the Autonomous mode section.

Examples:

Read the whole SKILL.md on GitHub

More in AI and agents