fuel-pricing

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Fuel Pricing Skill

燃油价格查询Skill

Find the cheapest fuel at nearby stations across Australia. Zero config — no API keys, no setup.
查找澳大利亚境内附近加油站的最便宜燃油价格。无需配置——不需要API密钥,无需设置。

When to Use

使用场景

Trigger this skill when the user:
  • Asks about fuel, petrol, diesel, or gas prices
  • Wants to compare prices at nearby stations
  • Mentions filling up, refueling, or finding a servo
  • Asks "where should I get fuel/petrol/diesel?"
  • Mentions a specific fuel type (E10, U91, U95, U98, diesel, LPG)
当用户有以下需求时,触发该Skill:
  • 询问燃油、汽油、柴油或天然气价格
  • 想要对比附近加油站的价格
  • 提及加油、补充燃油或寻找加油站
  • 询问“我应该去哪里加燃油/汽油/柴油?”
  • 提及特定燃油类型(E10、U91、U95、U98、柴油、LPG)

Prerequisites

前置条件

  • uv
    brew install uv
    (macOS) or
    pip install uv
    (all platforms)
  • API keys — not needed. Optional:
    FUELCHECK_CONSUMER_KEY
    for official NSW govt data.
  • Dependencies — declared inline (PEP 723), installed automatically by
    uv run
    .
  • uv — macOS系统使用
    brew install uv
    安装,其他平台使用
    pip install uv
    安装
  • API密钥 — 无需提供。可选:若要使用新南威尔士州官方政府数据,可配置
    FUELCHECK_CONSUMER_KEY
  • 依赖项 — 内联声明(符合PEP 723标准),将由
    uv run
    自动安装

Setup Status

安装状态检查

!
command -v uv > /dev/null 2>&1 && echo "uv: installed" || echo "uv: NOT INSTALLED"
!
command -v uv > /dev/null 2>&1 && echo "uv: installed" || echo "uv: NOT INSTALLED"

Location Flow (IMPORTANT — follow this exactly)

位置获取流程(重要——严格按此执行)

Before fetching prices, you MUST resolve the user's location. Follow these steps in order — do NOT skip ahead to IP fallback.
Step 1: Check what the user already provided.
  • User shared a location pin (Telegram, WhatsApp, Signal, Discord)? Extract lat/lng → use
    --lat
    /
    --lng
    . Done.
  • User mentioned a suburb, city, or address? → use
    --location
    . Done.
  • User mentioned a postcode? → use
    --postcode
    . Done.
Step 2: User said "near me" or "nearby" but gave no location. Ask them to share location. Tailor the ask to their platform:
  • Telegram: "Tap the paperclip icon → Location → Send My Current Location"
  • WhatsApp: "Tap the + button → Location → Send Your Current Location"
  • Signal: "Tap the + button → Location"
  • Discord/terminal: "What suburb or postcode are you near?"
Wait for their response. Do not proceed without it.
Step 3: User can't or won't share location. Ask: "No worries — what suburb or postcode are you near?" Wait for response.
Step 4: User refuses to give any location info. Only now fall back to auto-detect (no location args). This uses IP geolocation which is city-level only and often wrong. If the result comes back with
confidence: "low"
, tell the user: "I got an approximate location of [city] from your IP but it may not be accurate. Can you tell me your suburb or postcode for better results?"
Never silently use IP geolocation when you can ask the user instead.
在获取价格之前,必须先确定用户的位置。请按以下步骤依次执行——不要直接跳转到IP地址 fallback 方案。
步骤1:检查用户已提供的信息
  • 用户是否通过Telegram、WhatsApp、Signal、Discord分享了位置定位?提取纬度/经度→使用
    --lat
    /
    --lng
    参数。完成。
  • 用户是否提及了郊区、城市或地址?→使用
    --location
    参数。完成。
  • 用户是否提及了邮政编码?→使用
    --postcode
    参数。完成。
步骤2:用户说“附近”但未提供具体位置 请求用户分享位置信息,并根据其使用的平台调整话术:
  • Telegram:“点击回形针图标→位置→发送我的当前位置”
  • WhatsApp:“点击+按钮→位置→发送你的当前位置”
  • Signal:“点击+按钮→位置”
  • Discord/终端:“你所在的郊区或邮政编码是什么?”
等待用户回复,未收到回复前不要继续。
步骤3:用户无法或不愿分享位置 询问:“没关系——你所在的郊区或邮政编码是什么?”等待用户回复。
步骤4:用户拒绝提供任何位置信息 只有此时才使用自动检测(不传入位置参数)。该方式使用IP地理定位,仅能定位到城市级别,且通常不够准确。若结果显示
confidence: "low"
,请告知用户:“我获取到你的大致位置为[城市],但该信息可能不准确。能否告诉我你的郊区或邮政编码以获取更准确的结果?”
切勿在可向用户询问的情况下,默认使用IP地理定位。

Command Template

命令模板

