/loop — schedule a recurring prompt
Parse the input below into [interval] <prompt…> and schedule it with ${CRON_CREATE_TOOL_NAME}.
Parsing (in priority order)
- Leading token: if the first whitespace-delimited token matches
^\d+[smhd]$ (e.g. 5m, 2h), that's the interval; the rest is the prompt.
- 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), extract that as the interval and strip it from the prompt. Only match when what follows "every" is a time expression — check every PR has no interval.
- Default: otherwise, interval is
${DEFAULT_INTERVAL} and the entire input is the prompt.
If the resulting prompt is empty, show usage /loop [interval] <prompt> and stop — do not call ${CRON_CREATE_TOOL_NAME}.
Examples:
5m /babysit-prs → interval 5m, prompt /babysit-prs (rule 1)
check the deploy every 20m → interval 20m, prompt check the deploy (rule 2)
run tests every 5 minutes → interval 5m, prompt run tests (rule 2)
check the deploy → interval ${DEFAULT_INTERVAL}, prompt check the deploy (rule 3)
check every PR → interval ${DEFAULT_INTERVAL}, prompt check every PR (rule 3 — "every" not followed by time)
5m → empty prompt → show usage
${ADDITIONAL_PARSING_NOTES_FN()}
Interval → cron
Supported suffixes: s (seconds, rounded up to nearest minute, min 1), m (minutes), h (hours), d (days). Convert:
| Interval pattern |
Cron expression |
Notes |
Nm where N ≤ 59 |
*/N * * * * |
every N minutes |
Nm where N ≥ 60 |
0 */H * * * |
round to hours (H = N/60, must divide 24) |
Nh where N ≤ 23 |
0 */N * * * |
every N hours |
Nd |
0 0 */N * * |
every N days at midnight local |
Ns |
treat as ceil(N/60)m |
cron minimum granularity is 1 minute |
If the interval doesn't cleanly divide its unit (e.g. 7m → */7 * * * * gives uneven gaps at :56→:00; 90m → 1.5h which cron can't express), pick the nearest clean interval and tell the user what you rounded to before scheduling.
Action
- Call ${CRON_CREATE_TOOL_NAME} with:
cron: the expression from the table above
prompt: the parsed prompt from above, verbatim (slash commands are passed through unchanged)
recurring: true
- Briefly confirm: what's scheduled, the cron expression, the human-readable cadence, that recurring tasks auto-expire after ${CANCEL_TIMEFRAME_DAYS} days, and that they can cancel sooner with ${CRON_DELETE_TOOL_NAME} (include the job ID).${ADDITIONAL_INFO_FN()}
- Then immediately execute the parsed prompt now — don't wait for the first cron fire. If it's a slash command, invoke it via the Skill tool; otherwise act on it directly.
Input
${USER_INPUT}
1---2name: skill-loop-slash-command3description: Parses user input into an interval and prompt, converts the interval to a cron expression, and schedules a recurring task4license: BSD-3-Clause license5---67# /loop — schedule a recurring prompt89Parse the input below into `[interval] <prompt…>` and schedule it with ${CRON_CREATE_TOOL_NAME}.1011## Parsing (in priority order)12131. **Leading token**: if the first whitespace-delimited token matches `^\d+[smhd]$` (e.g. `5m`, `2h`), that's the interval; the rest is the prompt.142. **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`), extract that as the interval and strip it from the prompt. Only match when what follows "every" is a time expression — `check every PR` has no interval.153. **Default**: otherwise, interval is `${DEFAULT_INTERVAL}` and the entire input is the prompt.1617If the resulting prompt is empty, show usage `/loop [interval] <prompt>` and stop — do not call ${CRON_CREATE_TOOL_NAME}.1819Examples:20- `5m /babysit-prs` → interval `5m`, prompt `/babysit-prs` (rule 1)21- `check the deploy every 20m` → interval `20m`, prompt `check the deploy` (rule 2)22- `run tests every 5 minutes` → interval `5m`, prompt `run tests` (rule 2)23- `check the deploy` → interval `${DEFAULT_INTERVAL}`, prompt `check the deploy` (rule 3)24- `check every PR` → interval `${DEFAULT_INTERVAL}`, prompt `check every PR` (rule 3 — "every" not followed by time)25- `5m` → empty prompt → show usage26${ADDITIONAL_PARSING_NOTES_FN()}27## Interval → cron2829Supported suffixes: `s` (seconds, rounded up to nearest minute, min 1), `m` (minutes), `h` (hours), `d` (days). Convert:3031| Interval pattern | Cron expression | Notes |32|-----------------------|---------------------|------------------------------------------|33| `Nm` where N ≤ 59 | `*/N * * * *` | every N minutes |34| `Nm` where N ≥ 60 | `0 */H * * *` | round to hours (H = N/60, must divide 24)|35| `Nh` where N ≤ 23 | `0 */N * * *` | every N hours |36| `Nd` | `0 0 */N * *` | every N days at midnight local |37| `Ns` | treat as `ceil(N/60)m` | cron minimum granularity is 1 minute |3839**If the interval doesn't cleanly divide its unit** (e.g. `7m` → `*/7 * * * *` gives uneven gaps at :56→:00; `90m` → 1.5h which cron can't express), pick the nearest clean interval and tell the user what you rounded to before scheduling.4041## Action42431. Call ${CRON_CREATE_TOOL_NAME} with:44 - `cron`: the expression from the table above45 - `prompt`: the parsed prompt from above, verbatim (slash commands are passed through unchanged)46 - `recurring`: `true`472. Briefly confirm: what's scheduled, the cron expression, the human-readable cadence, that recurring tasks auto-expire after ${CANCEL_TIMEFRAME_DAYS} days, and that they can cancel sooner with ${CRON_DELETE_TOOL_NAME} (include the job ID).${ADDITIONAL_INFO_FN()}483. **Then immediately execute the parsed prompt now** — don't wait for the first cron fire. If it's a slash command, invoke it via the Skill tool; otherwise act on it directly.4950## Input5152${USER_INPUT}