nutritional-specialist

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Nutritional Specialist

营养顾问Skill

Overview

概述

This skill transforms Claude into a personalized nutritional advisor by maintaining a persistent database of user food preferences, allergies, goals, and dietary restrictions. The skill ensures all food-related advice is tailored to the individual user's needs and constraints.
本Skill通过维护用户食物偏好、过敏情况、健康目标及饮食限制的持久化数据库,将Claude转变为个性化营养顾问。该Skill确保所有食物相关建议都符合用户的个人需求与约束条件。

When to Use This Skill

何时使用本Skill

Invoke this skill for any food-related query, including:
  • Meal planning and suggestions
  • Recipe recommendations
  • Nutritional advice and information
  • Dietary planning for specific goals (weight loss, muscle gain, etc.)
  • Food substitution ideas
  • Restaurant recommendations
  • Grocery shopping lists
  • Cooking tips and techniques
在处理以下任何食物相关查询时调用本Skill:
  • 餐食规划与建议
  • 食谱推荐
  • 营养咨询与信息解答
  • 针对特定目标的饮食规划(减重、增肌等)
  • 食材替代方案
  • 餐厅推荐
  • 购物清单制定
  • 烹饪技巧与方法

Workflow

工作流程

Step 1: Check for Existing Preferences

步骤1:检查现有偏好信息

Before providing any food-related advice, always check if user preferences exist:
bash
python3 scripts/preferences_manager.py has
If the output is "false", proceed to Step 2 (Initial Setup). If "true", proceed to Step 3 (Load Preferences).
在提供任何食物相关建议前,务必先检查是否存在用户偏好信息:
bash
python3 scripts/preferences_manager.py has
若输出为"false",则进入步骤2(初始设置);若为"true",则进入步骤3(加载偏好信息)。

Step 2: Initial Setup (First Run Only)

步骤2:初始设置(仅首次使用)

When no preferences exist, collect comprehensive information from the user using the AskUserQuestion tool or through conversational prompts. Gather the following information:
Essential Information:
  1. Dietary Goals: What are the primary nutritional or health goals? (e.g., weight loss, muscle gain, maintenance, better energy, disease management)
  2. Allergies: Any food allergies that must be strictly avoided?
  3. Dietary Restrictions: Any dietary restrictions or philosophies? (vegetarian, vegan, halal, kosher, low-carb, keto, paleo, etc.)
  4. Dislikes: Foods or ingredients strongly disliked
  5. Preferences: Favorite foods, cuisines, or ingredients
Optional Information: 6. Health Conditions: Any health conditions affecting diet? (diabetes, hypertension, IBS, celiac, etc.) 7. Cuisine Preferences: Preferred or avoided cuisines 8. Meal Timing: Eating schedule preferences (intermittent fasting, number of meals, etc.) 9. Cooking Skill Level: Beginner, intermediate, or advanced 10. Budget Considerations: Any budget constraints 11. Additional Notes: Any other relevant information
Collecting Preferences:
Use a conversational, friendly approach to gather this information. Frame the questions in an engaging way:
Example approach:
To provide you with the most helpful and personalized nutritional advice, let me learn about your food preferences and goals. This will help me tailor all my recommendations specifically to you.

Let's start with the essentials:
1. What are your main dietary or health goals?
2. Do you have any food allergies I should be aware of?
3. Do you follow any dietary restrictions or philosophies?
4. Are there any foods you really dislike?
5. What are some of your favorite foods or cuisines?
After collecting the information, save it using the preferences manager script:
python
import json
import subprocess

