task icon Task

Extract Flights from Calendar

Fetch calendar events and extract structured flight data

Requirements
Optional: number of years to search back (default 3)
4

Analyze the calendar events to extract flight data.

For each event that represents an actual flight, extract:

  • Departure city/airport and country
  • Arrival city/airport and country
  • Departure date and time
  • Arrival date/time (if available)
  • Airline and flight number (if visible in title/description)

Exclude events that are:

  • Meetings or calls (not actual flights)
  • Travel reminders without flight details
  • Ground transportation (trains, cars)

Write extracted flights to stateExtracted Calendar Flights as a JSON array
sorted by departure date. Use the same format as email extraction for
easy merging.

                    To run this task you must have the following required information:

> Optional: number of years to search back (default 3)

If you don't have all of this information, exit here and respond asking for any extra information you require, and instructions to run this task again with ALL required information.

---

You MUST use a todo list to complete these steps in order. Never move on to one step if you haven't completed the previous step. If you have multiple CONSECUTIVE read steps in a row, read them all at once (in parallel). Otherwise, do not read a file until you reach that step.

Add all steps to your todo list now and begin executing.

## Steps

1. [Gather Arguments: Fetch Calendar Flight Events] The next step has the following requirements for arguments, do not proceed until you have all the required information:
- `yearsBack` (default: "3"): 3
- `outputPath` (default: "session/calendar-flights.json"): session/calendar-events.json

2. [Run Code: Fetch Calendar Flight Events]: Call `run_script` with:

```json
{
  "file": {
    "path": https://sk.ills.app/code/calendar.flights.fetch/preview,
    "args": [
      "yearsBack",
      "outputPath"
    ]
  },
  "packages": null
}
```

3. [Read Calendar Flight Patterns]: Read the documentation in: `skills/sauna/[skill_id]/references/calendar.flight.patterns.md` (Guide for identifying and extracting flight data from calendar events)

4. [Read Calendar Flight Events]: Read the file at `session/calendar-events.json` into context (Pre-filtered calendar events)

5. Analyze the calendar events to extract flight data.

For each event that represents an actual flight, extract:
- Departure city/airport and country
- Arrival city/airport and country
- Departure date and time
- Arrival date/time (if available)
- Airline and flight number (if visible in title/description)

Exclude events that are:
- Meetings or calls (not actual flights)
- Travel reminders without flight details
- Ground transportation (trains, cars)

Write extracted flights to `session/calendar-flights.json` as a JSON array
sorted by departure date. Use the same format as email extraction for
easy merging.