How to Write a Good Prompt for Specific Actions
Learn how to craft a good prompt to improve the quality of your commands.
Posted by
Mathias MichelRelated reading
How to Use RewriteBar with PopClip
The latest version of Rewritebar now supports PopClip. This means you can now trigger Rewritebar from PopClip.
Getting Started with RewriteBar: Improve your writing
Discover how to set up and start using RewriteBar, the AI-powered writing assistant for macOS that improves your writing across all applications. Boost your productivity with this step-by-step guide.
How to Write a Good Prompt for Specific Actions
Prompts are the foundation of any interaction with AI. Writing a well-crafted prompt can mean the difference between receiving vague, unhelpful responses and getting precise, actionable results. In this guide, we'll explore how to create effective prompts for specific actions, such as title casing, reformatting text, or translating languages. Follow these steps to craft a prompt that delivers the results you need.
1. Start with a Clear Objective
Before writing your prompt, define the goal you want to achieve. Be specific about what you want the AI to do. For example:
Good Objective: "Title case this text according to standard English grammar rules."
Vague Objective: "Fix the capitalization."
Why It Matters:
A clear objective ensures the AI understands the exact task, reducing ambiguity.
2. Break Down the Task into Rules
List any specific guidelines or rules the AI should follow. For example, when asking the AI to title case text, include rules about which words to capitalize and which to leave lowercase:
[Rules]
1. Capitalize the first and last words of the title.
2. Do not capitalize articles ("a", "an", "the").
3. Do not capitalize coordinating conjunctions ("and", "but", "or").
4. Keep prepositions lowercase unless they are the first or last word (see list below).
Why It Matters:
Providing clear, actionable rules ensures the AI adheres to your expectations and avoids errors.
3. Provide Examples
Including examples demonstrates exactly how you want the output to look. Examples help clarify nuanced instructions. For instance:
[Examples]
1. "How to Use AI for Better Productivity"
2. "10 Tips for Working Smarter, Not Harder"
Why It Matters:
Examples eliminate uncertainty, especially when your instructions could be interpreted in multiple ways.
4. Add Constraints or Exclusions
Specify any limitations or things the AI should avoid. For instance:
[Requirements]
- Do not translate the text into another language.
- Preserve all formatting, including line breaks and code blocks.
- Do not change the meaning of the text.
Why It Matters:
Constraints ensure the AI stays within your desired boundaries and doesn’t perform unwanted changes.
5. Use Structured Formatting
Organize your prompt with clear sections, such as "Rules," "Examples," and "Requirements." This helps the AI parse and follow your instructions. For example:
Act as an Expert Copywriter. Title Case the Provided Text According to the Following Rules.
[Rules]
1. Capitalize all words except articles, conjunctions, and prepositions unless they are the first or last word.
2. Always capitalize the first and last word.
[Prepositions to Keep Lowercase]
about, above, across, after, against, along, among, around, at, before, behind, below, beneath, beside, between, beyond, by, despite, down, during, except, for, from, in, inside, into, like, near, of, off, on, onto, out, outside, over, past, regarding, since, through, throughout, to, toward, under, underneath, until, up, upon, with, within, without
[Examples]
1. "How to Write Effective Prompts for AI"
2. "Best Practices for Managing Remote Teams"
[Requirements]
- Do not translate the text.
- Preserve formatting and meaning.
Why It Matters:
Structured formatting improves clarity and ensures that complex prompts are easy to follow.
6. Iterate and Refine
If the AI's response isn't quite right, refine your prompt. Add more rules, clarify ambiguous instructions, or provide additional examples. Here’s how you might improve a prompt:
Initial Prompt: "Make this title look good."
Refined Prompt: "Title case this text. Capitalize the first and last words, and leave prepositions lowercase unless they are the first or last word. Use examples as a guide."
7. Test Your Prompt
Before deploying a prompt widely, test it on a variety of inputs to ensure consistent results. Adjust your instructions based on the AI's performance.
8. Keep It Simple
While it’s essential to include detailed instructions, avoid overwhelming the AI with overly complex language. Keep sentences concise and use straightforward vocabulary.
By following these tips, you’ll be able to craft precise and effective prompts that yield consistent and accurate results. Remember, a well-written prompt saves time, improves productivity, and enhances the quality of your AI interactions.