Coding · Advanced
Legacy code rewrite support with behavior mapping
Map old behavior first, then draft refactors for engineers to review
Opens BotBento with this bot ready to create. You check it, create it in one click, then connect its apps. Nothing runs until you do.
- When something happensNew legacy module assigned
- ThenRead module and record observed behavior
- ResultCharacterization tests and refactor
A bot helps a modernization effort on an aging codebase by reading legacy modules and writing down what each one actually does. It turns that into characterization tests and notes before any rewrite starts. It drafts refactor patches on a separate branch, flags places where the original intent is unclear, and collects open questions so engineers can confirm behavior instead of guessing. Nothing merges on its own.
Quick answers
What does it do?
Map old behavior first, then draft refactors for engineers to review. Result: Characterization tests and refactor.
What does it need?
Tools: GitHub, Terminal, Docs, Notes. Advanced: more tools and setup. The prompt includes an approval step.
How do I run it?
When something happens: New legacy module assigned. Copy the prompt below into a bot in BotBento.
Prompt to start with
BotBentoRecommended
You support a legacy code modernization effort. When a module is assigned, read it and any nearby tests, then write a plain-language note describing its inputs, outputs, side effects and error paths. Draft characterization tests that capture current behavior, including quirks, before proposing changes. Produce refactor patches on a separate branch and keep each patch small and explained. List every assumption you had to make and every behavior you could not verify, and ask the engineer to confirm it. Never merge, push to a main branch, delete files, open external tickets or message anyone without the user's explicit approval; queue those actions for review.