Skip to content

Claude Code guide in three levels, Beginner to Advanced: hands-on lessons with checked exercises, every volatile fact cited to its source. Independent community guide.

checks: compare the practice app's lesson files, not the /tutor step scripts, with the lessons they quote (#106)

Wesam Abousaid9d4a857922ad
diff --git a/.github/compat/learn.txt b/.github/compat/learn.txt
new file mode 100644
index 0000000..515b6d4
--- /dev/null
+++ b/.github/compat/learn.txt
@@ -0,0 +1,4 @@
+# Lessons the practice template's learning app (npm run learn) quotes, one per
+# line: the lesson id, then the page. The lesson file is learn/lessons/<id>.md
+# in the template. The lesson-quotes rule compares the two.
+b-1 docs/beginner/01-install-and-look-around.md
diff --git a/.github/compat/tutor.txt b/.github/compat/tutor.txt
deleted file mode 100644
index b309eee..0000000
--- a/.github/compat/tutor.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-# Lessons the practice template's /tutor quotes, one per line: the lesson id,
-# then the page. The step script is .claude/skills/tutor/steps/<id>.md in the
-# template. The tutor-quotes rule compares the two.
-b-1 docs/beginner/01-install-and-look-around.md
diff --git a/.github/scripts/fixtures/lesson-quotes-any-key/fixture.json b/.github/scripts/fixtures/lesson-quotes-any-key/fixture.json
new file mode 100644
index 0000000..eaacba3
--- /dev/null
+++ b/.github/scripts/fixtures/lesson-quotes-any-key/fixture.json
@@ -0,0 +1,8 @@
+{
+ "rule": "lesson-quotes",
+ "expect": "fail",
+ "env": {
+ "LEARN_DIR": "practice"
+ },
+ "about": "A quote under any key counts: a because line the lesson no longer holds fails."
+}
diff --git a/.github/scripts/fixtures/tutor-quotes-anchor-gone/tree/.github/compat/tutor.txt b/.github/scripts/fixtures/lesson-quotes-any-key/tree/.github/compat/learn.txt
similarity index 100%
rename from .github/scripts/fixtures/tutor-quotes-anchor-gone/tree/.github/compat/tutor.txt
rename to .github/scripts/fixtures/lesson-quotes-any-key/tree/.github/compat/learn.txt
diff --git a/.github/scripts/fixtures/tutor-quotes-match/tree/docs/beginner/01-demo.md b/.github/scripts/fixtures/lesson-quotes-any-key/tree/docs/beginner/01-demo.md
similarity index 100%
rename from .github/scripts/fixtures/tutor-quotes-match/tree/docs/beginner/01-demo.md
rename to .github/scripts/fixtures/lesson-quotes-any-key/tree/docs/beginner/01-demo.md
diff --git a/.github/scripts/fixtures/lesson-quotes-any-key/tree/practice/b-1.md b/.github/scripts/fixtures/lesson-quotes-any-key/tree/practice/b-1.md
new file mode 100644
index 0000000..8c437da
--- /dev/null
+++ b/.github/scripts/fixtures/lesson-quotes-any-key/tree/practice/b-1.md
@@ -0,0 +1,36 @@
+---
+lesson: b-1
+title: "Demo lesson"
+stamp: "Verified against Claude Code v2.1.285 (stable) on 2026-10-05"
+---
+
+## intro
+- minutes: "about 20 minutes"
+
+## steps
+
+### W1 | Worked example step 1 of 2 | Look at /status
+- tier: guided
+- skill: status
+- where: claude
+- beat: do
+- verify: self
+- do: "Type `/status`."
+
+### Y1 | Your turn step 1 of 1 | Your own question
+- tier: hinted
+- skill: ask
+- where: claude
+- beat: do
+- verify: self
+- goal: "Ask a question of your own."
+- ask: Did Claude answer?
+- right: Yes
+- because: "Ask two questions of your own."
+- option: Not yet
+
+## ladder
+
+### `.practice/version.txt` holds the output of `claude --version`
+- narrow "No `.practice/version.txt` yet": Which folder does the check name?
+- bottom: "End the session with `/exit`."
diff --git a/.github/scripts/fixtures/lesson-quotes-crlf/fixture.json b/.github/scripts/fixtures/lesson-quotes-crlf/fixture.json
new file mode 100644
index 0000000..667374d
--- /dev/null
+++ b/.github/scripts/fixtures/lesson-quotes-crlf/fixture.json
@@ -0,0 +1,8 @@
+{
+ "rule": "lesson-quotes",
+ "expect": "fail",
+ "env": {
+ "LEARN_DIR": "practice"
+ },
+ "about": "The lesson reworded a sentence that a lesson file with Windows line endings quotes."
+}
diff --git a/.github/scripts/fixtures/tutor-quotes-crlf/generate.mjs b/.github/scripts/fixtures/lesson-quotes-crlf/generate.mjs
similarity index 70%
rename from .github/scripts/fixtures/tutor-quotes-crlf/generate.mjs
rename to .github/scripts/fixtures/lesson-quotes-crlf/generate.mjs
index 7dc57f8..63de8f2 100644
--- a/.github/scripts/fixtures/tutor-quotes-crlf/generate.mjs
+++ b/.github/scripts/fixtures/lesson-quotes-crlf/generate.mjs
@@ -1,9 +1,9 @@
import { readFileSync, writeFileSync } from 'node:fs';
import { join } from 'node:path';
-// Rewrites the step script with Windows line endings, as a checkout with
+// Rewrites the lesson file with Windows line endings, as a checkout with
// core.autocrlf would, so the rule must still find the reworded quote.
export default function generate(root) {
- const path = join(root, 'practice', 'steps', 'b-1.md');
+ const path = join(root, 'practice', 'b-1.md');
writeFileSync(path, readFileSync(path, 'utf8').replace(/\r?\n/g, '\r\n'));
}
diff --git a/.github/scripts/fixtures/tutor-quotes-crlf/tree/.github/compat/tutor.txt b/.github/scripts/fixtures/lesson-quotes-crlf/tree/.github/compat/learn.txt
similarity index 100%
rename from .github/scripts/fixtures/tutor-quotes-crlf/tree/.github/compat/tutor.txt
rename to .github/scripts/fixtures/lesson-quotes-crlf/tree/.github/compat/learn.txt
diff --git a/.github/scripts/fixtures/tutor-quotes-crlf/tree/docs/beginner/01-demo.md b/.github/scripts/fixtures/lesson-quotes-crlf/tree/docs/beginner/01-demo.md
similarity index 100%
rename from .github/scripts/fixtures/tutor-quotes-crlf/tree/docs/beginner/01-demo.md
rename to .github/scripts/fixtures/lesson-quotes-crlf/tree/docs/beginner/01-demo.md
diff --git a/.github/scripts/fixtures/lesson-quotes-crlf/tree/practice/b-1.md b/.github/scripts/fixtures/lesson-quotes-crlf/tree/practice/b-1.md
new file mode 100644
index 0000000..8dc7989
--- /dev/null
+++ b/.github/scripts/fixtures/lesson-quotes-crlf/tree/practice/b-1.md
@@ -0,0 +1,36 @@
+---
+lesson: b-1
+title: "Demo lesson"
+stamp: "Verified against Claude Code v2.1.285 (stable) on 2026-10-05"
+---
+
+## intro
+- minutes: "about 20 minutes"
+
+## steps
+
+### W1 | Worked example step 1 of 2 | Look at /status
+- tier: guided
+- skill: status
+- where: claude
+- beat: do
+- verify: self
+- do: "Type `/status`."
+
+### Y1 | Your turn step 1 of 1 | Your own question
+- tier: hinted
+- skill: ask
+- where: claude
+- beat: do
+- verify: self
+- goal: "Ask a question of your own."
+- ask: Did Claude answer?
+- right: Yes
+- because: "Ask a question of your own."
+- option: Not yet
+
+## ladder
+
+### `.practice/version.txt` holds the output of `claude --version`
+- narrow "No `.practice/version.txt` yet": Which folder does the check name?
+- bottom: "End the session with `/exit`."
diff --git a/.github/scripts/fixtures/lesson-quotes-loose-quote/fixture.json b/.github/scripts/fixtures/lesson-quotes-loose-quote/fixture.json
new file mode 100644
index 0000000..9655e5c
--- /dev/null
+++ b/.github/scripts/fixtures/lesson-quotes-loose-quote/fixture.json
@@ -0,0 +1,8 @@
+{
+ "rule": "lesson-quotes",
+ "expect": "fail",
+ "env": {
+ "LEARN_DIR": "practice"
+ },
+ "about": "A reworded quote with extra spaces around it, which the app still reads as a quote, no longer matches the lesson."
+}
diff --git a/.github/scripts/fixtures/tutor-quotes-match/tree/.github/compat/tutor.txt b/.github/scripts/fixtures/lesson-quotes-loose-quote/tree/.github/compat/learn.txt
similarity index 100%
rename from .github/scripts/fixtures/tutor-quotes-match/tree/.github/compat/tutor.txt
rename to .github/scripts/fixtures/lesson-quotes-loose-quote/tree/.github/compat/learn.txt
diff --git a/.github/scripts/fixtures/tutor-quotes-pr-unchanged/base/docs/beginner/01-demo.md b/.github/scripts/fixtures/lesson-quotes-loose-quote/tree/docs/beginner/01-demo.md
similarity index 100%
rename from .github/scripts/fixtures/tutor-quotes-pr-unchanged/base/docs/beginner/01-demo.md
rename to .github/scripts/fixtures/lesson-quotes-loose-quote/tree/docs/beginner/01-demo.md
diff --git a/.github/scripts/fixtures/lesson-quotes-loose-quote/tree/practice/b-1.md b/.github/scripts/fixtures/lesson-quotes-loose-quote/tree/practice/b-1.md
new file mode 100644
index 0000000..94d3dee
--- /dev/null
+++ b/.github/scripts/fixtures/lesson-quotes-loose-quote/tree/practice/b-1.md
@@ -0,0 +1,36 @@
+---
+lesson: b-1
+title: "Demo lesson"
+stamp: "Verified against Claude Code v2.1.285 (stable) on 2026-10-05"
+---
+
+## intro
+- minutes: "about 20 minutes"
+
+## steps
+
+### W1 | Worked example step 1 of 2 | Look at /status
+- tier: guided
+- skill: status
+- where: claude
+- beat: do
+- verify: self
+- do: "Type `/status` now."
+
+### Y1 | Your turn step 1 of 1 | Your own question
+- tier: hinted
+- skill: ask
+- where: claude
+- beat: do
+- verify: self
+- goal: "Ask a question of your own."
+- ask: Did Claude answer?
+- right: Yes
+- because: "Ask a question of your own."
+- option: Not yet
+
+## ladder
+
+### `.practice/version.txt` holds the output of `claude --version`
+- narrow "No `.practice/version.txt` yet": Which folder does the check name?
+- bottom: "End the session with `/exit`."
diff --git a/.github/scripts/fixtures/lesson-quotes-match/fixture.json b/.github/scripts/fixtures/lesson-quotes-match/fixture.json
new file mode 100644
index 0000000..e083713
--- /dev/null
+++ b/.github/scripts/fixtures/lesson-quotes-match/fixture.json
@@ -0,0 +1,8 @@
+{
+ "rule": "lesson-quotes",
+ "expect": "pass",
+ "env": {
+ "LEARN_DIR": "practice"
+ },
+ "about": "Every quoted line, the title, the Stamp and the step counts match the lesson; a ladder's narrow line holds the check's words, not the lesson's."
+}
diff --git a/.github/scripts/fixtures/tutor-quotes-pr-unchanged/base/.github/compat/tutor.txt b/.github/scripts/fixtures/lesson-quotes-match/tree/.github/compat/learn.txt
similarity index 100%
rename from .github/scripts/fixtures/tutor-quotes-pr-unchanged/base/.github/compat/tutor.txt
rename to .github/scripts/fixtures/lesson-quotes-match/tree/.github/compat/learn.txt
diff --git a/.github/scripts/fixtures/tutor-quotes-pr-unchanged/tree/docs/beginner/01-demo.md b/.github/scripts/fixtures/lesson-quotes-match/tree/docs/beginner/01-demo.md
similarity index 100%
rename from .github/scripts/fixtures/tutor-quotes-pr-unchanged/tree/docs/beginner/01-demo.md
rename to .github/scripts/fixtures/lesson-quotes-match/tree/docs/beginner/01-demo.md
diff --git a/.github/scripts/fixtures/lesson-quotes-match/tree/practice/b-1.md b/.github/scripts/fixtures/lesson-quotes-match/tree/practice/b-1.md
new file mode 100644
index 0000000..8dc7989
--- /dev/null
+++ b/.github/scripts/fixtures/lesson-quotes-match/tree/practice/b-1.md
@@ -0,0 +1,36 @@
+---
+lesson: b-1
+title: "Demo lesson"
+stamp: "Verified against Claude Code v2.1.285 (stable) on 2026-10-05"
+---
+
+## intro
+- minutes: "about 20 minutes"
+
+## steps
+
+### W1 | Worked example step 1 of 2 | Look at /status
+- tier: guided
+- skill: status
+- where: claude
+- beat: do
+- verify: self
+- do: "Type `/status`."
+
+### Y1 | Your turn step 1 of 1 | Your own question
+- tier: hinted
+- skill: ask
+- where: claude
+- beat: do
+- verify: self
+- goal: "Ask a question of your own."
+- ask: Did Claude answer?
+- right: Yes
+- because: "Ask a question of your own."
+- option: Not yet
+
+## ladder
+
+### `.practice/version.txt` holds the output of `claude --version`
+- narrow "No `.practice/version.txt` yet": Which folder does the check name?
+- bottom: "End the session with `/exit`."
diff --git a/.github/scripts/fixtures/tutor-quotes-pr-unchanged/tree/.github/compat/tutor.txt b/.github/scripts/fixtures/lesson-quotes-pr-unchanged/base/.github/compat/learn.txt
similarity index 100%
rename from .github/scripts/fixtures/tutor-quotes-pr-unchanged/tree/.github/compat/tutor.txt
rename to .github/scripts/fixtures/lesson-quotes-pr-unchanged/base/.github/compat/learn.txt
diff --git a/.github/scripts/fixtures/tutor-quotes-pr-warn/base/docs/beginner/01-demo.md b/.github/scripts/fixtures/lesson-quotes-pr-unchanged/base/docs/beginner/01-demo.md
similarity index 100%
rename from .github/scripts/fixtures/tutor-quotes-pr-warn/base/docs/beginner/01-demo.md
rename to .github/scripts/fixtures/lesson-quotes-pr-unchanged/base/docs/beginner/01-demo.md
diff --git a/.github/scripts/fixtures/lesson-quotes-pr-unchanged/fixture.json b/.github/scripts/fixtures/lesson-quotes-pr-unchanged/fixture.json
new file mode 100644
index 0000000..44666b0
--- /dev/null
+++ b/.github/scripts/fixtures/lesson-quotes-pr-unchanged/fixture.json
@@ -0,0 +1,8 @@
+{
+ "rule": "lesson-quotes",
+ "expect": "pass",
+ "env": {
+ "LEARN_DIR": ""
+ },
+ "about": "Offline, a pull request that leaves the lessons in the app alone passes without reading the template."
+}
diff --git a/.github/scripts/fixtures/tutor-quotes-pr-warn/base/.github/compat/tutor.txt b/.github/scripts/fixtures/lesson-quotes-pr-unchanged/tree/.github/compat/learn.txt
similarity index 100%
rename from .github/scripts/fixtures/tutor-quotes-pr-warn/base/.github/compat/tutor.txt
rename to .github/scripts/fixtures/lesson-quotes-pr-unchanged/tree/.github/compat/learn.txt
diff --git a/.github/scripts/fixtures/tutor-quotes-title-changed/tree/docs/beginner/01-demo.md b/.github/scripts/fixtures/lesson-quotes-pr-unchanged/tree/docs/beginner/01-demo.md
similarity index 100%
rename from .github/scripts/fixtures/tutor-quotes-title-changed/tree/docs/beginner/01-demo.md
rename to .github/scripts/fixtures/lesson-quotes-pr-unchanged/tree/docs/beginner/01-demo.md
diff --git a/.github/scripts/fixtures/tutor-quotes-pr-warn/tree/.github/compat/tutor.txt b/.github/scripts/fixtures/lesson-quotes-pr-warn/base/.github/compat/learn.txt
similarity index 100%
rename from .github/scripts/fixtures/tutor-quotes-pr-warn/tree/.github/compat/tutor.txt
rename to .github/scripts/fixtures/lesson-quotes-pr-warn/base/.github/compat/learn.txt
diff --git a/.github/scripts/fixtures/tutor-quotes-anchor-gone/tree/docs/beginner/01-demo.md b/.github/scripts/fixtures/lesson-quotes-pr-warn/base/docs/beginner/01-demo.md
similarity index 93%
rename from .github/scripts/fixtures/tutor-quotes-anchor-gone/tree/docs/beginner/01-demo.md
rename to .github/scripts/fixtures/lesson-quotes-pr-warn/base/docs/beginner/01-demo.md
index 41bc092..e229fc3 100644
--- a/.github/scripts/fixtures/tutor-quotes-anchor-gone/tree/docs/beginner/01-demo.md
+++ b/.github/scripts/fixtures/lesson-quotes-pr-warn/base/docs/beginner/01-demo.md
@@ -11,6 +11,6 @@
1. Ask a question of your own.
-## Check your work
+## Check
Run the check.
diff --git a/.github/scripts/fixtures/lesson-quotes-pr-warn/fixture.json b/.github/scripts/fixtures/lesson-quotes-pr-warn/fixture.json
new file mode 100644
index 0000000..c2cb114
--- /dev/null
+++ b/.github/scripts/fixtures/lesson-quotes-pr-warn/fixture.json
@@ -0,0 +1,8 @@
+{
+ "rule": "lesson-quotes",
+ "expect": "warn",
+ "env": {
+ "LEARN_DIR": ""
+ },
+ "about": "Offline, a pull request that changes a lesson the app quotes gets a warning to run the comparison locally."
+}
diff --git a/.github/scripts/fixtures/tutor-quotes-quote-gone/tree/.github/compat/tutor.txt b/.github/scripts/fixtures/lesson-quotes-pr-warn/tree/.github/compat/learn.txt
similarity index 100%
rename from .github/scripts/fixtures/tutor-quotes-quote-gone/tree/.github/compat/tutor.txt
rename to .github/scripts/fixtures/lesson-quotes-pr-warn/tree/.github/compat/learn.txt
diff --git a/.github/scripts/fixtures/tutor-quotes-pr-warn/tree/docs/beginner/01-demo.md b/.github/scripts/fixtures/lesson-quotes-pr-warn/tree/docs/beginner/01-demo.md
similarity index 100%
rename from .github/scripts/fixtures/tutor-quotes-pr-warn/tree/docs/beginner/01-demo.md
rename to .github/scripts/fixtures/lesson-quotes-pr-warn/tree/docs/beginner/01-demo.md
diff --git a/.github/scripts/fixtures/lesson-quotes-quote-gone/fixture.json b/.github/scripts/fixtures/lesson-quotes-quote-gone/fixture.json
new file mode 100644
index 0000000..a021e43
--- /dev/null
+++ b/.github/scripts/fixtures/lesson-quotes-quote-gone/fixture.json
@@ -0,0 +1,8 @@
+{
+ "rule": "lesson-quotes",
+ "expect": "fail",
+ "env": {
+ "LEARN_DIR": "practice"
+ },
+ "about": "The lesson reworded a sentence the lesson file quotes."
+}
diff --git a/.github/scripts/fixtures/tutor-quotes-stamp-changed/tree/.github/compat/tutor.txt b/.github/scripts/fixtures/lesson-quotes-quote-gone/tree/.github/compat/learn.txt
similarity index 100%
rename from .github/scripts/fixtures/tutor-quotes-stamp-changed/tree/.github/compat/tutor.txt
rename to .github/scripts/fixtures/lesson-quotes-quote-gone/tree/.github/compat/learn.txt
diff --git a/.github/scripts/fixtures/tutor-quotes-quote-gone/tree/docs/beginner/01-demo.md b/.github/scripts/fixtures/lesson-quotes-quote-gone/tree/docs/beginner/01-demo.md
similarity index 100%
rename from .github/scripts/fixtures/tutor-quotes-quote-gone/tree/docs/beginner/01-demo.md
rename to .github/scripts/fixtures/lesson-quotes-quote-gone/tree/docs/beginner/01-demo.md
diff --git a/.github/scripts/fixtures/lesson-quotes-quote-gone/tree/practice/b-1.md b/.github/scripts/fixtures/lesson-quotes-quote-gone/tree/practice/b-1.md
new file mode 100644
index 0000000..8dc7989
--- /dev/null
+++ b/.github/scripts/fixtures/lesson-quotes-quote-gone/tree/practice/b-1.md
@@ -0,0 +1,36 @@
+---
+lesson: b-1
+title: "Demo lesson"
+stamp: "Verified against Claude Code v2.1.285 (stable) on 2026-10-05"
+---
+
+## intro
+- minutes: "about 20 minutes"
+
+## steps
+
+### W1 | Worked example step 1 of 2 | Look at /status
+- tier: guided
+- skill: status
+- where: claude
+- beat: do
+- verify: self
+- do: "Type `/status`."
+
+### Y1 | Your turn step 1 of 1 | Your own question
+- tier: hinted
+- skill: ask
+- where: claude
+- beat: do
+- verify: self
+- goal: "Ask a question of your own."
+- ask: Did Claude answer?
+- right: Yes
+- because: "Ask a question of your own."
+- option: Not yet
+
+## ladder
+
+### `.practice/version.txt` holds the output of `claude --version`
+- narrow "No `.practice/version.txt` yet": Which folder does the check name?
+- bottom: "End the session with `/exit`."
diff --git a/.github/scripts/fixtures/lesson-quotes-stamp-changed/fixture.json b/.github/scripts/fixtures/lesson-quotes-stamp-changed/fixture.json
new file mode 100644
index 0000000..d9509a2
--- /dev/null
+++ b/.github/scripts/fixtures/lesson-quotes-stamp-changed/fixture.json
@@ -0,0 +1,8 @@
+{
+ "rule": "lesson-quotes",
+ "expect": "fail",
+ "env": {
+ "LEARN_DIR": "practice"
+ },
+ "about": "The lesson was restamped, so the lesson file must be re-verified and restamped too."
+}
diff --git a/.github/scripts/fixtures/tutor-quotes-step-added/tree/.github/compat/tutor.txt b/.github/scripts/fixtures/lesson-quotes-stamp-changed/tree/.github/compat/learn.txt
similarity index 100%
rename from .github/scripts/fixtures/tutor-quotes-step-added/tree/.github/compat/tutor.txt
rename to .github/scripts/fixtures/lesson-quotes-stamp-changed/tree/.github/compat/learn.txt
diff --git a/.github/scripts/fixtures/tutor-quotes-stamp-changed/tree/docs/beginner/01-demo.md b/.github/scripts/fixtures/lesson-quotes-stamp-changed/tree/docs/beginner/01-demo.md
similarity index 100%
rename from .github/scripts/fixtures/tutor-quotes-stamp-changed/tree/docs/beginner/01-demo.md
rename to .github/scripts/fixtures/lesson-quotes-stamp-changed/tree/docs/beginner/01-demo.md
diff --git a/.github/scripts/fixtures/lesson-quotes-stamp-changed/tree/practice/b-1.md b/.github/scripts/fixtures/lesson-quotes-stamp-changed/tree/practice/b-1.md
new file mode 100644
index 0000000..8dc7989
--- /dev/null
+++ b/.github/scripts/fixtures/lesson-quotes-stamp-changed/tree/practice/b-1.md
@@ -0,0 +1,36 @@
+---
+lesson: b-1
+title: "Demo lesson"
+stamp: "Verified against Claude Code v2.1.285 (stable) on 2026-10-05"
+---
+
+## intro
+- minutes: "about 20 minutes"
+
+## steps
+
+### W1 | Worked example step 1 of 2 | Look at /status
+- tier: guided
+- skill: status
+- where: claude
+- beat: do
+- verify: self
+- do: "Type `/status`."
+
+### Y1 | Your turn step 1 of 1 | Your own question
+- tier: hinted
+- skill: ask
+- where: claude
+- beat: do
+- verify: self
+- goal: "Ask a question of your own."
+- ask: Did Claude answer?
+- right: Yes
+- because: "Ask a question of your own."
+- option: Not yet
+
+## ladder
+
+### `.practice/version.txt` holds the output of `claude --version`
+- narrow "No `.practice/version.txt` yet": Which folder does the check name?
+- bottom: "End the session with `/exit`."
diff --git a/.github/scripts/fixtures/lesson-quotes-step-added/fixture.json b/.github/scripts/fixtures/lesson-quotes-step-added/fixture.json
new file mode 100644
index 0000000..28260f6
--- /dev/null
+++ b/.github/scripts/fixtures/lesson-quotes-step-added/fixture.json
@@ -0,0 +1,8 @@
+{
+ "rule": "lesson-quotes",
+ "expect": "fail",
+ "env": {
+ "LEARN_DIR": "practice"
+ },
+ "about": "The lesson gained a Worked example step, so the lesson file's step counts are wrong."
+}
diff --git a/.github/scripts/fixtures/tutor-quotes-title-changed/tree/.github/compat/tutor.txt b/.github/scripts/fixtures/lesson-quotes-step-added/tree/.github/compat/learn.txt
similarity index 100%
rename from .github/scripts/fixtures/tutor-quotes-title-changed/tree/.github/compat/tutor.txt
rename to .github/scripts/fixtures/lesson-quotes-step-added/tree/.github/compat/learn.txt
diff --git a/.github/scripts/fixtures/tutor-quotes-step-added/tree/docs/beginner/01-demo.md b/.github/scripts/fixtures/lesson-quotes-step-added/tree/docs/beginner/01-demo.md
similarity index 100%
rename from .github/scripts/fixtures/tutor-quotes-step-added/tree/docs/beginner/01-demo.md
rename to .github/scripts/fixtures/lesson-quotes-step-added/tree/docs/beginner/01-demo.md
diff --git a/.github/scripts/fixtures/lesson-quotes-step-added/tree/practice/b-1.md b/.github/scripts/fixtures/lesson-quotes-step-added/tree/practice/b-1.md
new file mode 100644
index 0000000..8dc7989
--- /dev/null
+++ b/.github/scripts/fixtures/lesson-quotes-step-added/tree/practice/b-1.md
@@ -0,0 +1,36 @@
+---
+lesson: b-1
+title: "Demo lesson"
+stamp: "Verified against Claude Code v2.1.285 (stable) on 2026-10-05"
+---
+
+## intro
+- minutes: "about 20 minutes"
+
+## steps
+
+### W1 | Worked example step 1 of 2 | Look at /status
+- tier: guided
+- skill: status
+- where: claude
+- beat: do
+- verify: self
+- do: "Type `/status`."
+
+### Y1 | Your turn step 1 of 1 | Your own question
+- tier: hinted
+- skill: ask
+- where: claude
+- beat: do
+- verify: self
+- goal: "Ask a question of your own."
+- ask: Did Claude answer?
+- right: Yes
+- because: "Ask a question of your own."
+- option: Not yet
+
+## ladder
+
+### `.practice/version.txt` holds the output of `claude --version`
+- narrow "No `.practice/version.txt` yet": Which folder does the check name?
+- bottom: "End the session with `/exit`."
diff --git a/.github/scripts/fixtures/lesson-quotes-title-changed/fixture.json b/.github/scripts/fixtures/lesson-quotes-title-changed/fixture.json
new file mode 100644
index 0000000..dd80f77
--- /dev/null
+++ b/.github/scripts/fixtures/lesson-quotes-title-changed/fixture.json
@@ -0,0 +1,8 @@
+{
+ "rule": "lesson-quotes",
+ "expect": "fail",
+ "env": {
+ "LEARN_DIR": "practice"
+ },
+ "about": "The lesson file's title no longer matches the lesson's heading."
+}
diff --git a/.github/scripts/fixtures/lesson-quotes-title-changed/tree/.github/compat/learn.txt b/.github/scripts/fixtures/lesson-quotes-title-changed/tree/.github/compat/learn.txt
new file mode 100644
index 0000000..1d980f9
--- /dev/null
+++ b/.github/scripts/fixtures/lesson-quotes-title-changed/tree/.github/compat/learn.txt
@@ -0,0 +1 @@
+b-1 docs/beginner/01-demo.md
diff --git a/.github/scripts/fixtures/lesson-quotes-title-changed/tree/docs/beginner/01-demo.md b/.github/scripts/fixtures/lesson-quotes-title-changed/tree/docs/beginner/01-demo.md
new file mode 100644
index 0000000..e229fc3
--- /dev/null
+++ b/.github/scripts/fixtures/lesson-quotes-title-changed/tree/docs/beginner/01-demo.md
@@ -0,0 +1,16 @@
+# Demo lesson
+
+<sub>**Beginner** · Lesson 1 of 5 · about 20 minutes · Verified against Claude Code v2.1.285 (stable) on 2026-10-05</sub>
+
+## Worked example
+
+1. Type `/status`.
+2. End the session with `/exit`.
+
+## Your turn
+
+1. Ask a question of your own.
+
+## Check
+
+Run the check.
diff --git a/.github/scripts/fixtures/lesson-quotes-title-changed/tree/practice/b-1.md b/.github/scripts/fixtures/lesson-quotes-title-changed/tree/practice/b-1.md
new file mode 100644
index 0000000..5fa11ba
--- /dev/null
+++ b/.github/scripts/fixtures/lesson-quotes-title-changed/tree/practice/b-1.md
@@ -0,0 +1,36 @@
+---
+lesson: b-1
+title: "An older demo title"
+stamp: "Verified against Claude Code v2.1.285 (stable) on 2026-10-05"
+---
+
+## intro
+- minutes: "about 20 minutes"
+
+## steps
+
+### W1 | Worked example step 1 of 2 | Look at /status
+- tier: guided
+- skill: status
+- where: claude
+- beat: do
+- verify: self
+- do: "Type `/status`."
+
+### Y1 | Your turn step 1 of 1 | Your own question
+- tier: hinted
+- skill: ask
+- where: claude
+- beat: do
+- verify: self
+- goal: "Ask a question of your own."
+- ask: Did Claude answer?
+- right: Yes
+- because: "Ask a question of your own."
+- option: Not yet
+
+## ladder
+
+### `.practice/version.txt` holds the output of `claude --version`
+- narrow "No `.practice/version.txt` yet": Which folder does the check name?
+- bottom: "End the session with `/exit`."
diff --git a/.github/scripts/fixtures/lesson-quotes-title-unquoted/fixture.json b/.github/scripts/fixtures/lesson-quotes-title-unquoted/fixture.json
new file mode 100644
index 0000000..280f772
--- /dev/null
+++ b/.github/scripts/fixtures/lesson-quotes-title-unquoted/fixture.json
@@ -0,0 +1,8 @@
+{
+ "rule": "lesson-quotes",
+ "expect": "fail",
+ "env": {
+ "LEARN_DIR": "practice"
+ },
+ "about": "An unquoted title, which the app reads too, no longer matches the lesson's heading."
+}
diff --git a/.github/scripts/fixtures/lesson-quotes-title-unquoted/tree/.github/compat/learn.txt b/.github/scripts/fixtures/lesson-quotes-title-unquoted/tree/.github/compat/learn.txt
new file mode 100644
index 0000000..1d980f9
--- /dev/null
+++ b/.github/scripts/fixtures/lesson-quotes-title-unquoted/tree/.github/compat/learn.txt
@@ -0,0 +1 @@
+b-1 docs/beginner/01-demo.md
diff --git a/.github/scripts/fixtures/lesson-quotes-title-unquoted/tree/docs/beginner/01-demo.md b/.github/scripts/fixtures/lesson-quotes-title-unquoted/tree/docs/beginner/01-demo.md
new file mode 100644
index 0000000..e229fc3
--- /dev/null
+++ b/.github/scripts/fixtures/lesson-quotes-title-unquoted/tree/docs/beginner/01-demo.md
@@ -0,0 +1,16 @@
+# Demo lesson
+
+<sub>**Beginner** · Lesson 1 of 5 · about 20 minutes · Verified against Claude Code v2.1.285 (stable) on 2026-10-05</sub>
+
+## Worked example
+
+1. Type `/status`.
+2. End the session with `/exit`.
+
+## Your turn
+
+1. Ask a question of your own.
+
+## Check
+
+Run the check.
diff --git a/.github/scripts/fixtures/lesson-quotes-title-unquoted/tree/practice/b-1.md b/.github/scripts/fixtures/lesson-quotes-title-unquoted/tree/practice/b-1.md
new file mode 100644
index 0000000..d592d50
--- /dev/null
+++ b/.github/scripts/fixtures/lesson-quotes-title-unquoted/tree/practice/b-1.md
@@ -0,0 +1,36 @@
+---
+lesson: b-1
+title: An older demo title # the app reads it unquoted
+stamp: "Verified against Claude Code v2.1.285 (stable) on 2026-10-05"
+---
+
+## intro
+- minutes: "about 20 minutes"
+
+## steps
+
+### W1 | Worked example step 1 of 2 | Look at /status
+- tier: guided
+- skill: status
+- where: claude
+- beat: do
+- verify: self
+- do: "Type `/status`."
+
+### Y1 | Your turn step 1 of 1 | Your own question
+- tier: hinted
+- skill: ask
+- where: claude
+- beat: do
+- verify: self
+- goal: "Ask a question of your own."
+- ask: Did Claude answer?
+- right: Yes
+- because: "Ask a question of your own."
+- option: Not yet
+
+## ladder
+
+### `.practice/version.txt` holds the output of `claude --version`
+- narrow "No `.practice/version.txt` yet": Which folder does the check name?
+- bottom: "End the session with `/exit`."
diff --git a/.github/scripts/fixtures/tutor-quotes-anchor-gone/fixture.json b/.github/scripts/fixtures/tutor-quotes-anchor-gone/fixture.json
deleted file mode 100644
index b478beb..0000000
--- a/.github/scripts/fixtures/tutor-quotes-anchor-gone/fixture.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "rule": "tutor-quotes",
- "expect": "fail",
- "env": {
- "TUTOR_DIR": "practice"
- },
- "about": "The lesson renamed a heading the step script links to."
-}
diff --git a/.github/scripts/fixtures/tutor-quotes-anchor-gone/tree/practice/steps/b-1.md b/.github/scripts/fixtures/tutor-quotes-anchor-gone/tree/practice/steps/b-1.md
deleted file mode 100644
index 4ec4613..0000000
--- a/.github/scripts/fixtures/tutor-quotes-anchor-gone/tree/practice/steps/b-1.md
+++ /dev/null
@@ -1,15 +0,0 @@
----
-lesson: b-1
-stamp: "Verified against Claude Code v2.1.285 (stable) on 2026-10-05"
----
-
-## start
-
-### W1 | Worked example step 1 of 2 | in the session
-- do: "Type `/status`."
-- anchor: check
-
-## your-turn
-
-### Y1 | Your turn step 1 of 1 | in the session
-- do: "Ask a question of your own."
diff --git a/.github/scripts/fixtures/tutor-quotes-crlf/fixture.json b/.github/scripts/fixtures/tutor-quotes-crlf/fixture.json
deleted file mode 100644
index 917d943..0000000
--- a/.github/scripts/fixtures/tutor-quotes-crlf/fixture.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "rule": "tutor-quotes",
- "expect": "fail",
- "env": {
- "TUTOR_DIR": "practice"
- },
- "about": "The lesson reworded a sentence that a step script with Windows line endings quotes."
-}
diff --git a/.github/scripts/fixtures/tutor-quotes-crlf/tree/practice/steps/b-1.md b/.github/scripts/fixtures/tutor-quotes-crlf/tree/practice/steps/b-1.md
deleted file mode 100644
index 4ec4613..0000000
--- a/.github/scripts/fixtures/tutor-quotes-crlf/tree/practice/steps/b-1.md
+++ /dev/null
@@ -1,15 +0,0 @@
----
-lesson: b-1
-stamp: "Verified against Claude Code v2.1.285 (stable) on 2026-10-05"
----
-
-## start
-
-### W1 | Worked example step 1 of 2 | in the session
-- do: "Type `/status`."
-- anchor: check
-
-## your-turn
-
-### Y1 | Your turn step 1 of 1 | in the session
-- do: "Ask a question of your own."
diff --git a/.github/scripts/fixtures/tutor-quotes-match/fixture.json b/.github/scripts/fixtures/tutor-quotes-match/fixture.json
deleted file mode 100644
index 952c4a1..0000000
--- a/.github/scripts/fixtures/tutor-quotes-match/fixture.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "rule": "tutor-quotes",
- "expect": "pass",
- "env": {
- "TUTOR_DIR": "practice"
- },
- "about": "The step script's quotes, Stamp, anchor and step counts all match the lesson."
-}
diff --git a/.github/scripts/fixtures/tutor-quotes-match/tree/practice/steps/b-1.md b/.github/scripts/fixtures/tutor-quotes-match/tree/practice/steps/b-1.md
deleted file mode 100644
index 4ec4613..0000000
--- a/.github/scripts/fixtures/tutor-quotes-match/tree/practice/steps/b-1.md
+++ /dev/null
@@ -1,15 +0,0 @@
----
-lesson: b-1
-stamp: "Verified against Claude Code v2.1.285 (stable) on 2026-10-05"
----
-
-## start
-
-### W1 | Worked example step 1 of 2 | in the session
-- do: "Type `/status`."
-- anchor: check
-
-## your-turn
-
-### Y1 | Your turn step 1 of 1 | in the session
-- do: "Ask a question of your own."
diff --git a/.github/scripts/fixtures/tutor-quotes-pr-unchanged/fixture.json b/.github/scripts/fixtures/tutor-quotes-pr-unchanged/fixture.json
deleted file mode 100644
index e415953..0000000
--- a/.github/scripts/fixtures/tutor-quotes-pr-unchanged/fixture.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "rule": "tutor-quotes",
- "expect": "pass",
- "env": {
- "TUTOR_DIR": ""
- },
- "about": "Offline, a pull request that leaves the tutored lessons alone passes without reading the template."
-}
diff --git a/.github/scripts/fixtures/tutor-quotes-pr-warn/fixture.json b/.github/scripts/fixtures/tutor-quotes-pr-warn/fixture.json
deleted file mode 100644
index 16a9147..0000000
--- a/.github/scripts/fixtures/tutor-quotes-pr-warn/fixture.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "rule": "tutor-quotes",
- "expect": "warn",
- "env": {
- "TUTOR_DIR": ""
- },
- "about": "Offline, a pull request that changes a tutored lesson gets a warning to run the comparison locally."
-}
diff --git a/.github/scripts/fixtures/tutor-quotes-quote-gone/fixture.json b/.github/scripts/fixtures/tutor-quotes-quote-gone/fixture.json
deleted file mode 100644
index f79d0ff..0000000
--- a/.github/scripts/fixtures/tutor-quotes-quote-gone/fixture.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "rule": "tutor-quotes",
- "expect": "fail",
- "env": {
- "TUTOR_DIR": "practice"
- },
- "about": "The lesson reworded a sentence the step script quotes."
-}
diff --git a/.github/scripts/fixtures/tutor-quotes-quote-gone/tree/practice/steps/b-1.md b/.github/scripts/fixtures/tutor-quotes-quote-gone/tree/practice/steps/b-1.md
deleted file mode 100644
index 4ec4613..0000000
--- a/.github/scripts/fixtures/tutor-quotes-quote-gone/tree/practice/steps/b-1.md
+++ /dev/null
@@ -1,15 +0,0 @@
----
-lesson: b-1
-stamp: "Verified against Claude Code v2.1.285 (stable) on 2026-10-05"
----
-
-## start
-
-### W1 | Worked example step 1 of 2 | in the session
-- do: "Type `/status`."
-- anchor: check
-
-## your-turn
-
-### Y1 | Your turn step 1 of 1 | in the session
-- do: "Ask a question of your own."
diff --git a/.github/scripts/fixtures/tutor-quotes-stamp-changed/fixture.json b/.github/scripts/fixtures/tutor-quotes-stamp-changed/fixture.json
deleted file mode 100644
index e3b7009..0000000
--- a/.github/scripts/fixtures/tutor-quotes-stamp-changed/fixture.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "rule": "tutor-quotes",
- "expect": "fail",
- "env": {
- "TUTOR_DIR": "practice"
- },
- "about": "The lesson was restamped, so the step script must be re-verified and restamped too."
-}
diff --git a/.github/scripts/fixtures/tutor-quotes-stamp-changed/tree/practice/steps/b-1.md b/.github/scripts/fixtures/tutor-quotes-stamp-changed/tree/practice/steps/b-1.md
deleted file mode 100644
index 4ec4613..0000000
--- a/.github/scripts/fixtures/tutor-quotes-stamp-changed/tree/practice/steps/b-1.md
+++ /dev/null
@@ -1,15 +0,0 @@
----
-lesson: b-1
-stamp: "Verified against Claude Code v2.1.285 (stable) on 2026-10-05"
----
-
-## start
-
-### W1 | Worked example step 1 of 2 | in the session
-- do: "Type `/status`."
-- anchor: check
-
-## your-turn
-
-### Y1 | Your turn step 1 of 1 | in the session
-- do: "Ask a question of your own."
diff --git a/.github/scripts/fixtures/tutor-quotes-step-added/fixture.json b/.github/scripts/fixtures/tutor-quotes-step-added/fixture.json
deleted file mode 100644
index 6740a49..0000000
--- a/.github/scripts/fixtures/tutor-quotes-step-added/fixture.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "rule": "tutor-quotes",
- "expect": "fail",
- "env": {
- "TUTOR_DIR": "practice"
- },
- "about": "The lesson gained a Worked example step, so the step script's step counts are wrong."
-}
diff --git a/.github/scripts/fixtures/tutor-quotes-step-added/tree/practice/steps/b-1.md b/.github/scripts/fixtures/tutor-quotes-step-added/tree/practice/steps/b-1.md
deleted file mode 100644
index 4ec4613..0000000
--- a/.github/scripts/fixtures/tutor-quotes-step-added/tree/practice/steps/b-1.md
+++ /dev/null
@@ -1,15 +0,0 @@
----
-lesson: b-1
-stamp: "Verified against Claude Code v2.1.285 (stable) on 2026-10-05"
----
-
-## start
-
-### W1 | Worked example step 1 of 2 | in the session
-- do: "Type `/status`."
-- anchor: check
-
-## your-turn
-
-### Y1 | Your turn step 1 of 1 | in the session
-- do: "Ask a question of your own."
diff --git a/.github/scripts/fixtures/tutor-quotes-title-changed/fixture.json b/.github/scripts/fixtures/tutor-quotes-title-changed/fixture.json
deleted file mode 100644
index 304f391..0000000
--- a/.github/scripts/fixtures/tutor-quotes-title-changed/fixture.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "rule": "tutor-quotes",
- "expect": "fail",
- "env": {
- "TUTOR_DIR": "practice"
- },
- "about": "The step script's title no longer matches the lesson's heading."
-}
diff --git a/.github/scripts/fixtures/tutor-quotes-title-changed/tree/practice/steps/b-1.md b/.github/scripts/fixtures/tutor-quotes-title-changed/tree/practice/steps/b-1.md
deleted file mode 100644
index fb0e265..0000000
--- a/.github/scripts/fixtures/tutor-quotes-title-changed/tree/practice/steps/b-1.md
+++ /dev/null
@@ -1,16 +0,0 @@
----
-lesson: b-1
-title: "An older demo title"
-stamp: "Verified against Claude Code v2.1.285 (stable) on 2026-10-05"
----
-
-## start
-
-### W1 | Worked example step 1 of 2 | in the session
-- do: "Type `/status`."
-- anchor: check
-
-## your-turn
-
-### Y1 | Your turn step 1 of 1 | in the session
-- do: "Ask a question of your own."
diff --git a/.github/scripts/rules/index.mjs b/.github/scripts/rules/index.mjs
index fbd6ab9..37528a8 100644
--- a/.github/scripts/rules/index.mjs
+++ b/.github/scripts/rules/index.mjs
@@ -11,8 +11,8 @@ import * as lessonLint from './lesson-lint.mjs';
import * as staticValidation from './static-validation.mjs';
import * as inertness from './inertness.mjs';
import * as smokeTests from './smoke-tests.mjs';
-import * as tutorQuotes from './tutor-quotes.mjs';
+import * as lessonQuotes from './lesson-quotes.mjs';
import * as externalLinks from './external-links.mjs';
import * as drift from './drift.mjs';
-export const rules = [internalLinks, anchorDiff, stubPaths, stamps, editionGate, expiry, emDash, images, lessonLint, staticValidation, inertness, smokeTests, tutorQuotes, externalLinks, drift];
+export const rules = [internalLinks, anchorDiff, stubPaths, stamps, editionGate, expiry, emDash, images, lessonLint, staticValidation, inertness, smokeTests, lessonQuotes, externalLinks, drift];
diff --git a/.github/scripts/rules/lesson-quotes.mjs b/.github/scripts/rules/lesson-quotes.mjs
new file mode 100644
index 0000000..448c3c6
--- /dev/null
+++ b/.github/scripts/rules/lesson-quotes.mjs
@@ -0,0 +1,164 @@
+// The practice template's learning app, `npm run learn`, quotes lessons word
+// for word, from one lesson file per lesson (learn/lessons/<id>.md in the
+// template); .github/compat/learn.txt lists them. In a lesson file, every
+// double-quoted `- key: "…"` value is the lesson's own text. This rule fails
+// when such a quote, the title, the Stamp or a step count no longer matches
+// its lesson. It reads each line and the front matter as the app does
+// (learn/lib/content.mjs and checks/frontmatter.mjs in the template), so no
+// spacing, quoting or line ending the app accepts can hide a quote. It needs
+// the template's lesson files: with LEARN_DIR set to a template checkout's
+// learn/lessons folder, any mode reads them there; the weekly scheduled run
+// fetches them from the template's main branch. A pull request run without
+// LEARN_DIR stays offline and only warns when the change touches a listed
+// lesson.
+import { existsSync, readFileSync } from 'node:fs';
+import { join, resolve } from 'node:path';
+import { readText } from '../lib/tree.mjs';
+import { changedFiles } from '../lib/git.mjs';
+import { outsideFences } from '../lib/markdown.mjs';
+import { STAMP } from '../lib/stamps.mjs';
+
+export const id = 'lesson-quotes';
+export const modes = ['pr', 'scheduled'];
+
+const LIST = '.github/compat/learn.txt';
+const RAW = 'https://raw.githubusercontent.com/wesammustafa/claude-code-practice/main/learn/lessons';
+const flat = (text) => text.replace(/\s+/g, ' ').trim();
+
+// The front matter as the app reads it: a copy of checks/frontmatter.mjs in
+// the template (`key: value` lines, quoted or not, a trailing ` # comment`,
+// folded and literal blocks, lists, and plain values on indented lines), so a
+// title or Stamp the app shows can't be read differently here.
+const unquote = (value) => value.replace(/^(['"])(.*)\1$/, '$2');
+
+function uncomment(value) {
+ const v = value.trim();
+ const quoted = v.match(/^(['"]).*?\1/);
+ if (quoted) return quoted[0];
+ return v.replace(/\s+#.*$/, '');
+}
+
+function scalar(value) {
+ const v = uncomment(value);
+ if (/^\[.*\]$/.test(v)) return v.slice(1, -1).split(',').map((s) => unquote(s.trim())).filter(Boolean);
+ return unquote(v);
+}
+
+function frontmatter(text) {
+ const lines = (text ?? '').replace(/^\uFEFF/, '').split(/\r?\n/);
+ if (lines[0].trim() !== '---') return {};
+ const end = lines.findIndex((line, i) => i > 0 && line.trim() === '---');
+ if (end === -1) return {};
+ const fields = {};
+ let key = null;
+ let block = null;
+ let plain = false;
+ for (const line of lines.slice(1, end)) {
+ if (/^\s*#/.test(line) || !line.trim()) {
+ if (block && !line.trim()) block.lines.push('');
+ continue;
+ }
+ const top = line.match(/^([A-Za-z_][\w-]*):(?:\s+(.*))?$/);
+ if (top) {
+ key = top[1];
+ const value = (top[2] ?? '').trim();
+ block = /^[|>][+-]?$/.test(uncomment(value)) ? { folded: uncomment(value).startsWith('>'), lines: [] } : null;
+ plain = false;
+ fields[key] = block ? '' : uncomment(value) === '' ? [] : scalar(value);
+ continue;
+ }
+ if (!key || !/^\s/.test(line)) continue;
+ if (block) {
+ block.lines.push(line.trim());
+ fields[key] = block.lines.join(block.folded ? ' ' : '\n').replace(/\s+$/, '');
+ } else if (!plain && Array.isArray(fields[key]) && /^\s*-\s+/.test(line)) {
+ fields[key].push(unquote(uncomment(line.replace(/^\s*-\s+/, ''))));
+ } else if (plain || (Array.isArray(fields[key]) && fields[key].length === 0)) {
+ fields[key] = plain ? `${fields[key]} ${uncomment(line)}` : unquote(uncomment(line));
+ plain = true;
+ }
+ }
+ return fields;
+}
+
+function listed(root) {
+ if (!existsSync(join(root, LIST))) return [];
+ return readText(root, LIST).split('\n').map((l) => l.trim()).filter((l) => l && !l.startsWith('#'))
+ .map((l) => { const [lesson, page] = l.split(/\s+/); return { lesson, page }; });
+}
+
+async function lessonFile(root, lesson) {
+ const dir = process.env.LEARN_DIR;
+ if (dir) return readFileSync(join(resolve(root, dir), `${lesson}.md`), 'utf8');
+ const res = await fetch(`${RAW}/${lesson}.md`, { signal: AbortSignal.timeout(20_000) });
+ if (!res.ok) throw new Error(`the template's learn/lessons/${lesson}.md returned ${res.status}`);
+ return res.text();
+}
+
+// The number of top-level numbered steps under a `## <name>` heading.
+function stepCount(text, name) {
+ let inside = false;
+ let count = 0;
+ for (const { line } of outsideFences(text)) {
+ if (/^## /.test(line)) inside = line.trim() === `## ${name}`;
+ else if (inside && /^\d+\. /.test(line)) count += 1;
+ }
+ return count;
+}
+
+function compare(lesson, page, rawPage, rawFile) {
+ const pageText = rawPage.replace(/\r\n?/g, '\n');
+ const file = rawFile.replace(/\r\n?/g, '\n');
+ const problems = [];
+ const say = (msg) => problems.push(`${page}: the app's learn/lessons/${lesson}.md ${msg}`);
+ const body = flat(pageText);
+ const stamp = pageText.match(STAMP)?.[0];
+ const fields = frontmatter(rawFile);
+ const theirs = fields.stamp;
+ if (theirs !== stamp) say(`is stamped "${theirs}", but the lesson is stamped "${stamp}". Re-verify the lesson file and copy the new Stamp.`);
+ const title = fields.title;
+ const h1 = pageText.match(/^# (.+)$/m)?.[1]?.trim();
+ if (title !== h1) say(`is titled "${title}", but the lesson's heading is "${h1}".`);
+ const recounted = new Set();
+ let heading = '(front matter)';
+ for (const line of file.split('\n')) {
+ const h = line.match(/^#{2,3} (.+)$/);
+ if (h) {
+ heading = h[1];
+ const counted = h[1].match(/(Worked example|Your turn) step \d+ of (\d+)/);
+ if (counted && !recounted.has(counted[1]) && stepCount(pageText, counted[1]) !== Number(counted[2])) {
+ recounted.add(counted[1]);
+ say(`counts ${counted[2]} steps in ${counted[1]}, but the lesson has ${stepCount(pageText, counted[1])}.`);
+ }
+ continue;
+ }
+ const q = line.match(/^- [a-z-]+: (.+)$/)?.[1].trim().match(/^"(.*)"$/);
+ if (q && !body.includes(flat(q[1]))) say(`quotes "${q[1]}" (${heading}), which is no longer in the lesson.`);
+ }
+ return problems;
+}
+
+export async function run(ctx) {
+ const lessons = listed(ctx.root);
+ if (!lessons.length) return { status: 'pass', summary: `no lessons listed in ${LIST}` };
+ if (!process.env.LEARN_DIR && ctx.mode === 'pr') {
+ if (!ctx.base.sha) return { status: 'skip', summary: `diff-scoped: ${ctx.base.note}` };
+ const changed = new Set(changedFiles(ctx.root, ctx.base.sha));
+ const touched = lessons.filter((l) => changed.has(l.page));
+ if (!touched.length) return { status: 'pass', summary: `${lessons.length} lesson(s) in the app, none changed; the weekly run compares the quotes` };
+ return {
+ status: 'warn',
+ problems: touched.map((l) => `${l.page} changed, and the practice template's learning app quotes it in learn/lessons/${l.lesson}.md. Before you merge, run LEARN_DIR=<template checkout>/learn/lessons node .github/scripts/check.mjs --only lesson-quotes, and if it fails, update the lesson file in the template first.`),
+ };
+ }
+ const problems = [];
+ for (const { lesson, page } of lessons) {
+ if (!existsSync(join(ctx.root, page))) {
+ problems.push(`${LIST} lists ${page}, which doesn't exist`);
+ continue;
+ }
+ problems.push(...compare(lesson, page, readText(ctx.root, page), await lessonFile(ctx.root, lesson)));
+ }
+ if (problems.length) return { status: 'fail', problems };
+ return { status: 'pass', summary: `${lessons.length} lesson(s) in the app match their lesson files` };
+}
diff --git a/.github/scripts/rules/tutor-quotes.mjs b/.github/scripts/rules/tutor-quotes.mjs
deleted file mode 100644
index 9c7d16e..0000000
--- a/.github/scripts/rules/tutor-quotes.mjs
+++ /dev/null
@@ -1,107 +0,0 @@
-// The practice template's /tutor skill quotes lessons word for word, from one
-// step script per lesson; .github/compat/tutor.txt lists them. This rule fails
-// when a quote, the title, the Stamp, a linked anchor or a step count in a step
-// script no longer matches its lesson, whatever the step script's line endings. It needs the template's step scripts: with
-// TUTOR_DIR set to a template checkout's .claude/skills/tutor folder, any mode
-// reads them there; the weekly scheduled run fetches them from the template's
-// main branch. A pull request run without TUTOR_DIR stays offline and only
-// warns when the change touches a listed lesson.
-import { existsSync, readFileSync } from 'node:fs';
-import { join, resolve } from 'node:path';
-import { readText } from '../lib/tree.mjs';
-import { changedFiles } from '../lib/git.mjs';
-import { outsideFences, pageIds } from '../lib/markdown.mjs';
-import { STAMP } from '../lib/stamps.mjs';
-
-export const id = 'tutor-quotes';
-export const modes = ['pr', 'scheduled'];
-
-const LIST = '.github/compat/tutor.txt';
-const RAW = 'https://raw.githubusercontent.com/wesammustafa/claude-code-practice/main/.claude/skills/tutor';
-// Step script keys whose value is lesson text in double quotes.
-const QUOTES = new Set(['do', 'rule', 'expect', 'note', 'after', 'own-repo', 'self', 'goal', 'quote', 'bottom', 'on-hint']);
-const flat = (text) => text.replace(/\s+/g, ' ').trim();
-
-function listed(root) {
- if (!existsSync(join(root, LIST))) return [];
- return readText(root, LIST).split('\n').map((l) => l.trim()).filter((l) => l && !l.startsWith('#'))
- .map((l) => { const [lesson, page] = l.split(/\s+/); return { lesson, page }; });
-}
-
-async function stepScript(root, lesson) {
- const dir = process.env.TUTOR_DIR;
- if (dir) return readFileSync(join(resolve(root, dir), 'steps', `${lesson}.md`), 'utf8');
- const res = await fetch(`${RAW}/steps/${lesson}.md`, { signal: AbortSignal.timeout(20_000) });
- if (!res.ok) throw new Error(`the template's steps/${lesson}.md returned ${res.status}`);
- return res.text();
-}
-
-// The number of top-level numbered steps under a `## <name>` heading.
-function stepCount(text, name) {
- let inside = false;
- let count = 0;
- for (const { line } of outsideFences(text)) {
- if (/^## /.test(line)) inside = line.trim() === `## ${name}`;
- else if (inside && /^\d+\. /.test(line)) count += 1;
- }
- return count;
-}
-
-function compare(lesson, page, rawPage, rawScript) {
- const pageText = rawPage.replace(/\r\n?/g, '\n');
- const script = rawScript.replace(/\r\n?/g, '\n');
- const problems = [];
- const say = (msg) => problems.push(`${page}: the tutor's steps/${lesson}.md ${msg}`);
- const body = flat(pageText);
- const stamp = pageText.match(STAMP)?.[0];
- const theirs = script.match(/^stamp: "(.*)"$/m)?.[1];
- if (theirs !== stamp) say(`is stamped "${theirs}", but the lesson is stamped "${stamp}". Re-verify the step script and copy the new Stamp.`);
- const title = script.match(/^title: "(.*)"$/m)?.[1];
- const h1 = pageText.match(/^# (.+)$/m)?.[1]?.trim();
- if (title !== undefined && title !== h1) say(`is titled "${title}", but the lesson's heading is "${h1}".`);
- const ids = pageIds(pageText);
- const recounted = new Set();
- let heading = '(front matter)';
- for (const line of script.split('\n')) {
- const h = line.match(/^### (.+)$/);
- if (h) {
- heading = h[1];
- const counted = h[1].match(/(Worked example|Your turn) step \d+ of (\d+)/);
- if (counted && !recounted.has(counted[1]) && stepCount(pageText, counted[1]) !== Number(counted[2])) {
- recounted.add(counted[1]);
- say(`counts ${counted[2]} steps in ${counted[1]}, but the lesson has ${stepCount(pageText, counted[1])}.`);
- }
- continue;
- }
- const q = line.match(/^- ([a-z-]+): "(.*)"$/);
- if (q && QUOTES.has(q[1]) && !body.includes(flat(q[2]))) say(`quotes "${q[2]}" (${heading}), which is no longer in the lesson.`);
- const a = line.match(/^- anchor: (\S+)$/);
- if (a && !ids.includes(a[1])) say(`links #${a[1]} (${heading}), which the lesson no longer has.`);
- }
- return problems;
-}
-
-export async function run(ctx) {
- const lessons = listed(ctx.root);
- if (!lessons.length) return { status: 'pass', summary: `no lessons listed in ${LIST}` };
- if (!process.env.TUTOR_DIR && ctx.mode === 'pr') {
- if (!ctx.base.sha) return { status: 'skip', summary: `diff-scoped: ${ctx.base.note}` };
- const changed = new Set(changedFiles(ctx.root, ctx.base.sha));
- const touched = lessons.filter((l) => changed.has(l.page));
- if (!touched.length) return { status: 'pass', summary: `${lessons.length} tutored lesson(s), none changed; the weekly run compares the quotes` };
- return {
- status: 'warn',
- problems: touched.map((l) => `${l.page} changed, and the practice template's /tutor quotes it in .claude/skills/tutor/steps/${l.lesson}.md. Before you merge, run TUTOR_DIR=<template checkout>/.claude/skills/tutor node .github/scripts/check.mjs --only tutor-quotes, and if it fails, update the step script in the template first.`),
- };
- }
- const problems = [];
- for (const { lesson, page } of lessons) {
- if (!existsSync(join(ctx.root, page))) {
- problems.push(`${LIST} lists ${page}, which doesn't exist`);
- continue;
- }
- problems.push(...compare(lesson, page, readText(ctx.root, page), await stepScript(ctx.root, lesson)));
- }
- if (problems.length) return { status: 'fail', problems };
- return { status: 'pass', summary: `${lessons.length} tutored lesson(s) match their step scripts` };
-}
diff --git a/.github/workflows/tutor-weekly.yml b/.github/workflows/lesson-quotes-weekly.yml
similarity index 58%
rename from .github/workflows/tutor-weekly.yml
rename to .github/workflows/lesson-quotes-weekly.yml
index 930f606..3ee74d5 100644
--- a/.github/workflows/tutor-weekly.yml
+++ b/.github/workflows/lesson-quotes-weekly.yml
@@ -1,9 +1,10 @@
-name: Weekly tutor quotes
+name: Weekly lesson quotes
-# Runs the tutor-quotes check in scheduled mode: it fetches the practice
-# template's /tutor step scripts from its main branch and compares them with
-# the lessons they quote. On a problem it opens, or updates, one tracking issue
-# titled "Tutor quotes drifted from a lesson". It never opens a pull request.
+# Runs the lesson-quotes check in scheduled mode: it fetches the practice
+# template's learning app lesson files from its main branch and compares them
+# with the lessons they quote. On a problem it opens, or updates, one tracking
+# issue titled "Lesson quotes drifted from a lesson". It never opens a pull
+# request.
on:
schedule:
- cron: "0 8 * * 1"
@@ -14,7 +15,7 @@ permissions:
issues: write
jobs:
- tutor:
+ lesson-quotes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
@@ -25,7 +26,7 @@ jobs:
id: check
run: |
set +e
- node .github/scripts/check.mjs --mode scheduled --only tutor-quotes > "$RUNNER_TEMP/check.txt" 2>&1
+ node .github/scripts/check.mjs --mode scheduled --only lesson-quotes > "$RUNNER_TEMP/check.txt" 2>&1
echo "code=$?" >> "$GITHUB_OUTPUT"
cat "$RUNNER_TEMP/check.txt"
- name: Open or update the tracking issue
@@ -33,4 +34,4 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- run: .github/scripts/tracking-issue.sh "Tutor quotes drifted from a lesson" "$RUNNER_TEMP/check.txt"
+ run: .github/scripts/tracking-issue.sh "Lesson quotes drifted from a lesson" "$RUNNER_TEMP/check.txt"
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 16043ab..b9a0e30 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -218,7 +218,7 @@ It needs Node.js LTS, git, Ruby (for YAML), jq (for the examples' smoke tests),
| `static-validation` | JSON, YAML, skill or agent frontmatter, a workflow script or a shell script does not parse or lint |
| `inertness` | `examples/` holds a path Claude Code can load on its own, or a marketplace manifest not renamed to `dot-claude-plugin/`, or the repository root holds a `.claude-plugin/` folder |
| `smoke-tests` | An example's `test.sh` fails (only when the change touches `examples/`) |
-| `tutor-quotes` | With `TUTOR_DIR` set to a practice template checkout's `.claude/skills/tutor` folder, or in the weekly run: a quote, the title, the Stamp, a linked anchor or a step count in a `/tutor` step script no longer matches its lesson. On a pull request that changes a lesson listed in `tutor.txt`, it only warns |
+| `lesson-quotes` | With `LEARN_DIR` set to a practice template checkout's `learn/lessons` folder, or in the weekly run: a quoted line, the title, the Stamp or a step count in a lesson file of the template's learning app no longer matches its lesson. On a pull request that changes a lesson listed in `learn.txt`, it only warns |
Each rule has known-bad fixtures under `.github/scripts/fixtures/`, one folder per case: `fixture.json` names the rule and the expected result, `tree/` holds the files, `base/` the state before a change, and `generate.mjs` writes anything that would be live Claude Code config if committed. If you change a rule, run the self-test too:
@@ -235,7 +235,7 @@ Scheduled checks keep watch between editions. Each opens or updates one tracking
| Weekly external links | Mondays | Broken external links |
| Daily expiry markers | Daily | Expired facts in the guide |
| Weekly version drift | Mondays | New Claude Code stable release |
-| Weekly tutor quotes | Mondays | Tutor quotes drifted from a lesson |
+| Weekly lesson quotes | Mondays | Lesson quotes drifted from a lesson |
Every month, the maintainer: