Skip to Content

Prompt Engineering — How to Write Prompts That Work

Section 3 — Lesson 1

Prompt Engineering — How to Write Prompts That Work

The difference between a mediocre AI response and a brilliant one almost always comes down to the prompt. Learn the six pillars that professionals use to get outstanding results from Claude every single time.

Why Prompt Engineering Matters

Prompt engineering is the skill of crafting inputs that consistently produce the outputs you want from an AI model. It is not about tricking Claude or using magic keywords — it is about communicating clearly. Think of it this way: if you walked into a room and said “write me something about marketing,” you would get a wildly different result than if you said “write a 500-word LinkedIn post targeting SaaS founders about the three biggest content marketing mistakes in 2025, using a conversational but authoritative tone, with a hook in the first sentence and a clear call-to-action at the end.” The same principle applies to AI. The quality of your output is directly proportional to the quality of your input.

Most people who are disappointed with AI results are not dealing with a limitation of the model — they are dealing with a limitation of their prompt. The good news? Prompt engineering is a learnable skill, and the six pillars below will transform your results immediately. These principles work with Claude, ChatGPT, Gemini, and any other large language model, but they are especially effective with Claude because of its strong instruction-following capabilities.

10x
Better results with well-engineered prompts vs. vague ones
6
Core pillars that cover every prompting scenario
80%
Of prompt issues are solved by being more specific

The 6 Pillars of Effective Prompting

1

Be Specific — Vague Inputs = Vague Outputs

The single most important rule in prompt engineering is specificity. Every ambiguous word in your prompt is an opportunity for the model to guess — and guess wrong. Instead of “write something about dogs,” say “write a 300-word informative paragraph about the top three health benefits of owning a dog, citing recent studies, aimed at first-time pet owners.” Specificity removes ambiguity. It tells Claude exactly what you want, how long it should be, who the audience is, and what evidence to include. The more specific your prompt, the fewer revisions you will need. This one pillar alone solves the majority of disappointing AI interactions.

2

Provide Context — Role, Audience, Industry

Context is what transforms a generic answer into a tailored one. Tell Claude who it should act as (“You are a senior financial analyst”), who the audience is (“This is for C-suite executives with no technical background”), and what industry or domain applies (“in the European fintech sector”). Context gives Claude a lens through which to filter its enormous knowledge base. Without context, Claude writes for a generic audience in a generic tone. With context, it writes for your audience in your tone. Think of context as the briefing you would give a new colleague before asking them to write something on your behalf.

3

Define Format — Bullet Points, Table, JSON, Code

Claude can produce output in virtually any format — but only if you ask. Want a comparison? Request a table. Need structured data? Ask for JSON. Want a quick overview? Request bullet points. Building software? Specify the programming language and framework. Format instructions prevent you from getting a 2,000-word essay when you needed a quick bullet list, or a wall of text when a neatly formatted table would have been perfect. Always specify your desired format explicitly: “Present this as a markdown table with columns for Feature, Pro, and Con” or “Return the result as a valid JSON array.”

4

Set Constraints — Word Count, Tone, Language

Constraints are guardrails that keep the output within your requirements. Common constraints include: word or character count (“maximum 200 words”), tone (“professional but approachable”, “casual and witty”), language (“respond in Czech”), reading level (“explain like I am 12”), and exclusions (“do not mention competitor products”, “avoid jargon”). Constraints are especially valuable in professional settings where your output needs to meet specific brand guidelines, compliance requirements, or publishing standards. Without constraints, Claude defaults to a helpful but generic style that may not match what you need.

5

Give Examples — Few-Shot Prompting

Few-shot prompting means including one or two examples of the desired output directly in your prompt. This is one of the most powerful techniques available because it shows Claude exactly what you want instead of just describing it. For example, if you want product descriptions in a specific style, include two sample descriptions and then say “Now write one for this product following the same style.” Claude is exceptionally good at pattern-matching from examples. Even a single example (one-shot) dramatically improves consistency. This technique is indispensable for repetitive tasks like generating catalog entries, formatting data, or writing responses in a branded voice.

6

Think Step by Step — Chain-of-Thought Reasoning

