Period Care Assistant
Overview
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:<staffId> or telegram:<userId>.
Handle User Identity
Build a stable userKey before touching storage.
- - Prefer the channel's immutable sender identifier.
- Prefix it with the transport, for example
telegram:123456, slack:U123, or dingtalk:manager123. - Do not use display names as the primary key unless there is no stable id.
- If the user is in a shared chat, keep records per person and confirm who the record belongs to before writing.
Record A New Period Start
When the user says anything equivalent to "月经来了", "今天来例假了", "帮我记一下今天来姨妈", or "记一下 2026-03-18 来月经":
- 1. Infer the start date from the message. If no date is given, use the user's local date and say which date was recorded.
- Run:
CODEBLOCK0
- 3. Read the returned JSON and reply with:
- the recorded start date,
- the predicted next start date,
- the reminder date,
- a short caring sentence.
- 4. If the user also gives reminder preference, timezone, route, or period length, include:
CODEBLOCK1
Answer Status Queries
When the user asks "我现在是什么周期", "帮我查一下月经周期", "下次大概什么时候来", or similar:
CODEBLOCK2
Explain the result in natural language:
- - current phase,
- days since last recorded start,
- predicted next start date,
- reminder status,
- confidence level and uncertainty when history is sparse or irregular.
Do not state medical certainty. Say the estimate is data-based, not a diagnosis.
Configure Reminder Delivery
The helper script stores reminder preferences and generates a one-shot cron plan.
Use:
CODEBLOCK3
Supported delivery modes in the helper:
- -
announce: for native OpenClaw chat delivery routes. - INLINECODE8 : for an external bridge or webhook endpoint.
- INLINECODE9 : keep the prediction but do not arm a delivery route yet.
If reminder delivery is configured, fetch the plan:
CODEBLOCK4
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.
Natural-Language Interaction Style
Keep the interaction short, warm, and explicit.
- - Accept colloquial Chinese such as "姨妈来了", "例假来了", "下次大概啥时候".
- After recording, confirm the exact date that was saved.
- If fewer than two historical records exist, explain that the next prediction is a provisional baseline.
- If the forecast confidence is low or the estimated error exceeds two days, say that clearly instead of overstating accuracy.
- If the user says the cycle is highly irregular, severe pain is present, or bleeding is unusual, suggest professional medical advice.
Privacy And Safety Rules
- - Never print or quote the encryption key.
- Keep raw history in the encrypted store only.
- Avoid putting full menstrual history into logs, commit messages, or public summaries.
- Share only the minimum needed in chat responses unless the user explicitly asks for the detailed history.
- If this skill is published to ClawHub, remember ClawHub is public. Publish code and instructions only, never real user data or secrets.
Read More Only When Needed
- - Read
{baseDir}/references/deployment.md when you need OpenClaw cron, ClawHub publish, or DingTalk transport notes. - Read
{baseDir}/references/model-and-privacy.md when you need the forecasting method, storage layout, or accuracy caveats.
经期护理助手
概述
使用 {baseDir}/scripts/period_tracker.mjs 中的辅助脚本进行所有读写操作,以确保经期历史记录、预测和提醒计划保持确定性。将所有周期数据本地存储、加密,并通过稳定的用户专属键(如 dingtalk: 或 telegram:)限定范围。
处理用户身份
在访问存储之前,构建一个稳定的 userKey。
- - 优先使用渠道的不可变发送者标识符。
- 为其添加传输方式前缀,例如 telegram:123456、slack:U123 或 dingtalk:manager123。
- 除非没有稳定ID,否则不要使用显示名称作为主键。
- 如果用户在共享聊天中,请按人分别保存记录,并在写入前确认记录归属。
记录新的经期开始
当用户说出类似月经来了、今天来例假了、帮我记一下今天来姨妈或记一下 2026-03-18 来月经等内容时:
- 1. 从消息中推断开始日期。如果未提供日期,则使用用户的本地日期,并告知记录的日期。
- 运行:
bash
node {baseDir}/scripts/period_tracker.mjs record --user --date --json
- 3. 读取返回的JSON并回复:
- 记录的起始日期,
- 预测的下次开始日期,
- 提醒日期,
- 一句简短的关怀语句。
- 4. 如果用户还提供了提醒偏好、时区、渠道或周期长度,请包含:
bash
node {baseDir}/scripts/period_tracker.mjs record --user --date --reminder-days 4 --timezone Asia/Shanghai --delivery-mode webhook --delivery-webhook https://example.invalid/reminder --json
回答状态查询
当用户询问我现在是什么周期、帮我查一下月经周期、下次大概什么时候来或类似问题时:
bash
node {baseDir}/scripts/period_tracker.mjs status --user --json
用自然语言解释结果:
- - 当前阶段,
- 自上次记录开始以来的天数,
- 预测的下次开始日期,
- 提醒状态,
- 当历史记录稀疏或不规律时的置信水平和不确定性。
不要陈述医学确定性。说明该估算是基于数据的,而非诊断。
配置提醒投递
辅助脚本存储提醒偏好并生成一次性cron计划。
使用:
bash
node {baseDir}/scripts/period_tracker.mjs configure --user --timezone Asia/Shanghai --reminder-days 4 --delivery-mode announce --delivery-channel telegram --delivery-to user:123456 --json
辅助脚本支持的投递模式:
- - announce:用于原生OpenClaw聊天投递渠道。
- webhook:用于外部桥接或webhook端点。
- none:保留预测但暂不启用投递渠道。
如果配置了提醒投递,请获取计划:
bash
node {baseDir}/scripts/period_tracker.mjs reminder-plan --user --json
然后创建或刷新一次性cron任务。优先使用JSON输出中的确定性任务名称。使用 schedule.kind = at 和生成的ISO时间戳。对于独立的投递任务,使用生成的提示文本作为 agentTurn.message。完整的cron JSON示例请参见 {baseDir}/references/deployment.md。
自然语言交互风格
保持交互简短、温暖且明确。
- - 接受口语化的中文表达,如姨妈来了、例假来了、下次大概啥时候。
- 记录后,确认保存的确切日期。
- 如果历史记录少于两条,说明下次预测是临时基线。
- 如果预测置信度较低或估计误差超过两天,请明确说明,不要夸大准确性。
- 如果用户表示周期极不规律、有严重疼痛或出血异常,建议寻求专业医疗建议。
隐私与安全规则
- - 切勿打印或引用加密密钥。
- 仅将原始历史记录保存在加密存储中。
- 避免将完整的月经历史记录放入日志、提交消息或公开摘要中。
- 除非用户明确要求详细历史记录,否则在聊天回复中仅分享最少必要信息。
- 如果此技能发布到ClawHub,请记住ClawHub是公开的。仅发布代码和说明,绝不发布真实的用户数据或密钥。
仅在需要时阅读更多
- - 当需要OpenClaw cron、ClawHub发布或钉钉传输说明时,请阅读 {baseDir}/references/deployment.md。
- 当需要预测方法、存储布局或准确性注意事项时,请阅读 {baseDir}/references/model-and-privacy.md。