An abstract purple and blue background with soft lines and shades.
Photo by @magicpattern on Unsplash

In this article we'll talk a bit about how to actually use AI to speed up the development process and break free from inertia on software projects.

Let me be clear: the idea is not to replace our critical thinking or simply let the LLM do all the work (even though it will do a good chunk of it — you get the point!). It will rarely produce something that is truly good and, more importantly, secure in the way best practices recommend.

First tip

Whenever possible, make commits. This applies to all scenarios, but especially when using an AI agent to assist with development.

The reason? Well. Let's imagine the following scenario:

  1. The agent implements a first version, things work in a certain way, everything seems ok and functional.
  2. Now you decide to ask for something else — a simple change here and there.
  3. The agent "thinks" for 3 minutes and… it has undone the entire first version and now suggests something completely different, with a special bonus: nothing works anymore.

Experience from someone who's been through this... 🥲

So, commit in stages — after making sure everything is safe to move to the next change, proceed with the instructions. If something goes wrong, just roll back to the previous version. Trust me, it will save you a few minutes and make the whole process much smoother.

Iterations, iterations, iterations...

One of the most interesting points of using a code-focused agent is the analysis and rapid coding ability it puts in our hands. When we understand what we need to do and how to do it, the use of AI becomes much more evident, as we can see in the following example:

Image of a terminal window showing a response from GEMINI CLI

This is the response the agent gave me. After an initial coding session, I submitted the first prompt and got a good result, but I wanted to go further — to create an application that is less "chaotic" and easier to read by humans (in this case, myself) in the future. We can't dismiss the use of common sense and following the good old practices of well-written code.

So I instructed the LLM to start thinking about modularization, breaking the application into independent libraries using the concept of Single Responsibility. To achieve this, we can use a framework to facilitate the implementation, such as Flutter Modular, Ng Modules, PNPM Workspaces, NX, and so on.

Improving Instructions for the Agent

One of the main points I noticed when using agents is the loss or lack of context on certain details. Most AI tools today have a good context window, but that doesn't mean the agent can't get lost amid so many instructions.

What is a context window?

Translated from the English Context Window, it is a concept from the AI/LLMs field. It essentially refers to the size of the "memory" that a machine learning model can access during an interaction session. The larger the "window," the better — meaning the model will "remember" more of the recent conversation.

This is the case when using these tools over a longer coding session: as we request adjustments and new implementations, the agent gradually loses track of some of the rules — something like a lack of "attention to detail."

To address this, we can use a simple but effective strategy: either the traditional README file, which usually contains project information and technical decisions, or a file called {CODING_AGENT}.md.

{CODING_AGENT} may differ depending on which agent you are using — for example: CLAUDE.md or GEMINI.md.

For example, with Gemini CLI, Claude Code, and others, we can create this file and define some important instructions that the agent will consult every time it receives a new one.

Something interesting we can do is: whenever the agent produces something unexpected, instruct it to correct the issue and also ask it to append the correction to the .md file.

Image of a terminal window showing a response from GEMINI CLI

Do I Still Need to Write Code?

Well, yes — in my view, quite a lot still. I don't believe AI will replace the work of a good dev, and this becomes even more evident when we use these AI tools during the creative process. Take a look:

Image of a terminal window showing a response from GEMINI CLI

In the image above, I asked the agent to generate a very common component in mobile apps — the "BottomSheetModal". Everything seemed fine at first, but the behavior was not what I expected, as we can see below:

App screen 1
App screen 2

From left to right: 1. Version with error generated by the AI — 2. Version corrected by me

It looks like a simple fix, yet even after asking the agent to correct it, it still couldn't manage (it invented an entirely unnecessary workaround). The solution was simpler than it seemed:

  void _showAddContentMenu(BuildContext context) {
    showModalBottomSheet(
      context: context,
      useRootNavigator: true,
      builder: (_) {
       ...
    );
  }

By using the useRootNavigator property, the modal component is rendered from the root navigation object, which makes it overlay any other layers at the same position (this is the expected behavior — see the image on the right above).

This understanding of how things work and where to adjust them will continue to be extremely important. We need to maintain critical thinking about everything that AI — or any other tool — sells us as the "truth."

We should use the tools, but not delegate to them the chance to learn and grow as professionals every day.

It is not enough to just reproduce prompts and follow the simple path of "vibe coding." We need to understand what we are doing and why, so that we are the ones ahead — being more productive by using the tools rather than depending on them (or being used by them).

References