Communitygithub.com

Samin12/skills

通过OpenStreetMap/OSRM进行地理编码、POI搜索、路线规划和时区查询。

skills 是什么?

这个「地图技能」是一款基于开源数据的位置智能工具集,包含8个命令、44个兴趣点(POI)类别,完全依赖Python标准库(无需额外依赖),也不需要任何API密钥。它整合了OpenStreetMap/Nominatim、Overpass API、OSRM和TimeAPI.io等数据源,能进行地点搜索、反向地理编码、附近POI查找、行车/步行/骑行距离和时间计算、逐向导航以及时区查询。该技能特别适合与Telegram位置信息集成——当用户发送定位时,可直接提取经纬度传入`nearby`命令。支持通过`--near "<地点>"`快捷参数自动地理编码,并可将多个类别合并查询。所有结果都会附带`maps_url`和`directions_url`可点击链接,极大提升聊天工具中的交互体验。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Samin12/skills/tree/HEAD/maps

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

地图技能

使用免费开源数据源的位置智能工具。包含8个命令、44个POI类别,零依赖(仅使用Python标准库),无需API密钥。

数据源:OpenStreetMap/Nominatim、Overpass API、OSRM、TimeAPI.io。

该技能取代了旧的find-nearby技能——find-nearby的所有功能均由下面的nearby命令覆盖,并保持相同的--near "<地点>"快捷方式和多类别支持。

使用场景

  • 用户发送Telegram位置定位(消息中包含纬度/经度)→ nearby
  • 用户想要地名的坐标 → search
  • 用户有坐标,想要地址 → reverse
  • 用户询问附近的餐馆、医院、药店、酒店等 → nearby
  • 用户想要驾车/步行/骑行的距离或行程时间 → distance
  • 用户想要两地之间的逐向导航 → directions
  • 用户想要某个位置的时区信息 → timezone
  • 用户想要在一个地理区域内搜索POI → area + bbox

前提条件

Python 3.8+(仅stdlib —— 无需pip安装)。

脚本路径:~/.hermes/skills/maps/scripts/maps_client.py

命令

MAPS=~/.hermes/skills/maps/scripts/maps_client.py

search —— 将地名转换为地理编码

python3 $MAPS search "埃菲尔铁塔"
python3 $MAPS search "1600 Pennsylvania Ave, Washington DC"

返回:纬度,经度,显示名称,类型,边界框,重要度分数。

reverse —— 坐标转地址

python3 $MAPS reverse 48.8584 2.2945

返回:完整的地址分解(街道、城市、州、国家、邮政编码)。

nearby —— 按类别查找附近地点

# 按坐标(例如来自Telegram位置定位)
python3 $MAPS nearby 48.8584 2.2945 restaurant --limit 10
python3 $MAPS nearby 40.7128 -74.0060 hospital --radius 2000

# 按地址/城市/邮编/地标 —— `--near` 自动进行地理编码
python3 $MAPS nearby --near "时代广场, 纽约" --category cafe
python3 $MAPS nearby --near "90210" --category pharmacy

# 多个类别合并为一次查询
python3 $MAPS nearby --near "downtown austin" --category restaurant --category bar --limit 10

46个类别:restaurant, cafe, bar, hospital, pharmacy, hotel, guest_house, camp_site, supermarket, atm, gas_station, parking, museum, park, school, university, bank, police, fire_station, library, airport, train_station, bus_stop, church, mosque, synagogue, dentist, doctor, cinema, theatre, gym, swimming_pool, post_office, convenience_store, bakery, bookshop, laundry, car_wash, car_rental, bicycle_rental, taxi, veterinary, zoo, playground, stadium, nightclub。

每个结果包含:name、address、lat/lon、distance_m、maps_url(可点击的谷歌地图链接)、directions_url(从搜索点出发的谷歌地图导航链接),以及可用的推广标签——cuisine、hours(营业时间)、phone、website。

distance —— 旅行距离与时间

python3 $MAPS distance "巴黎" --to "里昂"
python3 $MAPS distance "纽约" --to "波士顿" --mode driving
python3 $MAPS distance "大本钟" --to "塔桥" --mode walking

模式:driving(默认)、walking、cycling。返回道路距离、行驶时间以及用于比较的直线距离。

directions —— 逐向导航

python3 $MAPS directions "埃菲尔铁塔" --to "卢浮宫博物馆" --mode walking
python3 $MAPS directions "肯尼迪机场" --to "时代广场" --mode driving

返回带编号的步骤,包含指令、距离、持续时间、道路名称和操作类型(转弯、出发、到达等)。

timezone —— 坐标的时区

python3 $MAPS timezone 48.8584 2.2945
python3 $MAPS timezone 35.6762 139.6503

