@thanh01.pmt/curriculum-kit 1.0.2 → 1.0.3

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.
@@ -15,6 +15,11 @@ interface SingleArtifactRequest {
15
15
  targetAge?: string;
16
16
  scaffoldingLevel?: ScaffoldingLevel;
17
17
  hardwarePlatform?: string[];
18
+ gradeLevel?: string;
19
+ studentCount?: string;
20
+ language?: string;
21
+ extraContext?: string;
22
+ config?: Record<string, any>;
18
23
  contextSot?: {
19
24
  framework?: string;
20
25
  learnerProfile?: string;
@@ -44,7 +49,7 @@ interface SingleArtifactResult {
44
49
  /**
45
50
  * Maps artifact type to default canonical filename and responsible agent persona
46
51
  */
47
- declare function getArtifactMetadata(type: ArtifactType, lessonId?: string): {
52
+ declare function getArtifactMetadata(type: ArtifactType, lessonId?: string, pedagogy?: string): {
48
53
  filename: string;
49
54
  persona: string;
50
55
  templateFile: string;
@@ -15,6 +15,11 @@ interface SingleArtifactRequest {
15
15
  targetAge?: string;
16
16
  scaffoldingLevel?: ScaffoldingLevel;
17
17
  hardwarePlatform?: string[];
18
+ gradeLevel?: string;
19
+ studentCount?: string;
20
+ language?: string;
21
+ extraContext?: string;
22
+ config?: Record<string, any>;
18
23
  contextSot?: {
19
24
  framework?: string;
20
25
  learnerProfile?: string;
@@ -44,7 +49,7 @@ interface SingleArtifactResult {
44
49
  /**
45
50
  * Maps artifact type to default canonical filename and responsible agent persona
46
51
  */
47
- declare function getArtifactMetadata(type: ArtifactType, lessonId?: string): {
52
+ declare function getArtifactMetadata(type: ArtifactType, lessonId?: string, pedagogy?: string): {
48
53
  filename: string;
49
54
  persona: string;
50
55
  templateFile: string;
package/dist/index.cjs CHANGED
@@ -9340,12 +9340,14 @@ var __filename2 = typeof (typeof document === 'undefined' ? require('u' + 'rl').
9340
9340
  var _resolvedDir = __filename2 ? path3__default.default.dirname(__filename2) : typeof __dirname !== "undefined" ? __dirname : process.cwd();
9341
9341
  function loadCurriculumTemplate(templateName) {
9342
9342
  const candidatePaths = [
9343
- path3__default.default.resolve(process.cwd(), "_templates", templateName),
9343
+ path3__default.default.resolve("/Users/tonypham/MEGA/WebApp/WIP/learnwell-platform/packages/curriculum-kit/docs/refs/templates", templateName),
9344
9344
  path3__default.default.resolve(process.cwd(), "packages/curriculum-kit/docs/refs/templates", templateName),
9345
+ path3__default.default.resolve(process.cwd(), "_templates", templateName),
9345
9346
  path3__default.default.resolve(process.cwd(), "docs/refs/templates", templateName),
9346
9347
  path3__default.default.resolve(_resolvedDir, "../docs/refs/templates", templateName),
9347
9348
  path3__default.default.resolve(_resolvedDir, "../../docs/refs/templates", templateName),
9348
9349
  path3__default.default.resolve(_resolvedDir, "../../../docs/refs/templates", templateName),
9350
+ path3__default.default.resolve("/Users/tonypham/MEGA/WebApp/content-gen/the-ultimate-curriculum-agent-os/_templates", templateName),
9349
9351
  path3__default.default.resolve(_resolvedDir, "../../../../the-ultimate-curriculum-agent-os/_templates", templateName)
9350
9352
  ];
9351
9353
  for (const p of candidatePaths) {
@@ -10770,11 +10772,14 @@ async function produceBatchLessons(storage, projectId, lessonIds, options = {})
10770
10772
  // src/services/singleArtifactService.ts
10771
10773
  init_streamRunner();
10772
10774
  init_errors();
10773
- function getArtifactMetadata(type, lessonId) {
10775
+ function getArtifactMetadata(type, lessonId, pedagogy) {
10774
10776
  const id = lessonId || "ON_DEMAND";
10775
10777
  switch (type) {
10776
- case "lesson":
10777
- return { filename: `LESSON_${id}.md`, persona: "@content", templateFile: "LESSON_5E_template.md" };
10778
+ case "lesson": {
10779
+ const p = (pedagogy || "").toLowerCase();
10780
+ const templateFile = p === "edp" ? "LESSON_EDP_template.md" : p === "general" ? "LESSON_GENERAL_template.md" : "LESSON_5E_template.md";
10781
+ return { filename: `LESSON_${id}.md`, persona: "@content", templateFile };
10782
+ }
10778
10783
  case "slide":
10779
10784
  return { filename: `SLIDE_${id}.md`, persona: "@illustrator", templateFile: "SLIDE_template.md" };
10780
10785
  case "act":
@@ -10815,6 +10820,8 @@ function getArtifactMetadata(type, lessonId) {
10815
10820
  return { filename: `REVIEW_GAME_${id}.md`, persona: "@assessor", templateFile: "REVIEW_GAME_template.md" };
10816
10821
  case "graphic_organizer":
10817
10822
  return { filename: `GRAPHIC_ORGANIZER_${id}.md`, persona: "@illustrator", templateFile: "GRAPHIC_ORGANIZER_template.md" };
10823
+ default:
10824
+ return { filename: `ARTIFACT_${id}.md`, persona: "@content", templateFile: "LESSON_5E_template.md" };
10818
10825
  }
10819
10826
  }
10820
10827
  async function generateSingleArtifact(req) {
@@ -10827,24 +10834,50 @@ async function generateSingleArtifact(req) {
10827
10834
  targetAge = "14-18 years old (High School / Early College)",
10828
10835
  scaffoldingLevel = "balanced",
10829
10836
  hardwarePlatform = ["MacBook Lab (macOS 14+ / Swift 6)"],
10837
+ gradeLevel,
10838
+ studentCount,
10839
+ language = "Vietnamese",
10840
+ extraContext,
10841
+ config,
10830
10842
  contextSot = {},
10831
10843
  options = {},
10832
10844
  onChunk
10833
10845
  } = req;
10834
- const meta = getArtifactMetadata(artifactType, lessonId);
10835
- const templateContent = loadCurriculumTemplate(meta.templateFile);
10846
+ const meta = getArtifactMetadata(artifactType, lessonId, pedagogy || config?.pedagogicalModel);
10836
10847
  const displayTitle = lessonTitle || topic;
10848
+ const loadedTemplate = loadCurriculumTemplate(meta.templateFile);
10849
+ const templateContent = loadedTemplate || getDefaultFallbackTemplate(artifactType, displayTitle, lessonId || "ON_DEMAND");
10837
10850
  const hwStr = hardwarePlatform.join(", ");
10851
+ const selectedDevices = (config?.devices || (hardwarePlatform[0]?.toLowerCase().includes("paper") ? "paper-only" : "laptop")).toLowerCase();
10852
+ const isBilingual = language.toLowerCase().includes("bilingual") || language.toLowerCase().includes("song");
10853
+ const isVietnamese = !isBilingual && language.toLowerCase().includes("viet");
10854
+ const langRule = isBilingual ? `1. AUTHORING LANGUAGE: Bilingual (Vietnamese - English). Headings and core conceptual definitions should be presented in Vietnamese with English technical terms in parentheses. Explanations and instructional text are in Vietnamese. Key code terms, comments, and challenge summaries are presented bilingually.` : isVietnamese ? `1. AUTHORING LANGUAGE: Vietnamese for all instructional text, explanations, questions, rubrics, and presenter notes. Programming code, syntax keywords, and standard API identifiers remain in standard English (with Vietnamese explanation comments/notes).` : `1. AUTHORING LANGUAGE: 100% English (Plan C Canonical Specification).`;
10855
+ const isPaperOnly = selectedDevices === "paper-only" || hwStr.toLowerCase().includes("paper") || hwStr.toLowerCase().includes("print-ready");
10856
+ const deviceRule = isPaperOnly ? `
10857
+ - \u{1F4C4} PAPER-ONLY / NO-DEVICE ENVIRONMENT: The learning space has NO computers or screens. All exercises, worksheets, task cards, exit tickets, and code analyses MUST be 100% printable. Provide write-in blank boxes, printed code snippets with line numbers, tracing tables, and physical manipulative instructions.` : selectedDevices === "tablet" || selectedDevices === "smartphone" ? `
10858
+ - \u{1F4F1} MOBILE/TABLET ENVIRONMENT: Activities should be optimized for touch interfaces and mobile/tablet sandboxes (e.g. Swift Playgrounds, Web IDEs, tap/touch interactions).` : `
10859
+ - \u{1F4BB} LAPTOP/DESKTOP ENVIRONMENT: Full keyboard, terminal, multi-file code editing, and browser developer tooling are available.`;
10860
+ const classDynamicsRule = studentCount ? `
10861
+ - \u{1F465} CLASS SIZE LOGISTICS: Class has exactly ${studentCount} students. Structure group sizes, pair-programming pairs, station rotations, and material distribution to realistically accommodate ${studentCount} students without bottlenecks.` : "";
10862
+ const scaffoldingRule = scaffoldingLevel === "foundation" ? `
10863
+ - \u{1FA9C} FOUNDATION SCAFFOLDING: High instructional support. Provide step-by-step numbered breakdowns, concrete real-world analogies, hints for every problem, scaffolded starter code/fill-in-the-blanks, and frequent check-for-understanding prompts.` : scaffoldingLevel === "advanced" ? `
10864
+ - \u{1F680} ADVANCED CHALLENGE: Minimal scaffolding. Focus on deeper system architecture, edge case handling, computational complexity, performance optimization, and open-ended extension challenges.` : `
10865
+ - \u2696\uFE0F BALANCED SCAFFOLDING: Balanced approach combining structured teacher guidance with independent inquiry and problem solving.`;
10866
+ const extraContextRule = extraContext ? `
10867
+ - \u{1F3AF} CRITICAL USER INSTRUCTIONS (MANDATORY): "${extraContext}". You MUST directly reflect and satisfy every point of this user guidance in the generated artifact!` : "";
10868
+ const artifactSpecializedPrompt = getArtifactSpecializedInvariants(artifactType, {
10869
+ ...req,
10870
+ studentCount});
10838
10871
  const systemPrompt = `You are ${meta.persona}, an expert Curriculum & Pedagogical Specialist in the Curriculum OS Multi-Agent Team.
10839
10872
  Your task is to author a canonical, publication-grade learning artifact of type "${artifactType.toUpperCase()}".
10840
10873
 
10841
10874
  ### CORE OPERATIONAL INVARIANTS:
10842
- 1. AUTHORING LANGUAGE: 100% English (Plan C Canonical Specification).
10875
+ ${langRule}
10843
10876
  2. NON-MOCK CODE INVARIANT: Any code snippet provided MUST be 100% syntactically valid, idiomatic, and executable without placeholders or fake functions.
10844
10877
  3. PEDAGOGICAL GROUNDING: Strictly align with the ${pedagogy.toUpperCase()} model, Bloom's Revised Taxonomy, and IEEE/ACM CS2023 guidelines.
10845
- 4. SCAFFOLDING LEVEL: "${scaffoldingLevel.toUpperCase()}" (Foundation: High support & concrete analogies; Balanced: Application & problem solving; Advanced: Systems architecture & concurrency invariants).
10846
- 5. TARGET AUDIENCE: ${targetAge} on ${hwStr}.
10847
- 6. OUTPUT INTEGRITY: Output clean Markdown starting directly with YAML frontmatter. Do not wrap entire response in triple backticks.`;
10878
+ 4. SCAFFOLDING LEVEL: "${scaffoldingLevel.toUpperCase()}".${scaffoldingRule}
10879
+ 5. TARGET AUDIENCE: ${gradeLevel ? `Grade ${gradeLevel}, ` : ""}${targetAge} on ${hwStr}.${deviceRule}${classDynamicsRule}${extraContextRule}
10880
+ 6. OUTPUT INTEGRITY: Output clean Markdown starting directly with YAML frontmatter. Do not wrap entire response in triple backticks.${artifactSpecializedPrompt}`;
10848
10881
  const userPrompt = `### CONTEXT GROUND TRUTH:
10849
10882
  - Topic / Concept Domain: "${topic}"
10850
10883
  - Lesson ID: "${lessonId || "ON_DEMAND"}"
@@ -10852,7 +10885,13 @@ Your task is to author a canonical, publication-grade learning artifact of type
10852
10885
  - Pedagogy: "${pedagogy.toUpperCase()}"
10853
10886
  - Scaffolding Level: "${scaffoldingLevel}"
10854
10887
  - Hardware Environment: "${hwStr}"
10855
-
10888
+ ${gradeLevel ? `- Target Grade Level: "${gradeLevel}"
10889
+ ` : ""}${studentCount ? `- Class Size: "${studentCount} students"
10890
+ ` : ""}- Target Language: "${language}"
10891
+ ${selectedDevices ? `- Device Mode: "${selectedDevices}"
10892
+ ` : ""}${extraContext ? `- User Specific Guidance & Requirements: "${extraContext}"
10893
+ ` : ""}${config ? `- Full Task Config: ${JSON.stringify(config)}
10894
+ ` : ""}
10856
10895
  ${contextSot.framework ? `### SOT CURRICULUM FRAMEWORK:
10857
10896
  ${contextSot.framework.slice(0, 1500)}
10858
10897
  ` : ""}
@@ -10866,15 +10905,10 @@ ${contextSot.handout.slice(0, 1e3)}
10866
10905
  ### MANDATORY CANONICAL TEMPLATE CONTRACT:
10867
10906
  Use the following reference template structure as the exact specification:
10868
10907
 
10869
- ${templateContent || `---
10870
- id: "${lessonId || "ON_DEMAND"}"
10871
- title: "${displayTitle}"
10872
- type: "${artifactType.toUpperCase()}"
10873
- ---
10874
- # ${displayTitle}`}
10908
+ ${templateContent}
10875
10909
 
10876
10910
  ### TASK INSTRUCTION:
10877
- Generate the complete, thorough, production-grade "${artifactType.toUpperCase()}" artifact for "${displayTitle}". Ensure all [REQUIRED] sections are fully developed with realistic, detailed engineering content.`;
10911
+ Generate the complete, thorough, publication-grade "${artifactType.toUpperCase()}" artifact for "${displayTitle}". Ensure all [REQUIRED] sections are fully developed with realistic, detailed pedagogical and technical content. Strictly follow the specialized invariants for "${artifactType.toUpperCase()}".`;
10878
10912
  let accumulatedContent = "";
10879
10913
  let accumulatedThought = "";
10880
10914
  try {
@@ -10913,6 +10947,248 @@ Generate the complete, thorough, production-grade "${artifactType.toUpperCase()}
10913
10947
  });
10914
10948
  }
10915
10949
  }
10950
+ function getArtifactSpecializedInvariants(type, req) {
10951
+ const cfg = req.config || {};
10952
+ const isPaperOnly = cfg.devices === "paper-only" || req.hardwarePlatform?.some((h) => h.toLowerCase().includes("paper"));
10953
+ const studentCount = req.studentCount || "25";
10954
+ switch (type) {
10955
+ case "slide": {
10956
+ const slideCount = cfg.slideCount || 10;
10957
+ const presentationStyle = cfg.presentationStyle || "modern";
10958
+ const presentationDuration = cfg.presentationDuration || 45;
10959
+ const includeSpeakerNotes = cfg.includeSpeakerNotes !== false;
10960
+ return `
10961
+ ### \u{1F3AC} SLIDE PRESENTATION & MARP ARCHITECTURE INVARIANTS:
10962
+ 1. **SLIDE COUNT & TIMING TARGET**:
10963
+ - Generate EXACTLY ${slideCount} slides separated by \`---\` horizontal rules.
10964
+ - Pacing: Target total duration is ${presentationDuration} minutes (~${Math.round(Number(presentationDuration) / Number(slideCount))} mins per slide).
10965
+ - Visual Style: "${presentationStyle.toUpperCase()}". Maintain high visual clarity, contrasting accents, and executive polish.
10966
+ 2. **STRICT CONCISENESS & 6x6 RULE (ABSOLUTELY NO TEXT WALLS)**:
10967
+ - A slide is a VISUAL PROJECTION CANVAS, NOT a textbook or lesson plan!
10968
+ - Maximum 4\u20136 bullet points per slide.
10969
+ - Maximum 8\u201312 words per bullet point. Forbid dense multi-sentence paragraphs on the slide surface.
10970
+ 3. **SPEAKER NOTES FOR ALL SPOKEN WORDS (<!-- Presenter Notes: ... -->)**:
10971
+ ${includeSpeakerNotes ? "- MANDATORY: Every single slide MUST contain comprehensive presenter notes in `<!-- Presenter Notes: ... -->` at the bottom, giving the teacher the exact verbal talking points, analogies, and pacing tips." : "- Optional brief presenter notes."}
10972
+ 4. **CLICK-TO-REVEAL SYSTEM**:
10973
+ - Use \`<!-- clicks -->\` before bulleted lists (\`<ul>\` or \`<ol>\`) for incremental click-to-reveal.
10974
+ - Use \`<!-- click -->\` before answers, code reveals, or key callouts.
10975
+ 5. **2-COLUMN / SPLIT LAYOUT**:
10976
+ - Use <div class="columns"><div>...</div><div>...</div></div> for side-by-side concept vs. code or problem vs. solution comparisons.
10977
+ 6. **CONCISE CODE SNIPPETS**:
10978
+ - Maximum 6\u201310 lines of clean code per snippet with inline comments. Never paste whole files.
10979
+ 7. **MERMAID VISUALS**:
10980
+ - Use Mermaid flowcharts or sequence diagrams for workflows and control loops.`;
10981
+ }
10982
+ case "tiered_practice": {
10983
+ const techStack = cfg.techStack || (req.hardwarePlatform?.[0] || "Modern Programming Language");
10984
+ const includeUnitTests = cfg.includeUnitTests !== false;
10985
+ return `
10986
+ ### \u{1FA9C} TIERED PRACTICE ARCHITECTURE INVARIANTS (3-TIER ADAPTIVE):
10987
+ - Target Technology Stack: "${techStack}"
10988
+ ${includeUnitTests ? "- Automated Testing: Include explicit executable Unit Tests / Assertions for verifying Bronze, Silver, and Gold tiers." : ""}
10989
+ 1. **3 EXPLICIT RIGOR TIERS**:
10990
+ - **\u{1F949} Tier 1 (Bronze / C\u01A1 b\u1EA3n)**: 70% starter boilerplate / 30% fill-in. Direct recall, scaffolded fill-in-the-blanks, single-concept recognition with starter hints.
10991
+ - **\u{1F948} Tier 2 (Silver / Ti\xEAu chu\u1EA9n)**: 30% starter boilerplate / 70% implementation. Independent multi-step problem solving, bug identification, synthesis of 2+ concepts.
10992
+ - **\u{1F947} Tier 3 (Gold / Th\u1EED th\xE1ch)**: 0% code / open architecture. Edge case handling, algorithmic optimization, open-ended architectural design or extension.
10993
+ 2. **COMPLETE WORKED SOLUTIONS & ANSWER KEYS**:
10994
+ - Provide step-by-step worked solutions for every problem across all 3 tiers.
10995
+ 3. **SELF-DIAGNOSTIC RUBRIC**:
10996
+ - Include a clear student rubric with criteria for when a student is ready to level up from Bronze \u2794 Silver \u2794 Gold.`;
10997
+ }
10998
+ case "exit_ticket": {
10999
+ const questionCount = cfg.questionCount || 3;
11000
+ const diagnosticFocus = cfg.diagnosticFocus || "misconceptions";
11001
+ return `
11002
+ ### \u{1F39F}\uFE0F EXIT TICKET ARCHITECTURE INVARIANTS:
11003
+ 1. **EXACTLY ${questionCount} TARGETED ITEMS (3\u20135 MINUTE DURATION)**:
11004
+ - Item 1: Quick diagnostic checking mastery of the core objective.
11005
+ - Item 2: Application with diagnostic trap focusing on: "${diagnosticFocus}".
11006
+ - Item 3: Metacognitive self-check (Confidence rating 1\u20135 + "Explain what is still fuzzy").
11007
+ 2. **TEACHER DIAGNOSTIC INTERVENTION GUIDE**:
11008
+ - Provide a quick lookup table: "If student chooses/writes X \u2794 Misconception is Y \u2794 Quick remedy is Z".${isPaperOnly ? "\n3. **PRINTABLE CUT-OUT FORMAT**: Include student name/date line and cut-border dashed line." : ""}`;
11009
+ }
11010
+ case "quiz": {
11011
+ const questionCount = cfg.questionCount || 5;
11012
+ const questionTypes = Array.isArray(cfg.questionTypes) ? cfg.questionTypes.join(", ") : cfg.questionTypes || "multiple_choice";
11013
+ const diagnosticFocus = cfg.diagnosticFocus || "balanced";
11014
+ return `
11015
+ ### \u{1F4DD} BLOOM-ALIGNED QUIZ ARCHITECTURE INVARIANTS:
11016
+ 1. **EXACTLY ${questionCount} QUESTIONS (${questionTypes.toUpperCase()})**:
11017
+ - Diagnostic emphasis: "${diagnosticFocus}".
11018
+ - 40% Remember/Understand (Conceptual foundations).
11019
+ - 40% Apply/Analyze (Bug finding, code tracing, scenario application).
11020
+ - 20% Evaluate/Create (Algorithmic reasoning, trade-off evaluation).
11021
+ 2. **HIGH-QUALITY DISTRACTORS WITH RATIONALE**:
11022
+ - For every multiple choice item, explain WHY each incorrect option is a plausible misconception and WHY the key is correct.
11023
+ 3. **COMPLETE ANSWER KEY & SCORING RUBRIC**:
11024
+ - Explicit point distribution, partial credit guidelines, and sample ideal answers for open-ended questions.`;
11025
+ }
11026
+ case "task_cards": {
11027
+ const cardCount = cfg.cardCount || 12;
11028
+ const cardUsage = cfg.cardUsage || "stations";
11029
+ return `
11030
+ ### \u{1F4CB} TASK CARDS ARCHITECTURE INVARIANTS:
11031
+ 1. **SET OF EXACTLY ${cardCount} NUMBERED CARDS (Optimized for ${cardUsage.toUpperCase()})**:
11032
+ - Clearly mark each card: Card # (1 to ${cardCount}), Difficulty (Foundation / Standard / Challenge), and Target Skill.
11033
+ 2. **STUDENT RECORDING SHEET (B\u1EA2NG GHI \u0110\xC1P \xC1N)**:
11034
+ - Include a structured printable grid where students record answers for Cards 1\u2013${cardCount}.
11035
+ 3. **TEACHER MASTER KEY**:
11036
+ - Quick reference key with verified answers and explanations.${isPaperOnly ? "\n4. **PRINT-READY CARD BORDERS**: Layout with clean visual borders ready for physical printing and cutting." : ""}`;
11037
+ }
11038
+ case "graphic_organizer": {
11039
+ const diagramType = cfg.diagramType || "concept_map";
11040
+ const includeFillIn = cfg.includeFillInExercise !== false;
11041
+ return `
11042
+ ### \u{1F4CA} GRAPHIC ORGANIZER ARCHITECTURE INVARIANTS:
11043
+ 1. **VISUAL MODEL TYPE: "${diagramType.toUpperCase()}"**:
11044
+ - Structure a clear cognitive thinking tool: Concept Map, Flowchart, Venn Diagram, Hierarchy Tree, or Cause-Effect Matrix.
11045
+ 2. **VALID MERMAID SYNTAX**:
11046
+ - Embed complete, 100% syntactically correct Mermaid diagrams showing the knowledge structure.
11047
+ 3. **ACTIVE STUDENT INTERACTION PROMPTS**:
11048
+ ${includeFillIn ? "- Include interactive fill-in-the-blank nodes and connection articulation challenges." : "- Include synthesis and reflection prompts based on the visual model."}`;
11049
+ }
11050
+ case "choice_board": {
11051
+ const gridSize = cfg.gridSize || "3x3";
11052
+ const completionRule = cfg.completionRule || "row_column_diagonal";
11053
+ return `
11054
+ ### \u{1F3AF} CHOICE BOARD ARCHITECTURE INVARIANTS (UDL ${gridSize.toUpperCase()} MATRIX):
11055
+ 1. **${gridSize.toUpperCase()} MENU (UDL MULTIPLE MEANS OF EXPRESSION)**:
11056
+ - Option tasks spanning practical coding, architectural diagrams, analytical writing, and real-world scenarios.
11057
+ 2. **COMPLETION CONTRACT: "${completionRule.toUpperCase()}"**:
11058
+ - Explicit rule (e.g. Tic-Tac-Toe 3-in-a-row/column/diagonal, or Point Bounty system).
11059
+ 3. **UNIFIED EVALUATION RUBRIC**:
11060
+ - Consistent grading criteria applicable across all task choices on the board.`;
11061
+ }
11062
+ case "station_rotation": {
11063
+ const stationCount = cfg.stationCount || 3;
11064
+ const stationDuration = cfg.stationDuration || 15;
11065
+ return `
11066
+ ### \u{1F504} STATION ROTATION ARCHITECTURE INVARIANTS:
11067
+ 1. **EXACTLY ${stationCount} STATIONS SCALED FOR ${studentCount} STUDENTS**:
11068
+ - Group size: ~${Math.ceil(Number(studentCount) / Number(stationCount)) || 7} students per group.
11069
+ - Distinct station roles: Teacher-Led Small Group, Independent Practical Lab, Collaborative / Unplugged Peer Challenge.
11070
+ 2. **TIMING & TRANSITIONS (${stationDuration} MINS/STATION)**:
11071
+ - ${stationDuration} minutes per station + 3-minute structured rotation protocol.
11072
+ 3. **STATION DELIVERABLES & ACCOUNTABILITY**:
11073
+ - Clear check-in deliverable required at each station to ensure on-task accountability.`;
11074
+ }
11075
+ case "act":
11076
+ case "codelab":
11077
+ case "science_lab": {
11078
+ const techStack = cfg.techStack || (req.hardwarePlatform?.[0] || "Modern Programming Language");
11079
+ const includeUnitTests = cfg.includeUnitTests !== false;
11080
+ return `
11081
+ ### \u{1F4BB} HANDS-ON LAB & CODE ACTIVITY ARCHITECTURE INVARIANTS:
11082
+ - Technology Stack: "${techStack}"
11083
+ ${includeUnitTests ? "- Unit Testing: Provide automated assertions or test runner checks." : ""}
11084
+ 1. **100% RUNNABLE CODE / RIGOROUS PROCEDURE**:
11085
+ - Absolutely no fake APIs, mock functions, or non-executable pseudocode.
11086
+ 2. **STRUCTURED LAB PHASES**:
11087
+ - Objective & Environmental Prerequisites.
11088
+ - Starter Skeleton Code with clear \`// TODO [Student Task]\` comments.
11089
+ - Step-by-step Guided Challenges (Level 1 \u2794 Level 2 \u2794 Level 3).
11090
+ - Automated Verification / Test Cases.
11091
+ - Complete Reference Solution with design explanation.`;
11092
+ }
11093
+ case "bell_ringer":
11094
+ return `
11095
+ ### \u{1F514} BELL RINGER ARCHITECTURE INVARIANTS (3\u20135 MIN WARM-UP):
11096
+ 1. **3 QUICK HOOK QUESTIONS**:
11097
+ - 2 rapid-fire recall questions activating previous knowledge.
11098
+ - 1 curiosity hook question bridging into today's core topic.
11099
+ 2. **60-SECOND TEACHER REVIEW KEY**:
11100
+ - Quick-glance answer key for instant whole-class review.`;
11101
+ case "review_game":
11102
+ return `
11103
+ ### \u{1F3AE} REVIEW GAME ARCHITECTURE INVARIANTS:
11104
+ 1. **GAMIFIED STRUCTURE**:
11105
+ - Jeopardy-style board (3\u20134 Categories x 3 Point Values: 100 / 200 / 300) OR 3-Round Interactive Trivia.
11106
+ 2. **CLEAR RULES & TEAM DYNAMICS**:
11107
+ - Team scoring rules, buzz-in protocol, and tie-breaker challenge.
11108
+ 3. **COMPLETE QUESTION & ANSWER DECK**:
11109
+ - Verified answers and point values for the host/teacher.`;
11110
+ case "guide": {
11111
+ const lessonDuration = cfg.lessonDuration || 90;
11112
+ return `
11113
+ ### \u{1F4D6} TEACHER GUIDE ARCHITECTURE INVARIANTS (${lessonDuration} MINS LESSON):
11114
+ 1. **MINUTE-BY-MINUTE PACING TIMELINE**:
11115
+ - Pacing broken down for ${lessonDuration} minutes (Hook, Modeling, Guided Practice, Independent Practice, Debrief).
11116
+ 2. **SOCRATIC QUESTIONS & PROMPTS**:
11117
+ - Cold-call questions with anticipated student misconceptions and remediation scripts.
11118
+ 3. **DIFFERENTIATION STRATEGIES**:
11119
+ - Specific adaptations for students needing support vs. high-flyers needing extension.`;
11120
+ }
11121
+ case "worksheet":
11122
+ case "handout":
11123
+ return `
11124
+ ### \u{1F4D1} WORKSHEET / HANDOUT ARCHITECTURE INVARIANTS:
11125
+ 1. **I DO \u2794 WE DO \u2794 YOU DO SCAFFOLDING**:
11126
+ - Part 1 (I Do): Fully worked and annotated example.
11127
+ - Part 2 (We Do): Guided problem with fill-in hints and scaffolding scaffolds.
11128
+ - Part 3 (You Do): Independent mastery challenge.
11129
+ 2. **SELF-CHECK RUBRIC**:
11130
+ - End-of-worksheet self-evaluation checklist.${isPaperOnly ? "\n3. **PRINTABLE WORKSPACES**: Include spacious, clean write-in boxes and workspace for calculations/code." : ""}`;
11131
+ case "rubric": {
11132
+ const rubricScale = cfg.rubricScale || "4_levels";
11133
+ return `
11134
+ ### \u{1F4CA} ANALYTIC RUBRIC ARCHITECTURE INVARIANTS (${rubricScale.toUpperCase()} SCALE):
11135
+ 1. **RIGOROUS PROFICIENCY LEVELS**:
11136
+ - 4 Proficiency Levels: Level 4 (Exemplary) | Level 3 (Proficient) | Level 2 (Developing) | Level 1 (Beginning).
11137
+ 2. **CONCRETE OBSERVABLE CRITERIA**:
11138
+ - Each cell MUST describe concrete, observable behavioral evidence, not vague words like "good" or "average".`;
11139
+ }
11140
+ case "glossary":
11141
+ return `
11142
+ ### \u{1F4DA} TECHNICAL GLOSSARY ARCHITECTURE INVARIANTS:
11143
+ 1. **COMPREHENSIVE TERM PROFILES**:
11144
+ - For every key term: Technical Definition, Real-world Analogy, Code Syntax Example, and Common Misconception.`;
11145
+ case "bom":
11146
+ return `
11147
+ ### \u{1F4E6} BILL OF MATERIALS (BOM) ARCHITECTURE INVARIANTS:
11148
+ 1. **CLASS-SCALED INVENTORY FOR ${studentCount} STUDENTS**:
11149
+ - Exact quantities calculated for ${studentCount} students.
11150
+ - Component specifications, estimated unit cost, and affordable alternatives.`;
11151
+ case "lesson": {
11152
+ const lessonDuration = cfg.lessonDuration || 90;
11153
+ const pedagogicalModel = cfg.pedagogicalModel || req.pedagogy || "5e";
11154
+ return `
11155
+ ### \u{1F393} CANONICAL LESSON PLAN INVARIANTS (${pedagogicalModel.toUpperCase()} MODEL, ${lessonDuration} MINS):
11156
+ 1. **A. LESSON DESIGN PLAN**:
11157
+ - Learning Objectives (Bloom-aligned) & Observable Student Evidence.
11158
+ - Activity Sequence mapping every phase with timing totaling ${lessonDuration} minutes.
11159
+ - Resource Map & Assessment Map with explicit Artifact Contracts.
11160
+ 2. **B. LESSON FLOW**:
11161
+ - Detailed teacher moves, student actions, scripted key questions, and check-for-understanding points for every activity phase.`;
11162
+ }
11163
+ default:
11164
+ return "";
11165
+ }
11166
+ }
11167
+ function getDefaultFallbackTemplate(type, title, id) {
11168
+ const upperType = type.toUpperCase();
11169
+ return `---
11170
+ id: "${id}"
11171
+ title: "${title}"
11172
+ type: "${upperType}"
11173
+ version: "1.0.0"
11174
+ date: "${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}"
11175
+ ---
11176
+
11177
+ # ${title}
11178
+
11179
+ ## 1. Overview & Learning Objectives
11180
+ <!-- [REQUIRED] State 2-3 measurable, Bloom-aligned learning objectives -->
11181
+
11182
+ ## 2. Core Pedagogical Content
11183
+ <!-- [REQUIRED] Provide the core educational substance, questions, problems, and diagrams -->
11184
+
11185
+ ## 3. Practice & Differentiation
11186
+ <!-- [REQUIRED] Tiered support, worked examples, and challenges -->
11187
+
11188
+ ## 4. Assessment & Answer Key
11189
+ <!-- [REQUIRED] Complete solutions, rubrics, and diagnostic teacher feedback -->
11190
+ `;
11191
+ }
10916
11192
 
10917
11193
  // src/services/projectCreationService.ts
10918
11194
  init_streamRunner();