AashishAIHub commited on
Commit
d65393f
·
1 Parent(s): f806771

Rebuild Prompt Engineering Guide with dashboard UI and 4 new advanced modules

Browse files
index.html CHANGED
@@ -656,8 +656,8 @@
656
  <div class="module-card-body">
657
  <h2 class="module-card-title">Prompt Engineering</h2>
658
  <p class="module-card-description">
659
- Mastering LLMs. Zero-shot, Few-shot, Chain-of-Thought, and advanced prompting strategies for
660
- GPT-4/Claude.
661
  </p>
662
  </div>
663
  <div class="module-progress">
 
656
  <div class="module-card-body">
657
  <h2 class="module-card-title">Prompt Engineering</h2>
658
  <p class="module-card-description">
659
+ Mastering LLMs. Zero-shot, Few-shot, Chain-of-Thought, plus Claude, Gemini &amp; OpenAI
660
+ provider-specific techniques.
661
  </p>
662
  </div>
663
  <div class="module-progress">
prompt-engineering-guide/app.js CHANGED
@@ -1,628 +1,815 @@
1
- // Topics data
2
- const topics = [
3
- { id: 1, title: "Introduction to Prompt Engineering", subtitle: "What & Why" },
4
- { id: 2, title: "Prompt Structure", subtitle: "Building Blocks" },
5
- { id: 3, title: "Clarity & Specificity", subtitle: "Writing Precise Prompts" },
6
- { id: 4, title: "Context & Background", subtitle: "Providing Information" },
7
- { id: 5, title: "Output Format", subtitle: "Specifying Structure" },
8
- { id: 6, title: "Iterative Refinement", subtitle: "Testing & Improving" },
9
- { id: 7, title: "Advanced Techniques", subtitle: "Expert Methods" },
10
- { id: 8, title: "Real-World Applications", subtitle: "Putting It Together" }
 
 
 
 
11
  ];
12
 
13
- // State management
14
- let currentTopic = 1;
15
- let completedTopics = [];
16
-
17
- // Initialize app
18
- function init() {
19
- renderTopicList();
20
- initializeCanvases();
21
- updateProgress();
22
- showContextExample('minimal');
23
- showFormatExample('list');
24
- showIteration(1);
25
- updateSpecificity();
26
- setChallenge('email');
27
- }
28
-
29
- // Render topic list in sidebar
30
- function renderTopicList() {
31
- const topicList = document.getElementById('topicList');
32
- topicList.innerHTML = topics.map(topic => `
33
- <li class="topic-item ${topic.id === currentTopic ? 'active' : ''}" onclick="navigateTo(${topic.id})">
34
- <h3>${topic.id}. ${topic.title}</h3>
35
- <p>${topic.subtitle}</p>
36
- </li>
37
- `).join('');
38
- }
39
-
40
- // Navigate to topic
41
- function navigateTo(topicId) {
42
- // Hide current section
43
- const currentSection = document.querySelector('.content-section.active');
44
- if (currentSection) {
45
- currentSection.classList.remove('active');
46
- }
47
-
48
- // Show new section
49
- const newSection = document.getElementById(`topic-${topicId}`);
50
- if (newSection) {
51
- newSection.classList.add('active');
52
- currentTopic = topicId;
53
-
54
- // Mark previous topics as completed
55
- if (!completedTopics.includes(topicId - 1) && topicId > 1) {
56
- completedTopics.push(topicId - 1);
57
- }
58
-
59
- renderTopicList();
60
- updateProgress();
61
- window.scrollTo({ top: 0, behavior: 'smooth' });
62
- }
63
- }
64
-
65
- // Update progress bar
66
- function updateProgress() {
67
- const progress = (currentTopic / topics.length) * 100;
68
- const progressBar = document.getElementById('progressBar');
69
- progressBar.style.width = `${progress}%`;
70
- }
71
-
72
- // Prompt quality evaluation
73
- function updatePromptQuality() {
74
- const role = document.getElementById('roleInput').value;
75
- const context = document.getElementById('contextInput').value;
76
- const task = document.getElementById('taskInput').value;
77
- const format = document.getElementById('formatInput').value;
78
-
79
- const components = [role, context, task, format];
80
- const filledComponents = components.filter(c => c.trim().length > 0).length;
81
-
82
- const qualityGrade = document.getElementById('qualityGrade');
83
- const combinedPrompt = document.getElementById('combinedPrompt');
84
-
85
- let gradeText = '';
86
- let gradeClass = '';
87
-
88
- if (filledComponents === 0) {
89
- gradeText = 'Quality: Poor';
90
- gradeClass = 'grade-poor';
91
- combinedPrompt.textContent = 'Start filling in the components above...';
92
- } else if (filledComponents <= 2) {
93
- gradeText = 'Quality: Poor';
94
- gradeClass = 'grade-poor';
95
- } else if (filledComponents === 3) {
96
- gradeText = 'Quality: Good';
97
- gradeClass = 'grade-good';
98
- } else {
99
- gradeText = 'Quality: Excellent';
100
- gradeClass = 'grade-excellent';
101
- }
102
-
103
- qualityGrade.textContent = gradeText;
104
- qualityGrade.className = 'quality-grade ' + gradeClass;
105
-
106
- if (filledComponents > 0) {
107
- const parts = [];
108
- if (role) parts.push(role);
109
- if (context) parts.push(context);
110
- if (task) parts.push(task);
111
- if (format) parts.push(format);
112
- combinedPrompt.textContent = parts.join(' ');
113
- }
114
- }
115
-
116
- // Specificity slider
117
- const specificityLevels = [
118
- {
119
- level: 1,
120
- prompt: "Write about AI.",
121
- quality: "Poor - Too vague, could mean anything"
122
- },
123
- {
124
- level: 2,
125
- prompt: "Write about machine learning.",
126
- quality: "Poor - Still too broad, no specific focus"
127
- },
128
- {
129
- level: 3,
130
- prompt: "Explain how machine learning works in simple terms.",
131
- quality: "Good - More specific, mentions simplicity"
132
  },
133
- {
134
- level: 4,
135
- prompt: "Explain how machine learning works in 200 words, using simple terms for beginners.",
136
- quality: "Very Good - Specifies length and audience"
137
- },
138
- {
139
- level: 5,
140
- prompt: "Write a 200-word beginner's guide explaining how machine learning works, using a coffee shop analogy. Keep language simple for 10th graders.",
141
- quality: "Excellent - Specific length, audience, analogy, and complexity level"
142
- }
143
- ];
144
-
145
- function updateSpecificity() {
146
- const slider = document.getElementById('specificitySlider');
147
- const value = parseInt(slider.value);
148
- document.getElementById('specificityValue').textContent = value;
149
-
150
- const level = specificityLevels[value - 1];
151
- document.getElementById('specificityPrompt').textContent = level.prompt;
152
- document.getElementById('specificityQuality').textContent = level.quality;
153
- }
154
-
155
- // Context examples
156
- const contextExamples = {
157
- minimal: {
158
- prompt: "Write a marketing email.",
159
- quality: "⚠️ Poor - No context about product, audience, or goal"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  },
161
- moderate: {
162
- prompt: "Write a marketing email for our new coffee subscription service. Target coffee enthusiasts.",
163
- quality: "⚡ Good - Has product and audience, but could use more details"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
  },
165
- rich: {
166
- prompt: "Write a marketing email for our new coffee subscription service. We're a sustainable brand targeting environmentally-conscious coffee enthusiasts aged 25-40. The service delivers ethically-sourced beans monthly. Tone should be warm and knowledgeable. Email should introduce the service, highlight sustainability, and include a 20% off first order offer. Keep it under 200 words.",
167
- quality: "✓ Excellent - Complete context with audience, brand voice, key points, and constraints"
168
- }
169
- };
170
-
171
- function showContextExample(level) {
172
- // Update button states
173
- const buttons = document.querySelectorAll('#topic-4 .scenario-btn');
174
- buttons.forEach(btn => btn.classList.remove('active'));
175
- event.target.classList.add('active');
176
-
177
- const example = contextExamples[level];
178
- document.getElementById('contextPromptText').textContent = example.prompt;
179
- document.getElementById('contextQuality').textContent = example.quality;
180
- }
181
-
182
- // Format examples
183
- const formatExamples = {
184
- list: {
185
- prompt: "Provide the information as a numbered list with brief explanations for each point.",
186
- output: "1. First Point\n Brief explanation here\n\n2. Second Point\n Brief explanation here\n\n3. Third Point\n Brief explanation here"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
  },
188
- table: {
189
- prompt: "Create a comparison table with columns: Feature, Pros, Cons",
190
- output: "| Feature | Pros | Cons |\n|------------|-------------------|-------------------|\n| Feature A | Advantage 1 | Disadvantage 1 |\n| Feature B | Advantage 2 | Disadvantage 2 |"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
191
  },
192
- narrative: {
193
- prompt: "Write the response as a 3-paragraph narrative with introduction, body, and conclusion.",
194
- output: "Introduction paragraph setting context...\n\nBody paragraph with main information and details...\n\nConclusion paragraph summarizing key points..."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
  },
196
- code: {
197
- prompt: "Provide Python code with inline comments explaining each step.",
198
- output: "# Calculate factorial of a number\ndef factorial(n):\n # Base case: factorial of 0 or 1 is 1\n if n <= 1:\n return 1\n # Recursive case\n return n * factorial(n - 1)"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  },
200
- json: {
201
- prompt: "Return the data as a JSON object with proper structure.",
202
- output: "{\n \"name\": \"Example\",\n \"items\": [\n { \"id\": 1, \"value\": \"Item 1\" },\n { \"id\": 2, \"value\": \"Item 2\" }\n ]\n}"
203
- }
204
- };
205
-
206
- function showFormatExample(format) {
207
- // Update button states
208
- const buttons = document.querySelectorAll('#topic-5 .scenario-btn');
209
- buttons.forEach(btn => btn.classList.remove('active'));
210
- event.target.classList.add('active');
211
-
212
- const example = formatExamples[format];
213
- document.getElementById('formatPromptText').textContent = example.prompt;
214
- document.getElementById('formatOutputExample').textContent = example.output;
215
- }
216
-
217
- // Iteration examples
218
- const iterations = [
219
- {
220
- iteration: 1,
221
- prompt: "Help me with my website.",
222
- score: "25/100 - Very Poor",
223
- notes: "❌ Issues: No context, unclear task, no specifics. AI won't know what kind of help you need."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
224
  },
225
- {
226
- iteration: 2,
227
- prompt: "I have an e-commerce website and need help improving the checkout process. Can you suggest improvements?",
228
- score: "65/100 - Good",
229
- notes: "✓ Better: Added context (e-commerce) and specific area (checkout). ⚠️ Still missing: What problems exist? What's the current user experience?"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
230
  },
231
- {
232
- iteration: 3,
233
- prompt: "I run an e-commerce website selling handmade jewelry. Our checkout abandonment rate is 70%. Users complain it takes too long (5+ steps). Analyze this and suggest 3-5 specific improvements to reduce friction. Format as: Problem → Solution → Expected Impact.",
234
- score: "95/100 - Excellent",
235
- notes: "✓ Excellent: Clear context, specific problem with data, defined task, output format specified. AI has everything needed for quality response."
236
- }
237
- ];
238
-
239
- function showIteration(num) {
240
- const iteration = iterations[num - 1];
241
- document.getElementById('iterationPrompt').textContent = iteration.prompt;
242
- document.getElementById('iterationScore').textContent = iteration.score;
243
- document.getElementById('iterationNotes').innerHTML = `<p style="color: #ccc; margin: 0;">${iteration.notes}</p>`;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
244
  }
245
 
246
- // Challenge scenarios
247
- const challenges = {
248
- email: {
249
- scenario: "Your manager asked you to write a follow-up email to a client who attended yesterday's product demo. The client seemed interested but had concerns about pricing and implementation timeline."
250
- },
251
- code: {
252
- scenario: "You need to create a JavaScript function that validates email addresses and returns detailed error messages for invalid formats. It should handle edge cases like missing @ symbols, invalid domains, and special characters."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
253
  },
254
- creative: {
255
- scenario: "Create a compelling Instagram caption for a new eco-friendly water bottle launch. Your brand targets young professionals who care about sustainability. The post should encourage engagement and include a call-to-action."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
256
  },
257
- analysis: {
258
- scenario: "You have sales data from Q1-Q4 showing declining revenue in Q3. Analyze what might have caused this dip and provide actionable recommendations. Consider seasonality, marketing spend, and competition."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
259
  }
260
  };
261
 
262
- let currentChallenge = 'email';
263
-
264
- function setChallenge(type) {
265
- currentChallenge = type;
266
-
267
- // Update button states
268
- const buttons = document.querySelectorAll('.challenge-box .scenario-btn');
269
- buttons.forEach(btn => btn.classList.remove('active'));
270
- event.target.classList.add('active');
271
-
272
- document.getElementById('challengeScenario').textContent = challenges[type].scenario;
273
- document.getElementById('challengeInput').value = '';
274
- document.getElementById('challengeFeedback').classList.remove('show');
275
  }
276
 
277
- function evaluateChallenge() {
278
- const input = document.getElementById('challengeInput').value;
279
- const feedback = document.getElementById('challengeFeedback');
280
-
281
- if (!input.trim()) {
282
- feedback.innerHTML = '<p style="color: #FF6B35;">⚠️ Please write a prompt first!</p>';
283
- feedback.classList.add('show');
284
- return;
285
- }
286
-
287
- // Simple evaluation based on key elements
288
- const hasRole = /you are|act as|as a/i.test(input);
289
- const hasContext = input.length > 100;
290
- const hasFormat = /format|structure|provide|return|list|table/i.test(input);
291
- const hasConstraints = /words|length|tone|style|keep/i.test(input);
292
-
293
- let score = 0;
294
- let feedbackItems = [];
295
-
296
- if (hasRole) {
297
- score += 25;
298
- feedbackItems.push('✓ Good: Includes role/persona');
299
- } else {
300
- feedbackItems.push('⚠️ Consider: Adding a role or persona');
301
- }
302
-
303
- if (hasContext) {
304
- score += 25;
305
- feedbackItems.push('✓ Good: Provides context');
306
- } else {
307
- feedbackItems.push('⚠️ Consider: Adding more context and background');
308
- }
309
-
310
- if (hasFormat) {
311
- score += 25;
312
- feedbackItems.push('✓ Good: Specifies output format');
313
- } else {
314
- feedbackItems.push('⚠️ Consider: Specifying the desired output format');
315
- }
316
-
317
- if (hasConstraints) {
318
- score += 25;
319
- feedbackItems.push('✓ Good: Includes constraints');
320
- } else {
321
- feedbackItems.push('⚠️ Consider: Adding constraints like length, tone, or style');
322
- }
323
-
324
- let grade = '';
325
- let color = '';
326
- if (score >= 75) {
327
- grade = 'Excellent';
328
- color = '#00FF88';
329
- } else if (score >= 50) {
330
- grade = 'Good';
331
- color = '#FFB800';
332
- } else {
333
- grade = 'Needs Improvement';
334
- color = '#FF6B35';
335
- }
336
-
337
- feedback.innerHTML = `
338
- <h4 style="color: ${color}; margin-bottom: 12px;">Score: ${score}/100 - ${grade}</h4>
339
- ${feedbackItems.map(item => `<p style="margin: 8px 0; font-size: 14px;">${item}</p>`).join('')}
340
- ${score >= 75 ? '<p style="margin-top: 15px; color: #00D9FF;">🎉 Great job! Your prompt includes all key components.</p>' : ''}
341
  `;
342
- feedback.classList.add('show');
343
- }
344
-
345
- function resetChallenge() {
346
- document.getElementById('challengeInput').value = '';
347
- document.getElementById('challengeFeedback').classList.remove('show');
348
  }
349
 
