Build your first course
This step-by-step walkthrough creates a minimal, valid 1-task course by hand so you can see how every file connects before scaling up or bringing in an AI agent.
We will build a compact English course for French speakers (Calling in Sick, modeled on courses/calling-in-sick). You can inspect the finished Calling in Sick course reference first to see what OpenL2 compiles from these files.
1. Scaffold the course directory
Section titled “1. Scaffold the course directory”Run openl2 course init to generate a valid single-level course skeleton:
openl2 course init my-sick-call --lang en --instruction-lang fr --name "My Sick Call"That creates the four files a single-track, single-level course needs:
my-sick-call/├── course.yaml├── level.yaml├── tasks.yaml└── tasks/Next, review or customize those files and add tasks/report-absence.yaml.
2. Declare the course (course.yaml)
Section titled “2. Declare the course (course.yaml)”Point uses_library at one of the language libraries in libraries/ (en, de, fr, it, nl-nl, es-mx, zh-cn, ja-jp, la) so you can immediately reference existing Concepts and Skills without defining a vocabulary from scratch:
course_id: my-sick-callname: My Sick Callframework_id: workplace-englishdescription: Tell a manager you are too sick to work today.default_track: eninstruction_language: fr # Teaching English (en) with French (fr) explanationsdefault_level: mainvalidation: closure: open # Good default for focused coursesexercise_source: courseuses_library: en@^1.03. Define the level outcome (level.yaml)
Section titled “3. Define the level outcome (level.yaml)”exit_criteria: summary: Learner can notify a manager of a same-day sick absence clearly and politely. outcomes: - id: report-same-day-absence statement: Inform a manager that you are unwell and cannot come in today.4. List the ordered tasks (tasks.yaml)
Section titled “4. List the ordered tasks (tasks.yaml)”Each entry is a stable task ID. Its final dot-separated segment (report-absence) resolves to tasks/report-absence.yaml:
tasks: - my-sick-call.en.report-absence5. Author the task (tasks/report-absence.yaml)
Section titled “5. Author the task (tasks/report-absence.yaml)”task: my-sick-call.en.report-absenceoutcome: start a sick call, say you are not feeling well, and clearly say you cannot work todaylevel_outcome_refs: - report-same-day-absenceregister: neutrallessons: - type: core title: Sorry for the short notice. concepts: - call-in-sick - lex-come-in - feel-state-adjective - sorry-for-the-short-notice exercises: - type: presentation id: sick-call-meaning presentation_concepts: [call-in-sick] explanation: "`Call in sick` signifie prévenir son employeur qu'on ne peut pas travailler parce qu'on est malade." text: I'm calling in sick today. annotated_text: I'm [calling in sick](concept:call-in-sick) today. - type: presentation id: sick-call-attendance presentation_concepts: [lex-come-in] explanation: "Ici, `come in` signifie venir sur son lieu de travail." text: I can't come in to work today. annotated_text: I can't [come in](concept:lex-come-in) to work today. - type: presentation id: sick-call-feeling presentation_concepts: [feel-state-adjective] explanation: "On utilise `feel` suivi d'un adjectif pour décrire son état." text: I feel unwell. annotated_text: I [feel unwell](concept:feel-state-adjective). - type: presentation id: sick-call-short-notice presentation_concepts: [sorry-for-the-short-notice] explanation: "`Sorry for the short notice` sert à s'excuser de prévenir tard." text: Sorry for the short notice. annotated_text: "[Sorry for the short notice](concept:sorry-for-the-short-notice)." - type: role_play modalities: [listening_speaking, reading_writing] role_play: title: Prévenir de son absence setting: Vous êtes malade ce matin et votre journée de travail commence bientôt. Prévenez Alex. character_name: Alex character_role: Your manager partner_instructions: Speak as the learner's manager in short A2 English. Let them explain the absence, acknowledge their apology, and close naturally. register: neutral opening_question: Hi, it's Alex. Is everything OK? goals: - Dites rapidement que vous êtes malade et que vous ne pouvez pas venir aujourd'hui. - Excusez-vous de prévenir tard. example_scenario: id: S-RP-REPORT-ABSENCE setting: You are sick this morning and your workday starts soon. Call your manager Alex. turns: - role: interlocutor text: Hi, it's Alex. Is everything OK? annotated_text: Hi, it's Alex. Is everything OK? - role: learner expect_annotated_text: I'm [calling in sick](concept:call-in-sick) today. I [feel unwell](concept:feel-state-adjective). achieved_goals: - Dites rapidement que vous êtes malade et que vous ne pouvez pas venir aujourd'hui. - role: interlocutor text: Oh no, I hope you feel better soon. So you cannot come in today? annotated_text: Oh no, I hope you feel better soon. So you cannot come in today? - role: learner expect_annotated_text: Yes, I can't [come in](concept:lex-come-in) to work today. [Sorry for the short notice](concept:sorry-for-the-short-notice). achieved_goals: - Excusez-vous de prévenir tard. - role: interlocutor text: No problem at all. Thanks for letting me know, and get some rest. annotated_text: No problem at all. Thanks for letting me know, and get some rest.6. Validate and see the compiler catch errors
Section titled “6. Validate and see the compiler catch errors”Run validation against your course directory:
openl2 validate my-sick-callOn a fresh draft, expect 0 errors (with a few annotation-review warnings until linguistic analyses are recorded—see Quality and review).
Now try breaking an annotation—for example, change concept:lex-come-in to concept:nonexistent in tasks/report-absence.yaml—and re-run openl2 validate my-sick-call. The compiler immediately flags the unresolved concept reference before anything reaches a learner.
7. Add domain-specific vocabulary (local_concepts.yaml)
Section titled “7. Add domain-specific vocabulary (local_concepts.yaml)”Language libraries cover core grammar and vocabulary, but focused courses often need domain-specific terms. Add an optional local_concepts.yaml next to course.yaml:
concept_sets: - name: Workplace sick leave kind: lexical concepts: - id: sick-note text: sick note sense: a doctor's written note confirming you cannot work pos: nounYou can now reference sick-note in any task lesson ([sick note](concept:sick-note)) alongside concepts from en@^1.0 (Course format).
8. Choose an output
Section titled “8. Choose an output”Once your course validates, choose the output that fits your workflow:
| Command | Output | When to use |
|---|---|---|
openl2 site course my-sick-call --out dist/site |
Multi-page Course Reference site | Browsing or publishing a searchable curriculum site (like Calling in Sick) |
openl2 analyze-text my-sick-call "..." --html report.html |
Self-contained HTML analysis report | Visually inspecting matched Skills, prepared vs. untaught concepts, and gaps |
openl2 anki ... / Python compiler |
Anki deck or runtime export | Delivering exercises to learners or a custom SRS (Integrating OpenL2) |
Next steps
Section titled “Next steps”- Continue with Authoring a course to expand or personalize courses with an AI agent.
- Explore Quality and review to understand source validation, publication readiness, and semantic audits.