Traffic Intelligence Skill
Overview
Provides real-time traffic monitoring, route calculation, and departure planning using TomTom Traffic API (2,500 free requests/day).
Prerequisites
- TomTom Developer Account: https://developer.tomtom.com/
- API Key from TomTom Traffic API
- Set environment variable:
export TOMTOM_API_KEY="your_key_here"
Configuration
Default locations are configured for Seattle/Bellevue area. Edit ./traffic-check.js to update:
CONFIG.locations: Set your home, work, and frequent destinations
CONFIG.buffers: Adjust parking, coffee, and meeting buffer times
Usage
Direct CLI Commands
# Check current commute (home → work)
node ./traffic-check.js check
# Plan departure for 8:00 AM meeting
node ./traffic-check.js meeting 08:00
# Test API connection
node ./traffic-check.js test
Integration with Meeting Alerts
The traffic module can be called from other scripts to enhance meeting alerts with real-time traffic data.
Example Integration
const TrafficIntelligence = require('./traffic-check.js');
const traffic = new TrafficIntelligence(process.env.TOMTOM_API_KEY);
// Get traffic-aware departure time for coffee meeting
const route = await traffic.calculateRoute(home, coffeeShop);
const meetingInfo = traffic.calculateDepartureTime(
meetingTime,
route.totalTimeMinutes,
{ meetingBuffer: 10 }
);
console.log(traffic.generateAlert(route, meetingInfo));
API Limits
- Free Tier: 2,500 requests/day
- Recommendation: Cache results for 5-10 minutes during peak hours
- Monitoring: Check TomTom dashboard for usage statistics
Error Handling
- Missing API key: Error message with setup instructions
- API failure: Graceful degradation with cached/last-known data
- Network issues: Retry logic with exponential backoff
Security Notes
- API key stored in environment variable (not in code)
- No sensitive location data logged
- Rate limiting to prevent accidental overuse
Future Enhancements
- Historical traffic patterns
- Weather integration (rain/snow impact)
- Multiple route alternatives
- Public transit integration
- Traffic camera status
Maintainer: Agent M
Last Updated: 2026-03-19
Status: Operational