← LeaderboardThe Skill Leaderboard

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.

Published by sickn33 ↗sickn33/agentic-awesome-skills

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 .ics files offline for RFC 5545 recurrence correctness across DST boundaries, EXDATE, RDATE, RECURRENCE-ID, and STATUS:CANCELLED.

When to Use

  • Auditing .ics feeds, 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-ID reschedules, STATUS:CANCELLED exclusions, naive floating times, and VALUE=DATE all-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, plus pytest for running fixtures).
  • Local .ics input bytes/paths, an explicit bounded evaluation window (window_start, window_end), and an explicit max_occurrences ceiling.
  • No calendar credentials, CalDAV servers, or outbound network access required.

How It Works

1. Parse strictly with a maintained RFC 5545 library

  1. Read .ics bytes read-only without rewriting or mutating the file.
  2. Parse via icalendar.Calendar.from_ical(...) (avoid custom line-unfolding or RRULE string splitters). On invalid/unparseable VCALENDAR input, bad RRULE syntax, missing DTSTART, invalid window types, mixed timezone-aware + timezone-naive window bounds, non-positive-integer max_occurrences, or invalid window ordering, return structured errors (human-readable errors plus machine-readable structured_errors with code) 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:

  1. Active vs. cancelled instances: recurring-ical-events returns RECURRENCE-ID override components carrying STATUS:CANCELLED; separate those into cancelled_occurrences rather than treating them as active instances.
  2. Timezone-aware (TZID / Z) occurrences: Preserve local wall-clock ISO string (local_iso) and compute exact utc_iso across spring-forward and fall-back transitions.
  3. Floating local times (tzinfo=None): Flag with a warning and report utc_iso = None because naive datetimes have no universal UTC instant without an assumed consumer timezone.
  4. All-day events (VALUE=DATE -> datetime.date): Record kind = "all_day" and utc_iso = None without attempting .astimezone().
  5. Bounded execution: max_occurrences bounds total inspected occurrences (active + cancelled); when more occurrences exist inside the window, mark truncated = True and 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-TIMEZONE without matching VTIMEZONE/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 to max_occurrences. For non-empty occurrences an occurrence is inspected iff occurrence_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 at window_end is 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-filter occurrence_start < window_end. The cap max_occurrences (positive integer) bounds total inspected occurrences: active + cancelled; truncated = True when more exist. Cancelled occurrences are not appended before the ceiling check.
  • Output limits vs hard limits: max_occurrences is 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 .ics files and in-memory strings.
  • Never creates calendar events, sends invitations (METHOD:REQUEST/CANCEL dispatches), connects to Outlook/Google/CalDAV accounts, or modifies source .ics files.

Sources and related skills