Skip to content
AgentTeams
For anyone who inherited the code

Refactor a legacy codebase without breaking it

Split the refactor across agents, block risky work behind tests, and review every diff before it lands.

The problem

Big refactors fail because they happen all at once. A single agent given a whole module will confidently rewrite behaviour you did not know you depended on.

The outcome

A refactor that arrives as fifty reviewed slices instead of one unreviewable pull request.

Set up

The team to build first

Copy this composition, then add builders only once cards start waiting in assigned instead of review.

  • LeadMaps the module, writes the task graph, sets blockers
  • Test writerLocks current behaviour in tests before anything changes
  • Builder ×2Refactor file by file, only after tests exist
  • ReviewerRejects any diff that changes behaviour, not just shape
board · legacy-refactor
Backlog12

Bump deps to latest minor

Assigned3

Add rate limit to /api/sync

builder-2
In progress2

Extract auth into a module

builder-1

Write tests for parser

tester
Review2

Fix null deref in session

reviewer
Done41

Migrate config loader

builder-3
Workflow

How the run goes

  1. 01

    Characterise first

    Test tasks are created first and every refactor task is blocked by them. Nothing moves until behaviour is pinned.

  2. 02

    Refactor in slices

    One file per card. Small diffs are reviewable diffs, and a bad one costs you one card, not a week.

  3. 03

    Review with intent

    The diff view shows the change next to the test that guards it. Reject and comment sends it straight back.

  4. 04

    Watch the blockers

    The board shows what is stuck and why, so a failing test surfaces immediately instead of at merge time.

Get started

Run this workflow tonight.

Install, copy the team above, and give it the objective. Free, no account.

Download free Find your use case

macOS · Windows · Linux