Use the helper script at {baseDir}/scripts/period_tracker.mjs for all reads and writes so period history, forecasts, and reminder plans stay deterministic. Keep all cycle data local, encrypted, and scoped by a stable per-user key such as dingtalk: or telegram:.
Build a stable userKey before touching storage.
telegram:123456, slack:U123, or dingtalk:manager123.When the user says anything equivalent to "月经来了", "今天来例假了", "帮我记一下今天来姨妈", or "记一下 2026-03-18 来月经":
node "{baseDir}/scripts/period_tracker.mjs" record --user "<userKey>" --date "<YYYY-MM-DD>" --json
node "{baseDir}/scripts/period_tracker.mjs" record --user "<userKey>" --date "<YYYY-MM-DD>" --reminder-days 4 --timezone "Asia/Shanghai" --delivery-mode webhook --delivery-webhook "https://example.invalid/reminder" --json
When the user asks "我现在是什么周期", "帮我查一下月经周期", "下次大概什么时候来", or similar:
node "{baseDir}/scripts/period_tracker.mjs" status --user "<userKey>" --json
Explain the result in natural language:
Do not state medical certainty. Say the estimate is data-based, not a diagnosis.
The helper script stores reminder preferences and generates a one-shot cron plan.
Use:
node "{baseDir}/scripts/period_tracker.mjs" configure --user "<userKey>" --timezone "Asia/Shanghai" --reminder-days 4 --delivery-mode announce --delivery-channel "telegram" --delivery-to "user:123456" --json
Supported delivery modes in the helper:
announce: for native OpenClaw chat delivery routes.webhook: for an external bridge or webhook endpoint.none: keep the prediction but do not arm a delivery route yet.If reminder delivery is configured, fetch the plan:
node "{baseDir}/scripts/period_tracker.mjs" reminder-plan --user "<userKey>" --json
Then create or refresh a one-shot cron job. Prefer a deterministic job name from the JSON output. Use schedule.kind = "at" and the generated ISO timestamp. For isolated delivery jobs, use the generated prompt text as the agentTurn.message. See {baseDir}/references/deployment.md for a complete cron JSON example.
Keep the interaction short, warm, and explicit.
{baseDir}/references/deployment.md when you need OpenClaw cron, ClawHub publish, or DingTalk transport notes.{baseDir}/references/model-and-privacy.md when you need the forecasting method, storage layout, or accuracy caveats.共 1 个版本