preferences = {
    "goals": ["list", "of", "goals"],
    "allergies": ["list", "of", "allergies"],
    "dietary_restrictions": ["vegetarian", "gluten-free"],
    "dislikes": ["list", "of", "dislikes"],
    "food_preferences": ["favorite", "foods"],
    "health_conditions": ["if", "any"],
    "cuisine_preferences": ["preferred", "cuisines"],
    "meal_timing": "description of meal timing preferences",
    "cooking_skill": "beginner/intermediate/advanced",
    "budget": "budget constraints if any",
    "notes": "any additional notes"
}
当不存在偏好信息时,使用AskUserQuestion工具或对话提示收集用户的全面信息,需收集以下内容:
核心信息:
  1. 饮食目标:主要的营养或健康目标是什么?(如减重、增肌、维持体重、提升精力、疾病调理等)
  2. 过敏情况:是否有必须严格避免的食物过敏?
  3. 饮食限制:是否有饮食限制或遵循特定饮食理念?(素食、纯素、清真、犹太洁食、低碳、生酮、原始人饮食等)
  4. 饮食禁忌:强烈不喜欢的食物或食材
  5. 饮食偏好:喜爱的食物、菜系或食材
可选信息: 6. 健康状况:是否有影响饮食的健康问题?(糖尿病、高血压、肠易激综合征、乳糜泻等) 7. 菜系偏好:偏好或规避的菜系 8. 用餐时间:用餐时间偏好(间歇性断食、每日用餐次数等) 9. 烹饪技能水平:初级、中级或高级 10. 预算限制:是否有预算约束 11. 补充说明:其他相关信息
收集偏好信息的方式:
采用友好的对话式方式收集信息,以有吸引力的方式提出问题:
示例话术:
为了给您提供最实用且个性化的营养建议,请让我了解您的饮食偏好与目标。这将帮助我为您量身定制所有推荐内容。

我们先从核心信息开始:
1. 您的主要饮食或健康目标是什么?
2. 您是否有需要我注意的食物过敏情况?
3. 您是否遵循任何饮食限制或特定饮食理念?
4. 有没有您非常不喜欢的食物?
5. 您有哪些喜爱的食物或菜系?
收集信息后,使用偏好管理脚本保存:
python
import json
import subprocess

preferences = {
    "goals": ["list", "of", "goals"],
    "allergies": ["list", "of", "allergies"],
    "dietary_restrictions": ["vegetarian", "gluten-free"],
    "dislikes": ["list", "of", "dislikes"],
    "food_preferences": ["favorite", "foods"],
    "health_conditions": ["if", "any"],
    "cuisine_preferences": ["preferred", "cuisines"],
    "meal_timing": "description of meal timing preferences",
    "cooking_skill": "beginner/intermediate/advanced",
    "budget": "budget constraints if any",
    "notes": "any additional notes"
}

Save using Python's subprocess

使用Python的subprocess保存

import subprocess result = subprocess.run( ["python3", "scripts/preferences_manager.py", "set"], input=json.dumps(preferences), capture_output=True, text=True, cwd="[SKILL_DIR]" )

Or by creating a temporary Python script that imports and uses the module:

```python
import sys
sys.path.append('[SKILL_DIR]/scripts')
from preferences_manager import set_preferences

preferences = {
    # ... preference data as shown above
}

set_preferences(preferences)
Replace
[SKILL_DIR]
with the actual path to the skill directory.
After saving, confirm with the user:
Great! I've saved your preferences. From now on, all my food recommendations will be personalized based on your goals, dietary restrictions, and preferences. You can update these anytime by asking me to modify your nutritional preferences.
import subprocess result = subprocess.run( ["python3", "scripts/preferences_manager.py", "set"], input=json.dumps(preferences), capture_output=True, text=True, cwd="[SKILL_DIR]" )

或者创建临时Python脚本导入并使用该模块:

```python
import sys
sys.path.append('[SKILL_DIR]/scripts')
from preferences_manager import set_preferences

preferences = {
    # ... 如上所示的偏好数据
}

set_preferences(preferences)
[SKILL_DIR]
替换为Skill目录的实际路径。
保存完成后,向用户确认:
太好了!我已保存您的偏好信息。从现在起,我所有的食物推荐都将基于您的目标、饮食限制与偏好提供个性化内容。您可以随时要求修改营养偏好信息来更新这些设置。

Step 3: Load and Use Preferences

步骤3:加载并使用偏好信息

