Skip to content

Commit 3e57f61

Browse files
committed
update json-e lessons
1 parent a4207bb commit 3e57f61

2 files changed

Lines changed: 267 additions & 53 deletions

File tree

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

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,30 @@ Each lesson is an object in the lesson plan array with these fields:
2828
| `tests` | JSON array | One object per test case. Each object contains input fields and a `result` field. |
2929
| `solution` | string | Complete, valid C# code that passes all tests. |
3030

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
3245

3346
### Background
3447
- Explain the concept clearly before asking the user to use it.
3548
- 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.
3949
- Prefer in-depth backgrounds: typically at least two substantial paragraphs that cover both concept and practical usage.
4050

4151
### Instructions
4252
- State exactly what the user must do, in one or two sentences.
4353
- 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.
4455
- Do not explain how — that belongs in the background.
4556
- Do not refer to the testing framework or expected test mechanics in user-facing task text.
4657

@@ -50,16 +61,6 @@ Each lesson is an object in the lesson plan array with these fields:
5061
- Import only the namespaces needed for this lesson.
5162
- Keep surrounding scaffolding minimal so the user's task is obvious.
5263

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-
6364
### Tests
6465
- Include at least two test cases: one typical case and one edge or boundary case.
6566
- 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:
7172
- It should be the simplest correct implementation, not a showcase of advanced techniques.
7273
- Must pass all tests when run by the corresponding `ILessonHost`.
7374

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+
7491
## Ordering
7592

7693
- Order lessons from simplest to most complex within a topic.

0 commit comments

Comments
 (0)