Design composable recommendation, ranking, and feed pipelines using the six-stage Source→Hydrator→Filter→Scorer→Selector→SideEffect framework popularized by xAI's open-sourced X For You algorithm. Use when building any system that picks "the top K items for a (user, context)" — content feeds, search ranking, RAG rerankers, task prioritizers, notification triage, ad selection.
A spec-and-scaffold skill for building composable recommendation, ranking, and feed pipelines. Encodes the six-stage pattern popularized by xAI's open-sourced For You algorithm (Apache 2.0) and applies it to any "top K for (user, context)" problem.
Most "recommendation systems" in production aren't exotic ML — they're pipelines: fetch candidates from one or more sources, enrich them with metadata, drop the ineligible, score the rest, sort and pick the top K, then fire async side effects. The pattern is universal. The scoring function and the items change; the pipeline shape doesn't.
This skill is an independent reimplementation of the pattern (MIT) — no code copied from the original.
| # | Stage | Job | Parallel? | |---|---|---|---| | 1 | Source | Fetch candidates from one or more origins | Yes — multiple sources run in parallel | | 2 | Hydrator | Enrich candidates with metadata needed for filtering and scoring | Yes — independent hydrators run in parallel | | 3 | Filter | Drop ineligible candidates (blocked, expired, duplicate, ineligible) | Sequential — each filter sees fewer items | | 4 | Scorer | Assign each surviving candidate one or more scores | Sequential — later scorers see earlier scores | | 5 | Selector | Sort by final score, return top K | Single op | | 6 | SideEffect | Cache, log, emit events, update served-history | Async — must never block the response |
Walk the user through eight steps:
Never default silently on these — they are product decisions disguised as technical ones.
P(action) for many actions (P(read), P(like), P(share), P(skip), P(report)), combine with weights at serving time. To change behavior → change weights. No retraining.The X For You algorithm uses multi-action with both positive and negative weights. Recommend multi-action when the user expects to tune frequently.
Default to isolation. Joint only when there's a specific reason (e.g., explicit batch-aware diversity).
github.com/xai-org/x-algorithm (Apache 2.0).User has a CMS with 50k articles, wants a personalized "for you" feed. Walk through 8 steps → generate a Strapi plugin scaffold with multi-action scoring, author diversity, standard filters, async side-effect lane.
User's RAG returns top-50 chunks from a vector DB, wants to rerank with a more expensive scorer and return top-5. Single-source pipeline with a scorer chain (cheap retrieval + expensive rerank).
User has a queue of incoming task suggestions, wants to rank by "what should this user work on next" considering their past patterns. Items reversed (tasks instead of content), same shape applies.
User wants a daily digest that picks the top 10 from the last 24h queue. Offline-batch pipeline. Source = queue, filters = age/dedup/eligibility, scorer = urgency × user-affinity, selector = top 10, side effect = email send (still async).
This skill is a single-file adapter for the upstream repository, which ships 5 load-on-demand reference docs and 3 runnable example scaffolds (Strapi v5 / Go / Python — every one green on its test suite, 9/9 tests total).
npx skills add mturac/recsys-pipeline-architectCopy a source-pinned command for your client. You run it yourself.
Destination: .claude/skills/recsys-pipeline-architect · pinned to the source commit
# Run from your project root
git clone https://github.com/wshobson/agents.git .skillboard-tmp
git -C .skillboard-tmp checkout 38e19c20d2b154510b0e624a2e3e186b19b5c527
mkdir -p ".claude/skills"
cp -r ".skillboard-tmp/plugins/machine-learning-ops/skills/recsys-pipeline-architect" ".claude/skills/"
rm -rf .skillboard-tmpReview the source before running. This copies files into your project; it is not a one-click install and does not verify runtime safety.
sudo apt update && sudo apt install -y gitnpm install -g @anthropic-ai/claude-code# Run from your project root
git clone https://github.com/wshobson/agents.git .skillboard-tmp
git -C .skillboard-tmp checkout 38e19c20d2b154510b0e624a2e3e186b19b5c527
mkdir -p ".claude/skills"
cp -r ".skillboard-tmp/plugins/machine-learning-ops/skills/recsys-pipeline-architect" ".claude/skills/"
rm -rf .skillboard-tmpDestination: .claude/skills/recsys-pipeline-architect
Scanner static-checks@0.1.0 · commit 38e19c20d2b1. Static checks cannot prove runtime safety – review the source and the exact diff before installing. How checks work.
No static rules matched. This is not a safety guarantee.