Skip to content

Commit 656d356

Browse files
committed
more lessons
1 parent f1de9ea commit 656d356

5 files changed

Lines changed: 783 additions & 1237 deletions

File tree

.github/instructions/lesson-writing.instructions.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Each lesson is an object in the lesson plan array with these fields:
3232

3333
- Teach the libraries only: focus lessons on how to use json-everything APIs and behaviors, not on teaching the underlying technology or specification.
3434
- Assume the student already understands the underlying technology and is here to learn how to exercise that technology through the libraries.
35+
- Use progressive disclosure to control complexity. Introduce only the features required by the current lesson objective; defer optional or advanced features until their dedicated lessons.
3536
- When proposing or revising a lesson plan, define each lesson by the library capability the user will implement in C# (API call, option/configuration, extension point, or library-specific error handling).
3637
- Do not propose lessons framed primarily as technology topics (spec sections, operator catalogs, syntax tours, or language feature overviews) unless the lesson objective is explicitly tied to using a library surface.
3738
- Library touch is not sufficient. A lesson objective is valid only when the core skill is choosing or applying a library surface, and spec syntax/keywords are only inputs used to exercise that surface.
@@ -40,13 +41,21 @@ Each lesson is an object in the lesson plan array with these fields:
4041
- Do not break the fourth wall: user-facing lesson text must not reference tests, test runners, or lesson-host internals.
4142
- Teach the current API directly; do not describe how it changed from older versions.
4243
- Keep each lesson focused on its single concept without reteaching prior lessons in depth.
44+
- Avoid repeating prior lesson explanations. Later lessons should reference previously introduced APIs briefly and focus background text on what is newly added in the current lesson.
45+
- In sequential lesson tracks, write openings that continue from prior lessons instead of restating broad topic framing in each lesson.
46+
- Avoid stylistic section breaks made from dashes in lesson prose.
47+
- Use transitions between adjacent lessons for flow, but do not imply a technical dependency unless one truly exists.
48+
- If the next lesson shifts topics, do not force an artificial segue; briefly reframe the new topic and continue.
49+
- When teaching build options around references and dialect, present schema registry scoping and dialect selection as independent build-time controls.
50+
- Do not add a lesson when the only new idea is specification behavior and the library usage is unchanged from prior lessons.
4351

4452
## Sectional Instructions
4553

4654
### Background
4755
- Explain the concept clearly before asking the user to use it.
4856
- Use Markdown formatting. Inline code and links are encouraged.
4957
- Prefer in-depth backgrounds: typically at least two substantial paragraphs that cover both concept and practical usage.
58+
- Keep `background` explanatory without prescribing the exact implementation path step-by-step.
5059

5160
### Instructions
5261
- State exactly what the user must do, in one or two sentences.
@@ -55,6 +64,7 @@ Each lesson is an object in the lesson plan array with these fields:
5564
- Do not reveal the full implementation path in the task text. Avoid naming the exact operator or single method call when that would make the solution trivial.
5665
- Do not explain how — that belongs in the background.
5766
- Do not refer to the testing framework or expected test mechanics in user-facing task text.
67+
- Keep `instructions` goal-oriented and capability-focused. Avoid wording that dictates one exact method/operator unless that method is itself the lesson objective.
5868

5969
### Context Code
6070
- Place `/* USER CODE */` at the exact point where the user should write their code.
@@ -72,6 +82,8 @@ Each lesson is an object in the lesson plan array with these fields:
7282
- The solution must be a complete, compilable C# class body — not a fragment.
7383
- It should be the simplest correct implementation, not a showcase of advanced techniques.
7484
- Must pass all tests when run by the corresponding `ILessonHost`.
85+
- For lessons that include `/* USER CODE */` in `contextCode`, the `solution` must preserve all provided code exactly and only replace that placeholder region.
86+
- Do not refactor scaffolding in `solution` (e.g., changing object initialization style, moving existing fluent calls, or rewriting setup already provided in `contextCode`).
7587

7688
## Targeted Instructions
7789

@@ -80,14 +92,20 @@ Each lesson is an object in the lesson plan array with these fields:
8092
- This exception applies only to JSON Path lessons.
8193

8294
### JsonSchema Lessons
83-
- Present code in this order whenever applicable:
95+
- Prefer this flow when a lesson explicitly teaches options:
8496
1. Create `BuildOptions`.
8597
2. Build the schema using those build options.
8698
3. Read the instance from test input as `JsonElement`.
8799
4. Create `EvaluationOptions`.
88100
5. Evaluate using the evaluation options.
89-
- Prefer this explicit flow in both `contextCode` and `solution` for consistency, even when default options would also work.
101+
- In early lessons, do not introduce `BuildOptions` or `EvaluationOptions` unless they are required for the lesson objective.
102+
- If options are not part of the objective, prefer the simplest valid API usage and defer options to later dedicated lessons.
103+
- For construction lessons, explain multiple available construction methods in `background` and allow the exercise scenario to support method choice where practical.
104+
- Prefer realistic schema-input patterns in examples. For common usage, favor parsing raw JSON text and working from a document root element instead of `SerializeToElement(...)` unless serialization is itself the concept being taught.
90105
- Prefer `JsonElement` inputs to `schema.Evaluate(...)` instead of `JsonNode` values.
106+
- If a lesson objective is about build options, pass `BuildOptions` into schema builders in both `contextCode` and `solution`.
107+
- Do not manually register schemas into a registry when the lesson relies on schema self-registration during build unless manual registration is the explicit objective.
108+
- Use `https://learn.json-everything.net/...` for illustrative schema IDs and references in lessons.
91109

92110
## Ordering
93111

0 commit comments

Comments
 (0)