# Writing lessons

> How to write a lesson that works at every level, binds to the learner's project, and is checked fairly.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://learn.docs.sypnia.com/lessons/writing-lessons/

For agents: Authoring guide: one goal per lesson, a few minutes; start from the case (use cases first), say which step of the Sypnia way; write the shared text for everyone and put level-specific parts in level blocks; bind examples with uses + slots, test against the sample (learn preview <lesson> --level starter --project sample); exercises small and on one case; checks that test the goal, not the exact code (prefer case/cases-check/tests over file contains); one question at most, about understanding; code names in English in every language; videos one idea each with chapters and captions; lint and preview before publishing (learn lint, learn preview, learn courses add). Organizations publish private courses in Sypnia Cloud with the admin scope.

## One lesson, one goal

A lesson teaches one thing you can then do, written as its `goal`: «You can name what can go wrong in a case». If the goal needs «and», it is two lessons.

## Start from a case

Lessons follow [the Sypnia way](https://learn.docs.sypnia.com/paths/the-sypnia-way): start from what a person does in the app, and only then talk about screens, tables or code. Set `step` to say where the lesson sits.

## Write once, for every level

Write the shared explanation for everyone, then add what only some levels need in level blocks. A starter needs the idea and what the customer sees; a developer needs the names and the code. Avoid writing four separate lessons.

## Use the learner's project

Ask for examples with `uses`, and write with the slots (`{{case.title}}`). Then preview the lesson as different people:

```bash
npx @sypnia/learn preview failures-have-names --level starter --project sample
npx @sypnia/learn preview failures-have-names --level developer --project la-espiga
```

## Check the goal, not the answer

- Prefer checks that prove the goal: a `case` with a failure, a passing `cases-check`, a `tests` command.
- Avoid checks on the exact text of a file: there are many right answers.
- At most one `question`, about understanding, never about memory.
- Keep exercises small: one case, one change.

## Code stays in English

In every language, file names, commands, case and failure names stay in English. Explain them; never translate them.

## Publish

```bash
npx @sypnia/learn lint ./learn/use-cases-first
npx @sypnia/learn courses add ./learn/use-cases-first
```

On your own engine, publishing needs the `admin` scope. In Sypnia Cloud, an organization's owners and admins publish courses for their own members.
