← スキル一覧に戻る

recipe-generator
by ayia
⭐ 0🍴 0📅 2026年1月22日
SKILL.md
name: recipe-generator description: Generate and manage AI-powered recipes for NutriProfile. Use this skill when working with recipe generation, ingredients management, cooking instructions, or the Recipes page. Handles multi-model consensus (Mistral, Llama, Mixtral) and user dietary preferences. allowed-tools: Read,Write,Edit,Grep,Glob,Bash
NutriProfile Recipe Generator Skill
You are a recipe generation expert for the NutriProfile application. This skill helps you work with AI-powered recipe generation that considers user profiles, allergies, and nutritional goals.
Context
NutriProfile uses multi-agent AI (Mistral, Llama, Mixtral) with consensus validation for recipe generation. The system considers:
- User dietary preferences (vegetarian, vegan, omnivore, etc.)
- Allergies and food restrictions
- Nutritional goals (weight loss, muscle gain, maintenance)
- Available ingredients
Architecture
Backend Files
backend/app/agents/recipe.py- Recipe generation agentbackend/app/models/recipe.py- Recipe, FavoriteRecipe, RecipeHistory modelsbackend/app/api/v1/recipes.py- Recipe API endpointsbackend/app/schemas/recipe.py- Pydantic schemas
Frontend Files
frontend/src/pages/RecipesPage.tsx- Main recipes pagefrontend/src/components/recipes/RecipeGenerator.tsx- Generation formfrontend/src/components/recipes/RecipeCard.tsx- Recipe display cardfrontend/src/services/recipesApi.ts- API service
Data Models
Recipe Model
class Recipe(Base):
id: int
user_id: int
name: str
description: str
ingredients: List[dict] # [{name, quantity, unit}]
instructions: List[str]
prep_time: int # minutes
cook_time: int # minutes
servings: int
calories_per_serving: float
protein_per_serving: float
carbs_per_serving: float
fat_per_serving: float
difficulty: str # easy, medium, hard
cuisine_type: str
tags: List[str]
image_url: Optional[str]
confidence_score: float
created_at: datetime
RecipeHistory Model
class RecipeHistory(Base):
id: int
user_id: int
recipe_id: int
generated_at: datetime
ingredients_used: List[str]
preferences_applied: dict
API Endpoints
Recipe Generation
POST /api/v1/recipes/generate
{
"ingredients": ["poulet", "riz", "brocoli"],
"preferences": {
"cuisine": "asian",
"max_time": 30,
"difficulty": "easy"
}
}
Response:
{
"id": 1,
"name": "Bowl Asiatique au Poulet",
"description": "...",
"ingredients": [...],
"instructions": [...],
"nutrition_per_serving": {...},
"confidence": 0.85
}
Other Endpoints
GET /api/v1/recipes- List user's recipesGET /api/v1/recipes/{id}- Get specific recipePOST /api/v1/recipes/{id}/favorite- Add to favoritesDELETE /api/v1/recipes/{id}/favorite- Remove from favoritesGET /api/v1/recipes/favorites- Get favorites
Multi-Agent Consensus
Recipe Agent Flow
async def generate_recipe(self, ingredients: List[str], profile: UserProfile):
# 1. Build context with user profile
context = self._build_context(ingredients, profile)
# 2. Query multiple models in parallel
results = await asyncio.gather(
self.query_mistral(context),
self.query_llama(context),
self.query_mixtral(context)
)
# 3. Consensus validation
merged_recipe = self.consensus.merge_recipes(results)
# 4. Calculate nutrition
merged_recipe.nutrition = self.calculate_nutrition(merged_recipe.ingredients)
return merged_recipe
Consensus Rules
- Recipe name: Best rated by coherence
- Prep/cook time: Average of all models
- Ingredients: Union with quantity averaging
- Instructions: Merge and order by step logic
- Confidence: Minimum of individual confidences
Freemium Limits
| Tier | Recipes/Week |
|---|---|
| Free | 2 |
| Premium | 10 |
| Pro | Unlimited |
Check limits in backend/app/services/subscription.py:
limits = {
"free": {"recipe": 2},
"premium": {"recipe": 10},
"pro": {"recipe": -1} # unlimited
}
Frontend Integration
React Query Hooks
// Generate recipe
const generateMutation = useMutation({
mutationFn: (data: RecipeRequest) => recipesApi.generate(data),
onSuccess: (recipe) => {
queryClient.invalidateQueries(['recipes'])
toast.success(t('recipeGenerated'))
}
})
// Fetch recipes
const { data: recipes } = useQuery({
queryKey: ['recipes'],
queryFn: () => recipesApi.getAll()
})
i18n Namespace
Use recipes namespace for translations:
recipes.title- Page titlerecipes.generate- Generate buttonrecipes.ingredients- Ingredients labelrecipes.instructions- Instructions labelrecipes.nutrition- Nutrition info
Best Practices
- Respect dietary restrictions - Always filter recipes based on user allergies
- Calculate accurate nutrition - Use per-ingredient values and sum
- Handle missing ingredients - Suggest substitutions
- Support multiple cuisines - French, Italian, Asian, Mediterranean, etc.
- Cache generated recipes - Save to RecipeHistory for analytics
Example Tasks
Add New Cuisine Type
- Update
CUISINE_TYPESin recipe agent - Add prompt template for cuisine
- Update frontend dropdown options
- Add translations for all 7 languages
Improve Recipe Quality
- Review agent prompts in
recipe.py - Adjust consensus weights
- Add more detailed instructions generation
- Test with various ingredient combinations
Fix Nutrition Calculation
- Check
calculate_nutrition()in recipe agent - Verify ingredient quantities are parsed correctly
- Cross-reference with nutritionReference database
- Run backend tests:
pytest tests/test_recipes.py
スコア
総合スコア
50/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です