
It must already be old news how to make a good Prompt for a generative language model, but if you landed here out of nowhere, I’m going to show some tricks you can use to get a good prompt.
Just remember, you can ask ChatGPT itself, Grok, or another model how to make a prompt or improve it, but there are some nuances that aren’t so easy to notice.
A Prompt needs some important factors:
- How you want the action to be done
- Why you want the action to be done
- And sometimes the result you expect from the action performed
It sounds silly, but the difference between a nice prompt and a bad prompt is this kind of detail.
For example:
“Write a professional email to my boss asking to work from home on Fridays”
In this example, we don’t have the right context, the email length, or what the tone should be, whether more serious or lighter. In the example below:
“I need to write an email to my boss asking to work from home on Fridays. I want a professional but friendly tone, highlighting that my productivity remains high and that this would help me with work/life balance. The email should have at most 3 short paragraphs.”
The second prompt will be much more effective, regardless of the model you’re using, because you have the how and the why.
Now let’s think of something more complex. How about a task list API?
“Make a calculator in Python”
It’s a very simple example, which can work depending on the LLM model you’re using (GPT5 and Sonnet 4.5 already create something nice for you), but it might not have the details you need.
What buttons does this calculator need? Is it scientific? Here’s an example of a much more advanced Prompt.
“Create a calculator in Python that:
— Works in the terminal (CLI)
— Accepts operations: +, -, *, /
— Validates whether the user entered valid numbers
— Allows multiple operations in a row until the user types ‘exit’
— Shows friendly error messages if something goes wrong —
Include comments explaining the main parts of the code
Expected usage example:
- Enter the first number: 10
- Enter the operation (+, -, *, /): +
- Enter the second number: 5
- Result: 15
- Do you want to continue? (y/n): “
Do you see how this example is much better? If we were to mirror this in JIRA, a Story needs to have the Objective, Scope, Acceptance Criteria, and in many cases BDD and much more. The clearer your prompt is, the better it works.
That said, there are some “tricks” you can put into your prompt to get a better result.
⛓️Chain-of-Thought (CoT) — “Show your reasoning”
If you use LLM’s a lot you probably already know how it works, but if you still haven’t noticed, Chain of Thought is a way for the LLM to show what it is “thinking” at the time.
Chain-of-Thought was introduced in 2022 by Google researchers in a paper that showed something interesting: when we ask the model to “think out loud,” it makes far fewer mistakes, especially in math and logic problems. And there’s more: this technique works MUCH better in larger models. If you’re using a small or older model, you might not see that much difference. But in models like GPT-5, Claude Sonnet, or Gemini Pro, the result is impressive. It’s as if the model needs “mental space” to reason, and larger models have more of that space.
Currently, models already come with “Thinking” mode built in, but you can improve your prompts so they do this as well. It’s like a teacher asking you to explain how you multiply 30 x 10, to understand how your reasoning works. This is a good way to do alignment in Artificial Intelligences, but the most important thing in our scenario is that it makes it easier for how an LLM will answer you.
🤖Prompt Chaining — “Divide and conquer”
This one seems pretty obvious, but it can go unnoticed. Prompt Chaining is nothing more than splitting your tasks into several pieces, where each answer feeds the next question, so you end up with several small prompts answering each other. It’s like baking a cake — you don’t throw everything together all at once (I’ve done that before, the result was not a cake). First you prepare the batter, then bake it, then make the frosting.
Besides the cake analogy, Prompt Chaining solves another practical problem: the context limit. You know when you’re talking to an LLM and, suddenly, it “forgets” what you said back at the beginning? That happens because there is a limit to how much text (context) the model can “hold” in memory at the same time.
With Prompt Chaining, you split large tasks into smaller pieces, and each piece stays within the context limit. It’s like having several short, focused conversations, instead of one giant conversation where things get lost. Practical example: Instead of asking “Analyze this 50-page report and give me insights,” you split it into: 1. “Summarize pages 1–10” 2. “Summarize pages 11–20” 3. [continues…] 4. “Now, based on the previous summaries, give me the main insights”
Even with models that have much larger context windows (Gemini with 2 million Tokens or GPT 5 with 400 thousand), depending on your task, splitting the prompt into several pieces still helps the model perform better.
🖊️Self-Review — “Be your own critic”
This is a very interesting strategy. You ask the AI to review its own work before answering you. Incredibly, it changes the answer a lot depending on what you’re going to use it for.
I prepared (Ahem, ahem, Sonnet) a Prompt using the three techniques for something simple, like planning a trip, take a look at how it turned out:
STEP 1 - CoT:
I'm travelling to Lisbon in December. Let's think step by step:
1. What is the best time to visit in December?
2. How many days are ideal?
3. Which landmarks are essential?
4. What is the average daily budget?
STEP 2 - Chaining: [After receiving the answer from Step 1]
Based on that information, build a day-by-day itinerary:
- 5 days in Lisbon - Average budget - Including landmarks
+ restaurants + transport
STEP 3 - Self-Review: [After receiving the itinerary]
Review the itinerary you created:
- Is it too rushed, or is there free time?
- Are the places geographically close, or will I lose a lot of time
in transit? - Is any important landmark missing?
Adjust the itinerary based on that analysis.
That way, you’ll get a much better answer from any LLM. This applies to any scenario, whether it’s trip planning, programming, or anything else where it can be used.
Other Techniques You Should Know
🎯 Few-Shot Prompting — “Learn by example”
Instead of explaining what you want, you show examples.
Example:
"Classify the sentiment of the sentences below as positive, negative or neutral:
Sentence: 'I loved the product!' → Positive
Sentence: 'It didn't work as expected' → Negative
Sentence: 'The product arrived yesterday' → Neutral
Now classify: 'Terrible service, would not recommend'"
The model learns the pattern from the examples and applies it to the new sentence. This also applies to code! You can show examples of areas of the code and functions that you used, and the model will understand much better what it should do. And this is more or less how an LLM model is trained, with an (ENORMOUS) list of examples.
👤 Persona/Role Prompting — “You are a…”
You give the LLM a role to play, and it adjusts the tone and depth. For example:
“You are a sports nutritionist with 15 years of experience. Explain the importance of post-workout protein.”
It works because the model has “knowledge” about how different professionals speak and think.
Disclaimer: Professional help is always worthwhile in most scenarios, don’t go trying to use an AI that hallucinates for something you don’t know about and end up doing something stupid, okay.
📋 Output Formatting — “Control the format”
You specify exactly how you want the answer: JSON, table, bullet points, etc. Example:
“List 5 programming languages and their main characteristics in JSON format with the keys: name, type, difficulty”
This is ESSENTIAL if you are integrating LLMs into applications.
🌡️ Temperature/Parameters — “Control creativity”
It’s not exactly a prompt technique, but changing parameters like “temperature” completely changes the result:
— Low temperature (0.1–0.3): More predictable and consistent answers
— High temperature (0.7–1.0): More creative and varied answers
Use low temperature for code or technical analysis. Use high temperature for brainstorming and creative content.
And the Perfect Prompt?