bash
uv run "${CLAUDE_SKILL_DIR}/scripts/fuel_prices.py" [LOCATION_FLAGS] [OPTIONS]
bash
uv run "${CLAUDE_SKILL_DIR}/scripts/fuel_prices.py" [LOCATION_FLAGS] [OPTIONS]

Options

可选参数

FlagValuesDefaultPurpose
--fuel-type
E10
U91
U95
U98
DSL
PDSL
LPG
U91
Fuel type to search
--radius
km (integer)
5
Search radius
--no-cache
(flag)offForce fresh data
Only parse stdout (JSON). Stderr contains diagnostics only.
参数取值默认值用途
--fuel-type
E10
U91
U95
U98
DSL
PDSL
LPG
U91
指定要搜索的燃油类型
--radius
公里数(整数)
5
搜索半径
--no-cache
(开关参数)关闭强制获取最新数据
仅解析**标准输出(stdout)**的JSON内容。标准错误输出(stderr)仅包含诊断信息。

Common Commands

常用命令

bash
undefined
bash
undefined

User shared location via chat platform

用户通过聊天平台分享了位置

uv run "${CLAUDE_SKILL_DIR}/scripts/fuel_prices.py" --lat -34.07 --lng 150.74
uv run "${CLAUDE_SKILL_DIR}/scripts/fuel_prices.py" --lat -34.07 --lng 150.74

User mentioned a place or postcode

用户提及了地点或邮政编码

uv run "${CLAUDE_SKILL_DIR}/scripts/fuel_prices.py" --location "Newtown, NSW" uv run "${CLAUDE_SKILL_DIR}/scripts/fuel_prices.py" --postcode 2042
uv run "${CLAUDE_SKILL_DIR}/scripts/fuel_prices.py" --location "Newtown, NSW" uv run "${CLAUDE_SKILL_DIR}/scripts/fuel_prices.py" --postcode 2042

Auto-detect location (terminal — opens browser on first run)

自动检测位置(终端环境——首次运行会打开浏览器)

uv run "${CLAUDE_SKILL_DIR}/scripts/fuel_prices.py"
uv run "${CLAUDE_SKILL_DIR}/scripts/fuel_prices.py"

Specific fuel type + wider radius

指定燃油类型+扩大搜索半径

uv run "${CLAUDE_SKILL_DIR}/scripts/fuel_prices.py" --location "Parramatta" --fuel-type E10 --radius 10
undefined
uv run "${CLAUDE_SKILL_DIR}/scripts/fuel_prices.py" --location "Parramatta" --fuel-type E10 --radius 10
undefined

Presenting Results

结果展示规范

DO NOT use markdown tables. They don't render on mobile chat platforms (Telegram, WhatsApp, Signal). Use plain text with line breaks instead.
请勿使用Markdown表格,因为它们在移动聊天平台(Telegram、WhatsApp、Signal)上无法正常显示。请使用带有换行的纯文本格式。

Output Format

输出格式

Cheapest [fuel type]: $[price]/L
[Station name] · [distance] km · [freshness]

Nearby stations:
1. [Station] — $[price]/L · [distance] km · [freshness]
2. [Station] — $[price]/L · [distance] km · [freshness]
3. [Station] — $[price]/L · [distance] km · [freshness]

[N] stations within [radius]km of [location] · [source]
最便宜的[燃油类型]:$[价格]/升
[加油站名称] · [距离]公里 · [数据更新时长]

附近的加油站:
1. [加油站] — $[价格]/升 · [距离]公里 · [数据更新时长]
2. [加油站] — $[价格]/升 · [距离]公里 · [数据更新时长]
3. [加油站] — $[价格]/升 · [距离]公里 · [数据更新时长]

[数量]个加油站位于[位置]的[半径]公里范围内 · [数据来源]

Example

示例

Cheapest U91: $2.17/L
Ampol Smeaton Grange · 4.4 km · 6 hr ago

Nearby stations:
1. EG Ampol Oran Park — $2.19/L · 0.6 km · 6 days ago
2. BP Bringelly — $2.19/L · 1.4 km · 3 days ago
3. 7-Eleven Gregory Hills — $2.19/L · 3.7 km · 6 days ago
4. Ampol Foodary Narellan — $2.19/L · 5.0 km · 6 days ago

9 stations within 5km of Oran Park · FuelSnoop
最便宜的U91:$2.17/升
Ampol Smeaton Grange · 4.4公里 · 6小时前

附近的加油站:
1. EG Ampol Oran Park — $2.19/升 · 0.6公里 · 6天前
2. BP Bringelly — $2.19/升 · 1.4公里 · 3天前
3. 7-Eleven Gregory Hills — $2.19/升 · 3.7公里 · 6天前
4. Ampol Foodary Narellan — $2.19/升 · 5.0公里 · 6天前

9个加油站位于Oran Park的5公里范围内 · FuelSnoop

Formatting Rules

