HK Transit ETA

v1.0.1

Query Hong Kong bus ETA/stop data and MTR heavy rail ETA from natural-language transport questions using official KMB/LWB, Citybus, and MTR open-data endpoin...

0· 178·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for jimpang8/hk-transit-eta.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "HK Transit ETA" (jimpang8/hk-transit-eta) from ClawHub.
Skill page: https://clawhub.ai/jimpang8/hk-transit-eta
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install hk-transit-eta

ClawHub CLI

Package manager switcher

npx clawhub@latest install hk-transit-eta
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
medium confidence
Purpose & Capability
The name and description (HK bus/MTR ETA) match the implementation: the script queries KMB/Long Win, Citybus, and MTR open-data endpoints and includes mappings for operators/lines. The required resources (no env vars, no external credentials) are proportionate to the described task.
Instruction Scope
SKILL.md confines runtime steps to running the bundled Python script and parsing user queries; it does not instruct the agent to read unrelated files, access secrets, or call unknown endpoints. The script itself performs only HTTP requests to official transit/open-data endpoints and CSV parsing, which matches the skill's stated scope.
Install Mechanism
There is no install spec (instruction-only with an included script). No remote downloads or archive extraction are present in the metadata. The script uses Python's standard library urllib to fetch data from public APIs; this is expected for the task.
Credentials
The skill requires no environment variables, credentials, or config paths. The script makes unauthenticated calls to public open-data endpoints; no secret access or unrelated credentials are requested.
Persistence & Privilege
The skill is not marked always:true and is user-invocable only. The code uses in-memory caching (lru_cache) and does not appear to persist data or modify other skill/system configurations. Autonomous invocation is allowed by default but is not unusually privileged here.
Assessment
This skill appears coherent: it ships a Python script that queries official HK transit open-data endpoints (data.etabus.gov.hk, rt.data.gov.hk, opendata.mtr.com.hk) and needs no credentials. Before installing, review the full script yourself (or run it in a sandbox) to confirm there are no hidden network calls or filesystem writes beyond what you expect. Confirm network access is acceptable (the script will make outbound HTTP(S) requests). If you need stronger assurance, provide the complete (non-truncated) source for review or run the script with network monitoring to observe which hosts it contacts. Also avoid running third‑party scripts as a privileged user.

Like a lobster shell, security has layers — review code before you run it.

latestvk97f2gbv0qyy25f4yjw91nr09983en99
178downloads
0stars
3versions
Updated 1mo ago
v1.0.1
MIT-0

HK Bus ETA / MTR ETA

Use the bundled script to answer Hong Kong bus route + stop queries and MTR heavy rail station + direction queries quickly and consistently.

Quick start

Run the bundled script from the skill directory:

Bus

Legacy bus invocation still works:

python3 scripts/hk_bus_eta.py <route> <stop-keyword>

Equivalent explicit subcommand:

python3 scripts/hk_bus_eta.py bus <route> <stop-keyword>

Examples:

python3 scripts/hk_bus_eta.py 74X 九龍灣
python3 scripts/hk_bus_eta.py bus A41 青衣 --operator lwb
python3 scripts/hk_bus_eta.py bus 20 啟德 --operator citybus
python3 scripts/hk_bus_eta.py bus 20 "Kai Tak" --operator citybus --direction outbound
python3 scripts/hk_bus_eta.py bus 74X 九龍灣 --direction outbound
python3 scripts/hk_bus_eta.py bus 74X 九龍灣 --json

MTR heavy rail

Structured station-to-station query:

python3 scripts/hk_bus_eta.py mtr <origin-station> <destination-station>

Natural-language prompt parsing:

python3 scripts/hk_bus_eta.py mtr-text "火炭站去金鐘方向幾點有車"

Examples:

python3 scripts/hk_bus_eta.py mtr 火炭 金鐘
python3 scripts/hk_bus_eta.py mtr 火炭 金鐘 --line EAL
python3 scripts/hk_bus_eta.py mtr-text "火炭站去金鐘方向幾點有車"
python3 scripts/hk_bus_eta.py mtr-text "金鐘去北角下一班港島線幾時"
python3 scripts/hk_bus_eta.py mtr-text "荃灣站往中環方向有冇車" --json

Or use an absolute path rooted at the installed skill folder if needed.

Extraction workflow

