Skip to content

Commit b571cef

Browse files
committed
New: Lesson 13
1 parent 71bdf30 commit b571cef

File tree

22 files changed

+2584
-72
lines changed

22 files changed

+2584
-72
lines changed

scripts/generate-presentation.js

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,35 @@ For presentation slides:
182182
✗ Don't include every code example from the lesson
183183
✗ Don't show code without explaining its purpose
184184
185+
HANDLING MARKDOWN TABLES (CRITICAL):
186+
187+
Source material may contain markdown tables (pipe/dash syntax like | Col1 | Col2 |).
188+
Tables are NOT a valid slide format—they're unreadable at presentation scale and
189+
violate the one-concept-per-slide principle.
190+
191+
ABSOLUTE RULE: NEVER put pipe/dash table syntax in code or codeComparison slides.
192+
NEVER use language="markdown" for content containing table structures.
193+
194+
Instead, distill tables into appropriate slide types:
195+
196+
1. Two-category tables → "comparison" slide (neutral=true if both sides are valid)
197+
Extract the key insight from each row as a bullet point.
198+
199+
2. List-of-items tables → "concept" slide
200+
Each row becomes one bullet capturing the essential insight.
201+
202+
3. Sequential/flow tables → "codeExecution" slide
203+
Each row becomes a step with appropriate highlightType.
204+
205+
4. Good-vs-bad tables → "comparison" slide (evaluative, neutral=false)
206+
Left = weak approach, Right = strong approach.
207+
208+
Put the FULL original table in speakerNotes.talkingPoints for instructor reference.
209+
The slide shows the distilled insight; the notes provide the data.
210+
211+
NOTE: language="markdown" IS valid for prompt templates showing what to write to an
212+
AI (e.g., CLAUDE.md examples). It is ONLY prohibited for pipe/dash table content.
213+
185214
CODE FORMATTING FOR PRESENTATIONS:
186215
187216
✓ Include natural line breaks in code and text (use \\n for newlines in JSON strings)
@@ -1460,6 +1489,34 @@ function validateLearningObjectivesWordCount(presentation) {
14601489
};
14611490
}
14621491

1492+
/**
1493+
* Validate that no code/codeComparison slides contain raw markdown table syntax
1494+
* Tables rendered as code are unreadable at presentation scale and should be
1495+
* distilled into comparison/concept/codeExecution slides instead.
1496+
* @param {object} presentation - Generated presentation object
1497+
* @returns {object} Validation result with issues
1498+
*/
1499+
function validateNoMarkdownTablesInCode(presentation) {
1500+
const issues = [];
1501+
const tablePattern = /\|.+\|.+\|\n\|[-| ]+\|/;
1502+
1503+
for (const slide of presentation.slides) {
1504+
const checkCode = (code, label) => {
1505+
if (code && tablePattern.test(code)) {
1506+
issues.push({ slide: slide.title, location: label });
1507+
}
1508+
};
1509+
1510+
if (slide.type === "code") checkCode(slide.code, "code");
1511+
if (slide.type === "codeComparison") {
1512+
checkCode(slide.leftCode?.code, "leftCode");
1513+
checkCode(slide.rightCode?.code, "rightCode");
1514+
}
1515+
}
1516+
1517+
return { valid: issues.length === 0, issues };
1518+
}
1519+
14631520
/**
14641521
* Generate presentation for a file
14651522
*/
@@ -1656,6 +1713,30 @@ async function generatePresentation(filePath, manifest, modifiedKeys, config) {
16561713
);
16571714
}
16581715

1716+
// Validate no raw markdown tables in code slides
1717+
// Tables rendered as <pre><code> are unreadable at presentation scale
1718+
const tableValidation = validateNoMarkdownTablesInCode(presentation);
1719+
if (!tableValidation.valid) {
1720+
console.log(
1721+
` ❌ BUILD FAILURE: ${tableValidation.issues.length} raw markdown table(s) in code slides:`,
1722+
);
1723+
tableValidation.issues.forEach((issue) => {
1724+
console.log(
1725+
` - Slide "${issue.slide}" (${issue.location})`,
1726+
);
1727+
});
1728+
console.log(
1729+
` ℹ️ Distill tables into comparison/concept/codeExecution slides instead`,
1730+
);
1731+
validationErrors.push(
1732+
"Table validation failed - raw markdown tables found in code slides",
1733+
);
1734+
} else {
1735+
console.log(
1736+
` ✅ No raw markdown tables in code slides`,
1737+
);
1738+
}
1739+
16591740
// Validate takeaway word count (5 words or fewer)
16601741
// CRITICAL: This validation is intentionally strict and throws an error because
16611742
// takeaways are displayed prominently on conclusion slides and must be memorable.

