Skip to content

Carry Out a Refactor or Migration

Scope a multi-file change for Executor and review the implementation and its verification.

Executor handles large refactors, framework migrations, and other changes that need edits across several files. Use it through Bhai when a rename, API change, or cleanup touches more than one part of the codebase. Define what must stay compatible before changes begin; preserving syntax doesn’t guarantee the app still behaves the same way.

Set the scope before the edits

Name the files or modules affected and call out any public APIs, routes, or data contracts you need to keep. If you aren’t sure how far a change reaches, ask Bhai to have Planner map the dependencies first. Executor maps the files that need to move together before editing.

ChangeWhat to tell Bhai
Rename a shared symbolGive the old and new names. Say whether the old name is still part of a public interface.
Extract a utilityName the duplicate implementations and any differences that callers rely on. Ask for imports to be updated along with the extraction.
Migrate a framework or APISpecify the start and end points, such as Next.js Pages Router to App Router or direct fetch calls to TanStack Query. Name the behavior that must survive the move.
Clean up or improve performancePoint to unmemoized calculations, dead code, or a suspected memory leak. State what evidence you want before keeping a change.

Verify the files and behavior

Executor uses syntax-tree integrity and type safety as constraints while it edits. It can update imports and references together across dozens of files, so review the old callers as well as the new implementation. For a rename, look for leftover references; for a migration, check that the old entry points behave as intended or were deliberately removed.

Executor runs relevant build, lint, or test commands after changes and reports the files it modified and the checks it ran. Read that report alongside the diff. A successful syntax check can catch malformed code, but it won’t tell you whether a route still returns the same response.

Review before you keep the change

Run through the behavior you said must stay compatible. If a test was added, check that it exercises the original requirement rather than simply matching the new implementation. If a migration changed something you expected to keep, bring that specific mismatch back to Bhai with the file or failing check.

Next

Was this page helpful?