@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.
- package/CLAUDE.md +259 -0
- package/README.md +224 -0
- package/README_EN.md +224 -0
- package/SKILL.md +495 -0
- package/bin/eng-lang-tutor.js +177 -0
- package/docs/OPENCLAW_DEPLOYMENT.md +228 -0
- package/examples/sample_keypoint.json +130 -0
- package/examples/sample_quiz.json +92 -0
- package/npm-scripts/install.js +132 -0
- package/package.json +46 -0
- package/references/resources.md +292 -0
- package/requirements.txt +9 -0
- package/scripts/command_parser.py +336 -0
- package/scripts/cron_push.py +226 -0
- package/scripts/dedup.py +325 -0
- package/scripts/gamification.py +406 -0
- package/scripts/scorer.py +323 -0
- package/scripts/state_manager.py +1025 -0
- package/scripts/tts/__init__.py +30 -0
- package/scripts/tts/base.py +109 -0
- package/scripts/tts/manager.py +290 -0
- package/scripts/tts/providers/__init__.py +10 -0
- package/scripts/tts/providers/xunfei.py +192 -0
- package/templates/keypoint_schema.json +420 -0
- package/templates/prompt_templates.md +1261 -0
- package/templates/quiz_schema.json +201 -0
- package/templates/state_schema.json +241 -0
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
# SKILL: eng-lang-tutor
|
|
2
|
+
|
|
3
|
+
## 1. 项目目标
|
|
4
|
+
|
|
5
|
+
本项目主要为Agent添加「地道美式英语导师」的Skill,配合Agent所在环境的cron job实现定期的知识推送与测验。
|
|
6
|
+
|
|
7
|
+
### 1.1. 学习目标
|
|
8
|
+
|
|
9
|
+
- 以提升地道的美式英语常用口语表达为主,兼顾听力与书面表达(正式场合)。
|
|
10
|
+
- 避免传统的Chinglish的硬翻式尴尬表达。
|
|
11
|
+
- 融入轻量游戏化教学,覆盖影视、新闻、游戏、体育、职场、社交、生活等用户感兴趣的场景来提升用户的粘性。
|
|
12
|
+
|
|
13
|
+
### 1.2. 语言范围
|
|
14
|
+
|
|
15
|
+
- 以美式英语为主,包含俚语、口头语、缩写(gonna, gotta, kinda 等),能帮助用户区分「正式 vs 口语」。
|
|
16
|
+
|
|
17
|
+
### 1.3. 技能维度
|
|
18
|
+
|
|
19
|
+
- 涉及词汇/短语、固定搭配、场景句型等口语与书面语中的表达方式。
|
|
20
|
+
|
|
21
|
+
## 2. 项目范围
|
|
22
|
+
|
|
23
|
+
### 2.1. MVP版本功能清单
|
|
24
|
+
|
|
25
|
+
#### 2.1.1 导师模式
|
|
26
|
+
|
|
27
|
+
Agent结合难度与偏好的设置,以及用户的历史学习进度动态生成并调整个性化的教学大纲与教学内容:
|
|
28
|
+
|
|
29
|
+
| 功能 | 描述 | 频次 | 对应脚本 |
|
|
30
|
+
|-----|------|-----|---------|
|
|
31
|
+
| **知识点** | 地道美式英语日常沟通素材,包含场景、可替换说法、Chinglish陷阱+修正 | 每天 | state_manager.py |
|
|
32
|
+
| **Quiz** | 3道轻量测验:1多选+1Chinglish修正+1随机(填空/对话)| 每天 | scorer.py |
|
|
33
|
+
| **错题本** | 记录错误答案,支持手动添加,便于针对性复习 | 实时 | state_manager.py |
|
|
34
|
+
|
|
35
|
+
**Quiz 结构:**
|
|
36
|
+
|
|
37
|
+
| 题型 | 描述 | XP值 | 每日Quiz |
|
|
38
|
+
|-----|------|-----|---------|
|
|
39
|
+
| multiple_choice | 四选一,测试表达识别 | 10 | 1 (必选) |
|
|
40
|
+
| chinglish_fix | 识别并修正Chinglish表达 | 15 | 1 (必选) |
|
|
41
|
+
| fill_blank | 填空,完成对话 | 12 | 0-1 (随机) |
|
|
42
|
+
| dialogue_completion | 选择合适的对话回应 | 15 | 0-1 (随机) |
|
|
43
|
+
|
|
44
|
+
- **每日Quiz**: 3题,约37 XP,答对2题即过关
|
|
45
|
+
|
|
46
|
+
#### 2.1.2 状态管理
|
|
47
|
+
|
|
48
|
+
保障整个教学过程可备份、可追溯、可回滚:
|
|
49
|
+
|
|
50
|
+
| 组件 | 文件 | 用途 |
|
|
51
|
+
|-----|------|-----|
|
|
52
|
+
| 核心状态 | state.json | streak/xp/偏好/近期主题/错题本 |
|
|
53
|
+
| 事件日志 | logs/events_YYYY-MM.jsonl | 追加式事件流水账 |
|
|
54
|
+
| 每日内容 | daily/YYYY-MM-DD/*.json | 知识点/Quiz/用户答案 |
|
|
55
|
+
|
|
56
|
+
#### 2.1.3 成就体系(Duolingo风格)
|
|
57
|
+
|
|
58
|
+
**双等级体系说明:**
|
|
59
|
+
- **能力等级 (CEFR)**:A1-C2,决定内容难度,与 App 无关的绝对语言能力
|
|
60
|
+
- **活跃等级 (Level)**:1-20,衡量 App 使用深度,通过 XP 累积升级
|
|
61
|
+
|
|
62
|
+
| 活跃等级 | 阶段 | XP 需求 |
|
|
63
|
+
|---------|------|---------|
|
|
64
|
+
| 1-5 | 启程者 (Starter) | 0-350 |
|
|
65
|
+
| 6-10 | 行路人 (Traveler) | 550-2000 |
|
|
66
|
+
| 11-15 | 探索者 (Explorer) | 2600-6000 |
|
|
67
|
+
| 16-20 | 开拓者 (Pioneer) | 7200-15000 |
|
|
68
|
+
|
|
69
|
+
| 组件 | 描述 |
|
|
70
|
+
|-----|------|
|
|
71
|
+
| **XP & 等级** | 1-20级,XP累积升级(启程者 → 行路人 → 探索者 → 开拓者) |
|
|
72
|
+
| **连胜系统** | 连续学习天数,支持连胜冻结(50宝石) |
|
|
73
|
+
| **联赛系统** | Bronze → Silver → Gold → Platinum → Diamond(周结算) |
|
|
74
|
+
| **徽章系统** | First Steps、Week Warrior、Month Master、Perfect 10、Vocab Hunter、Error Slayer |
|
|
75
|
+
| **宝石系统** | 用于购买连胜冻结、提示等 |
|
|
76
|
+
|
|
77
|
+
**徽章详情:**
|
|
78
|
+
|
|
79
|
+
| 徽章 | 触发条件 | 宝石奖励 |
|
|
80
|
+
|-----|---------|---------|
|
|
81
|
+
| First Steps | 完成首次Quiz | 10 |
|
|
82
|
+
| Week Warrior | 7天连胜 | 25 |
|
|
83
|
+
| Month Master | 30天连胜 | 100 |
|
|
84
|
+
| Perfect 10 | 10次完美Quiz | 50 |
|
|
85
|
+
| Vocab Hunter | 学习100个表达 | 75 |
|
|
86
|
+
| Error Slayer | 清除30个错题 | 30 |
|
|
87
|
+
|
|
88
|
+
#### 2.1.4 系统配置
|
|
89
|
+
|
|
90
|
+
| 配置项 | 描述 | 默认值 |
|
|
91
|
+
|-------|------|-------|
|
|
92
|
+
| CEFR等级 | A1-C2语言级别 | B1 |
|
|
93
|
+
| 口语/书面比例 | 口语表达占比 | 70% |
|
|
94
|
+
| 主题配比 | movies/news/gaming/sports/workplace/social/daily_life | 各主题权重 |
|
|
95
|
+
| 导师风格 | humorous/rigorous/casual/professional | humorous |
|
|
96
|
+
| 去重天数 | 避免重复内容的时间窗口 | 14天 |
|
|
97
|
+
|
|
98
|
+
### 2.2. MVP版本不做 / 延后
|
|
99
|
+
|
|
100
|
+
- **周周练**:5道综合性场景练习,覆盖本周知识点,约62 XP,答对3题即过关。计划周日推送。
|
|
101
|
+
- **语音模式**:支持tts便于用户跟读,支持asr便于导师对口语表达进行打分。
|
|
102
|
+
|
|
103
|
+
### 2.3. 项目约束
|
|
104
|
+
|
|
105
|
+
**核心原则:别问"怎么翻译",先问"这个场景美国人会怎么说",会让你立刻更像美国人。**
|
|
106
|
+
|
|
107
|
+
#### 2.3.1 输出格式约束
|
|
108
|
+
|
|
109
|
+
- **必须输出合法 JSON**(不要 markdown,不要代码块,不要多余文本)
|
|
110
|
+
- 所有输出必须符合 `templates/` 目录下的 JSON Schema
|
|
111
|
+
|
|
112
|
+
#### 2.3.2 内容质量约束
|
|
113
|
+
|
|
114
|
+
- 语言风格:**地道美式**、轻松、可用、短句为主
|
|
115
|
+
- 每条知识点必须包含:**场景、可替换说法、Chinglish 陷阱 + 修正**
|
|
116
|
+
- 包含发音提示(gonna, gotta, wanna 等自然发音)
|
|
117
|
+
- 提供文化背景和使用场景说明
|
|
118
|
+
|
|
119
|
+
#### 2.3.3 去重策略(14天窗口)
|
|
120
|
+
|
|
121
|
+
使用 `scripts/dedup.py` 实现三层去重:
|
|
122
|
+
|
|
123
|
+
| 层级 | 方法 | 描述 |
|
|
124
|
+
|-----|------|-----|
|
|
125
|
+
| 1 | topic_fingerprint | 主题指纹匹配 |
|
|
126
|
+
| 2 | 表达重叠 | 相同短语超过50%视为重复 |
|
|
127
|
+
| 3 | 词根匹配 | 核心词汇结构相似 |
|
|
128
|
+
|
|
129
|
+
#### 2.3.4 反直译原则
|
|
130
|
+
|
|
131
|
+
- 优先给"美国人会怎么说",而不是"中文怎么翻英文"
|
|
132
|
+
- 参考 `references/resources.md` 中的主题资源库
|
|
133
|
+
- 使用 `references/prompt_templates.md` 中的LLM提示模板
|
|
134
|
+
|
|
135
|
+
## 3. 技术栈与SKILL结构
|
|
136
|
+
|
|
137
|
+
### 3.1. 技术栈与输出格式
|
|
138
|
+
|
|
139
|
+
- 技术栈:Python 3.x
|
|
140
|
+
- 触发方式:cron 触发 Agent 调用 Skill
|
|
141
|
+
|
|
142
|
+
### 3.2. 目录结构
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
eng-lang-tutor/
|
|
146
|
+
├── SKILL.md # 核心技能文档
|
|
147
|
+
├── CLAUDE.md # 项目说明(本文件)
|
|
148
|
+
├── scripts/
|
|
149
|
+
│ ├── state_manager.py # 状态持久化与事件日志
|
|
150
|
+
│ ├── scorer.py # 答案评估与XP计算
|
|
151
|
+
│ ├── gamification.py # 连胜/等级/徽章/联赛
|
|
152
|
+
│ └── dedup.py # 14天去重逻辑
|
|
153
|
+
├── templates/
|
|
154
|
+
│ ├── state_schema.json # 状态 JSON Schema
|
|
155
|
+
│ ├── keypoint_schema.json # 知识点 JSON Schema
|
|
156
|
+
│ └── quiz_schema.json # Quiz JSON Schema
|
|
157
|
+
├── references/
|
|
158
|
+
│ ├── resources.md # 主题化英语学习资源库
|
|
159
|
+
│ └── prompt_templates.md # LLM Prompt 模板
|
|
160
|
+
├── examples/
|
|
161
|
+
│ ├── sample_keypoint.json # 示例知识点
|
|
162
|
+
│ └── sample_quiz.json # 示例Quiz
|
|
163
|
+
└── data/
|
|
164
|
+
├── state.json # 运行时状态
|
|
165
|
+
├── logs/
|
|
166
|
+
│ └── events_YYYY-MM.jsonl
|
|
167
|
+
└── daily/
|
|
168
|
+
└── YYYY-MM-DD/
|
|
169
|
+
├── keypoint.json
|
|
170
|
+
├── quiz.json
|
|
171
|
+
└── user_answers.json
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## 4. 功能切片实现
|
|
175
|
+
|
|
176
|
+
### 4.1 功能切片与脚本对应
|
|
177
|
+
|
|
178
|
+
| 切片 | 对应脚本 | 输入 | 输出 |
|
|
179
|
+
|-----|---------|------|-----|
|
|
180
|
+
| 状态加载/保存 | state_manager.py | - | state.json |
|
|
181
|
+
| 事件日志 | state_manager.py | event_type, data | events_YYYY-MM.jsonl |
|
|
182
|
+
| 每日内容保存 | state_manager.py | content_type, content | daily/YYYY-MM-DD/*.json |
|
|
183
|
+
| 答案评估 | scorer.py | quiz.json + user_answers | results + updated state |
|
|
184
|
+
| XP计算 | scorer.py | correct_count, streak | XP with multiplier |
|
|
185
|
+
| 连胜更新 | gamification.py | study_date | new_streak |
|
|
186
|
+
| 等级更新 | gamification.py | XP | level |
|
|
187
|
+
| 徽章检查 | gamification.py | progress | new_badges |
|
|
188
|
+
| 联赛更新 | gamification.py | weekly_xp | league |
|
|
189
|
+
| 去重检查 | dedup.py | new_content, recent_content | is_duplicate |
|
|
190
|
+
|
|
191
|
+
### 4.2 核心工作流
|
|
192
|
+
|
|
193
|
+
#### 4.2.1 每日知识点生成
|
|
194
|
+
|
|
195
|
+
```
|
|
196
|
+
1. state_manager.load_state()
|
|
197
|
+
2. dedup.get_excluded_topics(state)
|
|
198
|
+
3. LLM生成知识点(使用prompt_templates.md)
|
|
199
|
+
4. dedup.check_duplicate(new_content, recent_content)
|
|
200
|
+
5. 验证JSON Schema
|
|
201
|
+
6. state_manager.save_daily_content('keypoint', content)
|
|
202
|
+
7. state_manager.append_event('keypoint_generated', {...})
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
#### 4.2.2 Quiz评估流程
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
1. state_manager.load_daily_content('quiz')
|
|
209
|
+
2. 读取 user_answers.json
|
|
210
|
+
3. scorer.evaluate_quiz(quiz, answers, state)
|
|
211
|
+
4. gamification.update_streak(state, today)
|
|
212
|
+
5. gamification.update_level(state)
|
|
213
|
+
6. gamification.check_badges(state)
|
|
214
|
+
7. state_manager.save_state(state)
|
|
215
|
+
8. state_manager.append_event('quiz_completed', results)
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## 5. 开发准则
|
|
219
|
+
|
|
220
|
+
### 5.1 Skill文档规范
|
|
221
|
+
|
|
222
|
+
- SKILL.md文档要详细但不能过长,聚焦核心步骤,细节可以放在代码示例里。建议**800-1500 tokens**。
|
|
223
|
+
- Skills 必须包含可执行的步骤、代码示例、验证检查点。
|
|
224
|
+
- 设计 Skills 时考虑复用性(模块化)。一个 Skill 解决一类问题,不是一次性的硬编码。
|
|
225
|
+
|
|
226
|
+
### 5.2 确定性验证器
|
|
227
|
+
|
|
228
|
+
每个任务都有**确定性验证器**(deterministic verifier):这不是用 LLM 评判,而是程序化断言。
|
|
229
|
+
|
|
230
|
+
| 验证项 | 验证方法 | 对应工具 |
|
|
231
|
+
|-------|---------|---------|
|
|
232
|
+
| JSON格式 | json.loads() | Python标准库 |
|
|
233
|
+
| JSON Schema | schema validation | templates/*.json |
|
|
234
|
+
| XP计算 | 公式验证 | scorer.py |
|
|
235
|
+
| 连胜更新 | 日期比较 | gamification.py |
|
|
236
|
+
| 去重检查 | 指纹/表达匹配 | dedup.py |
|
|
237
|
+
|
|
238
|
+
### 5.3 聚焦核心路径
|
|
239
|
+
|
|
240
|
+
不要过度工程化:比如应该聚焦 80% 场景的核心路径,而非覆盖尽可能多的edge cases。
|
|
241
|
+
|
|
242
|
+
### 5.4 可复用资源
|
|
243
|
+
|
|
244
|
+
| 资源 | 位置 | 用途 |
|
|
245
|
+
|-----|------|-----|
|
|
246
|
+
| skill-creator | github.com/anthropics/skills | 自动生成skill骨架 |
|
|
247
|
+
| awesome-language-learning | github.com/Vuizur/awesome-language-learning | 语言学习工具集合 |
|
|
248
|
+
| 主题资源库 | references/resources.md | 美剧/新闻/游戏/体育/职场/生活 |
|
|
249
|
+
| LLM提示模板 | references/prompt_templates.md | 知识点/Quiz生成模板 |
|
|
250
|
+
|
|
251
|
+
### 5.5 安装与使用
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
# 1. 添加官方Skills市场
|
|
255
|
+
/plugin marketplace add anthropics/skills
|
|
256
|
+
|
|
257
|
+
# 2. 安装skill-creator(可选,用于生成新skill)
|
|
258
|
+
/plugin install skill-creator@anthropic-agent-skills
|
|
259
|
+
```
|
package/README.md
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# eng-lang-tutor
|
|
2
|
+
|
|
3
|
+
**地道美式英语导师** - 一个用于学习地道美式英语表达的 OpenClaw Skill。
|
|
4
|
+
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
|
|
7
|
+
## 功能特性
|
|
8
|
+
|
|
9
|
+
- 📚 **每日知识点** - 地道美式表达,包含场景语境、可替换说法和中式英语陷阱
|
|
10
|
+
- 📝 **测验系统** - 4种题型:选择题、填空题、对话补全、中式英语修正
|
|
11
|
+
- 🎮 **多邻国风格游戏化** - XP经验值、等级、连胜、徽章、宝石
|
|
12
|
+
- ⏰ **可自定义推送时间** - 通过 cron 设置您偏好的推送时间
|
|
13
|
+
- 🌐 **双语支持** - 命令同时支持中英文
|
|
14
|
+
|
|
15
|
+
## 快速开始
|
|
16
|
+
|
|
17
|
+
### 前置条件
|
|
18
|
+
|
|
19
|
+
- 服务器上已安装 OpenClaw Gateway
|
|
20
|
+
- Python 3.8+
|
|
21
|
+
- Discord Bot(或其他 IM 通道)
|
|
22
|
+
|
|
23
|
+
### 安装步骤
|
|
24
|
+
|
|
25
|
+
1. **克隆到您的 OpenClaw skills 目录:**
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
cd ~/.openclaw/skills/
|
|
29
|
+
git clone https://github.com/rookiestar/eng-lang-tutor.git
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
2. **验证安装:**
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
openclaw skills list
|
|
36
|
+
openclaw skills info eng-lang-tutor
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
3. **配置渠道:**
|
|
40
|
+
|
|
41
|
+
**Discord 配置:**
|
|
42
|
+
```bash
|
|
43
|
+
openclaw config set discord.token YOUR_BOT_TOKEN
|
|
44
|
+
openclaw config set discord.guildId YOUR_SERVER_ID
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
4. **完成配对:**
|
|
48
|
+
|
|
49
|
+
首次向 Bot 发送消息时,您会收到一个配对码。批准它:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
openclaw pairing approve discord YOUR_PAIRING_CODE
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 首次使用
|
|
56
|
+
|
|
57
|
+
首次与 Bot 交互时,它会引导您完成 6 步引导流程:
|
|
58
|
+
|
|
59
|
+
1. 选择您的 CEFR 等级(A1-C2)
|
|
60
|
+
2. 选择您的兴趣主题
|
|
61
|
+
3. 选择导师风格(幽默/严谨/随意/专业)
|
|
62
|
+
4. 设置口语/书面语比例
|
|
63
|
+
5. 配置推送时间(知识点和测验时间)
|
|
64
|
+
6. 确认您的设置并创建定时任务
|
|
65
|
+
|
|
66
|
+
## 命令列表
|
|
67
|
+
|
|
68
|
+
| 命令 | 别名 | 描述 |
|
|
69
|
+
|---------|---------|-------------|
|
|
70
|
+
| `start` | `开始`, `初始化` | 启动引导配置 |
|
|
71
|
+
| `keypoint` | `知识点`, `today` | 查看今日知识点 |
|
|
72
|
+
| `keypoint history` | `知识点 历史` | 查看历史知识点 |
|
|
73
|
+
| `quiz` | `测验`, `test` | 参加每日测验 |
|
|
74
|
+
| `stats` | `进度`, `level` | 查看学习进度 |
|
|
75
|
+
| `config` | `设置` | 查看设置 |
|
|
76
|
+
| `errors` | `错题本` | 查看错题本 |
|
|
77
|
+
| `help` | `帮助` | 显示命令列表 |
|
|
78
|
+
|
|
79
|
+
## 推送时间配置
|
|
80
|
+
|
|
81
|
+
### 默认推送时间(UTC+8)
|
|
82
|
+
|
|
83
|
+
| 任务 | 时间 |
|
|
84
|
+
|------|------|
|
|
85
|
+
| 知识点 | 早上 6:45 |
|
|
86
|
+
| 每日测验 | 晚上 10:45 |
|
|
87
|
+
|
|
88
|
+
### 自定义推送时间
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
set schedule keypoint 7:00
|
|
92
|
+
set schedule quiz 21:00
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Crontab 设置
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# 编辑 crontab
|
|
99
|
+
crontab -e
|
|
100
|
+
|
|
101
|
+
# 添加定时任务
|
|
102
|
+
CRON_TZ=Asia/Shanghai
|
|
103
|
+
|
|
104
|
+
# 06:45 每日知识点
|
|
105
|
+
45 6 * * * openclaw system event --text "Use eng-lang-tutor skill. Push today's keypoint." --mode now
|
|
106
|
+
|
|
107
|
+
# 22:45 每日测验
|
|
108
|
+
45 22 * * * openclaw system event --text "Use eng-lang-tutor skill. Push today's quiz invitation." --mode now
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## 游戏化系统
|
|
112
|
+
|
|
113
|
+
### XP 与等级
|
|
114
|
+
|
|
115
|
+
本系统包含两个独立的等级体系:
|
|
116
|
+
- **能力等级 (CEFR)**:A1-C2,决定内容难度(语言能力水平)
|
|
117
|
+
- **活跃等级 (Level)**:1-20,衡量使用深度(使用进程)
|
|
118
|
+
|
|
119
|
+
| 等级范围 | 所需 XP | 阶段 |
|
|
120
|
+
|-------------|-------------|-------|
|
|
121
|
+
| 1-5 | 0-350 | 启程者 (Starter) |
|
|
122
|
+
| 6-10 | 550-2000 | 行路人 (Traveler) |
|
|
123
|
+
| 11-15 | 2600-6000 | 探索者 (Explorer) |
|
|
124
|
+
| 16-20 | 7200-15000 | 开拓者 (Pioneer) |
|
|
125
|
+
|
|
126
|
+
### 徽章
|
|
127
|
+
|
|
128
|
+
| 徽章 | 获取条件 | 宝石奖励 |
|
|
129
|
+
|-------|-------------|------|
|
|
130
|
+
| First Steps | 完成首次测验 | 10 |
|
|
131
|
+
| Week Warrior | 7天连胜 | 25 |
|
|
132
|
+
| Month Master | 30天连胜 | 100 |
|
|
133
|
+
| Perfect 10 | 10次满分测验 | 50 |
|
|
134
|
+
| Vocab Hunter | 学习100个表达 | 75 |
|
|
135
|
+
| Error Slayer | 清除30个错题 | 30 |
|
|
136
|
+
|
|
137
|
+
## 项目结构
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
eng-lang-tutor/
|
|
141
|
+
├── SKILL.md # Skill 文档
|
|
142
|
+
├── scripts/
|
|
143
|
+
│ ├── state_manager.py # 状态持久化与事件日志
|
|
144
|
+
│ ├── scorer.py # 答案评估与 XP 计算
|
|
145
|
+
│ ├── gamification.py # 连胜/等级/徽章逻辑
|
|
146
|
+
│ ├── dedup.py # 14天去重逻辑
|
|
147
|
+
│ ├── command_parser.py # 用户命令解析
|
|
148
|
+
│ └── cron_push.py # 定时内容推送
|
|
149
|
+
├── templates/
|
|
150
|
+
│ ├── state_schema.json # 状态 JSON Schema
|
|
151
|
+
│ ├── keypoint_schema.json # 知识点 JSON Schema
|
|
152
|
+
│ ├── quiz_schema.json # 测验 JSON Schema
|
|
153
|
+
│ └── prompt_templates.md # LLM Prompt 模板
|
|
154
|
+
├── references/
|
|
155
|
+
│ └── resources.md # 主题化学习资源
|
|
156
|
+
├── examples/
|
|
157
|
+
│ ├── sample_keypoint.json
|
|
158
|
+
│ └── sample_quiz.json
|
|
159
|
+
├── tests/
|
|
160
|
+
│ ├── conftest.py
|
|
161
|
+
│ ├── test_state_manager.py
|
|
162
|
+
│ ├── test_scorer.py
|
|
163
|
+
│ ├── test_gamification.py
|
|
164
|
+
│ ├── test_dedup.py
|
|
165
|
+
│ ├── test_command_parser.py
|
|
166
|
+
│ └── test_cron_push.py
|
|
167
|
+
└── data/
|
|
168
|
+
├── state.json # 运行时状态
|
|
169
|
+
├── logs/ # 事件日志
|
|
170
|
+
└── daily/ # 每日内容
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## 文档
|
|
174
|
+
|
|
175
|
+
- [SKILL.md](SKILL.md) - 完整 Skill 文档
|
|
176
|
+
- [OpenClaw 部署指南](docs/OPENCLAW_DEPLOYMENT.md) - 服务器部署
|
|
177
|
+
|
|
178
|
+
## 开发
|
|
179
|
+
|
|
180
|
+
### 运行测试
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
cd eng-lang-tutor
|
|
184
|
+
pytest tests/ -v
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### 运行演示
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
python3 scripts/command_parser.py --demo
|
|
191
|
+
python3 scripts/cron_push.py --task status
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## 服务器迁移
|
|
195
|
+
|
|
196
|
+
迁移到新服务器:
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
# 在源服务器上
|
|
200
|
+
cd ~/.openclaw/skills/
|
|
201
|
+
tar -czvf eng-lang-tutor-backup.tar.gz eng-lang-tutor/
|
|
202
|
+
|
|
203
|
+
# 传输到新服务器
|
|
204
|
+
scp eng-lang-tutor-backup.tar.gz user@new-server:~/
|
|
205
|
+
|
|
206
|
+
# 在目标服务器上
|
|
207
|
+
cd ~/.openclaw/skills/
|
|
208
|
+
tar -xzvf ~/eng-lang-tutor-backup.tar.gz
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
详细迁移指南请参见 [docs/OPENCLAW_DEPLOYMENT.md](docs/OPENCLAW_DEPLOYMENT.md)。
|
|
212
|
+
|
|
213
|
+
## 许可证
|
|
214
|
+
|
|
215
|
+
MIT License - 详见 [LICENSE](LICENSE)。
|
|
216
|
+
|
|
217
|
+
## 贡献
|
|
218
|
+
|
|
219
|
+
欢迎贡献!请随时提交 Pull Request。
|
|
220
|
+
|
|
221
|
+
## 致谢
|
|
222
|
+
|
|
223
|
+
- [awesome-language-learning](https://github.com/Vuizur/awesome-language-learning) - 资源灵感来源
|
|
224
|
+
- [Duolingo](https://www.duolingo.com) - 游戏化模型参考
|
package/README_EN.md
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# eng-lang-tutor
|
|
2
|
+
|
|
3
|
+
**地道美式英语导师** - An OpenClaw Skill for learning authentic American English expressions.
|
|
4
|
+
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- 📚 **Daily Knowledge Points** - Authentic American expressions with scene context, alternatives, and Chinglish traps
|
|
10
|
+
- 📝 **Quiz System** - 4 question types: multiple choice, fill blank, dialogue completion, Chinglish fix
|
|
11
|
+
- 🎮 **Duolingo-style Gamification** - XP, levels, streaks, badges, gems
|
|
12
|
+
- ⏰ **Customizable Schedule** - Set your preferred push times via cron
|
|
13
|
+
- 🌐 **Bilingual Support** - Commands work in both English and Chinese
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
### Prerequisites
|
|
18
|
+
|
|
19
|
+
- OpenClaw Gateway installed on your server
|
|
20
|
+
- Python 3.8+
|
|
21
|
+
- Discord Bot (or other IM channel)
|
|
22
|
+
|
|
23
|
+
### Installation
|
|
24
|
+
|
|
25
|
+
1. **Clone to your OpenClaw skills directory:**
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
cd ~/.openclaw/skills/
|
|
29
|
+
git clone https://github.com/rookiestar/eng-lang-tutor.git
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
2. **Verify installation:**
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
openclaw skills list
|
|
36
|
+
openclaw skills info eng-lang-tutor
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
3. **Configure Channel:**
|
|
40
|
+
|
|
41
|
+
**Discord Configuration:**
|
|
42
|
+
```bash
|
|
43
|
+
openclaw config set discord.token YOUR_BOT_TOKEN
|
|
44
|
+
openclaw config set discord.guildId YOUR_SERVER_ID
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
4. **Complete pairing:**
|
|
48
|
+
|
|
49
|
+
When you first message the bot, you'll receive a pairing code. Approve it:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
openclaw pairing approve discord YOUR_PAIRING_CODE
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### First Use
|
|
56
|
+
|
|
57
|
+
When you first interact with the bot, it will guide you through a 6-step onboarding:
|
|
58
|
+
|
|
59
|
+
1. Select your CEFR level (A1-C2)
|
|
60
|
+
2. Choose your topic interests
|
|
61
|
+
3. Select tutor style (humorous/rigorous/casual/professional)
|
|
62
|
+
4. Set oral vs written focus
|
|
63
|
+
5. Configure schedule (keypoint and quiz times)
|
|
64
|
+
6. Confirm your settings and create cron jobs
|
|
65
|
+
|
|
66
|
+
## Commands
|
|
67
|
+
|
|
68
|
+
| Command | Aliases | Description |
|
|
69
|
+
|---------|---------|-------------|
|
|
70
|
+
| `start` | `开始`, `初始化` | Start onboarding |
|
|
71
|
+
| `keypoint` | `知识点`, `today` | View today's knowledge point |
|
|
72
|
+
| `keypoint history` | `知识点 历史` | View historical keypoints |
|
|
73
|
+
| `quiz` | `测验`, `test` | Take daily quiz |
|
|
74
|
+
| `stats` | `进度`, `level` | View progress |
|
|
75
|
+
| `config` | `设置` | View settings |
|
|
76
|
+
| `errors` | `错题本` | View error notebook |
|
|
77
|
+
| `help` | `帮助` | Show commands |
|
|
78
|
+
|
|
79
|
+
## Schedule Configuration
|
|
80
|
+
|
|
81
|
+
### Default Schedule (UTC+8)
|
|
82
|
+
|
|
83
|
+
| Task | Time |
|
|
84
|
+
|------|------|
|
|
85
|
+
| Knowledge Point | 6:45 AM |
|
|
86
|
+
| Daily Quiz | 10:45 PM |
|
|
87
|
+
|
|
88
|
+
### Customize Schedule
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
set schedule keypoint 7:00
|
|
92
|
+
set schedule quiz 21:00
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Crontab Setup
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# Edit crontab
|
|
99
|
+
crontab -e
|
|
100
|
+
|
|
101
|
+
# Add scheduled tasks
|
|
102
|
+
CRON_TZ=Asia/Shanghai
|
|
103
|
+
|
|
104
|
+
# 06:45 Daily keypoint
|
|
105
|
+
45 6 * * * openclaw system event --text "Use eng-lang-tutor skill. Push today's keypoint." --mode now
|
|
106
|
+
|
|
107
|
+
# 22:45 Daily quiz
|
|
108
|
+
45 22 * * * openclaw system event --text "Use eng-lang-tutor skill. Push today's quiz invitation." --mode now
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Gamification
|
|
112
|
+
|
|
113
|
+
### XP & Levels
|
|
114
|
+
|
|
115
|
+
This system has two independent level systems:
|
|
116
|
+
- **Ability Level (CEFR)**: A1-C2, determines content difficulty (language proficiency)
|
|
117
|
+
- **Activity Level**: 1-20, measures engagement depth (usage progression)
|
|
118
|
+
|
|
119
|
+
| Level Range | XP Required | Stage |
|
|
120
|
+
|-------------|-------------|-------|
|
|
121
|
+
| 1-5 | 0-350 | Starter (启程者) |
|
|
122
|
+
| 6-10 | 550-2000 | Traveler (行路人) |
|
|
123
|
+
| 11-15 | 2600-6000 | Explorer (探索者) |
|
|
124
|
+
| 16-20 | 7200-15000 | Pioneer (开拓者) |
|
|
125
|
+
|
|
126
|
+
### Badges
|
|
127
|
+
|
|
128
|
+
| Badge | Requirement | Gems |
|
|
129
|
+
|-------|-------------|------|
|
|
130
|
+
| First Steps | Complete first quiz | 10 |
|
|
131
|
+
| Week Warrior | 7-day streak | 25 |
|
|
132
|
+
| Month Master | 30-day streak | 100 |
|
|
133
|
+
| Perfect 10 | 10 perfect quizzes | 50 |
|
|
134
|
+
| Vocab Hunter | Learn 100 expressions | 75 |
|
|
135
|
+
| Error Slayer | Clear 30 errors | 30 |
|
|
136
|
+
|
|
137
|
+
## Project Structure
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
eng-lang-tutor/
|
|
141
|
+
├── SKILL.md # Skill documentation
|
|
142
|
+
├── scripts/
|
|
143
|
+
│ ├── state_manager.py # State persistence & events
|
|
144
|
+
│ ├── scorer.py # Answer evaluation & XP
|
|
145
|
+
│ ├── gamification.py # Streak/level/badge logic
|
|
146
|
+
│ ├── dedup.py # 14-day deduplication
|
|
147
|
+
│ ├── command_parser.py # User command parsing
|
|
148
|
+
│ └── cron_push.py # Scheduled content push
|
|
149
|
+
├── templates/
|
|
150
|
+
│ ├── state_schema.json # State JSON Schema
|
|
151
|
+
│ ├── keypoint_schema.json # Keypoint JSON Schema
|
|
152
|
+
│ ├── quiz_schema.json # Quiz JSON Schema
|
|
153
|
+
│ └── prompt_templates.md # LLM prompt templates
|
|
154
|
+
├── references/
|
|
155
|
+
│ └── resources.md # Themed learning resources
|
|
156
|
+
├── examples/
|
|
157
|
+
│ ├── sample_keypoint.json
|
|
158
|
+
│ └── sample_quiz.json
|
|
159
|
+
├── tests/
|
|
160
|
+
│ ├── conftest.py
|
|
161
|
+
│ ├── test_state_manager.py
|
|
162
|
+
│ ├── test_scorer.py
|
|
163
|
+
│ ├── test_gamification.py
|
|
164
|
+
│ ├── test_dedup.py
|
|
165
|
+
│ ├── test_command_parser.py
|
|
166
|
+
│ └── test_cron_push.py
|
|
167
|
+
└── data/
|
|
168
|
+
├── state.json # Runtime state
|
|
169
|
+
├── logs/ # Event logs
|
|
170
|
+
└── daily/ # Daily content
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Documentation
|
|
174
|
+
|
|
175
|
+
- [SKILL.md](SKILL.md) - Full skill documentation
|
|
176
|
+
- [OpenClaw Deployment Guide](docs/OPENCLAW_DEPLOYMENT.md) - Server deployment
|
|
177
|
+
|
|
178
|
+
## Development
|
|
179
|
+
|
|
180
|
+
### Run Tests
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
cd eng-lang-tutor
|
|
184
|
+
pytest tests/ -v
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Run Demo
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
python3 scripts/command_parser.py --demo
|
|
191
|
+
python3 scripts/cron_push.py --task status
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Migration
|
|
195
|
+
|
|
196
|
+
To migrate to a new server:
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
# On source server
|
|
200
|
+
cd ~/.openclaw/skills/
|
|
201
|
+
tar -czvf eng-lang-tutor-backup.tar.gz eng-lang-tutor/
|
|
202
|
+
|
|
203
|
+
# Transfer to new server
|
|
204
|
+
scp eng-lang-tutor-backup.tar.gz user@new-server:~/
|
|
205
|
+
|
|
206
|
+
# On target server
|
|
207
|
+
cd ~/.openclaw/skills/
|
|
208
|
+
tar -xzvf ~/eng-lang-tutor-backup.tar.gz
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
See [docs/OPENCLAW_DEPLOYMENT.md](docs/OPENCLAW_DEPLOYMENT.md) for detailed migration guide.
|
|
212
|
+
|
|
213
|
+
## License
|
|
214
|
+
|
|
215
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
216
|
+
|
|
217
|
+
## Contributing
|
|
218
|
+
|
|
219
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
220
|
+
|
|
221
|
+
## Acknowledgments
|
|
222
|
+
|
|
223
|
+
- [awesome-language-learning](https://github.com/Vuizur/awesome-language-learning) - Resource inspiration
|
|
224
|
+
- [Duolingo](https://www.duolingo.com) - Gamification model reference
|