SKILL.md
Trip Planner
You are helping a human plan a real, bookable trip. The goal is one cohesive plan they can hand to a booking agent (or you) and execute.
Inputs you need from the user (ask if any are missing):
from(IATA, e.g.LAX) andto(IATA, e.g.NRT) for the flight.startDate,endDate(YYYY-MM-DD).adults(default 1),children(default 0).budgetUsd— total trip cap (flights + hotel + activities, food estimated).vibe— one or two phrases describing what kind of trip (e.g. "foodie + temples + a couple of museums", "kid-friendly + nature", "design + nightlife").homeBase— preferred neighborhood/area for the hotel, if they have one. If not, pick based onvibe.
What you do (in this order):
1. Find the flight
Call POST https://proxy-monetize.fluxapay.xyz/api/flight-ticket-search/search with {from, to, date: startDate, returnDate: endDate, adults, children}. Each call costs $0.01. Pick the lowest-priced flight that fits a reasonable schedule (avoid >2 layovers unless cheaper by >40%). Record flightId and the price.
2. Find the hotel
Call GET https://proxy-monetize.fluxapay.xyz/api/travel-search/search-hotels?q=<homeBase>+<city>&checkindate=<startDate>&checkoutdate=<endDate>&adults=<adults>¤cy=USD&sort_by=8 (sort by rating). Cost $0.05.
Filter for:
- Rating ≥ 4.0
- Per-night price × nights ≤ 50% of remaining budget after flights
- Within the requested neighborhood (or close)
Pick the top match. Save the hotel's property_token and address. If the result set is empty, drop the neighborhood constraint and retry once. If still empty, tell the user and stop.
3. Find attractions and food
Call GET https://proxy-monetize.fluxapay.xyz/api/travel-search/search-places?q=things+to+do+in+<city> (cost $0.03) and again with q=top+restaurants+in+<city> (another $0.03).
From the combined results, pick:
- 2–3 attractions per day matching the
vibe - 2 restaurant options per day (lunch + dinner)
Skip anything closed on the date you'd assign it. Do not invent ratings — only show the ones SerpAPI returned.
4. Sequence the days and check transit times
For each day, build a sequence: hotel → attraction → lunch → attraction → dinner → hotel.
For each adjacent pair in the sequence, call GET https://proxy-monetize.fluxapay.xyz/api/travel-search/directions?startaddr=<A>&endaddr=<B>&travelmode=3 (transit; cost $0.01 each). Record formattedduration.
If any leg exceeds 45 minutes by transit, re-sequence the day so that day-stops cluster geographically. If you can't get everything under 45 min, drop the farthest stop and pick a closer alternative from the unused attractions.
5. Render the plan
Produce a single markdown block the user can save:
# <City> Trip · <startDate> – <endDate> · <N> days
## Flight
- <flight summary, total $X for adults/children>
- Outbound: <airline+number, dep→arr times>
- Return: <…>
## Hotel
- <Name> · <rating> · <neighborhood>
- <N> nights × $<rate> = $<total>
- <one-line why this hotel>
## Day 1 — <weekday, date>
- Morning · <attraction> · <transit min from hotel>
- Lunch · <restaurant> · <transit min from morning>
- Afternoon · <attraction> · <transit min from lunch>
- Dinner · <restaurant> · <transit min from afternoon>
## Day 2 — …
…
## Budget
| Item | Amount |
|------|--------|
| Flights | $X |
| Hotel | $Y |
| Activities (est.) | $Z |
| **Total** | **$T** |
End with: Total spend on this plan: $<sum-of-api-calls> (sum the $0.01 + $0.05 + $0.03 × 2 + $0.01 × number-of-direction-calls).
Payment
These endpoints require x402 settlement and pay from your FluxA mandate. The CLI handles the 402 challenge; if no mandate covers the worst case (estimate: $0.20 for short trips, $0.60+ for longer multi-day itineraries with many direction calls), the CLI will print an approval link. Pass it to the user, wait for them to sign, then resume.
flight-ticket-search/search additionally requires Authorization: Bearer <agent-vc> with aud=urn:flight402:api. Mint via:
VC=$(fluxa-wallet agent-vc --audience "urn:flight402:api" --challenge "flight402" --ttl 3600 | python3 -c "import sys,json; print(json.load(sys.stdin)['data']['vc'])")
planner call '...search' --method POST --data '{...}' --header "Authorization: Bearer $VC" --pay credits
The travel-search endpoints do NOT require a VC — the API key is injected server-side.
Edge cases
- No flight matches under the budget → tell the user, do not pad budget silently.
- Hotel results all over the per-night cap → present the cheapest with a flag that it busts the budget; let the user decide.
- A direction call returns no transit option → fall back to walking (
travel_mode=6); if walking >30 min, mark the leg as needing a taxi and note it in the day plan. - SerpAPI returns empty → retry once with a broader
q. If still empty, surface that to the user; don't fabricate places.
Do not
- Recommend a hotel you didn't get from
/search-hotels. No external memory. - Skip the directions step to save money. Transit timing is the value-add that turns a list into a plan.
- Book anything — that's a separate skill (
flight-ticket-search/orders) the user runs after they approve the plan.