cnqso

Calorie Counter

生活服務v1.0.0
作者:cnqso更新於 2026-05-11calorie-counter@clawhub_cnqso/calorie-counter
健康管理#Sqlite#Food

據 AlphaMoat 統計,截至 2026-09,Calorie Counter 累計下載 3,388 次、獲 1 個星標,在全部 5,078 個 AI 技能中排名第 3,309 位,在「生活服務」分類(246 個)中排名第 162 位。

累計安裝
101
累計下載
3388
星標
1
全站排名
#3,309
全站前 66% · 「生活服務」前 66%
平台累計安裝累計下載星標評論
ClawHub ↗10133081-
SkillHub ↗10133881—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

它提供新增食物、檢視每日彙總、設定目標、記錄體重、檢視歷史和刪除條目的命令。資料庫為本地檔案且以明文儲存,包含個人健康與飲食資訊;記錄模糊或僅在談論食物時不應自動寫入,先確認使用者意圖,並保護資料庫檔案。該工具是記錄器,不構成醫療或營養診斷。

資料釋出於 2026-10-29

可以用來做什麼

  • 記錄一餐食物和相關營養資料。
  • 檢視當日累計攝入和歷史趨勢。
  • 規劃目標設定及記錄刪除的確認流程。

什麼時候用

  • 需要主動記錄食物攝入、熱量、蛋白質或體重時。
  • 需要檢視每日目標進度或歷史記錄時。
  • 健康資料敏感或對話只是一般討論食物時,先確認是否要記錄,並檢查本地資料庫的儲存位置與保護方式。

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

概述 Calorie Counter 的本地記錄內容、查詢和刪除功能,並指出隱私注意事項。
為記錄一條飲食資訊設計確認和本地檔案保護步驟;不要實際寫入資料。

月度資料趨勢

累計下載3388
1895269734992026-03 · 累計下載 20062026-05 · 累計下載 24892026-07 · 累計下載 30302026-08 · 累計下載 31722026-09 · 累計下載 338826-0326-09
星標1
0122026-03 · 星標 12026-05 · 星標 12026-07 · 星標 12026-08 · 星標 12026-09 · 星標 126-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-093388—1
2026-083172+4.7%1
2026-073030—1
2026-052489—1
2026-032006—1

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

5.2 KB · ClawHub v1.0.0
---
name: calorie-counter
description: 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.
metadata: { "openclaw": { "emoji": "🍎", "requires": { "python": ">=3.7" } } }
---

# Calorie Counter

Simple, reliable calorie and protein tracking with SQLite database.
展開全部(共 180 行)
## 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
```bash
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
```bash
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
```bash
python scripts/calorie_tracker.py goal 2000
```
Sets the daily calorie goal (persists).

### Weight Tracking
```bash
python scripts/calorie_tracker.py weight 175
python scripts/calorie_tracker.py weight-history
```
Weight is in pounds (decimals allowed: 175.5).

### Viewing History
```bash
# Last 7 days
python scripts/calorie_tracker.py history

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

### Deleting Entries
```bash
# 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

```bash
# 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
```

「生活服務」分類下的熱門技能

資料月份:2026-09 · 下載/星標/安裝數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。