Completion Contract Loop
Writes a contract of what "done" means and what evidence proves each requirement before any work starts, then refuses to claim success without that evidence.
npx claude-code-templates@latest --skill β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’Interactive Terminal Locked
Unlock this skill to run and inspect the interactive installation sequence.
Completion-Contract Loop
Loop Engineering β the /goal verb runs until a verifiable condition is true. This loop fixes the most common failure: an agent that says "done" when it isn't. It defines "complete" and the evidence for each requirement *upfront*, then can't declare victory without it.π― Goal
Before doing any work, write a completion contract: each requirement plus the concrete evidence that proves it. Then execute until every requirement is backed by evidence.
β±οΈ Schedule
Trigger: on-demand (a goal that runs to a condition, not a timer).
βΆοΈ Run it
/goal First write a completion contract: list each requirement and the exact evidence that proves it (a passing test, a command output, a diff). Confirm the contract, then implement. Do not claim success for any requirement without its evidence. Done only when every requirement has evidence. Stop after N turns if blocked.
π Iteration steps
critical-thinking drafts requirements + the evidence each needs./test-coverage, command output, diff); no evidence, not done./create-pr linking the contract.π Stopping condition
Every contract requirement is satisfied with verifiable evidence β or the turn/budget cap is hit and the loop reports what's still unproven.
π° Budget & guardrails
A separate check confirms each piece of evidence rather than trusting the worker's self-report. Hard turn cap so an unprovable requirement can't spin.
π§© Referenced components
agent:expert-advisors/critical-thinking β authors and enforces the contract.command:testing/test-coverage β supplies measurable evidence.command:git-workflow/create-pr β ships the result with the contract attached.π‘ Example
Asked to "add rate limiting", the loop first writes a contract (limit enforced, 429 returned, headers set, tested) and only reports done once each line has a passing test as evidence.
How to Use & Getting Started
# Step 1: Initialize skill agent setup
npx skills add Completion Contract Loop --install-production
python -m pip install -r requirements.txt
codex plugin install Completion Contract Loop@latest
export API_KEY=secret_token_key_here
Installation Runbook & Walkthrough Locked
Unlock this skill to reveal complete step-by-step setup guides, terminal commands, configuration recipes, repository links, and interactive installation video walkthroughs.
Unlock full access to Completion Contract Loop
Get instant access to complete setup guides, repository source code, and integration assets.
More in loop
View all loop skills βBuild Test Fix Loop
Builds the next item on the plan, then runs tests, typecheck and lint, feeding every failure back as the next instruction until the build is green.
Adversarial Review Loop
Has a second, independent model review every change before merge so two different reviewers must agree - code only lands when both clear the bar.
Builder Reviewer Loop
Passes code between a builder and an independent reviewer subagent until the review has no blocking findings and tests pass.