Skill: jiajiaoy/daily-fitness (version 1.0.1)

--- name: daily-fitness description: "Daily no-equipment workout — 5–15 min bodyweight routines (HIIT, yoga, core, mobility) with instructions and streak tracking. Works at home, office, or travel." keywords: - 今日运动 - 每日锻炼 - 运动推荐 - 健身计划 - 快速运动 - 无器材训练 - 拉伸 - 办公室运动 - 瑜伽 - HIIT - 核心训练 - 有氧运动 - daily fitness - daily workout - quick workout - exercise routine - morning workout - no equipment workout - home workout - office workout - stretch - yoga - bodyweight workout metadata: openclaw: runtime: node: ">=18" --- # Daily Fitness / 今日运动 Generate a daily workout routine with visual exercise cards and a built-in timer. ## Workflow 1. **Get today's date** — Use day of week to determine workout focus: - Mon: Upper body (push-ups, planks, arm circles) - Tue: Core (crunches, leg raises, russian twists) - Wed: Lower body (squats, lunges, calf raises) - Thu: Cardio (jumping jacks, high knees, burpees) - Fri: Full body HIIT - Sat: Yoga/Flexibility - Sun: Active recovery/Stretching 2. **Design the routine** — Create 5-7 exercises, each with duration/reps, rest periods. Total time 8-12 minutes. No equipment needed. 3. **Generate the visual** — Create a single-file HTML artifact with interactive timer. ## Visual Design Requirements Create an energetic, app-like workout interface: - **Layout**: Scrollable card-based layout. Each exercise is a card with: name (EN + CN), duration/reps, brief description of form. - **Typography**: Bold, sporty fonts (e.g., Rajdhani, Exo 2, Barlow Condensed). High contrast. - **Color scheme**: Energetic palette — electric blue + neon green, or warm orange + dark gray. Match the workout type (calming blues for yoga, fiery reds for HIIT). - **Exercise cards**: Each card shows exercise name, duration ("30 seconds" / "12 reps"), form tip in 1 line, and a text-art or emoji representation of the movement. - **Interactive timer**: A START button at the top that begins a countdown through all exercises with rest intervals. Visual countdown circle. Audio beep (use Web Audio API for a simple tone) at transitions. - **Progress bar**: Shows overall workout progress. - **Stats**: Total workout time, estimated calories, difficulty level (⭐⭐⭐). - **Ad-ready zone**: `<div id="ad-slot-top">` above the workout. `<div id="ad-slot-bottom">` after completion. - **Footer**: "Powered by ClawCode" ## Content Guidelines - All exercises should be doable in a small space (apartment/office friendly) - No equipment required - Include form tips to prevent injury - Provide modifications (easier/harder) for at least 2 exercises - Bilingual exercise names and instructions ## Output Save as `/mnt/user-data/outputs/daily-fitness.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 Fitness — No-Equipment Daily Workout Skill

> 5–15 minute daily workout with interactive timer — no gym, no equipment needed.

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

## What it does

Daily Fitness recommends a fresh workout routine every day — bodyweight exercises you can do anywhere, with movement descriptions and a built-in timer. Routines rotate between cardio, strength, flexibility, and recovery so you're never doing the same thing twice in a row.

**Morning push** — today's workout plan with sets, reps, and rest times  
**Evening recap** — log completion, track streaks  
**Variety** — HIIT, yoga, core, mobility, office stretches  
**No equipment** — designed for home, office, or travel

## Installation

```bash
openclaw install daily-fitness
```

## Usage

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

## Keywords

daily workout · no equipment workout · home workout · quick workout · HIIT · bodyweight exercises · office workout · 每日锻炼 · 今日运动 · 健身 · 拉伸 · 无器械运动

---

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


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}。请生成：①今日运动打卡提醒②明天（${tomorrow_weekday}）运动预告——明日主题和3个代表动作预览③睡前5分钟拉伸方案（3个动作）。轻松温馨语气。`);


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}），请生成今日运动方案。根据星期确定主题（周一上肢/周二核心/周三下肢/周四有氧/周五全身/周六瑜伽/周日恢复），给出5-7个无器材动作，每个含名称（中英）、时长/组数、动作要领、难度选项。总时长8-12分钟。附激励语。`);


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