Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .claude/commands/learn.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ Create `~/skill-tutor-tutorials/learner_profile.md` with their answers.
|-----------|--------|
| $ARGUMENTS = lesson number (e.g. `3.2`) | Read `.claude/commands/learn/teaching.md` |
| $ARGUMENTS = "status" | Read `.claude/commands/learn/status.md` |
| $ARGUMENTS = "slides" or "slides [lesson]" | Read `.claude/commands/learn/slides.md` |
| $ARGUMENTS empty | Read `.claude/commands/learn/resume.md` |
| "quiz me" trigger | Read `.claude/commands/learn/quiz.md` |
| "stop" trigger | Read `.claude/commands/learn/progress.md` |
Expand All @@ -86,3 +87,7 @@ Create `~/skill-tutor-tutorials/learner_profile.md` with their answers.
| stop | Read `.claude/commands/learn/progress.md`, then summarize |
| read aloud | Use TTS helper |
| settings | Show current settings |
| detail 1 | Switch to detail level 1 (very brief summaries) |
| detail 2 | Switch to detail level 2 (slightly compressed — default) |
| detail 3 | Switch to detail level 3 (full depth, may add bullet points) |
| slides | Read `.claude/commands/learn/slides.md` — verbatim slide reading mode |
89 changes: 89 additions & 0 deletions .claude/commands/learn/slides.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Slides Module

*Loaded when the learner types `/learn slides` or "slides" during a session. Switches to verbatim slide reading mode.*

Respond in `session.language` throughout.

---

## Overview

Slides Mode reads the course script verbatim — no Journey Format, no reformulation. The learner hears the slides exactly as written, translated to `session.language` if needed. Exercises are still written by the tutor (not taken from the exercises file verbatim).

---

## Step 1 — Resolve Lesson

If a lesson number was specified (e.g. `/learn slides 3.1`), load that lesson's script file.

If no lesson number was given, use the current lesson already loaded in the session. If no lesson is active, ask the learner which lesson they want.

Resolve the script path using the same priority as `teaching.md`:
1. Check `./lessons/` at project root
2. Fallback to `course.path` from settings

Split the script by `[מעבר שקף]`.

---

## Step 2 — Announce Mode

Tell the learner:
> "Switching to Slides Mode. I'll read each slide verbatim. Say **next** to advance, **stop slides** to return to teaching mode, or **exercises** to get the exercises for this lesson."

---

## Step 3 — Launch Viewer

On entry to Slides Mode, start the slide server and generate the HTML viewer:

