GIVEN-THEN: The right way to start every prompt
The GIVEN-THEN framework is your key to unlocking more accurate prompts that achieve more complex goals.
Starting a new prompt, especially with a more basic task, can feel aimless at times. Where do you start? What are you asking for? What does AI need to know?
A structured approach to building prompts makes all the difference, not only in crafting clear and effective prompts, but in allowing you to tackle more complex tasks through prompting.
One such approach (and the one I’ve started using the most) is the GIVEN-THEN framework. In it, I’ve actually found a simple and powerful tool when designing a prompt for ChatGPT, Claude, Copilot, etc. To give a crude example:
GIVEN the content of this blog post
THEN write me a comprehensive summary of this post AND return the list of all prompts provided within the blog
Let’s dig in.
About the GIVEN-THEN Framework
The GIVEN-THEN framework has strong roots in software testing, but it’s really just logic that gives us the structure for developing any prompt. At it most basic, it has a small handful of statements, but the three most important for us are:
GIVEN: The conditions (or context, as you’ll hear me call it). Think of it as setting the stage—what information do you have to provide?
THEN: The action or outcome you’re seeking. What are the conditions to be met (both in creation and formatting)?
AND: Used to add multiple conditions or actions (“GIVEN this AND that”), making the prompt more detailed and specific
These statements are the logical building blocks of every single prompt. And understanding this will lead to more accurate prompts around more complex goals. Or as you might also call it, time savings.
The GIVEN-THEN framework has its roots in Gherkin, most commonly used to ensure the thoroughness of software testing scenarios. Don’t let the tech jargon scare you: for our purposes, a prompt is akin to a software test.
An example: Outline my presidential tax plan
For any effective prompt, we need a goal. We’ll choose a topical (and dare I say ambitious) one. Let’s say my overall goal is: "I am a presidential candidate who wants to outline my tax plan so I can share it with the American people.”
We will use the GIVEN-THEN framework to structure our prompt. Note: At the end of these steps, we won’t have our final prompt, but we will know everything we need to about:
The best context to provide in our prompt
The output of what we want delivered back (and in the format we want it provided)
Step 1: Define the GIVEN
First, what are the existing conditions (aka, the context you can provide)? There can be a lot of things (and identifying all of them is where this framework can help too).
For our tax plan, the GIVEN will be:
GIVEN Five- and ten-year economic statistics AND the current sentiment of the stock market AND financial statistics about the middle and lower classes AND the provided rules for creating a tax plan
Other things you might pass: personal economic principles, broader economic trends, global outlooks, and market or risk analysis. This is where you’d make use of a subject matter expert.
Step 2: Specify the THEN
Next, determine the outcome. What do you need the AI to produce?
For our tax plan, the THEN will be:
THEN Create the outline of a tax plan that aligns with economic principles AND addresses current financial challenges AND ensure it follows all of the provided rules AND format it to so I can paste it into a Word (.docx) document
Step 3: Put them together
Now, when you put these two together you have:
GIVEN Five- and ten-year economic statistics AND the current sentiment of the stock market AND financial statistics about the middle and lower classes AND rules for creating a tax plan
THEN Create the outline of a tax plan that aligns with economic principles AND addresses current financial challenges AND ensure it follows all of the provided rules AND format it to so I can paste it into a Word (.docx) document”
In other words, you have the skeleton of your prompt, and one that’s going to help AI deliver output that is best tailored for your goal. Whether you're tackling a tax plan or any other project, the GIVEN-THEN framework gives you a large leg up on creating powerhouse prompts.
Keep reading to dive into some sub-prompts that will help us achieve our goal.
Sub-prompts
Sub-prompts are prompts you can use BEFORE your prompt. They’re aimed to increase the efficacy of every prompt that comes after.
Whenever possible, I like to include sub-prompts that can be useful in support of a bigger picture prompt (like our tax plan one above). In the spirit of this article, I’ll include them in the GIVEN-THEN format.
Sub-prompt 1: Develop a framework for a tax plan
GIVEN Examples of previous tax plans AND categories of content a tax plan includes AND a list of items that make a successful tax plan
THEN Provide an outline of a tax plan that I can copy/paste into a Word document AND provide 5-10 steps I need to take to complete the tax plan AND provide a GPT prompt I can use to complete each of the steps
Sub-prompt 2: Provide a list of economics statistics to use in a tax plan
GIVEN Five- and ten-year economic statistics AND the current sentiment about the US economic AND a list of financial statistics commonly used in macroeconomics
THEN Provide a list of statistics I should make use of within my tax plan AND order that list by the most impactful to least impactful statistics
Sub-prompt 3: Self-critique your tax plan as {person/job}
GIVEN The current state of the market AND the outline of my tax plan (or part of it) AND the economic philosophy of a {person/job}
THEN Provide a critique of the plan as if delivered by {person/job}
Gherkin syntax for AI?
Love it.
https://cucumber.io/docs/gherkin/