← Anyone Can Code
Asaf Avigal

Lesson 3

The Art of Prompting

How to get the best results from any AI tool

Press to navigate

Same AI, Wildly Different Results

The difference isn't the tool. It's how you ask.

Vague prompt

"Make this better."

Result: Generic, unhelpful changes

Specific prompt

"Rewrite this email to be more concise, keep a friendly tone, and end with a clear call to action."

Result: Exactly what you wanted

The Prompting Spectrum

Vague
"Help me with this" AI guesses everything
Specific
"Write a summary of this report" AI has direction
Expert
"Summarize this Q4 report for the board, focusing on revenue growth, in 5 bullets" AI delivers exactly

You don't need to be an expert on day one. Moving from vague to specific gets you 80% of the improvement.

What We'll Cover

1

Anatomy

The 4 pillars of a good prompt

2

Patterns

Proven techniques that work

3

Mistakes

What goes wrong and how to avoid it

4

Reviewing

Working with AI output

5

Context

Giving AI what it needs

6

Templates

Reusable prompts for common tasks

Anatomy

The 4 Pillars of a Good Prompt

1. Task

What do you want?
Be specific about the action.

2. Context

What's the background?
Give relevant info the AI needs.

3. Constraints

What are the boundaries?
Length, format, tone, what to avoid.

4. Format

How should it respond?
Bullets, table, email, step-by-step.

Anatomy

Pillar 1: Task

Be specific about what you want the AI to do.

Vague

Help me with this email.

Specific

Write a professional email declining a meeting invitation. Keep the tone friendly and suggest rescheduling next week.
Anatomy

Pillar 2: Context

Context transforms results. Tell the AI what it needs to know.

No context

Summarize this report.

Rich context

Summarize this Q4 earnings report for a board presentation. Focus on revenue growth and highlight any metrics that changed more than 10% from Q3.
Anatomy

Pillar 3: Constraints

Set boundaries so the AI stays on track.

  • Keep it under 200 words
  • Use bullet points, not paragraphs
  • Write at a 10th-grade reading level
  • Don't include technical jargon
  • Only use information from the provided document

Constraints aren't limiting, they're focusing. The more specific your boundaries, the more useful the output.

Anatomy

Pillar 4: Format

Tell the AI how to structure its response.

Table

Compare options side by side

Bullet list

Quick scannable points

Email

Ready to send format

Step-by-step

Ordered instructions

Pros/cons

Decision support

Code

Ready to use snippets

Anatomy

Putting It All Together

Before

Help me write something about our product.

After: All 4 Pillars

[Task] Write a product announcement email
[Context] for our new project management tool launching next month, targeting small business owners
[Constraints] Keep it under 150 words, enthusiastic but professional tone, no jargon
[Format] Subject line + body with 3 bullet points of key features + CTA
Anatomy

The One-Sentence Test

If your prompt could mean 10 different things, it will. Be specific enough that two different people would interpret it the same way.

Before sending a prompt, ask yourself: Would someone else reading this produce the same result? If not, add more detail.

Patterns

Patterns That Work

Proven techniques for better AI results

Patterns

Pattern 1: Role Prompting

Assign the AI an expertise to shape its perspective and vocabulary.

The Pattern

Act as a [role] with expertise in [area]...

Examples

  • Act as a senior editor reviewing my blog post
  • You are a financial advisor explaining retirement options
  • Act as a project manager creating a timeline
Patterns

Pattern 2: Step-by-Step

Break complex tasks into numbered steps for thorough results.

Analyze this business proposal:
1. First, summarize the key points
2. Then, identify the strengths
3. Next, list potential risks
4. Finally, give your recommendation with reasoning

This works because it forces the AI to think through each part instead of jumping to a conclusion.

Patterns

Pattern 3: Examples (Few-Shot)

Show the AI what you want by giving examples of input → output.

Convert these to professional subject lines:

Casual: 'Hey, about that thing we discussed'
Professional: 'Follow-up: Q4 Budget Discussion'

