Agent skill

Recommendation Engine

by secondsky in secondsky/claude-skills

Build recommendation systems with collaborative filtering, matrix factorization, hybrid approaches.

MITAuto-check passed

Install Recommendation Engine

skills CLI
$ npx skills add secondsky/claude-skills --skill recommendation-engine -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install secondsky/claude-skills recommendation-engine --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/secondsky/claude-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/recommendation-engine/skills/recommendation-engine .claude/skills/recommendation-engine && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
recommendation-engine
GitHub stars
227
Used in
1 other repo
Token cost
~2.8k tokens
SKILL.md length
369 words
Files
5 (incl. references)
Skills in repo
169
Repo updated
First seen
Licence
MIT

At a glance

Build recommendation systems with collaborative filtering, matrix factorization, hybrid approaches.

  • Works in 7 steps: Popularity Bias → Data Sparsity (Matrix >99% Empty) → Cold Start Without Fallback → …
  • Product recommendations
  • SKILL.md covers Recommendation Approaches, Collaborative Filtering, Matrix Factorization (SVD) and Hybrid Recommender, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Recommendation Engine is an agent skill from secondsky/claude-skills. Build recommendation systems with collaborative filtering, matrix factorization, hybrid approaches. Use for product recommendations, personalization, or encountering cold start, sparsity, quality evaluation issues.

Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files (for example `references/cold-start-strategies.md`, `references/collaborative-filtering-deep-dive.md` and `references/evaluation-metrics-implementation.md`).

The repository describes itself as: Production-ready skills for Claude Code CLI - Cloudflare, React, Tailwind v4, and AI integrations. The licence is MIT.

When your agent uses it

  • Product recommendations
  • Personalization
  • Encountering cold start
  • Quality evaluation issues

Example prompts

  • “/recommendation-engine”

Requirements

  • Python 3

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Popularity Bias
  2. Data Sparsity (Matrix >99% Empty)
  3. Cold Start Without Fallback
  4. Not Excluding Already-Interacted Items
  5. Ignoring Implicit Feedback Confidence
  6. Not Evaluating Ranking Quality (Using Only Accuracy)
  7. Filter Bubble (Lack of Exploration)

What it can do on your machine

Read from SKILL.md and the folder at commit 8837836. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Recommendation Engine loads about 2.8k tokens when it runs, and up to ~20k if it reads all its reference files. Until then it costs about 59 tokens; SKILL.md has 369 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~59
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~20k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from secondsky/claude-skills at commit 8837836, republished under its MIT licence (© secondsky). 369 words, ~2,845 tokens.

Download SKILL.mdSave it as .claude/skills/recommendation-engine/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
recommendation-engine
description
Build recommendation systems with collaborative filtering, matrix factorization, hybrid approaches. Use for product recommendations, personalization, or encountering cold start, sparsity, quality evaluation issues.
license
MIT
metadata.keywords
recommendation engine, collaborative filtering, matrix factorization, SVD, ALS, NMF, user-based CF, item-based CF, cold start, precision@k, recall@k, NDCG…

Recommendation Engine

Build recommendation systems for personalized content and product suggestions.

Recommendation Approaches

ApproachHow It WorksProsCons
CollaborativeUser-item interactionsDiscovers hidden patternsCold start
Content-basedItem featuresWorks for new itemsLimited discovery
HybridCombines bothBest of bothComplex

Collaborative Filtering

python
import numpy as np
from scipy.sparse import csr_matrix
from sklearn.metrics.pairwise import cosine_similarity

class CollaborativeFilter:
    def __init__(self):
        self.user_similarity = None
        self.item_similarity = None

    def fit(self, user_item_matrix):
        # User-based similarity
        self.user_similarity = cosine_similarity(user_item_matrix)
        # Item-based similarity
        self.item_similarity = cosine_similarity(user_item_matrix.T)

    def recommend_for_user(self, user_id, n=10):
        scores = self.user_similarity[user_id].dot(self.user_item_matrix)
        # Exclude already interacted items
        already_interacted = self.user_item_matrix[user_id].nonzero()[0]
        scores[already_interacted] = -np.inf
        return np.argsort(scores)[-n:][::-1]

