Refactor Safely
This loop systematically refactors your codebase to improve structure while maintaining test coverage. The agent identifies opportunities for cleaner code wi…
This loop is republished with attribution. Full credit and the original content belong to the source linked above.
AI Skill Market Insights
Real data. Real impact.
Emerging
Developers
Kickoff Prompt
Copy this prompt and run it with your agent to start the loop.
Start the "Refactor Safely" loop.
Goal: Improve code structure
Max iterations: 10
Between iterations run: npm test
Exit when: Tests pass
Please refactor the provided codebase to improve code structure while ensuring all tests continue to pass. Focus on making the code more readable and maintainable through proper naming, breaking down large functions, removing duplication, and organizing modules logically. Begin now.
Self-pace this loop. After each iteration, run `npm test` and evaluate the output, and only continue if the exit condition is not met (Tests pass). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.