skanetrafiken
npx skills add https://github.com/rezkam/boring-but-good --skill skanetrafiken
Agent 安装分布
Skill 文档
Skånetrafiken Trip Planner
Plan public transport journeys in Skåne, Sweden with real-time departure information.
Commands
1. Search Location
Search for stations, addresses, or points of interest.
./scripts/search-location.sh <query> [limit]
| Argument | Description |
|---|---|
query |
Location name to search for |
limit |
Number of results to show (default: 3, max: 10) |
Output includes:
ID– The location identifier (use this in journey search)Name– Official name of the locationType– STOP_AREA (station), ADDRESS, or POI (point of interest)Area– Region/municipalityCoordinates– Latitude, longitude
When to increase limit:
- First result doesn’t match user’s intent
- User’s query is ambiguous (e.g., “station”, “centrum”)
- Need to show user multiple options to choose from
2. Journey Search
Plan a journey between two locations using their IDs.
./scripts/journey.sh <from-id> <from-type> <to-id> <to-type> [datetime] [mode]
| Argument | Description |
|---|---|
from-id |
Origin location ID (from search) or coordinates (lat#lon) |
from-type |
STOP_AREA, ADDRESS, POI, or LOCATION (for coordinates) |
to-id |
Destination location ID or coordinates |
to-type |
Type of destination |
datetime |
Optional: "18:30", "tomorrow 09:00", "2026-01-15 09:00" |
mode |
Optional: "depart" (default) or "arrive" |
Important: The Journey API only accepts STOP_AREA and LOCATION types. For ADDRESS or POI results, use the coordinates as lat#lon with type LOCATION.
Understanding User Time Intent
Before searching, understand what the user wants:
Intent Types
| User Says | Intent | How to Query |
|---|---|---|
| “now”, “next bus”, “how do I get to” | Travel Now | No datetime parameter |
| “in 30 minutes”, “in 1 hour”, “after lunch” | Depart Later | Calculate time, use depart mode |
| “around 15:00”, “sometime afternoon” | Around Time | Query with offset (see below) |
| “arrive by 18:00”, “need to be there at 9” | Arrive By | Use arrive mode |
| “tomorrow morning”, “on Friday at 10” | Future Time | Use specific datetime |
Handling “Around Time” Queries
When user wants options “around” a time, query 15-30 minutes earlier to show options before and after:
# User: "I want to travel around 15:00"
# Query at 14:30 to get options spanning 14:30-16:00+
./scripts/journey.sh ... "14:30" depart
Relative Time Calculations
Convert relative times to absolute:
| User Says | Current: 14:00 | Query Time |
|---|---|---|
| “in 30m” | â | “14:30” |
| “in 1h” | â | “15:00” |
| “in 2 hours” | â | “16:00” |
LLM Response Formatting
When presenting journey results to users, use these emojis and formatting guidelines.
Emoji Reference
| Emoji | Use For |
|---|---|
| ð | Train (PÃ¥gatÃ¥g, ÃresundstÃ¥g) |
| ð | Bus |
| ð | Metro (Copenhagen) |
| ð | Tram |
| â´ï¸ | Ferry |
| ð¶ | Walking segment |
| â±ï¸ | Time/duration |
| ð | Departure time |
| ð | Arrival time |
| ð | Stop/station |
| ð | Origin (home/start) |
| ð¯ | Destination |
| â ï¸ | Delay or disruption |
| â | On time |
| ð | Transfer/change |
| ð¤ï¸ | Platform/track |
Response Structure
Always include these key elements from the tool output:
- When to leave – The actual time user needs to start (including walking)
- Walking segments – Distance and time for any walking
- Transport departure – When the bus/train actually leaves
- Arrival time – When user reaches destination
- Any delays – Show deviation from schedule
Example Response Format
For a simple direct journey:
ð **Leave home at 09:00**
ð¶ Walk 450m to MöllevÃ¥ngstorget (5 min)
ð **MöllevÃ¥ngstorget** â ð¯ **Malmö C**
ð Bus 5 departs 09:07 from MöllevÃ¥ngstorget
ð Arrives 09:18 at Malmö C
â±ï¸ Total: 18 min
For a journey with transfer:
ð **Leave at 08:45**
ð¶ Walk 300m to Västra Hamnen (4 min)
ð **Västra Hamnen** â ð **Malmö C** â ð¯ **Lund C**
**Leg 1:**
ð Bus 2 departs 08:51 [ð¤ï¸ Läge A]
ð Arrives Malmö C 09:05
ð Transfer at Malmö C (6 min)
**Leg 2:**
ð PÃ¥gatÃ¥g departs 09:11 [ð¤ï¸ SpÃ¥r 4]
ð Arrives Lund C 09:23
â±ï¸ Total: 38 min | ð 1 change
With delays:
ð **Depart 14:30** from Triangeln
ð ÃresundstÃ¥g 1042 â København H
â ï¸ +8 min delay (expected 14:38 instead of 14:30)
ð Arrives ~15:25 (normally 15:17)
Walking Segment Details
CRITICAL: Always show walking details from the tool output:
- Distance in meters (from
line.distance) - Include walking in the “leave time” calculation
- Show walking at start AND end of journey
Example tool output:
â WALK 450m from Kalendegatan to MöllevÃ¥ngstorget
Format as:
ð¶ Walk 450m to MöllevÃ¥ngstorget (~5 min)
Walk time estimate: ~100m per minute (normal walking speed)
Presenting Multiple Options
When showing journey options, make timing crystal clear:
I found 3 options for you:
**Option 1 - Leave now (09:00)** â
Recommended
ð¶ 5 min walk â ð Bus 5 at 09:07 â arrives 09:25
â±ï¸ Total: 25 min
**Option 2 - Leave in 15m (09:15)**
ð¶ 5 min walk â ð Bus 5 at 09:22 â arrives 09:40
â±ï¸ Total: 25 min
**Option 3 - Leave in 30m (09:30)**
ð¶ 5 min walk â ð Train at 09:37 â arrives 09:48
â±ï¸ Total: 18 min | Faster but later departure
Time Offset Notation
Use clear notation for departure times:
| Notation | Meaning |
|---|---|
| “now” | Immediately |
| “in 15m” | 15 minutes from now |
| “in 1h” | 1 hour from now |
| “at 14:30” | Specific time |
LLM Workflow: How to Plan a Trip
Follow this workflow when a user asks for a trip:
Step 1: Understand Time Intent
Parse what the user wants:
- “How do I get to…” â Travel now
- “I need to be there at 18:00” â Arrive mode
- “Sometime around 3pm” â Query 14:30, show range
- “In about an hour” â Calculate from current time
Step 2: Search for Both Locations
Search for origin and destination separately:
./scripts/search-location.sh "Malmö C"
./scripts/search-location.sh "Emporia"
Step 3: Validate Search Results
Check each result carefully:
-
Exact or close match? – If the name matches what the user asked for, proceed.
-
Multiple results returned? – The script shows up to 10 matches. If the first result isn’t clearly correct, ask the user to confirm.
-
Name significantly different? – If user asked for “the mall near Hyllie” and result shows “Emporia”, confirm with user: “I found Emporia shopping center near Hyllie. Is this correct?”
-
No results found? – Try alternative strategies (see below).
Step 4: Handle Ambiguous or Failed Searches
When results don’t match or are ambiguous, ask clarifying questions:
I searched for "centrum" and found multiple locations:
1. Malmö Centrum (bus stop)
2. Lund Centrum (bus stop)
3. Helsingborg Centrum (bus stop)
Which one did you mean?
When no results are found, try these strategies:
-
Try with city name for addresses:
# If "Storgatan 10" fails, try: ./scripts/search-location.sh "Storgatan 10, Malmö" -
Try official station names:
# If "Malmö station" fails, try: ./scripts/search-location.sh "Malmö C" -
Try landmark name only (without city):
# If "Emporia, Malmö" fails, try: ./scripts/search-location.sh "Emporia" -
Use coordinates as last resort:
- If you know the approximate location, use
lat#lonformat directly - Ask user: “I couldn’t find that location. Can you provide the address or coordinates?”
- If you know the approximate location, use
Step 5: Convert Types for Journey API
The Journey API only accepts:
STOP_AREA– Bus/train stations (use ID directly)LOCATION– GPS coordinates aslat#lon
If search returns ADDRESS or POI:
- Use the coordinates from search result
- Format as
lat#lonwith typeLOCATION
Example:
# Search returns: ID: 123, Type: ADDRESS, Coordinates: 55.605, 13.003
# Use in journey as:
./scripts/journey.sh "55.605#13.003" LOCATION 9021012080000000 STOP_AREA
Step 6: Execute Journey Search
Once you have confirmed IDs/coordinates for both locations:
./scripts/journey.sh <from-id> <from-type> <to-id> <to-type> [datetime] [mode]
Step 7: Format Response with Emojis
Use the emoji guide above to present results clearly. Always use actual numbers from the tool output – never speculate or estimate.
Query Formatting Rules
The search API is sensitive to formatting. Follow these rules:
Landmarks and POIs: Name Only
Use the landmark name WITHOUT city name.
# CORRECT
./scripts/search-location.sh "Emporia"
./scripts/search-location.sh "Triangeln"
./scripts/search-location.sh "Turning Torso"
# WRONG - city name breaks POI search
./scripts/search-location.sh "Emporia, Malmö" # May return wrong location!
./scripts/search-location.sh "Triangeln, Malmö" # Unnecessary, may fail
Street Addresses: Include City
Include city name for better accuracy.
# CORRECT
./scripts/search-location.sh "Kalendegatan 12, Malmö"
./scripts/search-location.sh "Storgatan 25, Lund"
./scripts/search-location.sh "Drottninggatan 5, Helsingborg"
# RISKY - may be ambiguous
./scripts/search-location.sh "Kalendegatan 12" # Works if unambiguous
Train Stations: Use Official Names
Use “C” suffix for central stations.
# CORRECT
./scripts/search-location.sh "Malmö C"
./scripts/search-location.sh "Lund C"
./scripts/search-location.sh "Helsingborg C"
./scripts/search-location.sh "Malmö Hyllie"
./scripts/search-location.sh "Malmö Triangeln"
# WRONG
./scripts/search-location.sh "Malmö" # Ambiguous!
./scripts/search-location.sh "Malmö Central" # Not official name
./scripts/search-location.sh "Lund station" # Not official name
Copenhagen (Cross-border)
Use Danish names or common alternatives.
# All work
./scripts/search-location.sh "København H"
./scripts/search-location.sh "Nørreport"
./scripts/search-location.sh "Copenhagen Airport"
./scripts/search-location.sh "Köpenhamn"
Examples
Example 1: Travel Now
User: “How do I get from Malmö C to Lund C?”
./scripts/search-location.sh "Malmö C"
./scripts/search-location.sh "Lund C"
./scripts/journey.sh 9021012080000000 STOP_AREA 9021012080040000 STOP_AREA
Response:
ð **Leave now** from Malmö C
ð **Malmö C** â ð¯ **Lund C**
ð ÃresundstÃ¥g 1324 departs 09:04 [ð¤ï¸ SpÃ¥r 2b]
ð Arrives 09:16 at Lund C [ð¤ï¸ SpÃ¥r 1]
â±ï¸ Total: 12 min | â
Direct, no changes
Example 2: Address with Walking
User: “I need to go from Kalendegatan 12 in Malmö to Emporia”
./scripts/search-location.sh "Kalendegatan 12, Malmö"
./scripts/search-location.sh "Emporia"
./scripts/journey.sh "55.595#13.001" LOCATION "55.563#12.973" LOCATION
Response:
ð **Leave at 10:05**
ð¶ Walk 320m to MöllevÃ¥ngstorget (~3 min)
ð **MöllevÃ¥ngstorget** â ð¯ **Emporia**
ð Bus 32 departs 10:10
ð Arrives 10:28 at Emporia
ð¶ Walk 150m to destination (~2 min)
â±ï¸ Total: 25 min
Example 3: Arrive By Time
User: “I need to be at Copenhagen central by 18:00 tomorrow”
./scripts/search-location.sh "Malmö C"
./scripts/search-location.sh "København H"
./scripts/journey.sh 9021012080000000 STOP_AREA 9921000008600626 STOP_AREA "tomorrow 18:00" arrive
Response:
ð¯ **Arrive by 18:00** at København H
ð **Malmö C** â ð¯ **København H**
ð ÃresundstÃ¥g departs **17:21** [ð¤ï¸ SpÃ¥r 1]
ð Arrives **17:56** â
4 min buffer
â±ï¸ Journey: 35 min
ð¡ Leave Malmö C by 17:21 to arrive on time!
Example 4: Around Time Query
User: “I want to travel to Lund around 15:00”
# Query 30 min earlier to show options around 15:00
./scripts/journey.sh 9021012080000000 STOP_AREA 9021012080040000 STOP_AREA "14:30"
Response:
Options around 15:00 for Malmö C â Lund C:
**Option 1 - Depart 14:34** (in 25m)
ð PÃ¥gatÃ¥g â arrives 14:52
â±ï¸ 18 min
**Option 2 - Depart 14:49** (in 40m)
ð ÃresundstÃ¥g â arrives 15:01
â±ï¸ 12 min
**Option 3 - Depart 15:04** (in 55m) â
Closest to 15:00
ð PÃ¥gatÃ¥g â arrives 15:22
â±ï¸ 18 min
Which works best for you?
Example 5: Relative Time
User: “I want to leave in about an hour”
# Current time: 13:00, so query for 14:00
./scripts/journey.sh ... "14:00"
Response:
Options departing around 14:00 (in ~1h):
**Leave at 13:55** (in 55m)
ð¶ 5 min walk â ð Bus 5 at 14:02 â arrives 14:25
**Leave at 14:10** (in 1h 10m)
ð¶ 5 min walk â ð Train at 14:17 â arrives 14:35
Let me know which one works!
Example 6: Journey with Delays
When tool output shows delays:
From: 14:30 Malmö C [+8 min late]
Response:
ð **Malmö C** â ð¯ **Lund C**
ð ÃresundstÃ¥g 1042
â ï¸ **Running 8 min late**
ð Scheduled: 14:30 â Expected: ~14:38
ð Arrives ~14:50 (normally 14:42)
When to Ask Clarifying Questions
Always ask when:
-
Search returns no results:
- “I couldn’t find [location]. Could you provide more details like the full address or nearby landmarks?”
-
Multiple plausible matches:
- “I found several locations matching ‘[query]’: [list]. Which one did you mean?”
-
Result name very different from query:
- “You asked for ‘[user query]’ but the closest match I found is ‘[result name]’. Is this correct?”
-
User request is vague:
- “From Malmö” – “Which location in Malmö? The central station (Malmö C), or a specific address?”
-
Cross-border ambiguity:
- “Copenhagen” could mean different stations – confirm if they want København H (central), Airport, or another station.
-
Time is unclear:
- “When do you want to travel? Now, or at a specific time?”
DateTime Formats
All times are Swedish local time (CET/CEST).
| Format | Example | Meaning |
|---|---|---|
| (empty) | Travel now | |
HH:MM |
"18:30" |
Today at 18:30 |
tomorrow HH:MM |
"tomorrow 09:00" |
Tomorrow at 09:00 |
YYYY-MM-DD HH:MM |
"2026-01-15 09:00" |
Specific date |
Output Format
Journey Option (Raw Tool Output)
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
OPTION 1: Malmö C â Lund C
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
Date: 2026-01-14
Depart: 09:04
Arrive: 09:16
Changes: 0
LEGS:
â ORESUND ÃresundstÃ¥g 1324
From: 09:04 Malmö C [Spår 2b]
To: 09:16 Lund C [Spår 1]
Direction: mot Helsingborg C
Transport Types
| Type | Emoji | Description |
|---|---|---|
TRAIN |
ð | PÃ¥gatÃ¥g (regional train) |
ORESUND |
ð | ÃresundstÃ¥g (cross-border train) |
BUS |
ð | City or regional bus |
WALK |
ð¶ | Walking segment |
TRAM |
ð | Tram/light rail |
METRO |
ð | Copenhagen Metro |
FERRY |
â´ï¸ | Ferry |
Status Indicators
| Indicator | Emoji | Meaning |
|---|---|---|
| (none) | â | On time |
[+X min late] |
â ï¸ | Delayed |
[-X min early] |
â¹ï¸ | Running early |
[PASSED] |
â | Already departed |
AVVIKELSE |
ð¨ | Service disruption |
Error Handling
“No locations found”
The search returned no results.
Strategies:
- Check spelling (Swedish: å, ä, ö)
- Try official station names with “C” for central
- For landmarks, remove city suffix
- For addresses, add city name
- Ask user for clarification
“No journeys found”
No routes available.
Strategies:
- Check if service operates at that hour (late night/early morning limited)
- Try different departure time
- Suggest alternative nearby stops
Quick Reference
| Location Type | Search Format | Journey Type |
|---|---|---|
| Train station | "Malmö C" |
STOP_AREA |
| Bus stop | "Möllevångstorget" |
STOP_AREA |
| Address | "Street 12, City" |
Use coords â LOCATION |
| Landmark/POI | "Emporia" (no city!) |
Use coords â LOCATION |
| Coordinates | 55.605#13.003 |
LOCATION |