define-loop
What it does
Lets the assistant build a repeating routine that works through a list of tasks, such as support tickets or bug alerts. Results wait for a person to check them. It is for teams with ongoing work.
When to use it
- βWhen you want the assistant to keep handling the same kind of work on a regular schedule.
- βWhen tasks need to be tracked so they are not worked on twice.
- βWhen you want to review the assistant's output before it is sent or shipped.
Skill link
https://github.com/yc-software/qm/blob/main/skills-seed/define-loop/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βSet up a routine that checks our support tickets every morning and drafts replies for me to review.β
5 new skills a week. 1 minute to read.
How it works
The assistant asks a few questions, runs one item as a test, and then saves a playbook. The loop runs on a schedule and keeps a record of finished items.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
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
FAQ
Why does the assistant run one test item first?
A test run lets you see the work before the routine starts on its own, so you are not surprised by scheduled results.
Is a regular scheduled task enough?
If each run is independent and nothing needs review, a simple schedule is enough. A loop is for work that must be tracked and checked.
Who approves the final output?
A person reviews the held outputs before any external action. The review step controls what gets shipped.
Details
Original description by the author
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
Popularity
- GitHub stars
- 16k
- Ranking position
- #10888
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
deploy-qm
16kDeploys the QM package to Fly.io, AWS, or Render, then sets up an administrator, connectors, and optionally Slack, following a full deployment checklist.
onboarding
16kWalks a new user through connecting accounts, sharing how they work, choosing a voice, and setting up first help, in one short conversation.
admin
16kLets a verified organization admin inspect or change org-wide settings and other scopes from chat, confirming each change before it is made.
browse
16kDrives a real stealth browser from your shell to act on websites, such as signing in or filling forms, with sign-ins kept per person. Meant for actions, not reading.
Similar skills
knowledge-automation
394kHelps your agent set up a recurring job that brings new content into your Knowledge vault on a schedule, then checks that the job runs.
knowledge-source-ingest
394kHelps your agent keep a Knowledge vault current with new items from chat channels, feeds, or mailboxes, without re-adding what it already has.
benchmark
280kHelps your agent measure code speed and performance. It's useful for ensuring things are fast and finding slowness issues.