---
name: wecom-caldav-calendar
description: Read and manage enterprise WeCom calendar events via CalDAV when the user mentions 企业微信日历、企业微信日程、企微日历、工作日历, or asks about schedules that appear in Apple Calendar but are actually synced from WeCom/Exchange/CalDAV. Default to this skill before wecom_mcp when the user means their day-to-day WeCom calendar. Use for stable day/week lookups, keyword search, lightweight refresh before query, and CalDAV-based create/update/delete operations with WeCom-compatible TZ08 time formatting.
---

# WeCom CalDAV Calendar

Use this skill when the user wants schedules from 企业微信 / WeCom that are exposed through CalDAV rather than iCloud.

## What this skill does

- Read events from a WeCom CalDAV calendar collection
- Maintain a local cache/index so queries are fast
- Support day and week lookups without scanning thousands of ICS files every time
- Support keyword search in title, location, and description
- Support lightweight refresh before query to reduce stale results

## Files

- `scripts/wecom_caldav_query.py` — index and query script
- `references/config.example.json` — config template
- `references/config.json` — real local config (create this; do not commit secrets)
- `references/cache.json` — generated event cache

If `references/config.json` exists, the script reads it first.

## Recommended behavior

For user-facing queries, prefer a light incremental refresh first. That gives fresher data without full rescans.

## Routing rule

When the user means their day-to-day 企业微信 / 企微 / work calendar, default to this CalDAV skill first.
Use `wecom_mcp` only when the user explicitly asks for the official 企业微信接口 path, or when they need capability that CalDAV does not cover.

## Write safety and formatting

- Treat create / update / delete as external calendar writes and get explicit confirmation first.
- For writes, use the bundled write/update path with WeCom-compatible `TZID=TZ08` formatting.
- Do not write generic UTC-only ICS timestamps for WeCom calendar events; they may be parsed incorrectly.
- Preserve the title suffix ` (From OpenClaw)` for events created or modified by OpenClaw.

## Commands

### Incremental refresh

```bash
python3 skills/wecom-caldav-calendar/scripts/wecom_caldav_query.py index --recent 300
```

### Refresh then query today / tomorrow / this week

```bash
python3 skills/wecom-caldav-calendar/scripts/wecom_caldav_query.py refresh-and-query today --recent 80
python3 skills/wecom-caldav-calendar/scripts/wecom_caldav_query.py refresh-and-query tomorrow --recent 80
python3 skills/wecom-caldav-calendar/scripts/wecom_caldav_query.py refresh-and-query this-week --recent 120
```

### Query without refresh

```bash
python3 skills/wecom-caldav-calendar/scripts/wecom_caldav_query.py today
python3 skills/wecom-caldav-calendar/scripts/wecom_caldav_query.py tomorrow
python3 skills/wecom-caldav-calendar/scripts/wecom_caldav_query.py this-week
```

## Response formatting rule

When answering a WeCom calendar query, format each event with these fields when available:
- 时间
- 标题
- 地点（有就必须显示）
- 线上会议链接（有就必须显示）

If both a physical location and an online meeting link exist, show both instead of choosing only one.

### Query a specific day

```bash
python3 skills/wecom-caldav-calendar/scripts/wecom_caldav_query.py query-day 2026-03-25
```

### Query a custom range

```bash
python3 skills/wecom-caldav-calendar/scripts/wecom_caldav_query.py query-range 2026-03-25 2026-03-31
```

### Keyword search

```bash
python3 skills/wecom-caldav-calendar/scripts/wecom_caldav_query.py search 供应链 --refresh --recent 80
python3 skills/wecom-caldav-calendar/scripts/wecom_caldav_query.py search 战略月会 --start-day 2026-03-25 --end-day 2026-03-31
```

## Operating notes

- If results look stale, refresh before query.
- Prefer incremental refresh over full rescans.
- For routine user queries, use `refresh-and-query` by default.
- If the password changes, update `references/config.json`.
- For user-visible answers, always summarize with time and title.
- If an event has a location, explicitly show the location.
- If an event description or location contains an online meeting link (for example 腾讯会议 / 企业微信会议 / meeting.tencent.com / work.weixin.qq.com meeting links), explicitly show that meeting link too.
- Do not hide the meeting link just because it also appears inside a long description; extract and present it separately when possible.