A. Bus queries

  1. Extract the route first.
    • Examples: 74X, A41, 20, NA31.
  2. Extract the stop or area keyword next.
    • Accept stop names, stations, estates, landmarks, districts, malls, piers, airports, hospitals, or short area names.
    • Treat messages like 74X 九龍灣幾耐到, A41 青衣站有冇車, 城巴20啟德幾時到 as route + place queries.
  3. Infer operator if the user says it explicitly.
    • 九巴--operator kmb
    • 龍運 / Long Win--operator lwb
    • 城巴 / Citybus--operator citybus
    • If the user does not say, default to KMB. If the route obviously looks like a Citybus-only route or the first attempt fails, retry with --operator citybus.
  4. If the user hints at direction or destination, pass it through.
    • 去機場, 往尖沙咀, outbound, 返去 often imply direction disambiguation.
    • Use --direction outbound or --direction inbound when the user's wording clearly prefers one side.
  5. Run the bus query.
  6. If multiple stop matches appear, summarize each clearly with operator, direction, stop name, sequence, and destination.
  7. Report ETA in natural language, usually in minutes first.
  8. If no match appears, say so and ask for a more specific stop name, estate, station, or direction.

B. MTR heavy rail queries

  1. Detect that the prompt is station + destination/direction based, not bus-route based.
    • Strong triggers: X站去Y方向, X去Y下一班, 往Y有冇車, X站到Y幾點有車.
  2. Extract the origin station and target station/direction anchor.
    • Examples:
      • 火炭站去金鐘方向幾點有車 → origin 火炭, target 金鐘
      • 金鐘去北角下一班港島線幾時 → origin 金鐘, target 北角, line hint ISL
      • 荃灣站往中環方向有冇車 → origin 荃灣, target 中環
  3. If the message names a line, pass it as --line.
    • Common mappings:
      • 東鐵線EAL
      • 港島線ISL
      • 荃灣線TWL
      • 觀塘線KTL
      • 將軍澳線TKL
      • 屯馬線TML
      • 東涌線TCL
      • 機場快綫 / Airport ExpressAEL
      • 南港島線SIL
      • 迪士尼線DRL
  4. Prefer mtr-text when the user phrased the request naturally and it fits the built-in patterns.
  5. If parsing feels ambiguous, use mtr <origin> <destination> directly instead of guessing from a messy sentence.
  6. The script resolves line/station mapping from the official MTR lines-and-stations CSV, then filters trains from the official MTR schedule endpoint that actually pass the requested target station.
  7. If multiple line candidates remain, list them instead of pretending certainty.

Reporting guidance

  • Prefer a concise answer like 74X 喺九龍灣下一班大約 3 分鐘後到。 or 火炭去金鐘方向下一班東鐵線大約 2 分鐘後到,4 號月台。
  • If there are multiple likely matches, list them instead of guessing.
  • If there is no ETA, say that clearly rather than implying no service.
  • Use --json only when structured output is easier for follow-up processing.

Operator / data-source notes

  • kmb: official data.etabus.gov.hk KMB endpoints.
  • lwb: handled through the same KMB-family endpoint structure used by Long Win routes in the KMB dataset.
  • citybus: official rt.data.gov.hk/v2/transport/citybus endpoints.
  • mtr: official rt.data.gov.hk/v1/transport/mtr/getSchedule.php endpoint plus the official MTR lines/stations CSV from opendata.mtr.com.hk.

Matching behavior

  • Bus stop matching is flexible substring/token matching against Traditional Chinese, Simplified Chinese, and English stop names.
  • MTR station matching is flexible against Chinese name, English name, and station code.
  • For MTR, destination matching is by path logic, not just terminal-code equality: trains are kept only if their displayed destination would carry the passenger past the requested target station on that line.
  • If the user gives only a broad area or a very ambiguous station name, refine from the returned candidates.

Scope and limitations

  • Bus coverage here remains KMB, Long Win, and Citybus only.
  • MTR coverage added here is heavy rail only. Light Rail, buses branded under MTR, and airport/feeder bus services are out of scope.
  • mtr-text handles common natural-language forms like X站去Y方向幾點有車, X去Y下一班, and X往Y有冇車; unusual phrasings may need manual extraction with mtr <origin> <destination>.
  • Very ambiguous interchange stations or cross-line phrasing may return multiple candidates and need clarification.
  • The script does not plan multi-leg journeys; it answers next-train ETA for a specific origin station toward a target station on a line that passes both.

scripts/

  • scripts/hk_bus_eta.py — query KMB/LWB/Citybus bus ETA, and MTR heavy rail ETA using either structured station arguments or a short natural-language MTR prompt.

Comments

Loading comments...