I built this entire blog — 35+ articles, 6 interactive games, 5 cheat sheets, SEO optimization, GitHub Pages deployment, Giscus comments — using Claude Code in a single session. Not by luck. By learning how to prompt it properly. The difference between a vague prompt and a precise one is the difference between "it kind of works" and "ship it to production."
This tutorial teaches you the prompting patterns that actually work, with real examples from building real software. No theory — just what works.
The Fundamental Rule
Before we get into techniques, understand this one thing:
Claude Code is not a search engine. It's a junior developer who is incredibly fast, never gets tired, and has read every programming book ever written — but needs clear direction.
You wouldn't tell a junior dev "make the app better." You'd say "add a loading spinner to the submit button that appears when the form is submitting and disappears when the response arrives." That's the level of specificity Claude Code needs.
Pattern 1: The Context-First Prompt
Always start with context. Claude Code doesn't know your project's history, your tech stack, or your business requirements unless you tell it. Front-load the important stuff.
# ❌ BAD: No context
"Add a comments section"
# ✅ GOOD: Context-first
"Add Giscus comments to the blog post page. Use this script:
<script src='https://giscus.app/client.js'
data-repo='myuser/myrepo'
data-repo-id='R_xxx'
data-category='General'
data-category-id='DIC_xxx'
data-mapping='title'
data-theme='preferred_color_scheme'
data-loading='lazy'
async></script>
Load the script dynamically in ngAfterViewChecked. Reload when
navigating between blog posts so each post gets its own discussion."
Notice the difference: the good prompt tells Claude what (Giscus), how (dynamic script loading), when (ngAfterViewChecked), and edge case (reload on navigation). Claude doesn't have to guess anything.
Pattern 2: The Screenshot Prompt
When something looks wrong visually, show it. Claude Code can read screenshots. Instead of trying to describe a layout issue in words, paste a screenshot and say "this card is misaligned — the left column is too narrow and text is wrapping."
# ❌ BAD: Vague visual description
"The auth quick reference section looks weird on the page"
# ✅ GOOD: Screenshot + specific problem
[paste screenshot]
"Auth Quick Reference: Which Auth for Which Scenario UI having
issues. It's not properly aligned — the left card is too narrow
and text is clipping. The VS cards layout doesn't work for this
content."
# Claude can see the screenshot and understands exactly what
# needs fixing. In this case, it replaced VS cards with a
# proper 3-column table that works at all widths.
Pattern 3: The Reference Prompt
Instead of describing what you want from scratch, point to an existing example. This is incredibly powerful.
# ❌ BAD: Abstract description
"Add a table of contents that's always visible"
# ✅ GOOD: Reference + what to copy
[paste screenshot of Android Developers docs]
"Move the Table of Contents to the right side of the page in
expanded mode, like how Google also does it on their Android
developer docs. Sticky, always visible, with section titles
that scroll with the page."
# Claude immediately understands the exact pattern you want
# because it can see the reference implementation.
Pattern 4: The Multi-Task Prompt
When you need multiple things done, list them explicitly. Claude Code handles numbered lists beautifully — it tracks each item and doesn't skip any.
# ❌ BAD: Run-on paragraph
"Add some blog posts about security and also maybe fix the SEO
and add dark mode support"
# ✅ GOOD: Numbered list with specifics
"Three things:
1. Add a blog on ethical hacking — make it beginner-friendly,
include real tool examples, safe lab setup guide
2. Add a blog on M2M authentication — cover OAuth Client
Credentials, mTLS, API keys, JWT validation
3. Add a blog on SSO (SAML & OIDC) — compare both protocols,
include sequence diagrams, Python implementation"
# Claude will create all three posts, each complete and
# properly structured, without forgetting any.
Pattern 5: The Constraint Prompt
Tell Claude what NOT to do. Constraints are as important as requirements.
# ❌ BAD: Open-ended
"Add games to the site"
# ✅ GOOD: Requirements + constraints
"Add 6 developer games to the site:
1. Guess the Output
2. Spot the Bug
3. DevOps Scenario Simulator
4. Typing Speed Test
5. Salary Calculator
6. Linux Command Challenge
Constraints:
- All routes MUST be lazy-loaded to avoid page speed delay
- Games content should relate to existing blog topics
- Each game needs proper SEO (title, meta, breadcrumbs)
- Pre-render all game pages for Google indexing"
Pattern 6: The Iterative Refinement Prompt
Don't try to get everything perfect in one prompt. Build iteratively — the same way you'd code. Ship a v1, test it, then refine.
# Round 1: Get the foundation
"Add interactive diagrams to the SSO blog post — sequence
diagrams for SAML and OIDC flows"
# Round 2: After seeing the result
"These SVGs are static. I want interactive HTML/CSS diagrams
with animations, hover effects, and step-by-step highlights
instead"
# Round 3: After testing in browser
"The sequence diagrams look great but the SAML vs OIDC
comparison cards don't render properly on mobile — the
VS badge should stack above on small screens"
# Each round gets you closer to exactly what you want.
# Don't try to specify everything upfront — iterate.
Pattern 7: The Debug Prompt
When something is broken, give Claude the error message, the context, and what you expected. The more diagnostic information, the faster the fix.
# ❌ BAD: "It's broken"
"The build is failing"
# ✅ GOOD: Error + context + expectation
"The Angular build fails with:
TS2349: This expression is not callable
TS2304: Cannot find name 'Execute'
Expected '}' but found 'C:\Python312\python.exe'
This started after I added the Cron Jobs blog post. The issue
is likely backticks or dollar signs in PowerShell code examples
inside the template literal — they're being interpreted as
JavaScript template expressions."
# Claude immediately knows:
# 1. It's a template literal escaping issue
# 2. It's in the blog-post.model.ts file
# 3. PowerShell backticks and $ signs need escaping
# Fix takes 30 seconds instead of 10 minutes of guessing.
Pattern 8: The "Teach Me Then Build" Prompt
When you're unsure about the right approach, ask Claude to explain options first, then pick one.
# ❌ BAD: Jump to implementation without understanding
"Add Firebase to the site for storing blog data"
# ✅ GOOD: Ask for analysis first
"Can I use Firebase Realtime Database to store this site's
blog info? What are the pros and cons?"
# Claude explains: "Technically yes, but practically it's a
# bad idea for YOUR specific site because..."
# - Breaks SEO (content fetched client-side)
# - Costs money when free GitHub Pages works fine
# - Adds complexity for no benefit
#
# Now you make an informed decision BEFORE writing code.
# You saved yourself a week of wasted work.
Pattern 9: The Quality Bar Prompt
Tell Claude the quality level you expect. "Make it detailed" vs "make it production-grade" produce very different outputs.
# Levels of quality you can request:
# Quick/rough:
"Add a basic 404 page"
# Thorough:
"Add a 404 page with the same styling as the rest of the site,
breadcrumbs, links to home and blog"
# Production-grade:
"Add a proper 404 page:
- Matches site design (header, footer, theme)
- SEO: noindex meta tag, proper title
- Helpful: links to home, blog, search
- The 404.html for GitHub Pages should serve the full Angular
app (not redirect) so Google doesn't see redirect errors
- Pre-render with meaningful content for crawlers"
# The third prompt produces something you can actually ship.
Pattern 10: The "Do What I Mean" Prompt
Sometimes you know the problem but not the solution. That's fine — describe the problem, let Claude figure out the implementation.
# Problem-first (you don't need to know the solution):
"Google says our pages have a 'Soft 404' error. The pages load
with 200 OK but Google sees empty content because it's a SPA.
How do we fix this so Google can actually index our blog posts?"
# Claude figures out the solution:
# 1. Generate static HTML for every route at build time
# 2. Inject route-specific title, description, OG tags
# 3. Put real content inside for each page
# 4. Update the CI pipeline to run the generation script
# 5. Add the script to pre-commit validation
# You described the PROBLEM ("Google says Soft 404").
# Claude provided the SOLUTION (pre-rendering with content).
# You didn't need to know about pre-rendering beforehand.
Pro Tips from Building This Blog
The Prompt Template I Use Most
# My go-to structure for complex tasks:
"[WHAT]: Add/Fix/Create [specific thing]
[CONTEXT]: This is a [tech stack] project.
Currently [current state]. The problem is [problem].
[REQUIREMENTS]:
1. [Specific requirement 1]
2. [Specific requirement 2]
3. [Specific requirement 3]
[CONSTRAINTS]:
- Must be [performance/security/accessibility constraint]
- Don't [thing to avoid]
- Make sure [quality bar]
[REFERENCES]: Similar to [reference implementation/screenshot]
Build, commit, and push when done."
What Claude Code Can't Do Well (Be Realistic)
- Visual design decisions: Claude can implement any design you describe, but it can't tell you if purple looks better than blue for your brand. You're the designer.
- Business strategy: "Should I add a paywall?" is a business question, not a technical one. Claude can build a paywall, but can't tell you if your audience will pay.
- Real user testing: Claude can't click through your UI in a browser. Always test the output yourself, especially for visual/interactive features.
- Domain expertise you haven't shared: If your API has a specific naming convention or your company has a style guide, tell Claude. It doesn't know your internal standards unless you provide them.
Real Session Stats (This Blog)
To give you a sense of what's possible with good prompting, here's what was built in a single Claude Code session:
| Feature | Count |
|---|---|
| Blog posts (2000-4000 words each) | 35+ |
| Interactive diagrams | 100+ |
| Games (full interactive) | 6 |
| Cheat sheets (with advanced sections) | 5 |
| SEO fixes (meta, schema, pre-rendering) | 20+ |
| Bug fixes | 15+ |
| Features (TOC, search, comments, etc.) | 25+ |
| Commits pushed to GitHub | 80+ |
All of this in one session. Not because Claude Code is magic — because the prompts were specific, contextual, and iterative. The tool does exactly what you tell it. The skill is in the telling.
Start with the Context-First pattern. Master it. Then add constraints and references. Within a week, you'll be shipping features 10x faster than you ever thought possible. The bottleneck is no longer coding speed — it's how clearly you can think about what you want.