Skip to main content
ClaudeWave
Skill209 estrellas del repoactualizado 7d ago

algo-rec-content

Implement content-based recommendation by matching item features to user preference profiles. Use this skill when the user needs to recommend items based on attributes, solve the cold start problem for new items, or build recommendations without collaborative data — even if they say 'recommend similar products', 'items like this', or 'feature-based matching'.

Instalar en Claude Code
Copiar
git clone --depth 1 https://github.com/asgard-ai-platform/skills /tmp/algo-rec-content && cp -r /tmp/algo-rec-content/algo-rec-content ~/.claude/skills/algo-rec-content
Después abre una sesión nueva de Claude Code; el skill carga automáticamente.

SKILL.md

# Content-Based Recommendation

## Overview

Content-based filtering recommends items whose features match the user's preference profile, built from their interaction history. Computes in O(I × F) per user where I=items, F=features. Solves new-item cold start since items only need features, not interaction history.

## When to Use

**Trigger conditions:**
- Recommending based on item attributes (genre, category, keywords, price range)
- New item cold start: items have features but no interaction data yet
- When user privacy requires no cross-user data sharing

**When NOT to use:**
- When serendipity matters (content-based creates filter bubbles)
- When item features are unavailable or uninformative (use CF instead)

## Algorithm

```
IRON LAW: Content-Based Can Only Recommend SIMILAR Items
It cannot discover unexpected interests (filter bubble problem).
Users who only interact with action movies will only get action
movie recommendations — even if they'd love a documentary.
```

### Phase 1: Input Validation
Extract item feature vectors (TF-IDF for text, one-hot for categories, numerical for attributes). Build user profile from weighted item features of interacted items.
**Gate:** Item features extracted, user profile vector built.

### Phase 2: Core Algorithm
1. Represent each item as a feature vector
2. Build user profile: weighted centroid of interacted item vectors (weight by recency, rating, or engagement)
3. Compute similarity between user profile and all candidate items (cosine similarity)
4. Rank by similarity score, exclude already-interacted items

### Phase 3: Verification
Evaluate: does the recommendation list reflect the user's demonstrated preferences? Check diversity metrics.
**Gate:** Recommendations are topically aligned with user history.

### Phase 4: Output
Return ranked recommendations with feature-level explanations.

## Output Format

```json
{
  "recommendations": [{"item_id": "456", "score": 0.87, "matching_features": ["genre:thriller", "director:Nolan"]}],
  "metadata": {"method": "content-based", "features_used": 15, "profile_items": 30}
}
```

## Examples

### Sample I/O
**Input:** User watched 5 sci-fi movies, 2 documentaries. Candidate: new sci-fi movie.
**Expected:** High score (~0.8+) due to genre match with dominant preference.

### Edge Cases
| Input | Expected | Why |
|-------|----------|-----|
| New user, no history | Cannot build profile | New-user cold start — use popularity |
| All items same features | Equal scores | No differentiation possible |
| User with diverse history | Moderate scores for all | Profile averages dilute signal |

## Gotchas

- **Feature quality is everything**: Garbage features → garbage recommendations. Invest in feature engineering.
- **Filter bubble**: Users get increasingly narrow recommendations. Inject diversity by mixing in exploration items.
- **Profile drift**: User preferences change over time. Apply temporal decay to older interactions.
- **Feature sparsity**: Items with few features produce unreliable similarity. Set a minimum feature count threshold.
- **Over-specialization**: A user who rated one jazz album highly shouldn't get ALL jazz. Weight by interaction count, not just rating.

## References

- For hybrid approaches combining content and CF, see `references/hybrid-strategies.md`
- For text-based feature extraction techniques, see `references/feature-extraction.md`
algo-ad-biddingSkill

Implement and select ad bidding strategies from manual CPC to automated target-CPA and target-ROAS. Use this skill when the user needs to choose a bidding strategy, set up automated bidding, or optimize bid parameters — even if they say 'what bidding strategy should I use', 'target CPA setup', or 'smart bidding configuration'.

algo-ad-budgetSkill

Optimize advertising budget allocation across campaigns using marginal returns analysis. Use this skill when the user needs to distribute budget across multiple campaigns, optimize spend pacing, or maximize overall ROAS under budget constraints — even if they say 'how to split my ad budget', 'campaign budget optimization', or 'diminishing returns on ad spend'.

algo-ad-ctrSkill

Build CTR prediction models for estimating ad click-through rates from features. Use this skill when the user needs to predict click probability, build an ad ranking model, or evaluate ad creative performance — even if they say 'predict click rate', 'ad relevance scoring', or 'which ad will get more clicks'.

algo-ad-gspSkill

Implement Generalized Second Price auction for ad slot allocation and pricing. Use this skill when the user needs to understand search ad auctions, compute ad positions and costs-per-click, or analyze bidding dynamics — even if they say 'how does Google Ads auction work', 'ad rank calculation', or 'second price auction for ads'.

algo-ad-vcgSkill

Implement VCG mechanism for incentive-compatible ad slot allocation with truthful bidding. Use this skill when the user needs to design a truthful auction mechanism, compute externality-based payments, or understand why platforms may prefer GSP over VCG — even if they say 'truthful auction design', 'VCG payments', or 'incentive-compatible mechanism'.

algo-blockchain-basicsSkill

Explain blockchain fundamentals including distributed ledger architecture, consensus mechanisms, and block structure. Use this skill when the user needs to understand blockchain concepts, evaluate whether blockchain fits a use case, or design a blockchain-based solution — even if they say 'how does blockchain work', 'do I need blockchain', or 'distributed ledger'.

algo-blockchain-smart-contractSkill

Design and implement smart contracts as self-executing programmatic agreements on blockchain. Use this skill when the user needs to build automated on-chain logic, evaluate smart contract security, or design tokenized business rules — even if they say 'smart contract development', 'automated agreement', or 'on-chain logic'.

algo-ecom-bm25Skill

Implement BM25 ranking function for e-commerce product search relevance scoring. Use this skill when the user needs to build a text-based product search engine, improve search result relevance, or replace basic TF-IDF with a more robust ranking function — even if they say 'product search ranking', 'search relevance', or 'BM25 implementation'.