loop-goal
Turns a loose request into a runnable artifact. This skill writes it; it never executes it.
The artifact is a pair
/goal is a real command in Claude Code and Codex: it re-checks a condition after every turn and
starts another turn until the condition holds. The condition is capped at 4.000 characters.
So emit two pieces:
- The document —
.claude/goals/<slug>.md: the full contract (autonomy, product defaults, gates, review, progress, stop rules). No size limit. - The
/goalline — target ≤600 characters: the measurable criterion written out, a pointer to the document, the turn cap.
Cursor has no engine: same document, plus a short opening message telling the agent to read and execute it.
Hard rules
Criterion on the line, procedure in the document. Never /goal do what <doc> says — the
evaluator cannot open files.
The evaluator only reads the conversation. It runs no command and opens no file; it judges what the agent printed. So the document must demand:
- a SCORE line closing every turn, always the same format, always cumulative:
SCORE: 7/12 merged | typecheck exit 0 | 3 ❌ left | turn 4/20; - numbers from a command run that turn. "All good, done" satisfies a weak evaluator and closes a goal on a lie;
- quality numbers from a fresh judge subagent, never from the agent that did the work.
Context compaction erases old evidence, which is why the score is reprinted in full every turn.
Measurable or no emit. Count · deterministic check (exit 0) · artifact complete (0 ❌) · external state · rubric with per-dimension threshold. "Until it looks good" is refused: ask what good is measured as.
Autonomy block, four items: continue-until; 2+ concrete product defaults; stop criterion plus what may interrupt the user; and "do not offer next steps, do not ask to proceed". With a goal engine, an open decision no longer pauses the run, it burns turns in a loop.
Turn cap lives in the condition. Claude Code has no engine-side cap, and resuming a session resets the count.
Gates must already be permitted. A goal stalls on the first permission prompt. If the gate command is not on the allowlist, say so above the artifact.
Code work gets reviewed per step by a fresh subagent at the platform's top tier, before any
commit or merge. A green check proves nothing broke, never that what was asked got built. Ask the
execution platform before naming any model; tiers are in ~/.claude/execution-platform-models.md.
Read next
| Situation | File |
|---|---|
| One track: checklist to 0 ❌, metric ≥ threshold, find N of something | reference/serial.md |
| N independent units in parallel waves | reference/waves.md |
Platform mechanics, and the /loop watcher for external state | reference/engines.md |
Interview
Ask only the gaps, one at a time, each with a recommended default: platform · form (serial, waves, watcher) · stop criterion · verification · footprints (waves only) · product defaults · commit policy · gates · document path · then the one-sentence condition, which depends on all the above.
If the user hands over one paragraph with everything, infer, write both pieces, and list the assumptions underneath for correction.
Traps
- Whole contract stuffed into the
/goalline. - Criterion the evaluator can never observe.
- No SCORE format defined, or a score that says "made progress" instead of
7/12. - Goal closed by self-assertion.
- Parallel work without declared footprints, or the full test suite run inside every unit.
- Writing the document as a chat block instead of a real file.
Language
Interview and generated artifacts follow the user's language (pt-BR by default); this skill and its references stay in English. No em dashes in user-facing artifacts.