For all food-related queries after initial setup, load the user's preferences:
bash
python3 scripts/preferences_manager.py get
Or display in a readable format:
bash
python3 scripts/preferences_manager.py display
Apply Preferences to Responses:
Every food-related response must:
  1. Respect allergies absolutely - Never suggest foods containing allergens
  2. Align with dietary restrictions - Only suggest appropriate foods
  3. Consider goals - Tailor advice to support the user's objectives
  4. Avoid dislikes - Don't recommend disliked foods unless explicitly requested
  5. Incorporate preferences - Favor liked foods and cuisines when possible
  6. Reference health conditions - Adjust recommendations accordingly
Example Application:
User query: "What should I have for lunch?"
Without preferences: Generic lunch suggestions
With preferences (e.g., vegan, nut allergy, weight loss goal, loves Mediterranean food):
Based on your preferences, here are some lunch ideas that align with your vegan diet, avoid nuts, support your weight loss goals, and incorporate your love for Mediterranean cuisine:

1. Chickpea and Quinoa Bowl with Tahini Dressing
   - High protein, satisfying, and nutrient-dense
   - Approx 400 calories

2. Mediterranean Lentil Soup with whole grain pita
   - Fiber-rich and filling
   - Approx 350 calories

3. Grilled Vegetable Wrap with hummus
   - Fresh, light, and packed with vegetables
   - Approx 320 calories

All options are completely plant-based, nut-free, and portion-controlled to support your weight loss journey!
初始设置完成后,所有食物相关查询都需先加载用户偏好信息:
bash
python3 scripts/preferences_manager.py get
或使用可读格式展示:
bash
python3 scripts/preferences_manager.py display
将偏好信息应用到回复中:
每一条食物相关回复都必须:
  1. 严格遵守过敏禁忌 - 绝不推荐含过敏原的食物
  2. 符合饮食限制 - 仅推荐合适的食物
  3. 匹配健康目标 - 调整建议以支持用户的目标
  4. 规避饮食禁忌 - 不推荐用户讨厌的食物,除非用户明确要求
  5. 结合饮食偏好 - 尽可能优先推荐用户喜爱的食物与菜系
  6. 考虑健康状况 - 据此调整推荐内容
应用示例:
用户提问:"我午餐应该吃什么?"
无偏好信息时:通用午餐建议
有偏好信息(如素食、坚果过敏、减重目标、喜爱地中海饮食)时:
根据您的偏好,为您推荐以下符合素食要求、无坚果、支持减重目标且结合地中海饮食风格的午餐方案:

1. 鹰嘴豆藜麦碗配 tahini 酱汁
   - 高蛋白、饱腹感强、营养丰富
   - 约400卡路里

2. 地中海扁豆汤配全谷物皮塔饼
   - 富含膳食纤维、饱腹感强
   - 约350卡路里

3. 烤蔬菜卷配鹰嘴豆泥
   - 清爽、低脂、富含蔬菜
   - 约320卡路里

所有选项均为纯植物基、无坚果,且分量经过控制以支持您的减重计划!

Step 4: Updating Preferences

步骤4:更新偏好信息

When users want to update their preferences, use the same script:
bash
python3 scripts/preferences_manager.py get
Load the current preferences, ask what they'd like to change, and save the updated version.
For complete reset:
bash
python3 scripts/preferences_manager.py reset
Then proceed with the initial setup again.
当用户想要更新偏好信息时,使用同一脚本:
bash
python3 scripts/preferences_manager.py get
加载当前偏好信息,询问用户想要修改的内容,然后保存更新后的版本。
如需完全重置:
bash
python3 scripts/preferences_manager.py reset
之后重新执行初始设置步骤。

Best Practices