Matrix Factorization (SVD)

python
from sklearn.decomposition import TruncatedSVD

class MatrixFactorization:
    def __init__(self, n_factors=50):
        self.svd = TruncatedSVD(n_components=n_factors)

    def fit(self, user_item_matrix):
        self.user_factors = self.svd.fit_transform(user_item_matrix)
        self.item_factors = self.svd.components_.T

    def predict(self, user_id, item_id):
        return np.dot(self.user_factors[user_id], self.item_factors[item_id])

Hybrid Recommender

python
class HybridRecommender:
    def __init__(self, collab_weight=0.7, content_weight=0.3):
        self.collab = CollaborativeFilter()
        self.content = ContentBasedFilter()
        self.weights = (collab_weight, content_weight)

    def recommend(self, user_id, n=10):
        collab_scores = self.collab.score(user_id)
        content_scores = self.content.score(user_id)
        combined = self.weights[0] * collab_scores + self.weights[1] * content_scores
        return np.argsort(combined)[-n:][::-1]

Evaluation Metrics

  • Precision@K, Recall@K
  • NDCG (ranking quality)
  • Coverage (catalog diversity)
  • A/B test conversion rate

Cold Start Solutions

  • New users: Popular items, onboarding preferences, demographic-based
  • New items: Content-based bootstrapping, active learning
  • Exploration strategies: ε-greedy, Thompson sampling bandits

Quick Start: Build a Recommender in 5 Steps

python
from scipy.sparse import csr_matrix
import numpy as np

# 1. Prepare user-item interaction matrix
# rows = users, cols = items, values = ratings/interactions
ratings_data = [(0, 5, 5), (0, 10, 4), (1, 5, 3), ...]  # (user, item, rating)
n_users, n_items = 1000, 5000

row_idx = [r[0] for r in ratings_data]
col_idx = [r[1] for r in ratings_data]
ratings = [r[2] for r in ratings_data]
user_item_matrix = csr_matrix((ratings, (row_idx, col_idx)), shape=(n_users, n_items))

# 2. Choose and train model
from recommendation_engine import ItemBasedCollaborativeFilter  # See references

model = ItemBasedCollaborativeFilter(similarity_metric='cosine', k_neighbors=20)
model.fit(user_item_matrix)

# 3. Generate recommendations
recommendations = model.recommend(user_id=42, n=10)
print(recommendations)  # [(item_id, score), ...]

# 4. Evaluate on test set
from evaluation_metrics import precision_at_k, recall_at_k

test_items = {42: {10, 25, 30}}  # True relevant items for user 42
rec_items = [item for item, score in recommendations]

precision = precision_at_k(rec_items, test_items[42], k=10)
recall = recall_at_k(rec_items, test_items[42], k=10)
print(f"Precision@10: {precision:.3f}, Recall@10: {recall:.3f}")

# 5. Handle cold start
from cold_start import PopularityRecommender

popularity_model = PopularityRecommender()
popularity_model.fit(interactions_with_timestamps)
new_user_recs = popularity_model.recommend(n=10)

Known Issues Prevention

1. Popularity Bias

Problem: Recommending only popular items, ignoring long tail. Reduces diversity and serendipity.

Solution: Balance popularity with personalization, apply re-ranking for diversity:

python
def diversify_recommendations(
    recommendations: List[Tuple[int, float]],
    item_features: np.ndarray,
    diversity_weight: float = 0.3
) -> List[Tuple[int, float]]:
    """Re-rank to increase diversity while maintaining relevance."""
    from sklearn.metrics.pairwise import cosine_distances

    selected = []
    candidates = recommendations.copy()

    while len(selected) < len(recommendations) and candidates:
        if not selected:
            # First item: highest score
            selected.append(candidates.pop(0))
            continue

        # Compute diversity scores
        selected_features = item_features[[item for item, _ in selected]]
        diversity_scores = []

        for item, relevance in candidates:
            item_feature = item_features[item].reshape(1, -1)
            # Average distance to already selected items
            avg_distance = cosine_distances(item_feature, selected_features).mean()
            # Combined score: relevance + diversity
            combined = (1 - diversity_weight) * relevance + diversity_weight * avg_distance
            diversity_scores.append((item, relevance, combined))

        # Select item with best combined score
        best = max(diversity_scores, key=lambda x: x[2])
        selected.append((best[0], best[1]))
        candidates = [(i, s) for i, s, _ in diversity_scores if i != best[0]]

    return selected
