refactor-agent

Refactors code with loop behavior for iterative improvement