self-loop
Skill1 starsChanged 3 months agoMITView on GitHub
Iterate on a deliverable until it meets strict pass criteria — plan, execute, score each criterion 1-10 with evidence, fix the lowest score first, repeat until all criteria score 8+. Built-in guards against score inflation and runaway loops (max 5 iterations, stop on 2 stalled rounds). Use when the user says 'loop until done', '될 때까지 반복', 'keep fixing until it passes', 'self-loop', or when reworking after a FAIL from /smoke-check, /gate-check, or /story-done.
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- dawn840705/codex-code-studiosedited, first seen Aug 28, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- dawn840705/codex-code-studios★ 17100% same
Wrote their own version · 0
None found.
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 repository90 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- adoptSkill
- api-cost-gateSkill
- architecture-decisionSkill
- architecture-reviewSkill
- art-bibleSkill
- asset-auditSkill
- asset-specSkill
- balance-checkSkill
- brainstormSkill
- bug-reportSkill
- bug-triageSkill
- changelogSkill
- code-reviewSkill
- consistency-checkSkill
- content-auditSkill
- create-architectureSkill
- create-control-manifestSkill
- create-epicsSkill
- create-prdSkill
- create-storiesSkill
- day-one-patchSkill
- design-reviewSkill
- design-systemSkill
- dev-storySkill
- doc-relinkSkill
- estimateSkill
- gate-checkSkill
- governance-bible-initSkill
- helpSkill
- hotfixSkill
- humanize-koreanSkill
- humanize-redoSkill
- humanizeSkill
- launch-checklistSkill
- legacy-purgeSkill
- lesson-logSkill
- lesson-reviewSkill
- localizeSkill
- map-systemsSkill
- milestone-reviewSkill
- onboardSkill
- patch-notesSkill
- perf-profileSkill
- playtest-reportSkill
- product-conceptSkill
- project-stage-detectSkill
- propagate-design-changeSkill
- prototypeSkill
- qa-planSkill
- quick-designSkill
- regression-suiteSkill
- release-checklistSkill
- remove-bgSkill
- retrospectiveSkill
- reverse-documentSkill
- review-all-gddsSkill
- scope-checkSkill
- security-auditSkill
- setup-engineSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 43
If the deliverable mutates persistent state (money, orders, inventory, credits, messages), include the concurrency triad as a criterion: …
- Very specific: line 92
All criteria >= 8 and the policy axis clean → declare DONE, go to Phase 3.
- Distinctive: line 113
Never claim the work is finished while any criterion is below 8.
- Distinctive: line 114
Do not ask the user questions mid-loop — judge and proceed autonomously.
- Distinctive: line 116
If every criterion scores 9-10 on iteration 1, the criteria were too loose — tighten them once and re-score before declaring DONE.
- Very specific: line 119
Stall detector: if the lowest score fails to improve for 2 consecutive iterations, STOP immediately.
- Distinctive: line 130
Always produced — whether the loop finished, stalled, or hit the cap.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Self-Loop
Runs the plugin's self-iteration quality protocol on a single deliverable:
plan → execute → score → judge, repeated until every pass criterion scores
8/10 or higher. The full rule (including rationale) lives in
rules/self-loop.md — this skill is its executable form.
Two traps this skill actively defends against:
- Score inflation — the model grades itself leniently to exit the loop. Defense: criteria must be objectively verifiable, and any score of 8+ must cite evidence (test output, command results, actual file content).
- Runaway loops — criteria never reached, tokens burn forever. Defense: hard iteration cap (default 5) and a stall detector (2 consecutive rounds without the lowest score improving → stop and report).
Phase 1: Lock the Target and Pass Criteria
- Target — from the argument, state in one paragraph exactly what will be built or fixed. If no argument was given and no deliverable is obvious from context, ask the user for one and stop.
Pass criteria — 3 to 7 criteria, each one objectively verifiable:
- ❌ "code quality is good"
- ✅ "all tests pass (
<test command>exits 0)" - ✅ "zero hardcoded gameplay values in changed files (grep evidence)"
- ✅ "every acceptance criterion in the story file is demonstrably met"
Sources, in priority order:
--criteriaargument → the governing artifact (story file, GDD section, PRD, gate report that failed) → propose 3-5 yourself and show them before starting.If the deliverable mutates persistent state (money, orders, inventory, credits, messages), include the concurrency triad as a criterion: race conditions, partial writes, idempotency.
- Iteration cap —
--max Nif given, otherwise 5.
Display the locked contract before looping:
Target: <one paragraph>
Criteria (all must score >= 8/10):
C1. ...
C2. ...
Max iterations: 5Phase 2: The Loop
Each iteration, in strict order:
- Plan — name the ONE thing this iteration will do.
- Execute — build or fix it. Actually run commands / write files; a plan is not an iteration.
Score — before grading anything, ask of each criterion: "can a script decide this?"
- Yes → run the script. Its exit code sets the score, and your
judgment does not override it. Non-zero → that criterion scores below 8,
even if the work looks right to you. Record the command and the code:
pytest tests/ → exit 1 (3 failed). Seedocs/deterministic-gates.mdfor the 0/1/2/3 contract. A gate that could not run (exit 3) is NOT a pass — that criterion is unscored and the loop cannot declare DONE on it. - No (readability, tone, whether an argument holds) → grade 1-10, and:
- cite evidence (test output, command result, file excerpt) — a score of 8+ without quoted evidence is invalid, re-score it lower;
- name at least one remaining weakness, even at 9-10.
Self-scoring is the fallback, not the default. Every criterion you grade by hand that a script could have measured is a criterion you are grading generously without knowing it.
A score below 8 is not yet a licence to rewrite. Emit a defect ticket —
claim_id/defect_type/evidence/severity— and fix only what the ticket names. Defaultseverityislocal-fix;full-rewriteis for structural defects only. No ticket → preserve that part untouched. Rule:rules/self-loop.md§ 2.1.- Yes → run the script. Its exit code sets the score, and your
judgment does not override it. Non-zero → that criterion scores below 8,
even if the work looks right to you. Record the command and the code:
- Judge —
- All criteria >= 8 and the policy axis clean → declare
DONE, go to Phase 3. scripts/verify_policy.py → exit 2→BLOCKED, whatever the scores say. Criteria met by breaking a rule is unsafe-success, not completion.- Cannot proceed for want of a permission, data, or a human decision →
BLOCKED, not a failure. Say what would unblock it and where to resume. - Otherwise → declare
CONTINUE, and the next iteration MUST target the lowest-scoring criterion first.
- All criteria >= 8 and the policy axis clean → declare
Iteration input does not accumulate. From iteration 2 on, re-inject only
four things: the previous output (or just the span being fixed), this round's
defect tickets, the violated criteria with their allowed values, and what must
be preserved. Re-feeding the whole context makes the model reinterpret the task
and undo earlier agreements. See rules/self-loop.md § 2.2.
Emit one progress line per iteration so the user can follow along:
[iter 2/5] lowest: C3 (5/10 — no error-path test) → this round: add error-path testsHard rules:
- Never claim the work is finished while any criterion is below 8.
- Do not ask the user questions mid-loop — judge and proceed autonomously. The only exits are DONE, the iteration cap, or the stall detector.
- If every criterion scores 9-10 on iteration 1, the criteria were too loose — tighten them once and re-score before declaring DONE.
Stall detector: if the lowest score fails to improve for 2 consecutive
iterations, STOP immediately. Do not attempt the same approach a third
time. Go to Phase 3 with result STALLED.
Cap: reaching max iterations without DONE → go to Phase 3 with
result CAP REACHED.
Phase 3: Exit Report
Always produced — whether the loop finished, stalled, or hit the cap. The user must be able to verify the result without trusting the scores.
## Self-Loop Report
Result: DONE | STALLED (<why>) | CAP REACHED
Iterations: N/5
| Criterion | Score | Evidence | Remaining risk |
|-----------|-------|----------|----------------|
| C1 ... | 9/10 | test run: 42 passed | flaky on CI unverified |
Verify it yourself:
- <1-3 commands or file paths the user can check directly>
[If STALLED or CAP REACHED]
Blocked on: <root cause>
Tried: <approaches attempted>
Decision needed: <what the user must choose>Anti-patterns
- Starting the loop with no criteria — lock Phase 1 first.
- Scoring without fixing, or fixing without re-scoring — the 4 steps are a set.
- Polishing an already-high criterion while the lowest one waits.
- "One more try" after the stall detector or cap fires — stop means stop.
- Reporting only scores with no evidence and no way for the user to verify.
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.

