Vibe Coding Forem

Devin
Devin

Posted on

How do you vibe code legacy code?

Lots of talk about new stuff, but what about old codebases? Anybody doing this?

Top comments (4)

Collapse
 
igventurelli profile image
Igor Venturelli

the first step is to ask AI to explain the project
in case you know the project, you can do some tricky questions in order to validate AI's knowledge, but if you don't, you can ask regular questions for you (and AI) to understand how it works

then, after that, one strong suggestion is to ask AI to create a .md file and write the overall explanation on it, then you can manage your future prompts to always refer to this doc before performing any change

then, finally, you can ask changes - I suggest starting with the small ones, but is up to you
another advice is to ask AI to always keep that .md up-to-date, by adding something like "and update the .md file if you found something new or you had a misunderstanding before" to your prompt

Collapse
 
junothreadborne profile image
Juno Threadborne

That depends on how to define "vibe coding," I think.

I've always thought of it as the typical "have the AI write basically everything, uncritically." I feel like the only useful way to use AI in a legacy codebase is, as @igventurelli pointed out, understanding the code. Which, admittedly, is often even tough for an AI in a mature code base.

But questions like "explain this pattern" or "what would happen if..." can be life-savers, especially if you're new to the project.

Collapse
 
avanichols_dev profile image
Ava Nichols

Carefully!

Collapse
 
hermergray profile image
Herrmer

In theory it should be great for legacy coding — I don't think the models are great at this sort of stuff yet but I think it's a good use case.