From flight-optimizer
Search and score multi-leg flight itineraries using Duffel API with cost-duration-stop optimization
npx claudepluginhub varunr89/claude-marketplace --plugin flight-optimizerThis skill uses the workspace's default tool permissions.
Searches for multi-leg flight itineraries (e.g., Seattle -> Milan -> Hyderabad -> Seattle) using the Duffel API (with optional fast-flights Google Flights scraper fallback). Applies hard constraints and a weighted scoring model to rank results.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Performs token-optimized structural code search using tree-sitter AST parsing to discover symbols, outline files, and unfold code without reading full files.
Searches for multi-leg flight itineraries (e.g., Seattle -> Milan -> Hyderabad -> Seattle) using the Duffel API (with optional fast-flights Google Flights scraper fallback). Applies hard constraints and a weighted scoring model to rank results.
Use this skill when the user wants to search for flight options across multiple legs with constraint filtering and convenience-adjusted scoring.
DUFFEL_API_KEY=<your-key> python3 ${CLAUDE_PLUGIN_ROOT}/scripts/flight_optimizer.py
The script currently targets a specific trip (SEA -> MXP -> HYD -> SEA), but the functions are reusable for any multi-leg itinerary.
| Variable | Required | Description |
|---|---|---|
DUFFEL_API_KEY | Yes | Duffel API access token (live or test mode) |
The optimizer applies hard constraints to filter out unsuitable flights:
MAX_STOPS)MAX_LAYOVER_HOURS)Each flight leg is scored as:
leg_score = price + (duration_hours * $20) + (stops * $200)
Complete itineraries add a childcare penalty:
total_score = sum(leg_scores) + (weekdays_away * $200)
Scoring weights are configurable constants: COST_PER_HOUR, COST_PER_STOP, COST_PER_WEEKDAY.
The optimizer tries two strategies and ranks all results together:
flight_results_spring2026.json (top 30 itineraries)