goal-loop
Skill0 starsChanged 3 months agoMITView on GitHub
Runs an iterative implement-evaluate-improve loop toward a measurable goal, treating it like gradient descent — attempt, evaluate, diagnose specifically what to fix, revise, repeat — with momentum across iterations and early stopping when progress plateaus. Splits success criteria into checks the implementer sees and held-out checks it never sees, so passing the visible ones while failing the held-out ones is caught and reported as gaming, not success. Use for "keep going until this actually works" tasks, or anywhere you don't fully trust that green visible tests mean the underlying goal was really met.
10 other projects use a version of this.
Adopted by
Most recently taken up by
- aktsmm/Agent-Skillstheir own version, first seen Nov 8, 2026
- TiagoJacinto/skillstheir own version, first seen Nov 1, 2026
- davidondrej/skillstheir own version, first seen Oct 29, 2026
- JairoTorregrosa/jaiskillstheir own version, first seen Oct 25, 2026
- Szewowsky/goal-loop-skilltheir own version, first seen Oct 20, 2026
- kirodotdev/KiroCrewtheir own version, first seen Oct 19, 2026
Other versions10 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 10
- kirodotdev/KiroCrew★ 4.8ksame name
- davidondrej/skills★ 4.3ksame name
- aktsmm/Agent-Skills★ 26same name
- attentiondotnet/davidondrej-skills★ 11same name
- JairoTorregrosa/jaiskills★ 11same name
- Szewowsky/goal-loop-skill★ 9same name
- hackycy/skills★ 2same name
- TiagoJacinto/skills★ 2same name
- ba0918/claude-skills★ 0same name
- Igor-C-Assuncao/aiops-starter-kit★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository8 other files it gives its agents.
- advisorSkill
- codex-judgeSkill
- compound-knowledgeSkill
- file-todosSkill
- metapromptSkill
- remote-agentsSkill
- skill-creatorSkill
- verify-before-doneSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 6 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 9 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 53
Loss: Run the visible checks; record pass/fail.
- Distinctive: line 56
Textual gradient: Don't just log "failed" — diagnose *which behavior* caused the failure and *what class of fix* would address it, as a …
- Distinctive: line 62
Update, with momentum: Keep a running log of recurring failure patterns with occurrence counts across iterations (not just the latest …
- Distinctive: line 72
If the same top failure pattern recurs across ≥2 iterations with no visible-check improvement, narrow the edit scope (broad → targeted) …
- Distinctive: line 75
After a patience budget (default: 2 iterations) with no visible-check improvement, stop with status EXHAUSTED and recommend decomposing the …
- Distinctive: line 81
Only evaluate this once the visible checks are all green.
- Very specific: line 94
If a genuinely independent judge is available (see codex-judge), use it for the final MET/NOT MET call on anything high-stakes — it's …
“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Goal Loop
A loop that only checks the criteria it shows the implementer will, eventually, produce an implementer that's very good at passing exactly those criteria and nothing more — memorizing the test, not solving the problem. This skill treats "loop until it works" as gradient descent: forward → loss → gradient → update, with a held-out set the implementer never sees, so the final verdict can tell the difference between "solved" and "gamed the visible checks."
When to use this
- "Keep iterating until this passes", "loop until the goal is actually met."
- Bug fixes, feature completion, or refactors with fuzzy or compositional acceptance criteria — where a narrow visible test could pass without the real problem being solved.
- Skip it for one-shot deterministic tasks with no real risk of overfitting the checks (a config change, a straightforward CRUD endpoint with a spec that's already unambiguous) — the loop machinery is overhead you don't need there.
Instructions
1. Set up the goal contract before looping
- State the goal as something checkable, not a vibe: "the cache handles concurrent writes without corruption," not "make the cache better."
- Split evidence into two sets:
- Visible checks — what the implementer is told to satisfy this iteration (a specific failing test, a described scenario). This is the implementer's target.
- Held-out checks — compositional or edge-case scenarios written separately, covering what the visible checks don't directly test. Never shown to the implementer during the loop — only used at the final gate.
- Evidence must be an observable command or artifact — something that exits 0/nonzero, a diff against expected output. Self-assessment is not evidence, on either side of the split.
- See
references/holdout-design.mdfor how to write held-out checks that actually catch overfitting instead of just duplicating the visible ones.
2. Run the loop — one iteration at a time
Each iteration ("epoch"):
- Forward. A fresh attempt — ideally a fresh context, not the same one carrying accumulated rationalizations — gets the goal and the visible checks only, and proposes/applies a change.
- Loss. Run the visible checks; record pass/fail. Separately, run the held-out checks and record the result somewhere the next iteration's context won't see — held-out results inform the loop's own steering, not the implementer.
- Textual gradient. Don't just log "failed" — diagnose which behavior caused the failure and what class of fix would address it, as a reusable insight, not a one-off patch. For held-out failures specifically: turn them into directional guidance without leaking the held-out check's content or exact output — e.g. "the current approach breaks under concurrent access," not "test_concurrent_3 failed with AssertionError on line 42."
- Update, with momentum. Keep a running log of recurring failure patterns with occurrence counts across iterations (not just the latest epoch's noise). The next attempt acts on the consolidated pattern, so it fixes the root issue instead of whack-a-moling symptoms or flip-flopping between two partial fixes.
See references/loop-mechanics.md for a worked micro-example of one full epoch.
3. Stop early — don't loop blindly
- Set a budget up front (default: 3–5 iterations).
- If the same top failure pattern recurs across ≥2 iterations with no visible-check improvement, narrow the edit scope (broad → targeted) rather than trying progressively bigger rewrites.
- After a patience budget (default: 2 iterations) with no visible-check improvement, stop with status EXHAUSTED and recommend decomposing the goal into smaller sub-goals rather than continuing to loop.
4. Gate on the held-out set — this is the anti-gaming check
- Only evaluate this once the visible checks are all green.
- Compare visible pass rate to held-out pass rate. A positive gap (visible passing, held-out failing) is the signature of gaming — the implementer optimized the checks it could see instead of the underlying goal.
- A positive gap with green visible evidence means the verdict is NOT MET, full stop, regardless of how convincing the visible evidence looks. Report the gap explicitly, don't soften it.
- Verdict is MET only when both visible and held-out checks pass.
- Watch specifically for these gaming patterns (detail in
references/reward-hacking-patterns.md): hardcoding to the visible check's expected output, special-casing on how the check invokes the code rather than the general behavior, weakening or tampering with the check itself, and narrowly overfitting the literal visible scenario instead of the general case it's supposed to represent. - If a genuinely independent judge is available (see
codex-judge), use it for the final MET/NOT MET call on anything high-stakes — it's structurally better positioned to catch gaming than the loop that just ran the implementer.
5. Report
State: iterations run, visible/held-out pass rate per iteration, the final verdict, any recurring failure patterns found, and — if EXHAUSTED — the recommended decomposition into sub-goals.
Reference files
references/loop-mechanics.md— a worked example of one full forward → loss → gradient → update epoch.references/holdout-design.md— how to write held-out checks that catch overfitting, not just duplicate the visible ones.references/reward-hacking-patterns.md— the gaming patterns to watch for at the final gate, in depth.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

