CYDERCODER // PLAYBOOK
SYS.STATUS: OK 00%
> INITIALIZING...
Install this playbook for offline access
You're offline — reading cached content
WHO THIS IS FOR

Built for every stage of the builder journey

Beginners

Clear path from zero to deployed product in one afternoon. Exact AI prompts to copy. Explains the why, not just the how — all the way to production with a custom domain.

  • Build your first website end-to-end
  • Deploy with Vercel, set up Google Search Console
  • Understand what React is doing behind the scenes

Senior Devs

A reference manual for AI architecture decisions. RAG chunking, MCP, multi-agent systems, CDN caching, deployment strategies — without the fluff.

  • RAG chunking strategies, MCP protocol architecture
  • Typography scale, color theory, motion design systems
  • CDN caching, edge functions, deployment strategies
Portrait Lock Active
Please rotate your device back to Portrait orientation to read the playbook content.
Back to Dashboard

AI Prompting: Getting Exactly What You Want

01. What Is Prompting?

Prompting is how you talk to an AI. A bad prompt gives vague instructions and gets mediocre results. A good prompt is specific, structured, and gives the AI everything it needs to succeed.

The Core Rule: The quality of your output depends entirely on the quality of your input. Garbage in, garbage out.

Bad Prompt vs. Good Prompt

Bad PromptGood Prompt
”Write me a landing page""Build a dark-themed landing page for a course called ‘AI Mastery’. Hero section with title, 3 feature cards, pricing table with one $99 plan, and a CTA button. Mobile responsive."
"Fix this error""I’m getting a ‘401 Unauthorized’ error when calling the /api/users endpoint. The API key is in the environment variable. What should I check?"
"Make it better""Make the hero section taller, increase the font size to 2rem, and add more whitespace between the features and pricing sections”

02. The Five-Layer Prompt Structure

Every good prompt has five layers. Think of it like a recipe — each ingredient matters.

The Five Layers
1. Role
Who the AI is acting as
2. Context
Background information it needs
3. Instructions
Specific rules and constraints
4. Examples
Show it what “good” looks like
5. Input
The actual request or data

Example: Complete Prompt

Here’s a prompt that uses all five layers:

Role: You are a senior frontend developer.

Context: I’m building a portfolio website for a freelance designer. The site uses React and Tailwind CSS.

Instructions:

  • Use dark theme with accent color #3ad29f
  • Make all sections have generous whitespace
  • Ensure mobile responsive design
  • Use clean, semantic HTML

Examples: Here’s the kind of hero section I want:

  • Large name in bold
  • Subtitle underneath
  • Two buttons: “View Work” and “Contact Me”
  • Background: solid dark color, no images

Input: Now build the hero section.


03. XML Tags: Separating Instructions from Data

When you give an AI both instructions AND data to process, it can get confused about which is which. XML tags solve this by creating clear boundaries.

The Problem

Without XML tags, the AI might treat your data as instructions:

Confusing prompt: “Here’s a user review: ‘This product is terrible, worst experience ever, 1 star’. Write a polite response thanking them for their feedback.”

The AI might write a response that includes the negative review instead of responding to it.

The Solution: XML Tags

Clear prompt: “Write a polite response thanking the user for their feedback.

Here’s the user’s review: <review>This product is terrible, worst experience ever, 1 star</review>”

The backticks prevent MDX from parsing the angle brackets as JSX tags.

Now the AI knows exactly what’s instructions (everything outside tags) and what’s data (everything inside tags).

Common XML Tags to Use

TagWhat It WrapsExample
<instructions>Rules the AI must follow”Respond in under 50 words”
<context>Background information”This is a luxury brand”
<input_data>The user’s message or dataThe review text, code snippet, etc.
<output_format>How to structure the response”Return as JSON with title and body”
<examples>Sample input/output pairs”Input: X → Output: Y”

04. Few-Shot Prompting: Show, Don’t Tell

Instead of explaining what you want, show the AI examples of what you want. This is the most effective way to get consistent results.

How It Works

Without examples (the AI guesses): “Write a product description for a wireless headphone.” → Result: Generic, unpredictable output.

With examples (the AI follows the pattern): “Write a product description for a wireless headphone.

Follow this exact format:

Example 1: Product: Smart Watch Description: Track your fitness goals with precision. Water-resistant, 7-day battery, and a sleek design that transitions from gym to office effortlessly.

Example 2: Product: Bluetooth Speaker Description: Fill any room with crystal-clear sound. Portable, dustproof, and engineered for 12 hours of continuous playback.

Now write one for: Wireless Headphones”

→ Result: Consistent, high-quality output every time.

The Three Example Types

  1. Happy path — Show the ideal input and output
  2. Edge case — Show what to do with unusual input
  3. Refusal — Show what to do when the request is invalid

