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
+31-14Lines changed: 31 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,19 +28,30 @@ Each lesson is an object in the lesson plan array with these fields:
28
28
|`tests`| JSON array | One object per test case. Each object contains input fields and a `result` field. |
29
29
|`solution`| string | Complete, valid C# code that passes all tests. |
30
30
31
-
## Writing Good Lessons
31
+
## General Instructions (Overall)
32
+
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
+
- Assume the student already understands the underlying technology and is here to learn how to exercise that technology through the libraries.
35
+
- 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
+
- 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
+
- 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.
38
+
- Reusability test: if the same lesson objective would read essentially the same after swapping in another conforming implementation, the objective is spec-first and must be rewritten.
39
+
- Success criteria must be library-behavior focused (what API/options/extension point behavior the user achieves), not spec-knowledge focused (what keyword or grammar rule the user can describe).
40
+
- Do not break the fourth wall: user-facing lesson text must not reference tests, test runners, or lesson-host internals.
41
+
- Teach the current API directly; do not describe how it changed from older versions.
42
+
- Keep each lesson focused on its single concept without reteaching prior lessons in depth.
43
+
44
+
## Sectional Instructions
32
45
33
46
### Background
34
47
- Explain the concept clearly before asking the user to use it.
35
48
- Use Markdown formatting. Inline code and links are encouraged.
36
-
- Keep it focused on what this lesson teaches — do not repeat content from prior lessons unless briefly recapping.
37
-
- Do not break the fourth wall: background text must not reference tests, test runners, or lesson-host internals.
38
-
- Teach the current API directly; do not describe how it changed from older versions.
39
49
- Prefer in-depth backgrounds: typically at least two substantial paragraphs that cover both concept and practical usage.
40
50
41
51
### Instructions
42
52
- State exactly what the user must do, in one or two sentences.
43
53
- Use imperative language: "Parse the path…", "Write a query that…", "Return null if…".
54
+
- Name the required library action in the task (method/class/option/exception behavior) so the objective is implementation-focused rather than concept-only.
44
55
- Do not explain how — that belongs in the background.
45
56
- Do not refer to the testing framework or expected test mechanics in user-facing task text.
46
57
@@ -50,16 +61,6 @@ Each lesson is an object in the lesson plan array with these fields:
50
61
- Import only the namespaces needed for this lesson.
51
62
- Keep surrounding scaffolding minimal so the user's task is obvious.
52
63
53
-
### Schema Lesson Flow
54
-
- For `JsonSchema` lessons, present code in this order whenever applicable:
55
-
1. Create `BuildOptions`.
56
-
2. Build the schema using those build options.
57
-
3. Read the instance from test input as `JsonElement`.
58
-
4. Create `EvaluationOptions`.
59
-
5. Evaluate using the evaluation options.
60
-
- Prefer this explicit flow in both `contextCode` and `solution` for consistency, even when default options would also work.
61
-
- Prefer `JsonElement` inputs to `schema.Evaluate(...)` instead of `JsonNode` values.
62
-
63
64
### Tests
64
65
- Include at least two test cases: one typical case and one edge or boundary case.
65
66
- Each test object must contain a `result` field matching what `ILessonHost` expects.
@@ -71,6 +72,22 @@ Each lesson is an object in the lesson plan array with these fields:
71
72
- It should be the simplest correct implementation, not a showcase of advanced techniques.
72
73
- Must pass all tests when run by the corresponding `ILessonHost`.
73
74
75
+
## Targeted Instructions
76
+
77
+
### JSON Path Lessons
78
+
- Exception to the library-only rule: JSON Path lessons may teach RFC 9535 semantics directly when needed because high-quality RFC 9535 learning resources are limited.
79
+
- This exception applies only to JSON Path lessons.
80
+
81
+
### JsonSchema Lessons
82
+
- Present code in this order whenever applicable:
83
+
1. Create `BuildOptions`.
84
+
2. Build the schema using those build options.
85
+
3. Read the instance from test input as `JsonElement`.
86
+
4. Create `EvaluationOptions`.
87
+
5. Evaluate using the evaluation options.
88
+
- Prefer this explicit flow in both `contextCode` and `solution` for consistency, even when default options would also work.
89
+
- Prefer `JsonElement` inputs to `schema.Evaluate(...)` instead of `JsonNode` values.
90
+
74
91
## Ordering
75
92
76
93
- Order lessons from simplest to most complex within a topic.
0 commit comments