You Should Micromanage Your Engineers (Sort of...)
Writing code with AI requires a whole new way to manage teams and projects. Here's what we've learned.
I’m excited to introduce Ian Roughley as the co-author of this article. Ian is the VP of Engineering at TrueNorth, where he is taking an AI approach to disrupting the freight logistics industry. Ian and I have been collaborating on building product teams that use generative AI to write the majority of the code. With over two decades of experience, Ian has led engineering teams at high-growth companies like Behavox and ClimaCell, launching AI/ML-driven products and expanding platforms. He also mentors startups through Techstars. Connect with Ian on LinkedIn to benefit from his extensive expertise in both startups and enterprise settings.
New Opportunities, New Challenges
Writing code with generative AI doesn’t just break our models of engineering; it demands a fresh perspective on management of engineers too. Here’s a philosophy for success based on our experiences standing up one of the first “AI-first” product teams.
Surprisingly, the most effective way to get great AI-generated code outputs for improving existing code bases is the opposite of what works for smart humans. When we don’t provide sufficient guidance on the details, AI code-generation tools produce outputs that fail in the following ways:
They rewrite working code for no reason
They introduce bugs that break one part of the system while improving another
They use common practices but not necessarily the ones that conform to the standards we’ve selected in our code base
They generate spaghetti code that’s hard even for the AI to find, improve, and maintain, and many other problems
The solution is to micromanage your robots.
Micromanaging them won’t hurt their feelings, and it will help you surgically get what you want. We don’t mean breaking every request into micro-tasks but, rather, providing a high level of detail about how we want the work done. To be clear, for new projects it does make sense to make broad statements if you want to start quickly and approach the challenge as a non-engineer. If you’re specifically looking for the AI to express its creativity via the code, that’s also a different situation.
The best prompting for existing code bases, however, comes when the prompt treats the AI as a team of junior engineers who require high-specificity instructions.
The engineer orchestrating the AI still needs to understand how pieces come together and the architecture, or the results quickly become a mess. In this manner, it actually requires stronger, more intelligent, more architecturally minded engineers to thrive in this new world order. Code review is now the dominant skill required for success.
Let’s break down a few examples.
In each scenario in the diagram, we contrast an "Incorrect Prompt" with an "Improved Prompt". The improved prompts demonstrate the level of specificity we advocate for when working with AI. For instance, instead of a vague request to "Update the chatbot to handle custom parameters," the improved prompt provides clear technical context that specifies the libraries to use, the frameworks, and it adds more detail about what can be customized. Similarly, for internationalization, rather than simply asking to "Support multiple languages," and touching every UI file in our entire project, the improved prompt outlines a detailed implementation strategy using specific libraries and file structures that starts with a single translation challenge and has identifiable results we can easily verify. We can expand from there if we get what we want. In the final example, we do not simply ask to connect to the X API, but we also specify the manner in which we want to connect. By providing this level of detail, we harness the AI's capabilities while ensuring the output integrates seamlessly with our existing systems.
Hopefully you’re noticing that we don’t sound like an influencer on X bragging about how they built a new game in five lines of prompting in one pass. You won’t see those individuals committing massive changes to multimillion-line production code bases with AI and no quality process. Instead, to make real progress, we want to sound like an experienced senior engineer giving guidance and coaching to a junior engineer, except that the junior engineer is an AI agent.
Hi! If you enjoyed these insights, please subscribe, and if you are interested in product coaching, fractional product support, or an AI First Team for your venture, please visit our website at First Principles, where we help the most ambitious founders make a difference.