@rookiestar/eng-lang-tutor 1.0.2 → 1.0.4
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.
- package/CLAUDE.md +5 -4
- package/README.md +16 -1
- package/README_EN.md +16 -1
- package/SKILL.md +113 -92
- package/docs/OPENCLAW_DEPLOYMENT.md +7 -4
- package/package.json +1 -1
- package/requirements.txt +2 -0
- package/scripts/__pycache__/audio_composer.cpython-313.pyc +0 -0
- package/scripts/__pycache__/audio_converter.cpython-313.pyc +0 -0
- package/scripts/__pycache__/audio_enhancer.cpython-313.pyc +0 -0
- package/scripts/__pycache__/state_manager.cpython-313.pyc +0 -0
- package/scripts/__pycache__/utils.cpython-313.pyc +0 -0
- package/scripts/audio_composer.py +389 -0
- package/scripts/audio_converter.py +245 -0
- package/scripts/cli.py +223 -0
- package/scripts/constants.py +56 -0
- package/scripts/feishu_voice.py +421 -0
- package/scripts/gamification.py +48 -34
- package/scripts/scorer.py +14 -32
- package/scripts/state_manager.py +131 -207
- package/scripts/tts/__pycache__/__init__.cpython-313.pyc +0 -0
- package/scripts/tts/__pycache__/base.cpython-313.pyc +0 -0
- package/scripts/tts/__pycache__/manager.cpython-313.pyc +0 -0
- package/scripts/tts/manager.py +14 -4
- package/scripts/tts/providers/__pycache__/__init__.cpython-313.pyc +0 -0
- package/scripts/tts/providers/__pycache__/xunfei.cpython-313.pyc +0 -0
- package/scripts/tts/providers/xunfei.py +10 -1
- package/scripts/utils.py +78 -0
- package/templates/prompt_templates.md +47 -1235
- package/templates/prompts/display_guide.md +106 -0
- package/templates/prompts/initialization.md +213 -0
- package/templates/prompts/keypoint_generation.md +268 -0
- package/templates/prompts/output_rules.md +106 -0
- package/templates/prompts/quiz_generation.md +187 -0
- package/templates/prompts/responses.md +291 -0
- package/templates/prompts/shared_enums.md +97 -0
- package/templates/state_schema.json +1 -6
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Emoji & Text Formatting Guide
|
|
2
|
+
|
|
3
|
+
> Guidelines for emoji decorations and markdown formatting in IM displays.
|
|
4
|
+
> Makes content more engaging, scannable, and visually consistent.
|
|
5
|
+
|
|
6
|
+
**Related Files:**
|
|
7
|
+
- [shared_enums.md](shared_enums.md) - Topic, category, formality, quiz type enums with emojis
|
|
8
|
+
- [output_rules.md](output_rules.md) - JSON output rules, markdown formatting, platform compatibility
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 1. Section Emojis
|
|
13
|
+
|
|
14
|
+
| Section | Emoji | Example |
|
|
15
|
+
|---------|-------|---------|
|
|
16
|
+
| Title | 🏢 | `🏢 今日知识点 \| Today's Knowledge Point` |
|
|
17
|
+
| Scene | 🎬 | `🎬 场景 \| Scene` |
|
|
18
|
+
| Expressions | ✨💬 | `✨ Let's touch base` |
|
|
19
|
+
| Pronunciation | 🔊 | `🔊 Sounds like 'touch base'` |
|
|
20
|
+
| Usage | 💡 | `💡 Brief, informal check-in` |
|
|
21
|
+
| Alternatives | 🔄 | `🔄 其他说法 \| Alternatives` |
|
|
22
|
+
| Chinglish | ⚠️❌✅ | `❌ Wrong ... ✅ Correct` |
|
|
23
|
+
| Examples | 🗣️💭 | `🗣️ 对话示例 \| Example Dialogues` |
|
|
24
|
+
| Extended | 📚 | `📚 延伸学习 \| Extended Learning` |
|
|
25
|
+
| Cultural | 🌎 | `🌎 Cultural Note` |
|
|
26
|
+
| Mistakes | 🚫 | `🚫 Common Mistakes` |
|
|
27
|
+
| Related | 🔗 | `🔗 Related phrases` |
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 5. Feedback Emojis
|
|
32
|
+
|
|
33
|
+
| Feedback | Emoji | Example |
|
|
34
|
+
|----------|-------|---------|
|
|
35
|
+
| Correct | ✅ | `✅ Correct! 'Touch base' = quick check-in` |
|
|
36
|
+
| Wrong | ❌ | `❌ Not quite. Try again!` |
|
|
37
|
+
| XP | 💎 | `💎 +10 XP` |
|
|
38
|
+
| Progress | ⬜⬜⬜⬜ | `⬜⬜⬜⬜ 0/4 questions` |
|
|
39
|
+
| Encourage | 💪🚀 | `💪 Good luck! 加油! 🚀` |
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 7. Situation Emojis for Examples
|
|
44
|
+
|
|
45
|
+
| Situation | Emoji |
|
|
46
|
+
|-----------|-------|
|
|
47
|
+
| Morning/coffee | ☕ |
|
|
48
|
+
| Email/message | 📧 |
|
|
49
|
+
| Meeting | 🤝 |
|
|
50
|
+
| Phone call | 📱 |
|
|
51
|
+
| Office chat | 💬 |
|
|
52
|
+
| Lunch break | 🍱 |
|
|
53
|
+
| Slack/Teams | 💬 |
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 8. Display Object Structure
|
|
58
|
+
|
|
59
|
+
When generating content, include a `display` object with formatted strings:
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"display": {
|
|
64
|
+
"title": "🏢 今日知识点 | Today's Knowledge Point",
|
|
65
|
+
"topic_tag": "🏷️ 主题: 职场口语 | Workplace Oral",
|
|
66
|
+
"formality_tag": "📊 正式度: 中性 | Neutral",
|
|
67
|
+
"scene_intro": "🎬 场景 | Scene",
|
|
68
|
+
"expressions_title": "💬 核心表达 | Key Expressions",
|
|
69
|
+
"chinglish_title": "⚠️ Chinglish 陷阱 | Chinglish Trap",
|
|
70
|
+
"examples_title": "🗣️ 对话示例 | Example Dialogues",
|
|
71
|
+
"footer": "───────────────────\n📅 2026-02-20 | 📝 Take the quiz to earn XP!"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## 9. Emoji Usage Rules
|
|
79
|
+
|
|
80
|
+
> See [output_rules.md](output_rules.md) for complete formatting rules.
|
|
81
|
+
|
|
82
|
+
1. **Keep it readable**: Don't overuse emojis; 1-2 per line maximum
|
|
83
|
+
2. **Be consistent**: Use the same emoji for the same concept
|
|
84
|
+
3. **Bilingual labels**: Include both Chinese and English when appropriate
|
|
85
|
+
4. **Visual hierarchy**: Use emojis to create visual sections
|
|
86
|
+
5. **Positive tone**: Use encouraging emojis for feedback
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## 10. Formatting Examples
|
|
91
|
+
|
|
92
|
+
> See [output_rules.md](output_rules.md) for complete formatting rules.
|
|
93
|
+
|
|
94
|
+
**Key phrase highlighting:**
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"dialogue": "💬 A: Hey, can we **touch base**?\n💬 B: Sure!",
|
|
98
|
+
"key_phrase_highlight": "**touch base**"
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Display object fields:**
|
|
103
|
+
| Field | Purpose | Example |
|
|
104
|
+
|-------|---------|---------|
|
|
105
|
+
| `phrase` | Bold key phrase | `**Let's touch base**` |
|
|
106
|
+
| `key_phrase_highlight` | Highlighted in context | `**touch base**` |
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
# Initialization Flow Templates
|
|
2
|
+
|
|
3
|
+
> Templates for the 6-step onboarding process when a new user starts.
|
|
4
|
+
|
|
5
|
+
**Related Files:**
|
|
6
|
+
- [shared_enums.md](shared_enums.md) - CEFR levels, topics, tutor styles
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Step 0: Welcome Message
|
|
11
|
+
|
|
12
|
+
```json
|
|
13
|
+
{
|
|
14
|
+
"type": "init_welcome",
|
|
15
|
+
"step": 0,
|
|
16
|
+
"display": {
|
|
17
|
+
"title": "👋 Welcome to American English Tutor!",
|
|
18
|
+
"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.",
|
|
19
|
+
"prompt": "Ready to get started? Reply with **start** or **开始** to begin.",
|
|
20
|
+
"footer": "───────────────────\n🎯 This takes about 2 minutes"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Step 1: CEFR Level Selection
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"type": "init_cefr",
|
|
32
|
+
"step": 1,
|
|
33
|
+
"display": {
|
|
34
|
+
"title": "📊 Step 1/5: Your English Level",
|
|
35
|
+
"message": "What's your current English level?",
|
|
36
|
+
"options": [
|
|
37
|
+
"**A1-A2**: Beginner - Basic conversations, everyday words",
|
|
38
|
+
"**B1-B2**: Intermediate - Work conversations, some idioms",
|
|
39
|
+
"**C1-C2**: Advanced - Complex topics, nuanced expressions"
|
|
40
|
+
],
|
|
41
|
+
"prompt": "Reply with your level (e.g., **B1**, **B2**, **C1**)",
|
|
42
|
+
"hint": "💡 Not sure? Most working professionals are B1-B2. You can change this later."
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Step 2: Topic Preferences
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"type": "init_topics",
|
|
54
|
+
"step": 2,
|
|
55
|
+
"display": {
|
|
56
|
+
"title": "🎯 Step 2/5: Your Interests",
|
|
57
|
+
"message": "Which topics interest you most?",
|
|
58
|
+
"topics": [
|
|
59
|
+
"🎬 movies - TV shows, films",
|
|
60
|
+
"📰 news - Current events",
|
|
61
|
+
"🎮 gaming - Video games",
|
|
62
|
+
"⚽ sports - Sports & fitness",
|
|
63
|
+
"🏢 workplace - Office & business",
|
|
64
|
+
"💬 social - Friends & parties",
|
|
65
|
+
"🏠 daily_life - Shopping, restaurants"
|
|
66
|
+
],
|
|
67
|
+
"prompt": "List your interests (e.g., **movies workplace gaming**)",
|
|
68
|
+
"example": "Example: **movies workplace gaming**"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Step 3: Tutor Style
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"type": "init_style",
|
|
80
|
+
"step": 3,
|
|
81
|
+
"display": {
|
|
82
|
+
"title": "🎭 Step 3/5: Tutor Style",
|
|
83
|
+
"message": "How should I teach you?",
|
|
84
|
+
"options": [
|
|
85
|
+
"😄 **humorous** - Fun examples, jokes, pop culture",
|
|
86
|
+
"📚 **rigorous** - Detailed explanations, grammar focus",
|
|
87
|
+
"😎 **casual** - Short & sweet, everyday language",
|
|
88
|
+
"👔 **professional** - Business-focused, formal contexts"
|
|
89
|
+
],
|
|
90
|
+
"prompt": "Reply with: **humorous**, **rigorous**, **casual**, or **professional**"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Step 4: Oral/Written Ratio
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
{
|
|
101
|
+
"type": "init_ratio",
|
|
102
|
+
"step": 4,
|
|
103
|
+
"display": {
|
|
104
|
+
"title": "💬 Step 4/5: Speaking vs Writing",
|
|
105
|
+
"message": "What do you want to focus on?",
|
|
106
|
+
"options": [
|
|
107
|
+
"🗣️ **Mostly speaking** - Daily conversations, casual chat",
|
|
108
|
+
"⚖️ **Balanced** - Mix of speaking and writing",
|
|
109
|
+
"✍️ **Mostly writing** - Emails, formal documents"
|
|
110
|
+
],
|
|
111
|
+
"prompt": "Reply with a number 0-100 for speaking focus (e.g., **70** = 70% speaking)"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Step 5: Schedule Configuration
|
|
119
|
+
|
|
120
|
+
```json
|
|
121
|
+
{
|
|
122
|
+
"type": "init_schedule",
|
|
123
|
+
"step": 5,
|
|
124
|
+
"display": {
|
|
125
|
+
"title": "⏰ Step 5/5: Schedule Your Learning",
|
|
126
|
+
"message": "When should I send you daily content?",
|
|
127
|
+
"defaults": {
|
|
128
|
+
"keypoint": "☀️ **Keypoint** (morning lesson): Default **06:45**",
|
|
129
|
+
"quiz": "🌙 **Quiz** (evening practice): Default **22:45**"
|
|
130
|
+
},
|
|
131
|
+
"prompt": "Reply with times in 24-hour format (e.g., **07:00 21:30**) or press Enter for defaults.",
|
|
132
|
+
"hint": "💡 Quiz time must be later than keypoint time. Example: '07:00 21:30' or just press Enter for defaults."
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**Validation Rules:**
|
|
138
|
+
- Both times must be in HH:MM format (24-hour)
|
|
139
|
+
- Quiz time must be later than keypoint time
|
|
140
|
+
- If user only provides one time, ask for the second
|
|
141
|
+
- If invalid format, show error and re-prompt
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Step 6: Confirmation
|
|
146
|
+
|
|
147
|
+
```json
|
|
148
|
+
{
|
|
149
|
+
"type": "init_confirm",
|
|
150
|
+
"step": 6,
|
|
151
|
+
"display": {
|
|
152
|
+
"title": "✅ All Set! Here's Your Profile:",
|
|
153
|
+
"summary": {
|
|
154
|
+
"level": "📊 Level: {cefr_level}",
|
|
155
|
+
"topics": "🎯 Topics: {top_topics}",
|
|
156
|
+
"style": "🎭 Style: {tutor_style}",
|
|
157
|
+
"focus": "💬 Focus: {oral_ratio}% speaking",
|
|
158
|
+
"schedule": "⏰ Schedule: Keypoint at {keypoint_time}, Quiz at {quiz_time}"
|
|
159
|
+
},
|
|
160
|
+
"prompt": "Does this look right? Reply **yes** to confirm or **change** to adjust.",
|
|
161
|
+
"footer": "───────────────────\n🚀 Your first lesson starts tomorrow!"
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Completion
|
|
169
|
+
|
|
170
|
+
```json
|
|
171
|
+
{
|
|
172
|
+
"type": "init_complete",
|
|
173
|
+
"display": {
|
|
174
|
+
"title": "🎉 Welcome Aboard!",
|
|
175
|
+
"message": "You're all set! Here's what happens next:\n\n"
|
|
176
|
+
"☀️ **{keypoint_time}** - Daily knowledge point\n"
|
|
177
|
+
"🌙 **{quiz_time}** - Daily quiz",
|
|
178
|
+
"cron_setup": "I'll create cron jobs for your schedule now. You can change this anytime with the **schedule** command.",
|
|
179
|
+
"first_lesson": "Want your first lesson now? Reply **keypoint** or **知识点**",
|
|
180
|
+
"footer": "───────────────────\n💡 Say **help** anytime to see all commands"
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Cron Job Creation (after Step 6 confirmation)
|
|
188
|
+
|
|
189
|
+
After user confirms with "yes", MUST execute the following bash commands to create cron jobs:
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
# Parse times from schedule
|
|
193
|
+
KEYPOINT_TIME="06:45" # Default, replace with user's keypoint_time
|
|
194
|
+
QUIZ_TIME="22:45" # Default, replace with user's quiz_time
|
|
195
|
+
|
|
196
|
+
# Extract hour and minute
|
|
197
|
+
KEYPOINT_HOUR=$(echo $KEYPOINT_TIME | cut -d: -f1)
|
|
198
|
+
KEYPOINT_MIN=$(echo $KEYPOINT_TIME | cut -d: -f2)
|
|
199
|
+
QUIZ_HOUR=$(echo $QUIZ_TIME | cut -d: -f1)
|
|
200
|
+
QUIZ_MIN=$(echo $QUIZ_TIME | cut -d: -f2)
|
|
201
|
+
|
|
202
|
+
# Create cron jobs using openclaw
|
|
203
|
+
# Keypoint job
|
|
204
|
+
${KEYPOINT_MIN} ${KEYPOINT_HOUR} * * * openclaw system event --text "Use eng-lang-tutor skill. Push today's keypoint." --mode now
|
|
205
|
+
|
|
206
|
+
# Quiz job
|
|
207
|
+
${QUIZ_MIN} ${QUIZ_HOUR} * * * openclaw system event --text "Use eng-lang-tutor skill. Push today's quiz invitation." --mode now
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
**IMPORTANT:** The cron job creation requires:
|
|
211
|
+
1. Parse user's `keypoint_time` and `quiz_time` from state.json schedule
|
|
212
|
+
2. Execute the bash command to register each cron job
|
|
213
|
+
3. Log the event using `state_manager.py append_event`
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
# Knowledge Point Generation Template
|
|
2
|
+
|
|
3
|
+
> Main template for generating daily English learning content.
|
|
4
|
+
|
|
5
|
+
**Related Files:**
|
|
6
|
+
- [shared_enums.md](shared_enums.md) - Topics, CEFR levels, tutor styles, quiz types
|
|
7
|
+
- [output_rules.md](output_rules.md) - JSON output rules, markdown formatting
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 1. Generation Prompt
|
|
12
|
+
|
|
13
|
+
```markdown
|
|
14
|
+
You are an authentic American English tutor. Generate a daily knowledge point.
|
|
15
|
+
|
|
16
|
+
## USER CONTEXT
|
|
17
|
+
- CEFR Level: {cefr_level} (A1=Beginner to C2=Proficient)
|
|
18
|
+
- Topic Focus: {topic} (movies/news/gaming/sports/workplace/social/daily_life)
|
|
19
|
+
- Tutor Style: {tutor_style} (humorous/rigorous/casual/professional)
|
|
20
|
+
- Expression Type: {oral_written_ratio}% oral expressions, {written_ratio}% written
|
|
21
|
+
|
|
22
|
+
## RESOURCE REFERENCES
|
|
23
|
+
{topic_resources}
|
|
24
|
+
|
|
25
|
+
## STRICT RULES
|
|
26
|
+
1. Output ONLY valid JSON - no markdown, no code blocks, no extra text
|
|
27
|
+
2. Focus on "How Americans say it" - NOT Chinese translations
|
|
28
|
+
3. Must include: scene context, alternatives, Chinglish trap + correction
|
|
29
|
+
4. Use authentic expressions from the resource references above
|
|
30
|
+
5. Include pronunciation tips for casual speech (gonna, gotta, wanna, etc.)
|
|
31
|
+
6. AVOID these recent topics (14-day dedup): {excluded_topics}
|
|
32
|
+
7. **End sentences with proper punctuation** - periods for statements, question marks for questions
|
|
33
|
+
8. **Include reference links** - provide authoritative sources for verification
|
|
34
|
+
9. **Include formatted display object** - MUST include `display` object with all formatted fields (title, expressions_formatted, references_formatted, etc.) using `**text**` for bold
|
|
35
|
+
10. **Never use strikethrough** - Use ❌ emoji for wrong answers instead of `~~text~~`
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 2. Reference Sources
|
|
41
|
+
|
|
42
|
+
When generating knowledge points, include links to these authoritative sources:
|
|
43
|
+
|
|
44
|
+
| Type | Source | URL Pattern | Description |
|
|
45
|
+
|------|--------|-------------|-------------|
|
|
46
|
+
| **Dictionary** | Merriam-Webster | `https://www.merriam-webster.com/dictionary/{phrase}` | Most authoritative American English dictionary |
|
|
47
|
+
| **Usage** | YouGlish | `https://youglish.com/pronounce/{phrase}/english/us` | Real YouTube videos with the phrase |
|
|
48
|
+
| **Etymology** | Etymonline | `https://www.etymonline.com/word/{word}` | Word origin and history |
|
|
49
|
+
| **Frequency** | Google Ngram | `https://books.google.com/ngrams/graph?content={phrase}` | Usage frequency over time |
|
|
50
|
+
|
|
51
|
+
**URL Encoding:** Replace spaces with `%20` in URLs.
|
|
52
|
+
|
|
53
|
+
**Reference Requirements:**
|
|
54
|
+
- `dictionary` is REQUIRED - always include Merriam-Webster link
|
|
55
|
+
- `usage_context` is REQUIRED - YouGlish helps users hear real usage
|
|
56
|
+
- `etymology` is OPTIONAL - include for interesting origin stories
|
|
57
|
+
- `frequency` is OPTIONAL - include for frequency comparison
|
|
58
|
+
|
|
59
|
+
**Example:**
|
|
60
|
+
```json
|
|
61
|
+
{
|
|
62
|
+
"references": {
|
|
63
|
+
"dictionary": {
|
|
64
|
+
"source": "merriam-webster",
|
|
65
|
+
"url": "https://www.merriam-webster.com/dictionary/touch%20base",
|
|
66
|
+
"note": "Official definition and usage examples"
|
|
67
|
+
},
|
|
68
|
+
"usage_context": {
|
|
69
|
+
"source": "youglish",
|
|
70
|
+
"url": "https://youglish.com/pronounce/touch%20base/english/us",
|
|
71
|
+
"note": "Hear it in 1000+ real YouTube videos"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## 3. Content Guidelines
|
|
80
|
+
|
|
81
|
+
### Scene
|
|
82
|
+
- Describe a realistic situation where this expression is used
|
|
83
|
+
- Include formality level (casual/neutral/formal)
|
|
84
|
+
- Make it relatable to the CEFR level
|
|
85
|
+
|
|
86
|
+
### Expressions
|
|
87
|
+
- Primary expression + 1-2 alternatives
|
|
88
|
+
- Include pronunciation tips for natural speech
|
|
89
|
+
- Usage notes explaining when to use
|
|
90
|
+
|
|
91
|
+
### Chinglish Trap
|
|
92
|
+
- Show what Chinese speakers TYPICALLY say (the wrong version)
|
|
93
|
+
- Provide the correct American expression
|
|
94
|
+
- Explain WHY the wrong version sounds unnatural
|
|
95
|
+
|
|
96
|
+
### Examples
|
|
97
|
+
- Use dialogue format with 2-3 exchanges
|
|
98
|
+
- Make conversations feel natural and authentic
|
|
99
|
+
- Include context for each dialogue
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## 4. Output Schema
|
|
104
|
+
|
|
105
|
+
```json
|
|
106
|
+
{
|
|
107
|
+
"date": "{today_date}",
|
|
108
|
+
"topic_fingerprint": "unique_lowercase_with_underscores",
|
|
109
|
+
"category": "oral|written",
|
|
110
|
+
"topic": "{topic}",
|
|
111
|
+
"scene": {
|
|
112
|
+
"context": "Brief description of the situation",
|
|
113
|
+
"formality": "casual|neutral|formal"
|
|
114
|
+
},
|
|
115
|
+
"expressions": [
|
|
116
|
+
{
|
|
117
|
+
"phrase": "The American expression",
|
|
118
|
+
"pronunciation_tip": "How to say it naturally",
|
|
119
|
+
"usage_note": "When and how to use this"
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
"alternatives": [
|
|
123
|
+
"Another way to say it 1",
|
|
124
|
+
"Another way to say it 2"
|
|
125
|
+
],
|
|
126
|
+
"chinglish_trap": {
|
|
127
|
+
"wrong": "What Chinese speakers typically say",
|
|
128
|
+
"correct": "The natural American way",
|
|
129
|
+
"explanation": "Why the wrong version sounds off"
|
|
130
|
+
},
|
|
131
|
+
"examples": [
|
|
132
|
+
{
|
|
133
|
+
"situation": "Context for example",
|
|
134
|
+
"dialogue": ["Speaker A: ...", "Speaker B: ..."]
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
"extended_learning": {
|
|
138
|
+
"related_phrases": ["phrase1", "phrase2"],
|
|
139
|
+
"cultural_note": "Brief cultural context",
|
|
140
|
+
"common_mistakes": ["mistake1"]
|
|
141
|
+
},
|
|
142
|
+
"references": {
|
|
143
|
+
"dictionary": {
|
|
144
|
+
"source": "merriam-webster",
|
|
145
|
+
"url": "https://www.merriam-webster.com/dictionary/{phrase}",
|
|
146
|
+
"note": "Definition and usage examples"
|
|
147
|
+
},
|
|
148
|
+
"usage_context": {
|
|
149
|
+
"source": "youglish",
|
|
150
|
+
"url": "https://youglish.com/pronounce/{phrase}/english/us",
|
|
151
|
+
"note": "Hear it in real YouTube videos"
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"display": {
|
|
155
|
+
"title": "🏢 今日知识点 | Today's Knowledge Point",
|
|
156
|
+
"topic_tag": "🏷️ 主题: **{topic_name}** | {topic_name_en}",
|
|
157
|
+
"formality_tag": "📊 正式度: **{formality}**",
|
|
158
|
+
"scene_intro": "🎬 场景 | Scene",
|
|
159
|
+
"scene_text": "{scene_context}",
|
|
160
|
+
"expressions_title": "💬 核心表达 | Key Expressions",
|
|
161
|
+
"expressions_formatted": [
|
|
162
|
+
{
|
|
163
|
+
"emoji": "✨",
|
|
164
|
+
"phrase": "**{phrase}**",
|
|
165
|
+
"phrase_plain": "{phrase}",
|
|
166
|
+
"pronunciation": "🔊 {pronunciation_tip}",
|
|
167
|
+
"usage": "💡 {usage_note}"
|
|
168
|
+
}
|
|
169
|
+
],
|
|
170
|
+
"alternatives_title": "🔄 其他说法 | Alternatives",
|
|
171
|
+
"alternatives_formatted": "• **{alt_1}**\n• **{alt_2}**",
|
|
172
|
+
"chinglish_title": "⚠️ Chinglish 陷阱 | Chinglish Trap",
|
|
173
|
+
"chinglish_formatted": "❌ Wrong: \"{wrong}\"\n✅ Correct: **{correct}**\n\n📝 {explanation}",
|
|
174
|
+
"examples_title": "🗣️ 对话示例 | Example Dialogues",
|
|
175
|
+
"examples_formatted": [
|
|
176
|
+
{
|
|
177
|
+
"situation_emoji": "☕",
|
|
178
|
+
"situation": "{situation_name}",
|
|
179
|
+
"dialogue": "💬 A: {line_1}\n💬 B: {line_2}",
|
|
180
|
+
"key_phrase_highlight": "**{key_phrase}**"
|
|
181
|
+
}
|
|
182
|
+
],
|
|
183
|
+
"extended_title": "📚 延伸学习 | Extended Learning",
|
|
184
|
+
"extended_formatted": "🔗 Related: **{related_1}** | **{related_2}**\n\n🌎 {cultural_note}",
|
|
185
|
+
"references_title": "📖 权威参考 | References",
|
|
186
|
+
"references_formatted": "📚 [Merriam-Webster]({dict_url}) - {dict_note}\n🎬 [YouGlish]({usage_url}) - {usage_note}",
|
|
187
|
+
"footer": "───────────────────\n📅 {date} | 📝 Take the quiz to earn XP!"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## 5. Topic Resource Injection
|
|
195
|
+
|
|
196
|
+
When generating content, inject topic-specific resources:
|
|
197
|
+
|
|
198
|
+
```python
|
|
199
|
+
TOPIC_RESOURCES = {
|
|
200
|
+
"movies": """
|
|
201
|
+
Reference expressions from TV shows:
|
|
202
|
+
- Friends: "How you doin'?", "Could I BE any more...?"
|
|
203
|
+
- The Office: "That's what she said", "Touch base"
|
|
204
|
+
- Gossip Girl: "No offense", "None taken", "Done and done"
|
|
205
|
+
Focus on: dialogue patterns, humor, sarcasm, casual speech
|
|
206
|
+
""",
|
|
207
|
+
|
|
208
|
+
"news": """
|
|
209
|
+
Reference vocabulary from:
|
|
210
|
+
- CNN 10: Current events, clear explanations
|
|
211
|
+
- VOA: Simplified news vocabulary
|
|
212
|
+
Focus on: formal register, topic-specific vocabulary, clear structure
|
|
213
|
+
""",
|
|
214
|
+
|
|
215
|
+
"gaming": """
|
|
216
|
+
Reference gaming terminology:
|
|
217
|
+
- Core: NPC, spawn, loot, grind, level up, buff, nerf
|
|
218
|
+
- Multiplayer: party, squad, GG, clutch, carry
|
|
219
|
+
- Slang in daily use: "That was clutch", "GG"
|
|
220
|
+
Focus on: casual speech, slang, gaming-specific vocabulary
|
|
221
|
+
""",
|
|
222
|
+
|
|
223
|
+
"sports": """
|
|
224
|
+
Reference sports vocabulary:
|
|
225
|
+
- Basketball: dunk, buzzer beater, pick and roll
|
|
226
|
+
- Sports idioms: "step up to the plate", "ballpark figure"
|
|
227
|
+
Focus on: energetic expressions, idioms used in business
|
|
228
|
+
""",
|
|
229
|
+
|
|
230
|
+
"workplace": """
|
|
231
|
+
Reference workplace expressions:
|
|
232
|
+
- Office idioms: touch base, circle back, bandwidth
|
|
233
|
+
- Meeting phrases: "Let's get the ball rolling", "wrap up"
|
|
234
|
+
- Email language: formal yet natural
|
|
235
|
+
Focus on: professional communication, formal/informal switching
|
|
236
|
+
""",
|
|
237
|
+
|
|
238
|
+
"social": """
|
|
239
|
+
Reference social expressions:
|
|
240
|
+
- Greetings: "What's up?", "How's it going?"
|
|
241
|
+
- Making plans: "Let's hang out", "grab coffee"
|
|
242
|
+
- Casual responses: "Not much, you?", "Can't complain"
|
|
243
|
+
Focus on: casual speech, fillers, natural conversation flow
|
|
244
|
+
""",
|
|
245
|
+
|
|
246
|
+
"daily_life": """
|
|
247
|
+
Reference daily life expressions:
|
|
248
|
+
- Shopping: "Just looking", "Can I get a discount?"
|
|
249
|
+
- Restaurant: "I'd like the...", "Check, please"
|
|
250
|
+
- Services: Asking for help, making requests
|
|
251
|
+
Focus on: practical communication, politeness strategies
|
|
252
|
+
"""
|
|
253
|
+
}
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## 6. CEFR Level Guidelines
|
|
259
|
+
|
|
260
|
+
> See [shared_enums.md](shared_enums.md#cefr-levels-能力等级) for level definitions.
|
|
261
|
+
|
|
262
|
+
Adjust content complexity based on CEFR level.
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
## 7. Tutor Style Variations
|
|
267
|
+
|
|
268
|
+
> See [shared_enums.md](shared_enums.md#tutor-styles-导师风格) for style definitions.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# 输出规则
|
|
2
|
+
|
|
3
|
+
> 本文件定义所有 LLM 输出的通用规则。生成内容时必须遵守这些规则。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## JSON 输出要求
|
|
8
|
+
|
|
9
|
+
### 基本规则
|
|
10
|
+
- ⛔ **只输出合法 JSON** - 无 markdown 代码块,无 ```json 标记
|
|
11
|
+
- ⛔ **无多余文本** - 不要在 JSON 前后添加说明文字
|
|
12
|
+
- ⛔ **无注释** - JSON 中不允许 `//` 或 `/* */` 注释
|
|
13
|
+
- ✅ **必须通过 Schema 验证** - 符合 `templates/` 目录下的 JSON Schema
|
|
14
|
+
|
|
15
|
+
### JSON 转义规则 (用于 bash 命令)
|
|
16
|
+
```bash
|
|
17
|
+
# 单引号包裹
|
|
18
|
+
python3 scripts/state_manager.py save_daily --content-type keypoint --content '{"key": "value"}'
|
|
19
|
+
|
|
20
|
+
# 转义内部单引号: ' → '\''
|
|
21
|
+
python3 scripts/state_manager.py save_daily --content-type keypoint --content '{"title": "It'\''s a test"}'
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Markdown 格式规则
|
|
27
|
+
|
|
28
|
+
### 平台兼容性
|
|
29
|
+
|
|
30
|
+
| 格式 | 语法 | 飞书 | Discord | Telegram | Slack |
|
|
31
|
+
|------|------|------|---------|----------|-------|
|
|
32
|
+
| 粗体 | `**text**` | ✅ | ✅ | ✅ | ✅ |
|
|
33
|
+
| 斜体 | `*text*` | ✅ | ✅ | ✅ | ✅ |
|
|
34
|
+
| 链接 | `[text](url)` | ✅ | ✅ | ✅ | ✅ |
|
|
35
|
+
| 代码 | `` `code` `` | ✅ | ✅ | ✅ | ✅ |
|
|
36
|
+
| 删除线 | `~~text~~` | ❌ | ✅ | ✅ | ✅ |
|
|
37
|
+
|
|
38
|
+
### 飞书兼容性特别说明
|
|
39
|
+
- **删除线**: 飞书不支持 `~~text~~` 语法
|
|
40
|
+
- **替代方案**: 直接使用「错误:xxx」而非删除线
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 标点符号规则
|
|
45
|
+
|
|
46
|
+
| 规则 | 正确示例 | 错误示例 |
|
|
47
|
+
|------|----------|----------|
|
|
48
|
+
| 陈述句以句号结尾 | `This is correct.` | `This is correct` |
|
|
49
|
+
| 问句以问号结尾 | `How are you?` | `How are you` |
|
|
50
|
+
| 避免连续标点 | `Great!` | `Great!!!` |
|
|
51
|
+
| 中英文标点不混用 | `Hello, 你好。` | `Hello,你好.` |
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 双语标签格式
|
|
56
|
+
|
|
57
|
+
### 标准格式
|
|
58
|
+
```
|
|
59
|
+
中文 | English
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 示例
|
|
63
|
+
```
|
|
64
|
+
选择题 | Multiple Choice
|
|
65
|
+
填空题 | Fill in the Blank
|
|
66
|
+
Chinglish 修正 | Fix the Chinglish
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Display 对象通用字段
|
|
72
|
+
|
|
73
|
+
所有 `display` 对象应包含以下通用格式字段:
|
|
74
|
+
|
|
75
|
+
| 字段 | 描述 | 示例 |
|
|
76
|
+
|------|------|------|
|
|
77
|
+
| `type_emoji` | 类型图标 | `🔤` |
|
|
78
|
+
| `type_name` | 类型名称(双语) | `选择题 \| Multiple Choice` |
|
|
79
|
+
| `hint` | 提示(不泄露答案) | `💡 考虑上下文...` |
|
|
80
|
+
| `correct_feedback` | 正确反馈 | `✅ 正确!` |
|
|
81
|
+
| `wrong_feedback` | 错误反馈 | `❌ 再想想...` |
|
|
82
|
+
| `xp_display` | XP 显示 | `💎 +10 XP` |
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Emoji 使用规则
|
|
87
|
+
|
|
88
|
+
### 通用原则
|
|
89
|
+
- ✅ 使用表情符号增加视觉效果
|
|
90
|
+
- ✅ 每个主要部分使用 emoji 作为视觉分隔
|
|
91
|
+
- ⛔ 不要过度使用,保持简洁
|
|
92
|
+
- ⛔ 不要在 JSON 字段名中使用 emoji
|
|
93
|
+
|
|
94
|
+
### 常用 Emoji 参考
|
|
95
|
+
- 📝 文档/测验
|
|
96
|
+
- 💬 对话/聊天
|
|
97
|
+
- 💎 XP/奖励
|
|
98
|
+
- ✅ 正确/完成
|
|
99
|
+
- ❌ 错误
|
|
100
|
+
- 💡 提示
|
|
101
|
+
- 🎯 目标/要点
|
|
102
|
+
- 📅 日期
|
|
103
|
+
- 🏆 成就/徽章
|
|
104
|
+
- ⛔ 禁止/警告
|
|
105
|
+
|
|
106
|
+
详细 Emoji 映射请参考 [display_guide.md](display_guide.md)。
|