Skip to main content

How Refactory uses AI

Una immagine di una struttura con la forma di un cervello realizzato con piccole sfere collegate da barrette, appoggiato su un piedistallo.

Does Refactory uses AI?

Yes, in Refactory we use Artificial Intelligence as a tool to help our development process.

This post will not be a “best practice” on how to use AI as there are many of those already; we like and suggest this one by the creator of Symfony. This post is a story of how AI made its way into our company.

It tells you more about Refactory than about AI.

Using smart tools

Generally speaking, we love using smart tools to improve our development process. This started way before AI; I would say the most significant step was when – a very long time ago – we started using a professional editor. This alone gave us a few goodies:

  • autoformatting
  • syntax highlighting
  • quick navigation
  • autocomplete

Our first AI usage ever

A few years ago we started using AI – as many probably did – as a smarter autocomplete in our editor. This made writing code even faster and more enjoyable, allowing us to keep the focus on the solution instead of the language syntax. At that time we used GitHub Copilot and its PhpStorm plugin.

When the ecosystem was ready we started assigning issues to Copilot on a GitHub repository. This is a pattern which works very well with us, as we make a point of writing excellent issues (more on that in a future post) and we got very satisfying results, even though this is mostly good for developing prototypes, which is not something we do every day.

Let’s get serious with AI

At one point, given the evolution in this technology, we decided it was time to make bolder steps into AI adoption. So we:

  • add an AGENTS.md file to all our our projects
  • add an agent chat to our editor and start using it on everyday coding task

After sharing and reviewing our opinions we switched to using OpenAI Codex, but I really feel that agent choice is not THAT relevant right now. First of all, Claude and Copilot are very good options as well and may even be better depending on the task at hand. Furthermore, the ecosystem is evolving so fast that any current evaluation may be obsolete in a few months.

So my advice is: choose one, learn how to use its ecosystem and go with it unless a significant change happen.

What’s next?

We’re now experimenting with:

  • integrating MCP servers to improve management of our own services
  • automating issues review: an agent may request clarifications, automatically explore the code and provide context and even suggest a possible fix

Yeah, but isn’t AI BAD?

Well. Let’s say that it has its dark sides. We’re well aware that using AI is not without cost and we do not refer just to OpenAI invoices.

That said, as a coding tool it’s incredibly useful and refusing to use it would be unsustainable, as we would become obsolete very quickly.

So we try to use our AI agent wisely:

  • we do not use AI for small tasks that require more time to be explained than coded
  • we do not always use the latest / fastest model
  • we reduce the context to avoid overconsumption and improve results
  • we rely on ChatGPT for broad technical questions not strictly related to the current code
  • we switch to Ecosia AI chat, a much more sustainable AI chat, for non technical question (e.g. naming things, choosing best translations, finding a nice place for your next vacation)

Meanwhile, we can but hope that such a large adoption will also trigger a request for more sustainable solutions, and we will keep ourselves up-to-date on any progress in that process.

Do you want to know more about our process? Do you have a project that needs care? Get in touch!

Foto di Growtika su Unsplash