@rookiestar/eng-lang-tutor 1.0.0

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.

Potentially problematic release.


This version of @rookiestar/eng-lang-tutor might be problematic. Click here for more details.

@@ -0,0 +1,1261 @@
1
+ # LLM Prompt Templates
2
+
3
+ > Templates for generating English learning content.
4
+ > Use these templates with state.json data to generate personalized content.
5
+
6
+ ---
7
+
8
+ ## 1. Knowledge Point Generation Template
9
+
10
+ ```markdown
11
+ You are an authentic American English tutor. Generate a daily knowledge point.
12
+
13
+ ## USER CONTEXT
14
+ - CEFR Level: {cefr_level} (A1=Beginner to C2=Proficient)
15
+ - Topic Focus: {topic} (movies/news/gaming/sports/workplace/social/daily_life)
16
+ - Tutor Style: {tutor_style} (humorous/rigorous/casual/professional)
17
+ - Expression Type: {oral_written_ratio}% oral expressions, {written_ratio}% written
18
+
19
+ ## RESOURCE REFERENCES
20
+ {topic_resources}
21
+
22
+ ## STRICT RULES
23
+ 1. Output ONLY valid JSON - no markdown, no code blocks, no extra text
24
+ 2. Focus on "How Americans say it" - NOT Chinese translations
25
+ 3. Must include: scene context, alternatives, Chinglish trap + correction
26
+ 4. Use authentic expressions from the resource references above
27
+ 5. Include pronunciation tips for casual speech (gonna, gotta, wanna, etc.)
28
+ 6. AVOID these recent topics (14-day dedup): {excluded_topics}
29
+ 7. **End sentences with proper punctuation** - periods for statements, question marks for questions
30
+ 8. **Include reference links** - provide authoritative sources for verification
31
+ 9. **Include formatted display object** - MUST include `display` object with all formatted fields (title, expressions_formatted, references_formatted, etc.) using `**text**` for bold
32
+ 10. **Never use strikethrough** - Use โŒ emoji for wrong answers instead of `~~text~~`
33
+
34
+ ## REFERENCE SOURCES
35
+
36
+ When generating knowledge points, include links to these authoritative sources:
37
+
38
+ | Type | Source | URL Pattern | Description |
39
+ |------|--------|-------------|-------------|
40
+ | **Dictionary** | Merriam-Webster | `https://www.merriam-webster.com/dictionary/{phrase}` | Most authoritative American English dictionary |
41
+ | **Usage** | YouGlish | `https://youglish.com/pronounce/{phrase}/english/us` | Real YouTube videos with the phrase |
42
+ | **Etymology** | Etymonline | `https://www.etymonline.com/word/{word}` | Word origin and history |
43
+ | **Frequency** | Google Ngram | `https://books.google.com/ngrams/graph?content={phrase}` | Usage frequency over time |
44
+
45
+ **URL Encoding:** Replace spaces with `%20` in URLs.
46
+
47
+ **Reference Requirements:**
48
+ - `dictionary` is REQUIRED - always include Merriam-Webster link
49
+ - `usage_context` is REQUIRED - YouGlish helps users hear real usage
50
+ - `etymology` is OPTIONAL - include for interesting origin stories
51
+ - `frequency` is OPTIONAL - include for frequency comparison
52
+
53
+ **Example:**
54
+ ```json
55
+ {
56
+ "references": {
57
+ "dictionary": {
58
+ "source": "merriam-webster",
59
+ "url": "https://www.merriam-webster.com/dictionary/touch%20base",
60
+ "note": "Official definition and usage examples"
61
+ },
62
+ "usage_context": {
63
+ "source": "youglish",
64
+ "url": "https://youglish.com/pronounce/touch%20base/english/us",
65
+ "note": "Hear it in 1000+ real YouTube videos"
66
+ }
67
+ }
68
+ }
69
+ ```
70
+
71
+ ## CONTENT GUIDELINES
72
+
73
+ ### Scene
74
+ - Describe a realistic situation where this expression is used
75
+ - Include formality level (casual/neutral/formal)
76
+ - Make it relatable to the CEFR level
77
+
78
+ ### Expressions
79
+ - Primary expression + 1-2 alternatives
80
+ - Include pronunciation tips for natural speech
81
+ - Usage notes explaining when to use
82
+
83
+ ### Chinglish Trap
84
+ - Show what Chinese speakers TYPICALLY say (the wrong version)
85
+ - Provide the correct American expression
86
+ - Explain WHY the wrong version sounds unnatural
87
+
88
+ ### Examples
89
+ - Use dialogue format with 2-3 exchanges
90
+ - Make conversations feel natural and authentic
91
+ - Include context for each dialogue
92
+
93
+ ## OUTPUT SCHEMA (JSON only)
94
+ {
95
+ "date": "{today_date}",
96
+ "topic_fingerprint": "unique_lowercase_with_underscores",
97
+ "category": "oral|written",
98
+ "topic": "{topic}",
99
+ "scene": {
100
+ "context": "Brief description of the situation",
101
+ "formality": "casual|neutral|formal"
102
+ },
103
+ "expressions": [
104
+ {
105
+ "phrase": "The American expression",
106
+ "pronunciation_tip": "How to say it naturally",
107
+ "usage_note": "When and how to use this"
108
+ }
109
+ ],
110
+ "alternatives": [
111
+ "Another way to say it 1",
112
+ "Another way to say it 2"
113
+ ],
114
+ "chinglish_trap": {
115
+ "wrong": "What Chinese speakers typically say",
116
+ "correct": "The natural American way",
117
+ "explanation": "Why the wrong version sounds off"
118
+ },
119
+ "examples": [
120
+ {
121
+ "situation": "Context for example",
122
+ "dialogue": ["Speaker A: ...", "Speaker B: ..."]
123
+ }
124
+ ],
125
+ "extended_learning": {
126
+ "related_phrases": ["phrase1", "phrase2"],
127
+ "cultural_note": "Brief cultural context",
128
+ "common_mistakes": ["mistake1"]
129
+ },
130
+ "references": {
131
+ "dictionary": {
132
+ "source": "merriam-webster",
133
+ "url": "https://www.merriam-webster.com/dictionary/{phrase}",
134
+ "note": "Definition and usage examples"
135
+ },
136
+ "usage_context": {
137
+ "source": "youglish",
138
+ "url": "https://youglish.com/pronounce/{phrase}/english/us",
139
+ "note": "Hear it in real YouTube videos"
140
+ }
141
+ },
142
+ "display": {
143
+ "title": "๐Ÿข ไปŠๆ—ฅ็Ÿฅ่ฏ†็‚น | Today's Knowledge Point",
144
+ "topic_tag": "๐Ÿท๏ธ ไธป้ข˜: **{topic_name}** | {topic_name_en}",
145
+ "formality_tag": "๐Ÿ“Š ๆญฃๅผๅบฆ: **{formality}**",
146
+ "scene_intro": "๐ŸŽฌ ๅœบๆ™ฏ | Scene",
147
+ "scene_text": "{scene_context}",
148
+ "expressions_title": "๐Ÿ’ฌ ๆ ธๅฟƒ่กจ่พพ | Key Expressions",
149
+ "expressions_formatted": [
150
+ {
151
+ "emoji": "โœจ",
152
+ "phrase": "**{phrase}**",
153
+ "phrase_plain": "{phrase}",
154
+ "pronunciation": "๐Ÿ”Š {pronunciation_tip}",
155
+ "usage": "๐Ÿ’ก {usage_note}"
156
+ }
157
+ ],
158
+ "alternatives_title": "๐Ÿ”„ ๅ…ถไป–่ฏดๆณ• | Alternatives",
159
+ "alternatives_formatted": "โ€ข **{alt_1}**\nโ€ข **{alt_2}**",
160
+ "chinglish_title": "โš ๏ธ Chinglish ้™ท้˜ฑ | Chinglish Trap",
161
+ "chinglish_formatted": "โŒ Wrong: \"{wrong}\"\nโœ… Correct: **{correct}**\n\n๐Ÿ“ {explanation}",
162
+ "examples_title": "๐Ÿ—ฃ๏ธ ๅฏน่ฏ็คบไพ‹ | Example Dialogues",
163
+ "examples_formatted": [
164
+ {
165
+ "situation_emoji": "โ˜•",
166
+ "situation": "{situation_name}",
167
+ "dialogue": "๐Ÿ’ฌ A: {line_1}\n๐Ÿ’ฌ B: {line_2}",
168
+ "key_phrase_highlight": "**{key_phrase}**"
169
+ }
170
+ ],
171
+ "extended_title": "๐Ÿ“š ๅปถไผธๅญฆไน  | Extended Learning",
172
+ "extended_formatted": "๐Ÿ”— Related: **{related_1}** | **{related_2}**\n\n๐ŸŒŽ {cultural_note}",
173
+ "references_title": "๐Ÿ“– ๆƒๅจๅ‚่€ƒ | References",
174
+ "references_formatted": "๐Ÿ“š [Merriam-Webster]({dict_url}) - {dict_note}\n๐ŸŽฌ [YouGlish]({usage_url}) - {usage_note}",
175
+ "footer": "โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€\n๐Ÿ“… {date} | ๐Ÿ“ Take the quiz to earn XP!"
176
+ }
177
+ }
178
+ ```
179
+
180
+ ---
181
+
182
+ ## 2. Quiz Generation Template
183
+
184
+ ```markdown
185
+ Based on today's knowledge point, generate a light 3-question quiz.
186
+
187
+ ## KNOWLEDGE POINT
188
+ {keypoint_json}
189
+
190
+ ## QUESTION TYPE REQUIREMENTS (3 questions total)
191
+ 1. **multiple_choice** (required): Test expression recognition - 10 XP
192
+ 2. **chinglish_fix** (required): Identify and correct Chinglish - 15 XP
193
+ 3. **fill_blank OR dialogue_completion** (random): Pick one randomly - 12 XP
194
+
195
+ ## QUESTION GUIDELINES
196
+
197
+ ### Multiple Choice (10 XP)
198
+ - 4 options (A, B, C, D)
199
+ - Only 1 correct answer
200
+ - Distractors should be plausible but clearly wrong
201
+ - Test understanding of meaning or usage
202
+
203
+ ### Chinglish Fix (15 XP)
204
+ - Show a sentence with Chinglish expressions
205
+ - Ask to identify the issue and provide correct version
206
+ - Include explanation in the answer
207
+
208
+ ### Fill in the Blank (12 XP)
209
+ - Use "___" for the blank
210
+ - Provide word bank with 3 options
211
+ - Test the main expression from the knowledge point
212
+
213
+ ### Dialogue Completion (12 XP)
214
+ - Show partial dialogue with context
215
+ - Ask what should come next
216
+ - Test natural conversation flow
217
+
218
+ ## STRICT RULES
219
+ 1. Output ONLY valid JSON - no markdown, no extra text
220
+ 2. All questions must relate to today's knowledge point
221
+ 3. Keep it light and fun - don't make questions too hard
222
+ 4. Include encouraging feedback in display fields
223
+ 5. Total XP should be around 35-40
224
+ 6. **End sentences with proper punctuation** - periods for statements, question marks for questions
225
+
226
+ ## OUTPUT SCHEMA (JSON only)
227
+ {
228
+ "quiz_date": "{today_date}",
229
+ "keypoint_fingerprint": "{fingerprint}",
230
+ "questions": [
231
+ {
232
+ "id": 1,
233
+ "type": "multiple_choice",
234
+ "question": "The question text",
235
+ "context": "Optional scenario description",
236
+ "options": ["A. ...", "B. ...", "C. ...", "D. ..."],
237
+ "correct_answer": "B",
238
+ "explanation": "Why this is correct...",
239
+ "xp_value": 10,
240
+ "display": {
241
+ "type_emoji": "๐Ÿ”ค",
242
+ "type_name": "้€‰ๆ‹ฉ้ข˜ | Multiple Choice",
243
+ "question_formatted": "๐Ÿ’ฌ {question_with_bold_key_phrase}",
244
+ "context_formatted": "๐Ÿ“ฑ {context}",
245
+ "options_formatted": ["โฌœ A. ...", "โฌœ B. ...", "โฌœ C. ...", "โฌœ D. ..."],
246
+ "correct_feedback": "โœ… Correct! **{key_phrase}** = {meaning}",
247
+ "wrong_feedback": "โŒ Not quite. **{key_phrase}** means...",
248
+ "key_phrase": "**{key_phrase}**",
249
+ "xp_display": "๐Ÿ’Ž +10 XP"
250
+ }
251
+ },
252
+ {
253
+ "id": 2,
254
+ "type": "chinglish_fix",
255
+ "question": "Identify and fix the Chinglish",
256
+ "context": "...",
257
+ "correct_answer": "...",
258
+ "explanation": "...",
259
+ "xp_value": 15,
260
+ "display": {
261
+ "type_emoji": "๐Ÿ”ง",
262
+ "type_name": "Chinglish ไฟฎๆญฃ | Fix the Chinglish",
263
+ "question_formatted": "๐Ÿ”ง {question}",
264
+ "email_formatted": "๐Ÿ“ง {email_content}",
265
+ "hint": "๐Ÿ’ก Hint: How would an American say this?",
266
+ "correct_feedback": "โœ… Fixed! **{correct_phrase}** sounds much better!",
267
+ "wrong_feedback": "โŒ '{wrong}' โ†’ **{correct}**",
268
+ "answer_formatted": "๐Ÿ“ Better: {corrected_sentence}",
269
+ "key_phrase": "**{key_phrase}**",
270
+ "xp_display": "๐Ÿ’Ž +15 XP"
271
+ }
272
+ },
273
+ {
274
+ "id": 3,
275
+ "type": "fill_blank",
276
+ "question": "Complete the sentence",
277
+ "context": "...",
278
+ "word_bank": ["option1", "option2", "option3"],
279
+ "correct_answer": "option1",
280
+ "explanation": "...",
281
+ "xp_value": 12,
282
+ "display": {
283
+ "type_emoji": "โœ๏ธ",
284
+ "type_name": "ๅกซ็ฉบ้ข˜ | Fill in the Blank",
285
+ "question_formatted": "โœ๏ธ {question}",
286
+ "context_formatted": "๐Ÿ’ผ {context_with_blank}",
287
+ "word_bank_formatted": "๐Ÿ“ฆ Word Bank: [ **{opt1}** | {opt2} | {opt3} ]",
288
+ "correct_feedback": "โœ… Perfect! **{answer}** is correct!",
289
+ "wrong_feedback": "โŒ Try **{correct_answer}** instead!",
290
+ "key_phrase": "**{key_phrase}**",
291
+ "xp_display": "๐Ÿ’Ž +12 XP"
292
+ }
293
+ }
294
+ ],
295
+ "total_xp": 37,
296
+ "passing_score": 70,
297
+ "display": {
298
+ "header": "๐Ÿ“ ไปŠๆ—ฅๆต‹้ชŒ | Daily Quiz",
299
+ "date": "๐Ÿ“… {quiz_date}",
300
+ "topic": "๐Ÿท๏ธ Topic: **{keypoint_fingerprint}**",
301
+ "instructions": "๐ŸŽฏ 3้“ๅฐ้ข˜๏ผŒ็ญ”ๅฏน2้“ๅฐฑ่ฟ‡ๅ…ณ๏ผ3 questions, get 2 right to pass!",
302
+ "progress_bar": "โฌœโฌœโฌœ 0/3 questions",
303
+ "key_phrase_summary": "๐Ÿ”‘ Key Phrase: **{key_phrase}** = {translation}",
304
+ "xp_summary": "๐Ÿ’Ž Total XP: {total_xp} | ๐Ÿ† Pass: 2/3 correct",
305
+ "footer": "โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€\n๐Ÿ’ช Good luck! ๅŠ ๆฒน! ๐Ÿš€"
306
+ }
307
+ }
308
+ ```
309
+
310
+ ---
311
+
312
+ ## 3. Topic Resource Injection
313
+
314
+ When generating content, inject topic-specific resources:
315
+
316
+ ```python
317
+ TOPIC_RESOURCES = {
318
+ "movies": """
319
+ Reference expressions from TV shows:
320
+ - Friends: "How you doin'?", "Could I BE any more...?"
321
+ - The Office: "That's what she said", "Touch base"
322
+ - Gossip Girl: "No offense", "None taken", "Done and done"
323
+ Focus on: dialogue patterns, humor, sarcasm, casual speech
324
+ """,
325
+
326
+ "news": """
327
+ Reference vocabulary from:
328
+ - CNN 10: Current events, clear explanations
329
+ - VOA: Simplified news vocabulary
330
+ Focus on: formal register, topic-specific vocabulary, clear structure
331
+ """,
332
+
333
+ "gaming": """
334
+ Reference gaming terminology:
335
+ - Core: NPC, spawn, loot, grind, level up, buff, nerf
336
+ - Multiplayer: party, squad, GG, clutch, carry
337
+ - Slang in daily use: "That was clutch", "GG"
338
+ Focus on: casual speech, slang, gaming-specific vocabulary
339
+ """,
340
+
341
+ "sports": """
342
+ Reference sports vocabulary:
343
+ - Basketball: dunk, buzzer beater, pick and roll
344
+ - Sports idioms: "step up to the plate", "ballpark figure"
345
+ Focus on: energetic expressions, idioms used in business
346
+ """,
347
+
348
+ "workplace": """
349
+ Reference workplace expressions:
350
+ - Office idioms: touch base, circle back, bandwidth
351
+ - Meeting phrases: "Let's get the ball rolling", "wrap up"
352
+ - Email language: formal yet natural
353
+ Focus on: professional communication, formal/informal switching
354
+ """,
355
+
356
+ "social": """
357
+ Reference social expressions:
358
+ - Greetings: "What's up?", "How's it going?"
359
+ - Making plans: "Let's hang out", "grab coffee"
360
+ - Casual responses: "Not much, you?", "Can't complain"
361
+ Focus on: casual speech, fillers, natural conversation flow
362
+ """,
363
+
364
+ "daily_life": """
365
+ Reference daily life expressions:
366
+ - Shopping: "Just looking", "Can I get a discount?"
367
+ - Restaurant: "I'd like the...", "Check, please"
368
+ - Services: Asking for help, making requests
369
+ Focus on: practical communication, politeness strategies
370
+ """
371
+ }
372
+ ```
373
+
374
+ ---
375
+
376
+ ## 5. CEFR Level Guidelines
377
+
378
+ Adjust content complexity based on CEFR level:
379
+
380
+ | Level | Vocabulary | Sentence Length | Topics |
381
+ |-------|------------|-----------------|--------|
382
+ | A1-A2 | Basic, high-frequency | Short, simple | Daily routines, shopping |
383
+ | B1-B2 | Intermediate, some idioms | Medium, some complex | Work, travel, social |
384
+ | C1-C2 | Advanced, nuanced | Varied, sophisticated | Abstract, professional |
385
+
386
+ ### A1-A2 Guidelines
387
+ - Use very common expressions
388
+ - Short dialogues (2-3 exchanges)
389
+ - Simple Chinglish traps
390
+ - Everyday situations
391
+
392
+ ### B1-B2 Guidelines
393
+ - Include common idioms
394
+ - Medium dialogues (3-4 exchanges)
395
+ - Nuanced Chinglish traps
396
+ - Work and social situations
397
+
398
+ ### C1-C2 Guidelines
399
+ - Complex expressions and idioms
400
+ - Longer dialogues (4+ exchanges)
401
+ - Subtle Chinglish traps (tone, formality)
402
+ - Professional and abstract topics
403
+
404
+ ---
405
+
406
+ ## 6. Tutor Style Variations
407
+
408
+ Adjust tone based on tutor_style:
409
+
410
+ ### Humorous
411
+ - Include funny examples
412
+ - Light-hearted explanations
413
+ - Pop culture references
414
+ - Jokes in cultural notes
415
+
416
+ ### Rigorous
417
+ - Detailed explanations
418
+ - Multiple examples
419
+ - Grammar focus
420
+ - Formal language
421
+
422
+ ### Casual
423
+ - Conversational tone
424
+ - Short, punchy explanations
425
+ - Everyday examples
426
+ - Slang-friendly
427
+
428
+ ### Professional
429
+ - Business-appropriate examples
430
+ - Formal language focus
431
+ - Workplace scenarios
432
+ - Email/communication tips
433
+
434
+ ---
435
+
436
+ ## 7. Emoji Display Guidelines
437
+
438
+ > Add emoji decorations to make IM conversations more engaging and scannable.
439
+
440
+ ### 7.1 Topic Emojis
441
+
442
+ | Topic | Emoji | Chinese Label |
443
+ |-------|-------|---------------|
444
+ | movies | ๐ŸŽฌ | ๅฝฑ่ง† |
445
+ | news | ๐Ÿ“ฐ | ๆ–ฐ้—ป |
446
+ | gaming | ๐ŸŽฎ | ๆธธๆˆ |
447
+ | sports | โšฝ | ไฝ“่‚ฒ |
448
+ | workplace | ๐Ÿข | ่Œๅœบ |
449
+ | social | ๐Ÿ’ฌ | ็คพไบค |
450
+ | daily_life | ๐Ÿ  | ็”Ÿๆดป |
451
+
452
+ ### 7.2 Category Emojis
453
+
454
+ | Category | Emoji |
455
+ |----------|-------|
456
+ | oral | ๐Ÿ’ฌ ๅฃ่ฏญ |
457
+ | written | โœ๏ธ ไนฆ้ข |
458
+
459
+ ### 7.3 Formality Emojis
460
+
461
+ | Formality | Emoji |
462
+ |-----------|-------|
463
+ | casual | ๐Ÿ˜Ž ้šๆ„ |
464
+ | neutral | ๐Ÿ˜ ไธญๆ€ง |
465
+ | formal | ๐Ÿคต ๆญฃๅผ |
466
+
467
+ ### 7.4 Section Emojis
468
+
469
+ | Section | Emoji | Example |
470
+ |---------|-------|---------|
471
+ | Title | ๐Ÿข | `๐Ÿข ไปŠๆ—ฅ็Ÿฅ่ฏ†็‚น \| Today's Knowledge Point` |
472
+ | Scene | ๐ŸŽฌ | `๐ŸŽฌ ๅœบๆ™ฏ \| Scene` |
473
+ | Expressions | โœจ๐Ÿ’ฌ | `โœจ Let's touch base` |
474
+ | Pronunciation | ๐Ÿ”Š | `๐Ÿ”Š Sounds like 'touch base'` |
475
+ | Usage | ๐Ÿ’ก | `๐Ÿ’ก Brief, informal check-in` |
476
+ | Alternatives | ๐Ÿ”„ | `๐Ÿ”„ ๅ…ถไป–่ฏดๆณ• \| Alternatives` |
477
+ | Chinglish | โš ๏ธโŒโœ… | `โŒ Wrong ... โœ… Correct` |
478
+ | Examples | ๐Ÿ—ฃ๏ธ๐Ÿ’ญ | `๐Ÿ—ฃ๏ธ ๅฏน่ฏ็คบไพ‹ \| Example Dialogues` |
479
+ | Extended | ๐Ÿ“š | `๐Ÿ“š ๅปถไผธๅญฆไน  \| Extended Learning` |
480
+ | Cultural | ๐ŸŒŽ | `๐ŸŒŽ Cultural Note` |
481
+ | Mistakes | ๐Ÿšซ | `๐Ÿšซ Common Mistakes` |
482
+ | Related | ๐Ÿ”— | `๐Ÿ”— Related phrases` |
483
+
484
+ ### 7.5 Quiz Type Emojis
485
+
486
+ | Question Type | Emoji | Label |
487
+ |---------------|-------|-------|
488
+ | multiple_choice | ๐Ÿ”ค | ้€‰ๆ‹ฉ้ข˜ \| Multiple Choice |
489
+ | fill_blank | โœ๏ธ | ๅกซ็ฉบ้ข˜ \| Fill in the Blank |
490
+ | dialogue_completion | ๐Ÿ’ฌ | ๅฏน่ฏ่กฅๅ…จ \| Dialogue Completion |
491
+ | chinglish_fix | ๐Ÿ”ง | Chinglish ไฟฎๆญฃ \| Fix the Chinglish |
492
+
493
+ ### 7.6 Feedback Emojis
494
+
495
+ | Feedback | Emoji | Example |
496
+ |----------|-------|---------|
497
+ | Correct | โœ… | `โœ… Correct! 'Touch base' = quick check-in` |
498
+ | Wrong | โŒ | `โŒ Not quite. Try again!` |
499
+ | XP | ๐Ÿ’Ž | `๐Ÿ’Ž +10 XP` |
500
+ | Progress | โฌœโฌœโฌœโฌœ | `โฌœโฌœโฌœโฌœ 0/4 questions` |
501
+ | Encourage | ๐Ÿ’ช๐Ÿš€ | `๐Ÿ’ช Good luck! ๅŠ ๆฒน! ๐Ÿš€` |
502
+
503
+ ### 7.7 Situation Emojis for Examples
504
+
505
+ | Situation | Emoji |
506
+ |-----------|-------|
507
+ | Morning/coffee | โ˜• |
508
+ | Email/message | ๐Ÿ“ง |
509
+ | Meeting | ๐Ÿค |
510
+ | Phone call | ๐Ÿ“ฑ |
511
+ | Office chat | ๐Ÿ’ฌ |
512
+ | Lunch break | ๐Ÿฑ |
513
+ | Slack/Teams | ๐Ÿ’ฌ |
514
+
515
+ ### 7.8 Display Object Structure
516
+
517
+ When generating content, include a `display` object with formatted strings:
518
+
519
+ ```json
520
+ {
521
+ "display": {
522
+ "title": "๐Ÿข ไปŠๆ—ฅ็Ÿฅ่ฏ†็‚น | Today's Knowledge Point",
523
+ "topic_tag": "๐Ÿท๏ธ ไธป้ข˜: ่Œๅœบๅฃ่ฏญ | Workplace Oral",
524
+ "formality_tag": "๐Ÿ“Š ๆญฃๅผๅบฆ: ไธญๆ€ง | Neutral",
525
+ "scene_intro": "๐ŸŽฌ ๅœบๆ™ฏ | Scene",
526
+ "expressions_title": "๐Ÿ’ฌ ๆ ธๅฟƒ่กจ่พพ | Key Expressions",
527
+ "chinglish_title": "โš ๏ธ Chinglish ้™ท้˜ฑ | Chinglish Trap",
528
+ "examples_title": "๐Ÿ—ฃ๏ธ ๅฏน่ฏ็คบไพ‹ | Example Dialogues",
529
+ "footer": "โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€\n๐Ÿ“… 2026-02-20 | ๐Ÿ“ Take the quiz to earn XP!"
530
+ }
531
+ }
532
+ ```
533
+
534
+ ### 7.9 Emoji Usage Rules
535
+
536
+ 1. **Keep it readable**: Don't overuse emojis; 1-2 per line maximum
537
+ 2. **Be consistent**: Use the same emoji for the same concept
538
+ 3. **Bilingual labels**: Include both Chinese and English when appropriate
539
+ 4. **Visual hierarchy**: Use emojis to create visual sections
540
+ 5. **Positive tone**: Use encouraging emojis for feedback
541
+ 6. **Cultural sensitivity**: Avoid emojis that might be confusing across cultures
542
+
543
+ ---
544
+
545
+ ## 8. Text Formatting Guidelines
546
+
547
+ > Use Markdown formatting to highlight key phrases and create visual emphasis in IM displays.
548
+
549
+ ### 8.1 Bold for Key Phrases
550
+
551
+ Use `**phrase**` for the main expressions being taught:
552
+
553
+ | Use Case | Format | Example |
554
+ |----------|--------|---------|
555
+ | Key phrase | `**touch base**` | โœจ **Let's touch base** |
556
+ | Correct answer | `**Correct: "touch base"**` | โœ… Correct: **Let's touch base!** |
557
+ | Important term | `**first mention**` | The phrase **'touch base'** comes from baseball |
558
+
559
+ ### 8.2 Wrong Answers Format (Feishu-Compatible)
560
+
561
+ > IMPORTANT: Do NOT use `~~strikethrough~~` - it doesn't work in Feishu cards. Use โŒ emoji + quotes instead.
562
+
563
+ | Use Case | Format | Example |
564
+ |----------|--------|---------|
565
+ | Wrong expression | `โŒ "discuss together"` | โŒ "Let's discuss together" |
566
+ | Chinglish | `โŒ "communicate with you"` | โŒ "I want to communicate with you" |
567
+
568
+ ### 8.3 Formatting Combinations
569
+
570
+ Combine formatting with emojis for maximum impact:
571
+
572
+ ```
573
+ โŒ Wrong: "Let's discuss together."
574
+ โœ… Correct: **Let's touch base!**
575
+
576
+ ๐Ÿ’ฌ A: "Can we **touch base** on those mockups?"
577
+ ```
578
+
579
+ ### 8.4 Key Phrase Highlighting in Dialogues
580
+
581
+ In examples, always highlight the key phrase:
582
+
583
+ ```json
584
+ {
585
+ "dialogue": "๐Ÿ’ฌ A: Hey, can we **touch base** on those mockups?\n๐Ÿ’ฌ B: Sure, I'll swing by after lunch.",
586
+ "key_phrase_highlight": "**touch base**"
587
+ }
588
+ ```
589
+
590
+ ### 8.5 Display Object Fields for Formatting
591
+
592
+ | Field | Purpose | Example |
593
+ |-------|---------|---------|
594
+ | `phrase` | Bold key phrase | `**Let's touch base**` |
595
+ | `phrase_plain` | Unformatted version | `Let's touch base` |
596
+ | `key_phrase` | Question key phrase | `**touch base**` |
597
+ | `key_phrase_highlight` | Highlighted in context | `**touch base**` |
598
+ | `correct_pattern` | Pattern explanation | `**Agree + suggest time**` |
599
+ | `key_phrase_summary` | Quiz summary | `๐Ÿ”‘ Key Phrase: **touch base** = ๅฟซ้€ŸๆฒŸ้€š` |
600
+
601
+ ### 8.6 Formatting Rules
602
+
603
+ 1. **Bold all key phrases** in display sections
604
+ 2. **Use โŒ emoji for wrong answers** in Chinglish traps and quizzes (NOT strikethrough)
605
+ 3. **Keep original text** in data fields (phrase, alternatives, etc.)
606
+ 4. **Add formatting only** in display fields
607
+ 5. **Be consistent** - always format the same phrase the same way
608
+ 6. **Don't over-format** - only highlight the key learning points
609
+
610
+ ---
611
+
612
+ ## 9. Initialization Flow Templates
613
+
614
+ > Templates for the 6-step onboarding process when a new user starts.
615
+
616
+ ### 9.1 Welcome Message (Step 0)
617
+
618
+ ```json
619
+ {
620
+ "type": "init_welcome",
621
+ "step": 0,
622
+ "display": {
623
+ "title": "๐Ÿ‘‹ Welcome to American English Tutor!",
624
+ "message": "Hi! I'm your personal English tutor. I'll help you learn authentic American expressions that native speakers actually use.\n\nLet me ask you a few questions to personalize your learning experience.",
625
+ "prompt": "Ready to get started? Reply with **start** or **ๅผ€ๅง‹** to begin.",
626
+ "footer": "โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€\n๐ŸŽฏ This takes about 2 minutes"
627
+ }
628
+ }
629
+ ```
630
+
631
+ ### 9.2 CEFR Level Selection (Step 1)
632
+
633
+ ```json
634
+ {
635
+ "type": "init_cefr",
636
+ "step": 1,
637
+ "display": {
638
+ "title": "๐Ÿ“Š Step 1/5: Your English Level",
639
+ "message": "What's your current English level?",
640
+ "options": [
641
+ "**A1-A2**: Beginner - Basic conversations, everyday words",
642
+ "**B1-B2**: Intermediate - Work conversations, some idioms",
643
+ "**C1-C2**: Advanced - Complex topics, nuanced expressions"
644
+ ],
645
+ "prompt": "Reply with your level (e.g., **B1**, **B2**, **C1**)",
646
+ "hint": "๐Ÿ’ก Not sure? Most working professionals are B1-B2. You can change this later."
647
+ }
648
+ }
649
+ ```
650
+
651
+ ### 9.3 Topic Preferences (Step 2)
652
+
653
+ ```json
654
+ {
655
+ "type": "init_topics",
656
+ "step": 2,
657
+ "display": {
658
+ "title": "๐ŸŽฏ Step 2/5: Your Interests",
659
+ "message": "Which topics interest you most?",
660
+ "topics": [
661
+ "๐ŸŽฌ movies - TV shows, films",
662
+ "๐Ÿ“ฐ news - Current events",
663
+ "๐ŸŽฎ gaming - Video games",
664
+ "โšฝ sports - Sports & fitness",
665
+ "๐Ÿข workplace - Office & business",
666
+ "๐Ÿ’ฌ social - Friends & parties",
667
+ "๐Ÿ  daily_life - Shopping, restaurants"
668
+ ],
669
+ "prompt": "List your interests (e.g., **movies workplace gaming**)",
670
+ "example": "Example: **movies workplace gaming**"
671
+ }
672
+ }
673
+ ```
674
+
675
+ ### 9.4 Tutor Style (Step 3)
676
+
677
+ ```json
678
+ {
679
+ "type": "init_style",
680
+ "step": 3,
681
+ "display": {
682
+ "title": "๐ŸŽญ Step 3/5: Tutor Style",
683
+ "message": "How should I teach you?",
684
+ "options": [
685
+ "๐Ÿ˜„ **humorous** - Fun examples, jokes, pop culture",
686
+ "๐Ÿ“š **rigorous** - Detailed explanations, grammar focus",
687
+ "๐Ÿ˜Ž **casual** - Short & sweet, everyday language",
688
+ "๐Ÿ‘” **professional** - Business-focused, formal contexts"
689
+ ],
690
+ "prompt": "Reply with: **humorous**, **rigorous**, **casual**, or **professional**"
691
+ }
692
+ }
693
+ ```
694
+
695
+ ### 9.5 Oral/Written Ratio (Step 4)
696
+
697
+ ```json
698
+ {
699
+ "type": "init_ratio",
700
+ "step": 4,
701
+ "display": {
702
+ "title": "๐Ÿ’ฌ Step 4/5: Speaking vs Writing",
703
+ "message": "What do you want to focus on?",
704
+ "options": [
705
+ "๐Ÿ—ฃ๏ธ **Mostly speaking** - Daily conversations, casual chat",
706
+ "โš–๏ธ **Balanced** - Mix of speaking and writing",
707
+ "โœ๏ธ **Mostly writing** - Emails, formal documents"
708
+ ],
709
+ "prompt": "Reply with a number 0-100 for speaking focus (e.g., **70** = 70% speaking)"
710
+ }
711
+ }
712
+ ```
713
+
714
+ ### 9.6 Schedule Configuration (Step 5)
715
+
716
+ ```json
717
+ {
718
+ "type": "init_schedule",
719
+ "step": 5,
720
+ "display": {
721
+ "title": "โฐ Step 5/5: Schedule Your Learning",
722
+ "message": "When should I send you daily content?",
723
+ "defaults": {
724
+ "keypoint": "โ˜€๏ธ **Keypoint** (morning lesson): Default **06:45**",
725
+ "quiz": "๐ŸŒ™ **Quiz** (evening practice): Default **22:45**"
726
+ },
727
+ "prompt": "Reply with times in 24-hour format (e.g., **07:00 21:30**) or press Enter for defaults.",
728
+ "hint": "๐Ÿ’ก Quiz time must be later than keypoint time. Example: '07:00 21:30' or just press Enter for defaults."
729
+ }
730
+ }
731
+ ```
732
+
733
+ **Validation Rules:**
734
+ - Both times must be in HH:MM format (24-hour)
735
+ - Quiz time must be later than keypoint time
736
+ - If user only provides one time, ask for the second
737
+ - If invalid format, show error and re-prompt
738
+
739
+ ### 9.7 Confirmation (Step 6)
740
+
741
+ ```json
742
+ {
743
+ "type": "init_confirm",
744
+ "step": 6,
745
+ "display": {
746
+ "title": "โœ… All Set! Here's Your Profile:",
747
+ "summary": {
748
+ "level": "๐Ÿ“Š Level: {cefr_level}",
749
+ "topics": "๐ŸŽฏ Topics: {top_topics}",
750
+ "style": "๐ŸŽญ Style: {tutor_style}",
751
+ "focus": "๐Ÿ’ฌ Focus: {oral_ratio}% speaking",
752
+ "schedule": "โฐ Schedule: Keypoint at {keypoint_time}, Quiz at {quiz_time}"
753
+ },
754
+ "prompt": "Does this look right? Reply **yes** to confirm or **change** to adjust.",
755
+ "footer": "โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€\n๐Ÿš€ Your first lesson starts tomorrow!"
756
+ }
757
+ }
758
+ ```
759
+
760
+ ### 9.8 Completion
761
+
762
+ ```json
763
+ {
764
+ "type": "init_complete",
765
+ "display": {
766
+ "title": "๐ŸŽ‰ Welcome Aboard!",
767
+ "message": "You're all set! Here's what happens next:\n\n"
768
+ "โ˜€๏ธ **{keypoint_time}** - Daily knowledge point\n"
769
+ "๐ŸŒ™ **{quiz_time}** - Daily quiz",
770
+ "cron_setup": "I'll create cron jobs for your schedule now. You can change this anytime with the **schedule** command.",
771
+ "first_lesson": "Want your first lesson now? Reply **keypoint** or **็Ÿฅ่ฏ†็‚น**",
772
+ "footer": "โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€\n๐Ÿ’ก Say **help** anytime to see all commands"
773
+ }
774
+ }
775
+ ```
776
+
777
+ **Cron Job Creation (after Step 6 confirmation):**
778
+
779
+ After user confirms with "yes", MUST execute the following bash commands to create cron jobs:
780
+
781
+ ```bash
782
+ # Parse times from schedule
783
+ KEYPOINT_TIME="06:45" # Default, replace with user's keypoint_time
784
+ QUIZ_TIME="22:45" # Default, replace with user's quiz_time
785
+
786
+ # Extract hour and minute
787
+ KEYPOINT_HOUR=$(echo $KEYPOINT_TIME | cut -d: -f1)
788
+ KEYPOINT_MIN=$(echo $KEYPOINT_TIME | cut -d: -f2)
789
+ QUIZ_HOUR=$(echo $QUIZ_TIME | cut -d: -f1)
790
+ QUIZ_MIN=$(echo $QUIZ_TIME | cut -d: -f2)
791
+
792
+ # Create cron jobs using openclaw
793
+ # Keypoint job
794
+ ${KEYPOINT_MIN} ${KEYPOINT_HOUR} * * * openclaw system event --text "Use eng-lang-tutor skill. Push today's keypoint." --mode now
795
+
796
+ # Quiz job
797
+ ${QUIZ_MIN} ${QUIZ_HOUR} * * * openclaw system event --text "Use eng-lang-tutor skill. Push today's quiz invitation." --mode now
798
+ ```
799
+
800
+ **IMPORTANT:** The cron job creation requires:
801
+ 1. Parse user's `keypoint_time` and `quiz_time` from state.json schedule
802
+ 2. Execute the bash command to register each cron job
803
+ 3. Log the event using `state_manager.py append_event`
804
+
805
+ ---
806
+
807
+ ## 10. Response Templates
808
+
809
+ > Templates for various response scenarios.
810
+
811
+ ### 10.1 Already Completed Responses
812
+
813
+ ```json
814
+ {
815
+ "quiz_already_done": {
816
+ "display": {
817
+ "title": "โœ… Already Completed!",
818
+ "message": "You've already finished today's quiz. Great job! ๐ŸŽ‰",
819
+ "stats": "Your score: {score}/{total} | XP earned: {xp}",
820
+ "next_quiz": "Come back tomorrow at 10:45 PM for a new quiz!",
821
+ "alternative": "๐Ÿ’ก Want to review? Say **errors** to see your wrong answers."
822
+ }
823
+ }
824
+ }
825
+ ```
826
+
827
+ ### 10.2 Not Available Responses
828
+
829
+ ```json
830
+ {
831
+ "keypoint_not_found": {
832
+ "display": {
833
+ "title": "๐Ÿ“… No Keypoint Found",
834
+ "message": "No knowledge point exists for {date}.",
835
+ "hint": "Try **keypoint today** for today's content.",
836
+ "history": "Or say **keypoint history** to see recent keypoints."
837
+ }
838
+ },
839
+ "quiz_not_ready": {
840
+ "display": {
841
+ "title": "โฐ Quiz Not Ready Yet",
842
+ "message": "Today's quiz will be available at 10:45 PM.",
843
+ "alternative": "Want to study? Say **keypoint** to review today's content!"
844
+ }
845
+ }
846
+ }
847
+ ```
848
+
849
+ ### 10.2.1 Keypoint History Response
850
+
851
+ **When user says:** `keypoint history`, `็Ÿฅ่ฏ†็‚น ๅކๅฒ`, `ๆ˜จๅคฉ`, `yesterday`
852
+
853
+ **Logic:**
854
+ 1. Scan `data/daily/` directory for all `YYYY-MM-DD/keypoint.json` files
855
+ 2. Sort by date descending (most recent first)
856
+ 3. Extract `display.title` or `topic` from each keypoint
857
+
858
+ **Empty History Response:**
859
+ ```markdown
860
+ ๐Ÿ“š **็Ÿฅ่ฏ†็‚นๅކๅฒ่ฎฐๅฝ•**
861
+
862
+ ๆš‚ๆ— ๅކๅฒ่ฎฐๅฝ•ใ€‚ไปŽไปŠๅคฉๅผ€ๅง‹ๅญฆไน ๅง๏ผ
863
+
864
+ ๐Ÿ’ก ่พ“ๅ…ฅ **keypoint** ๆˆ– **็Ÿฅ่ฏ†็‚น** ่Žทๅ–ไปŠๆ—ฅๅ†…ๅฎน
865
+ ```
866
+
867
+ **With History Response:**
868
+ ```markdown
869
+ ๐Ÿ“š **็Ÿฅ่ฏ†็‚นๅކๅฒ่ฎฐๅฝ•**
870
+
871
+ | ๆ—ฅๆœŸ | ไธป้ข˜ |
872
+ |------|------|
873
+ | 2026-02-21 | ๐Ÿข Touch Base - ๅทฅไฝœๆฒŸ้€š |
874
+ | 2026-02-20 | ๐ŸŽฎ GG - ๆธธๆˆ็”จ่ฏญ |
875
+ | 2026-02-19 | ๐Ÿ—ฃ๏ธ Gonna/Wanna - ๅฃ่ฏญ็ผฉๅ†™ |
876
+
877
+ ๐Ÿ’ก ่พ“ๅ…ฅ **keypoint ๆ—ฅๆœŸ** ๆŸฅ็œ‹่ฏฆๆƒ…๏ผŒๅฆ‚ `keypoint 2026-02-20`
878
+ ```
879
+
880
+ **CRITICAL:** The history list is populated from persisted `data/daily/YYYY-MM-DD/keypoint.json` files. If keypoints are not saved to this location, history will be empty.
881
+
882
+ ### 10.3 Keypoint Display Template
883
+
884
+ > IMPORTANT: Use `**text**` for bold. Never use `~~strikethrough~~`. Output Markdown text directly, NOT JSON.
885
+
886
+ **Assembly Flow:**
887
+
888
+ When displaying a keypoint, read the `display` object and assemble fields in this order:
889
+
890
+ ```markdown
891
+ {title}
892
+
893
+ | ไธป้ข˜ | **{topic_name}** |
894
+ |------|------------------|
895
+ | ๆญฃๅผๅบฆ | **{formality}** |
896
+
897
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
898
+ {scene_intro}
899
+
900
+ {scene_text}
901
+
902
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
903
+ {expressions_title}
904
+
905
+ {for each item in expressions_formatted:
906
+ {emoji} {phrase}
907
+ {pronunciation}
908
+ {usage}
909
+
910
+ }
911
+
912
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
913
+ {alternatives_title}
914
+
915
+ {alternatives_formatted}
916
+
917
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
918
+ {chinglish_title}
919
+
920
+ {chinglish_formatted}
921
+
922
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
923
+ {examples_title}
924
+
925
+ {for each item in examples_formatted:
926
+ {situation_emoji} {situation}
927
+ {dialogue}
928
+
929
+ }
930
+
931
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
932
+ {extended_title}
933
+
934
+ {extended_formatted}
935
+
936
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
937
+ {references_title}
938
+
939
+ {references_formatted}
940
+
941
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
942
+ {footer}
943
+ ```
944
+
945
+ **Display Object Structure (for generation):**
946
+
947
+ ```json
948
+ {
949
+ "display": {
950
+ "title": "๐Ÿข ไปŠๆ—ฅ็Ÿฅ่ฏ†็‚น | Today's Knowledge Point",
951
+ "topic_tag": "๐Ÿท๏ธ ไธป้ข˜: **{topic_name}** | {topic_name_en}",
952
+ "formality_tag": "๐Ÿ“Š ๆญฃๅผๅบฆ: **{formality}**",
953
+ "scene_intro": "๐ŸŽฌ ๅœบๆ™ฏ | Scene",
954
+ "scene_text": "{scene_context}",
955
+ "expressions_title": "๐Ÿ’ฌ ๆ ธๅฟƒ่กจ่พพ | Key Expressions",
956
+ "expressions_formatted": [
957
+ {
958
+ "emoji": "โœจ",
959
+ "phrase": "**{phrase}**",
960
+ "pronunciation": "๐Ÿ”Š {pronunciation_tip}",
961
+ "usage": "๐Ÿ’ก {usage_note}"
962
+ }
963
+ ],
964
+ "alternatives_title": "๐Ÿ”„ ๅ…ถไป–่ฏดๆณ• | Alternatives",
965
+ "alternatives_formatted": "โ€ข **{alt_1}**\nโ€ข **{alt_2}**",
966
+ "chinglish_title": "โš ๏ธ Chinglish ้™ท้˜ฑ | Chinglish Trap",
967
+ "chinglish_formatted": "โŒ Wrong: \"{wrong}\"\nโœ… Correct: **{correct}**\n\n๐Ÿ“ {explanation}",
968
+ "examples_title": "๐Ÿ—ฃ๏ธ ๅฏน่ฏ็คบไพ‹ | Example Dialogues",
969
+ "examples_formatted": [
970
+ {
971
+ "situation_emoji": "โ˜•",
972
+ "situation": "{situation_name}",
973
+ "dialogue": "๐Ÿ’ฌ A: {line_1}\n๐Ÿ’ฌ B: {line_2}",
974
+ "key_phrase_highlight": "**{key_phrase}**"
975
+ }
976
+ ],
977
+ "extended_title": "๐Ÿ“š ๅปถไผธๅญฆไน  | Extended Learning",
978
+ "extended_formatted": "๐Ÿ”— Related: **{related_1}** | **{related_2}**\n\n๐ŸŒŽ {cultural_note}",
979
+ "references_title": "๐Ÿ“– ๆƒๅจๅ‚่€ƒ | References",
980
+ "references_formatted": "๐Ÿ“š [{dict_source}]({dict_url}) - {dict_note}\n๐ŸŽฌ [{usage_source}]({usage_url}) - {usage_note}",
981
+ "footer": "โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€\n๐Ÿ“… {date} | ๐Ÿ“ Take the quiz to earn XP!"
982
+ }
983
+ }
984
+ ```
985
+
986
+ **Variables:**
987
+ - `{topic_name}`: Chinese topic name (e.g., ่Œๅœบๅฃ่ฏญ)
988
+ - `{topic_name_en}`: English topic name (e.g., Workplace Oral)
989
+ - `{formality}`: Formality level (้šๆ„/ไธญๆ€ง/ๆญฃๅผ)
990
+ - `{scene_context}`: Brief scene description
991
+ - `{phrase}`: Key expression phrase
992
+ - `{pronunciation_tip}`: Pronunciation tips
993
+ - `{usage_note}`: Usage notes
994
+ - `{alt_N}`: Alternative expressions
995
+ - `{wrong}`: The Chinglish/wrong expression
996
+ - `{correct}`: The correct American expression
997
+ - `{explanation}`: Why the wrong version is wrong
998
+ - `{situation_name}`: Example situation
999
+ - `{dialogue}`: Dialogue with **bold** key phrases
1000
+ - `{related_N}`: Related phrases
1001
+ - `{dict_source}`: Dictionary source name (e.g., Merriam-Webster)
1002
+ - `{dict_url}`: Dictionary URL
1003
+ - `{dict_note}`: Brief note about dictionary entry
1004
+ - `{usage_source}`: Usage context source name (e.g., YouGlish)
1005
+ - `{usage_url}`: Usage context URL
1006
+ - `{usage_note}`: Brief note about usage examples
1007
+
1008
+ ### 10.4 Stats Display Template
1009
+
1010
+ > IMPORTANT: Output Markdown text directly, NOT JSON. Read from state.json and format as shown.
1011
+
1012
+ **Data Source:** `data/state.json`
1013
+
1014
+ **Fields to Read:**
1015
+ - `user.xp` โ†’ current XP
1016
+ - `user.streak` โ†’ streak days
1017
+ - `user.level` โ†’ activity level (1-20)
1018
+ - `user.gems` โ†’ gems count
1019
+ - `progress.correct_rate` โ†’ accuracy percentage
1020
+ - `progress.badges` โ†’ earned badges list
1021
+
1022
+ **Markdown Output Format:**
1023
+
1024
+ ```markdown
1025
+ ๐Ÿ“Š **Your Learning Progress**
1026
+
1027
+ โ€ข ็ญ‰็บง: **{level}** ({level_name})
1028
+ โ€ข XP: **{current_xp}** / {next_level_xp} (**{progress}%**)
1029
+ โ€ข ่ฟž่ƒœ: **{streak}** ๅคฉ (ๅ€ๆ•ฐ: **{multiplier}x**)
1030
+ โ€ข ๆญฃ็กฎ็އ: **{correct_rate}%**
1031
+ โ€ข ๅพฝ็ซ : **{badges_count}**/6
1032
+ โ€ข ๅฎ็Ÿณ: **{gems}**
1033
+
1034
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
1035
+ Keep it up! ๐Ÿ’ช
1036
+ ```
1037
+
1038
+ **Level Names:**
1039
+ - Level 1-5: Starter (ๅฏ็จ‹่€…)
1040
+ - Level 6-10: Traveler (่กŒ่ทฏไบบ)
1041
+ - Level 11-15: Explorer (ๆŽข็ดข่€…)
1042
+ - Level 16-20: Pioneer (ๅผ€ๆ‹“่€…)
1043
+
1044
+ **Multiplier Calculation:** `1.0 + (streak * 0.05)`, max 2.0x
1045
+
1046
+ ### 10.5 Config Display Template
1047
+
1048
+ > IMPORTANT: Output Markdown text directly, NOT JSON. Read from state.json and format as shown.
1049
+
1050
+ **Data Source:** `data/state.json`
1051
+
1052
+ **Fields to Read:**
1053
+ - `preferences.cefr_level` โ†’ CEFR level (A1-C2)
1054
+ - `preferences.topic_weights` โ†’ topic preferences with weights
1055
+ - `preferences.tutor_style` โ†’ tutor style
1056
+ - `preferences.oral_ratio` โ†’ speaking focus percentage
1057
+ - `schedule.keypoint_time` โ†’ keypoint push time
1058
+ - `schedule.quiz_time` โ†’ quiz push time
1059
+
1060
+ **Markdown Output Format:**
1061
+
1062
+ ```markdown
1063
+ โš™๏ธ **Your Settings**
1064
+
1065
+ โ€ข CEFR ็ญ‰็บง: **{cefr_level}**
1066
+ โ€ข ไธป้ข˜ๅๅฅฝ: **{topics_list}**
1067
+ โ€ข ๅฏผๅธˆ้ฃŽๆ ผ: **{tutor_style}**
1068
+ โ€ข ๅฃ่ฏญๅ ๆฏ”: **{oral_ratio}%**
1069
+ โ€ข ็Ÿฅ่ฏ†็‚นๆŽจ้€: **{keypoint_time}**
1070
+ โ€ข Quiz ๆŽจ้€: **{quiz_time}**
1071
+
1072
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
1073
+ ๐Ÿ’ก Say **set level B2** to change your level
1074
+ ```
1075
+
1076
+ ### 10.6 Errors Display Template (Paginated)
1077
+
1078
+ > IMPORTANT: Output Markdown text directly, NOT JSON. Read from state.json error_notebook and format as shown.
1079
+
1080
+ **Data Source:** `data/state.json` โ†’ `error_notebook` array
1081
+
1082
+ **Fields to Read:**
1083
+ - `error_notebook` โ†’ array of error records
1084
+ - Each error has: `date`, `question`, `user_answer`, `correct_answer`, `reviewed`
1085
+
1086
+ **Markdown Output Format:**
1087
+
1088
+ ```markdown
1089
+ ๐Ÿ““ **Error Notebook**
1090
+
1091
+ ๐Ÿ“Š ็ปŸ่ฎก: **{total}** ๆก้”™้ข˜ (ๆœชๅคไน : **{unreviewed}**)
1092
+
1093
+ โŒ ๆœ€่ฟ‘ **5** ๆก:
1094
+
1095
+ **{date_1}**
1096
+ Q: {question_1}
1097
+ Your answer: {user_answer_1}
1098
+ โœ… Correct: **{correct_answer_1}**
1099
+
1100
+ **{date_2}**
1101
+ Q: {question_2}
1102
+ Your answer: {user_answer_2}
1103
+ โœ… Correct: **{correct_answer_2}**
1104
+
1105
+ [ๆ˜พ็คบ 5 ๆก๏ผŒ็ฌฌ 1/{total_pages} ้กต]
1106
+
1107
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
1108
+ ๐Ÿ“„ ่พ“ๅ…ฅ **"้”™้ข˜ๆœฌ ๆ›ดๅคš"** ๆŸฅ็œ‹ไธ‹5ๆก
1109
+ ๐Ÿ“„ ่พ“ๅ…ฅ **"้”™้ข˜ๆœฌ 2026-02"** ๆŸฅ็œ‹็‰นๅฎšๆœˆไปฝ
1110
+ ๐Ÿ“„ ่พ“ๅ…ฅ **"้”™้ข˜ๆœฌ ้šๆœบ5"** ้šๆœบๅคไน 5ๆก
1111
+ ๐Ÿ“„ ่พ“ๅ…ฅ **"้”™้ข˜ๆœฌ ็ปŸ่ฎก"** ๆŸฅ็œ‹ๅฎŒๆ•ด็ปŸ่ฎก
1112
+ ๐Ÿ“„ ่พ“ๅ…ฅ **"้”™้ข˜ๆœฌ ๅคไน "** ๅผ€ๅง‹้”™้ข˜ๅคไน 
1113
+ ```
1114
+
1115
+ **Pagination Commands:**
1116
+ - `errors` / `้”™้ข˜ๆœฌ` โ†’ Show recent 5 errors
1117
+ - `errors more` / `้”™้ข˜ๆœฌ ๆ›ดๅคš` โ†’ Next 5 errors
1118
+ - `errors page N` โ†’ Go to page N
1119
+ - `errors 2026-02` โ†’ Filter by month
1120
+ - `errors random 5` โ†’ Random 5 for review
1121
+ - `errors stats` โ†’ Show statistics only
1122
+ - `errors review` โ†’ Start interactive review
1123
+
1124
+ ### 10.7 Error Review Session Template
1125
+
1126
+ > IMPORTANT: Output Markdown text directly, NOT JSON. Error review gives NO XP.
1127
+
1128
+ **Question Display:**
1129
+ ```markdown
1130
+ ๐Ÿ““ **้”™้ข˜ๅคไน **
1131
+
1132
+ ๐Ÿ“Š ่ฟ›ๅบฆ: **{current}/{total}**
1133
+
1134
+ **Q:** {question}
1135
+ A. {option_a}
1136
+ B. {option_b}
1137
+ C. {option_c}
1138
+ D. {option_d}
1139
+
1140
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
1141
+ ๐Ÿ’ก ่พ“ๅ…ฅ **A/B/C/D** ไฝœ็ญ”
1142
+ ```
1143
+
1144
+ **Correct Answer Response:**
1145
+ ```markdown
1146
+ โœ… **ๆญฃ็กฎ๏ผ**
1147
+
1148
+ ๐ŸŽฏ **{correct_answer}** ๆ˜ฏๅœฐ้“็š„่กจ่พพ๏ผ
1149
+
1150
+ ๐Ÿ“Š ๆœฌ้ข˜ๅทฒไปŽ้”™้ข˜ๆœฌไธญ็งป้™ค โœ“
1151
+
1152
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
1153
+ ๐Ÿ“ ็ปง็ปญไธ‹ไธ€้ข˜๏ผŸ่พ“ๅ…ฅ **็ปง็ปญ**
1154
+ ```
1155
+
1156
+ **Wrong Answer Response:**
1157
+ ```markdown
1158
+ โŒ **้”™่ฏฏ๏ผ**
1159
+
1160
+ โœ… ๆญฃ็กฎ็ญ”ๆกˆ: **{correct_answer}**
1161
+
1162
+ ๐Ÿ“ {explanation}
1163
+
1164
+ ๐Ÿ“Š ๆœฌ้ข˜้”™่ฏฏๆฌกๆ•ฐ๏ผš**{wrong_count}**
1165
+
1166
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
1167
+ ๐Ÿ“ ็ปง็ปญไธ‹ไธ€้ข˜๏ผŸ่พ“ๅ…ฅ **็ปง็ปญ**
1168
+ ```
1169
+
1170
+ **Review Complete Summary:**
1171
+ ```markdown
1172
+ ๐Ÿ““ **้”™้ข˜ๅคไน ๅฎŒๆˆ๏ผ**
1173
+
1174
+ โ€ข ๆœฌๆฌกๆญฃ็กฎ็އ: **{correct}/{total}**
1175
+ โ€ข ๅทฒๆธ…้™ค: **{cleared}** ้“้”™้ข˜
1176
+ โ€ข ไป้œ€ๅคไน : **{remaining}** ้“้”™้ข˜
1177
+ โ€ข Error Slayer ่ฟ›ๅบฆ: **{progress}/30**
1178
+
1179
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
1180
+ ๐Ÿ’ช ็ปง็ปญๅŠ ๆฒน๏ผ่พ“ๅ…ฅ **้”™้ข˜ๆœฌ ๅคไน ** ๅ†ๆฌกๆŒ‘ๆˆ˜
1181
+ ```
1182
+
1183
+ **Variables:**
1184
+ - `{current}`: Current question number
1185
+ - `{total}`: Total questions in session (default 5)
1186
+ - `{wrong_count}`: Number of times this question was answered incorrectly
1187
+ - `{cleared}`: Number of errors cleared this session
1188
+ - `{remaining}`: Number of errors still needing review
1189
+ - `{progress}`: Current progress toward Error Slayer badge
1190
+
1191
+ ### 10.8 Quiz Result Display Template
1192
+
1193
+ > IMPORTANT: Output Markdown text directly, NOT JSON. Calculate XP from quiz answers.
1194
+
1195
+ **Markdown Output Format:**
1196
+
1197
+ ```markdown
1198
+ ๐Ÿ“Š **Quiz Results**
1199
+
1200
+ โ€ข ๅˆ†ๆ•ฐ: **{correct}/{total}** (**{accuracy}%**)
1201
+ โ€ข ็Šถๆ€: {status_emoji} {status_text}
1202
+ โ€ข XP ่Žทๅพ—: **+{total_xp} XP**
1203
+ โ€ข ่ฟž่ƒœ: **{old_streak}** โ†’ **{new_streak}** ๅคฉ
1204
+ โ€ข ๆ€ป XP: **{total_xp_earned}**
1205
+
1206
+ ๐Ÿ’Ž XP ๆ˜Ž็ป†:
1207
+ โ€ข Base: **{base_xp} XP**
1208
+ โ€ข Streak Bonus: **{multiplier}x** ({streak} day streak)
1209
+ {perfect_bonus}
1210
+
1211
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
1212
+ ๐Ÿ“ Come back tomorrow for a new quiz!
1213
+ ```
1214
+
1215
+ **Variables:**
1216
+ - `{status_emoji}`: โœ… for passed, โŒ for failed
1217
+ - `{status_text}`: "Passed! Great job! ๐ŸŽ‰" or "Keep trying! ๐Ÿ’ช"
1218
+ - `{perfect_bonus}`: "โ€ข Perfect Bonus: **+20 XP**" (only if 100% correct)
1219
+
1220
+ ### 10.9 Output Format Rules
1221
+
1222
+ > CRITICAL: All responses must use platform-agnostic Markdown. OpenClaw handles platform-specific conversions.
1223
+
1224
+ **Universal Markdown Format:**
1225
+
1226
+ Output standard Markdown that works across all platforms (Feishu, Discord, Telegram, Slack):
1227
+
1228
+ ```markdown
1229
+ ๐Ÿข **Title Here**
1230
+
1231
+ **Label:** Value
1232
+
1233
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
1234
+
1235
+ ๐Ÿ“ **Section Title**
1236
+
1237
+ Content with **bold** and [links](url).
1238
+
1239
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
1240
+
1241
+ ๐Ÿ“… Footer info
1242
+ ```
1243
+
1244
+ **Rules:**
1245
+
1246
+ 1. **Use standard Markdown** - Compatible with all platforms
1247
+ 2. **Bold syntax**: Use `**text**` for bold
1248
+ 3. **Never use** `~~strikethrough~~` - use โŒ emoji instead
1249
+ 4. **Line breaks**: Use blank lines between sections
1250
+ 5. **Bullets**: Use `โ€ข` for bullet points
1251
+ 6. **Emojis**: Include at the start of each section
1252
+ 7. **Punctuation**: End sentences properly (`.` or `?` or `!`)
1253
+ 8. **Links**: Use `[text](url)` format
1254
+
1255
+ **Platform Compatibility:**
1256
+
1257
+ | Syntax | Feishu | Discord | Telegram | Slack |
1258
+ |--------|--------|---------|----------|-------|
1259
+ | `**bold**` | โœ… | โœ… | โœ… | โœ… |
1260
+ | `[link](url)` | โœ… | โœ… | โœ… | โœ… |
1261
+ | Emoji | โœ… | โœ… | โœ… | โœ… |