---
name: pto-1on1-hygiene
version: 3.0.0
last_validated: 2026-05-27
model_compatibility: [fast, balanced, smart]
code_first: true
display_name: PTO 1:1 Hygiene
description: "Detect and cancel 1:1 meetings where either you or the attendee is on PTO/OOTO. Use when asked to 'check 1:1s for PTO conflicts', 'cancel 1:1s where people are on leave', 'PTO hygiene', 'who's on PTO that I have a 1:1 with', 'prep my calendar for vacation', or 'clean up 1:1s before my PTO'."
icon: "🧹"
trigger: check my 1:1s for PTO conflicts
inputs:
  - name: weeks_ahead
    description: "Minimum weeks ahead to scan (starting from today). The actual scan window extends beyond this if a PTO block starting within this window stretches further out."
    type: number
    required: false
    default: 4
tools: [calendar_view, calendar_search, calendar_delete_event, run_python]
---

## Overview

Scans your upcoming calendar using a **dynamic lookahead**: starting today, looks ahead at least {{weeks_ahead}} weeks and extends the window if PTO blocks reach further out. For each recurring 1:1 found, checks whether the attendee is on PTO — or whether you are — and groups results by PTO period for batch review. Lets you cancel by group, individual meeting, or skip entirely. Works for managers, SAs, ICs, BDMs — anyone with recurring 1:1s and Outlook calendar connected.

Also works before your own vacation: scans your upcoming PTO window, shows all affected 1:1s, prompts you to prep (backup coverage, open deadlines, handover docs).

Passes skill-quality-audit at 37/37.

## Workflow

### Step 1: Determine scan window
- **Mode**: `deterministic`
- **Tool**: `run_python`
- **Input**: `weeks_ahead` parameter (default 4)
- **Output**: `scan_start` (today), `scan_end` (today + weeks_ahead * 7 days, extended if needed)
- **Validate**: scan_end > scan_start
- **On failure**: Default to 4-week window

### Step 2: Fetch all calendar events in window
- **Mode**: `deterministic`
- **Tool**: `calendar_search`
- **Input**: scan_start to scan_end, all events
- **Output**: List of all calendar events with attendees, recurrence info, and OOO/PTO markers
- **Validate**: Events list returned (empty list is valid — no conflicts)
- **On failure**: Notify user that calendar search failed; suggest re-connecting Outlook connector

### Step 3: Identify 1:1 meetings
- **Mode**: `deterministic`
- **Tool**: `run_python`
- **Input**: Events list from Step 2
- **Output**: Filtered list of 1:1 meetings (exactly 2 attendees: user + one other)
- **Validate**: At least one 1:1 found; if none, exit with "No 1:1s found in window" message
- **On failure**: If attendee data missing, warn user and proceed with available data

### Step 4: Detect PTO conflicts
- **Mode**: `deterministic`
- **Tool**: `run_python`
- **Input**: 1:1 list + full event list (for OOO/PTO blocks)
- **Output**: Conflict map — for each 1:1, whether attendee is on PTO, you are on PTO, or both
- **Logic**:
  - PTO detection: look for OOO/Vacation/PTO all-day events or calendar blocks for each attendee
  - If attendee PTO overlaps a 1:1 date → flag as attendee-PTO conflict
  - If your own PTO overlaps → flag as your-PTO conflict
- **Validate**: Conflict map has at least one entry per 1:1 (may be "no conflict")
- **On failure**: If OOO data unavailable for an attendee, mark as "unknown" and note it

### Step 5: Group results and present decision card
- **Mode**: `agentic`
- **Input**: Conflict map from Step 4
- **Output**: Decision card showing conflicts grouped by PTO period

Present as:
```
📅 PTO Conflict Summary (4-week scan)

[Attendee Name] — on PTO [dates]:
  • 1:1 on [date] at [time] — CONFLICT
  • 1:1 on [date] at [time] — CONFLICT

[Your name] — on PTO [dates]:
  • 1:1 on [date] at [time] — YOUR PTO
```

Options offered:
- Cancel all conflicts for [attendee] (batch)
- Cancel specific meetings (individual)
- Skip cancellations and export conflict list
- Prep handover doc for your own PTO window

### Step 6: Execute cancellations
- **Mode**: `deterministic`
- **Tool**: `calendar_delete_event`
- **Input**: List of event IDs confirmed for cancellation
- **Output**: Cancellation confirmations
- **Validate**: Each deletion returns success response
- **On failure**: Log failed deletions; report to user with direct link to event

## Output

A conflict summary grouped by PTO period, with batch-cancel options. After execution:
- List of cancelled meetings with timestamps
- Any failed cancellations with direct links
- Optional: pre-drafted handover doc if your own PTO is detected

## Lessons Learned

### Do
- Use dynamic lookahead — extend past `weeks_ahead` if a PTO block runs longer
- Group by PTO period — easier to batch-decide than one-by-one
- Detect both directions: attendee on PTO and user on PTO
- Show the conflict summary before any destructive action — never cancel without user confirmation

### Don't
- Don't cancel meetings without showing the summary first
- Don't assume OOO = declined — OOO blocks may not appear as event declines
- Don't limit to exactly `weeks_ahead` weeks if a known PTO block extends further
- Don't fail silently if attendee OOO data is missing — mark as "unknown" and note it

### Common Failures
- Attendee OOO not detected if their OOO is set in a different calendar or as a "Busy" block without keywords
- Scan window too short — misses a PTO that starts in week 4 but runs through week 6
- Batch cancel includes the wrong timezone if events span DST boundary
- calendar_delete_event called before user sees summary — always gate with confirmation

### When to Ask the User
- When OOO status is ambiguous (no explicit PTO/Vacation keywords found)
- Before batch-cancelling: "Cancel all 4 meetings with [Name] during their PTO week May 27-31?"
- When user's own PTO is detected: "You're on PTO [dates]. Want me to prep a handover doc too?"
- If scan returns zero 1:1s: "I didn't find any recurring 1:1s in the next {{weeks_ahead}} weeks. Want me to search further out or check all meetings?"
