loop
Skill này làm gì
Skill này thiết lập một prompt lặp lại, chẳng hạn kiểm tra build hoặc pull request, theo khoảng thời gian định sẵn hoặc lịch tự điều chỉnh nhịp. Dành cho người muốn theo dõi hoặc lặp lại một việc mà không phải khởi động lại bằng tay mỗi lần.
Khi nào nên dùng
- ✓Khi bạn muốn một tác vụ như kiểm tra build được lặp lại mỗi vài phút.
- ✓Khi bạn muốn một pull request hoặc lần deploy được kiểm tra lại theo lịch cố định.
- ✓Khi bạn muốn liệt kê hoặc hủy các vòng lặp lặp lại đang chạy.
Liên kết skill
https://github.com/QwenLM/qwen-code/blob/main/packages/core/src/skills/bundled/loop/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Kiểm tra build mỗi 10 phút và báo cho tôi ngay khi nó thất bại.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent phân tích khoảng thời gian và prompt, chạy một lần ngay lập tức và lên lịch các lần tiếp theo. Các lệnh con liệt kê và xóa cho phép xem hoặc hủy các job đang hoạt động.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
/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:
- Empty input (no prompt, no interval): the autonomous path — run a self-paced autonomous loop. See the Autonomous mode section.
- 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. - Trailing "every" clause: otherwise, if the input ends with
every <N><unit>orevery <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 PRhas no interval. - 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:
5m /babysit-prs→ fixed interval5m, prompt/babysit-prs(leading interval token)check the deploy every 20m→ fixed interval20m, promptcheck the deploy(trailing "every" clause)run tests every 5 minutes→ fixed interval5m, promptrun tests(trailing "every" clause)check every PR→ prompt-only self-paced path, promptcheck every PR("every" is not followed by a time expression)check the deploy→ prompt-only self-paced path, promptcheck the deploy- (empty) → self-paced autonomous loop (sentinel
<<autonomous-loop-dynamic>>) 5m→ fixed-interval autonomous loop (interval5m, sentinel<<autonomous-loop>>)
Prompt-only self-paced path
Use this path only when the user supplied a prompt and no interval.
- Do not call CronCreate for this path.
- If this tick opens with a
<task-notification>block (a monitor or background event re-invoked you, not a bare/loopwakeup prompt), handle that event before re-running the prompt.- If the notification says the watched condition was met, cancel any pending fallback LoopWakeup with CronDelete if you still have its ID, then finish the loop.
- If a monitor auto-stopped on idle or max-events, restart it once if the watch is still useful, re-arm the fallback, report the restart count to the user, and include that count in the LoopWakeup prompt or reason (for example,
monitor restarted 1/1 time) so it survives context compaction. If it auto-stops again on the next tick, end the loop and report the repeated auto-stop to the user. - If the signal is ambiguous, re-arm a shorter follow-up and investigate on the next tick. If the signal remains ambiguous for three consecutive ticks, end the loop and report that the watch could not reach a clear conclusion.
- Run the parsed prompt immediately now.
- If it is a slash command, invoke it via the Skill tool.
- Otherwise, act on it directly.
- Before ending the turn, decide whether another check is useful.
- Call LoopWakeup only if continued follow-up is useful.
- Do not call LoopWakeup if the task is complete.
- Do not call LoopWakeup if the task is blocked on user input or external state that cannot be checked later.
- Do not call LoopWakeup just to keep polling when no useful next check exists.
- If you started a background agent or a Monitor, it wakes you via a terminal
<task-notification>on exit, failure, cancellation, or monitor auto-stop — so set LoopWakeup as a long fallback rather than a short poll. Do not omit it just because something is watching: the work may hang, or a Monitor may auto-stop on idle or max-events (and one owned by another agent routes its notification only to that agent). Omit LoopWakeup only on the terminal conditions above (complete, blocked, or repeated monitor auto-stop).
- When scheduling a continuation, call LoopWakeup with:
delaySeconds: the next useful delay in seconds. The runtime clamps to 60–3600 (1–60 min); follow the tool's own guidance on picking a value — it accounts for the prompt-cache window and for the fallback-heartbeat case when a background task will wake
Câu hỏi thường gặp
Làm sao tôi xem các vòng lặp đang chạy?
Dùng lệnh con list, lệnh này hiển thị các job đã lên lịch.
Làm sao dừng tất cả?
Dùng lệnh con clear, lệnh này hủy mọi job đã lên lịch.
Nếu tôi bỏ qua khoảng thời gian thì sao?
Agent chạy một vòng lặp tự điều chỉnh nhịp và tự chọn thời điểm.
Chi tiết
Mô tả gốc của tác giả
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.
repo: QwenLM/qwen-code
Độ phổ biến
- Sao GitHub
- 29k
- Vị trí xếp hạng
- #9782
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
codegraph
29kGiúp agent của bạn phân tích một codebase đã lập chỉ mục qua đồ thị gọi, phụ thuộc, mã chết, điểm nóng và tìm kiếm theo ngữ nghĩa.
qwen-code-claw
29kGiúp agent của bạn giao các tác vụ lập trình cho Qwen Code, như tìm hiểu codebase, sửa lỗi, tái cấu trúc mã hoặc tạo một dự án mới.
structured-debugging
29kDạy agent của bạn cách gỡ lỗi khó theo từng bước: đặt giả thuyết, thêm kiểm tra có mục tiêu, kiểm thử và tìm nguyên nhân thật trước khi sửa.
tmux-real-user-testing
29kGiúp agent của bạn kiểm thử một ứng dụng terminal như người dùng thật trong tmux, lưu nhật ký từng bước dễ đọc kèm ảnh chụp màn hình của mỗi hành động.
Skill tương tự
knowledge-automation
394kGiúp agent của bạn thiết lập tác vụ định kỳ đưa nội dung mới vào kho Knowledge theo lịch, rồi kiểm tra tác vụ có chạy không.
knowledge-source-ingest
394kGiúp agent của bạn cập nhật Knowledge vault với các mục mới từ kênh chat, nguồn tin hoặc hộp thư, mà không thêm lại những gì đã có.
benchmark
280kGiúp agent của bạn đo tốc độ và hiệu suất của code, hữu ích để đảm bảo mọi thứ nhanh và tìm ra những chỗ chậm.