$npx -y skills add rayw-lab/english-immersion-reader --skill immersion-readerBuild a local H5 English deep-reading lesson from an article URL, YouTube transcript, podcast transcript, or prepared segments.json.
| 1 | # Immersion Reader |
| 2 | |
| 3 | ## Setup (run once before first use) |
| 4 | |
| 5 | 1. Locate the repo root: this skill folder lives at `<repo>/skills/immersion-reader/` |
| 6 | — resolve the real path of this file and go up two directories. If you only have |
| 7 | the skill folder (no repo), clone it first: |
| 8 | `git clone https://github.com/rayw-lab/english-immersion-reader` |
| 9 | 2. Install the two Python dependencies (Python >= 3.10): |
| 10 | `python3 -m pip install jsonschema edge-tts` |
| 11 | (or, inside the repo: `python3 -m pip install -e .`) |
| 12 | 3. `edge-tts` needs network access at synthesis time; the script manages proxy |
| 13 | env vars itself, so no proxy setup is required. |
| 14 | |
| 15 | Follow `AGENTS.md` in this repository. |
| 16 | |
| 17 | ## Compile flow |
| 18 | |
| 19 | 1. Write `lessons/<slug>/segments.json` per `AGENTS.md` (segments + hard + |
| 20 | chunks + patterns + transfer task + full `lexicon`). |
| 21 | 2. `python src/tts_generate.py lessons/<slug>/segments.json --out lessons/<slug>/audio` |
| 22 | — one command produces segment mp3s, per-word audio for every lexicon term |
| 23 | (default `--word-audio full`, so card/selection playback never falls back to |
| 24 | browser TTS), and `.words.json` sidecars that power the karaoke word |
| 25 | highlight. Needs network. |
| 26 | 3. `python src/build_page.py lessons/<slug>/segments.json --out lessons/<slug>` |
| 27 | — validates the contract, injects data + word timings, prints the Chinese |
| 28 | closeout block. Relay that block verbatim; do not invent a summary. |
| 29 | 4. Upgrading an older lesson: rerun step 2 (word audio fills in incrementally); |
| 30 | add `--force` to regenerate segment mp3s so they gain timing sidecars. |
| 31 | |
| 32 | Use this skill when the user asks for any of these: |
| 33 | |
| 34 | - turn an English article URL into an immersion reading lesson |
| 35 | - turn a YouTube video or transcript into an English listening lesson |
| 36 | - build an H5/static HTML lesson with original English text |
| 37 | - create local audio, word cards, chunk cards, dictation, shadowing, or agent-copy prompts from source English |
| 38 | |
| 39 | Default output stays local under `lessons/`; generated lessons and transcripts are not committed unless the user owns the rights and explicitly asks. |