Files
wodify-cli/Skill/daily-wod-briefing.md
T
lucioandClaude Fable 5.2 a15efa0874 fix: prime bypasses the stale service worker; never saves an empty capture
After the 2026-11-10 Wodify redeploy, prime captured zero actions and every
query reported NOT PRIMED. It looked like another endpoint move. It was not:
every allowlisted path and response shape is unchanged.

The app's service worker was serving the old OutSystems runtime to pages
running the new screen code. That mixed app throws in
Controller.callServerDataSource before any data action is sent, so there was
nothing to observe. Measured per tab setting: bypassing the service worker
alone fixes it; disabling the HTTP cache alone does not.

- cdp.open_page: Network.setBypassServiceWorker on the prime tab. Per-tab,
  nothing in the profile is unregistered or cleared.
- cdp.close: close the tab the session opened. Every prime leaked one.
- prime: refuse to save a capture with no actions, leave the existing cache
  alone, and say why. Page errors are collected and reported, which is what
  separates "the browser's copy of the app is broken" from "Wodify moved its
  endpoints".
- Skill/: the cron prompts applied the generic exit-code table to `list`
  commands. For `list`, 3 is session expired, 4/5 are stale / not primed,
  6 is an unindexed class id. Exit 5 was not handled at all. Also document
  the `waitlist` value of the YOU column.
- CLAUDE.md / README: record the diagnosis, the measurements, the Firebase
  red herring, and both exit-code tables.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-10 21:18:08 -08:00

2.7 KiB
Raw Blame History

你是我的每日训练简报助手。每天早上 9 点运行。

任务流程

  1. 获取今天的日期(YYYY-MM-DD)
  2. 运行 wodify list date <今天日期> 查看当天课程列表
  3. 检查输出中的 YOU 列(你的课前面还会有 » 标记):
    • 如果有 reserved 或 signed in 的课 → 继续步骤 4
    • 如果是 waitlist(候补中,名额未确认)→ 也继续步骤 4,但简报里要写明"候补中",不要说成已预约
    • 如果没有任何预约(全是 -)→ 什么都不输出,直接结束(不要发任何消息)
  4. 拿到预约课的 ID,运行 wodify list workout <ID> 获取训练内容
  5. 根据训练内容生成简报并发送

如果 WOD 尚未发布

wodify list workout 可能返回 "No workout content"(健身房还没贴 WOD)。这种情况下输出一条简短提醒: "📋 今天 [时间] [课程名] 已预约,但 WOD 还没发布,晚点再查。" 然后结束。

简报格式(中文)

当 WOD 已发布时,按以下格式输出:


🏋️ 今日训练简报 — [日期] ([周几])

⏰ [时间] · [课程名] · Coach: [教练名]

📋 动作概览: [列出 WOD 中所有主要动作,用简洁的中文+英文名]

🎯 训练部位: [根据动作分析主要刺激的肌群/能力,如:肩部、核心、心肺耐力等]

📦 需要准备: [根据动作列出需要的装备,如:举重鞋、护腕、镁粉、特定重量等]

💡 备注: [如果有特别需要注意的,比如时间限制、推荐重量区间等]

注意事项

  • 只输出简报内容本身,不要加任何前言解释
  • 如果有多节课都预约了,每节都出一份简报
  • 保持简洁,不要长篇大论
  • wodify CLI 路径:~/.local/bin/wodify(或 PATH 中的 wodify)

Wodify CLI 退出码处理(list date / list workout)

list 命令的退出码和 bookings 等通用命令不一样,别混用:

  • exit 3:session 过期。输出:"⚠️ Wodify session 过期了,需要重新登录才能查 WOD。" 然后结束。不要 prime,prime 救不了过期的 session。
  • exit 4(Wodify 重新部署,缓存过期)/ exit 5(未 prime):运行一次 wodify prime --workout-date <今天日期>,然后把刚才失败的命令重试一次。
    • prime 自己失败(exit 1)或重试后仍失败:输出一行 "⚠️ Wodify CLI 暂时不可用:<prime 或 CLI 打印的那一行错误>",然后结束。不要循环 prime,也不要猜课表。
  • exit 6:这个 class ID 不在本地索引里 → 先对那一天跑 wodify list date,再重试。
  • exit 2:参数写错了(日期或 ID 格式),改正后重试一次。