How to achieve greater code refactoring automation?
OpenAI Developer Community
July 1, 2026
Codex CLI is perfect for refactoring.
Unfortunately it helps a lot to have significant dev experience to do this.
Why? Because it allows you to set choice, tasteful guardrails and architecture for the new version.
But keep going and try to learn from the changes and issues you encounter and perhaps you can improve your software engineering prowess.
One key thing to think about when refactoring - I don’t believe you can automate this effectively without full test coverage on the original.
So my question to you is - what is the state of the unit and behavioural test suite of the original?
Do you have a requirements document - it’s better to have full test coverage but a requirements definition can be used as second best.
Only when you have a full test suite will you be able to automate a port imho - then you can loop until all test pass on the new version. Unfortunately, depending on the severity of the port - the tests might need altering (e.g. change of class names, div structure from new frameworks etc.) - and this will add to the challenge.
I would expect this to be an iterative project if you can’t supply those pre-requisites.
Try to create those artifacts as part of the port as that will put you in a much better position for future changes.
Discussion in the ATmosphere