🧪Lesson 06AI Engineer Loopcraft Workshop 2026
Let the loop create work — and stop itself
Let the checker propose one maintenance event, then prove it stops when the repo or queue is not safe to touch.
This is the first command that can create work — which makes it the first that can quietly bury you in bad work. So its job is deliberately tiny: scan a short list of maintenance signals and propose at most one issue event, with hard stops everywhere it might do damage. It is not a little product agent. If the repo is dirty, the loop is already running, or a matching follow-up exists, it prints why and quits. Stopping is part of the feature, not a failure of it.
Your next move
You already have
- A local queue, stop reasons, claim receipts, and proof that dry-runs can avoid product edits.
- A need for boring maintenance without turning cleanup into an unbounded agent.
Add now
- Pass 1: dry-run one allowed maintenance event and print the exact event it would write.
- Pass 2: apply one event only after every stop check passes.
- A second run that refuses the duplicate follow-up and records the stop message.
Stop before
- Scanning broadly or proposing more than one maintenance event.
- Applying when git status is dirty, the checker is running, the follow-up already exists, or any event needs approval/input.
- Editing product files as part of cleanup.
Tiny two-pass cleanup shape
pass: dry-run
candidate: stale receipt link
wouldWrite: MAINT-001 update receipt link
writtenEvents: []
pass: apply
stopChecks: clean repo, checker idle, no duplicate, no approval/input blockers
writtenEvents: [MAINT-001]
duplicateCheck: refused — matching follow-up already existsStarter prompt
Starter prompt
Add a cleanup command that can propose at most one maintenance issue event. Keep it as two passes: first dry-run one allowed maintenance event and print the exact event it would write; then allow apply to write one event only after every stop check passes. Refuse to apply when git status is dirty, the checker process is running, the queue already has a matching follow-up, an event needs approval, or an event needs more input. Save a receipt with inspected files, proposed event id, written event id if any, duplicate check result, and the exact printed stop message.Build checklist
0/4 done
Define allowed maintenance
Pass 1: dry-run one event
Pass 2: guarded apply
Prove duplicate protection
Proof to save
Save proof that the cleanup command can propose one event, write at most one event, and refuse unsafe runs.
- A dry-run cleanup command prints the issue event it would write without changing files.
- Apply mode can write one fully formed maintenance event when every stop check passes.
- Dirty repo, duplicate follow-up, running checker process, approval-required work, and input-required work stop the command visibly.
- A receipt records what it saw, what it proposed, and why it stopped.
- mode: dry-run or apply
- inputsSeen: files/events inspected
- proposedEvents: event ids or summaries
- writtenEvents: event ids, if any
- stopMessages: exact messages printed when the command refused to run
- duplicateCheck: result of second run
- nextAction: approve, fix input, or leave it alone
Done when
Dry-run prints one proposed event, apply writes at most one event, and a second run refuses the duplicate with a saved receipt.
Why it matters
- Risk reduced: cleanup cannot touch the repo freely or create duplicate work.
- Temptation avoided: turning cleanup into a catch-all agent.
- Do not automate yet: broad file edits, unbounded scanning, or automatic product changes.
Try this 🔨
Read one printed stop message and say what you would do next: approve, fix the input, or leave it alone.
Exploration prompts
Use these when you want to ask an agent for a narrower pass instead of handing it the whole lesson.
Find boring maintenance
Scan the repo for maintenance facts the cleanup command may notice: stale receipt, missing link, outdated status, duplicate follow-up, or incomplete event. Return candidates only; do not edit.Define boundaries
Write the allowed maintenance types and exact stop messages for the cleanup command. Include dirty repo, running checker process, duplicate follow-up, approval-required work, and missing input.Dry-run one event
Take one maintenance candidate and show the exact event the cleanup command would write in dry-run mode. Explain why apply should or should not be allowed.