← 返回 Skills 市场
352
总下载
2
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install calorie-lookup
功能描述
Spoonacular 营养查询与热量估算(主数据源,USDA 后备)。支持搜寻优化、烹饪系数、交叉验证及图像识别。需要 API key 环境变量 SPOONACULAR_API_KEY 或 USDA_FDC_API_KEY。
使用说明 (SKILL.md)
Calorie Lookup (Spoonacular + USDA)
使用 / Usage
- 入口函数 / Entry functions:
scripts/core.py中的lookup_meal(text, meal_type)/lookup_food(name, qty, unit) - 结果为 JSON / Returns JSON:items + totals + questions(最多 2 个追问 / up to 2 follow-up questions)
配置 / Configuration
- 环境变量 / Env var:
SPOONACULAR_API_KEY(主数据源)/USDA_FDC_API_KEY(后备)/SPOONACULAR_API_KEY(primary) orUSDA_FDC_API_KEY(fallback) - 缓存 / Cache:
CALORIE_SKILL_CACHE_DB(默认本地 sqlite / defaults to local sqlite)
结构说明 / Module Structure
scripts/core.py:主逻辑(Spoonacular 主路由 + USDA 后备)/ Main logic (Spoonacular primary routing + USDA fallback)scripts/spoonacular.py:Spoonacular API 封装 / Spoonacular API wrapperscripts/translate.py:中英食物名字典(加速缓存,非主翻译路径)/ CN→EN dictionary (acceleration cache, not the primary translation path)scripts/usda_fdc.py:USDA API 封装 + 错误处理 / USDA API wrapper + error handlingscripts/parser.py:文本解析 / Text parsingscripts/units.py:默认换算表(常改)/ Unit conversion & portion defaultsscripts/cache.py:SQLite 缓存 / SQLite cachescripts/cooking.py:烹饪热量修正系数(USDA 数据源)/ Cooking calorie modifiers (USDA source)
行为约束 / Behavior Constraints
- 缺单位或无法换算:返回
questions提示补充 / Missing unit or unconvertible: returnsquestionsprompting user - 401/403/429/5xx:返回明确错误信息(适合直接在 Discord 显示)/ Returns clear error messages (suitable for Discord display)
工作流(含 Sub-agent 翻译 + 分解)/ Workflow (with Sub-agent Translation + Decomposition)
- sub-agent 描述位于本 skill 的
agents/目录 / Sub-agent contracts are inagents/ agents/calorie-lookup-image-recognizer.md:图像识别 Sub-agent 合约 / Image Recognizer Sub-agent contract- 非英语输入 → 触发 Decomposer Sub-agent(LLM 翻译 + 分解)/ Non-English input → triggers Decomposer Sub-agent (LLM translation + decomposition)
- 复合菜/套餐/模糊描述 → 触发 Decomposer Sub-agent / Composite dishes / set meals / ambiguous descriptions → triggers Decomposer
- 纯英语简单食材 → 直接调用
lookup_meal/ Plain English simple ingredients → callslookup_mealdirectly - 见 / See
WORKFLOW.md与 / andHOOKS.md - 分解后逐条调用
lookup_food(英文 name),再汇总 totals / After decomposition, callslookup_foodper item (English name), then aggregates totals scripts/translate.py字典仅作为 Python 层的加速缓存,不替代 LLM 翻译 / The dictionary is only an acceleration cache, not a replacement for LLM translation- 仍缺关键量化 → 追问最多 2 条 / Still missing key quantity data → up to 2 follow-up questions
路径规范 / Path Convention
- 本 skill 内所有引用均使用相对路径 / All references within this skill use relative paths(例如 / e.g.
scripts/core.py、agents/、references/usda_fdc.md)
安全使用建议
What to check before installing: 1) Confirm whether both SPOONACULAR_API_KEY and USDA_FDC_API_KEY truly must be provided — docs indicate at least one is enough but registry metadata lists both as required. Avoid supplying more credentials than necessary. 2) Review the included scripts (especially spoonacular.py and usda_fdc.py) to confirm network endpoints and logging behavior; run in an isolated virtualenv and with a non-production API key first. 3) Be aware sub-agents will use multimodal LLMs for translation/image recognition (Gemini/GPT-5.2 are referenced); understand where images/text are sent and whether that matches your privacy policy. 4) The skill creates a local SQLite cache — if you have concerns, set CALORIE_SKILL_CACHE_DB to an appropriate path and inspect the stored contents. 5) If you want higher assurance, run the smoke commands in AGENTS.md and review responses to confirm no unexpected external endpoints or secret access occurs. If the registry requires both keys but you only want to use one provider, ask the publisher to correct the metadata before provisioning credentials.
功能分析
Type: OpenClaw Skill
Name: calorie-lookup
Version: 0.3.0
The OpenClaw AgentSkills skill bundle 'calorie-lookup' is classified as benign. The skill's primary function is nutrition lookup and calorie estimation using Spoonacular and USDA FoodData Central APIs. All observed network requests to `api.nal.usda.gov` and `api.spoonacular.com` are directly related to this stated purpose, with API keys securely read from environment variables as defined in `scripts/config_example.py` and `SKILL.md`. Local file system access is limited to an SQLite cache (`scripts/cache.py`). The markdown files (`SKILL.md`, `AGENTS.md`, `WORKFLOW.md`, `HOOKS.md`, `agents/*.md`) describe the skill's legitimate workflow and sub-agent contracts, without any evidence of prompt injection attempts, malicious instructions, data exfiltration, or persistence mechanisms. No obfuscation or suspicious execution patterns were found.
能力评估
Purpose & Capability
Name/description (Spoonacular primary, USDA fallback, cooking modifiers, image recognition) aligns with the included Python modules (spoonacular.py, usda_fdc.py, cooking.py, image/decomposer contracts). Network calls to the two nutrition APIs are expected for this functionality.
Instruction Scope
SKILL.md, WORKFLOW.md, and agents/* prescribe triggering sub-agents (LLM-based Decomposer and multimodal Image Recognizer) and calling lookup_food/lookup_meal. Instructions reference only relative repo paths and the declared APIs. Note: sub-agents will cause LLM/model invocations for translation or image recognition (Gemini 3 Pro / GPT-5.2 are named as models). This is coherent for translation/image features but means user data (including images) will be processed by those LLM endpoints—verify how your platform routes those calls.
Install Mechanism
No install spec (instruction-only in registry) but the package contains Python code; dependencies are a single, reasonable requirement (requests). No remote downloads, no opaque installers — low install risk. You should still run in a virtualenv and inspect code before executing.
Credentials
Metadata and SKILL.md list SPOONACULAR_API_KEY and USDA_FDC_API_KEY as env vars. However the docs and config_example state each key is optional and at least one should be set (Spoonacular primary, USDA fallback). Registry 'Required env vars' appears to require both — this is inconsistent. Aside from these two API keys and optional CACHE_DB path, no unrelated secrets are requested.
Persistence & Privilege
No always:true; skill is user-invocable and can be invoked autonomously (platform default). The skill does not request to modify other skills or system-wide settings. It writes a local SQLite cache (configurable path).
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install calorie-lookup - 安装完成后,直接呼叫该 Skill 的名称或使用
/calorie-lookup触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.3.0
**Major update: Switch to Spoonacular as primary data source, with new features and modules.**
- Primary lookup is now via Spoonacular API (USDA as fallback).
- Added support for search optimization, cooking calorie modifiers, and cross-validation.
- Image recognition support introduced through a new image sub-agent.
- New modules: `spoonacular.py` (API wrapper), `cooking.py` (cooking modifiers).
- Requires `SPOONACULAR_API_KEY` (with fallback to `USDA_FDC_API_KEY`).
- Documentation and workflow updated for new data sources and features.
v0.1.0
Initial release of calorie-lookup.
- Supports USDA FoodData Central nutrition queries and meal calorie/macros estimation.
- Handles queries in both Chinese and English, including examples like "鸡胸肉200g / 米饭一碗 / 牛奶250ml".
- Provides structured JSON responses: itemized results, totals, and up to 2 follow-up questions if needed.
- Requires USDA_FDC_API_KEY environment variable; uses local SQLite cache by default.
- Features modular code: food name parsing, Chinese-English translation (with dictionary/cache), USDA API wrapper, and workflow with sub-agent for translation & decomposition.
- Clear error handling for missing/ambiguous info and API errors.
元数据
常见问题
Calorie Lookup 是什么?
Spoonacular 营养查询与热量估算(主数据源,USDA 后备)。支持搜寻优化、烹饪系数、交叉验证及图像识别。需要 API key 环境变量 SPOONACULAR_API_KEY 或 USDA_FDC_API_KEY。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 352 次。
如何安装 Calorie Lookup?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install calorie-lookup」即可一键安装,无需额外配置。
Calorie Lookup 是免费的吗?
是的,Calorie Lookup 完全免费(开源免费),可自由下载、安装和使用。
Calorie Lookup 支持哪些平台?
Calorie Lookup 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Calorie Lookup?
由 LiuZX886(@liuzx886)开发并维护,当前版本 v0.3.0。
推荐 Skills