english-learner
npx skills add https://github.com/learnwy/skills --skill english-learner
Agent 安装分布
Skill 文档
English Learner
Personal vocabulary learning assistant with persistent storage and mastery tracking.
Keywords (Special Commands)
| Keyword | Action |
|---|---|
å¦ä¹ / review / quiz |
Start interactive learning session |
stats / ç»è®¡ |
Show learning statistics |
All other input is treated as content to translate/learn (English, Chinese, or mixed).
Workflow
1. CHECK KEYWORD â If "å¦ä¹ "/"review"/"quiz" â Learning Mode
2. PARSE INPUT â Understand user intent (clarify if ambiguous)
3. IDENTIFY CONTENT â Extract word(s)/phrase(s)/sentence(s) into a list
4. IF AMBIGUOUS â AskUserQuestion to confirm before processing
5. BATCH LOOKUP â python vocab_manager.py batch_get '["word1", "word2", ...]'
6. AI GENERATES â For each "not_found" word, AI provides definition/phonetic/examples
7. BATCH SAVE â python vocab_manager.py batch_save '[{...}, {...}]'
8. LOG QUERY â python vocab_manager.py log_query <query> <type>
9. RESPOND â Unified format output
CRITICAL: Step 7 is MANDATORY. Every word/phrase MUST be saved before responding.
Input Clarification
If input is unclear or contains multiple items:
AskUserQuestion:
- question: "æçè§£ä½ æ³æ¥è¯¢ä»¥ä¸å
容ï¼è¯·ç¡®è®¤ï¼"
- header: "确认"
- options:
- label: "åè¯: apple, banana", description: "å嫿¥è¯¢è¿ä¸¤ä¸ªåè¯"
- label: "çè¯: break the ice", description: "æ¥è¯¢è¿ä¸ªçè¯"
- label: "å
¨é¨", description: "æ¥è¯¢ææå
容"
Scripts
All scripts in {skill_root}/scripts/. Data in ~/.english-learner/.
# vocab_manager.py - Single operations
python vocab_manager.py get_word <word>
python vocab_manager.py save_word <word> <definition> [phonetic] [examples_json]
python vocab_manager.py get_phrase "<phrase>"
python vocab_manager.py save_phrase "<phrase>" <definition> [phonetic] [examples_json]
python vocab_manager.py log_query <query> <type>
python vocab_manager.py stats
python vocab_manager.py update_mastery <item> <is_word:true/false> <correct:true/false>
# vocab_manager.py - Batch operations (PREFERRED for multiple words)
python vocab_manager.py batch_get '["word1", "word2", ...]'
python vocab_manager.py batch_save '[{"word": "...", "definition": "...", "phonetic": "...", "examples": [...]}]'
# sentence_parser.py
python sentence_parser.py classify <text>
python sentence_parser.py parse <sentence>
python sentence_parser.py batch_check <words>
# quiz_manager.py
python quiz_manager.py generate [count] [type] [focus]
python quiz_manager.py review [limit]
python quiz_manager.py summary
Unified Response Format
Word (åè¯)
Required fields: English, phonetic, definitions (all meanings), examples
ð **{english}** {phonetic}
**è¯ä¹ Definitions:**
1. **{pos1}** {chinese1}
- {example1_en}
- {example1_cn}
2. **{pos2}** {chinese2}
- {example2_en}
- {example2_cn}
**åä¹è¯:** {synonyms}
**åä¹è¯:** {antonyms}
---
ð æ¥è¯¢æ¬¡æ°: {lookup_count} | ææ¡åº¦: {mastery}%
Example:
ð **run** /rÊn/
**è¯ä¹ Definitions:**
1. **v.** è·ï¼å¥è·
- I run every morning.
- ææ¯å¤©æ©ä¸è·æ¥ã
2. **v.** è¿è¡ï¼è¿è½¬
- The program runs smoothly.
- ç¨åºè¿è¡é¡ºç
ã
3. **v.** ç»è¥ï¼ç®¡ç
- She runs a small business.
- 她ç»è¥ä¸å®¶å°å
¬å¸ã
4. **n.** è·æ¥ï¼ä¸æ®µè·¯ç¨
- I went for a run.
- æå»è·äºä¸åã
**åä¹è¯:** sprint, jog, operate
**åä¹è¯:** walk, stop
---
ð æ¥è¯¢æ¬¡æ°: 5 | ææ¡åº¦: 40%
Phrase (çè¯)
Required fields: English, phonetic, meaning, literal meaning, examples
ð **{english_phrase}** {phonetic}
**éä¹:** {chinese_meaning}
**å颿æ:** {literal_meaning}
**ä¾å¥:**
- {example1_en}
{example1_cn}
- {example2_en}
{example2_cn}
---
ð æ¥è¯¢æ¬¡æ°: {lookup_count} | ææ¡åº¦: {mastery}%
Example:
ð **break the ice** /breɪk Ã°É aɪs/
**éä¹:** æç ´åµå±ï¼æç ´æ²é»
**å颿æ:** æç ´å°å
**ä¾å¥:**
- He told a joke to break the ice at the meeting.
ä»å¨ä¼ä¸è®²äºä¸ªç¬è¯æ¥æç ´åµå±ã
- A good question can help break the ice.
ä¸ä¸ªå¥½é®é¢å¯ä»¥å¸®å©æç ´æ²é»ã
---
ð æ¥è¯¢æ¬¡æ°: 2 | ææ¡åº¦: 60%
Sentence (å¥å)
Required fields: Original, translation, phonetic guide, word/phrase breakdown
ð **å¥ååæ**
**åæ:** {original}
**è¯æ:** {translation}
**æè¯»:** {phonetic_guide}
---
**è¯æ±æè§£:**
{For each key word/phrase, use Word/Phrase format above}
Example:
ð **å¥ååæ**
**åæ:** The early bird catches the worm.
**è¯æ:** æ©èµ·çé¸å¿æè«åãï¼æ¯å»ï¼å¤å¥çäººææ¶è·ï¼
**æè¯»:** /Ã°É ËÉËli bÉËd ËkætÊɪz Ã°É wÉËm/
---
**è¯æ±æè§£:**
ð **early** /ËÉËli/
**è¯ä¹ Definitions:**
1. **adj.** æ©çï¼æåç
- I'm an early riser.
- ææ¯ä¸ªæ©èµ·ç人ã
---
ð **catch** /kætÊ/
**è¯ä¹ Definitions:**
1. **v.** æä½ï¼æè·
- The cat caught a mouse.
- ç«æä½äºä¸åªèé¼ ã
2. **v.** èµ¶ä¸ï¼è½¦ã飿ºçï¼
- I need to catch the 8am train.
- æéè¦èµ¶ä¸æ©ä¸8ç¹çç«è½¦ã
---
ð **worm** /wÉËm/
**è¯ä¹ Definitions:**
1. **n.** è«ï¼è è«
- Birds eat worms.
- é¸åè«åã
---
ð æ°å¢è¯æ±: early, catch, worm
Learning Mode (å¦ä¹ )
When user says å¦ä¹ / review / quiz:
1. python quiz_manager.py generate 5 all low_mastery
2. For EACH item:
AskUserQuestion #1:
- question: "ð **{word}** çæææ¯ä»ä¹ï¼"
- header: "Quiz"
- options:
- label: "认è¯", description: "æç¥éè¿ä¸ªè¯çææ"
- label: "模ç³", description: "æç¹å°è±¡ä½ä¸ç¡®å®"
- label: "ä¸è®¤è¯", description: "å®å
¨ä¸ç¥é"
3. Show answer (unified Word/Phrase format)
4. AskUserQuestion #2:
- question: "ææ¡ç¨åº¦å¦ä½ï¼"
- header: "Mastery"
- options:
- label: "å®å
¨ææ¡", description: "+10 mastery"
- label: "åºæ¬ææ¡", description: "+5 mastery"
- label: "éè¦å 强", description: "-5 mastery"
5. python vocab_manager.py update_mastery <item> true <result>
6. Continue or show summary
Data Structure
~/.english-learner/
âââ words/{prefix}.json # Words grouped by first 2 letters
âââ phrases/{first_word}.json
âââ history/{date}.json # Daily query logs
âââ memory/
âââ SOUL.md
âââ USER.md
Word Data Schema
{
"word": "run",
"definitions": [
{"pos": "v.", "meaning": "è·ï¼å¥è·", "examples": ["I run every morning."]},
{"pos": "v.", "meaning": "è¿è¡ï¼è¿è½¬", "examples": ["The program runs."]},
{"pos": "n.", "meaning": "è·æ¥", "examples": ["I went for a run."]}
],
"phonetic": "/rÊn/",
"synonyms": ["sprint", "jog"],
"antonyms": ["walk", "stop"],
"created_at": "2024-01-15T10:00:00",
"lookup_count": 5,
"mastery": 40
}
Stats Response Format
When user says stats / ç»è®¡:
ð **å¦ä¹ ç»è®¡**
| ç±»å« | æ°é |
|------|------|
| æ»è¯æ± | {total_words} |
| æ»çè¯ | {total_phrases} |
| å·²ææ¡ (â¥80%) | {mastered_words} |
| å¦ä¹ ä¸ (30-79%) | {learning_words} |
| æ°è¯æ± (<30%) | {new_words} |
| æ»æ¥è¯¢æ¬¡æ° | {total_lookups} |
Learning Mode – Empty Vocabulary
If quiz_manager.py returns empty list (no words to review):
ð **è¯åºä¸ºç©º**
è¿æ²¡ææ·»å ä»»ä½è¯æ±ãè¯è¯æ¥è¯¢ä¸äºåè¯æå¥åå§ï¼
**示ä¾:**
- è¾å
¥ `apple` æ¥è¯¢åè¯
- è¾å
¥ `break the ice` æ¥è¯¢çè¯
- è¾å
¥ä¸å¥è±ææä¸ææ¥ç¿»è¯åå¦ä¹
Execution Checklist (AI MUST Follow)
Before responding to user, verify:
- All words extracted from input (EN or CN)
- Batch lookup executed via
batch_get - New words SAVED via
batch_save(NOT optional!) - Query logged via
log_query - Response uses unified format
Common Mistake: Only logging query without saving words. FIX: Always run batch_save for new words.