350
- // Practice challenge
351
- function startPractice(topicId) {
352
- alert('Practice mode: Try building a prompt for a simple task like \"Write a product description for noise-canceling headphones\" and include all four components: Role, Context, Task, and Format!');
353
- }
354
-
355
- // Template copy
356
- function copyTemplate(element) {
357
- const template = element.querySelector('pre').textContent;
358
-
359
- // Create temporary textarea
360
- const textarea = document.createElement('textarea');
361
- textarea.value = template;
362
- document.body.appendChild(textarea);
363
- textarea.select();
364
-
365
- try {
366
- document.execCommand('copy');
367
- // Show feedback
368
- const originalHTML = element.innerHTML;
369
- element.style.borderColor = '#00FF88';
370
- setTimeout(() => {
371
- element.style.borderColor = '#333';
372
- }, 1000);
373
- } catch (err) {
374
- console.error('Copy failed:', err);
375
- }
376
-
377
- document.body.removeChild(textarea);
378
- }
379
-
380
- // Canvas visualizations
381
- function initializeCanvases() {
382
- // Structure Canvas - Component visualization
383
- const structureCanvas = document.getElementById('structureCanvas');
384
- if (structureCanvas) {
385
- const ctx = structureCanvas.getContext('2d');
386
- drawStructureVisualization(ctx, structureCanvas);
387
- }
388
-
389
- // Context Canvas - Information layers
390
- const contextCanvas = document.getElementById('contextCanvas');
391
- if (contextCanvas) {
392
- const ctx = contextCanvas.getContext('2d');
393
- drawContextVisualization(ctx, contextCanvas);
394
- }
395
-
396
- // Refinement Canvas - Improvement curve
397
- const refinementCanvas = document.getElementById('refinementCanvas');
398
- if (refinementCanvas) {
399
- const ctx = refinementCanvas.getContext('2d');
400
- drawRefinementVisualization(ctx, refinementCanvas);
401
- }
402
-
403
- // Techniques Canvas - Pattern comparison
404
- const techniquesCanvas = document.getElementById('techniquesCanvas');
405
- if (techniquesCanvas) {
406
- const ctx = techniquesCanvas.getContext('2d');
407
- drawTechniquesVisualization(ctx, techniquesCanvas);
408
- }
409
- }
410
-
411
- function drawStructureVisualization(ctx, canvas) {
412
- canvas.width = canvas.offsetWidth;
413
- canvas.height = canvas.offsetHeight;
414
-
415
- const components = [
416
- { name: 'Role', color: '#0066FF', y: 80 },
417
- { name: 'Context', color: '#00D9FF', y: 160 },
418
- { name: 'Task', color: '#FFB800', y: 240 },
419
- { name: 'Format', color: '#00FF88', y: 320 }
420
- ];
421
-
422
- const centerX = canvas.width / 2;
423
-
424
- // Draw connecting lines
425
- ctx.strokeStyle = '#333';
426
- ctx.lineWidth = 2;
427
- ctx.beginPath();
428
- ctx.moveTo(centerX, 60);
429
- ctx.lineTo(centerX, 340);
430
- ctx.stroke();
431
-
432
- // Draw components
433
- components.forEach(comp => {
434
- // Circle
435
- ctx.fillStyle = comp.color;
436
- ctx.beginPath();
437
- ctx.arc(centerX, comp.y, 30, 0, Math.PI * 2);
438
- ctx.fill();
439
-
440
- // Text
441
- ctx.fillStyle = '#FFFFFF';
442
- ctx.font = 'bold 14px sans-serif';
443
- ctx.textAlign = 'center';
444
- ctx.fillText(comp.name, centerX, comp.y + 5);
445
- });
446
-
447
- // Title
448
- ctx.fillStyle = '#00D9FF';
449
- ctx.font = 'bold 18px sans-serif';
450
- ctx.textAlign = 'center';
451
- ctx.fillText('Prompt Structure Components', centerX, 30);
452
- }
453
-
454
- function drawContextVisualization(ctx, canvas) {
455
- canvas.width = canvas.offsetWidth;
456
- canvas.height = canvas.offsetHeight;
457
-
458
- const layers = [
459
- { name: 'Task Only', width: 100, color: '#FF6B35' },
460
- { name: '+ Basic Context', width: 200, color: '#FFB800' },
461
- { name: '+ Full Context', width: 350, color: '#00FF88' }
462
- ];
463
-
464
- const startY = 100;
465
- const layerHeight = 60;
466
- const spacing = 30;
467
-
468
- layers.forEach((layer, index) => {
469
- const y = startY + (index * (layerHeight + spacing));
470
-
471
- // Draw rectangle
472
- ctx.fillStyle = layer.color + '44';
473
- ctx.fillRect(50, y, layer.width, layerHeight);
474
-
475
- // Draw border
476
- ctx.strokeStyle = layer.color;
477
- ctx.lineWidth = 2;
478
- ctx.strokeRect(50, y, layer.width, layerHeight);
479
-
480
- // Draw text
481
- ctx.fillStyle = '#FFFFFF';
482
- ctx.font = '14px sans-serif';
483
- ctx.textAlign = 'left';
484
- ctx.fillText(layer.name, 60, y + 35);
485
- });
486
-
487
- // Title
488
- ctx.fillStyle = '#00D9FF';
489
- ctx.font = 'bold 18px sans-serif';
490
- ctx.textAlign = 'left';
491
- ctx.fillText('Context Layers: From Minimal to Rich', 50, 50);
492
- }
493
-
494
- function drawRefinementVisualization(ctx, canvas) {
495
- canvas.width = canvas.offsetWidth;
496
- canvas.height = canvas.offsetHeight;
497
-
498
- const points = [
499
- { x: 100, y: 300, label: 'Iteration 1' },
500
- { x: 300, y: 200, label: 'Iteration 2' },
501
- { x: 500, y: 120, label: 'Iteration 3' },
502
- { x: 700, y: 80, label: 'Final' }
503
- ];
504
-
505
- // Draw curve
506
- ctx.strokeStyle = '#0066FF';
507
- ctx.lineWidth = 3;
508
- ctx.beginPath();
509
- ctx.moveTo(points[0].x, points[0].y);
510
-
511
- for (let i = 1; i < points.length; i++) {
512
- const xMid = (points[i - 1].x + points[i].x) / 2;
513
- ctx.quadraticCurveTo(xMid, points[i - 1].y, points[i].x, points[i].y);
514
  }
515
- ctx.stroke();
516
-
517
- // Draw points
518
- points.forEach((point, index) => {
519
- ctx.fillStyle = '#00D9FF';
520
- ctx.beginPath();
521
- ctx.arc(point.x, point.y, 8, 0, Math.PI * 2);
522
- ctx.fill();
523
-
524
- // Labels
525
- ctx.fillStyle = '#FFFFFF';
526
- ctx.font = '12px sans-serif';
527
- ctx.textAlign = 'center';
528
- ctx.fillText(point.label, point.x, point.y + 25);
529
- });
530
-
531
- // Y-axis label
532
- ctx.save();
533
- ctx.translate(30, 200);
534
- ctx.rotate(-Math.PI / 2);
535
- ctx.fillStyle = '#888';
536
- ctx.font = '14px sans-serif';
537
- ctx.textAlign = 'center';
538
- ctx.fillText('Quality', 0, 0);
539
- ctx.restore();
540
-
541
- // X-axis label
542
- ctx.fillStyle = '#888';
543
- ctx.font = '14px sans-serif';
544
- ctx.textAlign = 'center';
545
- ctx.fillText('Iterations', canvas.width / 2, canvas.height - 20);
546
-
547
- // Title
548
- ctx.fillStyle = '#00D9FF';
549
- ctx.font = 'bold 18px sans-serif';
550
- ctx.textAlign = 'center';
551
- ctx.fillText('Prompt Improvement Through Iteration', canvas.width / 2, 30);
552
  }
553
 
554
- function drawTechniquesVisualization(ctx, canvas) {
555
- canvas.width = canvas.offsetWidth;
556
- canvas.height = canvas.offsetHeight;
557
-
558
- const techniques = [
559
- { name: 'Basic', score: 40, color: '#FF6B35', x: 150 },
560
- { name: 'Chain-of-Thought', score: 75, color: '#FFB800', x: 350 },
561
- { name: 'Few-Shot', score: 85, color: '#00D9FF', x: 550 },
562
- { name: 'Combined', score: 95, color: '#00FF88', x: 750 }
563
- ];
564
-
565
- const maxHeight = 250;
566
- const barWidth = 80;
567
- const baseY = 320;
568
-
569
- techniques.forEach(tech => {
570
- const barHeight = (tech.score / 100) * maxHeight;
571
-
572
- // Draw bar
573
- ctx.fillStyle = tech.color + '88';
574
- ctx.fillRect(tech.x - barWidth / 2, baseY - barHeight, barWidth, barHeight);
575
-
576
- // Draw border
577
- ctx.strokeStyle = tech.color;
578
- ctx.lineWidth = 2;
579
- ctx.strokeRect(tech.x - barWidth / 2, baseY - barHeight, barWidth, barHeight);
580
-
581
- // Score text
582
- ctx.fillStyle = '#FFFFFF';
583
- ctx.font = 'bold 16px sans-serif';
584
- ctx.textAlign = 'center';
585
- ctx.fillText(tech.score + '%', tech.x, baseY - barHeight - 10);
586
-
587
- // Technique name
588
- ctx.font = '12px sans-serif';
589
- ctx.fillText(tech.name, tech.x, baseY + 25);
590
- });
591
-
592
- // Title
593
- ctx.fillStyle = '#00D9FF';
594
- ctx.font = 'bold 18px sans-serif';
595
- ctx.textAlign = 'center';
596
- ctx.fillText('Technique Effectiveness Comparison', canvas.width / 2, 30);
597
-
598
- // Y-axis
599
- ctx.strokeStyle = '#333';
600
- ctx.lineWidth = 2;
601
- ctx.beginPath();
602
- ctx.moveTo(80, 70);
603
- ctx.lineTo(80, baseY);
604
- ctx.stroke();
605
-
606
- // Y-axis label
607
- ctx.fillStyle = '#888';
608
- ctx.font = '12px sans-serif';
609
- ctx.textAlign = 'right';
610
- ctx.fillText('0%', 75, baseY + 5);
611
- ctx.fillText('50%', 75, baseY - 125);
612
- ctx.fillText('100%', 75, baseY - 250);
613
  }
614
 
615
- // Checklist interaction
616
- document.addEventListener('click', function(e) {
617
- if (e.target.tagName === 'LI' && e.target.parentElement.classList.contains('checklist')) {
618
- e.target.classList.toggle('checked');
619
- }
620
- });
621
-
622
- // Initialize on load
623
- window.addEventListener('load', init);
624
-
625
- // Handle window resize for canvases
626
- window.addEventListener('resize', function() {
627
- initializeCanvases();
628
- });
 
1
+ // Prompt Engineering Masterclass — Dashboard Module
2
+ const modules = [
3
+ { id: "intro", title: "Introduction to Prompt Engineering", icon: "🎯", category: "Foundations", description: "What prompt engineering is, why it matters, and core principles" },
4
+ { id: "structure", title: "Prompt Structure", icon: "🧱", category: "Foundations", description: "Building blocks: role, context, task, and format components" },
5
+ { id: "clarity", title: "Clarity & Specificity", icon: "🔍", category: "Foundations", description: "Writing precise, unambiguous prompts that get exact results" },
6
+ { id: "context", title: "Context & Background", icon: "📋", category: "Foundations", description: "Providing the right information and constraints" },
7
+ { id: "output", title: "Output Format", icon: "📐", category: "Techniques", description: "Specifying structure, length, tone, and formatting" },
8
+ { id: "refinement", title: "Iterative Refinement", icon: "🔄", category: "Techniques", description: "Testing, evaluating, and improving prompts over time" },
9
+ { id: "advanced", title: "Advanced Techniques", icon: "⚙️", category: "Advanced", description: "Chain-of-thought, few-shot, system prompts, and more" },
10
+ { id: "applications", title: "Real-World Applications", icon: "🌍", category: "Advanced", description: "Applying prompt engineering across domains" },
11
+ { id: "claude", title: "Claude Prompt Mastery", icon: "🟣", category: "Provider — Anthropic", description: "XML tags, thinking blocks, prefilling, prompt chaining" },
12
+ { id: "gemini", title: "Google Gemini Prompting", icon: "🔵", category: "Provider — Google", description: "System instructions, multimodal, JSON Schema, ReAct" },
13
+ { id: "openai", title: "OpenAI GPT Best Practices", icon: "🟢", category: "Provider — OpenAI", description: "Delimiters, function calling, RAG, context engineering" },
14
+ { id: "comparison", title: "Provider Comparison", icon: "⚡", category: "Strategy", description: "Claude vs Gemini vs GPT — when to use what" }
15
  ];
16
 
