← 返回 Skills 市场
cnqso

Calorie Counter

作者 cnqso · GitHub ↗ · v1.0.0
cross-platform ✓ 安全检测通过
2094
总下载
1
收藏
3
当前安装
1
版本数
在 OpenClaw 中安装
/install calorie-counter
功能描述
Track daily calorie and protein intake, set goals, and log weight. Use when user mentions food they ate, wants to know remaining calories, or needs to track weight. Stores data in SQLite with automatic daily totals.
使用说明 (SKILL.md)

Calorie Counter

Simple, reliable calorie and protein tracking with SQLite database.

Features

  • Manual Entry: Add food with calories and protein
  • Protein Tracking: Monitor daily protein intake
  • Daily Goals: Set custom calorie targets
  • Weight Tracking: Log weight in pounds
  • Instant Feedback: See totals immediately after adding food
  • History: View past days and trends

Usage

Adding Food

python scripts/calorie_tracker.py add "chicken breast" 165 31
python scripts/calorie_tracker.py add "banana" 100 1

Shows immediate feedback with today's totals and remaining calories.

Viewing Today's Summary

python scripts/calorie_tracker.py summary

Shows:

  • All entries for today
  • Total calories and protein consumed
  • Daily goal and remaining calories
  • Progress percentage

Setting Goals

python scripts/calorie_tracker.py goal 2000

Sets the daily calorie goal (persists).

Weight Tracking

python scripts/calorie_tracker.py weight 175
python scripts/calorie_tracker.py weight-history

Weight is in pounds (decimals allowed: 175.5).

Viewing History

# Last 7 days
python scripts/calorie_tracker.py history

# Last 30 days
python scripts/calorie_tracker.py history 30

Deleting Entries

# List entries to get ID
python scripts/calorie_tracker.py list

# Delete by ID
python scripts/calorie_tracker.py delete 42

Database

SQLite database: calorie_data.db

Tables

entries - Food log

  • id (INTEGER) - Auto-increment
  • date (TEXT) - YYYY-MM-DD
  • food_name (TEXT)
  • calories (INTEGER)
  • protein (INTEGER)
  • created_at (TIMESTAMP) - Automatic

daily_goal - Single calorie target

  • id (INTEGER) - Always 1
  • calorie_goal (INTEGER)

weight_log - Weight tracking

  • id (INTEGER) - Auto-increment
  • date (TEXT) - YYYY-MM-DD
  • weight_lbs (REAL) - Pounds with decimals
  • created_at (TIMESTAMP) - Automatic

Agent Instructions

Important: The skill is located at workspace/calorie-counter/ in your agent's workspace. All commands should use this path prefix.

When user mentions food:

  1. Extract food name, calories, and protein (estimate if not provided)
  2. Run: python3 workspace/calorie-counter/scripts/calorie_tracker.py add "food" CALORIES PROTEIN
  3. The command outputs immediate totals (no need to run summary separately)

Example:

  • User: "I had a chicken breast for lunch, about 165 calories"
  • Estimate protein (chicken is ~30g per 165 cal)
  • Run: python3 workspace/calorie-counter/scripts/calorie_tracker.py add "chicken breast" 165 30

When user wants remaining calories:

  1. Run: python3 workspace/calorie-counter/scripts/calorie_tracker.py summary

When user sets a goal:

  1. Run: python3 workspace/calorie-counter/scripts/calorie_tracker.py goal CALORIES

When user logs weight:

  1. Convert to pounds if needed (1 kg ≈ 2.205 lbs)
  2. Run: python3 workspace/calorie-counter/scripts/calorie_tracker.py weight POUNDS

When user wants to delete entry:

  1. Run: python3 workspace/calorie-counter/scripts/calorie_tracker.py list to show IDs
  2. Run: python3 workspace/calorie-counter/scripts/calorie_tracker.py delete ID

Protein Estimation Guide

If user doesn't specify protein, estimate based on food type:

  • Lean meats (chicken, turkey): ~0.30g per calorie
  • Fish: ~0.25g per calorie
  • Red meat: ~0.20g per calorie
  • Eggs: ~0.12g per calorie (1 egg = 70 cal, 6g protein)
  • Greek yogurt: ~0.10g per calorie
  • Nuts: ~0.04g per calorie
  • Bread/pasta: ~0.03g per calorie
  • Fruits: ~0.01g per calorie or less
  • Vegetables: ~0.02-0.04g per calorie

When uncertain, estimate conservatively or ask the user.

Notes

  • Calories and protein are integers (no decimals)
  • Weight is in pounds (decimals allowed)
  • Database created automatically on first use
  • All times in local timezone
  • Dates in YYYY-MM-DD format
  • Time shown in lists is from created_at timestamp (HH:MM format)

Example Session

