| name | natbag |
| description | This skill should be used when the user asks about "Ben Gurion airport", "TLV flights", "flight status", "departures from Tel Aviv", "arrivals at TLV", "is my flight on time", "flight to Amsterdam", "airport delays", "cancelled flights", "gate info", "terminal 3", "pickup from airport", "weather at destination", "flight delay history", "ื ืชืืดื", "ืืืกืืช", "ืืื ืืืกืืช", "ืืฆื ืืืกื". Provides live flight data from Ben Gurion Airport (TLV), destination weather via Open-Meteo, and historical delay analysis via local SQLite database. Do NOT use for booking flights, non-TLV airports, or general travel planning.
|
| user-invocable | true |
| argument-hint | [departures|arrivals|LY001|delayed|weather <city>|history <airline>] |
| allowed-tools | ["Bash(curl)","Bash(python3)","Bash(sqlite3)","Read","Write"] |
Natbag โ Ben Gurion Airport Flights
Live flight data, destination weather, and historical analysis for Ben Gurion Airport (TLV/LLBG). Data from Israel's open data portal (data.gov.il), covering a rolling ~3-day window.
Query Workflow
Show step progress to the user as each step runs:
- Step 1: Fetching flights โ run
query_flights.py with appropriate filters
- Step 2: Getting weather โ fetch destination weather (for single flight or when relevant)
- Step 3: Checking history โ query historical stats (only if user asks about delays/patterns)
Not all steps run every time. Skip steps that aren't relevant to the query:
- Departure board โ Step 1 only
- "Is my flight on time?" โ Step 1 + Step 2
- "Are El Al flights usually delayed?" โ Step 3 only
- "Next flight to London with weather" โ Step 1 + Step 2
Display each step label before running it so the user sees progress.
Data Sources
- Live flights: data.gov.il API โ departures, arrivals, status, gates
- Weather: Open-Meteo API โ free, no API key โ current conditions at destination
- Historical: Local SQLite DB at
~/.natbag/flights.db โ accumulated via daily snapshots
Daily Snapshot (Automatic)
A PreToolUse hook runs snapshot.py automatically whenever this skill is invoked. On first run, it copies the shipped data/db.db (airlines + airports) to ~/.natbag/flights.db, adds the flights table, and fetches live flights. On subsequent runs, it self-guards: skips if it already ran today or if the user disabled snapshots.
After the first invocation, inform the user: "Natbag initialized. Flight data and IATA reference loaded. Historical data will accumulate automatically on each use. To disable daily snapshots, set daily_snapshot: false in ~/.natbag/config.json."
Replace SKILL_DIR with the resolved path to this skill's directory (where this SKILL.md lives).
Querying Live Flights
Use the composable query_flights.py script for live API queries:
python3 SKILL_DIR/scripts/query_flights.py --departures --date YYYY-MM-DD
python3 SKILL_DIR/scripts/query_flights.py --arrivals --date YYYY-MM-DD --upcoming
python3 SKILL_DIR/scripts/query_flights.py --arrivals --airline LY --date YYYY-MM-DD
python3 SKILL_DIR/scripts/query_flights.py --destination JFK --upcoming
python3 SKILL_DIR/scripts/query_flights.py --flight LY001
python3 SKILL_DIR/scripts/query_flights.py --status DELAYED
python3 SKILL_DIR/scripts/query_flights.py --search "London"
Flags can be combined. All scripts return JSON โ Claude handles formatting for the user.
CRITICAL: Always use --date YYYY-MM-DD when counting or listing flights for a specific day. Without it, the API returns a rolling ~3-day window, inflating counts. When --date is set, the script automatically pages through all API results before filtering, so counts are accurate. Replace YYYY-MM-DD with the actual date (e.g., 2026-04-03).
For raw API access, use curl directly โ see references/api.md for filter patterns.
Resolving Ambiguous Queries
The local DB at ~/.natbag/flights.db includes airlines and airports tables (from data/db.db) for resolving user input:
Output Fields
query_flights.py returns clean JSON with these fields:
| Field | Content |
|---|
| flight | Airline code + number (e.g., "LY 1008") |
| airline | Airline full name |
| date | Scheduled date (YYYY-MM-DD) |
| time | Scheduled time (HH:MM) |
| updated_time | Actual/updated time (compare with time to detect delays) |
| direction | "departure" or "arrival" |
| city / city_he | City name (English / Hebrew) |
| country / country_he | Country (English / Hebrew) |
| airport | IATA airport code |
| terminal | Terminal number |
| gate | Gate assignment (null if unassigned) |
| checkin_zone | Check-in zone (null if N/A) |
| status / status_he | Flight status (English / Hebrew) |
Full field reference and curl examples: see references/api.md.
For complete output examples: see examples/ (departure board, single flight, historical stats).
Destination Weather
After showing flight info, offer weather at the destination. Uses Open-Meteo (free, no key).
Steps:
- Get the
city field from the flight JSON (e.g., "BERLIN")
- Geocode:
curl -s 'https://geocoding-api.open-meteo.com/v1/search?name={city}&count=1'
- Extract
latitude and longitude from results[0]
- Fetch weather:
curl -s 'https://api.open-meteo.com/v1/forecast?latitude={lat}&longitude={lon}¤t_weather=true'
- Display: temperature, weather description, wind speed
Open-Meteo returns the most populated city match, so "Berlin" โ Berlin Germany (not Berlin NH). Tested and correct for all TLV route cities.
Weather codes: 0=Clear, 1-3=Partly cloudy, 45/48=Fog, 51-55=Drizzle, 61-65=Rain, 71-75=Snow, 80-82=Showers, 95=Thunderstorm.
Historical Analysis
Use the composable query_history.py script for historical queries:
python3 SKILL_DIR/scripts/query_history.py --coverage
python3 SKILL_DIR/scripts/query_history.py --ontime
python3 SKILL_DIR/scripts/query_history.py --ontime --airline LY
python3 SKILL_DIR/scripts/query_history.py --delays --route JFK
python3 SKILL_DIR/scripts/query_history.py --cancellations
python3 SKILL_DIR/scripts/query_history.py --airports London
python3 SKILL_DIR/scripts/query_history.py --airline-lookup "Wizz"
Add --days N to change the lookback period (default: 30). All output is JSON.
Flight Change History
Track how flights evolve over time โ status changes, time updates, gate reassignments:
python3 SKILL_DIR/scripts/query_history.py --flight-history LY001
python3 SKILL_DIR/scripts/query_history.py --delay-patterns
python3 SKILL_DIR/scripts/query_history.py --delay-patterns --airline LY
python3 SKILL_DIR/scripts/query_history.py --status-transitions
Change history accumulates from version 1.1.0 onward. Older flights (captured before the upgrade) will not have change records.
Use --flight-history when the user asks about a specific flight's progression. Use --delay-patterns when they ask about how early delays are typically announced. Use --status-transitions when they ask about flights that were delayed then cancelled, or other status paths.
If the database doesn't exist or is empty, inform the user: "Historical data accumulates from install date via daily snapshots. Run python3 SKILL_DIR/scripts/snapshot.py --force to start collecting now."
For custom SQL queries, use sqlite3 ~/.natbag/flights.db directly. The DB also has airlines, airports, and flight_changes tables for JOINs. See references/api.md for query patterns.
Output Formatting
Departure/Arrival Board
Ben Gurion Departures โ March 21, 2026
Time Flight Airline To Gate Status
14:10 LY 001 El Al London (LHR) B2-B4 ON TIME
14:30 IZ 1511 Arkia Larnaca (LCA) G11 DELAYED โ 15:04
15:00 6H 996 Israir Amsterdam (AMS) โ CANCELED
- Sort by
date + time
- For DELAYED flights, show
updated_time
- Use
โ for null gate/checkin_zone values
- Omit past flights (status DEPARTED/LANDED) unless the user explicitly asks for all
Single Flight Detail
Flight LY 001 โ El Al Israel Airlines
Route: Tel Aviv (TLV) โ London Heathrow (LHR)
Scheduled: 14:10 | Updated: 14:10
Terminal: 3 | Gate: B2-B4 | Check-in: B
Status: ON TIME
London Weather: 12ยฐC, Partly Cloudy, Wind 15 km/h
Historical Stats
El Al to JFK โ Last 30 Days (from local DB)
Total: 28 | On time: 19 (68%) | Avg delay: 22 min
Cancellations: 1 (3.6%)
Hebrew Support
When the user writes in Hebrew, respond in Hebrew and use the Hebrew fields from the JSON:
- City names:
city_he instead of city
- Country names:
country_he instead of country
- Status:
status_he instead of status
- Board header:
ืืื ืืืกืืช ื ืชื"ื โ ืืฆืืืืช / ืืืขืืช
Smart Behaviors
- "my flight": Ask for flight number or destination to narrow down
- Pickup planning: Show arrival time + suggest arriving 30 min after expected landing. If DELAYED, use
updated_time instead of time
- Delay detection: When
updated_time > time, calculate and show delay duration in minutes
- Weather proactively: When showing a single flight detail, include destination weather automatically
- First use: Mention that historical data accumulates over time via daily snapshots. The user can disable this in
~/.natbag/config.json by setting daily_snapshot: false
Snapshot Management
The scripts/snapshot.py script fetches current flights and stores them in SQLite:
- Runs automatically via PreToolUse hook on each skill invocation (self-guards to once daily)
python3 SKILL_DIR/scripts/snapshot.py --force to run manually anytime
- Opt-out: set
daily_snapshot: false in ~/.natbag/config.json
- First run copies shipped
data/db.db (airlines + airports) to ~/.natbag/flights.db
- Data deduplicates by airline+flight+scheduled time
- Status and gate info are updated on each snapshot
Gotchas
- Field names are cryptic: All fields start with CH (Hebrew abbreviation for "ืืืจื"/company). Always refer to the field reference, never guess. Common mistake: using
STATUS instead of CHRMINE.
- Rolling window inflates counts: API returns ~3 days of data, NOT just today. When counting flights for a specific day, ALWAYS pass
--date YYYY-MM-DD to filter. Without it, "how many flights today?" will return 3x the real number. This has caused wrong answers repeatedly.
- Uppercase values: Filter values must be uppercase.
filters={"CHRMINE":"delayed"} returns 0 results silently โ use "DELAYED". Same for airline codes: "ly" โ no results, "LY" โ works.
- API timeout: data.gov.il can be slow (5-15s). If
curl hangs, retry once. Error: curl: (28) Operation timed out โ fix with curl -s --max-time 30.
- Bad resource ID: Returns
{"success": false, "error": {"__type": "Not Found Error", "message": "ืื ื ืืฆื: Resource was not found."}}. Fix: verify the resource_id constant hasn't changed.
- Malformed filters JSON: Returns
{"success": false, "error": {"filters": ["Cannot parse JSON"], "__type": "Validation Error"}}. Fix: ensure filters value is valid JSON with properly escaped quotes in the URL.
- Empty result confusion:
"total": 0 with "success": true means the filter matched nothing โ not an error. Check: is the value uppercase? Is the field name correct? Is the flight within the 3-day window?
- Gate availability:
CHCINT and CHCKZN are often null for flights >24h away or for arrivals. Don't treat null gate as an error.
- "NOT FINAL": Many future flights show status "NOT FINAL" โ this means the schedule isn't confirmed yet, not that the flight is cancelled. Don't alarm the user.
- No booking: This skill provides information only. Cannot book, modify, or cancel flights. If asked, clearly say so.