Anti Spin Build Loop

Builds toward a machine-checkable contract with explicit anti-spin guardrails — stops on no progress, repeated approaches, flip-flopping, or a spend budget.

WorkflowengineeringMIT1 source files

Before you use this component

This is a third-party source bundle, not an installation into your account. UI Discovery has checked the available redistribution license evidence; runtime behavior has not been tested. Review all files, use a disposable project first, and do not enable scripts or hooks until you understand their permissions.

Some integrations require separately installed software, API keys or paid services. Credentials and subscriptions are not included. These are Claude Code resources; other clients may require adaptation.

Extract the ZIP into a temporary folder, inspect its entry file and supporting resources, then follow the original instructions. Do not overwrite an existing project configuration blindly. Keep the bundled license and attribution notices.

Source publisher
Claude Code Templates
Creator supplied by source
Not listed in source
Pinned source version
a344359459263d73d8948651c789244093c02e4e
License evidence
LICENSE

Source preview

cli-tool/components/loops/engineering/anti-spin-build-loop.md

---
name: anti-spin-build-loop
description: Builds toward a machine-checkable contract with explicit anti-spin guardrails — stops on no progress, repeated approaches, flip-flopping, or a spend budget.
category: engineering
interval: 15m
stop-condition: The machine-checkable contract passes, or an anti-spin guard trips (no progress, repeated/flip-flopping approach, or budget hit).
components: [agent:expert-advisors/architect-review, command:git-workflow/pr-review, hook:quality-gates/scope-guard]
tags: [reliability, guardrails, budget, loop]
---

# Anti-Spin Build Loop

> **Loop Engineering** — most agent loops never stop to ask whether they're actually making progress, so they retry the same broken approach or quietly edit the test to pass. This loop runs build → audit → verify against a machine-checkable contract, with explicit stops that detect spinning.

## 🎯 Goal
Drive toward a verifiable contract while actively guarding against the classic failure mode: an agent that loops forever without converging.

## ⏱️ Schedule
Suggested interval: `15m`.

## ▶️ Run it
```
/loop 15m "Build toward the goal, then audit and verify against a machine-checkable contract. Track progress each pass. Stop if you make no progress, repeat an approach you already tried, flip-flop between two approaches, or hit the budget. Finish only when the contract passes — never by weakening the contract or the tests."
```

## 🔁 Iteration steps
1. **Build** — advance toward the contract.
2. **Audit** — `architect-review` checks the change; `scope-guard` blocks weakening the tests/contract.
3. **Verify** — run the machine-checkable contract; record progress vs. last pass.
4. **Anti-spin check** — no progress? repeated approach? flip-flop? budget hit? → stop and report.
5. **Observe** — if making progress and contract not yet met, loop; else `/pr-review` and hand off.

## 🛑 Stopping condition
Contract passes, **or** an anti-spin guard trips — whichever comes first.

## 💰 Budget & guardrails
Hard caps on iterations and spend; no-progress, repeated-approach and flip-flop detection. The contract and tests are immutable — the loop may not edit them to "pass".

## 🧩 Referenced components
- `agent:expert-advisors/architect-review` — independent audit each pass.
- `command:git-workflow/pr-review` — structured review at handoff.
- `hook:quality-gates/scope-guard` — prevents weakening tests/contract to fake success.

## 💡 Example
Chasing a contract for a parser, the loop tries approach A, then B, then drifts back to A — the flip-flop guard trips and it stops with a clear report instead of burning tokens forever.

Preview capped at 60,000 characters. Download the bundle for every original file and notice.

Read the redistribution license
MIT License

Copyright (c) 2025 Daniel (San) Ávila

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Bundle SHA-256: bfbb4e5397ba848a049db428d6c5c916be659eb50dff4bb6972ea51a58226332. Files are served as downloads and are never executed by this page.