✍️ Phase 2: Prompting Mastery

Write prompts that work. Master the art and science of asking Claude the right questions. Learn the CLAUDE.md system.

🎯 Why Prompting Matters

A bad prompt gets a bad answer. A good prompt gets a great answer. The difference? A 2-minute rewrite.

This is the highest ROI skill you can learn. Get prompting right, and Claude becomes 10x more useful. Everything else in Phase 3 and 4 depends on this.

🏗️ The 4-Part Prompt Structure

Every good prompt has these 4 parts. Use them in order:

ROLE: "You are a [specific expertise]. You know [specific domain knowledge]." TASK: "Write/Build/Debug/Analyze [specific output]. The output should [specific requirements]." CONTEXT: "Here's the background: [relevant information]. Constraints: [limits]." FORMAT: "Return the output as [format]. Structure it like [example or structure]."

❌ Bad Prompt

Write me a Python script.

✅ Good Prompt

You are an expert Python developer. Write a Python script that parses CSV files and exports them as JSON. It should handle errors gracefully and log all operations. Return the complete code with comments.

Pro Tips

  • Be specific. "Make it better" → "Add error handling for network timeouts"
  • Show examples. "Format like this: ..." → Claude copies your style
  • Add constraints. "Keep it under 200 tokens" → Claude optimizes
  • State the WHY. "This is for a startup MVP" → Claude prioritizes speed over perfection

📈 5 Levels of Prompting

Master these one by one. Level 1 → Level 5 = 100x better results.

Level 1: Basic

Single sentence. No context. "Write a poem." Works but messy output.

Level 2: Structured

Use the 4-part framework. Claude gives you what you asked for.

Level 3: Examples

Show Claude examples of good output. It copies your style exactly.

Level 4: Reasoning

Ask Claude to "think out loud" first. Better for complex problems.

Level 5: Expert

Combine all of the above. Use CLAUDE.md for context. Perfect results every time.

💡 Level 3: Show Examples (The Game Changer)

Claude doesn't just follow instructions—it copies patterns. Show it what you want, and it replicates it perfectly.

You are a technical writer. Rewrite this in YOUR style: EXAMPLE OF YOUR STYLE: - Title: starts with emoji + action verb - Tone: conversational, not corporate - Length: 2-3 sentences max - Format: bullets with arrows Here's the text to rewrite: [text here] Match my style exactly. Use emoji, short sentences, action verbs.

Why this works: Claude learns from examples better than from instructions. Show, don't tell.

🧠 Level 4: Chain of Thought (The Reasoning Hack)

For complex problems, ask Claude to think before answering.

I need to debug this Python error: [error message] Please: 1. Think out loud about what could cause this 2. Consider the most likely causes first 3. Propose 3 solutions from most to least likely 4. Show code for each solution Think through this step-by-step before answering.

Why this works: "Think first" mode takes more tokens but gives way better answers for complex problems.

🎯 The CLAUDE.md System (Level 5)

This is the secret that changes everything.

CLAUDE.md is a file you create in your project. It stores rules, context, and preferences that Claude remembers across all your messages. No more repeating yourself.

What goes in CLAUDE.md:

  • Code style preferences: "Use TypeScript, no semicolons, 2-space indent"
  • Project context: "This is a React app for [purpose]. Stack: [technologies]"
  • Rules: "Never use X library. Always add error handling. Include tests."
  • Target audience: "This is for beginners. Explain everything."
  • Quality standards: "Add 100% test coverage. Performance critical—optimize first."

Example CLAUDE.md:

# Miru Project ## What This Is - WhatsApp AI assistant for UK daily life - Python + Flask backend, Supabase DB, Twilio integration - Deployed to Railway (auto-deploy on git push main) ## Rules (ALWAYS FOLLOW) - Use Python 3.11+ - Add error handling for all API calls - Never hardcode secrets (use .env) - Test with real phone numbers, not fake ones - Always include docstrings ## Code Style - 2-space indent - Type hints everywhere - No wildcard imports - Class names: PascalCase, functions: snake_case ## Team - Vikram built this. Know his style: pragmatic, ship fast, focus on user value - When unsure about design, ask: "Would Vikram do this?" ## Next Priority - Fix school comms polling - Add motivation features - Deploy by Friday

How to use it: Just put CLAUDE.md in your project root. Claude Code reads it automatically and follows all your rules.

⚠️ Common Mistakes (Don't Do These)

❌ Too Vague

"Make this function faster"

✅ Specific

"This function processes 10k records and takes 30s. Target: under 5s. Profile shows 80% time in database queries."

❌ Rambling

"I have this problem where the thing isn't doing the other thing and I'm not sure why but it might be because of..."

✅ Concise

"Error: 'NoneType' object is not iterable. Line 42. Variable 'x' is None when it shouldn't be."

❌ No Context

"Debug this" [pastes code snippet]

✅ With Context

"This code runs on Railway with Supabase. When user uploads a file over 50MB, it fails. I've added logging—see attached."

The "Prompt Audit" Checklist

  • Is the ROLE clear? (Who should Claude be?)
  • Is the TASK specific? (What exactly do you want?)
  • Is there CONTEXT? (What's the background?)
  • Is the FORMAT defined? (How should it be returned?)
  • Can you read it to someone else in 30 seconds?

🎯 Practice Exercise

Rewrite this bad prompt into a good one:

Write me a function to do stuff with data.

Good answer should have:

💪 Key Takeaway

Perfect prompt = 10 seconds thinking + 2 minutes writing.

The time you spend writing a good prompt saves you 10x the time dealing with bad output. It's the highest-ROI skill you can learn this week.