← 返回 Skills 市场
813
总下载
0
收藏
4
当前安装
2
版本数
在 OpenClaw 中安装
/install currency-converter
功能描述
提供实时或近实时的货币汇率查询与转换服务。
使用说明 (SKILL.md)
\r \r
汇率转换器 (Currency Converter)\r
\r
1. 详细描述\r
该工具能够帮助用户查询两种不同货币之间的实时汇率,并根据用户提供的金额进行换算。它依赖于一个外部的汇率API来获取最新数据,确保转换结果的时效性和准确性。支持全球主要流通货币,如人民币(CNY)、美元(USD)、欧元(EUR)、日元(JPY)、英镑(GBP)等。\r \r
2. 使用场景 (When to use)\r
当用户明确表达以下意图时,应该调用此工具:\r
- 用户说:“100美元等于多少人民币?”\r
- 用户说:“查询一下欧元兑英镑的汇率。”\r
- 用户说:“帮我换算一下5000日元。”\r
- 用户说:“今天的美元对人民币汇率是多少?”\r \r
3. 如何使用 (How to use)\r
当用户指令匹配到上述场景时,请按以下步骤操作:\r \r
- 解析参数:从用户消息中提取关键信息。\r
- 金额:用户想要转换的数值(例如:100, 5000)。如果用户只问汇率没提金额,默认金额为1。\r
- 原始货币:用户持有的货币(例如:美元、USD、日元)。需要识别常见的中英文名称和货币代码。\r
- 目标货币:用户想要转换成的货币(例如:人民币、EUR)。如果用户只问一种货币对另一种,这两个参数都需要提取。\r \r
- 标准化货币代码:将用户输入的中文或英文货币名称,转换为标准的三个字母货币代码(ISO 4217标准)。\r
- 例如:“人民币” -> CNY, “美元” -> USD, “欧元” -> EUR, “日元” -> JPY, “英镑” -> GBP。\r \r
- 执行脚本:调用后端的汇率转换脚本。\r
- 命令格式:
python3 currency_converter.py --amount {金额} --from {原始货币代码} --to {目标货币代码}\r - 示例:如果用户问“100美元等于多少人民币?”,则执行:\r
python3 currency_converter.py --amount 100 --from USD --to CNY\r \r
- 命令格式:
- 处理并返回结果:\r
- 成功:脚本会返回一个包含转换结果和汇率的JSON。你需要将这个结果组织成一段自然、友好的语言回复用户。\r
- 示例回复: “根据最新汇率,100 美元 (USD) 大约可以兑换 725.50 人民币 (CNY)。当前汇率为 1 USD = 7.2550 CNY。”\r
- 失败:如果脚本返回错误信息,按照“边缘情况处理”部分来回复。\r \r
- 成功:脚本会返回一个包含转换结果和汇率的JSON。你需要将这个结果组织成一段自然、友好的语言回复用户。\r
4. 边缘情况处理 (Edge cases)\r
在以下特殊情况下,请按提示回复用户,不要执行脚本或强行解释:\r \r
- 缺少货币参数:如果用户只说“帮我换算一下”,但没有指明是哪两种货币。\r
- 回复: “请问您想换算哪两种货币呢?例如:‘100美元兑换人民币’。”\r
- 货币不支持:如果用户查询的货币不在我们支持列表中(脚本会返回特定错误码)。\r
- 回复: “抱歉,暂时不支持您查询的货币(例如:
{用户输入的货币}),请尝试查询美元、欧元、人民币等主流货币。”\r
- 回复: “抱歉,暂时不支持您查询的货币(例如:
- 网络或API错误:如果脚本因网络问题或外部API服务不可用而失败。\r
- 回复: “哎呀,我现在无法连接到汇率数据服务,暂时无法进行实时换算。请稍后再试。”\r
- 无效的金额:如果用户输入的金额不是有效的正数。\r
- 回复: “您输入的金额‘
{用户输入}’好像不太对,请提供一个有效的数字,比如‘100’。”
- 回复: “您输入的金额‘
安全使用建议
This skill appears safe and coherent: it only needs network access to a public exchange-rate API and no secrets. Before installing, ensure your agent environment has Python 3 and the 'requests' package available, and that you are comfortable allowing outbound requests to https://api.exchangerate-api.com (API provider may log requests). If you require a different or authenticated data provider, review/modify the script to use your preferred API and credentials. Note: there is a minor robustness bug (date handling) that may affect the displayed update time but not security.
功能分析
Type: OpenClaw Skill
Name: currency-converter
Version: 1.0.1
The `SKILL.md` file instructs the AI agent to construct a shell command (`python3 currency_converter.py ...`) by directly embedding user-provided parameters (`{金额}`, `{原始货币代码}`, `{目标货币代码}`). This design introduces a shell injection vulnerability, as a malicious user could potentially inject arbitrary commands if the AI agent does not properly sanitize or escape these parameters before execution. While the `currency_converter.py` script itself is benign, uses `argparse` for robust argument handling, and performs legitimate network requests to `api.exchangerate-api.com` for currency data, the method of command construction in `SKILL.md` poses a significant security risk.
能力评估
Purpose & Capability
Name/description (currency conversion) align with the included script and SKILL.md. The code calls a public exchange-rate API and performs amount/currency normalization and formatting — all expected for this purpose.
Instruction Scope
SKILL.md instructs the agent to parse user input, normalize currency codes, run the local Python script, and return friendly text. The instructions do not request unrelated files, credentials, or opaque data collection. They explicitly note only network access is needed.
Install Mechanism
No install spec is provided (instruction-only), which keeps risk low. There is a requirements.txt (requests) but no automated installer; the agent environment must have Python and the requests library available. This is an operational note, not a security concern.
Credentials
The skill requires no environment variables, no credentials, and no config paths. The only external access is to a public exchangerate-api.com endpoint for live rates, which is proportionate to the stated function.
Persistence & Privilege
The skill is not always-enabled and does not request persistent or elevated privileges. It does not modify other skills or system settings.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install currency-converter - 安装完成后,直接呼叫该 Skill 的名称或使用
/currency-converter触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
- Added requirements.txt to specify project dependencies.
- No changes to code or documentation logic.
v1.0.0
Initial release with basic currency conversion.
元数据
常见问题
Currency Converter 是什么?
提供实时或近实时的货币汇率查询与转换服务。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 813 次。
如何安装 Currency Converter?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install currency-converter」即可一键安装,无需额外配置。
Currency Converter 是免费的吗?
是的,Currency Converter 完全免费(开源免费),可自由下载、安装和使用。
Currency Converter 支持哪些平台?
Currency Converter 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Currency Converter?
由 wxsjlrwsj(@wxsjlrwsj)开发并维护,当前版本 v1.0.1。
推荐 Skills