360 Secure SkillHub
360 安全技能中心

Jetlag Planner

通过 Node 脚本读取 Google 日历中的近期航班,计算昼夜节律调节方案并写回日历;运行前检查配置与授权文件,缺失时提示用户完成设置,最后以简短纯文本汇报发现的航班与创建的日程数量。

chadholdorf
chadholdorf
热度 56.23
最近更新 2026-05-11 17:29:40
分类:生活依赖:代码执行 / 读写文件 / 第三方 API应用场景:旅行 / 健康 / 日程安排

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add openclaw-jetlag
Metadata
name
jetlag-planner
description
Scans your Google Calendar for upcoming flights and writes a personalized circadian adjustment plan back to your calendar. Trigger with phrases like "check my flights", "run jetlag planner", "plan my trip adjustment", or "am I ready for my upcoming flight".

Run the jetlag planner by following these steps exactly.

Step 1 — Check for .env

Check whether the file ~/openclaw-jetlag/.env exists.

If it does not exist, stop immediately and reply:

⚠️ No .env file found in ~/openclaw-jetlag/. You need to add your Google OAuth credentials before I can run the planner. Follow the setup instructions in the README — ask me "show me the jetlag setup instructions" if you need them.

Step 2 — Check for .oauth-token.json

Check whether the file ~/openclaw-jetlag/.oauth-token.json exists.

If it does not exist, stop immediately and reply:

⚠️ Google authorization hasn't been completed yet. Run this once in your terminal to finish setup:

cd ~/openclaw-jetlag && node index.js

It will open a browser, ask you to sign in to Google, and save your authorization. After that, just say "check my flights" again and I'll handle it from here.

Step 3 — Run the planner

Run the following command and capture all output (stdout and stderr):

cd ~/openclaw-jetlag && node index.js

Step 4 — Report back

Reply with a short, plain-language Telegram-friendly summary. Do not dump raw output. Instead:

  • If flights were detected and plans were written, say which flights were found (route and date) and how many calendar events were created total.
  • If the output says no flight events were found, reply: "No upcoming flights found in your calendar for the next 90 days. If you have flights coming up, check that your airline confirmation emails are in the Gmail account linked to this calendar."
  • If flights were found but all were skipped (under 2-hour timezone shift), reply: "Found [N] flight(s) but all had under a 2-hour timezone shift, so no adjustment plan was needed."
  • If the command exited with a non-zero code or printed an error, relay the error message directly and suggest running cd ~/openclaw-jetlag && node index.js manually to see the full output.

Keep the reply under 5 sentences. No markdown headers in the Telegram reply — just plain text with line breaks between items if listing multiple flights.