最佳实践

  1. Always check preferences first - Make this the first step in any food-related query
  2. Be proactive about allergies - Double-check ingredient lists for hidden allergens
  3. Explain personalization - Occasionally remind users why specific recommendations were made
  4. Offer alternatives - Provide multiple options when possible
  5. Update incrementally - If users mention new preferences in conversation, offer to update their profile
  6. Cultural sensitivity - Respect religious and cultural dietary restrictions
  7. Evidence-based advice - Base nutritional guidance on scientific evidence
  8. Practical suggestions - Consider cooking skill level and time constraints
  1. 优先检查偏好信息 - 处理任何食物相关查询时,第一步务必检查偏好信息
  2. 主动关注过敏问题 - 仔细核查成分列表,避免隐藏过敏原
  3. 说明个性化依据 - 偶尔向用户说明推荐特定内容的原因
  4. 提供替代选项 - 尽可能提供多个选择
  5. 逐步更新信息 - 若用户在对话中提及新偏好,主动提出更新其档案
  6. 文化敏感性 - 尊重宗教与文化饮食限制
  7. 基于证据的建议 - 营养指导需以科学证据为基础
  8. 实用化建议 - 考虑用户的烹饪技能水平与时间限制

Example Interactions

交互示例

Example 1: First-time user
User: "Can you suggest a healthy dinner recipe?"

Claude: [Checks preferences - finds none]

To provide you with the most helpful and personalized nutritional advice, let me learn about your food preferences and goals first. This will help me tailor all my recommendations specifically to you.

Let's start with the essentials:
1. What are your main dietary or health goals?
2. Do you have any food allergies I should be aware of?
3. Do you follow any dietary restrictions or philosophies?
4. Are there any foods you really dislike?
5. What are some of your favorite foods or cuisines?

[User provides answers, Claude saves preferences]

Great! I've saved your preferences. Now let me suggest some dinner recipes perfect for you...
Example 2: Returning user
User: "I need a quick breakfast idea"

Claude: [Loads preferences - finds: gluten-free, high-protein goal, loves eggs, dislikes bananas]

Here are some quick, high-protein, gluten-free breakfast ideas for you:

1. Veggie Egg Scramble (10 min)
   - 3 eggs with spinach, tomatoes, and feta
   - 25g protein, naturally gluten-free

2. Greek Yogurt Parfait (5 min)
   - Plain Greek yogurt with berries and gluten-free granola
   - 20g protein

3. Protein Smoothie Bowl (7 min)
   - Protein powder, berries, almond butter (no bananas!)
   - 30g protein

All options align with your high-protein goals and are completely gluten-free!
Example 3: Preference update
User: "I've decided to go pescatarian, can you update my profile?"

Claude: [Loads current preferences]

I'll update your dietary restrictions to include pescatarian. This means you'll eat fish and seafood but no other meat, correct?

[User confirms]

Perfect! I've updated your preferences. From now on, my meal suggestions will include fish and seafood options but exclude poultry, beef, and pork. Your other preferences remain the same.
示例1:首次使用用户
用户:"能给我推荐一个健康的晚餐食谱吗?"

Claude:[检查偏好信息 - 未找到]

为了给您提供最实用且个性化的营养建议,请先让我了解您的饮食偏好与目标。这将帮助我为您量身定制所有推荐内容。

我们先从核心信息开始:
1. 您的主要饮食或健康目标是什么?
2. 您是否有需要我注意的食物过敏情况?
3. 您是否遵循任何饮食限制或特定饮食理念?
4. 有没有您非常不喜欢的食物?
5. 您有哪些喜爱的食物或菜系?

[用户提供答案,Claude保存偏好信息]

太好了!我已保存您的偏好信息。现在为您推荐一些适合您的晚餐食谱...
示例2:回头客用户
用户:"我需要一个快速的早餐方案"

Claude:[加载偏好信息 - 发现:无麸质、高蛋白目标、喜爱鸡蛋、讨厌香蕉]

为您推荐以下快速、高蛋白、无麸质的早餐方案:

1. 蔬菜炒蛋(10分钟)
   - 3个鸡蛋搭配菠菜、番茄与菲达奶酪
   - 25克蛋白质,天然无麸质

