agentleFS
yangwhaleyangwhale/CloseCrab/skills/hk-bus/SKILL.md

hk-bus

Skill5 starsChanged 3 months agoApache-2.0View on GitHub

香港智能通勤助手。Google Maps 路线推荐 + KMB/Citybus 实时到站融合。当用户说"几点有车"、"巴士到了吗"、"怎么去公司"、"坐什么车"、"查公交"、"bus ETA"、"下一班车"、"通勤"、"commute"等关键词时触发。

The file

Files
SKILL.md

香港智能通勤助手

Google Maps 路线推荐 + KMB/Citybus 实时到站,两步串联。

核心流程

  1. 用户提供出发位置 → 调 Google Maps Directions API (transit) 获取推荐路线
  2. 从路线中提取巴士线路 → 调 KMB/Citybus 实时 API 叠加精确到站时间
  3. 比较步行到站时间 vs 巴士到站时间 → 判断赶不赶得上

用法

# 智能通勤(需要用户位置,自动融合 Google Maps + 实时 ETA)
python3 ~/CloseCrab/skills/hk-bus/scripts/bus-eta.py --origin "Cumberland Rd 3, Kowloon Tong"
python3 ~/CloseCrab/skills/hk-bus/scripts/bus-eta.py --origin "La Salle Rd 6, Kowloon City"
python3 ~/CloseCrab/skills/hk-bus/scripts/bus-eta.py --origin "22.3370,114.1750"

# 指定目的地(默认 Times Square, Causeway Bay)
python3 ~/CloseCrab/skills/hk-bus/scripts/bus-eta.py --origin "..." --dest "Central, Hong Kong"

# 传统模式(查单条路线的实时 ETA,不需要位置)
python3 ~/CloseCrab/skills/hk-bus/scripts/bus-eta.py 113
python3 ~/CloseCrab/skills/hk-bus/scripts/bus-eta.py --all
python3 ~/CloseCrab/skills/hk-bus/scripts/bus-eta.py --list

重要:调用前必须获取用户位置

用户问"坐什么车去公司"时,必须先确认用户位置再调脚本:

  • 如果用户发了飞书定位消息 → 用经纬度作为 --origin
  • 如果用户提到了地名 → 用地名作为 --origin
  • 如果都没有 → 问用户"你现在在哪?"

绝对不要在不知道用户位置的情况下只查 --all,因为无法判断用户能否赶上某班车。

数据源

  • Google Maps Directions API: 路线规划 + 步行时间 + 换乘方案
  • KMB: https://data.etabus.gov.hk/v1/transport/kmb/ (实时到站)
  • Citybus: https://rt.data.gov.hk/v2/transport/citybus/ (实时到站)
  • 巴士数据免费、无需 API key、精确到秒
  • Google Maps API key 从 /tmp/maps-api-key.txt 或 Firestore 读取

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.