2. Data Sparsity (Matrix >99% Empty)

Problem: Collaborative filtering fails when most users have rated <1% of items.

Solution: Use matrix factorization (SVD, ALS) instead of memory-based CF:

python
# ❌ Bad: User-based CF on sparse data (fails to find similar users)
user_cf = UserBasedCollaborativeFilter()
user_cf.fit(sparse_matrix)  # Most users have <10 ratings

# ✅ Good: Matrix factorization handles sparsity
from sklearn.decomposition import TruncatedSVD

svd = TruncatedSVD(n_components=50)
user_factors = svd.fit_transform(sparse_matrix)
item_factors = svd.components_.T

# Predict rating: user_factors[u] @ item_factors[i]
3. Cold Start Without Fallback

Problem: Recommender crashes or returns empty results for new users/items.

Solution: Always implement fallback chain:

python
def recommend_with_fallback(user_id, n=10):
    """Graceful degradation through fallback chain."""
    try:
        # Try personalized recommendations
        if has_sufficient_history(user_id, min_interactions=5):
            return collaborative_filter.recommend(user_id, n)
    except Exception as e:
        logger.warning(f"CF failed for user {user_id}: {e}")

    # Fallback 1: Demographic-based
    if user_demographics_available(user_id):
        return demographic_recommender.recommend(user_id, n)

    # Fallback 2: Popularity
    return popularity_recommender.recommend(n)
4. Not Excluding Already-Interacted Items

Problem: Recommending items user already purchased/viewed wastes recommendation slots.

Solution: Always filter interacted items:

python
# ✅ Correct: Exclude interacted items
user_items = user_item_matrix[user_id].nonzero()[1]
scores[user_items] = -np.inf  # Ensure they don't appear in top-K
recommendations = np.argsort(scores)[-n:][::-1]

# ❌ Wrong: Forgetting to filter
recommendations = np.argsort(scores)[-n:][::-1]  # May include already purchased!
5. Ignoring Implicit Feedback Confidence

Problem: Treating all clicks/views equally. 1 view ≠ 100 views.

Solution: Weight by interaction strength (view count, watch time, etc.):

python
# For implicit feedback, use confidence weighting
confidence_matrix = 1 + alpha * np.log(1 + interaction_counts)

# In ALS: C_ui * (P_ui - X_ui)²
# Higher confidence for items with more interactions
Show full SKILL.md (157 more words)Show less
6. Not Evaluating Ranking Quality (Using Only Accuracy)

Problem: High prediction accuracy (RMSE) doesn't mean good top-K recommendations.

Solution: Use ranking metrics (NDCG, MAP@K):

python
# ❌ Bad: Only RMSE
from sklearn.metrics import mean_squared_error
rmse = np.sqrt(mean_squared_error(y_true, y_pred))

# ✅ Good: Ranking metrics for top-K evaluation
from evaluation_metrics import ndcg_at_k, mean_average_precision_at_k

# NDCG rewards putting highly relevant items first
ndcg = ndcg_at_k(recommendations, relevance_scores, k=10)

# MAP@K considers precision at each relevant item position
map_score = mean_average_precision_at_k(all_recommendations, ground_truth, k=10)
7. Filter Bubble (Lack of Exploration)

Problem: Always recommending similar items limits discovery, reduces user engagement over time.

Solution: Implement explore-exploit strategy:

