loop-contract-builder
Skill7 starsChanged 4 months agoMITView on GitHub
Build standalone loop contracts, completion gates, rubrics, acceptance criteria, evidence requirements, and iteration stop conditions from fuzzy user intent. Optionally adapt the result for Codex Goal mode or another agent runtime.
In this repository14 other files it gives its agents.
- article-annotation-pageSkill
- beautiful-article-rednote-paginationSkill
- claudemd-updaterSkill
- crazy-realist-friend-skillSkill
- garbage-collectionSkill
- ia-planner-skillSkill
- mav-cover-skillSkill
- mav-slidecraft-skillSkill
- motion-conceptSkill
- patient-pm-skillSkill
- resource-inventorySkill
- solution-researcher-skillSkill
- upgraderSkill
- visual-explorer-skillSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
25 rules. About 0 are common, 17 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈17
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this skill to turn an ambiguous desired outcome into a measurable contract that another agent loop can execute against.
- Distinctive: line 12
Create a loop contract with evidence-backed completion gates.
- Distinctive: line 24
If the task is not loop-ready, still produce a concise one-shot acceptance contract when useful.
- Distinctive: line 28
Ask at most 3 questions per round.
- Very specific: line 29
Prefer A/B/Ignore/Other style choices when taste or tradeoffs are unclear.
- Distinctive: line 31
Stop interviewing when more questions would only refine low-impact preferences.
- Distinctive: line 34
Write each effect as: desired result, observable evidence, unacceptable failure, and verification method.
- Distinctive: line 40
Use 5-9 criteria by default.
- Very specific: line 44
Use unknown instead of guessing when evidence is missing.
- Very specific: line 50
Stop conditions: max iteration/time/token budget, repeated no-progress, unsafe scope expansion, missing required validation, or high-stakes …
- Very specific: line 54
Read references/output-formats.md before producing final artifacts.
- Very specific: line 58
When the user explicitly wants Codex Goal mode, an optional adapter may instead add GOAL_READY_PROMPT.md and a /goal prompt.
- Very specific: line 59
If writing files, use names such as LOOP_CONTRACT.md, EXECUTION_PROMPT.md, rubric.json, and scorecard.md unless the user requests a …
- Very specific: line 62
If a rubric.json file is created, run scripts/validate_rubric.py <path-to-rubric.json>.
- Distinctive: line 63
If validation fails, fix the JSON contract before delivering it.
- Distinctive: line 64
If validation cannot run, state the reason and the residual risk.
- Distinctive: line 79
Stop conditions: When should the loop stop, ask for input, or declare blocked?
- Distinctive: line 83
Treat must-pass criteria as gates, not weighted preferences.
- Distinctive: line 84
Default completion threshold: weighted score >= 85 and every must-pass criterion passes.
- Distinctive: line 85
Default max iterations: 6 for small tasks, 8 for larger implementation tasks.
- Distinctive: line 86
Default no-progress rule: stop or escalate after 2 consecutive iterations with less than 3 weighted-score points of improvement and no …
- Distinctive: line 88
Use evidence levels consistently:
- Distinctive: line 93
Prefer concrete checks over vague adjectives.
- Very specific: line 107
When the user asks how this connects to upstream or downstream tools, read references/closed-loop-interfaces.md.
- Distinctive: line 111
Keep the final contract concise enough for Goal mode.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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
Loop Contract Builder
Use this skill to turn an ambiguous desired outcome into a measurable contract that another agent loop can execute against. The output is not the final product; it is the control surface for producing, scoring, iterating, and stopping.
Core Rule
Create a loop contract with evidence-backed completion gates. Scores guide iteration, but must-pass gates decide whether the loop may stop.
Workflow
- Establish the task frame.
- Identify the artifact or outcome being optimized.
- Identify the user, audience, use case, constraints, and stakes.
- Identify whether the contract should be delivered inline or written to files.
- Assess loop readiness.
- Mark the task
loop_readywhen it has one durable objective, a verifiable end state, and enough multi-step work for iterative progress. - Mark it
not_loop_readywhen it is a one-line answer, one-shot edit, unrelated backlog, or has no reliable finish line. - If the task is not loop-ready, still produce a concise one-shot acceptance contract when useful.
- Capture the files, docs, plans, logs, examples, or commands an executor must read before starting.
- Mark the task
- Interview the user in short rounds.
- Ask at most 3 questions per round.
- Prefer A/B/Ignore/Other style choices when taste or tradeoffs are unclear.
- Continue until product behavior, quality bar, non-goals, verification, checkpoint cadence, and stop conditions are clear enough to score.
- Stop interviewing when more questions would only refine low-impact preferences; make reversible assumptions and mark them.
- Convert intent into effect statements.
- Write each effect as: desired result, observable evidence, unacceptable failure, and verification method.
- Separate hard constraints from weighted preferences.
- Preserve subjective preferences, but translate them into visible or testable signals.
- Label the evidence level for each effect as
direct,proxy,manual_review, orunknown.
- Build the rubric.
- Use 5-9 criteria by default.
- Weights must sum to 100.
- Mark critical criteria as
must_pass; do not let weighted averages hide them. - Give each criterion an ID, weight, pass threshold, 0/1/2/3 score anchors, evidence requirements, evidence level, and verification method.
- Use
unknowninstead of guessing when evidence is missing.
- Define loop mechanics.
- Completion gate: all must-pass criteria pass, weighted score meets the threshold, and required evidence exists.
- Iteration policy: each loop reads required context, scores the current result, fixes the highest-value gap, records evidence, then rescans.
- Checkpoints: define what the executor should report after each meaningful iteration: current checkpoint, evidence collected, score/gaps, next action, and blocked status.
- Stop conditions: max iteration/time/token budget, repeated no-progress, unsafe scope expansion, missing required validation, or high-stakes ambiguity.
- Escalation: ask the user only when the answer changes product behavior, public API, data model, security posture, cost, legal exposure, or user-visible scope.
- Produce artifacts.
- Read
references/output-formats.mdbefore producing final artifacts. - Include a human-readable Loop Contract Markdown document.
- Include a machine-readable
rubric.jsonwhen the contract will drive automated scoring, subagents, evals, or repeated loops. - Include
EXECUTION_PROMPT.mdwhen the user wants a reusable runtime-neutral prompt. - When the user explicitly wants Codex Goal mode, an optional adapter may instead add
GOAL_READY_PROMPT.mdand a/goalprompt. - If writing files, use names such as
LOOP_CONTRACT.md,EXECUTION_PROMPT.md,rubric.json, andscorecard.mdunless the user requests a different path.
- Read
- Validate the contract.
- If a
rubric.jsonfile is created, runscripts/validate_rubric.py <path-to-rubric.json>. - If validation fails, fix the JSON contract before delivering it.
- If validation cannot run, state the reason and the residual risk.
- If a
Interview Coverage
Cover these areas before drafting the final contract:
- Outcome: What should be true when this is done?
- Audience: Who judges the result, and in what situation?
- Positive examples: What existing thing feels close to the target?
- Negative examples: What would be obviously wrong or unacceptable?
- Tradeoffs: What matters most when quality, speed, scope, cost, or novelty conflict?
- Constraints: Required tools, formats, platforms, dependencies, style, security, and budget.
- Verification: Commands, screenshots, human review, benchmark, eval, or evidence.
- Goal readiness: Whether the work is one durable objective with a verifiable finish line, and what Codex must read first.
- Checkpoints: What Codex should report after each iteration so progress is legible.
- Stop conditions: When should the loop stop, ask for input, or declare blocked?
Scoring Guidance
- Treat must-pass criteria as gates, not weighted preferences.
- Default completion threshold: weighted score >= 85 and every must-pass criterion passes.
- Default max iterations: 6 for small tasks, 8 for larger implementation tasks.
- Default no-progress rule: stop or escalate after 2 consecutive iterations with less than 3 weighted-score points of improvement and no must-pass fix.
- Require evidence for every positive score. Without evidence, mark the criterion as
unknownor score it conservatively. - Use evidence levels consistently:
direct: deterministic command output, test result, reproduced artifact, benchmark, or screenshot/video evidence that directly proves the criterion.proxy: indirect metric, partial reproduction, sampled check, or substitute artifact; label remaining uncertainty.manual_review: human or LLM-judge review; include reviewer, rubric, and artifact inspected.unknown: evidence is missing or unavailable; do not count it as passing a must-pass gate.
- Prefer concrete checks over vague adjectives. Replace "polished" with visible signals such as spacing consistency, empty states, mobile behavior, error states, and screenshot review.
Optional Integrations
This Skill works without any other Skill. When compatible integrations are installed, the contract may optionally be adapted for:
- a long-running goal state adapter;
- an autonomous implementation loop;
- an independent acceptance auditor;
- a context handoff mechanism;
- a domain-specific builder or reviewer.
Examples such as $goal-specifier, $autonomous-dev-loop, $acceptance-auditor, and $context-handoff are optional integration names, never installation or execution requirements.
When the user asks how this connects to upstream or downstream tools, read references/closed-loop-interfaces.md.
Output Discipline
Keep the final contract concise enough for Goal mode. Put details that are useful for scoring in the contract; put implementation ideas, open questions, and out-of-scope findings in separate notes. The loop contract should define success, not prescribe every implementation step.
The default output is runtime-neutral: LOOP_CONTRACT.md, rubric.json, and scorecard.md. A Codex adapter may optionally write .codex/agent-state files only when the user requests that mode. In that case, map each must-pass rubric ID to one acceptance criterion and record evidence under the same IDs.
Standalone Fallback
Without Goal mode, subagents, or any integration Skill, produce the contract, rubric, blank scorecard, iteration checklist, and stop conditions directly. The user can run each iteration manually or hand the files to any compatible agent runtime.
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.