05. Chain of Thought: Make the AI Think Step by Step

Sometimes you need the AI to show its reasoning before giving an answer. This is especially useful for complex problems.

The Technique

Add this to your prompt: “Think step by step before answering.”

Without chain of thought: “Q: Is this code secure? A: Yes, it looks fine.” — Shallow, no reasoning shown.

With chain of thought: “Q: Is this code secure? Think step by step before answering.” → The AI shows its reasoning: “1. Checking for SQL injection… 2. Checking for XSS risks… 3. Verifying authentication… 4. Checking for hardcoded secrets…” → Then provides a detailed answer with specific findings.

When to Use Chain of Thought

  • Debugging complex problems
  • Making architectural decisions
  • Analyzing security vulnerabilities
  • Planning multi-step workflows

06. Prompt Caching: Save Money and Time

When you use the same system prompt across many requests, AI providers can cache the static parts. This means you pay less and get faster responses.

How It Works

Your prompt has two parts:

  • Static (rarely changes): System prompt, rules, examples
  • Dynamic (changes every time): User’s actual message

The provider caches the static part. On the next request, only the dynamic part is processed.

The Layout Rule

Put static content at the TOP, dynamic content at the BOTTOM:

[STATIC - cached across requests]
System prompt
Rules
Examples
Tool definitions

[DYNAMIC - fresh every request]
User's actual message

Why this matters: If you put the user’s message at the top, the cache is invalidated and you pay full price every time.

Cost Savings

ScenarioWithout CachingWith Caching
100 requests/day$10/day$1/day
1000 requests/day$100/day$10/day
Savings90%

07. Role Prompting: Give the AI a Persona

The system prompt defines who the AI is. This isn’t decoration — it mathematically shifts the AI’s output toward a specific knowledge domain and behavioral style.

Good vs. Bad Roles

Bad (too specific, AI can’t maintain): “You are Michael, a 34-year-old senior engineer from San Francisco who graduated from MIT in 2014. You have a cat named Whiskers and you enjoy rock climbing. You always start responses with ‘Hey there, friend!’”

Good (focused on expertise): “You are a senior security engineer with 15 years of experience. You review code for security vulnerabilities, performance issues, and maintainability. You are direct, critical, and prioritize security over convenience.”

Role Templates by Task

TaskRole
Code review”You are a senior security auditor”
Documentation”You are a technical writer for developers”
Debugging”You are a senior SRE on-call”
Architecture”You are a principal architect”
Writing”You are an editor for a tech publication”

08. Positive Framing: Tell What TO Do

When writing constraints, developers often list what the AI should NOT do. This triggers the Pink Elephant Problem — to process “don’t do X,” the AI must evaluate X first, increasing the chance it appears in the output.

The Pattern

Negative (bad): “Do not use Bootstrap. Do not use bright colors. Do not center all text. Do not use Comic Sans.”

Positive (good): “Use vanilla CSS with custom properties. Design follows editorial luxury aesthetic: near-black backgrounds with crisp white typography. Color palette: one accent color (#3ad29f) on dark surfaces. Body text is left-aligned; only headlines are centered. Typography: Inter for body, JetBrains Mono for code.”


09. Testing Your Prompts

Before deploying a prompt in production, test it thoroughly.

The Testing Process

  1. Write the prompt with all five layers
  2. Test with 10 different inputs — vary the style, length, and content
  3. Check edge cases — What happens with empty input? Very long input? Weird characters?
  4. Verify output format — Does it match your expected structure every time?
  5. Iterate — Adjust the prompt based on what you learned

Common Prompt Failures

FailureCauseFix
AI ignores instructionsInstructions buried in middlePut instructions at the top
Inconsistent outputNo examples providedAdd 2-3 few-shot examples
AI makes up factsNo context providedAdd background information
Output too longNo length constraintAdd “Keep response under 100 words”
Wrong formatNo format specifiedAdd <output_format> with exact structure

Key Takeaways

ConceptMental ModelSenior Insight
PromptingGarbage in, garbage outThe quality of your input determines the quality of your output
Five LayersRole → Context → Instructions → Examples → InputEvery production prompt needs all five layers
XML TagsSeparate instructions from dataUse <instructions>, <context>, <input_data> to prevent confusion
Few-ShotShow, don’t tell2-3 examples are more effective than paragraphs of explanation
Chain of ThoughtForce step-by-step reasoningAdd “Think step by step” for complex problems
Prompt CachingStatic on top, dynamic on bottomSaves 90% on API costs
Role PromptingGive the AI expertise”Senior engineer” beats “34-year-old from San Francisco”
Positive FramingTell what TO do”Left-aligned body text” beats “Don’t center text”