For complex problems involving math, logic, multi-step analysis, or decision-making, adding “think step by step” or “show your reasoning” to your prompt dramatically improves accuracy. This technique, called chain-of-thought (CoT) prompting, encourages Claude to break a hard problem into smaller pieces and solve each one sequentially rather than jumping to a final answer. It is especially useful for tasks like financial calculations, code debugging, strategic planning, and any scenario where the answer depends on multiple intermediate steps. Without CoT, Claude may skip steps and arrive at incorrect conclusions. With it, you can follow its reasoning and catch errors early.

Before and After: Prompt Comparison

The difference between a weak prompt and a strong prompt is dramatic. Here are two real-world examples that demonstrate the transformation:

❌ Weak Prompt
“Write me an email about our new product.”
Result: Generic, unfocused, wrong tone, missing key details
✅ Strong Prompt
“Write a 150-word product launch email for our B2B SaaS customer base. The product is an AI-powered analytics dashboard. Tone: professional, excited but not salesy. Include: one key benefit, a launch date (March 15), and a CTA linking to a demo. Subject line included.”
Result: Targeted, on-brand, correct length, actionable
❌ Weak Prompt
“Help me with my code.”
Result: Claude asks multiple clarifying questions, wasting time
✅ Strong Prompt
“I have a Python FastAPI endpoint that returns a 422 error when I POST JSON with nested objects. Here is my Pydantic model and the request body. Find the type mismatch and fix the model. Show the corrected code only.”
Result: Precise diagnosis, immediate fix, no back-and-forth

Copyable Prompt Template

Use this template as a starting point for any prompt. Fill in the sections that apply to your task and delete the ones that do not. Over time, you will internalize this structure and write effective prompts naturally.

## PROMPT TEMPLATE
Role: You are a [role/expert type].
Task: [Specific action verb] + [what you need].
Context: The audience is [who]. The industry is [what].
Format: Return as [bullet points / table / JSON / code / essay].
Constraints: [word count] words. Tone: [tone]. Language: [lang].
Example: Here is an example of what I want: [paste example].
Reasoning: Think step by step before answering.

Common Prompt Mistakes

Even experienced users fall into these traps. Recognizing them will save you countless revision cycles and frustrating back-and-forth conversations with Claude.

❌ Too Vague
“Write something about AI.” — This gives Claude almost no constraints, so it picks a random angle, length, and tone. You will almost certainly need to start over. Always answer: what specifically, for whom, how long, and in what style.
❌ Too Long and Unfocused
A 500-word prompt that rambles through multiple topics, contradicts itself, and buries the actual request in paragraph four. Claude will try to address everything, producing a muddled response. Keep prompts focused: one clear task per prompt. If you have multiple tasks, break them into separate prompts or number them clearly.
❌ Conflicting Instructions
“Write a comprehensive 5,000-word analysis but keep it brief and under 200 words.” Contradictory instructions force Claude to choose one over the other, and its choice may not be the one you wanted. Review your prompt for contradictions before sending — especially length vs. depth, formal vs. casual, and detailed vs. concise.
❌ Not Iterating
Expecting perfection on the first try and giving up when the result is not ideal. Prompt engineering is iterative by nature. If the first result is 70% right, refine your prompt: add constraints, provide an example, adjust the tone. Most world-class outputs come from two or three prompt iterations, not one.
📚 Lesson Summary
  • Prompt engineering is about clear communication, not magic keywords — quality in = quality out
  • The 6 pillars: Be Specific, Provide Context, Define Format, Set Constraints, Give Examples, Think Step by Step
  • Few-shot prompting (including 1–2 examples) is the most powerful technique for consistent results
  • Chain-of-thought (“think step by step”) dramatically improves accuracy for complex reasoning tasks
  • Use the prompt template as a starting point: Role, Task, Context, Format, Constraints, Example, Reasoning
  • Avoid common mistakes: too vague, too long, conflicting instructions, and not iterating on results

Komplexní průvodce prompt engineeringem — šest pilířů, které přemění vágní interakce s AI na přesné a kvalitní výstupy pokaždé.

Rating
0 0

There are no comments for now.

to be the first to leave a comment.