---
name: iterative-refactoring-and-test-coverage-runner
description: "Refactors code, updates dependencies, or expands test coverage in incremental cycles, logging progress and running checks. Use when an agent must execute a multi-step codebase objective through sequential pull requests for review."
license: CC-BY-4.0
compatibility: "Needs access to: Terminal, GitHub, Notes."
metadata:
  author: "BotBento Editorial"
  version: "2026-10-15"
  source: "https://botbento.com/usecases/iterative-refactoring-and-test-coverage-runner/"
  kind: workflow
  hermes:
    tags: ["refactoring", "git", "testing", "ci-cd"]
    category: coding
    requires_toolsets: ["terminal"]
---
# Iterative refactoring and test coverage runner

Break down large codebase changes into sequential pull requests with preserved progress context.

## When to use

Execute multi-step code refactors, dependency updates, or test coverage expansion by processing incremental tasks in sequence. Each cycle modifies the codebase, logs intermediate reasoning, runs checks, and stages pull requests for review before continuing.

## Inputs

- `refactoring_objective`: The code change, dependency update, or test coverage goal the agent should execute.
- `codebase_access`: The active codebase or repository the agent should inspect and modify.
- `progress_log` (optional): Existing notes log with prior observations and remaining tasks, when continuing work.

## Steps

1. When you ask: Refactoring objective provided (A person provides a refactoring objective in chat.)
2. Apply change and run test suite
3. Submit pull request for review

## Instructions

Inspect the active codebase and current progress log in the notes file. For each assigned objective, create a focused Git branch and make minimal, isolated code or test modifications via terminal commands. Run all relevant local tests to confirm changes pass. Record intermediate observations, remaining tasks, and status in the shared log. Ask for user approval before pushing branches, opening pull requests on GitHub, or merging any changes into the primary branch.

## Approvals

- Pushing branches to the remote
- Opening pull requests on GitHub
- Merging changes into the primary branch

## Output

Pull request staged for review after tests pass. (format: pull_request)

## Harness notes

- Claude Code: Save this file as ~/.claude/skills/iterative-refactoring-and-test-coverage-runner/SKILL.md (or .claude/skills/iterative-refactoring-and-test-coverage-runner/SKILL.md in the repo). Claude Code loads it when the task matches; run /iterative-refactoring-and-test-coverage-runner to start it directly.

## Source

Summarized in our own words from [Show HN: Continuous Claude – run Claude Code in a loop](https://news.ycombinator.com/item?id=45938517) (Hacker News, checked 2026-10-15). Any results described there are the authors’ own.

From the BotBento use-case directory: https://botbento.com/usecases/iterative-refactoring-and-test-coverage-runner/. Licence: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