17
+ const MODULE_CONTENT = {
18
+ "intro": {
19
+ concepts: `
20
+ <div class="section">
21
+ <h2>What is Prompt Engineering?</h2>
22
+ <p>Prompt engineering is the art of writing clear, specific instructions to AI models to produce desired outputs. Think of it as learning to communicate effectively with an intelligent assistant.</p>
23
+ <div class="info-box">
24
+ <div class="box-title">💡 The difference between a vague and specific prompt can be 10x in output quality</div>
25
+ <div class="box-content">Just like giving directions to a colleague, the more precise you are, the better the result.</div>
26
+ </div>
27
+ <h3>Real-World Analogy: Ordering Food</h3>
28
+ <div class="comparison">
29
+ <div class="comparison-bad">
30
+ <h4>❌ Vague Order</h4>
31
+ <p>"Give me something to eat"</p>
32
+ <p style="color:#888;margin-top:8px">Result: Random item, probably not what you wanted</p>
33
+ </div>
34
+ <div class="comparison-good">
35
+ <h4>✓ Detailed Order</h4>
36
+ <p>"I'd like a medium margherita pizza with extra basil, thin crust, no olives"</p>
37
+ <p style="color:#888;margin-top:8px">Result: Exactly what you wanted</p>
38
+ </div>
39
+ </div>
40
+ <h3>Why Does It Matter?</h3>
41
+ <table>
42
+ <tr><th>Factor</th><th>Without PE</th><th>With PE</th></tr>
43
+ <tr><td>Output Quality</td><td>Inconsistent</td><td>Reliable & precise</td></tr>
44
+ <tr><td>Iterations Needed</td><td>5-10 tries</td><td>1-2 tries</td></tr>
45
+ <tr><td>Token Cost</td><td>Higher (retries)</td><td>Lower (first-shot)</td></tr>
46
+ <tr><td>Reproducibility</td><td>Low</td><td>High</td></tr>
47
+ </table>
48
+ </div>`,
49
+ code: `
50
+ <div class="section">
51
+ <h2>Prompt Examples: Basic vs Engineered</h2>
52
+ <h3>Example 1: Summarization</h3>
53
+ <div class="code-block">❌ Bad: "Summarize this article"
54
+
55
+ ✓ Good: "Summarize this article in 3 bullet points,
56
+ each under 20 words, focusing on key findings
57
+ and their business implications."</div>
58
+ <h3>Example 2: Code Generation</h3>
59
+ <div class="code-block">❌ Bad: "Write a Python function"
60
+
61
+ ✓ Good: "Write a Python function called 'validate_email'
62
+ that takes a string parameter and returns True/False.
63
+ Use regex. Include docstring and type hints.
64
+ Handle edge cases: empty string, None, spaces."</div>
65
+ <h3>Example 3: Analysis</h3>
66
+ <div class="code-block">❌ Bad: "Analyze this data"
67
+
68
+ ✓ Good: "Analyze the Q4 sales data below.
69
+ Identify the top 3 trends, calculate YoY growth
70
+ for each product line, and flag any anomalies
71
+ more than 2 standard deviations from the mean.
72
+ Present as a markdown table."</div>
73
+ </div>`,
74
+ interview: `
75
+ <div class="section">
76
+ <h2>Interview Questions: Prompt Engineering Basics</h2>
77
+ <div class="interview-box">
78
+ <div class="box-title">Q1: What is prompt engineering and why is it important?</div>
79
+ <div class="box-content">Prompt engineering is the practice of designing effective inputs for AI language models. It's important because the quality of AI output is directly proportional to the quality of the input prompt. Good prompts reduce costs (fewer retries), improve reliability, and enable consistent automation.</div>
80
+ </div>
81
+ <div class="interview-box">
82
+ <div class="box-title">Q2: What are the four components of an effective prompt?</div>
83
+ <div class="box-content"><strong>Role</strong> (who the AI should be), <strong>Context</strong> (background info), <strong>Task</strong> (specific action), and <strong>Format</strong> (how to structure output). Not all are required for every prompt, but complex tasks benefit from all four.</div>
84
+ </div>
85
+ <div class="interview-box">
86
+ <div class="box-title">Q3: How do you measure prompt quality?</div>
87
+ <div class="box-content">Key metrics: accuracy (correctness), relevance (on-topic), completeness (nothing missing), consistency (same prompt → similar results), and efficiency (tokens used). Use evaluation rubrics and A/B testing across multiple runs.</div>
88
+ </div>
89
+ </div>`
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  },
91
+ "structure": {
92
+ concepts: `
93
+ <div class="section">
94
+ <h2>The Four Building Blocks</h2>
95
+ <table>
96
+ <tr><th>Component</th><th>Purpose</th><th>Example</th></tr>
97
+ <tr><td><strong>Role</strong></td><td>Sets expertise level & perspective</td><td>"You are a senior data scientist..."</td></tr>
98
+ <tr><td><strong>Context</strong></td><td>Background information</td><td>"Given this dataset of 10K customer records..."</td></tr>
99
+ <tr><td><strong>Task</strong></td><td>Specific action to perform</td><td>"Identify the top 5 churn predictors"</td></tr>
100
+ <tr><td><strong>Format</strong></td><td>Output structure</td><td>"Present as a numbered list with confidence scores"</td></tr>
101
+ </table>
102
+ <h3>How Components Work Together</h3>
103
+ <div class="info-box">
104
+ <div class="box-title">🧱 Think of it like building a house</div>
105
+ <div class="box-content">Role = architect's style, Context = site conditions, Task = what to build, Format = blueprint specs. Missing any one leads to suboptimal results.</div>
106
+ </div>
107
+ </div>`,
108
+ code: `
109
+ <div class="section">
110
+ <h2>Prompt Structure Templates</h2>
111
+ <h3>Full 4-Component Template</h3>
112
+ <div class="code-block">ROLE: You are a [expertise] with [years] experience in [domain].
113
+
114
+ CONTEXT: [Background information, constraints, data description]
115
+
116
+ TASK: [Specific action be precise about what to do]
117
+
118
+ FORMAT: [How to structure the output — bullets, table, JSON, etc.]</div>
119
+ <h3>Minimal Template (simple tasks)</h3>
120
+ <div class="code-block">As a [role], [task]. Output as [format].</div>
121
+ <h3>Professional Email Template</h3>
122
+ <div class="code-block">ROLE: You are a professional business writer.
123
+
124
+ CONTEXT: We're launching a new SaaS product for HR teams.
125
+ The audience is VP-level decision makers.
126
+ Tone: confident but not aggressive.
127
+
128
+ TASK: Write a cold outreach email under 150 words that
129
+ highlights 3 pain points and our solution.
130
+
131
+ FORMAT: Subject line + email body. Use short paragraphs.</div>
132
+ </div>`,
133
+ interview: `
134
+ <div class="section">
135
+ <h2>Interview Questions: Prompt Structure</h2>
136
+ <div class="interview-box">
137
+ <div class="box-title">Q1: When would you omit the Role component?</div>
138
+ <div class="box-content">For simple, factual questions ("What's the capital of France?") or when the default assistant behavior is sufficient. Role is most valuable for specialized tasks requiring domain expertise or a particular perspective.</div>
139
+ </div>
140
+ <div class="interview-box">
141
+ <div class="box-title">Q2: How does adding context affect token usage vs quality?</div>
142
+ <div class="box-content">More context uses more input tokens but typically reduces output tokens (fewer retries needed). The ROI is positive for complex tasks. For simple tasks, minimal context is fine — over-contextualizing can actually confuse models.</div>
143
+ </div>
144
+ </div>`
145
  },
146
+ "clarity": {
147
+ concepts: `
148
+ <div class="section">
149
+ <h2>Writing Precise Prompts</h2>
150
+ <p>Ambiguity is the #1 cause of poor AI output. Every word in your prompt should serve a purpose.</p>
151
+ <h3>5 Rules of Clarity</h3>
152
+ <table>
153
+ <tr><th>#</th><th>Rule</th><th>Bad Example</th><th>Good Example</th></tr>
154
+ <tr><td>1</td><td>Be specific</td><td>"Make it better"</td><td>"Reduce word count by 30%"</td></tr>
155
+ <tr><td>2</td><td>Use numbers</td><td>"Write a short summary"</td><td>"Write a 50-word summary"</td></tr>
156
+ <tr><td>3</td><td>Define terms</td><td>"Analyze sentiment"</td><td>"Rate sentiment 1-5 (1=very negative)"</td></tr>
157
+ <tr><td>4</td><td>Set boundaries</td><td>"List some examples"</td><td>"List exactly 5 examples"</td></tr>
158
+ <tr><td>5</td><td>Specify format</td><td>"Give me the data"</td><td>"Return as CSV with headers"</td></tr>
159
+ </table>
160
+ </div>`,
161
+ code: `
162
+ <div class="section">
163
+ <h2>Clarity Examples</h2>
164
+ <div class="code-block">❌ Vague: "Help me with my resume"
165
+
166
+ ✓ Clear: "Review my resume below for a Senior Data Engineer role.
167
+ Score each section 1-10: summary, experience, skills, education.
168
+ For any section scoring below 7, provide specific rewrite
169
+ suggestions with before/after examples."</div>
170
+ <div class="code-block">❌ Vague: "Make this code faster"
171
+
172
+ ✓ Clear: "Optimize this Python function for speed.
173
+ Current: processes 10K records in 5 seconds.
174
+ Target: under 1 second.
175
+ Constraints: must maintain the same input/output interface.
176
+ Show benchmarks before and after."</div>
177
+ </div>`,
178
+ interview: `
179
+ <div class="section">
180
+ <h2>Interview Questions: Clarity & Specificity</h2>
181
+ <div class="interview-box">
182
+ <div class="box-title">Q1: How do you handle inherently ambiguous tasks?</div>
183
+ <div class="box-content">Break ambiguous tasks into specific sub-tasks. Ask the AI to first clarify assumptions, then proceed. Use constraints to narrow the scope. For creative tasks where some ambiguity is desired, control it with parameters like "creative but professional tone."</div>
184
+ </div>
185
+ </div>`
186
  },
187
+ "context": {
188
+ concepts: `
189
+ <div class="section">
190
+ <h2>Providing the Right Context</h2>
191
+ <p>Context bridges the gap between what you know and what the AI knows. Too little = guessing. Too much = distraction.</p>
192
+ <h3>Types of Context</h3>
193
+ <table>
194
+ <tr><th>Type</th><th>When to Use</th><th>Example</th></tr>
195
+ <tr><td><strong>Domain</strong></td><td>Specialized fields</td><td>"In the context of Kubernetes orchestration..."</td></tr>
196
+ <tr><td><strong>Audience</strong></td><td>Tailoring output</td><td>"The audience is non-technical executives"</td></tr>
197
+ <tr><td><strong>Constraints</strong></td><td>Setting boundaries</td><td>"Must comply with HIPAA regulations"</td></tr>
198
+ <tr><td><strong>Data</strong></td><td>Working with specific info</td><td>"Given this JSON payload: {...}"</td></tr>
199
+ <tr><td><strong>History</strong></td><td>Multi-turn conversations</td><td>"Building on our previous analysis..."</td></tr>
200
+ </table>
201
+ </div>`,
202
+ code: `
203
+ <div class="section">
204
+ <h2>Context Templates</h2>
205
+ <div class="code-block">TEMPLATE: Data Analysis with Context
206
+
207
+ CONTEXT:
208
+ - Dataset: 50K rows of e-commerce transactions (Jan-Dec 2024)
209
+ - Columns: order_id, customer_id, product, amount, date, region
210
+ - Business goal: reduce cart abandonment by 15%
211
+ - Constraint: recommendations must be implementable within 30 days
212
+
213
+ TASK: Identify the top 3 actionable insights from this data.</div>
214
+ </div>`,
215
+ interview: `
216
+ <div class="section">
217
+ <h2>Interview Questions: Context</h2>
218
+ <div class="interview-box">
219
+ <div class="box-title">Q1: What's the difference between over-contextualization and under-contextualization?</div>
220
+ <div class="box-content"><strong>Under</strong>: AI fills gaps with assumptions (often wrong). <strong>Over</strong>: AI gets confused by irrelevant details, wastes tokens, and may focus on the wrong aspects. The sweet spot is providing only context that directly affects the desired output.</div>
221
+ </div>
222
+ </div>`
223
  },
224
+ "output": {
225
+ concepts: `
226
+ <div class="section">
227
+ <h2>Specifying Output Format</h2>
228
+ <p>Format specifications eliminate guesswork and make AI output directly usable in your workflow.</p>
229
+ <table>
230
+ <tr><th>Format Type</th><th>Use Case</th><th>Prompt Pattern</th></tr>
231
+ <tr><td>JSON</td><td>API responses, data pipelines</td><td>"Return valid JSON with keys: name, score, reasons"</td></tr>
232
+ <tr><td>Markdown</td><td>Documentation, reports</td><td>"Use ## headers, bullet points, code blocks"</td></tr>
233
+ <tr><td>Table</td><td>Comparisons, structured data</td><td>"Present as a table with columns: X, Y, Z"</td></tr>
234
+ <tr><td>Numbered List</td><td>Steps, rankings</td><td>"List as numbered steps, each under 20 words"</td></tr>
235
+ <tr><td>Code</td><td>Implementation</td><td>"Write in Python 3.11+ with type hints and docstrings"</td></tr>
236
+ </table>
237
+ </div>`,
238
+ code: `
239
+ <div class="section">
240
+ <h2>Output Format Examples</h2>
241
+ <div class="code-block">JSON Output:
242
+ "Analyze this product review and return JSON:
243
+ {
244
+ 'sentiment': 'positive|negative|neutral',
245
+ 'confidence': 0.0-1.0,
246
+ 'key_topics': ['topic1', 'topic2'],
247
+ 'summary': 'one sentence summary'
248
+ }"</div>
249
+ <div class="code-block">Table Output:
250
+ "Compare React, Vue, and Angular.
251
+ Format as a markdown table with columns:
252
+ Feature | React | Vue | Angular
253
+ Include rows for: learning curve, performance,
254
+ ecosystem, job market, best for."</div>
255
+ </div>`,
256
+ interview: `
257
+ <div class="section">
258
+ <h2>Interview Questions: Output Format</h2>
259
+ <div class="interview-box">
260
+ <div class="box-title">Q1: How do you ensure consistent JSON output from LLMs?</div>
261
+ <div class="box-content">1) Provide the exact schema in the prompt. 2) Use API features like OpenAI's function calling or Gemini's JSON Schema mode. 3) For Claude, use response prefilling starting with "{". 4) Include an example of the expected output. 5) Add "Return ONLY valid JSON, no other text" as a constraint.</div>
262
+ </div>
263
+ </div>`
264
  },
265
+ "refinement": {
266
+ concepts: `
267
+ <div class="section">
268
+ <h2>Iterative Prompt Refinement</h2>
269
+ <p>Great prompts aren't written — they're refined. Use systematic testing to improve results.</p>
270
+ <h3>The Refinement Loop</h3>
271
+ <table>
272
+ <tr><th>Step</th><th>Action</th><th>Goal</th></tr>
273
+ <tr><td>1. Draft</td><td>Write initial prompt</td><td>Get a baseline result</td></tr>
274
+ <tr><td>2. Evaluate</td><td>Score output quality</td><td>Identify weaknesses</td></tr>
275
+ <tr><td>3. Diagnose</td><td>Find root cause</td><td>Understand why it failed</td></tr>
276
+ <tr><td>4. Refine</td><td>Modify prompt</td><td>Address specific issues</td></tr>
277
+ <tr><td>5. Test</td><td>Run again with variations</td><td>Verify improvement</td></tr>
278
+ </table>
279
+ <div class="callout tip">
280
+ <div class="callout-title">✅ Pro Tip</div>
281
+ <p>Keep a prompt journal — track what you changed and why. This builds your personal prompt library over time.</p>
282
+ </div>
283
+ </div>`,
284
+ code: `
285
+ <div class="section">
286
+ <h2>Refinement in Practice</h2>
287
+ <div class="code-block">Iteration 1 (Draft):
288
+ "Write a product description for headphones."
289
+ → Result: Generic, bland, 200 words
290
+
291
+ Iteration 2 (Add specifics):
292
+ "Write a product description for Sony WH-1000XM5.
293
+ Target: audiophiles. Tone: technical but accessible."
294
+ → Result: Better, but too long
295
+
296
+ Iteration 3 (Add constraints):
297
+ "Write a 60-word product description for Sony WH-1000XM5.
298
+ Target: audiophiles. Tone: technical but accessible.
299
+ Must mention: noise cancellation, 30-hour battery, LDAC codec.
300
+ End with a call to action."
301
+ → Result: ✓ Excellent — concise, targeted, actionable</div>
302
+ </div>`,
303
+ interview: `
304
+ <div class="section">
305
+ <h2>Interview Questions: Refinement</h2>
306
+ <div class="interview-box">
307
+ <div class="box-title">Q1: How do you systematically A/B test prompts?</div>
308
+ <div class="box-content">1) Define clear evaluation criteria (accuracy, format, completeness). 2) Run both prompts on the same set of 10+ test inputs. 3) Score each output against criteria. 4) Use statistical significance tests if needed. 5) Keep the winning prompt and iterate further.</div>
309
+ </div>
310
+ </div>`
311
  },
312
+ "advanced": {
313
+ concepts: `
314
+ <div class="section">
315
+ <h2>Advanced Prompting Techniques</h2>
316
+ <table>
317
+ <tr><th>Technique</th><th>What It Does</th><th>Best For</th></tr>
318
+ <tr><td><strong>Zero-Shot</strong></td><td>Direct instruction, no examples</td><td>Simple, well-defined tasks</td></tr>
319
+ <tr><td><strong>Few-Shot</strong></td><td>Provide 2-5 examples</td><td>Pattern replication, formatting</td></tr>
320
+ <tr><td><strong>Chain-of-Thought</strong></td><td>"Think step by step"</td><td>Math, logic, reasoning</td></tr>
321
+ <tr><td><strong>System Prompts</strong></td><td>Persistent role/rules</td><td>Chatbots, consistent behavior</td></tr>
322
+ <tr><td><strong>Self-Consistency</strong></td><td>Generate multiple answers, pick majority</td><td>High-stakes decisions</td></tr>
323
+ <tr><td><strong>Tree of Thoughts</strong></td><td>Explore multiple reasoning paths</td><td>Complex problem solving</td></tr>
324
+ </table>
325
+ <h3>Chain-of-Thought Deep Dive</h3>
326
+ <div class="info-box">
327
+ <div class="box-title">🧠 Why CoT works</div>
328
+ <div class="box-content">By asking the model to show its reasoning, you force it to decompose the problem. This reduces errors in math, logic, and multi-step tasks by 30-50%.</div>
329
+ </div>
330
+ </div>`,
331
+ code: `
332
+ <div class="section">
333
+ <h2>Advanced Techniques in Action</h2>
334
+ <h3>Few-Shot Example</h3>
335
+ <div class="code-block">Classify the sentiment of each review:
336
+
337
+ Review: "The battery life is incredible!"
338
+ Sentiment: Positive
339
+
340
+ Review: "Broke after 2 days, terrible quality"
341
+ Sentiment: Negative
342
+
343
+ Review: "It's okay, nothing special"
344
+ Sentiment: Neutral
345
+
346
+ Review: "Best purchase I've made this year!"
347
+ Sentiment:</div>
348
+ <h3>Chain-of-Thought Example</h3>
349
+ <div class="code-block">"A store has 45 apples. They sell 60% on Monday
350
+ and half of the remainder on Tuesday.
351
+ How many are left?
352
+
353
+ Think through this step by step before answering."
354
+
355
+ → Step 1: 60% of 45 = 27 sold on Monday
356
+ → Step 2: Remaining = 45 - 27 = 18
357
+ → Step 3: Half of 18 = 9 sold on Tuesday
358
+ → Step 4: Remaining = 18 - 9 = 9 apples</div>
359
+ </div>`,
360
+ interview: `
361
+ <div class="section">
362
+ <h2>Interview Questions: Advanced Techniques</h2>
363
+ <div class="interview-box">
364
+ <div class="box-title">Q1: When would you use few-shot over zero-shot?</div>
365
+ <div class="box-content">Use few-shot when: 1) The task has a specific format the model might not default to. 2) You need consistent output patterns. 3) The task is domain-specific and examples clarify expectations. Zero-shot is better when: the task is straightforward, examples might bias the output, or you want more creative/diverse responses.</div>
366
+ </div>
367
+ <div class="interview-box">
368
+ <div class="box-title">Q2: Explain self-consistency prompting.</div>
369
+ <div class="box-content">Generate multiple responses (3-5) to the same prompt using higher temperature, then take the majority answer. This is like polling multiple experts — reduces variance and improves reliability on reasoning tasks. Trade-off: costs more tokens.</div>
370
+ </div>
371
+ </div>`
372
  },
373
+ "applications": {
374
+ concepts: `
375
+ <div class="section">
376
+ <h2>Real-World Applications</h2>
377
+ <table>
378
+ <tr><th>Domain</th><th>Use Case</th><th>Key Technique</th></tr>
379
+ <tr><td>Software Dev</td><td>Code review, debugging, documentation</td><td>Role + structured output</td></tr>
380
+ <tr><td>Marketing</td><td>Ad copy, SEO content, A/B variants</td><td>Few-shot + constraints</td></tr>
381
+ <tr><td>Data Science</td><td>EDA, feature engineering, reporting</td><td>Context + CoT</td></tr>
382
+ <tr><td>Education</td><td>Tutoring, quiz generation, explanations</td><td>Role + audience-aware</td></tr>
383
+ <tr><td>Legal</td><td>Contract analysis, compliance checks</td><td>RAG + structured output</td></tr>
384
+ <tr><td>Healthcare</td><td>Literature review, patient summaries</td><td>Context + safety constraints</td></tr>
385
+ </table>
386
+ </div>`,
387
+ code: `
388
+ <div class="section">
389
+ <h2>Application Templates</h2>
390
+ <h3>Code Review Prompt</h3>
391
+ <div class="code-block">You are a senior software engineer (15 years, Python expert).
392
+
393
+ Review this code for:
394
+ 1. Bugs and edge cases
395
+ 2. Performance issues (O(n) analysis)
396
+ 3. Security vulnerabilities (OWASP Top 10)
397
+ 4. Code style (PEP 8 compliance)
398
+
399
+ For each issue found:
400
+ - Severity: Critical / Major / Minor
401
+ - Line number
402
+ - Description
403
+ - Fix with code example
404
+
405
+ Code to review:
406
+ """
407
+ [paste code here]
408
+ """</div>
409
+ </div>`,
410
+ interview: `
411
+ <div class="section">
412
+ <h2>Interview Questions: Applications</h2>
413
+ <div class="interview-box">
414
+ <div class="box-title">Q1: How do you design prompts for production systems vs ad-hoc use?</div>
415
+ <div class="box-content">Production prompts need: 1) Deterministic output (low temperature). 2) Structured format (JSON/schema). 3) Error handling instructions ("If input is invalid, return {error: ...}"). 4) Version control. 5) Evaluation metrics. Ad-hoc prompts can be more flexible and creative.</div>
416
+ </div>
417
+ </div>`
418
  },
419
+ "claude": {
420
+ concepts: `
421
+ <div class="section">
422
+ <h2>Why Claude Is Different</h2>
423
+ <p>Claude is fine-tuned by Anthropic with emphasis on <strong>helpfulness, harmlessness, and honesty</strong>. It's specifically trained to respect <strong>XML-based structure</strong> in prompts.</p>
424
+ <div class="info-box">
425
+ <div class="box-title">💡 Think of Claude as a brilliant new employee</div>
426
+ <div class="box-content">It has broad knowledge but needs explicit context about your specific situation.</div>
427
+ </div>
428
+ <h3>Key Claude Techniques</h3>
429
+ <table>
430
+ <tr><th>Technique</th><th>What It Does</th><th>When to Use</th></tr>
431
+ <tr><td><strong>XML Tags</strong></td><td>Semantic structure for prompts</td><td>Always — Claude's killer feature</td></tr>
432
+ <tr><td><strong>Thinking Blocks</strong></td><td>Step-by-step reasoning scratchpad</td><td>Math, logic, complex analysis</td></tr>
433
+ <tr><td><strong>Response Prefilling</strong></td><td>Start Claude's response for you</td><td>Forcing JSON, controlling format</td></tr>
434
+ <tr><td><strong>Prompt Chaining</strong></td><td>Sequential subtask pipeline</td><td>Complex multi-step workflows</td></tr>
435
+ <tr><td><strong>Positive Framing</strong></td><td>Say "do X" not "don't do Y"</td><td>All Claude prompts</td></tr>
436
+ <tr><td><strong>Allow Uncertainty</strong></td><td>Let Claude say "I don't know"</td><td>Reducing hallucinations</td></tr>
437
+ </table>
438
+ </div>`,
439
+ code: `
440
+ <div class="section">
441
+ <h2>Claude Prompt Templates</h2>
442
+ <h3>XML-Structured Code Review</h3>
443
+ <div class="code-block">&lt;role&gt;Expert Python code reviewer&lt;/role&gt;
444
+
445
+ &lt;code&gt;
446
+ def factorial(n):
447
+ return n * factorial(n-1)
448
+ &lt;/code&gt;
449
+
450
+ &lt;instructions&gt;
451
+ 1. Identify all bugs and edge cases
452
+ 2. Suggest improvements with examples
453
+ 3. Rate code quality (1-10)
454
+ &lt;/instructions&gt;
455
+
456
+ &lt;output_format&gt;markdown with code blocks&lt;/output_format&gt;</div>
457
+ <h3>Response Prefilling (API)</h3>
458
+ <div class="code-block">User: "Extract name, age, city from: 'John is 30, lives in NYC'"
459
+
460
+ Prefilled assistant response: {"name":
461
+
462
+ → Claude continues: {"name": "John", "age": 30, "city": "NYC"}</div>
463
+ <h3>Prompt Chaining Pipeline</h3>
464
+ <div class="code-block">Step 1: "Read this document and extract the 5 main arguments."
465
+ ↓ output feeds into...
466
+ Step 2: "For each argument: [step 1 output], evaluate strength
467
+ (1-10) and identify counterarguments."
468
+ ↓ output feeds into...
469
+ Step 3: "Using this analysis: [step 2 output], write a balanced
470
+ 500-word summary."</div>
471
+ <h3>Document Analysis Template</h3>
472
+ <div class="code-block">&lt;role&gt;Expert analyst&lt;/role&gt;
473
+
474
+ &lt;document&gt;
475
+ {{paste document here}}
476
+ &lt;/document&gt;
477
+
478
+ &lt;instructions&gt;
479
+ 1. Summarize the key points
480
+ 2. Identify potential issues
481
+ 3. Provide recommendations
482
+ &lt;/instructions&gt;
483
+
484
+ &lt;output_format&gt;
485
+ Use headers for each section.
486
+ Keep each point under 50 words.
487
+ &lt;/output_format&gt;</div>
488
+ </div>`,
489
+ interview: `
490
+ <div class="section">
491
+ <h2>Interview Questions: Claude</h2>
492
+ <div class="interview-box">
493
+ <div class="box-title">Q1: Why does Claude respond better to XML tags than other models?</div>
494
+ <div class="box-content">Claude is specifically fine-tuned by Anthropic to parse XML tags as semantic structure. Unlike other models that treat XML as text, Claude understands that &lt;instructions&gt; contains directives and &lt;context&gt; contains background. This training makes XML-structured prompts significantly more effective with Claude.</div>
495
+ </div>
496
+ <div class="interview-box">
497
+ <div class="box-title">Q2: Explain Claude's Extended Thinking feature.</div>
498
+ <div class="box-content">Extended Thinking gives Claude a dedicated scratchpad for complex reasoning before producing a final answer. Enabled via API with {"thinking": {"type": "enabled", "budget_tokens": 10000}}. The thinking is visible to you but separate from the final response. Error rates drop 50%+ on reasoning tasks.</div>
499
+ </div>
500
+ <div class="interview-box">
501
+ <div class="box-title">Q3: What's Response Prefilling and when to use it?</div>
502
+ <div class="box-content">Prefilling starts Claude's response with specific text via the API. Use cases: 1) Force JSON output by prefilling with "{". 2) Prevent chatty preambles. 3) Guide output format. 4) Continue from a specific point. It's unique to Claude's API and not available in the web interface.</div>
503
+ </div>
504
+ </div>`
505
  },
506
+ "gemini": {
507
+ concepts: `
508
+ <div class="section">
509
+ <h2>The Gemini Difference</h2>
510
+ <p>Google's Gemini is <strong>natively multimodal</strong> it processes text, images, audio, and video in a single prompt. It also supports <strong>system instructions</strong> that persist across turns.</p>
511
+ <div class="callout insight">
512
+ <div class="callout-title">💡 Key Insight</div>
513
+ <p>Gemini 2.0+ may over-analyze verbose prompts — keep instructions precise and direct.</p>
514
+ </div>
515
+ <h3>Key Gemini Techniques</h3>
516
+ <table>
517
+ <tr><th>Technique</th><th>What It Does</th><th>Best For</th></tr>
518
+ <tr><td><strong>System Instructions</strong></td><td>Persistent rules across all turns</td><td>Chatbots, consistent AI apps</td></tr>
519
+ <tr><td><strong>JSON Schema Output</strong></td><td>Guaranteed structured responses</td><td>API integrations, data pipelines</td></tr>
520
+ <tr><td><strong>Multimodal Input</strong></td><td>Text + image + audio + video</td><td>Content analysis, accessibility</td></tr>
521
+ <tr><td><strong>Temperature/Top-K/Top-P</strong></td><td>Fine-grained randomness control</td><td>Tuning creativity vs accuracy</td></tr>
522
+ <tr><td><strong>Step-Back Prompting</strong></td><td>Abstract before solving</td><td>Complex domain questions</td></tr>
523
+ <tr><td><strong>ReAct Pattern</strong></td><td>Reason + Act loop</td><td>AI agents with tool use</td></tr>
524
+ </table>
525
+ </div>`,
526
+ code: `
527
+ <div class="section">
528
+ <h2>Gemini Prompt Templates</h2>
529
+ <h3>System Instruction Example</h3>
530
+ <div class="code-block">System: You are a professional data analyst at a Fortune 500 company.
531
+
532
+ Rules:
533
+ - Always cite data sources
534
+ - Use metric units unless asked otherwise
535
+ - Present numbers with 2 decimal places for percentages
536
+ - If asked about topics outside data analysis, politely redirect
537
+ - Format responses with clear headers and bullet points
538
+
539
+ → These rules apply to EVERY subsequent user message.</div>
540
+ <h3>JSON Schema Output (API)</h3>
541
+ <div class="code-block">// Set response_mime_type to "application/json"
542
+ // Provide response_schema:
543
+ {
544
+ "product_name": "string",
545
+ "rating": "number (1-5)",
546
+ "pros": ["string"],
547
+ "cons": ["string"],
548
+ "would_recommend": "boolean"
549
  }
550
 
551
+ Gemini GUARANTEES valid JSON matching this schema.</div>
552
+ <h3>Step-Back Prompting</h3>
553
+ <div class="code-block">Step 1: "What physics principle governs the relationship
554
+ between pressure, temperature, and volume of gases?"
555
+
556
+ Step 2: "Using that principle, what happens to pressure
557
+ if temperature is tripled and volume is halved?"
558
+
559
+ → AI first recalls PV=nRT, then applies it correctly.</div>
560
+ <h3>ReAct Agent Pattern</h3>
561
+ <div class="code-block">Thought: I need to find the current stock price of NVIDIA
562
+ Action: search("NVIDIA stock price today")
563
+ Observation: NVIDIA (NVDA) is trading at $875.32
564
+
565
+ Thought: Now I need to calculate the market cap
566
+ Action: calculate(875.32 × 24.49 billion shares)
567
+ Observation: Market cap ≈ $21.4 trillion
568
+
569
+ Answer: NVIDIA's current market cap is approximately...</div>
570
+ </div>`,
571
+ interview: `
572
+ <div class="section">
573
+ <h2>Interview Questions: Gemini</h2>
574
+ <div class="interview-box">
575
+ <div class="box-title">Q1: How does Gemini's multimodal capability differ from other models?</div>
576
+ <div class="box-content">Gemini is natively multimodal — trained on text, images, audio, and video together from the start. Other models often bolt on vision/audio as separate modules. This means Gemini can process a video and answer questions about it in a single prompt, or analyze images alongside text naturally.</div>
577
+ </div>
578
+ <div class="interview-box">
579
+ <div class="box-title">Q2: Explain Temperature, Top-K, and Top-P tuning.</div>
580
+ <div class="box-content"><strong>Temperature</strong> (0-2): Controls randomness. 0 = deterministic, 2 = maximum creativity. <strong>Top-K</strong> (1-40): Limits token selection to most probable K tokens. <strong>Top-P</strong> (0-1): Nucleus sampling — selects from tokens whose cumulative probability reaches P. Use low temp for factual tasks, high for brainstorming.</div>
581
+ </div>
582
+ <div class="interview-box">
583
+ <div class="box-title">Q3: What is step-back prompting?</div>
584
+ <div class="box-content">A Google research technique where you ask the AI to first abstract/generalize the problem before solving it. Example: Before asking "What's 15% of $342?", first ask "What's the formula for calculating percentages?" This helps the model recall the right framework before applying it.</div>
585
+ </div>
586
+ </div>`
587
  },
588
+ "openai": {
589
+ concepts: `
590
+ <div class="section">
591
+ <h2>OpenAI's Prompting Philosophy</h2>
592
+ <p>OpenAI's approach centers on <strong>six core strategies</strong>: write clear instructions, provide reference text, split complex tasks, give models time to think, use external tools, and test systematically.</p>
593
+ <div class="callout insight">
594
+ <div class="callout-title">💡 Key Insight</div>
595
+ <p>For o1/o3 reasoning models, use SIMPLER prompts — they have built-in chain-of-thought. Over-prompting can hurt.</p>
596
+ </div>
597
+ <h3>Key OpenAI Techniques</h3>
598
+ <table>
599
+ <tr><th>Technique</th><th>What It Does</th><th>Best For</th></tr>
600
+ <tr><td><strong>Delimiters</strong></td><td>### """ --- to separate sections</td><td>Preventing prompt injection</td></tr>
601
+ <tr><td><strong>Function Calling</strong></td><td>Structured JSON tool outputs</td><td>API integrations, data extraction</td></tr>
602
+ <tr><td><strong>RAG</strong></td><td>Ground responses in your docs</td><td>Reducing hallucinations</td></tr>
603
+ <tr><td><strong>Self-Improvement</strong></td><td>AI critiques & refines own output</td><td>High-quality content</td></tr>
604
+ <tr><td><strong>Multi-Perspective</strong></td><td>Simulate different expert views</td><td>Comprehensive analysis</td></tr>
605
+ <tr><td><strong>Context Engineering</strong></td><td>Curate entire context window</td><td>Production AI systems</td></tr>
606
+ </table>
607
+ </div>`,
608
+ code: `
609
+ <div class="section">
610
+ <h2>OpenAI Prompt Templates</h2>
611
+ <h3>Delimiter Pattern</h3>
612
+ <div class="code-block">Summarize the text delimited by triple quotes.
613
+
614
+ """
615
+ {{long article text here}}
616
+ """
617
+
618
+ ###
619
+ Rules:
620
+ - Keep summary under 100 words
621
+ - Focus on key findings
622
+ - Use bullet points
623
+ ###</div>
624
+ <h3>Recursive Self-Improvement (3-Step)</h3>
625
+ <div class="code-block">Step 1 — Generate:
626
+ "Write a marketing email for our new SaaS product."
627
+
628
+ Step 2 — Critique:
629
+ "Review this email for: clarity, persuasiveness,
630
+ call-to-action effectiveness, and tone.
631
+ Score each dimension 1-10 and explain weaknesses."
632
+
633
+ Step 3 — Refine:
634
+ "Rewrite the email addressing these specific
635
+ weaknesses: [critique output].
636
+ Aim for 9+/10 on all dimensions."</div>
637
+ <h3>Multi-Perspective Analysis</h3>
638
+ <div class="code-block">Analyze this business proposal from three perspectives:
639
+
640
+ 1. CFO: Focus on financial viability, ROI, cash flow
641
+ 2. CTO: Focus on technical feasibility, scalability, risks
642
+ 3. CMO: Focus on market opportunity, brand impact
643
+
644
+ For each perspective, provide:
645
+ - Top 3 concerns
646
+ - Top 3 opportunities
647
+ - Recommendation (Go / No-Go / Conditional)
648
+
649
+ Then synthesize a unified recommendation.</div>
650
+ </div>`,
651
+ interview: `
652
+ <div class="section">
653
+ <h2>Interview Questions: OpenAI GPT</h2>
654
+ <div class="interview-box">
655
+ <div class="box-title">Q1: What is function calling and how does it work?</div>
656
+ <div class="box-content">Function calling lets you define function signatures (name, description, parameters with types) in the API request. GPT decides when to call functions and returns structured JSON with arguments. You execute the function and return results. Supports parallel calling in GPT-4o. Perfect for building AI agents that interact with APIs.</div>
657
+ </div>
658
+ <div class="interview-box">
659
+ <div class="box-title">Q2: Explain RAG and its benefits.</div>
660
+ <div class="box-content">Retrieval-Augmented Generation: 1) Embed your docs as vectors. 2) On each query, retrieve relevant chunks. 3) Include them as context in the prompt. Benefits: reduces hallucinations, provides up-to-date info, enables domain-specific answers without fine-tuning, and you can cite sources.</div>
661
+ </div>
662
+ <div class="interview-box">
663
+ <div class="box-title">Q3: What is "context engineering"?</div>
664
+ <div class="box-content">The evolution beyond prompt engineering. Instead of crafting individual prompts, you curate the ENTIRE context window: system message (role/rules), tool definitions (available functions), retrieved context (RAG results), and conversation history (filtered/summarized). The prompt is just one piece of the bigger picture.</div>
665
+ </div>
666
+ </div>`
667
  },
668
+ "comparison": {
669
+ concepts: `
670
+ <div class="section">
671
+ <h2>Side-by-Side Comparison</h2>
672
+ <table>
673
+ <tr>
674
+ <th>Feature</th>
675
+ <th style="color:#B07DFF">🟣 Claude</th>
676
+ <th style="color:#4285F4">🔵 Gemini</th>
677
+ <th style="color:#10A37F">🟢 GPT</th>
678
+ </tr>
679
+ <tr><td>Best Structuring</td><td>XML Tags</td><td>System Instructions</td><td>Delimiters (###/""")</td></tr>
680
+ <tr><td>Structured Output</td><td>Prefilling</td><td>JSON Schema</td><td>Function Calling</td></tr>
681
+ <tr><td>Reasoning</td><td>Extended Thinking</td><td>Step-Back Prompting</td><td>o1/o3 Models</td></tr>
682
+ <tr><td>Multimodal</td><td>Text + Images</td><td>Text+Image+Audio+Video</td><td>Text + Image + Audio</td></tr>
683
+ <tr><td>Context Window</td><td>200K tokens</td><td>1M+ tokens</td><td>128K tokens</td></tr>
684
+ <tr><td>Tool Use</td><td>Tool Use API</td><td>Function Declarations</td><td>Function Calling</td></tr>
685
+ <tr><td>Unique Strength</td><td>Long-form analysis</td><td>Multimodal + Google</td><td>Ecosystem + tools</td></tr>
686
+ </table>
687
+ <h3>When to Use Which Model</h3>
688
+ <div class="info-box">
689
+ <div class="box-title">🟣 Choose Claude when...</div>
690
+ <div class="box-content">Long document analysis (200K context), nuanced writing, XML-structured prompts, complex reasoning, coding with explanations</div>
691
+ </div>
692
+ <div class="info-box">
693
+ <div class="box-title">🔵 Choose Gemini when...</div>
694
+ <div class="box-content">Multimodal tasks (image/audio/video), extremely long context (1M+), Google integration, guaranteed JSON output, grounding with Search</div>
695
+ </div>
696
+ <div class="info-box">
697
+ <div class="box-title">🟢 Choose GPT when...</div>
698
+ <div class="box-content">Building apps with API, complex tool-use, hard math/reasoning (o1/o3), existing OpenAI ecosystem, image generation (DALL-E)</div>
699
+ </div>
700
+ </div>`,
701
+ code: `
702
+ <div class="section">
703
+ <h2>Cross-Platform Prompt Adaptation</h2>
704
+ <p>The same task requires different prompt structures across providers:</p>
705
+ <h3>Task: Code Review</h3>
706
+ <div class="code-block">🟣 CLAUDE VERSION:
707
+ &lt;role&gt;Senior code reviewer&lt;/role&gt;
708
+ &lt;code language="python"&gt;
709
+ def process(data):
710
+ return [x*2 for x in data if x > 0]
711
+ &lt;/code&gt;
712
+ &lt;instructions&gt;
713
+ Review for bugs, performance, readability.
714
+ Use &lt;thinking&gt; tags before responding.
715
+ &lt;/instructions&gt;</div>
716
+ <div class="code-block">🔵 GEMINI VERSION:
717
+ System: You are a senior code reviewer.
718
+ Always respond in JSON format.
719
+
720
+ User: Review this Python code:
721
+ \`\`\`python
722
+ def process(data):
723
+ return [x*2 for x in data if x > 0]
724
+ \`\`\`
725
+ Provide: bugs, performance, readability (1-10), improved version.</div>
726
+ <div class="code-block">🟢 GPT VERSION:
727
+ You are a senior code reviewer.
728
+
729
+ Review the following code:
730
+ ###
731
+ def process(data):
732
+ return [x*2 for x in data if x > 0]
733
+ ###
734
+
735
+ Evaluate:
736
+ 1. Bugs or edge cases
737
+ 2. Performance concerns
738
+ 3. Readability (1-10)
739
+ 4. Improved version with comments</div>
740
+ </div>`,
741
+ interview: `
742
+ <div class="section">
743
+ <h2>Interview Questions: Provider Strategy</h2>
744
+ <div class="interview-box">
745
+ <div class="box-title">Q1: How do you decide which AI provider to use for a project?</div>
746
+ <div class="box-content">Consider: 1) Task type — multimodal? Use Gemini. Long docs? Claude. API integration? GPT. 2) Context needs — 1M tokens? Gemini. 200K? Claude. 128K? GPT. 3) Output format — guaranteed JSON? Gemini Schema. Tool use? GPT Functions. 4) Budget and latency requirements. 5) Existing tech stack integration.</div>
747
+ </div>
748
+ <div class="interview-box">
749
+ <div class="box-title">Q2: What's the future of prompt engineering?</div>
750
+ <div class="box-content">Four key trends: 1) <strong>Context engineering</strong> — curating entire context windows, not just prompts. 2) <strong>Agentic workflows</strong> — prompts become policies for autonomous AI agents. 3) <strong>Multimodal-first</strong> — combining text, images, audio, video as standard. 4) <strong>Automated optimization</strong> — tools like DSPy auto-optimize prompts.</div>
751
+ </div>
752
+ <div class="interview-box">
753
+ <div class="box-title">Q3: How do you maintain a cross-platform prompt library?</div>
754
+ <div class="box-content">Keep a "prompt cookbook" with 3 versions of each template (Claude/Gemini/GPT). Version control prompts like code. Document: what each prompt does, which model it's for, expected input/output format, and performance metrics. Update when model versions change.</div>
755
+ </div>
756
+ </div>`
757
  }
758
  };
