readalong-writing
Skill1 starsChanged 24 days agoMITView on GitHub
How to write a codelabgen lesson's read-along (`docs/readalong.md`) — a plain explanation of the lesson code, meant to be read side by side with the code in the editor, referring to files, functions, classes and lines. Used by the readalong-writer agent.
In this repository24 other files it gives its agents.
- code-authoringSkill
- codelabgen-orchestratorSkill
- course-extensionSkill
- curriculum-designSkill
- diagrammingSkill
- example-designSkill
- lesson-reviewSkill
- notes-writingSkill
- runtime-strategySkill
- site-assemblySkill
- source-articlesSkill
- source-books-coursesSkill
- source-digestSkill
- source-evaluationSkill
- source-github-reposSkill
- source-official-blogSkill
- source-official-docsSkill
- source-package-internalsSkill
- source-papers-specsSkill
- source-qaSkill
- source-talks-workshopsSkill
- source-universitySkill
- state-protocolSkill
- topic-extractionSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Keep it simple and short. A paragraph or a few bullets per function is usually enough.
- Very specific: line 13
Write in the course language (language in .codelabgen/config.yaml).
- Very specific: line 48
Don't copy code into the read-along.
- Very specific: line 63
Every link points to an existing file, and every #L… anchor to an existing line: codelabgen check links --course <dir> reports nothing for …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Writing the read-along
The learner opens the lesson code and the read-along side by side, for example in VS Code. The read-along explains the code: what each part is for, why it is written this way, and what the library does behind each call. That's all. No copies of the code, no theory (that's in the notes), no exercises.
Keep it simple and short. A paragraph or a few bullets per function is usually enough.
Write in the course language (language in .codelabgen/config.yaml). Identifiers, file names and commands stay as they are.
Structure
# <id> <lesson title> — разбор кода ← "code walkthrough" in the course language
One or two sentences: what the program does. Run it with `./run.sh <id>` from the course root.
The concept itself: [конспект](notes.md).
## Что изменилось с урока X ← only when the example extends an earlier lesson
A short list of the changes, each with a link to the place in the code.
## [state.py](../src/l1_2_routing/state.py) ← one section per file, in reading order
What the file is for, in a sentence.
- [`TicketState`](../src/l1_2_routing/state.py#L8) — …
- [`route`](../src/l1_2_routing/state.py#L12): the `Annotated[list[str], operator.add]` annotation in line 12 makes LangGraph …
## [graph.py](../src/l1_2_routing/graph.py)
…Section titles are examples in Russian; use the course language.
Order
Order the files so the reader understands each one before the next needs it. Usually: the data (state, models), then the pieces that act on it (nodes, handlers, functions), then how they are wired together, then the entry point that runs everything. Within a file, follow the code from top to bottom, so the reader can scroll along.
Referring to code
- By name first: functions, classes, methods, variables, in backticks:
build_graph,TicketState.route. - Link each name to its place, relative to the read-along, with a line anchor:
[build_graph](../src/l1_2_routing/graph.py#L74), or a range:…graph.py#L74-L94. In VS Code these links open the file at that line, on GitHub they highlight it, and the reader always knows where to look. - Line numbers for single lines that matter: "line 87 adds the conditional edge". Take the numbers from the final code, and check them.
- Paths go from
docs/readalong.mdto the code:../src/…for Python, Node and Rust,../<file>.gofor Go. - Don't copy code into the read-along. A short inline fragment in backticks is fine when you talk about it: "the call
builder.add_conditional_edges("classify", route_ticket)".
What to explain
- What the code comments don't already say. The code has its own comments, so don't repeat them. Add what a learner would ask next to the code: why this approach, what the library does here, what happens at run time, what would break if you changed it.
- The technology, not the syntax. "
add_noderegisters the function under a name; the graph calls it with the current state and merges what it returns" is the point. "Here we call add_node" is not. - The non-obvious lines, one by one when needed: a default that matters, an order that matters, a value that is merged rather than replaced.
- For the concept itself, link to the notes (
подробнее — в [конспекте](notes.md#…)) instead of explaining theory here.
Syntax
Plain Markdown: headings, short paragraphs, lists, inline code, relative links. Nothing else is needed. In particular, no snippet markers, no code blocks with lesson code, no <details>, no diagrams.
Before you finish
- Every link points to an existing file, and every
#L…anchor to an existing line:codelabgen check links --course <dir>reports nothing for this lesson. - Open each linked line and make sure it really shows what the text says it shows.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

