loop
Fungsinya
Skill ini menyiapkan tugas berulang yang menjalankan sebuah perintah pada interval tetap. Skill ini ditujukan untuk orang yang ingin agent mereka terus memeriksa sesuatu atau mengulang sebuah rutinitas.
Kapan dipakai
- โSaat Anda ingin tugas diulang setiap beberapa menit, jam, atau hari.
- โSaat Anda ingin agent terus mengawasi status atau sebuah proses.
- โSaat Anda ingin sebuah rutinitas berjalan berulang kali tanpa Anda memulainya.
Link skill
https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/cli/src/skill/builtin/.bundle/loop/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
โSaya ingin status deploy saya diperiksa setiap 15 menit, dan saya ingin diberi tahu jika gagal.โ
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent membaca interval dan perintah, memilih jadwal, mendaftarkannya, lalu langsung menjalankan perintah sekali agar Anda bisa melihat cara kerjanya.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
/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.
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.Trailing
every <N><unit>clause. Otherwise, look for a clause at the end of the input of the formevery <N><unit>orevery <N> <unit-word>where<unit>iss|m|h|dand<unit-word>issecond(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.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
| Pattern | Cron expression |
|---|---|
Ns |
treat as ceil(N/60)m; minimum is 1m |
Nm where N is 1โ59 and divides cleanly (1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30) |
*/N * * * * |
Nm where N โฅ 60 and N/60 divides 24 (1, 2, 3, 4, 6, 8, 12) |
0 */(N/60) * * * |
Nh where N is 1โ23 and divides 24 |
0 */N * * * |
Nd where N divides 31 sensibly (1, 2) |
0 0 */N * * |
Cron fields are UTC. These interval patterns are timezone-agnostic; the Nd
row fires at midnight UTC, not local midnight.
Rounding rule. If N does not divide its wrap-around cleanly (e.g. 7m, 90m, 5h, 7d), pick the nearest interval that does and tell the user explicitly what you rounded to and why. Acceptable nearby values:
- minutes < 60: 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30
- hours: 1, 2, 3, 4, 6, 8, 12
- days: 1, 2
Examples of rounding messages:
7mโ "rounding 7m to 6m so the fires stay evenly spaced;*/7skews at the hour wrap"90mโ "rounding 90m to 2h; cron's hour field can't express 1.5h"
4. Call the cron tool
With the parsed cron expression and prompt, invoke the cron tool's schedule verb. Use whichever call form the tool's own prompt describes โ pass cron and prompt as required, leave durable: false (the default; only set true when the user explicitly asked the job to persist across sessions), leave it recurring (the default; one-shot is wrong for /loop โ one-shots come from natural-language scheduling).
The cron tool returns a job id. Mention it briefly so the user can cancel with /loops cancel <id>.
5. Execute the prompt once immediately
After the cron call succeeds, do not wait for the first scheduled tick. Run the prompt body once right now:
- If the prompt starts with
/(e.g./loop 5m /standupโ prompt is/standup), invoke it as a slash command โ load the corresponding skill or command via theskilltool. - Otherwise, act on the prompt directly in this turn.
This is the "don't make the user wait" rule. The cron job carries the recurring behavior; the immediate run is for responsiveness.
6. Examples
| User input | Interval | Cron | Prompt |
|---|---|---|---|
/loop 5m /babysit-prs |
5m (leading) |
*/5 * * * * |
/babysit-prs |
/loop check the deploy every 20m |
20m (trailing) |
*/20 * * * * |
check the deploy |
/loop /standup every 2 hours |
2h |
0 */2 * * * |
/standup |
/loop tidy inbox |
10m (default) |
*/10 * * * * |
tidy inbox |
/loop 30s ping |
30s โ 1m |
*/1 * * * * |
ping |
/loop 7m ping |
7m โ 6m (rounded, explain) |
*/6 * * * * |
ping |
/loop |
(usage hint) | โ | โ |
/loop 5m |
autonomous-only | (if enabled) | <<autonomous-loop>> |
7. Do not
- Do not invent intervals the user didn't ask for. If unsure, default to
10mand sa
Pertanyaan umum
Format interval apa yang berfungsi?
Anda bisa mulai dengan interval seperti 5m atau 2h, atau diakhiri dengan every 20 minutes. Jika dikosongkan, default-nya adalah 10 menit.
Apakah langsung berjalan sekali sekarang?
Ya. Skill ini menjalankan perintah sekali segera, lalu sesuai jadwal.
Apa yang terjadi jika permintaannya kosong?
Skill ini menampilkan petunjuk penggunaan singkat dan tidak menjadwalkan apa pun.
Detail
Deskripsi asli dari pembuat
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.
repo: XiaomiMiMo/MiMo-Code
Popularitas
- Bintang GitHub
- 14k
- Peringkat
- #11330
- Lisensi
- MIT
- Diperbarui
- 2/11/2026
Komentar
- โฆ
Skill lain dari repositori ini
effect
14kMembantu agent Anda menjawab pertanyaan tentang kerangka kerja TypeScript Effect dengan memeriksa kode sumber dan dokumentasinya, bukan mengandalkan ingatan.
arxiv
14kMembantu agent Anda mencari, membaca, mengutip, dan melacak makalah akademik di arXiv, mencakup abstrak, sitasi BibTeX, unduhan PDF, dan tautan sitasi.
claude-code
14kMembantu agent Anda menyerahkan tugas pemrograman ke alat baris perintah Claude Code, sebagai satu kali jalan, sesi interaktif, atau pekerjaan latar belakang.
codex
14kMembantu agent Anda menjalankan alat baris perintah OpenAI Codex tanpa jendela obrolan, untuk tugas pemrograman, skrip, dan alur kerja otomatis.
Skill serupa
knowledge-automation
394kMembantu agent Anda mengatur tugas terjadwal yang memasukkan konten baru ke Knowledge vault Anda secara rutin, lalu memastikan tugas itu berjalan.
knowledge-source-ingest
394kMembantu agent Anda menjaga Knowledge vault tetap mutakhir dengan item baru dari chat, feed, atau kotak surat, tanpa menambahkan ulang yang sudah ada.
benchmark
280kMembantu agent Anda mengukur kecepatan dan performa kode. Berguna untuk memastikan semuanya cepat dan menemukan penyebab kelambatan.