@thanh01.pmt/curriculum-kit 1.4.43 → 1.4.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/dist/ai/index.cjs +66 -470
  2. package/dist/ai/index.cjs.map +1 -1
  3. package/dist/ai/index.d.cts +77 -77
  4. package/dist/ai/index.d.ts +77 -77
  5. package/dist/ai/index.mjs +64 -469
  6. package/dist/ai/index.mjs.map +1 -1
  7. package/dist/index.cjs +478 -837
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.d.cts +124 -58
  10. package/dist/index.d.ts +124 -58
  11. package/dist/index.mjs +470 -829
  12. package/dist/index.mjs.map +1 -1
  13. package/dist/pipeline/index.cjs +99 -484
  14. package/dist/pipeline/index.cjs.map +1 -1
  15. package/dist/pipeline/index.mjs +97 -483
  16. package/dist/pipeline/index.mjs.map +1 -1
  17. package/dist/schemas/index.d.cts +1064 -1064
  18. package/dist/schemas/index.d.ts +1064 -1064
  19. package/dist/standards/index.d.cts +2 -2
  20. package/dist/standards/index.d.ts +2 -2
  21. package/dist/{standardsCoverageGate-49pJq5t8.d.cts → standardsCoverageGate-CLnq0d0s.d.cts} +12 -12
  22. package/dist/{standardsCoverageGate-49pJq5t8.d.ts → standardsCoverageGate-CLnq0d0s.d.ts} +12 -12
  23. package/dist/templates/ACT_template.md +18 -9
  24. package/dist/templates/ALIGNMENT_MATRIX_template.md +5 -0
  25. package/dist/templates/ART_DIRECTION_template.md +7 -0
  26. package/dist/templates/ASSET_MANIFEST_template.md +5 -0
  27. package/dist/templates/BASELINE_STANDARD.md +5 -0
  28. package/dist/templates/BELL_RINGER_template.md +13 -13
  29. package/dist/templates/CHANGELOG_template.md +3 -0
  30. package/dist/templates/CHOICE_BOARD_template.md +8 -5
  31. package/dist/templates/CODE_template.md +5 -6
  32. package/dist/templates/CONTENT_CONTINUITY_template.md +6 -0
  33. package/dist/templates/CONTENT_STYLE_GUIDE_template.md +4 -5
  34. package/dist/templates/CURRICULUM_FRAMEWORK_template.md +5 -6
  35. package/dist/templates/DEPENDENCY_MAP_template.md +3 -4
  36. package/dist/templates/EXIT_TICKET_template.md +8 -8
  37. package/dist/templates/EXT_template.md +3 -0
  38. package/dist/templates/GLOSSARY_template.md +1 -2
  39. package/dist/templates/GRAPHIC_ORGANIZER_template.md +8 -8
  40. package/dist/templates/GUIDE_template.md +5 -6
  41. package/dist/templates/HANDOUT_template.md +5 -6
  42. package/dist/templates/HANDOVER_DOCUMENT_template.md +8 -0
  43. package/dist/templates/KNOWLEDGE_EXPOSITION_template.md +16 -6
  44. package/dist/templates/LAB_TEMPLATE.md +78 -0
  45. package/dist/templates/LEARNER_PROFILE_template.md +4 -5
  46. package/dist/templates/LESSONS_LEARNED_template.md +8 -0
  47. package/dist/templates/LESSON_5E_template.md +24 -9
  48. package/dist/templates/LESSON_EDP_template.md +26 -10
  49. package/dist/templates/LESSON_GENERAL_template.md +22 -8
  50. package/dist/templates/OUTPUT_CONSTRAINTS_template.md +7 -0
  51. package/dist/templates/PACKAGING_SPEC_template.md +8 -0
  52. package/dist/templates/PILOT_FEEDBACK_template.md +6 -0
  53. package/dist/templates/PROJECT_BRIEF_template.md +8 -0
  54. package/dist/templates/PROJECT_STATUS_template.md +9 -0
  55. package/dist/templates/QUIZ_template.md +7 -0
  56. package/dist/templates/QUIZ_v4.6_template.md +4 -5
  57. package/dist/templates/REFERENCE_PACK_template.md +4 -0
  58. package/dist/templates/REVIEW_GAME_template.md +11 -8
  59. package/dist/templates/RUBRIC_template.md +2 -3
  60. package/dist/templates/SCIENCE_LAB_template.md +11 -5
  61. package/dist/templates/SECTION_LANGUAGE_CONTRACT_template.md +44 -0
  62. package/dist/templates/SELF_LAB_template.md +174 -0
  63. package/dist/templates/SLIDE_template.md +23 -0
  64. package/dist/templates/STATION_ROTATION_template.md +11 -11
  65. package/dist/templates/TASK_CARDS_template.md +8 -8
  66. package/dist/templates/TIERED_PRACTICE_template.md +14 -10
  67. package/dist/templates/UPDATE_ROADMAP_template.md +7 -0
  68. package/dist/templates/WKS_template.md +5 -6
  69. package/dist/workflow/index.cjs +250 -672
  70. package/dist/workflow/index.cjs.map +1 -1
  71. package/dist/workflow/index.d.cts +1 -1
  72. package/dist/workflow/index.d.ts +1 -1
  73. package/dist/workflow/index.mjs +248 -670
  74. package/dist/workflow/index.mjs.map +1 -1
  75. package/docs/refs/templates/ACT_template.md +18 -9
  76. package/docs/refs/templates/ALIGNMENT_MATRIX_template.md +5 -0
  77. package/docs/refs/templates/ART_DIRECTION_template.md +7 -0
  78. package/docs/refs/templates/ASSET_MANIFEST_template.md +5 -0
  79. package/docs/refs/templates/BASELINE_STANDARD.md +5 -0
  80. package/docs/refs/templates/BELL_RINGER_template.md +13 -13
  81. package/docs/refs/templates/CHANGELOG_template.md +3 -0
  82. package/docs/refs/templates/CHOICE_BOARD_template.md +8 -5
  83. package/docs/refs/templates/CODE_template.md +5 -6
  84. package/docs/refs/templates/CONTENT_CONTINUITY_template.md +6 -0
  85. package/docs/refs/templates/CONTENT_STYLE_GUIDE_template.md +4 -5
  86. package/docs/refs/templates/CURRICULUM_FRAMEWORK_template.md +5 -6
  87. package/docs/refs/templates/DEPENDENCY_MAP_template.md +3 -4
  88. package/docs/refs/templates/EXIT_TICKET_template.md +8 -8
  89. package/docs/refs/templates/EXT_template.md +3 -0
  90. package/docs/refs/templates/GLOSSARY_template.md +1 -2
  91. package/docs/refs/templates/GRAPHIC_ORGANIZER_template.md +8 -8
  92. package/docs/refs/templates/GUIDE_template.md +5 -6
  93. package/docs/refs/templates/HANDOUT_template.md +5 -6
  94. package/docs/refs/templates/HANDOVER_DOCUMENT_template.md +8 -0
  95. package/docs/refs/templates/KNOWLEDGE_EXPOSITION_template.md +16 -6
  96. package/docs/refs/templates/LAB_TEMPLATE.md +78 -0
  97. package/docs/refs/templates/LEARNER_PROFILE_template.md +4 -5
  98. package/docs/refs/templates/LESSONS_LEARNED_template.md +8 -0
  99. package/docs/refs/templates/LESSON_5E_template.md +24 -9
  100. package/docs/refs/templates/LESSON_EDP_template.md +26 -10
  101. package/docs/refs/templates/LESSON_GENERAL_template.md +22 -8
  102. package/docs/refs/templates/OUTPUT_CONSTRAINTS_template.md +7 -0
  103. package/docs/refs/templates/PACKAGING_SPEC_template.md +8 -0
  104. package/docs/refs/templates/PILOT_FEEDBACK_template.md +6 -0
  105. package/docs/refs/templates/PROJECT_BRIEF_template.md +8 -0
  106. package/docs/refs/templates/PROJECT_STATUS_template.md +9 -0
  107. package/docs/refs/templates/QUIZ_template.md +7 -0
  108. package/docs/refs/templates/QUIZ_v4.6_template.md +4 -5
  109. package/docs/refs/templates/REFERENCE_PACK_template.md +4 -0
  110. package/docs/refs/templates/REVIEW_GAME_template.md +11 -8
  111. package/docs/refs/templates/RUBRIC_template.md +2 -3
  112. package/docs/refs/templates/SCIENCE_LAB_template.md +11 -5
  113. package/docs/refs/templates/SECTION_LANGUAGE_CONTRACT_template.md +44 -0
  114. package/docs/refs/templates/SELF_LAB_template.md +174 -0
  115. package/docs/refs/templates/SLIDE_template.md +23 -0
  116. package/docs/refs/templates/STATION_ROTATION_template.md +11 -11
  117. package/docs/refs/templates/TASK_CARDS_template.md +8 -8
  118. package/docs/refs/templates/TIERED_PRACTICE_template.md +14 -10
  119. package/docs/refs/templates/UPDATE_ROADMAP_template.md +7 -0
  120. package/docs/refs/templates/WKS_template.md +5 -6
  121. package/package.json +1 -1