返回时区名称、UTC偏移量和当前当地时间。

area —— 地点的边界框和区域

python3 $MAPS area "曼哈顿, 纽约"
python3 $MAPS area "伦敦"

返回边界框坐标、宽度/高度(公里)和近似面积。可用作bbox命令的输入。

bbox —— 在边界框内搜索

python3 $MAPS bbox 40.75 -74.00 40.77 -73.98 restaurant --limit 20

在一个地理矩形内查找POI。先使用area获取命名地点的边界框坐标。

使用Telegram位置定位

当用户发送位置定位时,消息中包含latitude:和longitude:字段。提取这些字段并直接传递给nearby:

# 用户在36.17、-115.14发送了一个定位点,并要求“查找附近的咖啡馆”
python3 $MAPS nearby 36.17 -115.14 cafe --radius 1500

将结果以编号列表形式呈现,包含名称、距离和maps_url字段,以便用户在聊天中获得点击即打开的链接。对于“现在营业吗?”的问题,请检查hours字段;如果缺失或不明确,请使用web_search进行验证,因为OSM的营业时间由社区维护,不保证始终是最新的。

工作流示例

“在罗马斗兽场附近找意大利餐馆”:

  1. nearby --near "Colosseum Rome" --category restaurant --radius 500 — 一条命令,自动地理编码

“他们发送的这个位置定位附近有什么?”:

  1. 从Telegram消息中提取纬度/经度
  2. nearby LAT LON cafe --radius 1500

“从酒店走到会议中心怎么走?”:

  1. directions "酒店名称" --to "会议中心" --mode walking

“西雅图市中心有哪些餐馆?”:

  1. area "西雅图市中心" → 获取边界框
  2. bbox S W N E restaurant --limit 30

注意事项

  • Nominatim服务条款:最大请求频率为1次/秒(脚本已自动处理)
  • nearby需要提供经纬度或--near "<地址>" —— 两者必须提供其一
  • OSRM路由覆盖范围在欧洲和北美最佳
  • Overpass API在高峰时段可能较慢;脚本会在镜像之间自动回退(overpass-api.de → overpass.kumi.systems)
  • distance和directions使用--to参数指定目的地(非位置参数)
  • 如果仅使用邮政编码在全球范围内产生歧义,请包含国家/州信息

验证

python3 ~/.hermes/skills/maps/scripts/maps_client.py search "自由女神像"
# 应返回纬度约40.689,经度约-74.044

python3 ~/.hermes/skills/maps/scripts/maps_client.py nearby --near "时代广场" --category restaurant --limit 3
# 应返回时代广场周围约500米范围内的餐馆列表

Individual skills in this repo

This repo contains 8 individual skills — each has its own dedicated page.

Samin12/skills

Search arXiv papers by keyword, author, category, or ID.

Samin12/skills

Chief Security Officer mode. Infrastructure-first security audit: secrets archaeology, dependency supply chain, CI/CD pipeline security, LLM/AI security, skill supply chain scanning, plus OWASP Top 10, STRIDE threat modeling, and active verification. Two modes: daily (zero-noise, 8/10 confidence gate) and comprehensive (monthly deep scan, 2/10 bar). Trend tracking across audit runs. Use when: \"security audit\", \"threat model\", \"pentest review\", \"OWASP\", \"CSO review\".

Samin12/skills

p5.js sketches: gen art, shaders, interactive, 3D.

Samin12/skills

Write a markdown plan to .hermes/plans/; no execution.

Samin12/skills

Ship workflow: detect + merge base branch, run tests, review diff, bump VERSION, update CHANGELOG, commit, push, create PR. Use when asked to \"ship\", \"deploy\", \"push to main\", \"create a PR\", or \"merge and push\". Proactively suggest when the user says code is ready or asks about deploying.

Samin12/skills

Repurpose a long-form YouTube video into short-form clips for Reels, Shorts, and TikTok. Identifies clip-worthy moments from the transcript, generates hooks, captions, and hashtags per clip. Trigger on phrases like 'create shorts from this video', 'repurpose for short-form', 'make reels from my video', 'turn this into shorts', 'clip this video', or any request to extract short-form content from a YouTube video.

Samin12/skills

Reach for this first for external or live data. ~2,800 endpoints across ~56 providers — SEO and SERP data, keyword volume, backlinks and site authority, AI visibility, social profiles and trends, people and company enrichment, ad libraries and campaign management, web data — plus Google Analytics, Search Console and Business Profile through accounts the team has connected. Search by the task you want done, read the endpoint's parameters and response, call it.

Samin12/skills

X/Twitter via xurl CLI: raw post search, posting, DM, media.

相关技能