There isn’t one! New Prompt Engineering techniques are emerging, and each Prompt or technique fits better in each usage context. Eventually, models tend to improve to the point that some techniques become better than others or even become irrelevant, but knowing how to “ask” an LLM for something can save you a lot of time.
And yes, you can ask an LLM to format a prompt for you, but if you know how to do that, the output will be better, right?
I hope this article helped you understand Prompt Engineering a little better. That’s it. See you in the next article!
📚 REFERENCE LINKS ABOUT PROMPT ENGINEERING TECHNIQUES
🔗 Chain-of-Thought (CoT) Prompting
Original Paper & Official Documentation
- Original Paper (Google Research, 2022): https://arxiv.org/abs/2201.11903
- Google Research Blog Post: https://research.google/blog/language-models-perform-reasoning-via-chain-of-thought/
🔗 Few-Shot Prompting
- Original GPT-3 Paper (OpenAI, 2020): https://arxiv.org/abs/2005.14165
- NeurIPS 2020: https://papers.nips.cc/paper/2020/hash/1457c0d6bfcb4967418bfb8ac142f64a-Abstract.html
- Prompt Engineering Guide — Few-Shot: https://www.promptingguide.ai/techniques/fewshot
- Hugging Face — Few-Shot with GPT-Neo: https://huggingface.co/blog/few-shot-learning-gpt-neo-and-inference-api
🔗 Prompt Chaining
- Prompt Engineering Guide — Chaining: https://www.promptingguide.ai/techniques/prompt_chaining
- DataCamp Tutorial on Prompt Chaining: https://www.datacamp.com/tutorial/prompt-chaining-llm
- PromptHub — Comprehensive Chaining Guide: https://www.prompthub.us/blog/prompt-chaining-guide
🔗 Self-Critique / Self-Refine / Self-Review
- Learn Prompting — Self-Criticism Introduction: https://learnprompting.org/docs/advanced/self_criticism/introduction
- Self-Refine Official Page: https://selfrefine.info/
- Learn Prompting — Self-Refine Tutorial: https://learnprompting.org/docs/advanced/self_criticism/self_refine
- Eric Jang — Can LLMs Critique Themselves?: https://evjang.com/2023/03/26/self-reflection.html
- Prompt Engineering Org — Self-Critique Guide: https://promptengineering.org/llms-learn-humility-how-self-critique-improves-logic-and-reasoning-in-llms-like-chatgpt/
- Medium — Self-Criticism with Google Gemini: https://leonnicholls.medium.com/the-art-of-llm-self-criticism-with-google-gemini-21e8052d6adf
🔗 Role Prompting / Persona Prompting
- Learn Prompting — Role Prompting: https://learnprompting.org/docs/advanced/zero_shot/role_prompting
- Learn Prompting — Roles Basics: https://learnprompting.org/docs/basics/roles
- Medium — Mastering Persona Prompts: https://architectak.medium.com/mastering-persona-prompts-a-guide-to-leveraging-role-playing-in-llm-based-applications-1059c8b4de08
🔗Multi-Persona
- PromptHub — Multi-Persona Prompting: https://www.prompthub.us/blog/exploring-multi-persona-prompting-for-better-outputs
- Proxet — Using LLMs to Create Personas: https://www.proxet.com/blog/using-llms-to-create-personas
- OneNorth — Prompt Engineering Insights: https://www.onenorth.com/insights/unlocking-large-language-models-through-thoughtful-prompt-engineering/
🔗 General Guides and Aggregated Resources
Prompt Engineering Guide (Community)
- Main Site: https://www.promptingguide.ai/
- Few-Shot: https://www.promptingguide.ai/techniques/fewshot
- Prompt Chaining: https://www.promptingguide.ai/techniques/prompt_chaining
Learn Prompting