Build Travel History
Orchestrate flight extraction and timeline visualization to build travel history report
Note: Check today's date to determine the current year. The timeline should cover
from 3 years ago up to today's date (e.g., if today is January 2026, search from
January 2023 to January 2026).
Tell the user you're going to search their Gmail and Calendar for flight information
from the past 3 years to build a travel history timeline. Let them know this may take
a minute as you'll be fetching and analyzing data from multiple sources.
Merge the flight records from email and calendar sources.
Deduplicate by matching: same date + same route + same flight number.
Prefer email data for confirmation codes, calendar for times if email missing.
Build country-level timeline spans:
- After arriving in a country, user stays until next departure
- First flight's origin is assumed home base
- Combine consecutive days in same country
Write merged flight records to Merged Flight Records
Write timeline spans (for Gantt) to Timeline Input Data
Write the full travel history report to Travel History Report as markdown:
Travel History
Generated on {date}. Covers {date range}.
Summary
- Countries visited: X
- Total flights: X
- Total trips: X
- Longest stay: X days in {country}
Timeline

Trips
| Trip | Dates | Route | Days |
|---|---|---|---|
| ...detailed trip table... |
Flight Log
- Date - Flight: Origin → Destination
...chronological list...
Present the travel history to the user with key highlights:
- How many countries they visited
- Their most visited country
- Longest trip
- Total flights detected
Let them know the full report with visual timeline has been saved. Offer to
show specific trips or time periods in more detail.
To run this task you must have the following required information:
> Gmail and Google Calendar connections (used for flight extraction). Optional: time range (default: past 3 years).
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. Note: Check today's date to determine the current year. The timeline should cover
from 3 years ago up to today's date (e.g., if today is January 2026, search from
January 2023 to January 2026).
Tell the user you're going to search their Gmail and Calendar for flight information
from the past 3 years to build a travel history timeline. Let them know this may take
a minute as you'll be fetching and analyzing data from multiple sources.
2. [Gather Requirements for Extract Flights from Email] The next step has the following requirements: "Optional: number of years to search back (default 3), specific date range". Search the user's data for this information or ask them directly if needed. Do not proceed until you have this information.
3. [Execute Extract Flights from Email Task]: Spawn a subagent and provide it with the requirements gathered above and instructions to read `skills/sauna/[skill_id]/references/recipes/flight.emails.extract.md` for its task list
4. [Gather Requirements for Extract Flights from Calendar] The next step has the following requirements: "Optional: number of years to search back (default 3)". Search the user's data for this information or ask them directly if needed. Do not proceed until you have this information.
5. [Execute Extract Flights from Calendar Task]: Spawn a subagent and provide it with the requirements gathered above and instructions to read `skills/sauna/[skill_id]/references/recipes/calendar.flights.extract.md` for its task list
6. [Read Extracted Flight Records]: Read the file at `session/flight-records.json` into context (Email-extracted flights)
7. [Read Extracted Calendar Flights]: Read the file at `session/calendar-flights.json` into context (Calendar-extracted flights)
8. [Read Travel Report Format]: Read the documentation in: `skills/sauna/[skill_id]/references/travel.report.format.md` (Guide for merging data and building timeline)
9. Merge the flight records from email and calendar sources.
Deduplicate by matching: same date + same route + same flight number.
Prefer email data for confirmation codes, calendar for times if email missing.
Build country-level timeline spans:
- After arriving in a country, user stays until next departure
- First flight's origin is assumed home base
- Combine consecutive days in same country
Write merged flight records to `session/travel-merged.json`
Write timeline spans (for Gantt) to `session/timeline-data.json`
10. [Gather Requirements for Generate Timeline] The next step has the following requirements: "JSON data with records containing: label, startDate, endDate. Optional: category for grouping, title for the chart.". Search the user's data for this information or ask them directly if needed. Do not proceed until you have this information.
11. [Execute Generate Timeline Task]: Spawn a subagent and provide it with the requirements gathered above and instructions to read `skills/sauna/[skill_id]/references/recipes/timeline.chart.generate.md` for its task list
12. Write the full travel history report to `documents/travel-history.md` as markdown:
# Travel History
Generated on {date}. Covers {date range}.
## Summary
- Countries visited: X
- Total flights: X
- Total trips: X
- Longest stay: X days in {country}
## Timeline

## Trips
| Trip | Dates | Route | Days |
|------|-------|-------|------|
...detailed trip table...
## Flight Log
1. **Date** - Flight: Origin → Destination
...chronological list...
13. Present the travel history to the user with key highlights:
- How many countries they visited
- Their most visited country
- Longest trip
- Total flights detected
Let them know the full report with visual timeline has been saved. Offer to
show specific trips or time periods in more detail.