python
class ExploreExploitRecommender:
    def __init__(self, base_model, epsilon=0.1):
        self.base_model = base_model
        self.epsilon = epsilon  # 10% exploration

    def recommend(self, user_id, n=10):
        # Exploit: Use trained model for most recommendations
        n_exploit = int(n * (1 - self.epsilon))
        exploitative_recs = self.base_model.recommend(user_id, n=n_exploit)

        # Explore: Add random diverse items
        n_explore = n - n_exploit
        explored_items = sample_diverse_items(n_explore)

        return exploitative_recs + explored_items

When to Load References

Load reference files when you need detailed implementations:

  • Collaborative Filtering: Load references/collaborative-filtering-deep-dive.md for complete user-based and item-based CF implementations with similarity metrics (cosine, Pearson, Jaccard), scalability optimizations (sparse matrices, approximate nearest neighbors), and handling edge cases (cold start, sparsity)

  • Matrix Factorization: Load references/matrix-factorization-methods.md for SVD, ALS, and NMF implementations with hyperparameter tuning, implicit feedback handling, and advanced techniques (BPR, WARP)

  • Evaluation Metrics: Load references/evaluation-metrics-implementation.md for Precision@K, Recall@K, NDCG, coverage, diversity metrics, cross-validation strategies, and statistical significance testing (paired t-test, bootstrap confidence intervals)

  • Cold Start Solutions: Load references/cold-start-strategies.md for new user/item strategies (popularity-based, onboarding, demographic, content-based bootstrapping, active learning), explore-exploit approaches (ε-greedy, Thompson sampling), and hybrid fallback chains

© secondsky, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (references) in plugins/recommendation-engine/skills/recommendation-engine of secondsky/claude-skills.

  • SKILL.md
  • references/cold-start-strategies.md
  • references/collaborative-filtering-deep-dive.md
  • references/evaluation-metrics-implementation.md
  • references/matrix-factorization-methods.md

Open the folder on GitHubat commit 8837836

Used in 1 other repository

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in secondsky/claude-skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Recommendation Engine next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Recommendation Engine compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Recommendation Engine this skillsecondsky/claude-skills2271 repos~2.8kAutomated safety check: PassMIT
Filterzalando/skipper3.3k—~527Automated safety check: PassMIT
Agent Matrix Optimizerruvnet/ruflo74k3 repos~1.8kAutomated safety check: PassMIT
Matrixbergside/awesome-design-skills3.1k1 repos~957Automated safety check: PassMIT
Tech Matrixsickn33/agentic-awesome-skills47k1 repos~3.1kAutomated safety check: PassMIT
Competency Matrixsickn33/agentic-awesome-skills47k1 repos~3.7kAutomated safety check: PassMIT

Similar skills

  • Filter

    zalando/skipper

    Create or modify code in the filters package and all its sub-folders

    3.3k GitHub stars~527 tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Agent skill for matrix-optimizer - invoke with $agent-matrix-optimizer

    74k GitHub starsUsed in 3 repos~1.8k tokens
    Auto-check passed
  • Matrix

    bergside/awesome-design-skills

    A cyber-slick, dark-only Matrix-inspired interface defined by minimalist fashion, high-tech digital elements

    3.1k GitHub starsUsed in 1 repo~957 tokens
    Frontend & DesignAuto-check passed
  • Tech Matrix

    sickn33/agentic-awesome-skills

    Reference document for monopoly tech-matrix. An agent skill from sickn33/agentic-awesome-skills.

    47k GitHub starsUsed in 1 repo~3.1k tokens
    Backend & APIsAuto-check passed
  • Competency Matrix

    sickn33/agentic-awesome-skills

    Competency matrix of expected proficiency by job title and grade, with assessment method and linked skill area.

    47k GitHub starsUsed in 1 repo~3.7k tokens
    Auto-check passed
  • Access Matrix

    sickn33/agentic-awesome-skills

    Access matrix of role-by-module permissions, with per-role scope, confidentiality level and SME tier, as CSV, SQL, JSON Schema or Notion on request.

    47k GitHub starsUsed in 1 repo~3.6k tokens
    Backend & APIsAuto-check passed