1. **Start the server** (if not already running on port 7823):
```powershell
Start-Process powershell -ArgumentList "-NoProfile -File `"C:\Users\yuval\Tov-learn\.claude\scripts\slide-server.ps1`"" -WindowStyle Normal
Start-Sleep -Seconds 2
```

2. **Resolve the lesson's absolute path** on disk:
- Slide images are at: `C:\Users\yuval\ai-track\courses\ai-engineer\lessons\[module]\[lesson]\digital-course-screenshots\`
- TTS scripts are at: `C:\Users\yuval\ai-track\courses\ai-engineer\lessons\[module]\[lesson]\digital-course-tts-scripts\`

3. **Generate and open the viewer**:
```powershell
& "C:\Users\yuval\Tov-learn\.claude\scripts\generate-slideshow.ps1" -LessonPath "ABSOLUTE_LESSON_PATH"
Start-Process "$env:TEMP\tov_slideshow.html"
```

---

## Step 4 — Per-Slide Loop

Repeat this sequence for every slide, starting at slide 1:

**a. Display text** — show the verbatim slide content (translated to `session.language`).

**b. Fire TTS — MANDATORY, do not skip.** Immediately after displaying the text, run:
```powershell
Invoke-RestMethod -Uri "http://localhost:7823/" -Method POST -Body "SLIDE_NUMBER" | Out-Null
```
Replace `SLIDE_NUMBER` with the current slide number (integer). This tells the server to speak the slide and sync the viewer. TTS fires automatically on every slide — the learner should never have to ask for it.

**c. Wait** for the learner to say **next** before advancing.

**Do not** apply Journey Format. **Do not** ask thinking questions between slides.

---

## Step 4 — Exercises

When the learner says **exercises**:
- Do NOT read from the exercises file verbatim
- Write fresh, interactive exercises based on the slide content covered so far
- Follow the exercise design rule: most exercises completable through Claude directly; external tool exercises only when the lesson topic is that specific tool

---

## Step 5 — Exit Slides Mode

When the learner says **stop slides** or **teaching mode**:
- Return to the teaching module (`teaching.md`) at the slide where they left off
- Resume in the previously set `session.detail_level`
46 changes: 35 additions & 11 deletions .claude/commands/learn/teaching.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,53 @@ Greet the learner. State the lesson topic and number of sections.
**If a progress file exists for this lesson:**
Tell the learner their previous score and ask if they want to restart or jump to a quiz on what was already covered.

**Otherwise:** Ask what they already know about the topic, if anything.
**Otherwise:** Ask what they already know about the topic, if anything. Also ask which detail level they prefer:
- **detail 1** — very brief, one or two sentences per slide
- **detail 2** — slightly compressed (default)
- **detail 3** — full depth, may add extra bullet points

Use their answer plus `learner_profile.md` to calibrate depth. Offer to skip sections they clearly already know.
Store the chosen level as `session.detail_level` (default: 2).

Use their answers plus `learner_profile.md` to calibrate depth. Offer to skip sections they clearly already know.

*(Speak greeting if TTS enabled)*

---

## Step 4 — Teach Each Section
## Step 4 — Cover Every Slide

**IMPORTANT: Every slide (section split by `[מעבר שקף]`) MUST be represented in the lesson output.** Never silently skip a slide. At minimum, include one sentence summarizing it.

For every slide, apply the **Journey Format** scaled by `session.detail_level`:

### Detail Level 1 — Very Brief
- 1–2 sentences max per slide
- State the core idea only
- No question, no context example
- Good for fast review passes

For every section, use the **Journey Format**:
### Detail Level 2 — Standard (default)
Use the full Journey Format:
1. **The problem** — one sentence
2. **The insight** — 2–3 sentences in your own words, not copied from the script
3. **In your context** — one concrete connection to the learner's project or a real example
4. **Question** — one thinking question; wait for an answer before continuing

1. **The problem** — What problem does this section solve? Why is it hard without it? (One sentence)
2. **The insight** — What do experts understand that beginners don't? (2–3 sentences, in your own words — not copied from the script)
3. **In your context** — How does this connect to the learner's project from their profile, or a relevant real-world example
4. **Question** — Ask one thinking question. Not trivia. Wait for an answer before continuing.
Each block: max 5 sentences total.

### Detail Level 3 — Full Depth
Use the full Journey Format plus:
- Expand the insight to 4–5 sentences
- Add bullet points for key facts, numbers, or comparisons from the slide
- May include one extra "did you know" point not in the script if genuinely relevant
- Still ask a question and wait for an answer

**The learner can switch levels at any time** by saying "detail 1", "detail 2", or "detail 3".

**Responding to answers:**
- Correct → brief acknowledgment + "Shall we continue?"
- Correct → brief acknowledgment + continue
- Partial/wrong → one hint → let them try again → then explain

Each teaching block: max 5 sentences. The learner should write more than you.

*(Speak each teaching block if TTS enabled — strip markdown before speaking)*

---
Expand Down
43 changes: 43 additions & 0 deletions .claude/scripts/auto-save-progress.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Auto-save progress when Claude session ends.
# Reads lesson/slide from TTS temp files and writes to skill-tutor-tutorials/progress/.
# Runs silently — no output on success.

$lessonFile = "$env:TEMP\tov_current_lesson.txt"
$slideFile = "$env:TEMP\tov_current_slide.txt"
$progressDir = "$env:USERPROFILE\skill-tutor-tutorials\progress"

if (!(Test-Path $lessonFile)) { exit 0 }
$lessonPath = (Get-Content $lessonFile -Raw -Encoding UTF8).Trim()
if (!$lessonPath) { exit 0 }

$lessonFolder = Split-Path $lessonPath -Leaf
$lessonNum = if ($lessonFolder -match '^(\d+\.\d+)') { $Matches[1] } else { $lessonFolder }

$slide = if (Test-Path $slideFile) { (Get-Content $slideFile -Raw).Trim() } else { "1" }
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm"

if (!(Test-Path $progressDir)) { New-Item -ItemType Directory -Path $progressDir -Force | Out-Null }

$progressFile = "$progressDir\lesson-$lessonNum.md"

# Read existing file to preserve quiz scores and notes
$existing = if (Test-Path $progressFile) { Get-Content $progressFile -Raw -Encoding UTF8 } else { "" }

# Replace or prepend the auto-save block
$autoSaveBlock = @"
<!-- auto-save -->
**שיעור:** $lessonNum
**שקף אחרון:** $slide
**זמן:** $timestamp
**נתיב:** $lessonPath
<!-- /auto-save -->

"@

if ($existing -match '(?s)<!-- auto-save -->.*?<!-- /auto-save -->') {
$updated = $existing -replace '(?s)<!-- auto-save -->.*?<!-- /auto-save -->\r?\n?', $autoSaveBlock
} else {
$updated = $autoSaveBlock + $existing
}

[System.IO.File]::WriteAllText($progressFile, $updated, (New-Object System.Text.UTF8Encoding($true)))
Loading
Loading