Challenge
- Once writing starts, chapters get crammed with concepts and none of them is explained fully
- Questions readers raise while reading, and the answers they get, vanish into chat and never reach the next reader
Approach
- Start with a concept list for the whole work, then write each chapter on a five-part skeleton: what it is, what it is not, how it differs, how to use it, practice
- Q&A goes into a supplement md word for word; the tutorial HTML only gains per-term hover layers and expandable panels
Outcome
- Every chapter has the same shape, and md (the editable source), HTML (to share) and PDF (to print or archive) come out together
- Without changing a single word of the tutorial text, readers' real questions can be read right where they arose
When the author writes course or book material, the rule is that one chapter fully explains one concept. A concept list for the whole work comes first; each chapter follows the five-part skeleton, and every section is checked for what, why and how. A fixed "common mistakes" panel at the end of each chapter grows as real readers' mistakes are collected.
On the reading side, the reader asks Claude Code questions while going through the tutorial and, once satisfied, freezes the exchange. The supplement keeps it verbatim, and the tutorial HTML gains a pure-CSS hover layer with no scripts, so it works even inside a sandboxed HTML preview.
The full workflow
| Task | Who | Inputs | Outputs |
|---|---|---|---|
| 1. List concepts | Main session | — | Concept list |
| 2. Write 5 parts | Main session | Concept list, Refers to Skeleton | Chapter draft |
| 3. Export | Export scriptmd2doc.sh | Chapter draft | HTML + PDF |
| 4. Read and ask | Readerreader | HTML + PDF | Reading Q&A |
| 5. Freeze Q&A | Main session | Reading Q&A, Refers to Q&A template | Q&A supplement |
| 6. Inject hovers | Hover builderbuild_qa.py | Q&A supplement, HTML + PDF | Hover page |
6 steps · 1 role · 2 scripts · 2 skills · 2 loops
The writer follows a fixed shape, one concept per chapter; the reader's questions are laid over the tutorial word for word.
- Steps 1–3 are the tutorial-chapter skill, steps 5–6 the tutorial-qa skill; only step 4 is a person's work
- The main session does the writing and curating; scripts handle only export and injection
- Two loops: revise a chapter on readers' feedback, and re-pick an anchor term the page does not contain
- The tutorial text and its source are never rewritten along the way
Project folders involved (3)
This workflow does not live in one folder: it runs across projects.
- ~/.claude/skills/tutorial-chapter
- Writing side: the method in its original words, the chapter skeleton, a sample chapter, the export script and stylesheet
- ~/.claude/skills/tutorial-qa
- Reading side: the supplement template and the injection script
- any project folder that holds a tutorial
- Where the tutorial lives; chapters, supplements and archived versions all stay next to it
Step 1 · Main session
List conceptsconcept list
Write the concept list before any chapter.
- One concept per line, naming the concept itself, not a chapter title
- A line that fails "what would the reader miss without it?" is cut or folded into another chapter's differences
- No body text until the list is settled: it is the contract for the whole work
Common misconceptionStarting from chapter one crams in concepts until none is explained fully
| Outputs | Concept list |
Step 2 · Main session
Write 5 partsfive parts
Write one chapter on the five-part skeleton.
- What it is, what it is not, differences, how to use it, practice; the headings never change
- "What it is not" names a real misconception; "differences" says what goes wrong if you mix them up
- Each section is checked for missing what, why or how, and facts are checked against primary sources
Common misconceptionThe common-mistakes panel is never filled with invented errors; until real ones arrive it says so
| Inputs | Concept list |
| Outputs | Chapter draft |
| Refers to | Skeleton |
Step 3 · Export script
Exportpandoc
Turn the md into HTML and PDF in one go.
- md is the editable source, HTML is for sharing (opens with a double-click), PDF is for printing and archiving
- If a file of the same name exists it is never overwritten; a numbered copy is written instead
- Bilingual quotes collapse into one paragraph unless an empty quote line separates them, so the PDF is always opened and checked
| Inputs | Chapter draft |
| Outputs | HTML + PDF |
Step 4 · Reader
Read and askClaude Code
The reader asks Claude Code questions while reading.
- The tutorial stays open in an editor's HTML preview while reading
- It can take several rounds; the exchange continues until the reader is satisfied
- If an answer looks doubtful, it is verified first, before anything is frozen
Claude CodeThe questions happen in an ordinary session; no special tool is needed
| Inputs | HTML + PDF |
| Outputs | Reading Q&A |
Step 5 · Main session
Freeze Q&Averbatim
Keep the Q&A word for word in a supplement file.
- Questions are kept as typed, typos included; the final answer is kept in full
- One exchange becomes one entry, each tagged with two or three anchor terms from the page
- The tutorial md is never touched; even a discovered error is only noted inside the supplement
Common misconceptionSummarise the answers and nobody can later see what was actually unclear
| Inputs | Reading Q&A |
| Outputs | Q&A supplement |
| Refers to | Q&A template |
Step 6 · Hover builder
Inject hoverspure CSS
Add hover layers and expandable panels to the tutorial HTML.
- Anchor terms get a dotted underline: hover shows an excerpt, expanding shows the full exchange
- It is pure CSS with no scripts, so it works inside previews that strip scripts
- The old version is archived first and no text changes; the supplement also gets a matching HTML twin
Claude CodeIf an anchor term is not found, the script exits with an error and you go back to step 5 to pick another
| Inputs | Q&A supplement, HTML + PDF |
| Outputs | Hover page |
Loops and rework
- Readers' feedback → step 2: Drafts go out marked "v1, awaiting feedback"; what comes back feeds the common-mistakes panel
- Anchor term not found → step 5: Pick another term and rerun; the old layer is removed first, so it can be repeated freely
Key points
The first thing written is not chapter one but the concept list. One concept per line; anything that fails the question "what would the reader miss if this were cut?" is dropped or folded into another chapter's "differences" section. The list is the contract for the whole work, and no body text is written until it is settled.
Do not cut corners on "what it is not" and "differences". The first must name and refute a misconception that really exists; the second must say not only how similar concepts differ but what goes wrong if you confuse them. Mistakes are never invented: until real ones are collected, the panel says it is waiting for them.
Q&A verbatim, tutorial untouched. Questions are kept as typed, typos included, and the final answer is kept in full. The tutorial HTML is archived first, then only gains wrapped terms and expandable panels, with its text unchanged. Each anchor term is checked to appear in the page, and is re-chosen if it does not.