Skill: jiajiaoy/daily-recipe (version 1.0.1)

--- name: daily-recipe description: "Daily recipe recommendation — Chinese, Western, and fusion cuisines on rotation. Full ingredients, step-by-step instructions, 30–60 min home-cook meals." keywords: - 今日食谱 - 今天吃什么 - 做什么菜 - 食谱推荐 - 每日菜谱 - 晚餐吃什么 - 家常菜 - 菜谱 - 烹饪 - 午餐 - 早餐 - daily recipe - what to cook - recipe of the day - dinner ideas - lunch recipe - cooking - meal idea - home cooking metadata: openclaw: runtime: node: ">=18" --- # Daily Recipe / 今日食谱 Generate a beautiful daily recipe card with bilingual content and step-by-step cooking instructions. ## Workflow 1. **Get today's date** — Use day of week and season to determine cuisine: - Mon: Chinese home cooking (家常菜) - Tue: Japanese/Korean - Wed: Italian/Mediterranean - Thu: Southeast Asian (Thai/Vietnamese) - Fri: American/Mexican - Sat: French/European fine dining (simplified) - Sun: Brunch/Baking special - Season affects ingredients: light/cold dishes in summer, warm/hearty in winter. 2. **Select a dish** — Use `web_search` to find a specific recipe that fits today's theme. Query: `"easy [cuisine] recipe [season]"`. Pick something achievable in 30-60 min. 3. **Format the recipe** — Ingredients list, step-by-step instructions, cooking tips. All bilingual. 4. **Generate the visual** — Create a single-file HTML artifact. ## Visual Design Requirements Create a food-magazine quality recipe page: - **Layout**: Full-page editorial style. Hero section with dish name and description, then ingredients sidebar + steps main column. - **Typography**: Warm, editorial fonts (e.g., Playfair Display for titles, Nunito for body). Food should feel inviting. - **Color scheme**: Warm, appetizing palette — terracotta, olive, cream, warm brown. Or fresh palette for salads/light dishes — mint, white, light yellow. Rotate based on dish type. - **Recipe header**: Dish name (EN + CN, large), cuisine tag, prep time, cook time, servings, difficulty (1-3 🔥). - **Ingredients**: Clean list with checkboxes (interactive — click to mark as gathered). Quantities in both metric and imperial. - **Steps**: Numbered steps with clear formatting. Key actions bolded. Timer suggestions noted. - **Tips section**: Chef's tips, substitution suggestions, storage advice. - **Nutrition estimate**: Approximate calories, protein, carbs, fat per serving in a small info box. - **Ad-ready zone**: `<div id="ad-slot-sidebar">` in the ingredients column area. `<div id="ad-slot-bottom">` after the recipe. - **Footer**: "Powered by ClawCode" ## Content Guidelines - Recipes should be achievable by home cooks (not restaurant-level complexity) - Always include vegetarian substitution where possible - Chinese dishes should include authentic ingredients with common substitutes noted - Keep ingredient lists under 15 items - Steps should be clear and numbered (8-12 steps max) ## Output Save as `/mnt/user-data/outputs/daily-recipe.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 Recipe — Daily Recipe Recommendation Skill

> One curated recipe every day — Chinese and Western cuisines, with ingredients, steps, and visual card.

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

## What it does

Daily Recipe solves the "what should I cook today?" question with a fresh recipe recommendation every morning — alternating between Chinese home cooking, Western dishes, and fusion cuisine. Includes full ingredients list, step-by-step instructions, and estimated cook time.

**Morning push** — today's recipe with ingredients and steps  
**Variety** — Chinese, Western, and fusion cuisines on rotation  
**Practical** — designed for home cooks, 30–60 minute meals  
**Visual** — dish card format

## Installation

```bash
openclaw install daily-recipe
```

## Usage

```bash
openclaw run daily-recipe morning
openclaw run daily-recipe evening
```

## Keywords

daily recipe · recipe of the day · what to cook · dinner ideas · home cooking · Chinese cooking · 今日食谱 · 今天吃什么 · 做什么菜 · 食谱推荐 · 晚餐吃什么 · 家常菜

---

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


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}。推荐一道30分钟内可完成的快手菜：菜名（中英）、食材（≤8项）、5步极简做法。同时预告明天（${tomorrow_weekday}）的菜系主题，勾起期待。轻松愉快语气。`);


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}），请推荐今日菜谱。轮换菜系（周一中式家常/周二日韩/周三意式/周四东南亚/周五美式/周六法式/周日早午餐）。搜索一道具体菜品，给出：菜名（中英）、难度🔥、时间、食材（≤12项）、步骤（8-10步）、大厨贴士2条、素食替代方案。中英双语。`);


path: scripts/push-toggle.js
content: #!/usr/bin/env node
'use strict';
const fs=require('fs'),path=require('path');
const SKILL='daily-recipe',DEFAULT_MORNING='08:30',DEFAULT_EVENING='17:30';
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 (HIGH)