759
 
760
+ // ============== Rendering Functions ==============
761
+ function renderDashboard() {
762
+ document.getElementById('modulesGrid').innerHTML = modules.map(m => `
763
+ <div class="card" onclick="showModule('${m.id}')">
764
+ <div class="card-icon">${m.icon}</div>
765
+ <h3>${m.title}</h3>
766
+ <p>${m.description}</p>
767
+ <span class="category-label">${m.category}</span>
768
+ </div>
769
+ `).join('');
 
 
 
770
  }
771
 
772
+ function showModule(moduleId) {
773
+ const module = modules.find(m => m.id === moduleId);
774
+ const content = MODULE_CONTENT[moduleId];
775
+ document.getElementById('dashboard').classList.remove('active');
776
+
777
+ document.getElementById('modulesContainer').innerHTML = `
778
+ <div class="module active" id="module-${moduleId}">
779
+ <button class="btn-back" onclick="backToDashboard()">← Back to Dashboard</button>
780
+ <header>
781
+ <h1>${module.icon} ${module.title}</h1>
782
+ <p class="subtitle">${module.description}</p>
783
+ </header>
784
+ <div class="tabs">
785
+ <button class="tab-btn active" onclick="switchTab('${moduleId}', 'concepts', event)">📖 Key Concepts</button>
786
+ <button class="tab-btn" onclick="switchTab('${moduleId}', 'code', event)">💻 Prompt Templates</button>
787
+ <button class="tab-btn" onclick="switchTab('${moduleId}', 'interview', event)">🎯 Interview Questions</button>
788
+ </div>
789
+ <div id="${moduleId}-concepts" class="tab active">${content.concepts}</div>
790
+ <div id="${moduleId}-code" class="tab">${content.code}</div>
791
+ <div id="${moduleId}-interview" class="tab">${content.interview}</div>
792
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
793
  `;
 
 
 
 
 
 
794
  }
795
 
796
+ function switchTab(moduleId, tabName, e) {
797
+ const moduleEl = document.getElementById(`module-${moduleId}`);
798
+ moduleEl.querySelectorAll('.tab-btn').forEach(btn => btn.classList.remove('active'));
799
+ if (e && e.target) {
800
+ e.target.classList.add('active');
801
+ } else {
802
+ const tabNames = ['concepts', 'code', 'interview'];
803
+ const idx = tabNames.indexOf(tabName);
804
+ if (idx !== -1) moduleEl.querySelectorAll('.tab-btn')[idx]?.classList.add('active');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
805
  }
806
+ moduleEl.querySelectorAll('.tab').forEach(tab => tab.classList.remove('active'));
807
+ document.getElementById(`${moduleId}-${tabName}`).classList.add('active');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
808
  }