More from secondsky/claude-skills

All 169 skills in this repo
  • Tanstack AI

    secondsky/claude-skills

    TanStack AI (alpha) provider-agnostic type-safe chat with streaming for OpenAI, Anthropic, Gemini, Ollama.

    227 GitHub starsUsed in 1 repo~3.6k tokens
    Auto-check: notes
  • Auto Animate

    secondsky/claude-skills

    AutoAnimate (@formkit/auto-animate) zero-config animations for React.

    227 GitHub stars~2.9k tokensUpdated 9 days ago
    Auto-check passed
  • Base UI React

    secondsky/claude-skills

    MUI Base UI unstyled React components with Floating UI. An agent skill from secondsky/claude-skills.

    227 GitHub stars~1.9k tokensUpdated 9 days ago
    Auto-check passed
  • Cloudflare Images

    secondsky/claude-skills

    This skill should be used when the user asks to "upload images to Cloudflare", "implement direct creator upload", "configure image transformations", "optimize WebP/AVIF", "create image variants"…

    227 GitHub stars~3.6k tokensUpdated 9 days ago
    Auto-check: notes
  • Cloudflare Nextjs

    secondsky/claude-skills

    Deploy Next.js to Cloudflare Workers via the OpenNext adapter (@opennextjs/cloudflare).

    227 GitHub stars~5.3k tokensUpdated 9 days ago
    Auto-check: notes
  • Cloudflare Sandbox

    secondsky/claude-skills

    Cloudflare Sandboxes SDK for secure code execution in Linux containers at edge.

    227 GitHub stars~4.5k tokensUpdated 9 days ago
    Auto-check passed

Questions about Recommendation Engine

What does Recommendation Engine do?

Build recommendation systems with collaborative filtering, matrix factorization, hybrid approaches. Recommendation Engine is an agent skill from secondsky/claude-skills. Build recommendation systems with collaborative filtering, matrix factorization, hybrid approaches.

When should I use Recommendation Engine?

Recommendation Engine fits situations like: product recommendations; personalization; encountering cold start; quality evaluation issues.

How do I install Recommendation Engine in Claude Code?

Run `npx skills add secondsky/claude-skills --skill recommendation-engine -a claude-code`. Or copy the skill folder (plugins/recommendation-engine/skills/recommendation-engine in secondsky/claude-skills) into .claude/skills/recommendation-engine in your project. Claude Code loads it when a task matches its description.

How do I install Recommendation Engine in Codex?

Run `npx skills add secondsky/claude-skills --skill recommendation-engine -a codex`. Or copy the skill folder (plugins/recommendation-engine/skills/recommendation-engine in secondsky/claude-skills) into .agents/skills/recommendation-engine in your project. Codex loads it when a task matches its description.

Can I use Recommendation Engine in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add secondsky/claude-skills --skill recommendation-engine -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/recommendation-engine, .gemini/skills/recommendation-engine, .github/skills/recommendation-engine and .opencode/skills/recommendation-engine in your project.

What does Recommendation Engine need to run?

SKILL.md names no scripts, command-line tools or credentials: Recommendation Engine is instructions for the agent only. Our summary lists: Python 3.

Does Recommendation Engine access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Recommendation Engine safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Recommendation Engine use?

Recommendation Engine is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Recommendation Engine use?

About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 18k tokens, read only when the agent opens those files.

What are the alternatives to Recommendation Engine?

Skills that share tags, products or a category with Recommendation Engine: Filter (zalando/skipper, 3.3k stars), Agent Matrix Optimizer (ruvnet/ruflo, 74k stars), Matrix (bergside/awesome-design-skills, 3.1k stars) and Tech Matrix (sickn33/agentic-awesome-skills, 47k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Recommendation Engine?

secondsky (a GitHub user) maintains it in secondsky/claude-skills, which has 227 GitHub stars. The repository holds 169 skills in this directory. The repository was last updated on September 28, 2026.

Source: secondsky/claude-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.