You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/instructions/lesson-writing.instructions.md
+20-2Lines changed: 20 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,7 @@ Each lesson is an object in the lesson plan array with these fields:
32
32
33
33
- Teach the libraries only: focus lessons on how to use json-everything APIs and behaviors, not on teaching the underlying technology or specification.
34
34
- 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.
35
36
- 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).
36
37
- 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.
37
38
- 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:
40
41
- Do not break the fourth wall: user-facing lesson text must not reference tests, test runners, or lesson-host internals.
41
42
- Teach the current API directly; do not describe how it changed from older versions.
42
43
- 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.
43
51
44
52
## Sectional Instructions
45
53
46
54
### Background
47
55
- Explain the concept clearly before asking the user to use it.
48
56
- Use Markdown formatting. Inline code and links are encouraged.
49
57
- 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.
50
59
51
60
### Instructions
52
61
- 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:
55
64
- 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.
56
65
- Do not explain how — that belongs in the background.
57
66
- 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.
58
68
59
69
### Context Code
60
70
- 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:
72
82
- The solution must be a complete, compilable C# class body — not a fragment.
73
83
- It should be the simplest correct implementation, not a showcase of advanced techniques.
74
84
- 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`).
75
87
76
88
## Targeted Instructions
77
89
@@ -80,14 +92,20 @@ Each lesson is an object in the lesson plan array with these fields:
80
92
- This exception applies only to JSON Path lessons.
81
93
82
94
### JsonSchema Lessons
83
-
-Present code in this order whenever applicable:
95
+
-Prefer this flow when a lesson explicitly teaches options:
84
96
1. Create `BuildOptions`.
85
97
2. Build the schema using those build options.
86
98
3. Read the instance from test input as `JsonElement`.
87
99
4. Create `EvaluationOptions`.
88
100
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.
90
105
- 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.
0 commit comments