格式规则

  • Sort by price ascending (cheapest first)
  • Highlight the cheapest station at the top, separated from the numbered list
  • Use
    staleness.age_display
    from JSON for freshness
  • Stale stations (>48hrs): still show them but append a note at the bottom — "Some prices may be outdated"
  • WA tomorrow prices: add "Tomorrow: $X.XX" under the station
  • Cap at 10 stations
  • If user asked about a specific fuel type, show only that type
  • If no fuel type specified, default to U91 or E10
  • 按价格从低到高排序(最便宜的在前)
  • 在顶部突出显示最便宜的加油站,与编号列表分开
  • 使用JSON中的
    staleness.age_display
    字段作为数据更新时长
  • 数据过时的加油站(超过48小时):仍需展示,但在底部添加备注——“部分价格可能已过期”
  • 西澳大利亚州的明日价格:在加油站信息下方添加“明日价格:$X.XX”
  • 最多展示10个加油站
  • 如果用户询问了特定燃油类型,仅展示该类型的价格
  • 如果未指定燃油类型,默认展示U91或E10的价格

Handling Edge Cases

边缘情况处理

  • Low confidence (
    confidence: "low"
    ): Do not silently show results. Tell the user: "I got an approximate location of [city] but it may not be exact. What suburb or postcode are you near?" Rerun with their answer.
  • Stale prices (
    stale_count > 0
    ): Show results but add a note — "Heads up: some of these prices are a few days old and may have changed."
  • No results (empty stations): "No stations found within [radius]km. Want me to try a wider search or a different suburb?"
  • API errors: Multiple sources auto-fallback per state. If all fail: "Couldn't get prices right now. Can you try with a specific suburb name?"
Price sanity ($0.50–$5.00/L) is enforced automatically — out-of-range prices are filtered by the script.
  • 低置信度位置
    confidence: "low"
    ):请勿直接展示结果。告知用户:“我获取到你的大致位置为[城市],但可能存在偏差。你能告诉我所在的郊区或邮政编码吗?”根据用户的回复重新运行查询。
  • 价格数据过时
    stale_count > 0
    ):展示结果,但添加备注——“注意:部分价格已是几天前的,可能已发生变化。”
  • 无结果(加油站列表为空):“在[半径]公里范围内未找到加油站。需要扩大搜索范围或更换郊区重新查询吗?”
  • API错误:会自动按州切换到备用数据源。若所有数据源均失败:“目前无法获取燃油价格。能否尝试提供具体的郊区名称?”
脚本会自动校验价格合理性($0.50–$5.00/升)——超出范围的价格会被过滤掉。

Reference

参考信息

Fuel Types

燃油类型

CodeName
E10Ethanol 10%
U91Unleaded 91
U95Premium 95
U98Premium 98
DSLDiesel
LPGLPG
代码名称
E1010%乙醇汽油
U9191号无铅汽油
U9595号 premium汽油
U9898号 premium汽油
DSL柴油
LPG液化石油气

Data Sources

数据来源

StatePrimaryFallback
WAFuelWatch (govt, includes tomorrow's prices)PetrolSpy
NSW, QLDFuelSnoopPetrolSpy
VIC, SA, TAS, NT, ACTPetrolSpy
All data sources are read-only public APIs. FuelWatch is official Australian government open data. FuelSnoop and PetrolSpy are community data aggregators. No user data is sent to any service beyond coordinates for the search area.
州/领地主数据源备用数据源
WA(西澳)FuelWatch(官方数据源,包含明日价格)PetrolSpy
NSW(新南威尔士)、QLD(昆士兰)FuelSnoopPetrolSpy
VIC(维多利亚)、SA(南澳)、TAS(塔斯马尼亚)、NT(北领地)、ACT(首都领地)PetrolSpy
所有数据源均为只读公共API。FuelWatch是澳大利亚官方政府开放数据。 FuelSnoop和PetrolSpy是社区数据聚合平台。除搜索区域的坐标信息外,不会向任何服务发送用户的其他数据。

Script Location Fallback (internal — for reference only)

脚本位置获取 fallback 机制(内部参考)

When the script runs, it resolves location internally in this order:
  1. Explicit args
    --lat
    /
    --lng
    ,
    --location
    , or
    --postcode
    (Nominatim geocoding)
  2. Browser consent — localhost page requesting
    navigator.geolocation
    (WiFi, ~15-50ft accuracy, cached 24hrs)
  3. IP geolocation — ip-api.com (city-level only, often inaccurate for non-city users)
The agent should almost never reach step 3. The Location Flow above ensures the user provides location info before the script runs.
脚本运行时,会按以下优先级自动解析位置:
  1. 显式参数
    --lat
    /
    --lng
    --location
    --postcode
    (使用Nominatim地理编码服务)
  2. 浏览器授权 — 打开本地页面请求
    navigator.geolocation
    (基于WiFi,精度约15-50英尺,缓存24小时)
  3. IP地理定位 — 使用ip-api.com(仅城市级别,对非城市用户通常不准确)
Agent应几乎不会触发第3步。上述位置获取流程已确保在运行脚本前,用户已提供位置信息。