← 返回 Skills 市场
habitclaw

Habit AI

作者 habitclaw · GitHub ↗ · v1.2.0
cross-platform ⚠ suspicious
457
总下载
0
收藏
2
当前安装
4
版本数
在 OpenClaw 中安装
/install habit-ai
功能描述
Track nutrition, meals, water, weight, steps, meditation, and journal entries via the Habit AI API — a completely free service. Use when logging food, checki...
使用说明 (SKILL.md)

Habit AI

Track health and nutrition through the Habit AI REST API.

Setup (100% Free)

Habit AI is a completely free service — no subscription, no credit card, no usage limits.

  1. Create a free account at https://habitapp.ai (or download the free iOS app)
  2. Go to Settings → API Keys → Create Key (free, up to 5 keys)
  3. Store key in environment: export HABITAI_API_KEY="hab_..."

All requests use:

  • Base URL: https://habitapp.ai/api/v1
  • Auth header: Authorization: Bearer $HABITAI_API_KEY
  • Content-Type: application/json

Quick Reference

Action Method Endpoint
Log a meal POST /meals
Today's meals GET /meals?date=YYYY-MM-DD
Daily nutrition GET /nutrition/daily?date=YYYY-MM-DD
Weekly nutrition GET /nutrition/weekly?date=YYYY-MM-DD
Log water (ml) POST /water
Log weight (kg) POST /weight
Log steps POST /steps
Log meditation POST /meditation
Journal entry POST /journal
AI eating coach POST /coaches/eating
AI mindfulness coach POST /coaches/mindfulness
AI meditation coach POST /coaches/meditation
Get profile GET /profile
Update profile PUT /profile

For full endpoint details (request/response schemas, all parameters), see references/api.md.

Logging Meals — The Right Way

⚠️ CRITICAL: Use the AI model to analyze food, then POST /meals with the EXACT structure below

Do NOT call /analyze/food-image or /analyze/meal-description — instead, use your own vision/language capabilities to analyze the food, then construct the exact JSON structure below and POST it to /meals.

Step 0: Check user profile for allergens/diet

Before analyzing, call GET /profile to check foodSensitivities and diet fields. Factor these into:

  • healthScore — lower the score if the meal contains ingredients the user is sensitive to
  • healthScoreExplanation — mention the general nutritional pros/cons
  • healthSensitivityExplanation — if the meal contains any of the user's allergens/sensitivities, explain which ingredients are problematic and why. Leave empty string if no sensitivities match.

Step 1: Analyze the food yourself

For photos: Look at the image and identify each ingredient, estimate portions, and calculate nutrition using USDA data.

For descriptions: Parse the meal description and calculate nutrition the same way.

Step 2: POST /meals with the EXACT structure

Every field matters. iOS reads from nutritionalSummary (nested object) — if it's missing, meals show as 0 calories.

{
  "mealName": "Grilled Chicken Salad with Ranch",
  "calories": 520,
  "protein": 42,
  "carbs": 18,
  "fat": 32,
  "fiber": 4,
  "sodium": 890,
  "sugar": 6,
  "healthScore": 7,
  "healthScoreExplanation": "Lean protein from grilled chicken and fiber from greens, but ranch dressing adds significant fat and sodium.",
  "mealType": "lunch",
  "analysisConfidenceLevel": 8,
  "ingredients": [
    {
      "name": "grilled chicken breast",
      "calories": 280,
      "protein": 35,
      "carbs": 0,
      "fat": 14,
      "sugar": 0,
      "fiber": 0,
      "sodium": 400,
      "healthScore": 8,
      "measurementType": "grams",
      "measurementValue": 200
    },
    {
      "name": "mixed salad greens",
      "calories": 20,
      "protein": 2,
      "carbs": 4,
      "fat": 0,
      "sugar": 1,
      "fiber": 2,
      "sodium": 30,
      "healthScore": 9,
      "measurementType": "cups",
      "measurementValue": 2
    },
    {
      "name": "ranch dressing",
      "calories": 220,
      "protein": 5,
      "carbs": 14,
      "fat": 18,
      "sugar": 5,
      "fiber": 2,
      "sodium": 460,
      "healthScore": 3,
      "measurementType": "spoons",
      "measurementValue": 3
    }
  ]
}

