You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add prompt example preservation rules and validation to generator
Enforces that prompt examples (text showing what to write to an AI) must be preserved as code blocks, never converted to bullet points. Adds validatePromptExamples() function that fails the build if prompts are paraphrased.
Includes comprehensive documentation for:
- Strategic line break formatting (60 char limit)
- Prompt detection patterns
- codeComparison usage for prompt examples
- JSON string escaping with \n
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
"code": "Make a function\nFix the bug\nUpdate the docs\nImprove performance"
253
+
},
254
+
"rightCode": {
255
+
"label": "Strong",
256
+
"language": "text",
257
+
"code": "Write a function\nDebug the null pointer exception in UserService.ts:47\nAdd JSDoc comments to all exported functions in auth.ts\nOptimize the query to use indexed columns"
258
+
}
259
+
}
260
+
261
+
If you see prompt examples in the source (text showing what to write to an AI), you MUST use "code" or "codeComparison" slide types. NEVER use "concept" with bullet points for prompts.
262
+
144
263
COMPONENT DETECTION (CRITICAL):
145
264
146
265
The source content contains markers for visual React components in the format:
@@ -277,6 +396,8 @@ OUTPUT FORMAT:
277
396
278
397
You must generate a valid JSON file with this structure:
279
398
399
+
REMINDER: If the source contains prompt examples (text showing what to write to an AI coding assistant), you MUST use "code" or "codeComparison" slide types with language="text". NEVER convert prompts to bullet points in "concept" slides.
400
+
280
401
{
281
402
"metadata": {
282
403
"title": "Lesson Title",
@@ -390,6 +511,21 @@ INCORRECT: Putting the better option on the left will show it with RED ✗ styli
390
511
},
391
512
"speakerNotes": { ... }
392
513
},
514
+
{
515
+
"type": "codeComparison",
516
+
"title": "Prompt Example: Ineffective vs Effective",
517
+
"leftCode": {
518
+
"label": "Ineffective", // MANDATORY: LEFT = worse prompt (RED ✗)
519
+
"language": "text",
520
+
"code": "Could you help me write a function?\nThanks!"
521
+
},
522
+
"rightCode": {
523
+
"label": "Effective", // MANDATORY: RIGHT = better prompt (GREEN ✓)
524
+
"language": "text",
525
+
"code": "Write a TypeScript function that validates email addresses.\nHandle edge cases:\n- Invalid @ symbols\n- Missing domain\n\nReturn { valid: boolean }"
526
+
},
527
+
"speakerNotes": { ... }
528
+
},
393
529
{
394
530
"type": "marketingReality",
395
531
"title": "Marketing vs Reality: What Actually Happens",
@@ -431,6 +567,15 @@ CRITICAL REQUIREMENTS:
431
567
4. Every slide MUST have speakerNotes with all fields
432
568
5. Code examples must be actual code from the lesson, not pseudocode
433
569
6. Content arrays must have 3-5 items (except title slide)
570
+
7. PROMPT EXAMPLES: Use "code" or "codeComparison" slide types, NEVER bullet points
571
+
572
+
BEFORE YOU GENERATE - CHECKLIST:
573
+
574
+
□ Did I identify all prompt examples in the source?
575
+
□ Will I use "codeComparison" type for those slides (NOT "concept")?
576
+
□ Will I set language="text" for prompt code blocks?
577
+
□ Will I copy the EXACT prompt text without paraphrasing?
578
+
□ Did I avoid converting prompts to explanatory bullet points?
434
579
435
580
TECHNICAL CONTENT TITLE: ${fileName}
436
581
@@ -690,6 +835,77 @@ function validateComparisonSemantics(presentation) {
690
835
};
691
836
}
692
837
838
+
/**
839
+
* Validate that prompt examples are preserved as code blocks
0 commit comments