@@ -2,9 +2,10 @@ import { generateObject } from 'ai';
2
2
  import { createGoogleGenerativeAI } from '@ai-sdk/google';
3
3
  import { createOpenAI } from '@ai-sdk/openai';
4
4
  import { createDeepSeek } from '@ai-sdk/deepseek';
5
- import fs from 'fs';
5
+ import fs2 from 'fs';
6
6
  import path from 'path';
7
7
  import { z } from 'zod';
8
+ import { fileURLToPath } from 'url';
8
9
  import pLimit from 'p-limit';
9
10
  import fsPromises from 'fs/promises';
10
11
 
@@ -31,7 +32,7 @@ ${cc.technicalDepth}`;
31
32
  const dataRows = cc.comparisonTable.rows.map((r) => `| ${r.join(" | ")} |`).join("\n");
32
33
  str += `
33
34
 
34
- #### Comparison & Trade-off Analysis
35
+ **Comparison & Trade-off Analysis**
35
36
  ${headerRow}
36
37
  ${dividerRow}
37
38
  ${dataRows}`;
@@ -75,7 +76,8 @@ ${learningObjectivesStr}
75
76
 
76
77
  ---
77
78
 
78
- ## 1. ENGAGE (Hook & High-Stakes Scenario) \u2014 10-15 mins
79
+ ## 1. ENGAGE (Hook & High-Stakes Scenario)
80
+ > **Duration:** 10-15 mins
79
81
 
80
82
  ### Real-World Context: "${lesson.hookTitle || "The Incident"}"
81
83
  ${lesson.hookScenario}
@@ -84,13 +86,15 @@ ${lesson.hookQuestions && lesson.hookQuestions.length > 0 ? lesson.hookQuestions
84
86
 
85
87
  ---
86
88
 
87
- ## 2. EXPLORE & EXPLAIN (Core Technical Concepts & Principles) \u2014 30-40 mins
89
+ ## 2. EXPLORE & EXPLAIN (Core Technical Concepts & Principles)
90
+ > **Duration:** 30-40 mins
88
91
 
89
92
  ${coreConceptsStr}
90
93
 
91
94
  ---
92
95
 
93
- ## 3. GUIDED PRACTICE (Visual Architecture & Annotated Code) \u2014 20-25 mins
96
+ ## 3. GUIDED PRACTICE (Visual Architecture & Annotated Code)
97
+ > **Duration:** 20-25 mins
94
98
 
95
99
  ### System Architecture & Data Flow (Mermaid Diagram)
96
100
  ${mermaidBlock}
@@ -104,7 +108,8 @@ ${guidedPractice.codeSnippet}
104
108
 
105
109
  ---
106
110
 
107
- ## 4. ELABORATE & INDEPENDENT PRACTICE (Technical Challenge & Scaffolding) \u2014 15-20 mins
111
+ ## 4. ELABORATE & INDEPENDENT PRACTICE (Technical Challenge & Scaffolding)
112
+ > **Duration:** 15-20 mins
108
113
 
109
114
  ### Engineering Challenge: "${lesson.independentPractice?.title || "System Optimization Challenge"}"
110
115
  ${lesson.independentPractice?.description || "Implement the core logic and test against simulated edge cases."}
@@ -115,7 +120,8 @@ ${lesson.independentPractice?.description || "Implement the core logic and test
115
120
 
116
121
  ---
117
122
 
118
- ## 5. EVALUATE (Summary, Assessment & Metacognition) \u2014 5-10 mins
123
+ ## 5. EVALUATE (Summary, Assessment & Metacognition)
124
+ > **Duration:** 5-10 mins
119
125
 
120
126
  ### Exit Ticket (Bloom: Apply / Analyze)
121
127
  > **Scenario Question:** ${lesson.exitTicket.questionStem}
@@ -208,12 +214,16 @@ ${hardwareItems}
208
214
 
209
215
  ## [REQUIRED] Active Learning Workflow
210
216
 
211
- ### Phase 1: Planning & Design \u2014 ${phase1.durationMinutes} mins
217
+ ### Phase 1: Planning & Design
218
+ > **Duration:** ${phase1.durationMinutes} mins
219
+
212
220
  - **Student Task:** ${phase1.studentTask}
213
221
  - **Teacher Action:** ${phase1.teacherAction}
214
222
  ${phase1.inquiryQuestions.map((q) => ` - *Inquiry Question:* ${q}`).join("\n")}
215
223
 
216
- ### Phase 2: Implementation & Discovery \u2014 ${phase2.durationMinutes} mins
224
+ ### Phase 2: Implementation & Discovery
225
+ > **Duration:** ${phase2.durationMinutes} mins
226
+
217
227
  - **Student Task:** ${phase2.studentTask}
218
228
  - **Teacher Action:** ${phase2.teacherAction}
219
229
 
@@ -221,7 +231,9 @@ ${phase2.codeOrCommands.map((c) => `\`\`\`text
221
231
  ${c}
222
232
  \`\`\``).join("\n\n")}
