executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
nearby-search当用户询问周边、附近、旁边有什么时,先定位用户位置,再调用 amap-lbs 技能搜索周边 POI
Independent GitHub snapshot · Automated classification · Original documentation governs
name: nearby-search display_name: 周边搜索 - 定位用户并搜索附近 POI description: 当用户询问周边、附近、旁边有什么时,先定位用户位置,再调用 amap-lbs 技能搜索周边 POI version: 1.0.0 trigger:
当用户询问"周边"、"附近"、"旁边"有没有某类场所(如美食、咖啡、超市等)时,使用此技能定位用户并搜索周边信息。
重要:不要使用 web search 来回答周边搜索类问题,始终走本技能的定位 + amap-lbs 流程。
用户消息中包含以下意图:
按以下优先级确定用户当前所在位置:
如果用户消息中已包含具体地址(如"中关村附近有什么好吃的"、"南山科技园周边咖啡"),直接使用该地址,跳过后续定位步骤。
判断当前是否为工作日(周一至周五)且处于工作时间(9:00-18:00,注意使用用户所在时区):
context://memory/user_profile.md 或 context://memory/projects/ 下的相关文件)中查找用户的上班地址/公司地址如果以上都不可用,通过 IP 定位获取用户大致位置:
curl --noproxy "*" "http://ip-api.com/json?lang=zh-CN"
返回示例:
{
"status": "success",
"country": "中国",
"regionName": "广东",
"city": "深圳",
"lat": 22.5431,
"lon": 114.0579,
"query": "x.x.x.x"
}
从返回中提取 city(城市)和 lat/lon(经纬度)。
curl -s "https://restapi.amap.com/v3/geocode/geo?address={地址}&output=JSON&key=$(get_secret amap_webservice_key)"
从返回的 geocodes[0].location 获取 经度,纬度。
lat/lon,直接使用(注意高德格式为 经度,纬度,即 lon,lat)。使用 amap-lbs 技能的**场景四(POI 详细搜索)**进行周边搜索:
node scripts/poi-search.js --keywords={用户要搜的类别} --location={经度},{纬度} --radius=1000
脚本路径位于 amap-lbs 技能目录下:ethan/defaults/skills/amap-lbs/scripts/poi-search.js
参数说明:
--keywords:用户要找的类别(美食、咖啡、超市等)--location:经度,纬度(高德格式,经度在前)--radius:搜索半径,默认 1000 米,可根据需要调整将搜索结果整理为用户友好的格式,包含:
同时附上高德地图的可视化链接供用户查看更多:
https://ditu.amap.com/search?query={类别}&query_type=RQBXY&longitude={经度}&latitude={纬度}&range=1000
get_secret("amap_webservice_key") 获取经度,纬度(lon,lat),IP 定位 API 返回的是 lat,lon,注意转换