Menu

1 / 3

I automated my refactoring method with GitLab Duo agents. The agent writes the fix, a CI gate decides the merge.

DEV Community: gitlab·Karlis Gutans·3 days ago
#zk5ktb3i
#devtogitlab#devto#dev#file#liepa
Reading 0:00
15s threshold

AI writes code fast. The code runs and passes the tests. It is still hard to change.

I refactor a lot of AI-generated code. The same problems come back every time:

Functions grow long and deeply nested.

Files collect responsibilities that belong somewhere else.

The next AI session needs more and more context to make a safe edit.

For the GitLab Transcend Hackathon (theme: Life After Code ) I tested how far my own refactoring process can be automated with GitLab pipelines and the GitLab Duo Agent Platform. The result is Liepa refactoring .

Devpost: https://devpost.com/software/liepa-refactoring

Code: https://gitlab.com/gitlab-ai-hackathon/transcend-october-2026/43312097/liepa-refactoring

My manual method

My method has three steps:

Take the most characteristic keywords of each file.

Check whether those keywords belong to the area of the app where the file lives.

If they do not, the file mixes responsibilities. Refactor it with an AI assistant, one file at a time.

It works.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.