223
233
 
224
- ### Phase 3: Debugging & Testing \u2014 ${phase3.durationMinutes} mins
234
+ ### Phase 3: Debugging & Testing
235
+ > **Duration:** ${phase3.durationMinutes} mins
236
+
225
237
  - **Testing:** ${phase3.testingSteps}
226
238
  - **Error Analysis:** ${phase3.errorAnalysis}
227
239
 
@@ -276,22 +288,28 @@ This lab focuses on the practical implementation of core technical concepts, bri
276
288
 
277
289
  ## \u{1F4DD} Lab Tasks (3-Tier Differentiation)
278
290
 
279
- ### \u{1F949} Bronze (Foundational) \u2014 ${tasks.bronze.mins} mins
291
+ ### \u{1F949} Bronze (Foundational)
292
+ > **Duration:** ${tasks.bronze.mins} mins
293
+
280
294
  **Objective:** ${tasks.bronze.objective}
281
295
  - **Task:** ${tasks.bronze.task}
282
296
  - **Requirement:** ${tasks.bronze.requirement}
283
297
 
284
- ### \u{1F948} Silver (Application) \u2014 ${tasks.silver.mins} mins
298
+ ### \u{1F948} Silver (Application)
299
+ > **Duration:** ${tasks.silver.mins} mins
300
+
285
301
  **Objective:** ${tasks.silver.objective}
286
302
  - **Task:** ${tasks.silver.task}
287
303
  - **Requirement:** ${tasks.silver.requirement}
288
304
 
289
- ### \u{1F947} Gold (Enrichment/Creative) \u2014 ${tasks.gold.mins} mins
305
+ ### \u{1F947} Gold (Enrichment/Creative)
306
+ > **Duration:** ${tasks.gold.mins} mins
307
+
290
308
  **Objective:** ${tasks.gold.objective}
291
309
  - **Task:** ${tasks.gold.task}
292
310
  - **Requirement:** ${tasks.gold.requirement}
293
311
 
294
- ## \u{1F4BB} Technical Reference ([SME_MANDATE])
312
+ ## \u{1F4BB} Technical Reference
295
313
  <!-- [SME_MANDATE] -->
296
314
  > Any code provided in this section is verified for syntax accuracy and runtime execution.
297
315
 
