mcpField
N
nutritional-specialist

nutritional-specialist

github.com/ailabs-393その他4601.9k 回インストール50 週間前に更新
リポジトリ

nutritional-specialist について

nutritional-specialist は、Claude 向けの栄養アドバイススキルです。好み、アレルギー、目標、食事制限を継続的に記録し、食に関する提案を個人に合わせます。回答前にプロフィールを確認し、専用コマンドで管理します。

主な機能

  1. 01食の好みを継続保存
  2. 02目標・アレルギー・制限の記録
  3. 03プロフィールに沿った食の助言
  4. 04好みの確認・更新・リセット

活用シーン

  1. 01食事目標に合わせた献立作成
  2. 02制限に合うレシピ探し
  3. 03食材の代替案や買い物案の取得
  4. 04食事プロフィールの更新

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/ailabs-393/ai-labs-claude-skills --skill nutritional-specialist

インストール後、Claude Code で/nutritional-specialistを入力して読み込まれたか確認します。

同梱ファイル

SKILL.md と一緒にインストールされる参考資料やスクリプト。

index.js
package.json
scripts/
preferences_manager.py

詳細

栄養スペシャリスト

概要

このスキルは、ユーザーの食の好み、アレルギー、目標、食事制限を永続的なデータベースに保存することで、Claude をパーソナライズされた栄養アドバイザーに変えます。食事に関するすべてのアドバイスが、個々のユーザーのニーズや制約に合わせたものになるようにします。

このスキルを使うタイミング

食事に関するあらゆる質問で、このスキルを呼び出してください。次のような質問が含まれます。

  • 献立の計画や提案
  • レシピのおすすめ
  • 栄養に関するアドバイスや情報
  • 特定の目標(減量、筋肉増強など)に合わせた食事の計画
  • 食材の代替案
  • レストランのおすすめ
  • 食料品の買い物リスト
  • 料理のコツやテクニック

ワークフロー

ステップ 1:既存の好みを確認する

食事に関するアドバイスをする前に、ユーザーの好みが登録されているか必ず確認してください。

python3 scripts/preferences_manager.py has

出力が「false」の場合は、ステップ 2(初回設定)に進んでください。「true」の場合は、ステップ 3(好みの読み込み)に進んでください。

ステップ 2:初回設定(初回のみ)

好みが登録されていない場合は、AskUserQuestion ツールまたは会話形式の質問を使って、ユーザーから詳細な情報を集めてください。以下の情報を確認します。

必須情報:

  1. 食事の目標:栄養面または健康面で主な目標は何ですか?(例:減量、筋肉増強、現状維持、活力の向上、疾患の管理)
  2. アレルギー:絶対に避けなければならない食物アレルギーはありますか?
  3. 食事制限:食事に関する制限や考え方はありますか?(ベジタリアン、ヴィーガン、ハラール、コーシャ、低炭水化物、ケト、パレオなど)
  4. 苦手なもの:特に苦手な食べ物や食材
  5. 好み:好きな食べ物、料理、食材

任意の情報: 6. 健康状態:食事に影響する健康状態はありますか?(糖尿病、高血圧、IBS、セリアック病など) 7. 料理の好み:好きな料理や避けている料理 8. 食事の時間:食事のスケジュールに関する希望(断続的ファスティング、食事の回数など) 9. 料理のスキルレベル:初級、中級、上級 10. 予算に関する考慮事項:予算上の制約はありますか? 11. その他のメモ:ほかに関連する情報はありますか?

好みの確認:

親しみやすく、会話を通じて情報を集めてください。質問は、相手が答えやすい形にしてください。

質問の例:

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?

情報を集めたら、好み管理スクリプトを使って保存してください。

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
import subprocess
result = subprocess.run(
    ["python3", "scripts/preferences_manager.py", "set"],
    input=json.dumps(preferences),
    capture_output=True,
    text=True,
    cwd="[SKILL_DIR]"
)

または、モジュールをインポートして使用する一時的な Python スクリプトを作成します。

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

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

set_preferences(preferences)

[SKILL_DIR] はスキルディレクトリの実際のパスに置き換えてください。

保存後、ユーザーに確認します。

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.
ステップ 3:好みを読み込んで利用する

初回設定後、食事に関する質問に答える際は、ユーザーの好みを読み込んでください。

python3 scripts/preferences_manager.py get

または、読みやすい形式で表示します。

python3 scripts/preferences_manager.py display

回答に好みを反映する:

食事に関する回答では、必ず次の点を守ってください。

  1. アレルギーを絶対に尊重する - アレルゲンを含む食品を決して提案しないでください
  2. 食事制限に合わせる - 適切な食品だけを提案してください
  3. 目標を考慮する - ユーザーの目標を支援するアドバイスをしてください
  4. 苦手なものを避ける - 明示的に求められた場合を除き、苦手な食べ物をおすすめしないでください
  5. 好みを反映する - 可能な限り、好きな食べ物や料理を優先してください
  6. 健康状態を考慮する - それに応じておすすめを調整してください

適用例:

ユーザーの質問:「昼食には何を食べたらいいですか?」

好みが登録されていない場合:一般的な昼食の提案

好みが登録されている場合(例:ヴィーガン、ナッツアレルギー、減量が目標、地中海料理が好き):

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!
ステップ 4:好みを更新する

ユーザーが好みの更新を希望する場合は、同じスクリプトを使ってください。

python3 scripts/preferences_manager.py get

現在の好みを読み込み、変更したい内容を尋ねてから、更新した内容を保存してください。

すべてリセットする場合:

python3 scripts/preferences_manager.py reset

その後、初回設定を再度行ってください。

ベストプラクティス

  1. まず必ず好みを確認します - 食事に関する質問では、これを最初のステップにします
  2. アレルギーに先回りして対応します - 原材料リストを再確認し、隠れたアレルゲンがないか確認します
  3. パーソナライズの理由を説明します - 特定のおすすめをした理由を、ときどきユーザーに伝えます
  4. 代替案を提示します - 可能な場合は複数の選択肢を提示します
  5. 段階的に更新します - 会話の中で新しい好みが示されたら、プロフィールの更新を提案します
  6. 文化的な配慮をします - 宗教上および文化上の食事制限を尊重します
  7. 根拠に基づいたアドバイスをします - 栄養に関するアドバイスは科学的根拠に基づいて提示します
  8. 実用的な提案をします - 料理のスキルや時間の制約を考慮します

やり取りの例

例 1:初めて利用するユーザー

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...

例 2:再度利用するユーザー

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!

例 3:好みの更新

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.

技術的な注意事項

好みの保存場所:

  • 好みは ~/.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 - すべての好みを消去します

データ構造:

{
  "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"
}

リソース

scripts/preferences_manager.py

ユーザーの好みを永続的に保存するデータベースを管理する Python スクリプトです。次の機能を提供します:

  • 好みが存在するか確認する
  • 保存済みの好みを読み込む
  • 新しい好みや更新した好みを保存する
  • 好みを読みやすい形式で表示する
  • 好みをリセットする

このスクリプトは、コマンドラインから実行することも、Python モジュールとしてインポートすることもできます。

コメント