Field Reference

Field Type Required Description
mealName string Yes Display name (e.g. "Chicken Caesar Salad"). Without this, the meal has no name in the app.
calories number Yes Total calories (kcal). Must be > 0.
protein number Yes Total protein in grams
carbs number Yes Total carbohydrates in grams
fat number Yes Total fat in grams
fiber number Yes Total fiber in grams
sodium number Yes Total sodium in milligrams
sugar number Yes Total sugar in grams
healthScore integer Yes 1-10. How healthy is this meal overall? (1=very unhealthy, 10=very healthy)
mealType string Yes One of: breakfast, lunch, dinner, snack
analysisConfidenceLevel integer Yes 1-10. How confident are you in the nutrition estimates? (1=wild guess, 10=exact data from packaging). For photo analysis use 6-8, for descriptions use 5-7.
healthScoreExplanation string Yes 1-2 sentence explanation of the nutritional pros/cons (e.g. "Good protein from chicken but high sodium from the sausage and dressing.")
healthSensitivityExplanation string Yes If the meal contains any of the user's allergens/food sensitivities (from profile), explain which ingredients are problematic. Empty string "" if no sensitivities match or user has none set.
ingredients array Yes Array of ingredient objects (see below)
imageUrl string No URL of the food photo. Get this from POST /meals/upload-image first (see below).
dateScanned string No ISO 8601 timestamp. Defaults to now if omitted.
serving number No Serving multiplier (defaults to 1.0)

Ingredient Object

Each ingredient in the ingredients array must have:

Field Type Description
name string Ingredient name (e.g. "grilled chicken breast")
calories number Calories for this ingredient's portion (kcal)
protein number Protein in grams
carbs number Carbs in grams
fat number Fat in grams
sugar number Sugar in grams
fiber number Fiber in grams
sodium number Sodium in milligrams
healthScore integer 1-10 health score for this specific ingredient
measurementType string Must be one of: grams, ounces, cups, spoons, servings. Use servings for pieces/slices/bowls/items. Use spoons for tablespoons/teaspoons.
measurementValue number Amount in the specified unit

Important Rules

  1. All nutrition values must be numbers, not strings. "calories": 520 not "calories": "520"
  2. Ingredient calories should sum to the total calories (approximately — within 5%)
  3. mealName is mandatory — without it, the meal is invisible on iOS
  4. healthScore is 1-10 integer — use your judgment (fast food = 2-4, home-cooked balanced = 6-8, raw salad = 9-10)
  5. analysisConfidenceLevel is 1-10 integer — be honest about uncertainty
  6. Sodium is in milligrams, everything else is in grams (except calories in kcal)

Uploading a meal photo (thumbnail)

If you have a food photo, upload it first to get a URL:

curl -X POST https://habitapp.ai/api/v1/meals/upload-image \
  -H "Authorization: Bearer $HABITAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"imageBase64": "\x3Cbase64-encoded-image>"}'

Returns: {"success": true, "imageUrl": "https://firebasestorage.googleapis.com/..."}

Then pass imageUrl in your POST /meals call. You can also attach to an existing meal:

{"imageBase64": "\x3Cbase64>", "mealId": "\x3Cexisting-meal-id>"}

Full flow with photo:

  1. POST /meals/upload-image with base64 photo → get imageUrl
  2. POST /meals with nutrition data + imageUrl

Other Workflows

Check remaining calories

  1. GET /nutrition/daily for today's totals
  2. GET /profile for calorie goal
  3. Subtract: caloriesGoal - totalCalories

Quick water log

curl -X POST https://habitapp.ai/api/v1/water \
  -H "Authorization: Bearer $HABITAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amount": 500}'

Amount is in milliliters. 1 cup ≈ 237ml, 1 glass ≈ 250ml.

