## Premade
- [Storytelling sidekick](https://docs.anthropic.com/en/prompt-library/storytelling-sidekick)
- [Meeting scribe](https://docs.anthropic.com/en/prompt-library/meeting-scribe)
- [Socratic sage](https://docs.anthropic.com/en/prompt-library/socratic-sage)
- [Adaptive editor](https://docs.anthropic.com/en/prompt-library/adaptive-editor)
## Tips
### List
- From https://www.vellum.ai/blog/prompt-engineering-tips-for-claude
- Also see [[Prompt Engineering]]
````
- What the task results will be used for
- What audience the output is meant for
- What workflow the task is a part of, and where this task belongs in that workflow
- The end goal of the task, or what a successful task completion looks like
## 1\. Use XML tags to separate instructions from context
The Claude models have been fine-tuned to pay special attention to the structure created by XML tags, and it won’t follow any random indicators like GPT does. It’s important to use these tags to separate instructions, examples, questions, context, and input data as needed.
For example you can add text tags to wrap the input:
```
Summarize the main ideas from a provided text.
<span><text></span> {input input here} <span></text></span>
```
You can use any names you like for these tags; there are no specific or exclusive names required. What's important is the format. Just make sure to include **_<>_** and **_</>_** , and it will work fine!
## 2\. Be direct, concise and as specific as possible
This is equally important for every large model.
You’ll need to clearly state what the model should do rather than what it should avoid. Using affirmatives like “do” instead of “don’t” will give you better results.
Provide Claude with detailed context and clearly specify which tag to use to find this information.
Here’s how we can improve the above prompt:
```
Summarize the main ideas from the <span> provided article text within the <text> tags</span>.
<text> {input input here} </text>
```
## 3\. Help Claude with the output
The biggest problem with generally all Claude models is that it tends to be very chatty in its answers. It will always start with a sentence or two prior to providing the answer, despite being instructed in the prompt to follow a specific format.
To mitigate this, you can use the **_`Assistant`_** message to provide the beginning of the output. This technique will ensure Claude always begins its answer the same way.
Here’s how that prompt will look like if we want Claude to follow a specific format:
```
Summarize the main ideas from the provided article text within the <text> tags, <span>and only output the main conclusions in a 4 bulleted list. Follow the format provided below:
<format>
→ idea 1
→ idea 2
→ idea 3
</format></span>
<text> {input input here} </text>
```
## 4\. Assign a role
Always assign a role. If you’re building an AI-powered writing tool, start your prompt with “You’re a content writer…”, or better yet "You're the best content writer in the world!". Using the previous technique of putting the first token in the Assistant’s response, you can also force Claude to stay in character.
For example:
```
<span>You’re Jack, the best content writer in the world.</span> Summarize the main ideas from the provided article text within the <text> tags, and only output the main conclusions in a 4 bulleted list. Follow the format provided below:
<format>
→ idea 1
→ idea 2
→ idea 3
</format>
<text> {input input here} </text>
```
```
Assistant: <span>[Jack, the best content writer in the world] →</span>
```
## 5\. Give Claude time to think
There are some cases when it can be beneficial to explicitly instruct Claude to generate extra text where it reasons through the problem. To achieve this, you can instruct Claude to first "think through the problem" and then provide the answer. You can request that Claude outputs this process with two separate XML tags: one for the "thinking" part and another for the "answer.", like in the prompt below:
```
You’re Jack, the best content writer in the world. Summarize the main ideas from the provided article text within the <text> tags, and only output the main conclusions in a 4 bulleted list. Follow the format provided below:
<format>
→ idea 1
→ idea 2
→ idea 3
</format>
<span>When you generate the answer, first think how the output should be structured and add your answer in <thinking></thinking> tags. This is a space for you to write down relevant content and will not be shown to the user. Once you are done thinking, answer the question. Put your answer inside <answer></answer> XML tags.
</span>
<text> {input input here} </text>
```
Here’s what the model will output if we provide some text about Biochemistry (the prompt was cut down to highlight the format of the output):
```
You’re Jack, the best content writer in the world. Summarize the main ideas from the provided article text within the <text> tags, and only output the main conclusions in a 4 bulleted list. Follow the format provided below:
<format>
→ idea 1
→ idea 2
→ idea 3
</format>
Assistant:
<span><thinking></span>
Here are the 4 key ideas I would summarize from the text:
1. Biochemistry explores chemical processes in living organisms by….
<span></thinking></span>
<span><answer></span>
→ Biochemistry explores chemical processes…
→ It plays a vital role in health and medicine…
<span></answer></span>
```
Notice that the <answer> text doesn’t start with an arbitrary sentence, so you’ll always get the expected output format in this tag. You could easily apply some data manipulation, and cut the "thinking" tags, and extract the answer.
## 6\. Provide Examples
[Few-shot prompting](https://www.vellum.ai/blog/zero-shot-vs-few-shot-prompting-a-guide-with-examples) is probably the most effective way to get Claude to give very good answers. Including a couple of examples that might generalize well for your use case, can have high impact on the quality of the answers. The more examples you add the better the response will be, but at the cost of higher latency and tokens.
```
You’re Jack, the best content writer in the world. Summarize the main ideas from the provided article text within the <text> tags, and only output the main conclusions in a 4 bulleted list. Follow the format provided below:
<format>
→ idea 1
→ idea 2
→ idea 3
</format>
<span>
Here is an example on how to respond in a standard interaction:
<example>
{input examples here}
</example>
</span>
<text> {input input here} </text>
```
## 7\. Let Claude say "I don't know"
To prevent hallucinations just add the phrase shown in the prompt below
```
Answer the following question only if you know the answer or can make a well-informed guess; otherwise tell me you don't know it.
```
## 8\. Long documents before instructions
If you’re dealing with longer documents, always ask your question at the end of the prompt. For very long prompts Claude gives accent to the end of your prompt, so you need to add important instructions at the end. This is extremely [important](https://docs.anthropic.com/claude/docs/claude-2p1-guide#prompting-techniques-for-claude-21) for Claude 2.1.
```
<span>
<doc>
{input document here}
</doc>
</span>
You’re Jack, the best content writer in the world. Summarize the main ideas from the provided article text within the <text> tags, and only output the main conclusions in a 4 bulleted list. Follow the format provided below:
```
## 9\. Think step by step
You can significantly improve the accuracy, by adding the phrase “Think step by step” that will force Claude to think step by step, and follow intermediate steps to arrive to the final answer. This is called zero-shot chain of thought prompting and we wrote more on that in this [blog post.](https://www.vellum.ai/blog/chain-of-thought-prompting-cot-everything-you-need-to-know)
## 10\. Break complex tasks into steps
Claude might perform poorly at complex tasks that are composed of several subtasks. If you know who those subtasks are, you can help Claude by providing a step by step instructions. Something like:
```
You’re Jack, the best content writer in the world. Summarize the main ideas from the provided article text within the <text> tags, and only output the main conclusions in a 4 bulleted list. Follow the format provided below:
<text> {input input here} </text>
<span>
Please follow this steps:
1. Write a one paragraph summary for {{text}}
2. Write 4 bulleted list with the main conclusions for {{text}}
</span>
```
## 11\. Prompt Chaining
If you can’t get reliable results by breaking the prompt into subtasks, you can split the tasks in different prompts. This is called prompt chaining, and is very useful at troubleshooting specific steps in your prompts.
## 12\. Look for Relevant Sentences First
All Claude models can recall information very good across their 200K context window (they passed the "Needle in a Haystack" test with 95% accuracy). But, the models can be reluctant to answer questions based on an individual sentence in a document, especially if that sentence has been injected or is out of place.
To fix this, you can add start the **_`Assistant`_** message with "**_Here is the most relevant sentence in the context:”_** _,_ instructing Claude to begin its output with that sentence. This prompt instruction [achieves](https://www.aanthropic.com/news/claude-2-1-prompting) **near complete fidelity throughout Claude 2.1’s 200K context window**.
```
Assistant: <span>Here is the most relevant sentence in the context:</span>
```
````
## Creativity
```
Suggest 20 metaphors to describe the benefits of [Insert product/service], make them short no more than 6 words and use friendly tone and must include novelty.
Product: [Insert here]
```
## Better decision making
```
Identify cognitive biases that may be impacting the decision-making process concerning [decision/problem] and propose strategies to reduce or mitigate their influence.
Decision = [Insert Here]
```
## Content strategy
### Ideas
```
Generate ideas for influencer marketing campaign for [product] to attarct customers and decrease cost per click.
Product = [Insert Here]
```
## Marketing
### Picture Promise Prove Push
```
Create an email marketing campaign using the "Picture-Promise-Prove-Push" framework to get attention and create desire for [product/service] in [target audience].
Product = [Insert Here]
Target Audience = [Insert Here]
```
### Emotional Appeal
```
Write a marketing campaign outline that uses [emotional appeal] to persuade [ideal customers] to take action and purchase [product/service]. For every section in the campaign give step-by-step instructions.
Emotional appeal = [Insert Here]
Ideal customers = [Insert Here]
Product = [Insert Here]
```
### AIDA
```
Write an AIDA for the following product:
Product: [describe your product]
```
## Learning
### Breaking down a paragraph
```
Understand the concepts in [text], explain the topics individually, and also explain the whole concept in [text] at the end, like I am an 11-year-old.
Text = [Insert Here]
```
## Writing
### Replicate style
```
Act as a tone analyzer. Analyze the writing style and tone of [extract]. Create a description of that text's style and tone that can be used to recreate more text in that style. You are not to take any context or information from the "extract" below. The extract shared in this prompt is PURELY for tone analysis purposes.
Example: The author's writing style in this text is concise, informative and uses a journalistic tone. They maintain a smooth flow throughout the text. They use precise and clear language.
Format: Bullet pointed list
Extract = [Insert Here]
Using the analyzed tone, rewrite [text].
Text = [Insert Here]
```
### Changing style
```
There are 4 types of primary writing styles: 1.Essay Writing, 2. Descriptive Writing, 3.Narrative Writing, 4. Persuasive Writing.
Understand the context in [text] and convert [text] into [writing style]. Use the techniques, concepts that are used in [writing style] and apply them to the topics to get most out of [text]. Make sure the converted text is unique and interesting.
Text = [Insert Here]
Writing style = [Insert Here]
```
### Writing Expert
```
Act as an expert editor with several years of experience. Please provide a bullet point list of errors in spelling, punctuation, and grammar. Provide some general thoughts on style and structure. Then, ask for any elaborations or ask me to get you to suggest further useful prompts.
```
### Proofreading
```
I want you to act as a proofreader and writer. I'll provide you with an extract.
Proofread for grammatical errors and ensure it is written clearly.
Phrases that can be written more clearly should be done so. Write the extract with the relevant changes and share a list of improvements made.
Extract: "[Insert extract]"
```
### Copy style
```
[Insert Text]
Analyze the writing style and write about [your topic] as the above author would write.
```