Skill: jiajiaoy/daily-vocab (version 1.0.1)

--- name: daily-vocab description: "One advanced English word every day — IPA pronunciation, etymology, 3 example sentences, and quiz mode. GRE / SAT / IELTS / C2 vocabulary level." keywords: - 每日词汇 - 今日单词 - 学个单词 - 每日一词 - 高级词汇 - GRE词汇 - SAT词汇 - 英语学习 - 词汇量 - 单词记忆 - daily vocab - daily vocabulary - word of the day - vocabulary - advanced vocabulary - GRE word - SAT word - English learning - etymology - flashcard metadata: openclaw: runtime: node: ">=18" --- # Daily Vocabulary / 每日词汇 Generate a beautiful vocabulary learning card featuring one advanced English word with complete learning materials. ## Workflow 1. **Get today's date** — Use date to determine word theme. Rotate themes weekly: Mon=emotions, Tue=science, Wed=art/culture, Thu=business, Fri=nature, Sat=philosophy, Sun=daily life. 2. **Select a word** — Choose an interesting, useful but not commonly known English word (GRE/SAT level or above). Use `web_search` to verify meaning and find authentic usage examples. Query: `"[word] definition etymology usage examples"`. 3. **Build the learning card** — Include: word, phonetic transcription, part of speech, definition (EN + CN), etymology/word roots, 3 example sentences (with CN translation), synonyms, antonyms, a memory tip. 4. **Generate the visual** — Create a single-file HTML artifact. ## Visual Design Requirements Create a flashcard-style learning interface: - **Layout**: Single large card, centered, with clear sections. Think premium language-learning app aesthetic. - **Typography**: The word itself in a large, beautiful display font (e.g., Crimson Text, Spectral, Libre Caslon). Phonetics in a monospace font. Body in clean sans-serif. - **Color scheme**: Soft, focus-friendly palette — muted blues/greens/warm grays. Alternate between light and dark themes based on day of week. - **Sections**: - Top: Word + Phonetics + Part of Speech - Definition block: EN definition, then CN translation - Etymology: Root breakdown with visual connectors - Examples: 3 sentences with key word highlighted - Bottom row: Synonyms | Antonyms | Memory Tip - **Interactivity**: Click the word to toggle between showing/hiding the Chinese translation (study mode). A "Quiz Me" button that hides the definition and shows it on click. - **Animation**: Card flips in on load. Sections reveal with stagger. - **Ad-ready zone**: `<div id="ad-slot-bottom">` below the card (min-height 90px). - **Footer**: "Powered by ClawCode" ## Word Selection Guidelines - Prefer words that are: elegant, useful in professional/academic contexts, have interesting etymologies - Avoid: obscure archaic words nobody uses, basic words everyone knows - Good examples: "ephemeral", "serendipity", "paradigm", "resilience", "ubiquitous", "cacophony" ## Output Save as `/mnt/user-data/outputs/daily-vocab.html` and present to user. --- ## 推送管理 ```bash # 开启每日推送（早晚各一次） node scripts/push-toggle.js on <userId> # 自定义时间和渠道 node scripts/push-toggle.js on <userId> --morning 08:00 --evening 20:00 --channel feishu # 关闭推送 node scripts/push-toggle.js off <userId> # 查看推送状态 node scripts/push-toggle.js status <userId> ``` 支持渠道：`telegram` / `feishu` / `slack` / `discord`

path: README.md
content: # Daily Vocab — English Vocabulary Learning Skill

> One advanced English word every day — pronunciation, etymology, examples, and quiz mode.

