icalendar-recurrence-audit
Audit RFC 5545 .ics recurrence expansion read-only across RRULE, RDATE, EXDATE, RECURRENCE-ID overrides, cancellations, TZID DST transitions, floating times, and all-day events.
Try your first task
A source-grounded starter task has not been verified for this skill yet.
SKILL.md
name: icalendar-recurrence-auditdescription: "Audit RFC 5545 .ics recurrence expansion read-only across RRULE, RDATE, EXDATE, RECURRENCE-ID overrides, cancellations, TZID DST transitions, floating times, and all-day events."category: datarisk: safesource: selfsource_type: selfdate_added: "2026-12-01"author: Koushik-Katkamtags: [icalendar, ics, rfc5545, recurrence, rrule, timezone, dst, testing]iCalendar Recurrence Audit
Overview
Perform a strictly read-only, offline audit of RFC 5545 (.ics / VCALENDAR) recurrence expansion using maintained Python calendar libraries (icalendar, recurring-ical-events, python-dateutil, tzdata/zoneinfo) instead of custom regex or ad-hoc recurrence parsers. Computes exact local wall-clock timestamps and UTC instants inside a bounded date window and occurrence cap so DST shifts, excluded dates, overridden instances, cancellations, floating times, and all-day events are verified before ingestion or calendar sync.
Distinction from existing calendar skills:
outlook-calendar-automation: connects via Rube/Composio MCP to live Outlook accounts to create events, manage attendees, and send meeting invitations.google-calendar-automation: operates through an authenticated Google Calendar integration to inspect or write live user calendars.team-calendar: generates SME organizational templates (CSV, SQL DDL, Notion schemas) for shared team planning.- None of those inspect raw
.icsfiles offline for RFC 5545 recurrence correctness across DST boundaries,EXDATE,RDATE,RECURRENCE-ID, andSTATUS:CANCELLED.
When to Use
- Auditing
.icsfeeds, calendar export files, or ICS generators before syncing or importing schedules. - Verifying exact local and UTC timestamps across DST spring-forward / fall-back transitions (
TZID). - Testing
RRULE,RDATE,EXDATE,RECURRENCE-IDreschedules,STATUS:CANCELLEDexclusions, naive floating times, andVALUE=DATEall-day events without hitting live calendar APIs. - Do not use this skill to create calendar events, send invitations, or mutate remote Outlook/Google calendars (
outlook-calendar-automation,google-calendar-automation).
Prerequisites
- Python 3.10+ with maintained libraries (
icalendar==7.3.2,recurring-ical-events==3.8.2,python-dateutil==2.9.0.post0,tzdata==2026.6, pluspytestfor running fixtures). - Local
.icsinput bytes/paths, an explicit bounded evaluation window(window_start, window_end), and an explicitmax_occurrencesceiling. - No calendar credentials, CalDAV servers, or outbound network access required.
How It Works
1. Parse strictly with a maintained RFC 5545 library
- Read
.icsbytes read-only without rewriting or mutating the file. - Parse via
icalendar.Calendar.from_ical(...)(avoid custom line-unfolding orRRULEstring splitters). On invalid/unparseableVCALENDARinput, badRRULEsyntax, missingDTSTART, invalid window types, mixed timezone-aware + timezone-naive window bounds, non-positive-integermax_occurrences, or invalid window ordering, return structurederrors(human-readableerrorsplus machine-readablestructured_errorswithcode) rather than silently succeeding or raising.
2. Bound expansion and classify occurrence semantics
Run recurring_ical_events.of(cal, skip_bad_series=False).paginate(page_size=..., earliest_end=window_start, latest_start=window_end) so recurrence generation stops lazily at window_end or max_occurrences instead of materializing an unbounded expansion in memory:
- Active vs. cancelled instances:
recurring-ical-eventsreturnsRECURRENCE-IDoverride components carryingSTATUS:CANCELLED; separate those intocancelled_occurrencesrather than treating them as active instances. - Timezone-aware (
TZID/Z) occurrences: Preserve local wall-clock ISO string (local_iso) and compute exactutc_isoacross spring-forward and fall-back transitions. - Floating local times (
tzinfo=None): Flag with a warning and reportutc_iso = Nonebecause naive datetimes have no universal UTC instant without an assumed consumer timezone. - All-day events (
VALUE=DATE->datetime.date): Recordkind = "all_day"andutc_iso = Nonewithout attempting.astimezone(). - Bounded execution:
max_occurrencesbounds total inspected occurrences (active + cancelled); when more occurrences exist inside the window, marktruncated = Trueand stop inspecting before scanning further pages.
See icalendar recurrence harness for the runnable pytest audit module and synthetic fixtures.
3. Verify counts, cancellations, and byte preservation
Confirm expected active occurrence timestamps (local_iso and utc_iso), expected cancelled_occurrences, zero unexpected parser warnings, and identical file bytes before and after inspection.
Examples
Run the offline fixture suite in icalendar recurrence harness:
User request: "Audit our standup-series.ics across March and November 2026 DST transitions before import."
Inputs: Local .ics file, window [2026-03-06T00:00Z, 2026-03-13T00:00Z), max_occurrences=50.
Expected result: Spring-forward shifts UTC from 14:00:00Z (EST -05:00) to 13:00:00Z (EDT -04:00) while preserving
09:00 local wall clock; EXDATE removes 2026-03-07; RDATE adds 2026-03-11; RECURRENCE-ID shifts 2026-03-08 to
10:30:00-04:00 (14:30:00Z); STATUS:CANCELLED moves 2026-03-09 into cancelled_occurrences; floating and
all-day events report utc_iso=None; source .ics bytes remain unchanged.
Limitations
- Non-standard vendor properties (
X-WR-TIMEZONEwithout matchingVTIMEZONE/TZID), proprietary Outlook/Google recurrence extensions, and CalDAV sync semantics depend on client-specific interpretation beyond RFC 5545 core rules. - Window overlap semantics (pinned recurring-ical-events==3.8.2): the window
(window_start, window_end)(window_start < window_end) selects occurrences overlapping it, in chronological order, up tomax_occurrences. For non-empty occurrences an occurrence is inspected iffoccurrence_end > window_start AND occurrence_start <= window_end. Occurrences touching a boundary without overlapping are excluded; occurrences spanning either edge are included; under this pinned version an occurrence starting exactly atwindow_endis emitted; occurrences outside the window or past the cap are intentionally omitted. Window bounds must share timezone awareness. Callers needing strict half-open[window_start, window_end)on start should post-filteroccurrence_start < window_end. The capmax_occurrences(positive integer) bounds total inspected occurrences: active + cancelled;truncated = Truewhen more exist. Cancelled occurrences are not appended before the ceiling check. - Output limits vs hard limits:
max_occurrencesis an output/inspection limit, not a hard CPU/memory/time limit; expansion can still be expensive. Recommend an external execution timeout (subprocess kill,asyncio.wait_for,RLIMIT_CPU/RLIMIT_AS, sandbox) plus input size caps for unusually expensive or untrusted calendars. Read-only/offline is not sandboxing. - Floating local times cannot be pinned to UTC without an explicitly chosen reference timezone.
Safety and Side Effects
- Strictly read-only over local
.icsfiles and in-memory strings. - Never creates calendar events, sends invitations (
METHOD:REQUEST/CANCELdispatches), connects to Outlook/Google/CalDAV accounts, or modifies source.icsfiles.