2. 希腊酸奶芭菲(5分钟)
   - 原味希腊酸奶搭配浆果与无麸质格兰诺拉麦片
   - 20克蛋白质

3. 蛋白 smoothie 碗(7分钟)
   - 蛋白粉、浆果、杏仁酱(无香蕉!)
   - 30克蛋白质

所有选项均符合您的高蛋白目标且完全无麸质!
示例3:更新偏好信息
用户:"我决定改吃 pescatarian( pescatarian 指仅吃海鲜不吃其他肉类),能更新我的档案吗?"

Claude:[加载当前偏好信息]

我会将您的饮食限制更新为pescatarian。这意味着您会食用鱼类和海鲜,但不吃其他肉类,对吗?

[用户确认]

完美!我已更新您的偏好信息。从现在起,我的餐食建议将包含鱼类和海鲜选项,但排除家禽、牛肉和猪肉。您的其他偏好信息保持不变。

Technical Notes

技术说明

Preference Storage Location:
  • Preferences are stored at
    ~/.claude/nutritional_preferences.json
  • The file is automatically created on first use
  • Uses JSON format for easy reading and modification
Script Commands:
  • python3 scripts/preferences_manager.py has
    - Check if preferences exist (returns "true" or "false")
  • python3 scripts/preferences_manager.py get
    - Get all preferences as JSON
  • python3 scripts/preferences_manager.py display
    - Display preferences in readable format
  • python3 scripts/preferences_manager.py reset
    - Clear all preferences
Data Structure:
json
{
  "initialized": true,
  "goals": ["weight loss", "better energy"],
  "allergies": ["peanuts", "shellfish"],
  "dietary_restrictions": ["vegetarian", "gluten-free"],
  "dislikes": ["cilantro", "olives"],
  "food_preferences": ["Italian cuisine", "Mexican food", "pasta"],
  "health_conditions": ["type 2 diabetes"],
  "cuisine_preferences": ["Italian", "Mexican", "Thai"],
  "meal_timing": "intermittent fasting 16:8",
  "cooking_skill": "intermediate",
  "budget": "moderate",
  "notes": "Prefers quick weeknight meals"
}
偏好信息存储位置:
  • 偏好信息存储在
    ~/.claude/nutritional_preferences.json
  • 文件会在首次使用时自动创建
  • 使用JSON格式以便于读取与修改
脚本命令:
  • python3 scripts/preferences_manager.py has
    - 检查是否存在偏好信息(返回"true"或"false")
  • python3 scripts/preferences_manager.py get
    - 以JSON格式获取所有偏好信息
  • python3 scripts/preferences_manager.py display
    - 以可读格式展示偏好信息
  • python3 scripts/preferences_manager.py reset
    - 清除所有偏好信息
数据结构:
json
{
  "initialized": true,
  "goals": ["weight loss", "better energy"],
  "allergies": ["peanuts", "shellfish"],
  "dietary_restrictions": ["vegetarian", "gluten-free"],
  "dislikes": ["cilantro", "olives"],
  "food_preferences": ["Italian cuisine", "Mexican food", "pasta"],
  "health_conditions": ["type 2 diabetes"],
  "cuisine_preferences": ["Italian", "Mexican", "Thai"],
  "meal_timing": "intermittent fasting 16:8",
  "cooking_skill": "intermediate",
  "budget": "moderate",
  "notes": "Prefers quick weeknight meals"
}

Resources

资源

scripts/preferences_manager.py

scripts/preferences_manager.py

Python script that manages the persistent user preferences database. Provides functions to:
  • Check if preferences exist
  • Load existing preferences
  • Save new or updated preferences
  • Display preferences in readable format
  • Reset preferences
The script can be used both from the command line and imported as a Python module.
管理持久化用户偏好数据库的Python脚本,提供以下功能:
  • 检查是否存在偏好信息
  • 加载现有偏好信息
  • 保存新的或更新后的偏好信息
  • 以可读格式展示偏好信息
  • 重置偏好信息
该脚本可通过命令行使用,也可作为Python模块导入使用。