809
 
810
+ function backToDashboard() {
811
+ document.querySelectorAll('.module').forEach(m => m.remove());
812
+ document.getElementById('dashboard').classList.add('active');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
813
  }
814
 
815
+ renderDashboard();
 
 
 
 
 
 
 
 
 
 
 
 
 
prompt-engineering-guide/index.html CHANGED
@@ -1,10 +1,22 @@
1
  <!DOCTYPE html>
2
  <html lang="en">
 
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>Prompt Engineering Masterclass</title>
 
 
7
  <style>
 
 
 
 
 
 
 
 
 
8
  * {
9
  margin: 0;
10
  padding: 0;
@@ -12,1650 +24,378 @@
12
  }
13
 
14
  body {
15
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
16
- background-color: #121212;
17
- color: #FFFFFF;
18
  line-height: 1.6;
19
- overflow-x: hidden;
20
- }
21
-
22
- .app-container {
23
- display: flex;
24
- min-height: 100vh;
25
- }
26
-
27
- /* Sidebar */
28
- .sidebar {
29
- width: 280px;
30
- background: #1a1a1a;
31
- border-right: 1px solid #333;
32
- position: fixed;
33
- height: 100vh;
34
- overflow-y: auto;
35
- padding: 20px;
36
- z-index: 100;
37
- }
38
-
39
- .sidebar-header {
40
- margin-bottom: 30px;
41
- }
42
-
43
- .sidebar-header h1 {
44
- font-size: 20px;
45
- color: #0066FF;
46
- margin-bottom: 5px;
47
- }
48
-
49
- .sidebar-header p {
50
- font-size: 12px;
51
- color: #888;
52
- }
53
-
54
- .progress-bar {
55
- width: 100%;
56
- height: 4px;
57
- background: #333;
58
- border-radius: 2px;
59
- margin: 15px 0;
60
- overflow: hidden;
61
- }
62
-
63
- .progress-fill {
64
- height: 100%;
65
- background: linear-gradient(90deg, #0066FF, #00D9FF);
66
- width: 0%;
67
- transition: width 0.5s ease;
68
  }
69
 
70
- .topic-list {
71
- list-style: none;
 
 
72
  }
73
 
74
- .topic-item {
75
- padding: 12px 15px;
76
- margin-bottom: 8px;
77
- background: #222;
78
- border-radius: 8px;
79
- cursor: pointer;
80
- transition: all 0.3s ease;
81
- border-left: 3px solid transparent;
82
  }
83
 
84
- .topic-item:hover {
85
- background: #2a2a2a;
86
- border-left-color: #0066FF;
 
 
 
 
87
  }
88
 
89
- .topic-item.active {
90
- background: #0066FF22;
91
- border-left-color: #0066FF;
92
- }
93
-
94
- .topic-item h3 {
95
- font-size: 14px;
96
- margin-bottom: 3px;
97
- color: #fff;
98
  }
99
 
100
- .topic-item p {
101
- font-size: 11px;
102
- color: #888;
103
- }
104
-
105
- /* Main Content */
106
- .main-content {
107
- flex: 1;
108
- margin-left: 280px;
109
- padding: 40px;
110
- max-width: 1200px;
111
- }
112
-
113
- .content-section {
114
  display: none;
115
- animation: fadeIn 0.5s ease;
116
  }
117
 
118
- .content-section.active {
119
  display: block;
120
  }
121
 
122
- @keyframes fadeIn {
123
- from { opacity: 0; transform: translateY(20px); }
124
- to { opacity: 1; transform: translateY(0); }
125
- }
126
-
127
- .section-header {
128
- margin-bottom: 30px;
129
- }
130
-
131
- .section-header h2 {
132
- font-size: 36px;
133
- color: #00D9FF;
134
- margin-bottom: 8px;
135
- }
136
-
137
- .section-header .subtitle {
138
- font-size: 18px;
139
- color: #888;
140
- margin-bottom: 15px;
141
- }
142
-
143
- .section-header .description {
144
- font-size: 16px;
145
- color: #ccc;
146
- line-height: 1.8;
147
  }
148
 
149
- /* Cards */
150
  .card {
151
- background: #1a1a1a;
152
- border: 1px solid #333;
153
- border-radius: 12px;
154
- padding: 25px;
155
- margin-bottom: 25px;
156
  transition: all 0.3s ease;
 
 
157
  }
158
 
159
- .card:hover {
160
- border-color: #0066FF;
161
- box-shadow: 0 4px 20px rgba(0, 102, 255, 0.1);
162
- }
163
-
164
- .card h3 {
165
- font-size: 20px;
166
- color: #00D9FF;
167
- margin-bottom: 15px;
168
- }
169
-
170
- .card p {
171
- font-size: 15px;
172
- color: #ccc;
173
- line-height: 1.8;
174
  }
175
 
176
- /* Callout Boxes */
177
- .callout {
178
- padding: 18px 20px;
179
- border-radius: 8px;
180
- margin: 15px 0;
181
- border-left: 4px solid;
182
- font-size: 14px;
183
- line-height: 1.6;
184
  }
185
 
186
- .callout-insight {
187
- background: rgba(0, 217, 255, 0.1);
188
- border-color: #00D9FF;
189
- color: #00D9FF;
190
  }
191
 
192
- .callout-mistake {
193
- background: rgba(255, 107, 53, 0.1);
194
- border-color: #FF6B35;
195
- color: #FF6B35;
196
  }
197
 
198
- .callout-tip {
199
- background: rgba(0, 255, 136, 0.1);
200
- border-color: #00FF88;
201
- color: #00FF88;
202
  }
203
 
204
- .callout strong {
205
- margin-right: 8px;
 
 
206
  }
207
 
208
- /* Interactive Elements */
209
- .interactive-demo {
210
- background: #0a0a0a;
211
- border: 2px solid #333;
 
212
  border-radius: 12px;
213
- padding: 30px;
214
- margin: 25px 0;
215
- }
216
-
217
- .prompt-builder {
218
- display: grid;
219
- grid-template-columns: 1fr 1fr;
220
- gap: 20px;
221
- margin-top: 20px;
222
- }
223
-
224
- .prompt-component {
225
- background: #1a1a1a;
226
- padding: 15px;
227
- border-radius: 8px;
228
- border: 2px dashed #444;
229
- }
230
-
231
- .prompt-component h4 {
232
- color: #0066FF;
233
- font-size: 14px;
234
- margin-bottom: 10px;
235
- }
236
-
237
- .prompt-component textarea {
238
- width: 100%;
239
- background: #222;
240
- border: 1px solid #444;
241
- color: #fff;
242
- padding: 10px;
243
- border-radius: 6px;
244
- font-size: 14px;
245
- font-family: inherit;
246
- resize: vertical;
247
- min-height: 80px;
248
- }
249
-
250
- .prompt-component textarea:focus {
251
- outline: none;
252
- border-color: #0066FF;
253
  }
254
 
255
- .output-preview {
256
- grid-column: 1 / -1;
257
- background: #1a1a1a;
258
- padding: 20px;
259
- border-radius: 8px;
260
- border: 2px solid #0066FF;
261
  }
262
 
263
- .quality-grade {
264
- display: inline-block;
265
- padding: 8px 16px;
266
- border-radius: 20px;
267
- font-weight: 600;
268
- font-size: 14px;
269
- margin-bottom: 15px;
270
  }
271
 
272
- .grade-poor { background: #FF6B35; color: #000; }
273
- .grade-good { background: #FFB800; color: #000; }
274
- .grade-excellent { background: #00FF88; color: #000; }
275
-
276
- /* Canvas */
277
- .canvas-container {
278
- position: relative;
279
- width: 100%;
280
- height: 400px;
281
- background: #0a0a0a;
282
- border: 2px solid #333;
283
- border-radius: 12px;
284
- margin: 25px 0;
285
- overflow: hidden;
286
- }
287
 
288
- canvas {
289
- display: block;
290
- width: 100%;
291
- height: 100%;
292
  }
293
 
294
- /* Buttons */
295
- .btn {
296
- padding: 12px 24px;
297
  border: none;
 
298
  border-radius: 8px;
299
- font-size: 14px;
300
- font-weight: 600;
301
  cursor: pointer;
302
- transition: all 0.3s ease;
303
- display: inline-block;
304
- text-decoration: none;
305
- }
306
-
307
- .btn-primary {
308
- background: #0066FF;
309
- color: #fff;
310
- }
311
-
312
- .btn-primary:hover {
313
- background: #0052CC;
314
- transform: translateY(-2px);
315
- box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
316
  }
317
 
318
- .btn-secondary {
319
- background: #333;
320
- color: #fff;
321
  }
322
 
323
- .btn-secondary:hover {
324
- background: #444;
 
325
  }
326
 
327
- .btn-group {
 
328
  display: flex;
329
- gap: 10px;
330
- margin: 20px 0;
 
331
  flex-wrap: wrap;
332
  }
333
 
334
- /* Slider */
335
- .slider-control {
336
- margin: 25px 0;
337
- }
338
-
339
- .slider-control label {
340
- display: block;
341
- color: #00D9FF;
342
- font-size: 14px;
343
- font-weight: 600;
344
- margin-bottom: 10px;
345
- }
346
-
347
- .slider {
348
- width: 100%;
349
- height: 6px;
350
- border-radius: 3px;
351
- background: #333;
352
- outline: none;
353
- -webkit-appearance: none;
354
- }
355
-
356
- .slider::-webkit-slider-thumb {
357
- -webkit-appearance: none;
358
- appearance: none;
359
- width: 20px;
360
- height: 20px;
361
- border-radius: 50%;
362
- background: #0066FF;
363
  cursor: pointer;
364
- transition: all 0.3s ease;
 
 
365
  }
366
 
367
- .slider::-webkit-slider-thumb:hover {
368
- background: #00D9FF;
369
- transform: scale(1.2);
370
- }
371
-
372
- .slider::-moz-range-thumb {
373
- width: 20px;
374
- height: 20px;
375
- border-radius: 50%;
376
- background: #0066FF;
377
- cursor: pointer;
378
- border: none;
379
  }
380
 
381
- .slider-value {
382
- display: inline-block;
383
- margin-left: 15px;
384
  color: #fff;
385
- font-weight: 600;
386
  }
387
 
388
- /* Comparison */
389
- .comparison {
390
- display: grid;
391
- grid-template-columns: 1fr 1fr;
392
- gap: 20px;
393
- margin: 25px 0;
394
  }
395
 
396
- .comparison-item {
397
- background: #1a1a1a;
398
- padding: 20px;
399
- border-radius: 8px;
400
- border: 2px solid #333;
401
  }
402
 
403
- .comparison-item.bad {
404
- border-color: #FF6B35;
 
 
 
 
 
405
  }
406
 
407
- .comparison-item.good {
408
- border-color: #00FF88;
 
 
409
  }
410
 
411
- .comparison-item h4 {
412
- margin-bottom: 12px;
413
- font-size: 16px;
 
414
  }
415
 
416
- .comparison-item.bad h4 {
417
- color: #FF6B35;
 
 
 
 
 
 
418
  }
419
 
420
- .comparison-item.good h4 {
421
- color: #00FF88;
 
 
 
422
  }
423
 
424
- /* Navigation */
425
- .nav-buttons {
426
- display: flex;
427
- justify-content: space-between;
428
- margin-top: 40px;
429
- padding-top: 30px;
430
- border-top: 1px solid #333;
431
  }
432
 
433
- /* Component Grid */
434
- .component-grid {
435
- display: grid;
436
- grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
437
- gap: 20px;
438
- margin: 25px 0;
439
  }
440
 
441
- .component-card {
442
- background: #1a1a1a;
443
- padding: 20px;
 
444
  border-radius: 8px;
445
- border: 2px solid #333;
446
- transition: all 0.3s ease;
447
- }
448
-
449
- .component-card:hover {
450
- border-color: #0066FF;
451
- transform: translateY(-4px);
452
- }
453
-
454
- .component-card h4 {
455
- color: #0066FF;
456
- font-size: 16px;
457
- margin-bottom: 10px;
458
- }
459
-
460
- .component-card p {
461
- font-size: 14px;
462
  color: #ccc;
463
- margin-bottom: 12px;
464
- }
465
-
466
- .component-card code {
467
- display: block;
468
- background: #0a0a0a;
469
- padding: 10px;
470
- border-radius: 4px;
471
- font-size: 13px;
472
- color: #00D9FF;
473
- font-family: 'Courier New', monospace;
474
- }
475
-
476
- /* Steps */
477
- .steps {
478
- margin: 25px 0;
479
  }
480
 
481
- .step {
482
- display: flex;
483
- gap: 20px;
484
- margin-bottom: 25px;
485
- padding: 20px;
486
- background: #1a1a1a;
487
  border-radius: 8px;
488
- border-left: 4px solid #0066FF;
 
489
  }
490
 
491
- .step-number {
492
- flex-shrink: 0;
493
- width: 40px;
494
- height: 40px;
495
- background: #0066FF;
496
- color: #fff;
497
- border-radius: 50%;
498
- display: flex;
499
- align-items: center;
500
- justify-content: center;
501
  font-weight: 700;
502
- font-size: 18px;
 
 
503
  }
504
 
505
- .step-content h4 {
506
- color: #00D9FF;
507
- font-size: 16px;
508
- margin-bottom: 8px;
509
  }
510
 
511
- .step-content p {
512
- font-size: 14px;
513
- color: #ccc;
 
 
 
 
514
  }
515
 
516
- /* Use Cases */
517
- .use-case-section {
518
- margin: 30px 0;
 
 
 
519
  }
520
 
521
- .use-case-section h4 {
522
- color: #0066FF;
523
- font-size: 18px;
524
- margin-bottom: 15px;
525
  }
526
 
527
- .use-case-list {
528
- list-style: none;
529
- padding-left: 0;
530
  }
531
 
532
- .use-case-list li {
533
- padding: 12px 15px;
534
- background: #1a1a1a;
535
- border-left: 3px solid #00D9FF;
536
- margin-bottom: 10px;
537
- border-radius: 4px;
538
- font-size: 14px;
539
  }
540
 
541
- /* Checklist */
542
- .checklist {
543
- list-style: none;
544
- margin: 20px 0;
545
  }
546
 
547
- .checklist li {
548
- padding: 12px;
549
- margin-bottom: 8px;
550
- background: #1a1a1a;
551
- border-radius: 6px;
552
- font-size: 14px;
553
- cursor: pointer;
554
- transition: all 0.3s ease;
555
- display: flex;
556
- align-items: center;
557
- gap: 12px;
558
  }
559
 
560
- .checklist li:hover {
561
- background: #222;
 
 
 
562
  }
563
 
564
- .checklist li::before {
565
- content: '☐';
566
- font-size: 20px;
567
- color: #666;
 
568
  }
569
 
570
- .checklist li.checked::before {
571
- content: '✓';
572
- color: #00FF88;
573
  }
574
 
575
- .checklist li.checked {
576
- opacity: 0.6;
577
- text-decoration: line-through;
578
  }
579
 
580
- /* Responsive */
581
  @media (max-width: 768px) {
582
- .sidebar {
583
- width: 100%;
584
- position: relative;
585
- height: auto;
586
- border-right: none;
587
- border-bottom: 1px solid #333;
588
- }
589
-
590
- .main-content {
591
- margin-left: 0;
592
- padding: 20px;
593
  }
594
 
595
- .prompt-builder,
596
- .comparison,
597
- .component-grid {
598
  grid-template-columns: 1fr;
599
  }
600
 
601
- .section-header h2 {
602
- font-size: 28px;
603
  }
604
  }
605
-
606
- /* Template Library */
607
- .template-library {
608
- display: grid;
609
- grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
610
- gap: 15px;
611
- margin: 25px 0;
612
- }
613
-
614
- .template-item {
615
- background: #1a1a1a;
616
- padding: 18px;
617
- border-radius: 8px;
618
- border: 2px solid #333;
619
- cursor: pointer;
620
- transition: all 0.3s ease;
621
- }
622
-
623
- .template-item:hover {
624
- border-color: #0066FF;
625
- background: #222;
626
- }
627
-
628
- .template-item h5 {
629
- color: #00D9FF;
630
- font-size: 15px;
631
- margin-bottom: 10px;
632
- }
633
-
634
- .template-item pre {
635
- background: #0a0a0a;
636
- padding: 12px;
637
- border-radius: 4px;
638
- font-size: 12px;
639
- color: #ccc;
640
- overflow-x: auto;
641
- white-space: pre-wrap;
642
- }
643
-
644
- /* Practice Challenge */
645
- .challenge-box {
646
- background: linear-gradient(135deg, #0066FF22, #00D9FF22);
647
- border: 2px solid #0066FF;
648
- border-radius: 12px;
649
- padding: 30px;
650
- margin: 30px 0;
651
- }
652
-
653
- .challenge-box h3 {
654
- color: #00D9FF;
655
- margin-bottom: 15px;
656
- }
657
-
658
- .challenge-prompt {
659
- background: #0a0a0a;
660
- padding: 20px;
661
- border-radius: 8px;
662
- margin: 15px 0;
663
- font-size: 14px;
664
- color: #ccc;
665
- }
666
-
667
- .feedback {
668
- background: #1a1a1a;
669
- padding: 15px;
670
- border-radius: 8px;
671
- margin-top: 15px;
672
- display: none;
673
- }
674
-
675
- .feedback.show {
676
- display: block;
677
- animation: slideDown 0.3s ease;
678
- }
679
-
680
- @keyframes slideDown {
681
- from { opacity: 0; transform: translateY(-10px); }
682
- to { opacity: 1; transform: translateY(0); }
683
- }
684
-
685
- /* Scenario Selector */
686
- .scenario-selector {
687
- display: flex;
688
- gap: 12px;
689
- margin: 20px 0;
690
- flex-wrap: wrap;
691
- }
692
-
693
- .scenario-btn {
694
- padding: 10px 18px;
695
- background: #1a1a1a;
696
- border: 2px solid #333;
697
- border-radius: 8px;
698
- color: #fff;
699
- cursor: pointer;
700
- transition: all 0.3s ease;
701
- font-size: 14px;
702
- }
703
-
704
- .scenario-btn:hover {
705
- border-color: #0066FF;
706
- background: #222;
707
- }
708
-
709
- .scenario-btn.active {
710
- border-color: #0066FF;
711
- background: #0066FF22;
712
- color: #00D9FF;
713
- }
714
-
715
- .hidden {
716
- display: none;
717
- }
718
  </style>
719
  </head>
720
- <body>
721
- <div class="app-container">
722
- <!-- Sidebar -->
723
- <aside class="sidebar">
724
- <div class="sidebar-header">
725
- <h1>Prompt Engineering</h1>
726
- <p>Master the Art of AI Communication</p>
727
- <div class="progress-bar">
728
- <div class="progress-fill" id="progressBar"></div>
729
- </div>
730
- </div>
731
- <ul class="topic-list" id="topicList"></ul>
732
- </aside>
733
-
734
- <!-- Main Content -->
735
- <main class="main-content">
736
- <!-- Topic 1: Introduction -->
737
- <section class="content-section active" id="topic-1">
738
- <div class="section-header">
739
- <h2>Introduction to Prompt Engineering</h2>
740
- <p class="subtitle">What Is It and Why Does It Matter?</p>
741
- <p class="description">Learn the fundamentals of prompt engineering and why it's crucial in the AI era</p>
742
- </div>
743
-
744
- <div class="card">
745
- <h3>What is Prompt Engineering?</h3>
746
- <p>Prompt engineering is the art of writing clear, specific instructions for AI models to produce desired outputs. Think of it as learning to communicate effectively with an intelligent assistant.</p>
747
- <p>Just like how you'd give detailed instructions to a colleague for important work, prompt engineering teaches you to craft precise, contextual requests that help AI understand exactly what you need.</p>
748
- </div>
749
-
750
- <div class="callout callout-insight">
751
- <strong>💡 Insight:</strong> The difference between a vague and specific prompt can be 10x in output quality
752
- </div>
753
-
754
- <div class="card">
755
- <h3>Real-World Analogy</h3>
756
- <p><strong>Ordering Food:</strong></p>
757
- <div class="comparison">
758
- <div class="comparison-item bad">
759
- <h4>❌ Vague Order</h4>
760
- <p>"Give me something to eat."</p>
761
- <p style="margin-top: 10px; font-size: 13px; color: #888;">Result: You might get anything - could be great, could be terrible, probably not what you wanted.</p>
762
- </div>
763
- <div class="comparison-item good">
764
- <h4>✓ Detailed Order</h4>
765
- <p>"I'd like a medium pepperoni pizza with thin crust, extra cheese, and light sauce. Please deliver it to 123 Main St by 7 PM."</p>
766
- <p style="margin-top: 10px; font-size: 13px; color: #888;">Result: You get exactly what you wanted, when you wanted it.</p>
767
- </div>
768
- </div>
769
- </div>
770
-
771
- <div class="callout callout-tip">
772
- <strong>✅ Tip:</strong> AI models don't read minds—be explicit about what you want
773
- </div>
774
-
775
- <div class="card">
776
- <h3>Why Does It Matter?</h3>
777
- <p>In today's AI-powered world, the ability to communicate effectively with AI systems is becoming as important as traditional communication skills. Good prompt engineering helps you:</p>
778
- <ul style="margin-left: 20px; margin-top: 10px; color: #ccc;">
779
- <li style="margin-bottom: 8px;">Save time by getting better results on the first try</li>
780
- <li style="margin-bottom: 8px;">Unlock advanced AI capabilities for complex tasks</li>
781
- <li style="margin-bottom: 8px;">Reduce errors and misunderstandings</li>
782
- <li style="margin-bottom: 8px;">Boost productivity across all domains</li>
783
- </ul>
784
- </div>
785
-
786
- <div class="card">
787
- <h3>Key Applications</h3>
788
- <div class="use-case-section">
789
- <ul class="use-case-list">
790
- <li>📧 Email writing and summarization</li>
791
- <li>📊 Report generation and data analysis</li>
792
- <li>💻 Code generation and debugging</li>
793
- <li>✍️ Creative writing and content creation</li>
794
- <li>🎓 Educational content and explanations</li>
795
- </ul>
796
- </div>
797
- </div>
798
-
799
- <div class="callout callout-mistake">
800
- <strong>⚠️ Common Mistake:</strong> Assuming AI knows what you want without explicit instructions
801
- </div>
802
-
803
- <div class="card">
804
- <h3>Summary &amp; Key Takeaways</h3>
805
- <ul class="checklist">
806
- <li>Prompt engineering is about clear AI communication</li>
807
- <li>Specificity dramatically improves output quality</li>
808
- <li>It's a learnable skill that improves with practice</li>
809
- <li>Applications span professional, technical, and creative domains</li>
810
- </ul>
811
- <div class="btn-group" style="margin-top: 20px;">
812
- <button class="btn btn-primary" onclick="startPractice(1)">Try Practice Challenge</button>
813
- </div>
814
- </div>
815
-
816
- <div class="nav-buttons">
817
- <button class="btn btn-secondary" disabled>← Previous</button>
818
- <button class="btn btn-primary" onclick="navigateTo(2)">Next: Prompt Structure →</button>
819
- </div>
820
- </section>
821
-
822
- <!-- Topic 2: Prompt Structure -->
823
- <section class="content-section" id="topic-2">
824
- <div class="section-header">
825
- <h2>Prompt Structure: The Building Blocks</h2>
826
- <p class="subtitle">Role, Context, Task, and Format</p>
827
- <p class="description">Master the four key components of effective prompts</p>
828
- </div>
829
-
830
- <div class="card">
831
- <h3>The Four Components</h3>
832
- <p>Every effective prompt has four essential building blocks. Understanding and using these components will transform your AI interactions.</p>
833
- </div>
834
-
835
- <div class="component-grid">
836
- <div class="component-card">
837
- <h4>1. Role</h4>
838
- <p>What persona should the AI adopt?</p>
839
- <code>"You are an expert marketing consultant"</code>
840
- </div>
841
- <div class="component-card">
842
- <h4>2. Context</h4>
843
- <p>What background information is important?</p>
844
- <code>"We just launched a new coffee shop in Manhattan"</code>
845
- </div>
846
- <div class="component-card">
847
- <h4>3. Task</h4>
848
- <p>What exactly should the AI do?</p>
849
- <code>"Generate 5 creative marketing strategies"</code>
850
- </div>
851
- <div class="component-card">
852
- <h4>4. Format</h4>
853
- <p>How should the output be structured?</p>
854
- <code>"Provide as bullet points with pros and cons"</code>
855
- </div>
856
- </div>
857
-
858
- <div class="callout callout-insight">
859
- <strong>💡 Insight:</strong> Context is king—more information usually means better output
860
- </div>
861
-
862
- <div class="interactive-demo">
863
- <h3 style="color: #00D9FF; margin-bottom: 20px;">Interactive Prompt Builder</h3>
864
- <p style="color: #888; margin-bottom: 15px;">Fill in each component and watch the quality grade update in real-time:</p>
865
-
866
- <div class="prompt-builder">
867
- <div class="prompt-component">
868
- <h4>Role</h4>
869
- <textarea id="roleInput" placeholder="e.g., You are a senior software engineer..." oninput="updatePromptQuality()"></textarea>
870
- </div>
871
- <div class="prompt-component">
872
- <h4>Context</h4>
873
- <textarea id="contextInput" placeholder="e.g., Working on a mobile app for..." oninput="updatePromptQuality()"></textarea>
874
- </div>
875
- <div class="prompt-component">
876
- <h4>Task</h4>
877
- <textarea id="taskInput" placeholder="e.g., Write a function that..." oninput="updatePromptQuality()"></textarea>
878
- </div>
879
- <div class="prompt-component">
880
- <h4>Format</h4>
881
- <textarea id="formatInput" placeholder="e.g., Provide code with comments..." oninput="updatePromptQuality()"></textarea>
882
- </div>
883
- <div class="output-preview">
884
- <span class="quality-grade grade-poor" id="qualityGrade">Quality: Poor</span>
885
- <h4 style="color: #00D9FF; margin-bottom: 10px;">Combined Prompt:</h4>
886
- <p id="combinedPrompt" style="color: #ccc; font-size: 14px;">Start filling in the components above...</p>
887
- </div>
888
- </div>
889
- </div>
890
-
891
- <div class="callout callout-tip">
892
- <strong>✅ Tip:</strong> Start with clear action verbs: Write, Analyze, Explain, Generate, Debug
893
- </div>
894
-
895
- <div class="canvas-container">
896
- <canvas id="structureCanvas"></canvas>
897
- </div>
898
-
899
- <div class="card">
900
- <h3>Summary &amp; Key Takeaways</h3>
901
- <ul class="checklist">
902
- <li>All four components work together for best results</li>
903
- <li>Role sets the AI's perspective and expertise level</li>
904
- <li>Context provides necessary background information</li>
905
- <li>Task defines the specific action you want</li>
906
- <li>Format ensures output matches your needs</li>
907
- </ul>
908
- </div>
909
-
910
- <div class="nav-buttons">
911
- <button class="btn btn-secondary" onclick="navigateTo(1)">← Previous</button>
912
- <button class="btn btn-primary" onclick="navigateTo(3)">Next: Clarity &amp; Specificity →</button>
913
- </div>
914
- </section>
915
-
916
- <!-- Topic 3: Clarity and Specificity -->
917
- <section class="content-section" id="topic-3">
918
- <div class="section-header">
919
- <h2>Clarity and Specificity</h2>
920
- <p class="subtitle">Writing Precise Prompts</p>
921
- <p class="description">Learn how to eliminate ambiguity and get better results</p>
922
- </div>
923
 
924
- <div class="card">
925
- <h3>Why Specificity Matters</h3>
926
- <p>Vague prompts leave too much room for interpretation. The AI has to guess what you want, and guesses are rarely perfect. Specific prompts eliminate ambiguity and guide the AI to produce exactly what you need.</p>
927
- </div>
928
-
929
- <div class="callout callout-insight">
930
- <strong>💡 Insight:</strong> Testing and iteration is key to prompt mastery
931
- </div>
932
-
933
- <div class="card">
934
- <h3>Before &amp; After Examples</h3>
935
- <div class="comparison" style="margin-top: 20px;">
936
- <div class="comparison-item bad">
937
- <h4>❌ Vague Prompt</h4>
938
- <p style="font-family: monospace; font-size: 13px;">"Write something about AI"</p>
939
- </div>
940
- <div class="comparison-item good">
941
- <h4>✓ Specific Prompt</h4>
942
- <p style="font-family: monospace; font-size: 13px;">"Write a 200-word beginner's guide explaining how machine learning works, using a coffee shop analogy"</p>
943
- </div>
944
- </div>
945
-
946
- <div class="comparison" style="margin-top: 20px;">
947
- <div class="comparison-item bad">
948
- <h4>❌ Vague Prompt</h4>
949
- <p style="font-family: monospace; font-size: 13px;">"Fix my code"</p>
950
- </div>
951
- <div class="comparison-item good">
952
- <h4>✓ Specific Prompt</h4>
953
- <p style="font-family: monospace; font-size: 13px;">"I have a Python function that calculates factorial but it returns wrong results for numbers &gt; 10. Here's the code: [code]. What's the bug and how do I fix it?"</p>
954
- </div>
955
- </div>
956
- </div>
957
-
958
- <div class="callout callout-mistake">
959
- <strong>⚠️ Common Mistake:</strong> Not specifying output format, then being surprised by format
960
- </div>
961
-
962
- <div class="interactive-demo">
963
- <h3 style="color: #00D9FF; margin-bottom: 20px;">Specificity Slider</h3>
964
- <p style="color: #888; margin-bottom: 15px;">Adjust the specificity level and see how the prompt improves:</p>
965
-
966
- <div class="slider-control">
967
- <label>Specificity Level: <span class="slider-value" id="specificityValue">1</span>/5</label>
968
- <input type="range" min="1" max="5" value="1" class="slider" id="specificitySlider" oninput="updateSpecificity()">
969
- </div>
970
-
971
- <div style="margin-top: 25px; background: #1a1a1a; padding: 20px; border-radius: 8px;">
972
- <h4 style="color: #00D9FF; margin-bottom: 12px;">Current Prompt:</h4>
973
- <p id="specificityPrompt" style="color: #ccc; font-size: 14px; line-height: 1.8;"></p>
974
- <div style="margin-top: 15px; padding: 12px; background: #0a0a0a; border-radius: 6px;">
975
- <strong style="color: #00D9FF;">Expected Quality:</strong>
976
- <span id="specificityQuality" style="margin-left: 10px;"></span>
977
- </div>
978
- </div>
979
- </div>
980
-
981
- <div class="callout callout-tip">
982
- <strong>✅ Tip:</strong> Use phrases like 'For a 10th-grade student' to guide tone and complexity
983
- </div>
984
-
985
- <div class="card">
986
- <h3>Key Elements of Specific Prompts</h3>
987
- <div class="steps">
988
- <div class="step">
989
- <div class="step-number">1</div>
990
- <div class="step-content">
991
- <h4>Define Clear Objectives</h4>
992
- <p>State exactly what you want to achieve</p>
993
- </div>
994
- </div>
995
- <div class="step">
996
- <div class="step-number">2</div>
997
- <div class="step-content">
998
- <h4>Set Constraints</h4>
999
- <p>Specify length, style, tone, or other limitations</p>
1000
- </div>
1001
- </div>
1002
- <div class="step">
1003
- <div class="step-number">3</div>
1004
- <div class="step-content">
1005
- <h4>Provide Examples</h4>
1006
- <p>Show the AI what good output looks like</p>
1007
- </div>
1008
- </div>
1009
- <div class="step">
1010
- <div class="step-number">4</div>
1011
- <div class="step-content">
1012
- <h4>Specify Audience</h4>
1013
- <p>Indicate who will consume the output</p>
1014
- </div>
1015
- </div>
1016
- </div>
1017
- </div>
1018
-
1019
- <div class="card">
1020
- <h3>Summary &amp; Key Takeaways</h3>
1021
- <ul class="checklist">
1022
- <li>Vague prompts lead to unpredictable results</li>
1023
- <li>Add specific details: length, format, style, audience</li>
1024
- <li>Include examples when possible</li>
1025
- <li>Set clear constraints and boundaries</li>
1026
- <li>Think about edge cases and clarify them</li>
1027
- </ul>
1028
- </div>
1029
-
1030
- <div class="nav-buttons">
1031
- <button class="btn btn-secondary" onclick="navigateTo(2)">← Previous</button>
1032
- <button class="btn btn-primary" onclick="navigateTo(4)">Next: Context &amp; Background →</button>
1033
- </div>
1034
- </section>
1035
-
1036
- <!-- Topic 4: Context and Background -->
1037
- <section class="content-section" id="topic-4">
1038
- <div class="section-header">
1039
- <h2>Context and Background</h2>
1040
- <p class="subtitle">Providing Enough Information</p>
1041
- <p class="description">Give AI the full picture for better outputs</p>
1042
- </div>
1043
-
1044
- <div class="card">
1045
- <h3>Why Context Matters</h3>
1046
- <p>Context is the background information that helps AI understand the bigger picture. Without proper context, even the most specific task instructions can lead to irrelevant results.</p>
1047
- <p style="margin-top: 15px;">Think of context as the frame around a painting—it helps define boundaries and provides essential information for interpretation.</p>
1048
- </div>
1049
-
1050
- <div class="callout callout-insight">
1051
- <strong>💡 Insight:</strong> Format specification prevents surprises in AI responses
1052
- </div>
1053
-
1054
- <div class="card">
1055
- <h3>Essential Context Elements</h3>
1056
- <div class="component-grid">
1057
- <div class="component-card">
1058
- <h4>📄 Relevant Documents</h4>
1059
- <p>Include or reference important files, data, or prior conversations</p>
1060
- </div>
1061
- <div class="component-card">
1062
- <h4>🎯 Target Audience</h4>
1063
- <p>Specify who will use or read the output</p>
1064
- </div>
1065
- <div class="component-card">
1066
- <h4>⚙️ Constraints</h4>
1067
- <p>Mention technical, budget, or time limitations</p>
1068
- </div>
1069
- <div class="component-card">
1070
- <h4>🎨 Brand Voice</h4>
1071
- <p>Describe tone, style, or brand guidelines</p>
1072
- </div>
1073
- </div>
1074
- </div>
1075
-
1076
- <div class="callout callout-tip">
1077
- <strong>✅ Tip:</strong> Include examples of good output in your prompt
1078
- </div>
1079
-
1080
- <div class="card">
1081
- <h3>Context Levels Comparison</h3>
1082
- <div class="interactive-demo">
1083
- <div class="scenario-selector">
1084
- <button class="scenario-btn active" onclick="showContextExample('minimal')">Minimal Context</button>
1085
- <button class="scenario-btn" onclick="showContextExample('moderate')">Moderate Context</button>
1086
- <button class="scenario-btn" onclick="showContextExample('rich')">Rich Context</button>
1087
- </div>
1088
-
1089
- <div id="contextExample" style="margin-top: 20px; background: #1a1a1a; padding: 20px; border-radius: 8px;">
1090
- <h4 style="color: #00D9FF; margin-bottom: 12px;">Prompt Example:</h4>
1091
- <p id="contextPromptText" style="color: #ccc; line-height: 1.8;"></p>
1092
- <div style="margin-top: 15px; padding: 12px; background: #0a0a0a; border-radius: 6px;">
1093
- <strong style="color: #00D9FF;">Output Quality:</strong>
1094
- <span id="contextQuality" style="margin-left: 10px;"></span>
1095
- </div>
1096
- </div>
1097
- </div>
1098
- </div>
1099
-
1100
- <div class="callout callout-mistake">
1101
- <strong>⚠️ Common Mistake:</strong> Providing too little context about your problem
1102
- </div>
1103
-
1104
- <div class="card">
1105
- <h3>Best Practices for Context</h3>
1106
- <ul style="margin-left: 20px; margin-top: 15px; color: #ccc;">
1107
- <li style="margin-bottom: 12px;"><strong style="color: #00D9FF;">Be comprehensive but focused:</strong> Include all relevant information without overwhelming details</li>
1108
- <li style="margin-bottom: 12px;"><strong style="color: #00D9FF;">Front-load important context:</strong> Put crucial information at the beginning</li>
1109
- <li style="margin-bottom: 12px;"><strong style="color: #00D9FF;">Use examples:</strong> Show the AI what success looks like</li>
1110
- <li style="margin-bottom: 12px;"><strong style="color: #00D9FF;">Mention constraints:</strong> Be upfront about limitations</li>
1111
- <li style="margin-bottom: 12px;"><strong style="color: #00D9FF;">Define your audience:</strong> Specify who will consume the output</li>
1112
- </ul>
1113
- </div>
1114
-
1115
- <div class="canvas-container">
1116
- <canvas id="contextCanvas"></canvas>
1117
- </div>
1118
-
1119
- <div class="card">
1120
- <h3>Summary &amp; Key Takeaways</h3>
1121
- <ul class="checklist">
1122
- <li>Context provides the frame for AI to understand your request</li>
1123
- <li>Include relevant documents and background information</li>
1124
- <li>Specify target audience and use cases</li>
1125
- <li>Mention constraints and limitations upfront</li>
1126
- <li>Provide examples of desired output when possible</li>
1127
- </ul>
1128
- </div>
1129
-
1130
- <div class="nav-buttons">
1131
- <button class="btn btn-secondary" onclick="navigateTo(3)">← Previous</button>
1132
- <button class="btn btn-primary" onclick="navigateTo(5)">Next: Output Format →</button>
1133
- </div>
1134
- </section>
1135
-
1136
- <!-- Topic 5: Output Format -->
1137
- <section class="content-section" id="topic-5">
1138
- <div class="section-header">
1139
- <h2>Output Format and Constraints</h2>
1140
- <p class="subtitle">Specifying Desired Output</p>
1141
- <p class="description">Control exactly how the AI structures its response</p>
1142
- </div>
1143
-
1144
- <div class="card">
1145
- <h3>Why Format Matters</h3>
1146
- <p>Specifying the output format ensures you get results in a structure that's immediately useful. Without format guidance, AI might provide information in a way that requires significant reformatting.</p>
1147
- </div>
1148
-
1149
- <div class="callout callout-tip">
1150
- <strong>✅ Tip:</strong> Keep prompts focused on one main task
1151
- </div>
1152
-
1153
- <div class="card">
1154
- <h3>Common Output Formats</h3>
1155
- <div class="component-grid">
1156
- <div class="component-card">
1157
- <h4>📝 Structured List</h4>
1158
- <p>Organized points with clear hierarchy</p>
1159
- <code>"Return as numbered list with brief explanations"</code>
1160
- </div>
1161
- <div class="component-card">
1162
- <h4>📊 Table Format</h4>
1163
- <p>Data organized in rows and columns</p>
1164
- <code>"Create a comparison table with 3 columns: Feature, Pros, Cons"</code>
1165
- </div>
1166
- <div class="component-card">
1167
- <h4>📖 Narrative</h4>
1168
- <p>Flowing prose or storytelling format</p>
1169
- <code>"Write as a 3-paragraph narrative explanation"</code>
1170
- </div>
1171
- <div class="component-card">
1172
- <h4>💻 Code Block</h4>
1173
- <p>Formatted code with explanations</p>
1174
- <code>"Provide Python code with comments explaining each step"</code>
1175
- </div>
1176
- </div>
1177
- </div>
1178
-
1179
- <div class="callout callout-insight">
1180
- <strong>💡 Insight:</strong> Save and reuse effective prompts as templates
1181
- </div>
1182
-
1183
- <div class="interactive-demo">
1184
- <h3 style="color: #00D9FF; margin-bottom: 20px;">Format Selector</h3>
1185
- <p style="color: #888; margin-bottom: 15px;">Choose a format and see how to specify it in your prompt:</p>
1186
-
1187
- <div class="scenario-selector">
1188
- <button class="scenario-btn active" onclick="showFormatExample('list')">List</button>
1189
- <button class="scenario-btn" onclick="showFormatExample('table')">Table</button>
1190
- <button class="scenario-btn" onclick="showFormatExample('narrative')">Narrative</button>
1191
- <button class="scenario-btn" onclick="showFormatExample('code')">Code</button>
1192
- <button class="scenario-btn" onclick="showFormatExample('json')">JSON</button>
1193
- </div>
1194
-
1195
- <div id="formatExample" style="margin-top: 20px; background: #1a1a1a; padding: 20px; border-radius: 8px;">
1196
- <h4 style="color: #00D9FF; margin-bottom: 12px;">Format Specification:</h4>
1197
- <p id="formatPromptText" style="color: #ccc; line-height: 1.8; margin-bottom: 15px;"></p>
1198
- <h4 style="color: #00D9FF; margin-bottom: 12px;">Example Output:</h4>
1199
- <pre id="formatOutputExample" style="background: #0a0a0a; padding: 15px; border-radius: 6px; color: #ccc; overflow-x: auto;"></pre>
1200
- </div>
1201
- </div>
1202
-
1203
- <div class="callout callout-mistake">
1204
- <strong>⚠️ Common Mistake:</strong> Asking too many things in one prompt
1205
- </div>
1206
-
1207
- <div class="card">
1208
- <h3>Setting Effective Constraints</h3>
1209
- <div class="steps">
1210
- <div class="step">
1211
- <div class="step-number">1</div>
1212
- <div class="step-content">
1213
- <h4>Length Constraints</h4>
1214
- <p>Specify word count, character limit, or number of items</p>
1215
- </div>
1216
- </div>
1217
- <div class="step">
1218
- <div class="step-number">2</div>
1219
- <div class="step-content">
1220
- <h4>Style Guidelines</h4>
1221
- <p>Define tone, formality, and writing style</p>
1222
- </div>
1223
- </div>
1224
- <div class="step">
1225
- <div class="step-number">3</div>
1226
- <div class="step-content">
1227
- <h4>Structure Rules</h4>
1228
- <p>Specify sections, headings, or organization</p>
1229
- </div>
1230
- </div>
1231
- <div class="step">
1232
- <div class="step-number">4</div>
1233
- <div class="step-content">
1234
- <h4>Content Boundaries</h4>
1235
- <p>Define what to include or exclude</p>
1236
- </div>
1237
- </div>
1238
- </div>
1239
- </div>
1240
-
1241
- <div class="card">
1242
- <h3>Summary &amp; Key Takeaways</h3>
1243
- <ul class="checklist">
1244
- <li>Always specify the desired output format</li>
1245
- <li>Use clear format instructions (list, table, code, etc.)</li>
1246
- <li>Set length and style constraints</li>
1247
- <li>Define structure and organization upfront</li>
1248
- <li>Provide format examples when needed</li>
1249
- </ul>
1250
- </div>
1251
-
1252
- <div class="nav-buttons">
1253
- <button class="btn btn-secondary" onclick="navigateTo(4)">← Previous</button>
1254
- <button class="btn btn-primary" onclick="navigateTo(6)">Next: Iterative Refinement →</button>
1255
- </div>
1256
- </section>
1257
-
1258
- <!-- Topic 6: Iterative Refinement -->
1259
- <section class="content-section" id="topic-6">
1260
- <div class="section-header">
1261
- <h2>Iterative Refinement</h2>
1262
- <p class="subtitle">Testing and Improving Prompts</p>
1263
- <p class="description">How to iterate and optimize your prompts through testing</p>
1264
- </div>
1265
-
1266
- <div class="card">
1267
- <h3>The Refinement Process</h3>
1268
- <p>Perfect prompts are rarely written on the first try. Iterative refinement is the process of testing, evaluating, and improving your prompts based on actual results.</p>
1269
- <p style="margin-top: 15px;">Think of it like cooking—you taste and adjust seasonings until it's just right.</p>
1270
- </div>
1271
-
1272
- <div class="callout callout-insight">
1273
- <strong>💡 Insight:</strong> Testing and iteration is key to prompt mastery
1274
- </div>
1275
-
1276
- <div class="card">
1277
- <h3>5-Step Refinement Process</h3>
1278
- <div class="steps">
1279
- <div class="step">
1280
- <div class="step-number">1</div>
1281
- <div class="step-content">
1282
- <h4>Test Your Prompt</h4>
1283
- <p>Run your prompt and get initial output</p>
1284
- </div>
1285
- </div>
1286
- <div class="step">
1287
- <div class="step-number">2</div>
1288
- <div class="step-content">
1289
- <h4>Evaluate Results</h4>
1290
- <p>Does it meet your requirements? What's missing?</p>
1291
- </div>
1292
- </div>
1293
- <div class="step">
1294
- <div class="step-number">3</div>
1295
- <div class="step-content">
1296
- <h4>Refine</h4>
1297
- <p>Add specificity, context, or better format instructions</p>
1298
- </div>
1299
- </div>
1300
- <div class="step">
1301
- <div class="step-number">4</div>
1302
- <div class="step-content">
1303
- <h4>Test Again</h4>
1304
- <p>Compare new output with previous version</p>
1305
- </div>
1306
- </div>
1307
- <div class="step">
1308
- <div class="step-number">5</div>
1309
- <div class="step-content">
1310
- <h4>Repeat</h4>
1311
- <p>Keep iterating until satisfied</p>
1312
- </div>
1313
- </div>
1314
- </div>
1315
- </div>
1316
-
1317
- <div class="callout callout-tip">
1318
- <strong>✅ Tip:</strong> Keep a library of successful prompts for future use
1319
- </div>
1320
-
1321
- <div class="canvas-container">
1322
- <canvas id="refinementCanvas"></canvas>
1323
- </div>
1324
-
1325
- <div class="callout callout-mistake">
1326
- <strong>⚠️ Common Mistake:</strong> Not iterating or refining based on initial results
1327
- </div>
1328
-
1329
- <div class="card">
1330
- <h3>What to Look For When Evaluating</h3>
1331
- <div class="component-grid">
1332
- <div class="component-card">
1333
- <h4>✓ Accuracy</h4>
1334
- <p>Is the information correct and relevant?</p>
1335
- </div>
1336
- <div class="component-card">
1337
- <h4>✓ Completeness</h4>
1338
- <p>Did it cover everything you needed?</p>
1339
- </div>
1340
- <div class="component-card">
1341
- <h4>✓ Format</h4>
1342
- <p>Is it structured as you requested?</p>
1343
- </div>
1344
- <div class="component-card">
1345
- <h4>✓ Tone & Style</h4>
1346
- <p>Does it match your requirements?</p>
1347
- </div>
1348
- </div>
1349
- </div>
1350
-
1351
- <div class="interactive-demo">
1352
- <h3 style="color: #00D9FF; margin-bottom: 20px;">Refinement Simulator</h3>
1353
- <p style="color: #888; margin-bottom: 15px;">See how a prompt improves through iterations:</p>
1354
-
1355
- <div class="btn-group">
1356
- <button class="btn btn-primary" onclick="showIteration(1)">Iteration 1</button>
1357
- <button class="btn btn-primary" onclick="showIteration(2)">Iteration 2</button>
1358
- <button class="btn btn-primary" onclick="showIteration(3)">Iteration 3 (Final)</button>
1359
- </div>
1360
-
1361
- <div id="iterationDisplay" style="margin-top: 20px; background: #1a1a1a; padding: 20px; border-radius: 8px;">
1362
- <h4 style="color: #00D9FF; margin-bottom: 12px;">Current Iteration:</h4>
1363
- <p id="iterationPrompt" style="color: #ccc; line-height: 1.8; margin-bottom: 15px;"></p>
1364
- <div style="padding: 12px; background: #0a0a0a; border-radius: 6px;">
1365
- <strong style="color: #00D9FF;">Quality Score:</strong>
1366
- <span id="iterationScore" style="margin-left: 10px;"></span>
1367
- </div>
1368
- <div id="iterationNotes" style="margin-top: 15px; padding: 12px; border-left: 3px solid #00D9FF; background: #0a0a0a;"></div>
1369
- </div>
1370
- </div>
1371
-
1372
- <div class="card">
1373
- <h3>Summary &amp; Key Takeaways</h3>
1374
- <ul class="checklist">
1375
- <li>First attempts rarely produce perfect results</li>
1376
- <li>Test, evaluate, refine, and repeat</li>
1377
- <li>Look for accuracy, completeness, format, and style</li>
1378
- <li>Keep successful prompts as templates</li>
1379
- <li>Small tweaks can lead to big improvements</li>
1380
- </ul>
1381
- </div>
1382
-
1383
- <div class="nav-buttons">
1384
- <button class="btn btn-secondary" onclick="navigateTo(5)">← Previous</button>
1385
- <button class="btn btn-primary" onclick="navigateTo(7)">Next: Advanced Techniques →</button>
1386
- </div>
1387
- </section>
1388
-
1389
- <!-- Topic 7: Advanced Techniques -->
1390
- <section class="content-section" id="topic-7">
1391
- <div class="section-header">
1392
- <h2>Prompt Patterns and Techniques</h2>
1393
- <p class="subtitle">Advanced Methods for Better Results</p>
1394
- <p class="description">Learn professional techniques used by prompt engineering experts</p>
1395
- </div>
1396
-
1397
- <div class="card">
1398
- <h3>Advanced Prompt Techniques</h3>
1399
- <p>Once you master the basics, these advanced techniques will help you unlock even more powerful AI capabilities.</p>
1400
- </div>
1401
-
1402
- <div class="component-grid">
1403
- <div class="component-card">
1404
- <h4>🧠 Chain-of-Thought</h4>
1405
- <p>Ask AI to show its reasoning step-by-step</p>
1406
- <code>"Think through this step-by-step before answering"</code>
1407
- </div>
1408
- <div class="component-card">
1409
- <h4>📚 Few-Shot Examples</h4>
1410
- <p>Provide examples of desired output format</p>
1411
- <code>"Here are 3 examples: [examples]. Now do this:"</code>
1412
- </div>
1413
- <div class="component-card">
1414
- <h4>⚙️ System Prompts</h4>
1415
- <p>Set AI behavior and personality upfront</p>
1416
- <code>"You are a helpful tutor for 10th-grade students"</code>
1417
- </div>
1418
- <div class="component-card">
1419
- <h4>🎯 Constraints</h4>
1420
- <p>Limit scope and manage complexity</p>
1421
- <code>"Keep under 100 words, use simple language"</code>
1422
- </div>
1423
- </div>
1424
-
1425
- <div class="callout callout-insight">
1426
- <strong>💡 Insight:</strong> Chain-of-thought prompting can improve reasoning by 50% or more
1427
- </div>
1428
-
1429
- <div class="card">
1430
- <h3>Technique Deep Dive: Chain-of-Thought</h3>
1431
- <p>Chain-of-thought prompting asks the AI to show its work, which leads to better reasoning and more accurate results.</p>
1432
-
1433
- <div class="comparison" style="margin-top: 20px;">
1434
- <div class="comparison-item bad">
1435
- <h4>❌ Without Chain-of-Thought</h4>
1436
- <p style="font-family: monospace; font-size: 13px; margin-bottom: 10px;">"What's 15% of 240?"</p>
1437
- <p style="font-size: 13px; color: #888;">AI might give answer without showing work, making errors harder to spot.</p>
1438
- </div>
1439
- <div class="comparison-item good">
1440
- <h4>✓ With Chain-of-Thought</h4>
1441
- <p style="font-family: monospace; font-size: 13px; margin-bottom: 10px;">"What's 15% of 240? Think through this step-by-step."</p>
1442
- <p style="font-size: 13px; color: #888;">AI shows: 1) 10% of 240 = 24, 2) 5% = half of 10% = 12, 3) 15% = 24 + 12 = 36</p>
1443
- </div>
1444
- </div>
1445
- </div>
1446
-
1447
- <div class="callout callout-tip">
1448
- <strong>✅ Tip:</strong> Use few-shot examples when the output format is complex or unusual
1449
- </div>
1450
-
1451
- <div class="card">
1452
- <h3>Template Library</h3>
1453
- <p style="margin-bottom: 20px;">Ready-to-use prompt templates for common scenarios:</p>
1454
-
1455
- <div class="template-library">
1456
- <div class="template-item" onclick="copyTemplate(this)">
1457
- <h5>📧 Email Writing</h5>
1458
- <pre>You are a professional email writer.
1459
-
1460
- Write a [formal/casual] email to [recipient] about [topic].
1461
-
1462
- Tone: [professional/friendly]
1463
- Length: [brief/detailed]
1464
- Action needed: [yes/no]</pre>
1465
- </div>
1466
- <div class="template-item" onclick="copyTemplate(this)">
1467
- <h5>💻 Code Generation</h5>
1468
- <pre>You are an expert [language] developer.
1469
-
1470
- Write a function that [task description].
1471
-
1472
- Requirements:
1473
- - [requirement 1]
1474
- - [requirement 2]
1475
-
1476
- Provide code with comments.</pre>
1477
- </div>
1478
- <div class="template-item" onclick="copyTemplate(this)">
1479
- <h5>📊 Data Analysis</h5>
1480
- <pre>Analyze this data: [data]
1481
-
1482
- Provide:
1483
- 1. Key insights
1484
- 2. Trends or patterns
1485
- 3. Recommendations
1486
-
1487
- Format as bullet points.</pre>
1488
- </div>
1489
- <div class="template-item" onclick="copyTemplate(this)">
1490
- <h5>✍️ Content Creation</h5>
1491
- <pre>Write a [blog post/article] about [topic].
1492
-
1493
- Audience: [description]
1494
- Tone: [conversational/professional]
1495
- Length: [word count]
1496
-
1497
- Include:
1498
- - Introduction
1499
- - 3-5 main points
1500
- - Conclusion</pre>
1501
- </div>
1502
- </div>
1503
- </div>
1504
-
1505
- <div class="callout callout-mistake">
1506
- <strong>⚠️ Common Mistake:</strong> Using advanced techniques when simple prompts would work better
1507
- </div>
1508
-
1509
- <div class="canvas-container">
1510
- <canvas id="techniquesCanvas"></canvas>
1511
- </div>
1512
-
1513
- <div class="card">
1514
- <h3>Summary &amp; Key Takeaways</h3>
1515
- <ul class="checklist">
1516
- <li>Chain-of-thought improves reasoning quality</li>
1517
- <li>Few-shot examples guide output format</li>
1518
- <li>System prompts set overall behavior</li>
1519
- <li>Constraints keep responses focused</li>
1520
- <li>Use templates to save time and ensure consistency</li>
1521
- </ul>
1522
- </div>
1523
-
1524
- <div class="nav-buttons">
1525
- <button class="btn btn-secondary" onclick="navigateTo(6)">← Previous</button>
1526
- <button class="btn btn-primary" onclick="navigateTo(8)">Next: Real-World Applications →</button>
1527
- </div>
1528
- </section>
1529
-
1530
- <!-- Topic 8: Real-World Applications -->
1531
- <section class="content-section" id="topic-8">
1532
- <div class="section-header">
1533
- <h2>Real-World Applications</h2>
1534
- <p class="subtitle">Putting It All Together</p>
1535
- <p class="description">See prompt engineering in action across different domains</p>
1536
- </div>
1537
-
1538
- <div class="card">
1539
- <h3>Prompt Engineering in Practice</h3>
1540
- <p>Now that you've learned the fundamentals and advanced techniques, let's explore how prompt engineering is applied across different real-world domains.</p>
1541
- </div>
1542
-
1543
- <div class="card">
1544
- <h3>Professional Writing</h3>
1545
- <div class="use-case-section">
1546
- <ul class="use-case-list">
1547
- <li>Email summarization and drafting</li>
1548
- <li>Report generation</li>
1549
- <li>Meeting notes synthesis</li>
1550
- </ul>
1551
- </div>
1552
- <div class="callout callout-tip" style="margin-top: 15px;">
1553
- <strong>✅ Example:</strong> "Summarize this 3-page meeting transcript into 5 key action items with owners and deadlines. Format as a table."
1554
- </div>
1555
- </div>
1556
-
1557
- <div class="card">
1558
- <h3>Technical Applications</h3>
1559
- <div class="use-case-section">
1560
- <ul class="use-case-list">
1561
- <li>Code generation and debugging</li>
1562
- <li>API documentation creation</li>
1563
- <li>Technical explanation simplification</li>
1564
- </ul>
1565
- </div>
1566
- <div class="callout callout-tip" style="margin-top: 15px;">
1567
- <strong>✅ Example:</strong> "I have a React component that's re-rendering unnecessarily. Here's the code: [code]. Identify the issue and provide an optimized version with explanations."
1568
- </div>
1569
- </div>
1570
-
1571
- <div class="card">
1572
- <h3>Creative Work</h3>
1573
- <div class="use-case-section">
1574
- <ul class="use-case-list">
1575
- <li>Marketing copy creation</li>
1576
- <li>Brainstorming ideas</li>
1577
- <li>Content outline generation</li>
1578
- </ul>
1579
- </div>
1580
- <div class="callout callout-tip" style="margin-top: 15px;">
1581
- <strong>✅ Example:</strong> "Generate 10 creative Instagram post ideas for a sustainable fashion brand targeting Gen Z. Include post caption and hashtag suggestions."
1582
- </div>
1583
- </div>
1584
-
1585
- <div class="card">
1586
- <h3>Educational Content</h3>
1587
- <div class="use-case-section">
1588
- <ul class="use-case-list">
1589
- <li>Concept explanation</li>
1590
- <li>Quiz generation</li>
1591
- <li>Study guide creation</li>
1592
- </ul>
1593
- </div>
1594
- <div class="callout callout-tip" style="margin-top: 15px;">
1595
- <strong>✅ Example:</strong> "Explain photosynthesis to a 7th grader using an analogy they can relate to. Keep it under 150 words."
1596
- </div>
1597
- </div>
1598
-
1599
- <div class="callout callout-insight">
1600
- <strong>💡 Insight:</strong> The best prompts combine multiple techniques based on the specific use case
1601
- </div>
1602
-
1603
- <div class="challenge-box">
1604
- <h3>🎯 Final Challenge: Build Your Own Prompt</h3>
1605
- <p style="color: #ccc; margin-bottom: 15px;">Choose a scenario and build a complete prompt using everything you've learned:</p>
1606
-
1607
- <div class="scenario-selector">
1608
- <button class="scenario-btn active" onclick="setChallenge('email')">Email Writing</button>
1609
- <button class="scenario-btn" onclick="setChallenge('code')">Coding Help</button>
1610
- <button class="scenario-btn" onclick="setChallenge('creative')">Creative Writing</button>
1611
- <button class="scenario-btn" onclick="setChallenge('analysis')">Data Analysis</button>
1612
- </div>
1613
-
1614
- <div class="challenge-prompt" id="challengeScenario" style="margin-top: 15px;">
1615
- Scenario will appear here...
1616
- </div>
1617
-
1618
- <textarea id="challengeInput" placeholder="Build your prompt here..." style="width: 100%; min-height: 150px; background: #0a0a0a; border: 2px solid #333; color: #fff; padding: 15px; border-radius: 8px; font-size: 14px; margin-top: 15px; font-family: inherit;"></textarea>
1619
-
1620
- <div class="btn-group" style="margin-top: 15px;">
1621
- <button class="btn btn-primary" onclick="evaluateChallenge()">Evaluate My Prompt</button>
1622
- <button class="btn btn-secondary" onclick="resetChallenge()">Reset</button>
1623
- </div>
1624
-
1625
- <div class="feedback" id="challengeFeedback"></div>
1626
- </div>
1627
-
1628
- <div class="card">
1629
- <h3>Congratulations! 🎉</h3>
1630
- <p>You've completed the Prompt Engineering Masterclass! You now have the knowledge and tools to communicate effectively with AI systems.</p>
1631
-
1632
- <div style="margin-top: 20px; padding: 20px; background: linear-gradient(135deg, #0066FF22, #00D9FF22); border-radius: 8px;">
1633
- <h4 style="color: #00D9FF; margin-bottom: 15px;">What You've Learned:</h4>
1634
- <ul class="checklist">
1635
- <li>The four components of effective prompts</li>
1636
- <li>How to write clear and specific instructions</li>
1637
- <li>The importance of context and background</li>
1638
- <li>How to specify output formats</li>
1639
- <li>Iterative refinement techniques</li>
1640
- <li>Advanced prompt patterns</li>
1641
- <li>Real-world applications across domains</li>
1642
- </ul>
1643
- </div>
1644
-
1645
- <div class="btn-group" style="margin-top: 20px;">
1646
- <button class="btn btn-primary" onclick="navigateTo(1)">↻ Review from Beginning</button>
1647
- <button class="btn btn-secondary" onclick="alert('Export feature coming soon!')">📄 Export Summary</button>
1648
- </div>
1649
- </div>
1650
-
1651
- <div class="nav-buttons">
1652
- <button class="btn btn-secondary" onclick="navigateTo(7)">← Previous</button>
1653
- <button class="btn btn-primary" onclick="navigateTo(1)">↻ Start Over</button>
1654
- </div>
1655
- </section>
1656
- </main>
1657
  </div>
1658
-
1659
  <script src="app.js"></script>
1660
  </body>
 
1661
  </html>
 
1
  <!DOCTYPE html>
2
  <html lang="en">
3
+
4
  <head>
5
  <meta charset="UTF-8">
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
  <title>Prompt Engineering Masterclass</title>
8
+ <link rel="stylesheet" href="../shared/css/design-system.css">
9
+ <link rel="stylesheet" href="../shared/css/components.css">
10
  <style>
11
+ :root {
12
+ --pe-cyan: #00D9FF;
13
+ --pe-purple: #B07DFF;
14
+ --pe-green: #10A37F;
15
+ --pe-blue: #4285F4;
16
+ --color-primary: var(--pe-cyan);
17
+ --color-secondary: var(--pe-purple);
18
+ }
19
+
20
  * {
21
  margin: 0;
22
  padding: 0;
 
24
  }
25
 
26
  body {
27
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
28
+ background: linear-gradient(135deg, #0a0f1e 0%, #1a1f3a 100%);
29
+ color: #e0e6ed;
30
  line-height: 1.6;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  }
32
 
33
+ .container {
34
+ max-width: 1400px;
35
+ margin: 0 auto;
36
+ padding: 2rem;
37
  }
38
 
39
+ header {
40
+ text-align: center;
41
+ margin-bottom: 3rem;
42
+ padding: 2rem 0;
 
 
 
 
43
  }
44
 
45
+ header h1 {
46
+ font-size: 3rem;
47
+ background: linear-gradient(135deg, var(--pe-cyan), var(--pe-purple));
48
+ -webkit-background-clip: text;
49
+ -webkit-text-fill-color: transparent;
50
+ background-clip: text;
51
+ margin-bottom: 0.5rem;
52
  }
53
 
54
+ .subtitle {
55
+ font-size: 1.2rem;
56
+ color: #8892a6;
 
 
 
 
 
 
57
  }
58
 
59
+ /* Dashboard */
60
+ .dashboard {
 
 
 
 
 
 
 
 
 
 
 
 
61
  display: none;
 
62
  }
63
 
64
+ .dashboard.active {
65
  display: block;
66
  }
67
 
68
+ .modules-grid {
69
+ display: grid;
70
+ grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
71
+ gap: 2rem;
72
+ margin-bottom: 3rem;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  }
74
 
 
75
  .card {
76
+ background: rgba(255, 255, 255, 0.05);
77
+ border: 1px solid rgba(0, 217, 255, 0.3);
78
+ border-radius: 16px;
79
+ padding: 2rem;
80
+ cursor: pointer;
81
  transition: all 0.3s ease;
82
+ position: relative;
83
+ overflow: hidden;
84
  }
85
 
86
+ .card::before {
87
+ content: '';
88
+ position: absolute;
89
+ top: 0;
90
+ left: 0;
91
+ right: 0;
92
+ height: 4px;
93
+ background: linear-gradient(90deg, var(--pe-cyan), var(--pe-purple));
94
+ transform: scaleX(0);
95
+ transition: transform 0.3s ease;
 
 
 
 
 
96
  }
97
 
98
+ .card:hover::before {
99
+ transform: scaleX(1);
 
 
 
 
 
 
100
  }
101
 
102
+ .card:hover {
103
+ transform: translateY(-8px);
104
+ border-color: var(--pe-cyan);
105
+ box-shadow: 0 20px 40px rgba(0, 217, 255, 0.3);
106
  }
107
 
108
+ .card-icon {
109
+ font-size: 3rem;
110
+ margin-bottom: 1rem;
 
111
  }
112
 
113
+ .card h3 {
114
+ font-size: 1.5rem;
115
+ color: var(--pe-cyan);
116
+ margin-bottom: 0.5rem;
117
  }
118
 
119
+ .card p {
120
+ color: #b3b9c5;
121
+ font-size: 0.95rem;
122
+ margin-bottom: 1rem;
123
  }
124
 
125
+ .category-label {
126
+ display: inline-block;
127
+ padding: 0.25rem 0.75rem;
128
+ background: rgba(0, 217, 255, 0.2);
129
+ border: 1px solid var(--pe-cyan);
130
  border-radius: 12px;
131
+ font-size: 0.75rem;
132
+ color: var(--pe-cyan);
133
+ font-weight: 600;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
  }
135
 
136
+ /* Module View */
137
+ .module {
138
+ display: none;
 
 
 
139
  }
140
 
141
+ .module.active {
142
+ display: block;
143
+ animation: fadeIn 0.5s;
 
 
 
 
144
  }
145
 
146
+ @keyframes fadeIn {
147
+ from {
148
+ opacity: 0;
149
+ transform: translateY(20px);
150
+ }
 
 
 
 
 
 
 
 
 
 
151
 
152
+ to {
153
+ opacity: 1;
154
+ transform: translateY(0);
155
+ }
156
  }
157
 
158
+ .btn-back {
159
+ background: var(--pe-cyan);
160
+ color: #0a0f1e;
161
  border: none;
162
+ padding: 0.75rem 1.5rem;
163
  border-radius: 8px;
 
 
164
  cursor: pointer;
165
+ font-size: 1rem;
166
+ font-weight: 600;
167
+ margin-bottom: 2rem;
168
+ transition: all 0.3s;
 
 
 
 
 
 
 
 
 
 
169
  }
170
 
171
+ .btn-back:hover {
172
+ background: #00b8d9;
173
+ transform: translateX(-4px);
174
  }
175
 
176
+ .module header h1 {
177
+ font-size: 2.5rem;
178
+ margin-bottom: 1rem;
179
  }
180
 
181
+ /* Tabs */
182
+ .tabs {
183
  display: flex;
184
+ gap: 1rem;
185
+ margin: 2rem 0;
186
+ border-bottom: 2px solid rgba(255, 255, 255, 0.1);
187
  flex-wrap: wrap;
188
  }
189
 
190
+ .tab-btn {
191
+ background: transparent;
192
+ border: none;
193
+ color: #8892a6;
194
+ padding: 1rem 1.5rem;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
  cursor: pointer;
196
+ font-size: 1rem;
197
+ border-bottom: 3px solid transparent;
198
+ transition: all 0.3s;
199
  }
200
 
201
+ .tab-btn.active {
202
+ color: var(--pe-cyan);
203
+ border-bottom-color: var(--pe-cyan);
 
 
 
 
 
 
 
 
 
204
  }
205
 
206
+ .tab-btn:hover {
 
 
207
  color: #fff;
 
208
  }
209
 
210
+ .tab {
211
+ display: none;
212
+ animation: fadeIn 0.4s;
 
 
 
213
  }
214
 
215
+ .tab.active {
216
+ display: block;
 
 
 
217
  }
218
 
219
+ /* Content Sections */
220
+ .section {
221
+ background: rgba(255, 255, 255, 0.03);
222
+ border: 1px solid rgba(255, 255, 255, 0.1);
223
+ border-radius: 12px;
224
+ padding: 2rem;
225
+ margin-bottom: 2rem;
226
  }
227
 
228
+ .section h2 {
229
+ color: var(--pe-cyan);
230
+ margin-bottom: 1.5rem;
231
+ font-size: 1.8rem;
232
  }
233
 
234
+ .section h3 {
235
+ color: var(--pe-purple);
236
+ margin: 1.5rem 0 1rem;
237
+ font-size: 1.3rem;
238
  }
239
 
240
+ /* Tables */
241
+ table {
242
+ width: 100%;
243
+ border-collapse: collapse;
244
+ margin: 1.5rem 0;
245
+ background: rgba(0, 0, 0, 0.2);
246
+ border-radius: 8px;
247
+ overflow: hidden;
248
  }
249
 
250
+ th,
251
+ td {
252
+ padding: 1rem;
253
+ text-align: left;
254
+ border-bottom: 1px solid rgba(255, 255, 255, 0.1);
255
  }
256
 
257
+ th {
258
+ background: rgba(0, 217, 255, 0.15);
259
+ color: var(--pe-cyan);
260
+ font-weight: 600;
 
 
 
261
  }
262
 
263
+ tr:hover {
264
+ background: rgba(255, 255, 255, 0.05);
 
 
 
 
265
  }
266
 
267
+ /* Code Blocks */
268
+ .code-block {
269
+ background: #0d1117;
270
+ border: 1px solid #30363d;
271
  border-radius: 8px;
272
+ padding: 1.5rem;
273
+ margin: 1.5rem 0;
274
+ overflow-x: auto;
275
+ font-family: 'Fira Code', 'Consolas', monospace;
276
+ line-height: 1.6;
277
+ white-space: pre-wrap;
278
+ font-size: 0.9rem;
 
 
 
 
 
 
 
 
 
 
279
  color: #ccc;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
280
  }
281
 
282
+ /* Info Boxes */
283
+ .info-box {
284
+ background: linear-gradient(135deg, rgba(0, 217, 255, 0.1), rgba(176, 125, 255, 0.1));
285
+ border-left: 4px solid var(--pe-cyan);
 
 
286
  border-radius: 8px;
287
+ padding: 1.5rem;
288
+ margin: 1.5rem 0;
289
  }
290
 
291
+ .box-title {
 
 
 
 
 
 
 
 
 
292
  font-weight: 700;
293
+ color: var(--pe-cyan);
294
+ margin-bottom: 0.75rem;
295
+ font-size: 1.1rem;
296
  }
297
 
298
+ .box-content {
299
+ color: #d0d7de;
300
+ line-height: 1.7;
 
301
  }
302
 
303
+ /* Interview Box */
304
+ .interview-box {
305
+ background: linear-gradient(135deg, rgba(255, 107, 53, 0.1), rgba(163, 113, 247, 0.1));
306
+ border-left: 4px solid #ff6b35;
307
+ border-radius: 8px;
308
+ padding: 1.5rem;
309
+ margin: 1.5rem 0;
310
  }
311
 
312
+ /* Callouts */
313
+ .callout {
314
+ border-radius: 8px;
315
+ padding: 1rem 1.5rem;
316
+ margin: 1.5rem 0;
317
+ border-left: 4px solid;
318
  }
319
 
320
+ .callout.tip {
321
+ background: rgba(46, 204, 113, 0.1);
322
+ border-color: #2ecc71;
 
323
  }
324
 
325
+ .callout.warning {
326
+ background: rgba(255, 193, 7, 0.1);
327
+ border-color: #ffc107;
328
  }
329
 
330
+ .callout.insight {
331
+ background: rgba(0, 217, 255, 0.1);
332
+ border-color: var(--pe-cyan);
 
 
 
 
333
  }
334
 
335
+ .callout-title {
336
+ font-weight: 700;
337
+ margin-bottom: 0.5rem;
 
338
  }
339
 
340
+ /* Comparison */
341
+ .comparison {
342
+ display: grid;
343
+ grid-template-columns: 1fr 1fr;
344
+ gap: 1.5rem;
345
+ margin: 1.5rem 0;
 
 
 
 
 
346
  }
347
 
348
+ .comparison-bad {
349
+ background: rgba(255, 60, 60, 0.1);
350
+ border: 1px solid rgba(255, 60, 60, 0.3);
351
+ border-radius: 8px;
352
+ padding: 1.5rem;
353
  }
354
 
355
+ .comparison-good {
356
+ background: rgba(0, 255, 136, 0.1);
357
+ border: 1px solid rgba(0, 255, 136, 0.3);
358
+ border-radius: 8px;
359
+ padding: 1.5rem;
360
  }
361
 
362
+ strong {
363
+ color: var(--pe-cyan);
 
364
  }
365
 
366
+ .hidden {
367
+ display: none;
 
368
  }
369
 
 
370
  @media (max-width: 768px) {
371
+ header h1 {
372
+ font-size: 2rem;
 
 
 
 
 
 
 
 
 
373
  }
374
 
375
+ .comparison {
 
 
376
  grid-template-columns: 1fr;
377
  }
378
 
379
+ .modules-grid {
380
+ grid-template-columns: 1fr;
381
  }
382
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
383
  </style>
384
  </head>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
385
 
386
+ <body>
387
+ <div class="container">
388
+ <div class="dashboard active" id="dashboard">
389
+ <header>
390
+ <h1>🧠 Prompt Engineering Masterclass</h1>
391
+ <p class="subtitle">From Fundamentals to Provider Mastery — Claude · Gemini · GPT · Advanced Techniques
392
+ </p>
393
+ </header>
394
+ <div class="modules-grid" id="modulesGrid"></div>
395
+ </div>
396
+ <div id="modulesContainer"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
397
  </div>
 
398
  <script src="app.js"></script>
399
  </body>
400
+
401
  </html>
shared/js/search.js CHANGED
@@ -144,7 +144,11 @@
144
  { title: 'Zero-Shot Prompting', section: 'topic-2' },
145
  { title: 'Few-Shot Prompting', section: 'topic-3' },
146
  { title: 'Chain of Thought', section: 'topic-4' },
147
- { title: 'System Prompts', section: 'topic-5' }
 
 
 
 
148
  ]
149
  },
150
  {
 
144
  { title: 'Zero-Shot Prompting', section: 'topic-2' },
145
  { title: 'Few-Shot Prompting', section: 'topic-3' },
146
  { title: 'Chain of Thought', section: 'topic-4' },
147
+ { title: 'System Prompts', section: 'topic-5' },
148
+ { title: 'Claude Prompt Mastery', section: 'topic-9' },
149
+ { title: 'Google Gemini Prompting', section: 'topic-10' },
150
+ { title: 'OpenAI GPT Best Practices', section: 'topic-11' },
151
+ { title: 'Provider Comparison', section: 'topic-12' }
152
  ]
153
  },
154
  {