Test all commits and fix errors in a loop
Automates fixing test failures across commits by running tests in a loop, launching subagents to fix errors, and creating fixup commits until all pass. Use this to clean up a failing branch before merging.
/plugin marketplace add motlin/claude-code-plugins/plugin install build@motlin-claude-code-pluginsRun the test-branch script on all commits in the current branch. When a build failure occurs, use a fresh subagent to fix the error, create a fixup commit, rebase, and retry until all commits pass.
This command automates the test-fix loop:
scripts/test-branch to test each commitscripts/test-fix to create fixup commit and rebaseExecute the following loop:
Start the test run in background:
scripts/test-branch with run_in_background: trueMonitor the output:
BashOutput with a filter regex to capture only relevant lines:
"FAILURE|SUCCESS|ERROR|error:|warning:|✗|BAD COMMIT|GOOD COMMIT|Recipe.*failed"When the shell completes:
test-branch-fixer agent with:
Handle the agent result:
git status --porcelainscripts/test-fix (NOT in background)Safety limit: If more than 10 iterations occur, report: "Too many iterations. Please review manually." and exit
BashOutput filter is critical: it extracts errors without consuming the entire build logtest-fix script handles thatKillShell if you need to abort a running background shell