Reading this post from one my best former tech mentors, got me thinking about a few topics on coding with AI tools.

I find refactoring to be one of the most useful tasks to give to AI tools. Based on my experience they do these jobs thoroughly and with high quality, if guided well.

Before these tools, there have been often cases when I was getting in a new codebase or worked on one for a long a time and had useful refactoring ideas that we did not end-up taking on due to the effort involved and/or regression concerns.

With AI tools, I can be more bold and take on tasks like these with higher frequency, especially if I can pair that up with adding more tests and/or if a lot of tests already exist. This results in better codebases over time.

In terms or learning from/with the AIs

Below is one of the most useful rules I found to have in my global AGENTS.md:

Before you start any implementation work, ask me the 2 to 5 most important questions that would help you do your task very well. After I answer, then begin. If you don’t have any questions for me, please state so at the very beginning of your response before you start doing the work.

The questions that you will ask for me to respond to, will generally fall into 2 categories - each requiring a different treatment from the AI Agent:

A. Questions where a choice has to be made:

  • yes or no questions OR
  • questions that involve the selection of a choice from multiple options

For each of these type of questions (category A) include (at the end of the question) the answer you would have picked in the absence of an answer from me.

B. Open ended questions

Questions where I need to provide an answer that DOES NOT INVOLVE the selection of an option. In these cases, include the text of the answer you would have provided, if I was not able to provide you with an answer.

This rule brings a few benefits

  1. it forces the AI to think deeper about what it does and ask good questions.
  2. it speeds up my responses, whenever I can pick the AI’s defaults, and its answers are frequently as good or better than mine.
  3. I can get a better feel of “how it thinks”.
  4. Over time, I get better at providing prompts/plans in such a way that there is not even a need for follow-up questions -> it can just go.

It is also fun and revealing to have an AI generate prompts for another AI. Like for e.g. when I have changes in both the front-end and the backend, in different repos each w/ its own AI agent/context. I have the one that has more context on the overall task give prompts to the other one, for supporting work it needs.

Now of course, I could just let the agents be orchestrated by another team manager agent -> I am not ready though for that kind of setup: it takes me away too much from understanding what my codebases are doing and how they are doing it.