recsys-pipeline-architect
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.
Security Assessment
About recsys-pipeline-architect
recsys-pipeline-architect is a spec-and-scaffold skill for designing composable recommendation, ranking, and feed pipelines. It encodes the six-stage Source→Hydrator→Filter→Scorer→Selector→SideEffect pattern popularized by xAI's open-sourced For You algorithm (Apache 2.0) and applies it to any problem that picks the top K items for a (user, context) pair. Its premise is that most production recommendation systems are not exotic ML but pipelines whose shape stays fixed while the scoring function and items change, so it helps engineers build that plumbing correctly. This skill is an independent reimplementation of the pattern (MIT) with no code copied from the original.
The six stages each have a defined job and parallelism: Source fetches candidates from one or more origins (parallel), Hydrator enriches candidates with metadata needed for filtering and scoring (parallel), Filter drops ineligible candidates (sequential), Scorer assigns one or more scores (sequential so later scorers see earlier scores), Selector sorts by final score and returns top K (single op), and SideEffect caches, logs, and emits events asynchronously so it never blocks the response. The ordering is deliberate: sources before hydration, hydration before filtering, filtering before the expensive scoring stage, a scorer chain rather than a single scorer, selector after scoring for deterministic caching, and async side effects last. When invoked, the skill walks the user through eight steps from clarifying the use case to generating a runnable scaffold in the user's stack, and it surfaces key trade-offs including single score vs multi-action prediction, candidate isolation vs joint scoring, and online vs offline batch.
The skill targets engineers building content feeds, search ranking, RAG rerankers, task prioritizers, notification triage, and ad selection. It enforces hard rules: do not invent benchmark numbers, attribute the pattern to xAI's open-sourced For You algorithm without using its trademarks or "For You" branding, always surface product trade-offs rather than defaulting silently, keep filter order cheap-before-expensive and universal-before-user-specific, ensure side effects never block, and make the generated scaffold actually run rather than pass off pseudocode. Common use cases include a Strapi v5 TypeScript feed plugin, a Python async RAG reranker, a FastAPI task prioritizer, and an offline-batch notification digest. The upstream repository ships five load-on-demand reference docs and three runnable example scaffolds (Strapi v5 / Go / Python).
FAQ
What are the six stages of the pipeline?
Source (fetch candidates), Hydrator (enrich with metadata), Filter (drop ineligible candidates), Scorer (assign one or more scores), Selector (sort by final score, return top K), and SideEffect (cache, log, emit events asynchronously so they never block the response).
When should I use this skill?
When building any system that returns the top K items for a user/context: content feeds, search or notification ranking, wrapping an LLM/ML scorer in pipeline plumbing, adding multi-action prediction with tunable weights, building a RAG retrieval reranker, or designing a task prioritizer or alert triage system.
What is the difference between single-score and multi-action prediction?
A single score trains one model to predict relevance, so changing behavior requires retraining. Multi-action predicts P(action) for many actions (read, like, share, skip, report) and combines them with weights at serving time, so behavior changes by adjusting weights without retraining. The skill recommends multi-action when the user expects to tune frequently.
What attribution and naming rules does it enforce?
Attribute the pattern as popularized by xAI's open-sourced For You algorithm (github.com/xai-org/x-algorithm, Apache 2.0), do not use trademarks or "For You" branding, and name artifacts neutrally such as "candidate pipeline", "feed pipeline", or "ranking pipeline". The skill itself is an independent MIT reimplementation with no copied code.
Does the skill produce runnable code or pseudocode?
Runnable code. A hard rule states the generated scaffold must actually run, with no pseudocode passing as code, and the upstream repository ships three example scaffolds (Strapi v5 / Go / Python) that are green on their test suites.
Install recsys-pipeline-architect
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
wshobson/agents