Notes

  • Dates default to today if omitted (uses user's timezone from profile)
  • Water amount is in milliliters
  • Weight is in kilograms (1 lb ≈ 0.4536 kg)
  • Steps auto-calculate calories burned if profile has height/weight/gender
  • Max 5 API keys per account
安全使用建议
This skill appears to be a straightforward Habit AI API integration, but take these precautions before installing or using it: - Ask the publisher to declare HABITAI_API_KEY in the skill metadata (it currently isn't listed) so platform/permissions are clear. - Confirm where images will be processed: the SKILL.md tells the agent to analyze photos itself rather than using Habit AI's /analyze endpoints. Ask whether image data will be kept locally or transmitted elsewhere, and insist on explicit handling rules and user consent for image exposure. - Ask how USDA nutrition data is accessed or referenced — the skill asks you to 'use USDA data' but provides no data source or model instruction; verify accuracy expectations. - Because the skill source is unknown and homepage absent, treat the API key as sensitive: only provide a key with restricted scope/ability or use a throwaway key if testing. Revoke or rotate keys after evaluation. - Prefer a version that explicitly declares required env vars and documents privacy and data flow (where images or personal health details are sent and stored). If the publisher can clarify and fix the metadata (declare HABITAI_API_KEY) and explain the rationale for avoiding built-in analyze endpoints and for image handling, the inconsistencies would be resolved and the skill would be more trustworthy.
功能分析
Type: OpenClaw Skill Name: habit-ai Version: 1.2.0 The habit-ai skill bundle is a legitimate integration for the Habit AI health tracking service (habitapp.ai). It provides comprehensive instructions and API references for logging meals, water, weight, and journal entries. While it instructs the AI agent to perform its own nutritional analysis rather than using the API's built-in analysis endpoints, this appears to be a functional preference rather than a security risk. No evidence of data exfiltration, malicious execution, or harmful prompt injection was found.
能力评估
Purpose & Capability
Name/description match the included endpoints and instructions: the skill is a wrapper for the Habit AI REST API (meals, water, weight, steps, coaches, journal). However the SKILL.md expects an API key in HABITAI_API_KEY even though the registry metadata lists no required env vars — this mismatch is unexpected and should be declared.
Instruction Scope
Instructions tell the agent to call GET /profile and POST /meals and otherwise stay within the Habit API, which is appropriate. However the guide explicitly says not to call the built-in /analyze/ endpoints and instead use the agent's own vision/language capabilities to analyze photos/descriptions and compute nutrition (including using 'USDA data'), without providing data sources or safeguards. That raises privacy and scope concerns (where images are processed, what external data is used, and how accurate nutrition calculations are derived).
Install Mechanism
Instruction-only skill with no install spec and no code files — minimal filesystem or execution risk. This is the lowest install risk category.
Credentials
SKILL.md instructs the user to export HABITAI_API_KEY and use it for Authorization, but the registry metadata lists no required env vars/primary credential. The skill should declare HABITAI_API_KEY as a required/primary credential. Other than that single API key, no unrelated credentials are requested.
Persistence & Privilege
The skill does not request 'always: true' nor install components or modify other skills. It does allow normal autonomous invocation (platform default), which is expected and not in itself a red flag.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install habit-ai
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /habit-ai 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.2.0
v1.2: Improved documentation, meal logging, AI coaching, meditation tracking
v1.1.0
Clarified that Habit AI is a completely free service — no subscription or credit card required
v1.0.1
Updated meal logging docs, fixed iOS nutritionalSummary compatibility
v1.0.0
Initial release: full Habit AI API integration for nutrition tracking, meals, water, weight, steps, meditation, journaling, and AI coaching
元数据
Slug habit-ai
版本 1.2.0
许可证
累计安装 2
当前安装数 2
历史版本数 4
常见问题

Habit AI 是什么?

Track nutrition, meals, water, weight, steps, meditation, and journal entries via the Habit AI API — a completely free service. Use when logging food, checki... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 457 次。

如何安装 Habit AI?

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

Habit AI 是免费的吗?

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

Habit AI 支持哪些平台?

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

谁开发了 Habit AI?

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

💬 留言讨论