Skills

Loop

Schedule a prompt to fire on a fixed cadence (recurring loop).

Install

npx skills add XiaomiMiMo/MiMo-Code --skill loop -g -a claude-code -y
Repository
XiaomiMiMo/MiMo-Code13.7k
Category
AI and agents
Updated
3d ago
License
MIT
Context cost
Lightabout 1,201 tokens
Runs scripts
No, instructions only

What it does

Schedule a prompt to fire on a fixed cadence (recurring loop). Use when the user asks to "run X every N minutes/hours/days", "loop X", "babysit Y", "be proactive about Y every N", or invokes `/loop` directly. Parses `[interval] <prompt>`, picks a clean cron expression, registers the job via the `cron` tool, and executes the prompt once immediately so the user sees activity without waiting for the first cron tick.

/loop, schedule a recurring prompt

This skill turns a free-form [interval] <prompt> line into a cron tool call and runs the prompt once right away.

1. Parse the input

The user's text is whatever appears after /loop . Apply the three rules below in order and stop at the first match.

  1. Leading interval token. If the first whitespace-separated token matches the regex ^\d+[smhd]$ (case-insensitive), that token is the interval. Examples: 5m, 2h, 1d, 30s. The rest of the input is the prompt.

  2. Trailing every <N><unit> clause. Otherwise, look for a clause at the end of the input of the form every <N><unit> or every <N> <unit-word> where <unit> is s|m|h|d and <unit-word> is second(s)|minute(s)|hour(s)|day(s). Strip the clause; what's left is the prompt; the captured <N><unit> is the interval. Examples: every 20m, every 5 minutes, every 2 hours.

  3. Default. No interval found → interval is 10m, the whole input is the prompt.

If the input is empty, or is only an interval with no prompt body, reply with a one-line usage hint (/loop [interval] <prompt>) and stop. Do not schedule anything.

2. Special: empty prompt with autonomous opt-in

When the user types /loop <interval> (interval only) and the project has explicitly opted into autonomous-loop mode (a session-level flag the runtime sets), the prompt body is the sentinel <<autonomous-loop>>. The scheduler expands this sentinel at fire time into a self-directed tick instruction. If autonomous mode is not enabled, treat empty as the usage-hint case above.

3. Map interval → 5-field cron expression

Read the whole SKILL.md on GitHub

More in AI and agents