Metaprompt
Metaprompt
Welcome to the Metaprompt! This is a prompt engineering tool designed to solve the "blank page problem" and give you a starting point for iteration. All you need to do is enter your task, and optionally the names of the variables you'd like Claude to use in the template. Then you'll be able to run the prompt that comes out on any examples you like.
Caveats
- This is designed for single-turn question/response prompts, not multiturn.
- The prompt you'll get at the end is not guaranteed to be optimal by any means, so don't be afraid to change it!
Using This Notebook
The notebook is designed to be maximally easy to use. You don't have to write any code. Just follow these steps:
- Enter your Claude API key in between quotation marks where it says "Put your API key here!"
- Enter your task where it says "Replace with your task!"
- Optionally, enter an all-caps list of variables in quotes separated by commas where it says "specify the input variables you want Claude to use".
Then, you can simply click "Runtime -> Run all" and your prompt will be displayed at the bottom of the notebook.
Table of Contents
- The Metaprompt
- Quickstart - Enter a task, get a prompt template
- Testing your prompt template
0. The Metaprompt
The Metaprompt is a long multi-shot prompt filled with half a dozen examples of good prompts for solving various tasks. These examples help Claude to write a good prompt for your task. The full text is below (warning: it's long!)
1. Quickstart
Enter your task in the cell below. Here are some examples for inspiration:
- Choose an item from a menu for me given user preferences
- Rate a resume according to a rubric
- Explain a complex scientific concept in simple terms
- Draft an email responding to a customer complaint
- Design a marketing strategy for launching a new product
There are two examples of tasks + optional variables below.
{CUSTOMER_EMAIL}
{COMPANY_NAME}
Next, we'll insert your task into the metaprompt and see what Claude gives us! Expect this to take 20-30 seconds because the Metaprompt is so long.
If you want to see the full text returned by the Metaprompt to see how it planned things out, uncomment out the "pretty_print(message)" line below.
Now, we'll extract the prompt itself and the variables needed, while also removing empty tags at the end of the prompt template.
Below: the variables Claude chose (if you didn't provide any; if you did, these should just be the same ones you provided), and the prompt it wrote.
Variables:
{'$CUSTOMER_EMAIL', '$COMPANY_NAME'}
************************
Prompt:
You will be drafting a professional email response to a customer complaint for {$COMPANY_NAME}. Here
is the customer's email:
<customer_email>
{$CUSTOMER_EMAIL}
</customer_email>
Follow these guidelines when drafting your response:
1. Tone and Style:
- Begin with a courteous greeting
- Maintain a professional, empathetic tone throughout
- Avoid defensive language
- Be concise but thorough
- End with a constructive closing
2. Content Structure:
- Acknowledge the customer's concerns specifically
- Apologize sincerely for any inconvenience
- Explain what actions will be taken (if applicable)
- Provide a clear next step or resolution
- Include contact information for follow-up
3. Important Rules:
- Never make promises that aren't explicitly authorized
- Don't assign blame to any parties
- Focus on solutions rather than problems
- Maintain brand professionalism
Here are examples of good and bad responses:
<good_example>
Dear Mr. Smith,
Thank you for bringing this matter to our attention. I sincerely apologize for the inconvenience you
experienced with your recent order. I understand how frustrating this situation must be.
I have looked into this issue and am taking immediate steps to resolve it. Here's what we will do:
[specific action].
Please let me know if you have any questions. You can reach me directly at [contact information].
Best regards,
[Name]
</good_example>
<bad_example>
Hi,
Sorry about what happened. The shipping department made a mistake. This usually doesn't happen.
We'll try to fix it.
Thanks
</bad_example>
Write your response inside <email_response> tags. Before drafting the response, analyze the
customer's concerns and plan your approach in <scratchpad> tags.
Remember to:
- Address all specific points raised in the complaint
- Keep the tone professional but warm
- Provide specific, actionable solutions
- End with a clear path forward
2. Testing your prompt template
If you like your prompt, try it out! The cell will prompt you to add values for each variable. Then, it will be sent to Claude and you'll see Claude's final output.
Enter value for variable: $CUSTOMER_EMAIL Enter value for variable: $COMPANY_NAME Claude's output on your prompt: <scratchpad> The customer's email indicates that they encountered an issue with their recent order from TestCompany. They express frustration with the delivery delay and lack of communication. To address this, the response should: - Acknowledge the customer's concerns and apologize sincerely for the inconvenience - Explain the steps being taken to resolve the issue - Provide a clear next step or resolution - Offer a direct point of contact for any follow-up </scratchpad> <email_response> Dear [Customer], Thank you for reaching out to us regarding your recent order with TestCompany. I sincerely apologize for the frustration and inconvenience you have experienced. I have thoroughly reviewed the details of your order and can understand your concern about the delayed delivery. As our valued customer, you deserve the best possible service, and we regret that we have fallen short in this instance. Please be assured that I am taking immediate action to expedite the delivery of your order. I have coordinated with our shipping team, and they have confirmed that your package will be delivered to you by [date]. Additionally, to make up for the delay, we will be providing you with a [10%] discount on your next purchase. If you have any further questions or concerns, please do not hesitate to contact me directly at [email] or [phone number]. I am here to ensure that your experience with TestCompany is a positive one. Thank you for your patience and understanding. We value your business and look forward to serving you better in the future. Best regards, [Your Name] [Your Title] TestCompany </email_response>