Prompting Beginner 8 min read

The Beginner's Guide to Writing Better Prompts

Stop getting generic AI responses. These are the prompting patterns I learned that actually work — across Claude, ChatGPT, and every other AI tool.

For the first month I used AI tools, I was frustrated. My prompts were vague and my results were generic. "Help me with my code" got me unhelpful walls of text. Then I learned a few simple patterns and everything changed. Here's what I wish someone had told me on day one.

Pattern 1: Be embarrassingly specific

This is the single biggest improvement you can make. Vague prompts get vague answers. Specific prompts get useful answers. Compare these:

bad vs good
BAD:
"Help me with my website"

GOOD:
"I have a single-page HTML website using Tailwind CSS.
The navigation bar disappears on mobile screens.
I need a hamburger menu that shows/hides the nav
links when tapped. Use vanilla JavaScript, no
frameworks."

The second prompt tells the AI exactly:
→ What you have (HTML + Tailwind)
→ What's wrong (nav disappears on mobile)
→ What you want (hamburger menu)
→ What constraints exist (vanilla JS only)

I think of it like ordering food. "Give me something good" vs "I'd like a medium coffee, black, no sugar." The more specific you are, the less the AI has to guess — and the less it guesses wrong.

Pattern 2: Give context before your question

AI doesn't know anything about your situation unless you tell it. The more context you provide upfront, the better the response. I use a simple structure: who I am, what I'm working on, then what I need.

structured prompt
"I'm a beginner learning JavaScript. I'm building
a to-do list app as my first project.

I want to add a feature where clicking a task marks
it as complete (strikethrough text + gray color).

Here's my current HTML structure:
[paste your code here]

Explain your solution step by step so I can learn
from it, not just copy-paste it."

That last line is key — telling the AI how you want the answer delivered. "Explain step by step" or "keep it simple" or "give me just the code, no explanation" completely changes the output.

Pattern 3: Use tags to structure long prompts (especially for Claude)

I learned this one from Anthropic's official prompting guide, and it's a game-changer for complex requests. Wrap different parts of your prompt in XML-style tags. Claude is specifically trained to understand these, and ChatGPT handles them well too.

tagged prompt
<context>
I'm building an AI tools tutorial website.
It uses HTML + Tailwind CSS. Single page, dark theme.
</context>

<task>
Write a newsletter signup section with an email
input and subscribe button.
</task>

<requirements>
- Match the dark theme (bg #0a0f1a, text #e2e8f0)
- Green accent color (#22c55e)
- Mobile responsive
- Include a heading and short description
- Form should prevent default submit
</requirements>

<style-notes>
Use DM Sans font. Rounded corners (rounded-xl).
Layered box shadows, not flat shadow-md.
</style-notes>

Tags help the AI distinguish between different types of information in your prompt. Without them, everything blurs together. With them, the AI knows exactly what's context, what's the task, and what the constraints are.

Pattern 4: Ask the AI to think step by step

For complex problems, add "Think step by step" or "Walk me through your reasoning" to your prompt. This makes the AI break the problem down instead of jumping straight to an answer — and the answers are usually much better.

chain of thought
"My website loads slowly on mobile. The Lighthouse
score is 45.

Think step by step about what could be causing
the slow performance, then suggest fixes in order
of impact (biggest improvement first)."

Without "think step by step," the AI might give you a generic list. With it, it actually reasons through the problem — considers image sizes, render-blocking resources, JavaScript bundles — and gives you a prioritized, thoughtful answer.

Pattern 5: Show examples of what you want

This is called "few-shot prompting" and it's incredibly effective. Instead of describing what you want, show the AI an example of the output format you're looking for.

few-shot example
"Write short descriptions for AI tools. Here's the
format I want:

Tool: ChatGPT
One-liner: Conversational AI that can write, analyze,
and create across any topic.
Best for: General questions, writing, brainstorming
Price: Free (Plus $20/mo)

Now do the same for: Claude, Cursor, Copilot,
Windsurf, and Perplexity."

By giving one example, you've defined the exact format, tone, length, and style. The AI will match it precisely. This works for everything — code comments, data formats, writing styles, you name it.

The cheat sheet

Here's my mental checklist before I hit Enter on any prompt:

Am I being specific enough? Could someone else read this prompt and know exactly what I want?

Did I give context? Does the AI know my skill level, tech stack, and what I've tried?

Did I specify the output format? Do I want code? Bullet points? A step-by-step walkthrough?

Did I set constraints? What shouldn't the AI do? What limitations matter?

Prompting is a skill, and like any skill it gets better with practice. Don't overthink it — just start being more specific and you'll see immediate improvements.

Want to go deeper?

Check out the full Prompting & Workflows category for advanced techniques and interactive tutorials.