Article summary
In a time of pressing adaptation to AI, it’s tempting to get to the result with fast prompts. But I’ve found that with some planning before prompting, I get better results that scale well. Here’s what I ask before I get started.
What is the end goal?
Am I solving a bug ticket? If it’s debugging, then I need context for the code. This drives me to do more back-and-forth knowledge building. That means a lot of my prompts end up being something like, How does this x-feature work? Help me trace the tech stack. What are some business logics embedded here? What do the tests tell me?
Am I building a brand new feature? This one is the most fun, because this is where a lot of architecting happens. From here, I ask: what is the architecture in my repository? Are there patterns I need to follow? Do we have convention docs that we can reference as we generate? Once I have these questions answered, I use a feature-specific markdown file that outlines what I’ll build. A lot of my prompts sound like: I’m ready to build x, given our architecture, let’s consider all the layers we need to build. A lot of refinement can happen from here once the skeleton is in place.
Am I adding onto or changing a feature? This one combines both needs from above. I need to get context on what the existing feature is like and then weave what I need to build into it.
What does my team need from me?
Today, because we’re able to generate faster, we’re building large features. Lots of generation = lots of file changes in a pull request (PR). There are a couple of questions that drive me to help others review my PR. How can I split this into digestible PRs? Can I tackle a layer of abstraction first? How do I make my feature Markdown human-readable? And if it’s not just for humans but AI as well, what do I need to call out for someone with minimal context to understand where I’m at? What increment can I merge in?
Aside from documentation and small PRs, my team needed to align as we all pumped out code en masse. The question we asked here was: what conventions do we need to align on so that all our code follows the best patterns?
A consistent thing I hear is that AI should not do the thinking for us. Because of this, I’ve always found that asking questions is the best way to get the thinking started. You might say: I can’t ask what I don’t know. Well, I’ve got a list of questions to get you started.
- What do I need to know about this repository to get x done?
- What architecture does this repository have?
- What patterns do I need to follow for x feature?
- Where does the business logic live here?
- How does testing work in this repository? What needs to be updated for new or existing features?
Happy prompt planning!