How to Write Proper Prompts for AI or why “Write an article” means nothing


Short version: you’re not asking AI — you’re giving it a task.
Long version: let’s break it down.

After 2 years of working with AI (back when it was much dumber and answered like a drunk Stack Overflow), I learned one simple rule:

Output quality = input quality

AI is not a mind reader. It doesn’t “guess” what you mean. It follows instructions. And the clearer they are, the better the result.

Як правильно писати запити до ШІ, або чому «Напиши статтю» — це ні про що

❌ Bad prompt (classic)

Write an article about HTML




What’s wrong here?
Everything.

  • For whom?

  • For what purpose?

  • Skill level?

  • Style?

  • Length?

AI just shrugs digitally.

A good prompt is a command

You are a frontend developer with 10 years of experience.
Write a beginner-friendly educational article about <!DOCTYPE> in HTML.
Style: lively, based on personal experience.
Language: Russian.
Length: ~400 words.
Add 2 code examples and common mistakes.

Feel the difference?
This is already a technical brief, not a vague request.

What is this called?

Officially — a prompt.
In plain language — a well-formulated instruction.

Universal formula for a perfect prompt

AI ROLE
+
TASK
+
CONTEXT
+
FORMAT
+
CONSTRAINTS

Prompt skeleton

You are [role].
Do: [what needs to be done].
Context: [who it’s for / where it will be used].
Format: [article / list / table / code].
Constraints: [language, style, length, restrictions].

5 examples of good prompts

1. Article

You are an SEO specialist.
Write an article about meta tags for website owners.
Format: article.
Language: English.
Length: 500 words.

2. Code

You are a PHP developer.
Write an email validation function.
Format: code.
PHP 8. No frameworks.

3. Explain simply

You are a teacher.
Explain what DNS is as if to a child.
No technical terms.

4. Editing

You are an experienced editor.
Improve the text below without changing its meaning.
Remove fluff and bureaucratic language.

5. Creative

You are a screenwriter.
Create a short comic about common programmer mistakes.
Humorous, 5 lines.

Common mistakes

  1. ❌ Too vague

  2. ❌ No role defined

  3. ❌ No constraints

  4. ❌ Multiple tasks at once

  5. ❌ Expecting magic

Conclusion

If you want strong answers — think like a task setter.
One good prompt can save hours of revisions.