Effective communication with AI is an art. A well-crafted prompt can be the difference between a generic, unhelpful response and a precise, insightful solution. This guide provides best practices for designing prompts that deliver optimal results.
Ask a direct question without providing any examples. This works best for simple tasks where the AI already has sufficient training data.
Example:
"Summarize the key benefits of using a component-based architecture in web development."
Provide a few examples of the input and desired output to guide the AI's response. This is highly effective for tasks requiring a specific format or style.
Example:
"Translate the following English sentences to French:
English: Hello, how are you?
French: Bonjour, comment ça va?
English: I need to buy some groceries.
French: Je dois faire des courses.
English: What time is it?
French: "
Encourage the AI to break down a problem and "think" step-by-step before giving the final answer. This is useful for complex reasoning and multi-step problems.
Example:
"Q: A farmer has 15 cows. He sells all but 9 of them. How many cows does he have left?
A: The question is a bit of a riddle. The phrase "all but 9" means that 9 cows are the ones that were not sold. So, the farmer has 9 cows left.
Q: There are 3 birds on a wire. 2 of them decide to fly away. How many are left?
A: Let's think step by step. The birds 'deciding' to fly away doesn't mean they have flown away yet. So all 3 are still on the wire. The answer is 3."
<tag>), or dashes to clearly separate different parts of your prompt.write tests first, then the code, then run the tests and update the code until tests pass
i have got some build errors, run 'pnpm build' to see the errors, and then fix them, and then run build until build passes
claude --dangerously-skip-permissions