define-loop
Skill này làm gì
Cho phép trợ lý xây một quy trình lặp lại, xử lý lần lượt một danh sách công việc như ticket hỗ trợ hoặc cảnh báo lỗi. Kết quả chờ người kiểm tra. Dành cho nhóm có công việc đang tiếp diễn.
Khi nào nên dùng
- ✓Khi bạn muốn trợ lý tiếp tục xử lý cùng một loại công việc theo lịch đều đặn.
- ✓Khi các tác vụ cần được theo dõi để không bị làm hai lần.
- ✓Khi bạn muốn xem lại đầu ra của trợ lý trước khi nó được gửi hoặc triển khai.
Liên kết skill
https://github.com/yc-software/qm/blob/main/skills-seed/define-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
“Thiết lập một quy trình kiểm tra ticket hỗ trợ của chúng tôi mỗi sáng và soạn sẵn câu trả lời để tôi xem lại.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Trợ lý hỏi vài câu, chạy thử một mục như bài kiểm tra, rồi lưu một playbook. Vòng lặp chạy theo lịch và giữ bản ghi các mục đã hoàn thành.
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.
define-loop — author a Loop
A Loop is a cron with a memory and a gate: a trigger, a playbook, a ledger of work items that survives across fires, ship-ready outputs held for a person, and a governor watching its health. Reach for one when the ask is "keep doing this kind of work", not "do this".
Intake, work, and judge turns use the loop's existing owner/scope authorization, credentials, command policy, and security posture. They run without surface tools or addressed delivery. Intake reads candidates; work prepares outputs; the judge inspects the work and executes the declared checks. Final external actions belong in the approved ship stage. The review gate controls loop output shipping; it is not a read-only sandbox for arbitrary shell commands or API calls in earlier stages.
A cron is enough when each fire is independent and nothing needs reviewing. Prefer the cron; a loop earns its complexity only when work items persist, must not be worked twice, and produce artifacts someone should see before they go out.
The one rule: never arm a loop you have not watched work. Stage 2 is not optional.
Stage 1 — Interview
Get these, in the user's own words. Ask about them one or two at a time, not as a form.
| What | Why it matters |
|---|---|
| Source of work | How to enumerate candidates each fire, and the stable id per item (Sentry issue id, Front conversation id). That id is the dedupe key — get it right or work repeats. |
| Trigger | A cadence (calendar cron in their timezone) or an event. Ask when output is actually useful, not just how often. |
| Success condition | What "done" means for ONE item. |
| Ship actions | Which externally-visible actions the loop may take (open_pr, send_email, front_reply). Anything not declared is a quarantine when it happens. |
| Caps | Optional. Propose defaults; record a decline without argument. |
| Escalation | Who the governor pings, and where. |
Writing the success condition
Free text, and it's the most load-bearing sentence in the loop. A good one has:
- one measurable end state — a test result, a linked PR, an empty queue
- a stated check — how the agent proves it ("
npm testexits 0", "the PR shows CI green") - the constraints that matter — what must not change on the way ("touches only the implicated module")
- a bound — "or park with a diagnosis after 5 turns", so a hopeless item stops burning money
The Sentry issue has a linked PR whose tests pass and CI is green, the fix touches only the implicated module, or park with a diagnosis after 5 turns.
Add successChecks for anything a command can settle (npm test, npm run lint). The
judge runs each check and reports its command and result. A missing or failed reported
check prevents completion even when the judge claims success. Check results are
model-reported, not an independent deterministic execution attestation.
Stage 2 — Shadow run (never skip)
Work one real item end to end, in this conversation, with the user watching. No loop record exists yet.
- Pull one real candidate from the source.
- Do the whole job to the ship line — write the actual PR or the actual reply — and stop.
- Show the user the finished artifact. Ask directly: would you have sent this?
- Fix what they flag. Repeat on a second item if the first needed real correction.
Then write the playbook from what you just did — the steps that actually worked, the dead ends worth skipping, the exact success condition you'd have wanted. A playbook written before the shadow run is a guess; one written after is a procedure.
Stage 3 — Emit
Create the loop with t
Câu hỏi thường gặp
Vì sao trợ lý chạy thử một mục trước?
Lần chạy thử cho bạn thấy công việc trước khi quy trình tự chạy, để bạn không bất ngờ với kết quả theo lịch.
Một tác vụ theo lịch thông thường có đủ không?
Nếu mỗi lần chạy độc lập và không cần xem lại, lịch đơn giản là đủ. Vòng lặp dành cho công việc cần được theo dõi và kiểm tra.
Ai phê duyệt đầu ra cuối cùng?
Một người xem lại các đầu ra được giữ trước mọi hành động bên ngoài. Bước xem lại kiểm soát những gì được phát hành.
Chi tiết
Mô tả gốc của tác giả
Define a Loop — a durable scaffold that works a queue of recurring tasks autonomously (Sentry issues, Front tickets, small perf PRs) with its outputs held for human review. Use when someone wants an agent to keep doing a kind of work on a schedule, rather than one-off. Walks the interview, runs one real item live before arming anything, then writes the playbook and creates the loop.
repo: yc-software/qm
Độ phổ biến
- Sao GitHub
- 16k
- Vị trí xếp hạng
- #10888
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
deploy-qm
16kTriển khai gói QM lên Fly.io, AWS hoặc Render, rồi thiết lập quản trị viên, connector và tùy chọn Slack, theo một danh sách kiểm tra triển khai đầy đủ.
onboarding
16kHướng dẫn người dùng mới kết nối tài khoản, chia sẻ cách họ làm việc, chọn giọng nói và thiết lập trợ giúp đầu tiên, trong một cuộc trò chuyện ngắn.
admin
16kCho phép quản trị viên tổ chức đã xác minh xem hoặc thay đổi cài đặt toàn tổ chức và các phạm vi khác từ chat, xác nhận từng thay đổi trước khi thực hiện.
browse
16kĐiều khiển trình duyệt tàng hình từ dòng lệnh để thao tác trên web như đăng nhập hoặc điền form, giữ đăng nhập riêng cho từng người.
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.