hk-route

Smart public transport routing for Hong Kong with real-time bus ETAs. Queries Google Maps for transit alternatives, enriches bus legs with live arrival times, and ranks routes by effective total time.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "hk-route" with this command: npx skills add 7ito/hkroute

HK Route — Hong Kong Transit Routing with Real-Time ETAs

What this skill does

Finds the best public transport route in Hong Kong by combining Google Maps directions with real-time bus ETAs. Routes are ranked by effective total time (real-time wait + travel duration), not just schedule data.

Required environment

RequirementDetails
GOOGLE_MAPS_API_KEYGoogle Maps API key with Directions API enabled
node >= 18Runtime for the bundled script

External endpoints

This skill makes network requests to:

EndpointPurposeCredentials
maps.googleapis.com (Google Directions API)Transit route planningGOOGLE_MAPS_API_KEY
HK government & operator APIs via hk-bus-eta (DATA.GOV.HK, KMB, CTB, etc.)Real-time bus arrival timesNone (public APIs)

No other network calls are made. The ETA database is cached locally at ~/.cache/hk-route/etaDb.json (refreshed every 24h).

Source code

The bundled scripts/hk-route.cjs is built from readable TypeScript source at github.com/7ito/hkroute. Build command: esbuild src/index.ts --bundle --platform=node --format=cjs.

How to invoke

node /path/to/skill/scripts/hk-route.cjs \
  --origin "<origin>" \
  --destination "<destination>"

The scripts/hk-route.cjs bundle is self-contained — no npm install needed. Just node >= 18.

Optional flags

  • --departure-time "<ISO 8601 datetime>" — plan a future trip (e.g., --departure-time "2026-03-26T08:00:00+08:00")

Input formats

  • Coordinates: "22.2822,114.1875" (lat,lng — no space after comma)
  • Place name: "Causeway Bay", "Hong Kong Airport", "Stanley Market"
  • Both origin and destination accept either format.

Conversational flows

One-shot (user provides both locations)

User: "How do I get from Causeway Bay to Stanley?" → Run the CLI with --origin "Causeway Bay" --destination "Stanley", format the output.

Multi-turn (e.g., WhatsApp via OpenClaw)

  1. User sends /hkroute
  2. Ask: "Where are you now? Send a location pin or type your location."
  3. User sends a coordinate pin (e.g., 22.2822,114.1875) or text (e.g., "Tin Hau MTR")
  4. Ask: "Where do you want to go?"
  5. User sends destination as text or coordinates.
  6. Run the CLI, format the output.

If the user provides invalid input at any step, ask them to try again with a valid location.

Implicit activation

Activate this skill when the user asks about getting somewhere in Hong Kong by public transport, even without using /hkroute. Look for intent like "how do I get to...", "best way to...", "bus from...", etc., in a Hong Kong context.

Output format

The CLI outputs JSON to stdout. Format it for the user as follows:

WhatsApp / messaging format template

🚌 **Routes from {origin} to {destination}**

⭐ **Route 1 (Recommended)** — {effective_total_min} min
{for each leg:}
  🚶 Walk {duration_seconds/60} min — {instructions}
  🚌 Bus {route_number} from {departure_stop} — **Next bus: {etas[0] formatted as relative time}** (then {etas[1]})
     {num_stops} stops → {arrival_stop}
  🚇 MTR {route_number} from {departure_stop}
     {num_stops} stops → {arrival_stop}
  ⛴️ Ferry ...
  🚊 Light Rail / Tram ...

📍 Route 2 — {effective_total_min} min
{same leg format}

📍 Route 3 — {effective_total_min} min
{same leg format}

Formatting rules

  • Recommended route: Mark with ⭐ and "(Recommended)"
  • Actionable leg: The leg with actionable: true is the one that determines when the user needs to leave. Call it out prominently: "Next bus in X min — leave now!" or "Next bus in X min — you have time."
  • ETAs: Format as relative time ("in 3 min", "in 12 min"). Show up to 2 ETAs per bus leg.
  • Walking legs: Always show with duration. Use 🚶 emoji.
  • Transport emojis: 🚌 bus, 🚇 MTR/subway, ⛴️ ferry, 🚊 light rail/tram, 🚶 walk
  • Bold: Use bold for ETAs, route numbers, and the recommended route label.
  • Unavailable ETAs: If eta_source is "unavailable", show "ETA unavailable (scheduled: {departure_time})" instead of a real-time ETA.
  • Schedule-only: If eta_source is "schedule", show the scheduled departure time without a real-time label.

Error handling

If the CLI returns error: true:

  • NO_TRANSIT_ROUTES: Tell the user no transit routes were found. Suggest trying a different departure time or considering a taxi.
  • GOOGLE_API_ERROR: Tell the user there was an issue fetching routes. Suggest trying again.
  • INVALID_INPUT: Tell the user what was wrong with their input.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Huo15 Openclaw Enhance

火一五·克劳德·龙虾增强插件 v5.7.8 — 全面适配 openclaw 2026.4.24:peerDep ^4.24 + build/compat 同步到 4.24 + 14 处 api.on 全部去掉 as any 改成 typed hook(hookName 联合类型 + handler 自动推断 Pl...

Registry SourceRecently Updated
General

Content Trend Analyzer

Aggregates and analyzes content trends across platforms to identify hot topics, user intent, content gaps, and generates data-driven article outlines.

Registry SourceRecently Updated
General

Prompt Debugger

Debug prompts that produce unexpected AI outputs — diagnose failure modes, identify ambiguity and conflicting instructions, test variations, compare model re...

Registry SourceRecently Updated
General

Indie Maker News

独行者 Daily - 变现雷达。读对一条新闻,少走一年弯路。每天5分钟,给创业者装上商业雷达。聚焦一人公司、副业、创业变现资讯,智能分类,行动导向。用户下载即能用,无需本地部署!

Registry SourceRecently Updated