[![clawhub](https://img.shields.io/badge/clawhub-daily--vocab-blue)](https://clawhub.ai/skills/daily-vocab)
[![openclaw](https://img.shields.io/badge/openclaw-skill-orange)](https://openclaw.ai)

## What it does

Daily Vocab teaches one high-value English vocabulary word per day — the kind you'd need for GRE, SAT, IELTS, academic writing, or professional communication. Each card includes pronunciation (IPA), word origin, 3 example sentences, and an optional quiz to test retention.

**Daily card** — word, pronunciation, etymology, 3 example sentences  
**Quiz mode** — multiple choice or fill-in-the-blank  
**Level range** — B2 to C2 / GRE / SAT vocabulary  
**Visual** — flash card format for easy review

## Installation

```bash
openclaw install daily-vocab
```

## Usage

```bash
openclaw run daily-vocab morning
```

## Keywords

word of the day · daily vocabulary · GRE vocabulary · SAT words · advanced English · English learning · vocabulary builder · 每日词汇 · 今日单词 · 高级词汇 · 每日一词 · 学英语 · GRE词汇

---

Built for [OpenClaw](https://openclaw.ai) · Published on [clawhub.ai](https://clawhub.ai/skills/daily-vocab)


path: scripts/evening-push.js
content: #!/usr/bin/env node
'use strict';
const fs=require('fs'),path=require('path');
const USERS_DIR=path.join(__dirname,'../data/users');
const VOCAB_THEMES=["情感词汇", "科学词汇", "艺术文化", "商业词汇", "自然生态", "哲学词汇", "日常生活"];
function sanitizeId(v){if(typeof v!=='string'||!/^[a-zA-Z0-9_-]{1,128}$/.test(v)){console.error('❌ 无效userId');process.exit(1);}return v;}
function safeUserPath(u){const r=path.resolve(USERS_DIR,u+'.json');if(!r.startsWith(path.resolve(USERS_DIR)+path.sep)){console.error('❌ 非法路径');process.exit(1);}return r;}
function loadUser(u){const f=safeUserPath(u);return fs.existsSync(f)?JSON.parse(fs.readFileSync(f,'utf8')):{}}
const userId=sanitizeId(process.argv[2]||'default');
loadUser(userId);
const now=new Date();
const WEEKDAYS=['星期日','星期一','星期二','星期三','星期四','星期五','星期六'];
const MONTHS_EN=['January','February','March','April','May','June','July','August','September','October','November','December'];
const wd=now.getDay();
const date=`${now.getFullYear()}-${String(now.getMonth()+1).padStart(2,'0')}-${String(now.getDate()).padStart(2,'0')}`;
const weekday=WEEKDAYS[wd];
const month=now.getMonth()+1;
const day=now.getDate();
const month_en=MONTHS_EN[now.getMonth()];
const tomorrow_weekday=WEEKDAYS[(wd+1)%7];
const vocab_theme=VOCAB_THEMES[wd];
const tomorrow_vocab_theme=VOCAB_THEMES[(wd+1)%7];
console.log(`词汇晚间复习🌙今天是${date}（${vocab_theme}主题）。请出3道复习题：①词义选择②英文填空③场景应用选择。给出答案与解析。预告明日主题：${tomorrow_vocab_theme}，并给出1个神秘词汇线索。`);


path: scripts/morning-push.js
content: #!/usr/bin/env node
'use strict';
const fs=require('fs'),path=require('path');
const USERS_DIR=path.join(__dirname,'../data/users');
const VOCAB_THEMES=["情感词汇", "科学词汇", "艺术文化", "商业词汇", "自然生态", "哲学词汇", "日常生活"];
function sanitizeId(v){if(typeof v!=='string'||!/^[a-zA-Z0-9_-]{1,128}$/.test(v)){console.error('❌ 无效userId');process.exit(1);}return v;}
function safeUserPath(u){const r=path.resolve(USERS_DIR,u+'.json');if(!r.startsWith(path.resolve(USERS_DIR)+path.sep)){console.error('❌ 非法路径');process.exit(1);}return r;}
function loadUser(u){const f=safeUserPath(u);return fs.existsSync(f)?JSON.parse(fs.readFileSync(f,'utf8')):{}}
const userId=sanitizeId(process.argv[2]||'default');
loadUser(userId);
const now=new Date();
const WEEKDAYS=['星期日','星期一','星期二','星期三','星期四','星期五','星期六'];
const MONTHS_EN=['January','February','March','April','May','June','July','August','September','October','November','December'];
const wd=now.getDay();
const date=`${now.getFullYear()}-${String(now.getMonth()+1).padStart(2,'0')}-${String(now.getDate()).padStart(2,'0')}`;
const weekday=WEEKDAYS[wd];
const month=now.getMonth()+1;
const day=now.getDate();
const month_en=MONTHS_EN[now.getMonth()];
const tomorrow_weekday=WEEKDAYS[(wd+1)%7];
const vocab_theme=VOCAB_THEMES[wd];
const tomorrow_vocab_theme=VOCAB_THEMES[(wd+1)%7];
console.log(`今天是${weekday}（${date}），词汇主题：${vocab_theme}。请选一个该主题下的高级英语词汇（GRE/SAT级别），呈现：单词+音标+词性、中英定义、词源拆解、3个例句（含中译，关键词加粗）、近义词3个/反义词2个、记忆妙招1条。结尾出1道选择题，答案晚间揭晓。`);


path: scripts/push-toggle.js
content: #!/usr/bin/env node
'use strict';
const fs=require('fs'),path=require('path');
const SKILL='daily-vocab',DEFAULT_MORNING='08:00',DEFAULT_EVENING='21:00';
const USERS_DIR=path.join(__dirname,'../data/users');
const ALLOWED_CH=new Set(['telegram','feishu','slack','discord']);
function sanitizeId(v){if(typeof v!=='string'||!/^[a-zA-Z0-9_-]{1,128}$/.test(v)){console.error('❌ 无效userId');process.exit(1);}return v;}
function sanitizeTime(v,l){if(!/^\d{1,2}:\d{2}$/.test(v)){console.error('❌ 无效'+l);process.exit(1);}const[h,m]=v.split(':').map(Number);if(h>23||m>59){console.error('❌ 无效'+l);process.exit(1);}return{h,m};}
function safeUserPath(u){const r=path.resolve(USERS_DIR,u+'.json');if(!r.startsWith(path.resolve(USERS_DIR)+path.sep)){console.error('❌ 非法路径');process.exit(1);}return r;}
function loadUser(u){const f=safeUserPath(u);return fs.existsSync(f)?JSON.parse(fs.readFileSync(f,'utf8')):{}}
function saveUser(u,d){fs.mkdirSync(USERS_DIR,{recursive:true});fs.writeFileSync(safeUserPath(u),JSON.stringify(d,null,2),'utf8');}
function enablePush(userId,opts){
  userId=sanitizeId(userId);
  const user=loadUser(userId);
  const mt=opts.morning||user.morningTime||DEFAULT_MORNING;
  const et=opts.evening||user.eveningTime||DEFAULT_EVENING;
  const{h:mh,m:mm}=sanitizeTime(mt,'--morning');
  const{h:eh,m:em}=sanitizeTime(et,'--evening');
  const ch=opts.channel||user.channel||'telegram';
  if(!ALLOWED_CH.has(ch)){console.error('❌ 不支持渠道:'+ch);process.exit(1);}
  const sk=`agent:main:${ch}:direct:${userId}`;
  console.log('__OPENCLAW_CRON_ADD__:'+JSON.stringify({name:`${SKILL}-morning-${userId}`,cronExpr:`${mm} ${mh} * * *`,tz:'Asia/Shanghai',session:'isolated',sessionKey:sk,channel:ch,to:userId,announce:true,timeoutSeconds:180,message:`node ${path.join(__dirname,'morning-push.js')} ${userId}`}));
  console.log('__OPENCLAW_CRON_ADD__:'+JSON.stringify({name:`${SKILL}-evening-${userId}`,cronExpr:`${em} ${eh} * * *`,tz:'Asia/Shanghai',session:'isolated',sessionKey:sk,channel:ch,to:userId,announce:true,timeoutSeconds:180,message:`node ${path.join(__dirname,'evening-push.js')} ${userId}`}));
  saveUser(userId,{...user,morningTime:mt,eveningTime:et,channel:ch,pushEnabled:true,updatedAt:new Date().toISOString()});
  console.log(`\n✅ ${SKILL} 推送已开启\n⏰ 早推: ${mt}  🌙 晚推: ${et}  📡 渠道: ${ch}\n关闭: node push-toggle.js off ${userId}`);
}
function disablePush(userId){
  userId=sanitizeId(userId);
  console.log(`__OPENCLAW_CRON_RM__:${SKILL}-morning-${userId}`);
  console.log(`__OPENCLAW_CRON_RM__:${SKILL}-evening-${userId}`);
  const user=loadUser(userId);
  saveUser(userId,{...user,pushEnabled:false,updatedAt:new Date().toISOString()});
  console.log(`✅ ${SKILL} 推送已关闭`);
}
function showStatus(userId){
  userId=sanitizeId(userId);
  const u=loadUser(userId);
  console.log(`\n📡 ${SKILL} — ${userId}\n状态: ${u.pushEnabled?'✅ 开启':'❌ 关闭'}  早推: ${u.morningTime||DEFAULT_MORNING}  晚推: ${u.eveningTime||DEFAULT_EVENING}  渠道: ${u.channel||'telegram'}\n`);
}
if(require.main!==module)return;
const[cmd,uid,...rest]=process.argv.slice(2);
if(!cmd||!uid){console.log('用法: node push-toggle.js on|off|status <userId>');process.exit(1);}
const opts={};
const mi=rest.indexOf('--morning');if(mi!==-1)opts.morning=rest[mi+1];
const ei=rest.indexOf('--evening');if(ei!==-1)opts.evening=rest[ei+1];
const ci=rest.indexOf('--channel');if(ci!==-1)opts.channel=rest[ci+1];
if(cmd==='on')enablePush(uid,opts);
else if(cmd==='off')disablePush(uid);
else if(cmd==='status')showStatus(uid);
else{console.error('❌ 未知命令:'+cmd);process.exit(1);}


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (MEDIUM)