Casual: 'Quick question about the project'
Professional: 'Request for Clarification: Project Timeline'

Casual: 'Running late to the meeting'
Professional: ???
Patterns

Pattern 4: Chain of Thought

Ask the AI to show its reasoning. Best for complex analysis, math, and decisions.

Without

"Should we expand to the European market?"

→ "Yes, Europe is a great market."

With

"Should we expand to the European market? Think through this step by step, considering costs, competition, regulations, and timeline."

→ Detailed analysis

Patterns

Pattern 5: Constraints & Guardrails

Tell the AI what NOT to do. Boundaries prevent unwanted output.

  • Do NOT include pricing (we haven't finalized it)
  • Only use information from the provided document
  • If you're unsure about a fact, say so rather than guessing
  • Don't use buzzwords like 'synergy' or 'leverage'
  • Stay under 500 words
Patterns

Pattern 6: Iteration

Don't expect perfection on attempt one. The conversation IS the tool.

First prompt
Review output
Refine request
Better result

Iteration examples: "This is close but make it more casual" / "Good, now add a section about pricing" / "Shorten the intro and expand the conclusion"

Patterns

Pattern 7: Reusable Templates

Create fill-in-the-blank templates for tasks you do often.

Write a [type] email to [recipient].
Context: [background]
Tone: [formal/casual/diplomatic]
Key points to include: [points]
Length: [short/medium/long]
End with: [call to action]

Save templates like this and fill in the blanks each time. Consistency + speed.

Patterns

Pattern Comparison

Pattern Best For Key Phrase
Role PromptingSpecialized expertise"Act as a..."
Step-by-StepComplex multi-part tasks"First... then... finally..."
Few-ShotConsistent formatting"Here's an example..."
Chain of ThoughtAnalysis & decisions"Think step by step..."
ConstraintsPreventing unwanted output"Do NOT..."
IterationRefining results"This is close but..."
TemplatesRepeated tasks"[Fill in the blank]"
Patterns

Combining Patterns

The real power comes from combining multiple patterns.

[Role] Act as a senior marketing strategist.

[Step-by-step] Analyze our Q4 campaign results:
1. Summarize performance across channels
2. Identify the top 3 performing campaigns
3. Explain why they worked
4. Recommend changes for Q1

[Constraints] Keep each section under 100 words.
Use data from the attached report only.
Don't suggest increasing the budget.

[Format] Use headers and bullet points.
Mistakes

What Goes Wrong

Common prompting mistakes and how to avoid them

Mistakes

Mistake 1: Too Vague

The Mistake

"Make this better."
"Help me with my project."
"Write something about marketing."

The AI has to guess your intent, audience, format, and quality bar.

The Fix

"Rewrite this paragraph to be more concise and professional. Target audience is C-level executives. Keep the same key message."

Specific = predictable results.

Mistakes

Mistake 2: Too Much at Once

The Mistake

Dumping 10 tasks in one prompt. "Write the report AND make a presentation AND draft the email AND create a spreadsheet AND..."

The Fix

One task at a time. Build up. "First, let's write the report. [After reviewing] Great, now let's turn the key findings into a 5-slide presentation outline."

AI handles focused tasks better than scattered mega-prompts. Break it up.

Mistakes

Mistake 3: Not Reviewing Output

Copy-pasting AI output without reading it is the fastest way to embarrass yourself.

The 80/20 rule: AI gets you 80% of the way. Your job is to review, refine, and own that last 20%. This is where your expertise matters.

  • Check facts and numbers
  • Verify the tone matches your audience
  • Make sure nothing important was missed
  • Read it as if YOU wrote it, because you're sending it
Mistakes

Mistake 4: Giving Up Too Early

First result not perfect ≠ AI can't do it.

Bad first result
Add context
Better result
Refine further
Great result

Most people quit after one try. The best results come from 2-3 rounds of conversation. Treat it like working with a colleague: give feedback, iterate.

Mistakes

Mistake 5: Trusting Blindly

AI sounds confident even when it's wrong

AI doesn't say "I'm not sure." It presents everything with the same confidence. This includes made-up facts, wrong numbers, and plausible-sounding nonsense (hallucinations).

  • Always verify facts, statistics, and dates
  • Double-check names, quotes, and references
  • Be extra cautious with legal, medical, or financial claims
  • If something sounds too good to be true, verify it
Review

Working With What You Get

How to evaluate and refine AI output

Review

The Review Checklist

  • Accuracy: Are the facts correct?
  • Completeness: Did it cover everything you asked?
  • Tone: Does it match your audience?
  • Format: Is it structured the way you need?
  • Relevance: Does it actually answer your question?

Run through this checklist every time before using AI output.

Review

When to Accept

  • It meets your requirements, even if it's not how you'd write it
  • It saves you meaningful time
  • Small imperfections are easily fixed manually
  • The core content and structure are solid

Perfect is the enemy of done. If it's 90% right, fix the 10% and move on.

Review

When to Push Back

Tell the AI exactly what to change.

"This is close but change the tone to be more casual"

"You missed the part about the budget. Add that in"

"The intro is too long. Cut it in half"

"Give me 3 alternative versions of the opening paragraph"

Review

The Conversation Advantage

AI remembers the conversation. Build on previous responses instead of starting over.

Initial request
First draft
Now make it shorter
Add a section about X
Perfect, now format as email

Each message adds to the context. You're sculpting the result through conversation.

Context

Context is King

Giving AI what it needs to deliver

Context

Types of Context

Background

Who you are, what the project is, who the audience is. "I'm a marketing manager preparing for a board meeting..."

Reference Material

Paste documents, data, examples, or previous work. "Here are last quarter's numbers: ..."

Preferences

Your style, tone, format preferences. "I prefer bullet points over paragraphs, casual tone, and short sentences."

Context

Context Across Tools

Tool How Context Works Best For
ChatGPTPaste context each conversationQuick one-off questions
Claude.aiProjects feature stores docsLong document work, research
Claude CodeCLAUDE.md file + reads your codebaseSoftware projects, file work
Context

The Context Payoff

No context

Write a welcome email for new customers.

Result: Generic, bland, could be for any company

Rich context

Write a welcome email for new customers of CloudSync, a B2B file-sharing tool for law firms. Tone: professional but warm. Mention our 256-bit encryption and 24/7 support. Include a link to our onboarding guide.

Result: Specific, on-brand, ready to send

Templates

Template: Writing Tasks

Write a [type of content] about [topic].

Audience: [who will read this]
Tone: [formal / casual / diplomatic / urgent]
Length: [word count or short/medium/long]
Key points to include:
- [point 1]
- [point 2]
- [point 3]
Format: [email / report / blog post / summary]

Additional notes: [anything else relevant]
Templates

Template: Analysis Tasks

Analyze [document/data/situation].

Goal: [what decision this supports]
Focus on: [specific aspects to examine]
Compare: [what to compare, if applicable]
Output format: [summary / table / pros-cons / recommendation]
Length: [brief / detailed]

Important: [constraints, what to ignore, what to flag]
Templates

Template: Brainstorming Tasks

Help me brainstorm [topic/problem].

Context: [background on the situation]
Constraints: [budget, time, resources, etc.]
What's been tried: [previous attempts, if any]
Generate: [number] ideas that are [realistic / creative / unconventional]
For each idea, include:
- Brief description
- Why it could work
- Potential challenges

Prioritize by: [impact / feasibility / cost]

Key Takeaways

  • Be specific. Vague prompts get vague results
  • Give context. Background transforms output quality
  • Iterate. The first result is a starting point, not the finish line
  • Review everything. AI sounds confident even when wrong
  • Start simple and build up. You can always add complexity

Prompting is a skill. Like any skill, it gets better with practice.

Lesson 3

The Art of Prompting

Task

What to do

Context

The background

Constraints

The boundaries

Format

The shape

Practice makes progress