scripts/output/podcasts/manifest.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,11 @@
8888
"size": 8051,
8989
"tokenCount": 1931,
9090
"generatedAt": "2025-12-31T15:05:31.026Z"
91+
},
92+
"practical-techniques/lesson-13-systems-thinking-specs.md": {
93+
"scriptPath": "practical-techniques/lesson-13-systems-thinking-specs.md",
94+
"size": 17215,
95+
"tokenCount": 4207,
96+
"generatedAt": "2026-02-08T18:37:10.469Z"
9197
}
9298
}

website/docs/CLAUDE.md

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -60,20 +60,10 @@ title: 'Lesson Title'
6060
sidebar_position: X
6161
---
6262

63-
## Learning Objectives
64-
65-
- Objective 1 (specific, measurable)
66-
- Objective 2
67-
- Objective 3
68-
6963
## Content
7064

7165
[Main lesson content with examples]
7266

73-
## Hands-On Exercise
74-
75-
[Practical exercise with clear instructions]
76-
7767
## Key Takeaways
7868

7969
- Summary point 1
@@ -142,62 +132,6 @@ This approach is preferred in TypeScript projects
142132
:::
143133
```
144134

145-
## Learning Objectives
146-
147-
### Characteristics of Good Objectives
148-
149-
- **Specific** - Clear, well-defined outcome
150-
- **Measurable** - Can verify if achieved
151-
- **Actionable** - Describes what learner will DO
152-
- **Relevant** - Aligned with module goals
153-
- **Time-bound** - Achievable within lesson scope
154-
155-
### Examples
156-
157-
**Good:**
158-
159-
- "Implement effective prompt patterns for code refactoring tasks"
160-
- "Evaluate trade-offs between different AI coding assistants for your workflow"
161-
- "Design a secure architecture leveraging AI for code generation"
162-
163-
**Bad:**
164-
165-
- "Understand AI coding assistants" (too vague)
166-
- "Learn about prompting" (not measurable)
167-
- "Become an expert" (not specific or time-bound)
168-
169-
## Hands-On Exercises
170-
171-
### Exercise Guidelines
172-
173-
- **Real-world context** - Scenarios engineers actually face
174-
- **Clear instructions** - What to do, expected outcome
175-
- **Appropriate difficulty** - Challenging but achievable
176-
- **Multiple paths** - Allow different valid approaches
177-
- **Extension opportunities** - Bonus challenges for faster learners
178-
179-
### Example Exercise Structure
180-
181-
```markdown
182-
## Hands-On Exercise: Prompt-Driven Refactoring
183-
184-
**Scenario:** You have a legacy Node.js API with poor error handling...
185-
186-
**Your Task:**
187-
188-
1. Analyze the code structure
189-
2. Craft a prompt that guides the AI to refactor with:
190-
- Proper error handling middleware
191-
- Validation at API boundaries
192-
- Consistent error response format
193-
3. Evaluate the AI-generated solution
194-
4. Iterate based on issues found
195-
196-
**Expected Outcome:** Production-ready error handling that follows REST best practices
197-
198-
**Bonus Challenge:** Add OpenTelemetry tracing to the refactored code
199-
```
200-
201135
## Content Dependencies
202136

203137
### Prerequisites

website/docs/practical-techniques/lesson-11-agent-friendly-code.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Both problems feed the same exponential curve. When you accept a random AI error
4848

4949
From [Lesson 5](/docs/methodology/lesson-5-grounding), agents discover your codebase through **agentic search**—Grep, Read, Glob. **Agents only see code they explicitly find.** When constraints scatter across files, search determines what the agent sees and what it misses.
5050

51-
**Anti-pattern (scattered constraints):**
51+
**Anti-pattern (scattered constraints):**
5252

5353
```typescript
5454
// File: services/auth.ts
@@ -62,7 +62,7 @@ const MIN_PASSWORD_LENGTH = 12 // ← Agent never searches for this file
6262

6363
**What happens:** Agent searches `Grep("createUser")` → reads `services/auth.ts` → generates code accepting 3-character passwords because it never saw `MIN_PASSWORD_LENGTH`.
6464

65-
**Production pattern (co-located constraints):**
65+
**Production pattern (co-located constraints):**
6666

6767
```typescript
6868
// File: services/auth.ts

0 commit comments

Comments
 (0)