# Contract conformance loop

> Contract conformance loop is an open-source agent skill for developer tools. Iteratively builds code until every contract criterion is verified by a fresh evaluator. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/ivy00johns/Skill-Madness/tree/main/skills/loops/contract-conformance-loop
- **Repository:** https://github.com/ivy00johns/skill-madness
- **GitHub stars:** 12
- **License:** MIT
- **Skill name:** contract-conformance-loop
- **Collection:** https://github.com/ivy00johns/Skill-Madness
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

This skill drives an agent to implement or fix code until every criterion in an authored contract passes. It turns the contract into a criteria file where every entry starts as failing. The builder works on one failing criterion per round, then a separate evaluator subagent with no write permissions re-checks the whole set against the code and reports a verdict. Criteria only flip to passing on that evaluator verdict, and the builder cannot mark its own work green.

Each round checkpoints progress in git and updates a progress file so the run can be reviewed afterward. The loop stops when all criteria pass, or when an iteration cap, a no-progress limit of three rounds, or a budget ceiling is reached. Irreversible actions such as migrations against real databases or external API calls are paused for human approval.

It expects a contract or acceptance-criteria spec already present in the project, typically a contracts folder with an OpenAPI file, data-layer definitions and domain rules, plus the tools to read, edit and run tests. It is meant to be invoked explicitly, since it edits and commits code autonomously and spends tokens on each evaluator run. It is written for Claude Code and relies on its subagent and tool permission model.

## When your agent uses it

> Build until every criterion of an authored contract holds: the builder works one failing criterion at a time and a fresh-context evaluator (contract-auditor, no write tools, default-FAIL) grades all of them. Use when a contract or acceptance-criteria spec exists. Trigger on "build until the contract passes", "drive this to spec", "build-until-spec".

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/ivy00johns/Skill-Madness/tree/HEAD/skills/loops/contract-conformance-loop)
- [Asks for: Read, Write, Edit, Bash, Grep, Glob, Agent](https://github.com/ivy00johns/Skill-Madness/blob/HEAD/skills/loops/contract-conformance-loop/SKILL.md)
- [License: MIT](https://github.com/ivy00johns/Skill-Madness/tree/HEAD/skills/loops/contract-conformance-loop)

## Features

- **Default-fail criteria file:** Splits a contract into one testable criterion per checkable fact, each starting as unpassed.
- **One criterion per round:** The builder targets a single failing criterion each iteration so changes stay traceable.
- **Fresh-context evaluator:** A read-only subagent re-checks all criteria against the code without seeing the build reasoning.
- **Git checkpoints per criterion:** Each newly passing criterion is committed, giving a trail for review and rollback.
- **Stop and escalation guardrails:** Stops on full pass, iteration cap, three rounds without progress, or budget ceiling.
- **Human approval for irreversible steps:** Pauses before actions like database migrations or external API changes.

## Good for

- Build an API until it matches the OpenAPI contract in the repo
- Implement the domain rules listed in the contracts README and verify them
- Drive a service to meet its acceptance-criteria spec without self-grading
- Check that shared types are imported correctly across the implementation
- Resume an unfinished build against a previously authored contract

## Install

### Claude Code

This skill ships in the `skill-madness` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add ivy00johns/Skill-Madness
/plugin install skill-madness@skill-madness
```

Or copy only this skill to `~/.claude/skills/contract-conformance-loop`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/contract-conformance-loop &&
cp -R "$tmp/skills/loops/contract-conformance-loop" ~/.claude/skills/contract-conformance-loop &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/contract-conformance-loop` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/contract-conformance-loop` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/contract-conformance-loop &&
cp -R "$tmp/skills/loops/contract-conformance-loop" ~/.agents/skills/contract-conformance-loop &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/contract-conformance-loop` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/contract-conformance-loop` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/contract-conformance-loop &&
cp -R "$tmp/skills/loops/contract-conformance-loop" ~/.cursor/skills/contract-conformance-loop &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/contract-conformance-loop` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/ivy00johns/Skill-Madness.git --path skills/loops/contract-conformance-loop
```

Or copy the folder to `~/.gemini/skills/contract-conformance-loop` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/contract-conformance-loop`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/contract-conformance-loop &&
cp -R "$tmp/skills/loops/contract-conformance-loop" ~/.copilot/skills/contract-conformance-loop &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/contract-conformance-loop` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git
```

Then copy `Skill-Madness/skills/loops/contract-conformance-loop` into your agent's skills folder as `contract-conformance-loop`. Agents that support SKILL.md read one folder per skill.

## FAQ

### When does Contract conformance loop trigger?

It is invoked explicitly, for example with /contract-conformance-loop or phrases like build until the contract passes. Automatic invocation is disabled because it runs autonomously.

### What does Contract conformance loop need before it starts?

An authored contract or acceptance-criteria spec, usually in a contracts folder, plus the implementation to build or verify against it.

### Can the evaluator change my code?

No. The evaluator subagent is spawned without Write or Edit tools, so it can only read, search, run commands and report verdicts.

### What happens if the loop gets stuck?

If the same criteria stay failing for three rounds, or the iteration cap is hit, it stops and escalates rather than weakening the contract.

### How do I install Contract conformance loop in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/contract-conformance-loop to use it in all your projects, or to .claude/skills/contract-conformance-loop in one project. Or install the skill-madness plugin, which includes it: /plugin marketplace add ivy00johns/Skill-Madness, then /plugin install skill-madness@skill-madness.

### Does Contract conformance loop run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Contract conformance loop?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Contract conformance loop?

The closest alternatives to Contract conformance loop are Doubt driven development, Constraint driven development, Loop controller, Qe agent and Skill improver.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Doubt driven development](https://ai-powered.com/skills/doubt-driven-development): Doubt driven development is an open-source agent skill for developer tools.
- [Constraint driven development](https://ai-powered.com/skills/constraint-driven-development): Constraint driven development is an open-source agent skill for developer tools.
- [Loop controller](https://ai-powered.com/skills/loop-controller): Loop controller is an open-source agent skill for developer tools.
- [Qe agent](https://ai-powered.com/skills/qe-agent): Qe agent is an open-source agent skill for developer tools.
- [Skill improver](https://ai-powered.com/skills/skill-improver): Skill improver is an open-source agent skill for developer tools.
- [Contract auditor](https://ai-powered.com/skills/contract-auditor): Contract auditor is an open-source agent skill for developer tools.
- [Doubt driven development](https://ai-powered.com/skills/doubt-driven-development-ajyadav013-2): Doubt driven development is an open-source agent skill for developer tools.
- [Create test](https://ai-powered.com/skills/create-test): Create test is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/contract-conformance-loop
