This blog is part of a series on how Large Language Models (LLMs) can help software architects in their daily work. In this post, we focus on how to write better prompts to get more valuable and relevant responses from tools like ChatGPT.
If you’ve ever tried using an LLM and felt the results were too vague or not helpful, chances are the problem wasn’t the tool, but the prompt. Writing good prompts is like giving clear instructions to a colleague. The better your question, the better the answer.
Let’s explore a few simple but powerful ways to write better prompts.
Be Specific and Clear
The biggest mistake I see people make is asking vague questions. Instead of “Suggest an architecture for a web app to process payments,” try something like:
I need to design a web app that handles 1 million daily users, must be available 99.99% of the time, and needs to process payments in multiple currencies. Please suggest a microservices architecture for this.
The detailed prompt provides context to deliver relevant and useful answers.
Use Iterative Prompting
Don’t expect perfection on the first try. Think of your initial prompt as starting a conversation with a colleague. Begin with the main idea, then dive deeper into specific aspects.
Start broad: Design a basic healthcare system that needs to store patient records, handle doctor appointments, and follow HIPAA security rules.
Then refine: Good start. Now extend the architecture to keep patient data safe when stored, protect data during transmission, control access permissions, and track system usage.
Good answers often come from asking several focused questions rather than one question.
Assign a Role
One of my favourite techniques is assigning a specific role. Instead of generic responses, you’ll get answers tailored to your context:
Act as a senior solution architect who has helped several companies migrate from monoliths to microservices. Please create a step-by-step plan for moving our financial system to microservices.
Choose a role that matches your needs—cloud expert, security specialist, or infrastructure architect. It’s like choosing which expert colleague to consult.
Set Clear Goals
When you specify your goal clearly, the AI can focus on what really matters:
I am building a real-time financial risk assessment engine. It needs to handle high-throughput market data streams, must be fault-tolerant, and comply with financial regulations. Please propose a high-level design that emphasizes performance, reliability, and auditability.
Additional Tips
- Request alternatives: Ask for multiple solutions to compare and evaluate trade-offs. “Propose two different ways to design this data pipeline and explain the pros and cons of each.”
- Include your constraints: Always mention real-world limitations. “Design this system to comply with HIPAA regulations.”
- Specify output format: Want a table? A step-by-step guide? A diagram description? Just ask for it.
Writing better prompts is a skill every architect should develop. These techniques can transform how you use LLMs in your architecture work.
Remember, LLMs are collaborators, not replacements. Your expertise and judgment remain essential.
This blog is part of a series based on my book Generative AI for Software Architects: How to Use LLMs to Boost Your Productivity. If you enjoyed this post and would like to explore additional techniques for writing effective prompts, consider checking out the book.