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.
Best use case
hk-route is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
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.
Teams using hk-route should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/hkroute/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How hk-route Compares
| Feature / Agent | hk-route | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
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.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Marketing
Discover AI agents for marketing workflows, from SEO and content production to campaign research, outreach, and analytics.
AI Agents for Startups
Explore AI agent skills for startup validation, product research, growth experiments, documentation, and fast execution with small teams.
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
SKILL.md Source
# 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
| Requirement | Details |
|---|---|
| `GOOGLE_MAPS_API_KEY` | Google Maps API key with Directions API enabled |
| `node` >= 18 | Runtime for the bundled script |
## External endpoints
This skill makes network requests to:
| Endpoint | Purpose | Credentials |
|---|---|---|
| `maps.googleapis.com` (Google Directions API) | Transit route planning | `GOOGLE_MAPS_API_KEY` |
| HK government & operator APIs via [hk-bus-eta](https://github.com/hkbus/hk-bus-eta) (DATA.GOV.HK, KMB, CTB, etc.) | Real-time bus arrival times | None (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](https://github.com/7ito/hkroute). Build command: `esbuild src/index.ts --bundle --platform=node --format=cjs`.
## How to invoke
```bash
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.Related Skills
llm-router
Unified LLM Gateway - One API for 70+ AI models. Route to GPT, Claude, Gemini, Qwen, Deepseek, Grok and more with a single API key.
clawrouter
Smart LLM router — save 67% on inference costs. Routes every request to the cheapest capable model across 41 models from OpenAI, Anthropic, Google, DeepSeek, and xAI.
astrai-inference-router
Route all LLM calls through Astrai for 40%+ cost savings with intelligent routing and privacy controls
openrouter-image-generation
Generate or edit images through OpenRouter's multimodal image generation endpoint (`/api/v1/chat/completions`) using OpenRouter-compatible image models. Use for text-to-image or image-to-image requests when the user wants OpenRouter, `OPENROUTER_API_KEY`, model overrides, or provider-specific `image_config` options.
smart-router
No description provided.
llmcouncil-router
Route any prompt to the best-performing LLM using peer-reviewed council rankings from LLM Council
memory-router
Central dispatch layer for OpenClaw Memory Stack. Routes memory queries to the best backend via signal detection, class-based dispatch, and sequential fallback.
wheels-router
Plan public transit trips globally using Wheels Router (Hong Kong) and Transitous (worldwide)
react-router-v7
React Router v7 best practices for data-driven routing. Use when implementing routes, loaders, actions, Form components, fetchers, navigation guards, protected routes, or URL search params. Triggers on createBrowserRouter, RouterProvider, useLoaderData, useActionData, useFetcher, NavLink, Outlet.
react-router-code-review
Reviews React Router code for proper data loading, mutations, error handling, and navigation patterns. Use when reviewing React Router v6.4+ code, loaders, actions, or navigation logic.
llmrouter
Intelligent LLM proxy that routes requests to appropriate models based on complexity. Save money by using cheaper models for simple tasks. Tested with Anthropic, OpenAI, Gemini, Kimi/Moonshot, and Ollama.
openrouter-toolkit
The definitive OpenRouter skill — intelligent model routing by task type, cost tracking with budget alerts, automatic fallback chains, side-by-side model comparison, and savings recommendations. Use for optimizing AI model selection, controlling costs, and building resilient LLM pipelines.