AI Prompt Universal Formula: Write High-Quality Prompts in 4 Steps
I have been using AI tools for over two years now, and the biggest lesson is this: the quality of your prompt directly determines the quality of the output.
It sounds obvious, but most people still write prompts like "help me write a plan" or "summarize this article for me" — then blame the AI when the result misses the mark. In reality, the problem is not the AI being dumb. The problem is you being unclear.
This article shares a universal formula I have been using for a long time. It is not some advanced theory. Just four building blocks. Every time you include all four in your prompt, the output quality improves immediately.
The Four Building Blocks
The formula is simple: precise role positioning plus clear task requirements plus fixed output specifications plus explicit constraints.
Sounds easy? Let me break it down.
The first block is role positioning. Do not say "you are an expert." Say "you are a senior copywriter specializing in maternal and baby products on Xiaohongshu." The more specific the role, the more precisely the AI calibrates its knowledge and tone. When you say "help me write copy," the AI has no idea what style you want. When you say "you are a maternal brand copywriter with a warm, friendly tone," it immediately knows how to speak.
The second block is task requirements. The key is breaking things down into concrete actions instead of vague descriptions. "Write a good piece of copy" — what does "good" even mean? "Write a promotional copy for a 304 stainless steel portable thermos, highlighting three selling points: 8-hour heat retention, lightweight design, and macaron color options" — now that is clear.
The third block is output specification. Tell the AI exactly what format you want: bullet points, tables, markdown, conversational style, word count range. Without this, the AI defaults to what it thinks is most appropriate, which is almost never what you have in mind.
The fourth block is constraints. Define the boundaries: word limit, style requirements, things to avoid. For example, "within 150 words, conversational tone, no jargon, no exaggerated claims." The tighter the constraints, the less the AI wanders off.
Four Engineering Methods
Knowing the formula is not enough. These four methods make it work even better.
Method one: anchor the role precisely. Do not write "help me write." Write "as a senior expert in XX field." The role itself carries a built-in perspective and depth of knowledge.
Method two: describe tasks concretely. Replace vague words with specific actions and deliverables. "Write a good copy" becomes "write a promotional copy for XX product in XX scenario, highlighting XX selling points."
Method three: define the output format strongly. Give a template, even if it is only half-filled. AI is exceptionally good at filling in content to match a given format.
Method four: make constraints explicit. State the hard boundaries upfront. It is always easier to set boundaries first than to fix violations afterward.
Four Scenario Comparisons
Theory without practice is useless. Here are four high-frequency scenarios comparing plain prompts against formula-optimized prompts.
Scenario one: weekly report.
Plain version: "help me write a work weekly report." The result will be generic because the AI has no idea what you did this week, what format to use, or who will read it.
Optimized version: "You are an internet operations specialist. Summarize this week's new media operations report. It must include three sections: completed work, pending items, and problems with solutions. Output in bullet points, each section within 50 words. Use specific numbers, no vague language."
The difference is night and day.
Scenario two: Xiaohongshu product post.
Plain version: "write a Xiaohongshu post about a thermos." The result will read like generic AI-generated content.
Optimized version: "You are a Xiaohongshu viral copywriter. Write a promotional post for a 304 stainless steel portable thermos, highlighting three selling points: 8-hour heat retention, lightweight and compact, and macaron color options. Output in Xiaohongshu note format (title, body, hashtags), body within 150 words, conversational tone, relatable, not a hard sell."
Anyone who has used both versions knows the gap in quality.
Scenario three: Python code.
Plain version: "write Python code to filter data." The result might lack comments, omit dependency declarations, and use libraries you do not have.
Optimized version: "You are a junior Python developer. Write code to filter Excel data, keeping rows where sales are greater than 1000 and saving them to a new Excel file using pandas. Add detailed comments. Output in two sections: code and usage instructions. In the instructions, list required dependencies. Compatible with Python 3.8 and above."
Code written with this kind of prompt saves ten times the debugging time compared to writing the prompt itself.
Scenario four: math problem explanation.
Plain version: "explain this math problem." The AI might give you a solution that uses concepts beyond the student's level.
Optimized version: "You are a senior middle school math teacher. Explain how to solve 'x squared minus 5x plus 6 equals 0.' Include three parts: solution approach, step-by-step breakdown, and key concept summary. Output in numbered bullet points. Each step comes with a plain-language explanation. Do not use terms beyond the student's grade level. Suitable for a seventh grader."
An Easy-to-Miss Detail
Here is a counter-intuitive principle for writing prompts: only tell the AI what it does not already know.
When asking AI to write Python code, you do not need to explain Python syntax. The AI knows better than you. What you need to tell it is where your data is, what your filter conditions are, where to save the output, what version your environment runs — things the AI cannot possibly figure out on its own.
Once you internalize this principle, your prompts actually get shorter, but the results get much better.
Wrapping Up
The universal formula is not meant to turn every prompt into a long essay. With practice, you run through these four building blocks in a few seconds. Sometimes you write them down, sometimes you just keep them in mind.
My own experience: spending 30 seconds on a good prompt saves 10 minutes of revision later. That math works out every single time.
Adapting the Formula for Different AI Models
The universal formula works across all major models, but optimal implementation varies. For GPT-4, models respond well to detailed, structured prompts. Use the full formula with explicit formatting. They handle complex multi-step instructions reliably. For Claude, slightly less formal prompts work well. Write more like you are talking to a colleague. Claude is particularly good at following negative constraints. For Gemini, consider including reference images as part of your prompt. They handle code-related tasks well. For open-source models like Llama and Mistral, shorter, more focused prompts with clear delimiters work best. Use explicit formatting markers to separate parts. For specialized models, follow their domain-specific prompt conventions. Code models benefit from file path and context. Math models benefit from explicit reasoning instructions.
Cross-Domain Adaptation
Creative writing: emphasize voice tone emotional arc. Code generation: specify language framework constraints. Translation: clarify target audience and register. Master context-task-constraints-format once for any domain.
Advanced Patterns
Layer formula instances for multi-stage projects building outputs progressively. Save effective formulas as reusable templates for recurring project types. Track variations producing best results for continuous improvement.
Advanced Techniques for Power Users
Layer multiple formula instances together for complex multi-stage projects where each output builds on previous results. Create constraint layers that enforce consistent style, formatting, or voice requirements across an entire project or document. Build a personal library of proven formula templates for recurring task types you encounter regularly in your work. Review and refine your templates monthly to incorporate lessons learned from recent projects and evolving AI capabilities.
Meta-Patterns for Complex Tasks
Chain multiple context sections progressively for projects where earlier stages inform later reasoning and outputs. Use explicit output format specifications to ensure consistent structure across all generated content pieces. Test formula variations systematically to identify which specific phrasing produces the best results for different categories of tasks. Track your results in a spreadsheet or prompt management tool to build institutional knowledge over time.
Power User Patterns
Layer formula instances for multi-stage projects building outputs progressively over time. Save effective formulas as reusable templates for recurring project types you complete regularly.
The Universal Prompt Formula
After analyzing thousands of effective prompts, one pattern emerges consistently:
[Context] + [Role] + [Task] + [Constraints] + [Output Format]
Context provides background information the AI needs to know. Role defines who the AI should act as. Task specifies exactly what the AI should do. Constraints set limitations or things to avoid. Output Format structures how the response should be presented.
When to Deviate from the Formula
While this formula works for 80% of use cases, sometimes breaking the pattern is better: Creative tasks benefit from less structure to encourage novel outputs. Exploratory tasks work well with open-ended prompts that encourage diverse responses. Personal tasks suit conversational prompts that feel more natural. Expert users prefer minimal prompts that assume domain knowledge.
Testing Your Prompts
Always test prompts with edge cases (empty input, very long input), different phrasings of the same request, adversarial inputs designed to confuse the model, and multiple AI models for consistency checking.