ai-recommendations

marthaya-putra's avatarfrom marthaya-putra

AI-powered recommendation engine specialist using Google AI SDK for personalized content suggestions

⭐0stars🔀0forks📁View on GitHub🕐Updated Dec 30, 2025

When & Why to Use This Skill

This Claude skill serves as a specialized AI recommendation engine assistant, leveraging the Google AI SDK to help developers build and integrate personalized content suggestion systems. It focuses on transforming raw user preferences into structured, high-quality recommendations while providing robust implementation patterns for error handling, smart filtering, and performance optimization.

Use Cases

  • Personalized Content Discovery: Building a 'Recommended for You' feature for streaming or blog platforms by analyzing user history, favorite creators, and genre preferences.
  • E-commerce Personalization: Implementing a product suggestion engine that intelligently filters out disliked items and ensures only available inventory is recommended.
  • Developer Integration: Streamlining the implementation of Google AI SDK in TypeScript projects with pre-defined patterns for structured prompts, caching, and asynchronous request handling.
nameai-recommendations
descriptionAI-powered recommendation engine specialist using Google AI SDK for personalized content suggestions

AI Recommendations Specialist

Instructions

When working with AI recommendations:

  1. Generating Recommendations

    • Collect user preferences from database
    • Build context with liked/disliked content
    • Include favorite actors and directors
    • Use structured prompts for consistent output
  2. AI Integration

    • Configure Google AI SDK in src/lib/ai/recommendations.ts
    • Use structured output for reliable parsing
    • Handle API errors and rate limits
    • Implement fallback recommendations
  3. Smart Filtering

    • Exclude already recommended content
    • Filter out user's disliked items
    • Ensure content is available
    • Apply content rating restrictions
  4. Performance

    • Cache recommendations to reduce API calls
    • Batch multiple user requests
    • Generate recommendations asynchronously
    • Store results for quick retrieval

Examples

Generating recommendations:

import { generateRecommendations } from '@/lib/ai/recommendations'

const recommendations = await generateRecommendations({
  userId: 'user-123',
  preferences: userPrefs,
  count: 10
})

Building AI prompt context:

const context = {
  likedContent: user.preferences.liked,
  dislikedContent: user.preferences.disliked,
  favoritePeople: user.preferences.people,
  recentlyRecommended: user.recommendations,
  genres: user.favoriteGenres
}

Handling AI response:

const response = await model.generateContent(prompt)
const { text } = response.response
const recommendations = JSON.parse(text)
// Validate and filter recommendations