# Set goal
$ python scripts/calorie_tracker.py goal 2000
✓ Set daily goal: 2000 cal

# Add breakfast
$ python scripts/calorie_tracker.py add "oatmeal" 150 5
✓ Added: oatmeal (150 cal, 5g protein)
  Entry ID: 1
  Today: 150 / 2000 cal (remaining: 1850) | Protein today: 5g | Entries: 1

# Add lunch
$ python scripts/calorie_tracker.py add "grilled chicken salad" 350 45
✓ Added: grilled chicken salad (350 cal, 45g protein)
  Entry ID: 2
  Today: 500 / 2000 cal (remaining: 1500) | Protein today: 50g | Entries: 2

# Check summary
$ python scripts/calorie_tracker.py summary
============================================================
DAILY SUMMARY - 2026-02-05
============================================================
Entries: 2
Total consumed: 500 cal | 50g protein
Daily goal: 2000 cal
Remaining: 1500 cal
  25.0% of goal consumed
============================================================

# Log weight
$ python scripts/calorie_tracker.py weight 175.5
✓ Logged weight: 175.5 lbs
安全使用建议
This skill appears to be a simple local calorie/protein tracker that stores data in workspace/calorie-counter/calorie_data.db. Before installing, consider: 1) Privacy — the DB is stored unencrypted in your workspace and could be included in backups or accessed by other processes/users with access to that path. 2) Permissions — verify the workspace location is appropriate and restrict file permissions if needed. 3) Autonomy — the agent may auto-run the script when you mention food; if you want manual control, disable autonomous invocation or limit when the skill can run. 4) Code review — although the script appears benign (no networking, no exec of arbitrary shell commands, parameterized SQL), you may still inspect scripts/calorie_tracker.py yourself. If you need encrypted storage, remote sync, or integration with other services, expect to add explicit, audited code and credentials for those services.
功能分析
Type: OpenClaw Skill Name: Developer: Version: Description: OpenClaw Agent Skill Suspicious High-Entropy/Eval files: 1 The OpenClaw skill 'calorie-counter' is benign. The Python script `calorie_tracker.py` uses only standard libraries, stores data locally in a SQLite database (`calorie_data.db`), and correctly employs parameterized SQL queries to prevent injection vulnerabilities. There are no network calls, no attempts to access sensitive system files or environment variables, and no persistence mechanisms. The `SKILL.md` instructions for the AI agent are clear, directly mapping user intent to specific, safe commands of the local Python script, with no evidence of prompt injection aiming to subvert the agent's behavior or access unauthorized data.
能力评估
Purpose & Capability
Name/description (calorie & weight tracking) match the included Python script and README/SKILL.md. The skill requires only Python and uses a local SQLite DB in the skill workspace; nothing requested or included is unrelated to its stated purpose.
Instruction Scope
SKILL.md explicitly instructs the agent to run the included script from workspace/calorie-counter and to read/write the local SQLite DB. All referenced files, commands, and data (add, summary, goal, weight, delete, history) are directly relevant. The only non-functional autonomy is that the agent is asked to estimate protein when not provided — this is a behavioral/accuracy choice, not a security concern.
Install Mechanism
No install spec is provided (instruction-only with a bundled script). No external downloads, package installs, or archive extraction are present. The code is local and uses only the Python standard library and SQLite.
Credentials
The skill requests no environment variables, credentials, or config paths. The metadata notes Python>=3.7 which is reasonable. There are no unrelated or excessive permissions requested.
Persistence & Privilege
always:false and no install hooks or modifications to other skills are present. The skill persists data only to its own local SQLite file under the workspace (calorie_data.db). Agent autonomous invocation is allowed by default but is not disproportionate here.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install calorie-counter
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /calorie-counter 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of calorie-counter skill: simple calorie, protein, and weight tracking using SQLite. - Supports manual food entry with instant daily totals and protein estimation. - Allows setting and persisting daily calorie goals. - Includes weight logging (supports decimals, in pounds) and weight history. - Provides history, entry deletion, and complete summary views. - All data is stored automatically; tables created as needed.
元数据
Slug calorie-counter
版本 1.0.0
许可证
累计安装 3
当前安装数 3
历史版本数 1
常见问题

Calorie Counter 是什么?

Track daily calorie and protein intake, set goals, and log weight. Use when user mentions food they ate, wants to know remaining calories, or needs to track weight. Stores data in SQLite with automatic daily totals. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 2094 次。

如何安装 Calorie Counter?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install calorie-counter」即可一键安装,无需额外配置。

Calorie Counter 是免费的吗?

是的,Calorie Counter 完全免费(开源免费),可自由下载、安装和使用。

Calorie Counter 支持哪些平台?

Calorie Counter 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Calorie Counter?

由 cnqso(@cnqso)开发并维护,当前版本 v1.0.0。

💬 留言讨论