---
name: dynamic-code-repair-loop-runner
description: "Runs test suites through iterative code-repair cycles, tracks error reduction, and stops when failures plateau or all tests pass. Use when a failing test alert needs targeted revisions and a clear results report before any push."
license: CC-BY-4.0
compatibility: "Needs access to: Terminal, GitHub, Chat."
metadata:
  author: "BotBento Editorial"
  version: "2026-10-15"
  source: "https://botbento.com/usecases/dynamic-code-repair-loop-runner/"
  kind: skill
  hermes:
    tags: ["testing", "refactoring", "automation", "debugging"]
    category: coding
    requires_toolsets: ["terminal"]
---
# Dynamic code repair loop runner

Iterate on failing test suites and monitor convergence before pushing changes

## When to use

Executes test suites across iterative refactoring cycles, evaluates error rates between revision steps, and halts loops when test failures plateau or resolve, providing a clear summary of passing checks.

## Inputs

- `failing_test_details`: Alert details identifying the failing test suite or assertions that need repair.
- `test_command`: Terminal command used to run the relevant test suite after each revision.
- `target_repository`: GitHub repository and working branch containing the code and tests to revise.

## Steps

1. When you ask: Receive test failure alert (A test failure alert arrives in chat.)
2. Run tests and revise code
3. Report results for approval

## Instructions

Run the test suite in the terminal to identify failing assertions. Apply targeted code edits in small increments, re-running the test command after each revision. Track error reduction across attempts; if test outcomes stagnate or all tests pass, exit the loop. Do not push changes to GitHub or overwrite working branches without explicit user approval.

## Approvals

- Pushing changes to GitHub must wait for explicit user approval.
- Overwriting working branches must wait for explicit user approval.

## Output

Summary of test outcomes, error reduction across attempts, and passing checks for approval. (format: markdown)

## Source

Summarized in our own words from [Show HN: LoopGain – Stop agent loops with control theory, not max_iterations](https://news.ycombinator.com/item?id=48919562) (Hacker News, checked 2026-10-15). Any results described there are the authors’ own.

From the BotBento use-case directory: https://botbento.com/usecases/dynamic-code-repair-loop-runner/. Licence: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