@@ -429,7 +447,9 @@ ${instruction.verificationChecklist.map((c) => `- [ ] ${c}`).join("\n")}
429
447
  function serializeSelfLabToMarkdown(lab) {
430
448
  const renderChallenge = (c, label) => {
431
449
  const tasksList = c.tasks.map((t) => `- ${t}`).join("\n");
432
- return `### ${label}: ${c.title} \u2014 ~${c.estimatedMinutes} mins
450
+ return `### ${label}: ${c.title}
451
+ > **Duration:** ~${c.estimatedMinutes} mins
452
+
433
453
  **Objective:** ${c.objective}
434
454
 
435
455
  #### Tasks & Implementation Details:
@@ -594,8 +614,8 @@ function resolveApiKey(keyName, explicitKey) {
594
614
  path.resolve(currentDir, "../..", ".env")
595
615
  ];
596
616
  for (const envPath of envPaths) {
597
- if (fs.existsSync(envPath)) {
598
- const content = fs.readFileSync(envPath, "utf-8");
617
+ if (fs2.existsSync(envPath)) {
618
+ const content = fs2.readFileSync(envPath, "utf-8");
599
619
  for (const line of content.split("\n")) {
600
620
  const trimmed = line.trim();
601
621
  if (trimmed && !trimmed.startsWith("#") && trimmed.startsWith(keyName + "=")) {
@@ -2473,467 +2493,61 @@ z.object({
2473
2493
  }),
2474
2494
  phases: z.array(PhaseInputSchema).default([])
2475
2495
  });
2476
-
2477
- // src/templates/lessonTemplate.ts
2478
- var LESSON_PLAN_TEMPLATE = `
2479
- ---
2480
- id: "{{ID}}"
2481
- title: "{{TITLE}}"
2482
- type: "LESSON_5E"
2483
- created_by: "Curriculum OS Builder"
2484
- phase: "{{PHASE}}"
2485
- deliverable: "P3-T1"
2486
- version: "{{VERSION}}"
2487
- date: "{{DATE}}"
2488
- prerequisite: []
2489
- template_contract: "lesson-plan-v2"
2490
- template_required_sections:
2491
- - "A. Lesson Design Plan"
2492
- - "Learning Objectives & Evidence"
2493
- - "Activity Sequence"
2494
- - "Resource Map"
2495
- - "Assessment Map"
2496
- - "Artifact Contract"
2497
- - "B. Lesson Flow"
2498
- ---
2499
- <!-- INJECT_BODY -->
2500
-
2501
- # LESSON [{{LESSON_ID}}]: {{TITLE}} (5E Model)
2502
-
2503
- ## [REQUIRED] A. Lesson Design Plan
2504
-
2505
- ### 1. Learning Objectives & Evidence
2506
- - **Estimated Duration:** {{DURATION}}
2507
- - **Materials & Equipment:** {{MATERIALS_SUMMARY}}
2508
- - **Keywords / Core Concepts:** {{KEYWORDS}}
2509
-
2510
- | LO | Objective (Bloom's) | Student Evidence | Success Criteria |
2511
- |---|---|---|---|
2512
- {{LEARNING_OBJECTIVES_TABLE_ROWS}}
2513
-
2514
- ### 2. Activity Sequence
2515
- > This is the canonical activity contract. Satellite artifacts must expand this sequence and must not invent a different one.
2516
-
2517
- | Seq | 5E Phase | Activity Type | Actor | Purpose | Student Action | Teacher Move | Output/Evidence | LO | Time | Artifact Contract |
2518
- |---|---|---|---|---|---|---|---|---|---|---|
2519
- {{ACTIVITY_SEQUENCE_TABLE_ROWS}}
2520
-
2521
- ### 3. Resource Map
2522
- | Resource | Used In Activity | Purpose | Owner Artifact |
2523
- |---|---|---|---|
2524
- {{RESOURCE_MAP_TABLE_ROWS}}
2525
-
2526
- ### 4. Assessment Map
2527
- | Evidence | Assessed By | Criteria | Follow-up If Missing |
2528
- |---|---|---|---|
2529
- {{ASSESSMENT_MAP_TABLE_ROWS}}
2530
-
2531
- ### 5. Artifact Contract
2532
- - **ACT must expand:** {{ACT_CONTRACT}}
2533
- - **GUIDE must support:** {{GUIDE_CONTRACT}}
2534
- - **SLIDE must visualize:** {{SLIDE_CONTRACT}}
2535
- - **HANDOUT must provide:** {{HANDOUT_CONTRACT}}
2536
- - **WKS must practice:** {{WKS_CONTRACT}}
2537
- - **QUIZ must assess:** {{QUIZ_CONTRACT}}
2538
- - **EXT must extend:** {{EXT_CONTRACT}}
2539
-
2540
- ---
2541
-
2542
- ## [REQUIRED] B. Lesson Flow
2543
-
2544
- ### 1. ENGAGE \u2014 {{ENGAGE_DURATION}} mins
2545
- - **Hook Scenario:** {{HOOK_SCENARIO}}
2546
- - **Open Question:** {{HOOK_OPEN_QUESTION}}
2547
- - **Transition:** {{HOOK_TRANSITION}}
2548
-
2549
- ### 2. EXPLORE \u2014 {{EXPLORE_DURATION}} mins
2550
- - **Activity Reference:** {{EXPLORE_ACTIVITY_REF}}
2551
- - **Student Discovery:** {{EXPLORE_STUDENT_DISCOVERY}}
2552
-
2553
- ### 3. EXPLAIN \u2014 {{EXPLAIN_DURATION}} mins
2554
- - **Definitions:**
2555
- {{EXPLAIN_DEFINITIONS}}
2556
- - **Visual Illustration (REQUIRED):**
2557
- {{EXPLAIN_VISUAL_ILLUSTRATION}}
2558
-
2559
- ### 4. ELABORATE \u2014 {{ELABORATE_DURATION}} mins
2560
- - **Tiered Scaffolding:**
2561
- - \u{1F949} **Bronze:** {{DIFFERENTIATION_BRONZE}}
2562
- - \u{1F948} **Silver:** {{DIFFERENTIATION_SILVER}}
2563
- - \u{1F947} **Gold:** {{DIFFERENTIATION_GOLD}}
2564
-
2565
- > **ACT Contract**: Detailed operational instructions must expand the Activity Sequence above and must not change the planned evidence target.
2566
-
2567
- ### 5. EVALUATE \u2014 {{EVALUATE_DURATION}} mins
2568
- - **Exit Ticket:** {{EXIT_TICKET_CONTENT}}
2569
- - **Closing:** {{CLOSING_REMARKS}}
2570
-
2571
- > **QUIZ Contract**: Detailed assessment criteria and rubrics must assess the evidence and success criteria defined in the Lesson Design Plan.
2572
-
2573
- ---
2574
-
2575
- ## [OPTIONAL] Teacher Notes
2576
- - **Common Pitfalls:**
2577
- {{COMMON_PITFALLS}}
2578
- - **Troubleshooting:**
2579
- {{TROUBLESHOOTING_ROWS}}
2580
-
2581
- ---
2582
-
2583
- ## [REQUIRED] Artifact Linkage (Master Index)
2584
- > List all satellite files used in this lesson.
2585
-
2586
- | Artifact File | Role in the Classroom | When to Use |
2587
- |---|---|---|
2588
- | \`GUIDE_{{LESSON_ID}}.md\` | Detailed Teaching Script | Teacher preparation |
2589
- | \`SLIDE_{{LESSON_ID}}.md\` | Presentation Content | Throughout the session |
2590
- | \`HANDOUT_{{LESSON_ID}}.md\` | Theory Summary for Students | During EXPLAIN phase |
2591
- | \`ACT_{{LESSON_ID}}.md\` | Detailed Learning Activity Operations | During EXPLORE / ELABORATE / checkpoint phases |
2592
- | \`WKS_{{LESSON_ID}}.md\` | Individual Worksheet | Wrap-up or Homework |
2593
- | \`QUIZ_{{LESSON_ID}}.md\` | Assessment Rubric | During EVALUATE phase |
2594
- | \`EXT_{{LESSON_ID}}.md\` | Enrichment Materials | For "Gold" students |
2595
- `.trim();
2596
-
2597
- // src/templates/actTemplate.ts
2598
- var ACT_TEMPLATE = `
2599
- ---
2600
- id: "{{ID}}"
2601
- title: "{{TITLE}}"
2602
- type: "ACT"
2603
- created_by: "Curriculum OS Builder"
2604
- phase: "{{PHASE}}"
2605
- deliverable: "P3-T2"
2606
- version: "{{VERSION}}"
2607
- date: "{{DATE}}"
2608
- template_contract: "artifact-template-v1"
2609
- template_required_sections:
2610
- - "Computational Thinking Focus"
2611
- - "Materials & Setup"
2612
- - "Constraints & Safety"
2613
- - "Active Learning Workflow"
2614
- - "3-Tier Differentiation"
2615
- - "Reflection"
2616
- ---
2617
- <!-- INJECT_BODY -->
2618
-
2619
- # INQUIRY-BASED ACTIVITY: {{TITLE}}
2620
- _Milestone: {{MILESTONE_ID}} | Module: {{MODULE_NAME}} | Lesson: {{LESSON_ID}}_
2621
-
2622
- ## [REQUIRED] Computational Thinking Focus
2623
- - **Problem Statement (Real-world Scenario):** {{PROBLEM_STATEMENT}}
2624
- - **Decomposition:**
2625
- {{DECOMPOSITION_STEPS}}
2626
- - **Algorithm Design:** {{ALGORITHM_DESIGN}}
2627
-
2628
- ## [REQUIRED] Materials & Setup
2629
- - **Reference Material:** Students should use the **HANDOUT** for this lesson as their primary technical reference (lifeline).
2630
- - **Hardware/Software:**
2631
- <!-- [HARDWARE_BOM] -->
2632
- {{HARDWARE_ITEMS}}
2633
- <!-- [/HARDWARE_BOM] -->
2634
- - **Software:** {{SOFTWARE_ITEMS}}
2635
- - **Consumables:** {{CONSUMABLES}}
2636
- - **Other Resources:** {{OTHER_RESOURCES}}
2637
-
2638
- ## [REQUIRED] Constraints & Safety
2639
- - \u26A0\uFE0F **Technical/Safety:** {{SAFETY_WARNING}}
2640
- - \u{1F4A1} **Design Constraint:** {{DESIGN_CONSTRAINT}}
2641
-
2642
- ## [REQUIRED] Active Learning Workflow
2643
-
2644
- ### Phase 1: Planning & Design \u2014 {{PHASE1_DURATION}} mins
2645
- - **Student Task:** Hand-draw (or draft in words) the algorithm flowchart or connection architecture before touching the computer/devices.
2646
- - **Teacher Action:** Walk around to check the logic of each group. Ask inquiry questions:
2647
- {{PHASE1_INQUIRY_QUESTIONS}}
2648
-
2649
- ### Phase 2: Implementation & Discovery \u2014 {{PHASE2_DURATION}} mins
2650
- - **Student Task:** Apply the knowledge from the **HANDOUT** to realize the plan designed in Phase 1. Encourage self-inquiry and documentation lookup.
2651
- - **Teacher Action:** Avoid "hand-holding." Only intervene if a group has been stuck for more than 5 minutes.
2652
- {{PHASE2_GUIDANCE_BLOCK}}
2653
-
2654
- ### Phase 3: Debugging & Testing \u2014 {{PHASE3_DURATION}} mins
2655
- - **Testing:** Students run their system.
2656
- - **Error Analysis:** Ask students to record any error codes or unexpected behaviors and compare them with the Troubleshooting table in the Handout.
2657
- {{PHASE3_TESTING_STEPS}}
2658
-
2659
- ## [REQUIRED] 3-Tier Differentiation
2660
- > MUST design tasks in 3 tiers to support diverse learner groups. Bronze is the minimum requirement for all students.
2661
- - \u{1F949} **Bronze (Foundational):** {{DIFFERENTIATION_BRONZE}}
2662
- - \u{1F948} **Silver (Application):** {{DIFFERENTIATION_SILVER}}
2663
- - \u{1F947} **Gold (Enrichment/Creative):** {{DIFFERENTIATION_GOLD}}
2664
-
2665
- ## [REQUIRED] Reflection
2666
- - **Discussion Question:** {{REFLECTION_QUESTION}}
2667
- `.trim();
2668
-
2669
- // src/templates/codeLabTemplate.ts
2670
- var CODE_LAB_TEMPLATE = `
2671
- ---
2672
- id: "{{ID}}"
2673
- title: "{{TITLE}}"
2674
- type: "LAB"
2675
- created_by: "Curriculum OS Builder"
2676
- phase: "{{PHASE}}"
2677
- deliverable: "P3-T2"
2678
- version: "{{VERSION}}"
2679
- date: "{{DATE}}"
2680
- ---
2681
- <!-- INJECT_BODY -->
2682
-
2683
- # \u{1F468}\u200D\u{1F4BB} CODE LAB: {{TITLE}}
2684
- _Milestone: {{MILESTONE_ID}} | Tech Stack: {{TECH_STACK}}_
2685
-
2686
- ## \u{1F3AF} Overview
2687
- This lab focuses on the practical implementation of core technical concepts, bridging theory into working, robust, and testable code.
2688
-
2689
- ## \u{1F6E0}\uFE0F Environment & Setup
2690
- - **Language / Framework:** {{LANGUAGE_FRAMEWORK}}
2691
- - **IDE / Editor:** {{IDE_EDITOR}}
2692
- - **Required Libraries:** {{REQUIRED_LIBRARIES}}
2693
- - **Hardware / Connection Setup:** {{HARDWARE_ENV_CONNECTION}}
2694
-
2695
- ## \u{1F4DD} Lab Tasks (3-Tier Differentiation)
2696
-
2697
- ### \u{1F949} Bronze (Foundational) \u2014 {{BRONZE_MINS}} mins
2698
- **Objective:** {{BRONZE_OBJECTIVE}}
2699
- - **Task:** {{BRONZE_TASK}}
2700
- - **Requirement:** {{BRONZE_REQUIREMENT}}
2701
-
2702
- ### \u{1F948} Silver (Application) \u2014 {{SILVER_MINS}} mins
2703
- **Objective:** {{SILVER_OBJECTIVE}}
2704
- - **Task:** {{SILVER_TASK}}
2705
- - **Requirement:** {{SILVER_REQUIREMENT}}
2706
-
2707
- ### \u{1F947} Gold (Enrichment/Creative) \u2014 {{GOLD_MINS}} mins
2708
- **Objective:** {{GOLD_OBJECTIVE}}
2709
- - **Task:** {{GOLD_TASK}}
2710
- - **Requirement:** {{GOLD_REQUIREMENT}}
2711
-
2712
- ## \u{1F4BB} Technical Reference ([SME_MANDATE])
2713
- <!-- [SME_MANDATE] -->
2714
- > Any code provided in this section is verified for syntax accuracy and runtime execution.
2715
-
2716
- ### Starter Code Template
2717
- \`\`\`{{CODE_LANGUAGE}}
2718
- {{STARTER_CODE}}
2719
- \`\`\`
2720
-
2721
- ### Solution Code
2722
- \`\`\`{{CODE_LANGUAGE}}
2723
- {{SOLUTION_CODE}}
2724
- \`\`\`
2725
- <!-- [/SME_MANDATE] -->
2726
-
2727
- ## \u{1F50D} Troubleshooting & Debugging Matrix
2728
- | Issue | Potential Cause | Solution |
2729
- | :--- | :--- | :--- |
2730
- {{TROUBLESHOOTING_ROWS}}
2731
-
2732
- ## \u{1F3C1} Submission & Verification Checklist
2733
- {{CHECKLIST_ITEMS}}
2734
- `.trim();
2735
-
2736
- // src/templates/quizTemplate.ts
2737
- var QUIZ_TEMPLATE = `
2738
- ---
2739
- id: "{{ID}}"
2740
- title: "{{TITLE}}"
2741
- type: "QUIZ"
2742
- language: "{{LANGUAGE}}"
2743
- total_questions: {{TOTAL_QUESTIONS}}
2744
- passing_score_pct: {{PASSING_SCORE_PCT}}
2745
- ---
2746
-
2747
- # \u{1F9E0} Diagnostic & Active Recall Quiz: {{TITLE}}
2748
-
2749
- > \u23F1\uFE0F **Recommended Time:** ~10-15 mins
2750
- > \u{1F3AF} **Passing Score:** {{PASSING_SCORE_PCT}}%
2751
- > \u{1F4A1} **Purpose:** Test your conceptual understanding, catch hidden misconceptions, and evaluate architectural trade-offs.
2752
-
2753
- ---
2754
-
2755
- {{QUESTIONS_SECTION}}
2756
-
2757
- ---
2758
-
2759
- ## \u{1F511} Comprehensive Answer Key & Deep Explanation (Expand after completing)
2760
- <details>
2761
- <summary><b>\u{1F449} Click to View Full Explanations & Common Pitfall Analysis</b></summary>
2762
-
2763
- {{ANSWER_KEY_SECTION}}
2764
- </details>
2765
- `.trim();
2766
-
2767
- // src/templates/selfLabTemplate.ts
2768
- var SELF_LAB_TEMPLATE = `
2769
- ---
2770
- id: "{{ID}}"
2771
- title: "{{TITLE}}"
2772
- type: "SELF_LAB"
2773
- language: "{{LANGUAGE}}"
2774
- difficulty: "{{DIFFICULTY}}"
2775
- estimated_minutes: {{ESTIMATED_MINUTES}}
2776
- tech_stack: {{TECH_STACK}}
2777
- ---
2778
-
2779
- # \u{1F680} Self-Paced Hands-On Lab: {{TITLE}}
2780
-
2781
- > \u23F1\uFE0F **Estimated Duration:** ~{{ESTIMATED_MINUTES}} mins
2782
- > \u{1F3AF} **Difficulty Level:** {{DIFFICULTY_UPPER}}
2783
- > \u{1F9F0} **Tech Stack:** {{TECH_STACK_STR}}
2784
- > \u{1F4A1} **Self-Learner Notice:** You are in full control of this lab. Follow the progressive challenges below. If you get stuck at any point, use the **Progressive Hints System** to get unstuck without ruining the learning experience!
2785
-
2786
- ---
2787
-
2788
- ## \u{1F4CB} Mission Briefing & Environment Setup
2789
- {{MISSION_BRIEFING}}
2790
-
2791
- ### \u{1F6EB} Preflight Checklist
2792
- {{PREFLIGHT_CHECKLIST}}
2793
-
2794
- ---
2795
-
2796
- ## \u{1F3AF} Progressive Challenges (3-Tier Differentiation)
2797
-
2798
- ### \u{1F949} Challenge 1: Foundational Core (Bronze) \u2014 ~{{BRONZE_MINS}} mins
2799
- **Objective:** {{BRONZE_OBJECTIVE}}
2800
-
2801
- #### Tasks & Implementation Details:
2802
- {{BRONZE_TASKS}}
2803
-
2804
- #### \u{1F9EA} Self-Verification Command:
2805
- \`\`\`bash
2806
- {{BRONZE_VERIFY_COMMAND}}
2807
- \`\`\`
2808
- *Expected Terminal Output:*
2809
- \`\`\`text
2810
- {{BRONZE_EXPECTED_OUTPUT}}
2811
- \`\`\`
2812
-
2813
- #### \u{1F4A1} Progressive Hints (Expand only if stuck):
2814
- <details>
2815
- <summary><b>\u{1F4A1} Hint Level 1: Conceptual Clue (H\u01B0\u1EDBng t\u01B0 duy)</b></summary>
2816
-
2817
- {{BRONZE_HINT_1}}
2818
- </details>
2819
-
2820
- <details>
2821
- <summary><b>\u{1F50D} Hint Level 2: Structural Skeleton (Khung code m\u1EABu)</b></summary>
2822
-
2823
- \`\`\`{{CODE_LANGUAGE}}
2824
- {{BRONZE_HINT_2}}
2825
- \`\`\`
2826
- </details>
2827
-
2828
- <details>
2829
- <summary><b>\u{1F6A8} Hint Level 3: Full Solution & Explanation (L\u1EDDi gi\u1EA3i tr\u1ECDn v\u1EB9n)</b></summary>
2830
-
2831
- \`\`\`{{CODE_LANGUAGE}}
2832
- {{BRONZE_HINT_3_CODE}}
2833
- \`\`\`
2834
-
2835
- **Why this solution works:**
2836
- {{BRONZE_HINT_3_EXPLANATION}}
2837
- </details>
2838
-
2839
- ---
2840
-
2841
- ### \u{1F948} Challenge 2: Logic & Error Handling (Silver) \u2014 ~{{SILVER_MINS}} mins
2842
- **Objective:** {{SILVER_OBJECTIVE}}
2843
-
2844
- #### Tasks & Implementation Details:
2845
- {{SILVER_TASKS}}
2846
-
2847
- #### \u{1F9EA} Self-Verification Command:
2848
- \`\`\`bash
2849
- {{SILVER_VERIFY_COMMAND}}
2850
- \`\`\`
2851
- *Expected Terminal Output:*
2852
- \`\`\`text
2853
- {{SILVER_EXPECTED_OUTPUT}}
2854
- \`\`\`
2855
-
2856
- #### \u{1F4A1} Progressive Hints (Expand only if stuck):
2857
- <details>
2858
- <summary><b>\u{1F4A1} Hint Level 1: Conceptual Clue (H\u01B0\u1EDBng t\u01B0 duy)</b></summary>
2859
-
2860
- {{SILVER_HINT_1}}
2861
- </details>
2862
-
2863
- <details>
2864
- <summary><b>\u{1F50D} Hint Level 2: Structural Skeleton (Khung code m\u1EABu)</b></summary>
2865
-
2866
- \`\`\`{{CODE_LANGUAGE}}
2867
- {{SILVER_HINT_2}}
2868
- \`\`\`
2869
- </details>
2870
-
2871
- <details>
2872
- <summary><b>\u{1F6A8} Hint Level 3: Full Solution & Explanation (L\u1EDDi gi\u1EA3i tr\u1ECDn v\u1EB9n)</b></summary>
2873
-
2874
- \`\`\`{{CODE_LANGUAGE}}
2875
- {{SILVER_HINT_3_CODE}}
2876
- \`\`\`
2877
-
2878
- **Why this solution works:**
2879
- {{SILVER_HINT_3_EXPLANATION}}
2880
- </details>
2881
-
2882
- ---
2883
-
2884
- ### \u{1F947} Challenge 3: Edge Cases & Optimization (Gold) \u2014 ~{{GOLD_MINS}} mins
2885
- **Objective:** {{GOLD_OBJECTIVE}}
2886
-
2887
- #### Tasks & Implementation Details:
2888
- {{GOLD_TASKS}}
2889
-
2890
- #### \u{1F9EA} Self-Verification Command:
2891
- \`\`\`bash
2892
- {{GOLD_VERIFY_COMMAND}}
2893
- \`\`\`
2894
- *Expected Terminal Output:*
2895
- \`\`\`text
2896
- {{GOLD_EXPECTED_OUTPUT}}
2897
- \`\`\`
2898
-
2899
- #### \u{1F4A1} Progressive Hints (Expand only if stuck):
2900
- <details>
2901
- <summary><b>\u{1F4A1} Hint Level 1: Conceptual Clue (H\u01B0\u1EDBng t\u01B0 duy)</b></summary>
2902
-
2903
- {{GOLD_HINT_1}}
2904
- </details>
2905
-
2906
- <details>
2907
- <summary><b>\u{1F50D} Hint Level 2: Structural Skeleton (Khung code m\u1EABu)</b></summary>
2908
-
2909
- \`\`\`{{CODE_LANGUAGE}}
2910
- {{GOLD_HINT_2}}
2911
- \`\`\`
2912
- </details>
2913
-
2914
- <details>
2915
- <summary><b>\u{1F6A8} Hint Level 3: Full Solution & Explanation (L\u1EDDi gi\u1EA3i tr\u1ECDn v\u1EB9n)</b></summary>
2916
-
2917
- \`\`\`{{CODE_LANGUAGE}}
2918
- {{GOLD_HINT_3_CODE}}
2919
- \`\`\`
2920
-
2921
- **Why this solution works:**
2922
- {{GOLD_HINT_3_EXPLANATION}}
2923
- </details>
2924
-
2925
- ---
2926
-
2927
- ## \u{1F50D} Self-Learner Troubleshooting Matrix
2928
- | Symptom / Error Message | Root Cause | Exact Fix |
2929
- | :--- | :--- | :--- |
2930
- {{TROUBLESHOOTING_ROWS}}
2931
-
2932
- ---
2933
-
2934
- ## \u{1F3C1} Final Lab Submission & Mastery Checklist
2935
- {{FINAL_CHECKLIST}}
2936
- `.trim();
2496
+ function stripTemplateFrontmatter(raw) {
2497
+ let body = raw;
2498
+ if (body.startsWith("---")) {
2499
+ const end = body.indexOf("\n---", 3);
2500
+ if (end !== -1) body = body.slice(end + 4);
2501
+ }
2502
+ return body.split("\n").filter((l) => l.trim() !== "<!-- INJECT_BODY -->").join("\n").replace(/^\s*\n/, "").trimEnd();
2503
+ }
2504
+ var KIT_TEMPLATE_FALLBACK_DIRS = [
2505
+ // Packaged with the npm bundle (dist/templates) — resolves from node_modules.
2506
+ "templates",
2507
+ // Repo checkout layouts.
2508
+ "docs/refs/templates"
2509
+ ];
2510
+ var _moduleDir = (() => {
2511
+ try {
2512
+ if (typeof import.meta !== "undefined" && typeof import.meta.url === "string") {
2513
+ return path.dirname(fileURLToPath(import.meta.url));
2514
+ }
2515
+ } catch {
2516
+ }
2517
+ return typeof __dirname !== "undefined" ? __dirname : process.cwd();
2518
+ })();
2519
+ function candidateDirs(explicitDir) {
2520
+ const dirs = [];
2521
+ if (process.env.CURRICULUM_TEMPLATES_DIR) dirs.push(process.env.CURRICULUM_TEMPLATES_DIR);
2522
+ dirs.push(path.resolve(process.cwd(), "_templates"));
2523
+ for (const rel of KIT_TEMPLATE_FALLBACK_DIRS) {
2524
+ dirs.push(path.resolve(_moduleDir, rel));
2525
+ dirs.push(path.resolve(process.cwd(), rel));
2526
+ dirs.push(path.resolve(process.cwd(), "packages/curriculum-kit", rel));
2527
+ }
2528
+ return dirs;
2529
+ }
2530
+ function findTemplatePath(templateName, explicitDir) {
2531
+ for (const dir of candidateDirs()) {
2532
+ const p = path.join(dir, templateName);
2533
+ if (!fs2.existsSync(p)) continue;
2534
+ try {
2535
+ fs2.accessSync(p, fs2.constants.R_OK);
2536
+ return p;
2537
+ } catch {
2538
+ }
2539
+ }
2540
+ return null;
2541
+ }
2542
+ function loadAuthoringTemplate(templateName, templatesDir) {
2543
+ const p = findTemplatePath(templateName);
2544
+ if (!p) return "";
2545
+ try {
2546
+ return stripTemplateFrontmatter(fs2.readFileSync(p, "utf-8"));
2547
+ } catch {
2548
+ return "";
2549
+ }
2550
+ }
2937
2551
 
2938
2552
  // src/ai/prompts/lessonMasterPrompt.ts
2939
2553
  function buildLessonMasterPrompt(input) {
@@ -2987,7 +2601,7 @@ Build a deep, rigorous, and highly pedagogical Master Lesson Plan (LESSON) that
2987
2601
  # MANDATORY TEMPLATE STRUCTURE
2988
2602
  You MUST generate structured data that will render directly into this exact Markdown template:
2989
2603
  ---
2990
- ${LESSON_PLAN_TEMPLATE}
2604
+ ${loadAuthoringTemplate("LESSON_5E_template.md") ?? "[TEMPLATE FILE NOT FOUND: LESSON_5E_template.md]"}
2991
2605
  ---
2992
2606
 
2993
2607
  # INPUT PARAMETERS
@@ -3065,7 +2679,7 @@ Transform the exact pedagogical flow and activities from the Master Lesson Plan
3065
2679
  # MANDATORY TEMPLATE STRUCTURE
3066
2680
  You MUST generate data aligned with this Markdown template:
3067
2681
  ---
3068
- ${ACT_TEMPLATE}
2682
+ ${loadAuthoringTemplate("ACT_template.md") ?? "[TEMPLATE FILE NOT FOUND: ACT_template.md]"}
3069
2683
  ---
3070
2684
 
3071
2685
  # CANONICAL MASTER LESSON CONTEXT (SOURCE OF TRUTH)
@@ -3160,7 +2774,7 @@ Generate complete, verified source code that satisfies the lesson objectives and
3160
2774
  # MANDATORY TEMPLATE STRUCTURE
3161
2775
  You MUST generate data aligned with this Markdown template:
3162
2776
  ---
3163
- ${CODE_LAB_TEMPLATE}
2777
+ ${loadAuthoringTemplate("LAB_TEMPLATE.md") ?? "[TEMPLATE FILE NOT FOUND: LAB_TEMPLATE.md]"}
3164
2778
  ---
3165
2779
 
3166
2780
  # CANONICAL LESSON CONTEXT (SOURCE OF TRUTH)
@@ -3658,7 +3272,7 @@ Build a complete, engaging Self-Paced Hands-On Lab (SELF_LAB) for autonomous lea
3658
3272
  # MANDATORY TEMPLATE STRUCTURE
3659
3273
  You MUST generate data aligned with this Markdown template:
3660
3274
  ---
3661
- ${SELF_LAB_TEMPLATE}
3275
+ ${loadAuthoringTemplate("SELF_LAB_template.md") ?? "[TEMPLATE FILE NOT FOUND: SELF_LAB_template.md]"}
3662
3276
  ---
3663
3277
 
3664
3278
  # INPUT PARAMETERS
@@ -3795,7 +3409,7 @@ Use this mapping to determine which Bloom level each question truly targets. Mat
3795
3409
  # MANDATORY TEMPLATE STRUCTURE
3796
3410
  You MUST generate data aligned with this Markdown template:
3797
3411
  ---
3798
- ${QUIZ_TEMPLATE}
3412
+ ${loadAuthoringTemplate("QUIZ_v4.6_template.md") ?? "[TEMPLATE FILE NOT FOUND: QUIZ_v4.6_template.md]"}
3799
3413
  ---
3800
3414
 
3801
3415
  # INPUT PARAMETERS