Refactor high-complexity React components in Dify frontend. Use when `pnpm analyze-component...
npx skills add felixondesk/agent-skills --skill "x-algo-mastery"
Install specific skill from multi-skill repository
# Description
Expert guidance on X's (Twitter's) open-sourced recommendation algorithm from the official xai-org/x-algorithm repository. Use this skill to create content that maximizes algorithmic amplification, analyze post performance, and develop viral content strategies. Every recommendation traces directly to specific algorithm behavior from the open-sourced codebase.
# SKILL.md
name: x-algo-mastery
description: Expert guidance on X's (Twitter's) open-sourced recommendation algorithm from the official xai-org/x-algorithm repository. Use this skill to create content that maximizes algorithmic amplification, analyze post performance, and develop viral content strategies. Every recommendation traces directly to specific algorithm behavior from the open-sourced codebase.
license: MIT
metadata:
author: felixondesk
version: "1.0.0"
β¨ Features
- π― Multi-Action Prediction - 15 algorithm signals with actual impact weights
- π Network Bridge Framework - Convert out-of-network viewers to followers
- 𧬠Author Identity Building - Strengthen your topical embedding via two-tower retrieval
- π Compound Patterns - Signal cascades > single-signal optimization
- β οΈ Anti-Pattern Detection - Proactive root cause analysis, not reactive fixes
- π Official Documentation - Based directly on https://github.com/xai-org/x-algorithm
π Why This Is Different
| Feature | Generic Advice | This Skill |
|---|---|---|
| Source | Opinions & guesses | Official xai-org codebase |
| Signals | Vague "engagement" | 15 documented predictions |
| Retrieval | Not mentioned | Two-tower model explained |
| Network Strategy | Missing | OON β in-network framework |
| Author Embedding | Not addressed | Candidate tower strategy |
| Pipeline | Unknown | 7 documented stages |
π₯ Installation
Automatic Installation
npx skills add https://github.com/felixondesk/agent-skills --skill x-algo-mastery
Manual Installation
# Create the skill directory
mkdir -p ~/.claude/skills/x-algo-mastery
# Copy the skill files
# SKILL.md, .openskills.json, README.md, LICENSE.txt
Verify Installation
ls ~/.claude/skills/x-algo-mastery/
# Should show: SKILL.md, .openskills.json, README.md, LICENSE.txt
π― Usage
Basic Draft Review
Review this X post:
I built a SaaS that failed in 3 months. Here's what I learned:
1. I focused on features, not problems
2. I talked to users, but didn't listen
3. I optimized for metrics that didn't matter
The biggest lesson? Speed of learning > everything else.
Viral Potential Analysis
Will this go viral?
The #1 product at Amazon isn't what you think.
Not AWS. Not Prime. Not Alexa.
It's the internal document culture.
Every major decision starts with a 6-page narrative memo.
That's why they move fastβeveryone actually understands the decision.
Content Optimization
Optimize this for maximum reach:
"Check out my new thread about productivity tips!"
Strategy Session
I'm building an audience in AI/ML. What's my content strategy?
π§ How It Works
The Official Algorithm Architecture
Based on the open-sourced code at https://github.com/xai-org/x-algorithm
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FOR YOU FEED REQUEST β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β HOME MIXER β
β (Orchestration Layer) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β 1. QUERY HYDRATION β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β User Action Sequence (engagement history) + User Features β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β βΌ β
β 2. CANDIDATE SOURCES β
β ββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββββββββ β
β β THUNDER β β PHOENIX RETRIEVAL β β
β β (In-Network Posts) β β (Out-of-Network Posts) β β
β β β β β β
β β Posts from accounts β β Two-tower similarity search β β
β β you follow β β across global corpus β β
β β Sub-millisecond lookup β β User Tower + Candidate Tower β β
β ββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββββββββ β
β β β
β βΌ β
β 3. CANDIDATE HYDRATION β
β Fetch: post text, author info, media metadata, video duration β
β β β
β βΌ β
β 4. PRE-SCORING FILTERS β
β Remove: duplicates, too old, self-posts, blocked/muted authors β
β β β
β βΌ β
β 5. SCORING β
β ββββββββββββββββββ ββββββββββββββββββ ββββββββββββββββ β
β β Phoenix Scorer β β β Weighted Scorerβ β β Author β β
β β (Grok-based β β (Combine β β Diversity β β
β β Transformer) β β predictions) β β Scorer β β
β β β β β β β β
β β P(15 actions) β β Ξ£(weightΓP) β β Decay penaltyβ β
β ββββββββββββββββββ ββββββββββββββββββ ββββββββββββββββ β
β β β
β βΌ β
β 6. SELECTION β
β Sort by final score, select top K candidates β
β β β
β βΌ β
β 7. POST-SELECTION PROCESSING β
β Final validation: deleted/spam/violence/gore filters β
β β β
β βΌ β
β 2. RANKED FEED β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The 15 Engagement Signals
From the official Phoenix Grok-based transformer model:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β POSITIVE SIGNALS (Increase Score) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β P(favorite) βββββββββββββββββββ User likes the post β
β P(reply) βββββββββββββββββββ User replies to the post β
β P(repost) βββββββββββββββββββ User reposts without comment β
β P(quote) βββββββββββββββββββ User reposts with comment β
β P(click) βββββββββββββββββββ User clicks on the post β
β P(profile_click) βββββββββββββββββββ User clicks author's profile β
β P(video_view) βββββββββββββββββββ User views video content β
β P(photo_expand) βββββββββββββββββββ User expands photo to view β
β P(share) βββββββββββββββββββ User shares the post β
β P(dwell) βββββββββββββββββββ User dwells (pauses) on post β
β P(follow_author) βββββββββββββββββββ User follows the post's author β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β NEGATIVE SIGNALS (Decrease Score) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β P(not_interested) ββββββββββββββββββββ User marks as not interested β
β P(block_author) ββββββββββββββββββββ User blocks the author β
β P(mute_author) ββββββββββββββββββββ User mutes the author β
β P(report) ββββββββββββββββββββ User reports the post β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Scoring Formula
Final Score = Ξ£ (weight_i Γ P(action_i))
Positive actions β Positive weights β Higher score β More reach
Negative actions β Negative weights β Lower score β Less reach
Two-Tower Retrieval (How Out-of-Network Works)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β TWO-TOWER MODEL FOR OUT-OF-NETWORK β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β USER TOWER CANDIDATE TOWER β
β βββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββ β
β β β β β β
β β β’ User Features β β β’ All Posts in Corpus β β
β β β’ Engagement β β β’ Pre-computed Embeddings β β
β β History (128) β β β’ Processed through MLP β β
β β β’ Actions Taken β β β β
β β β β β β
β β βΌ β β βΌ β β
β β [User Embedding] β β [Candidate Embeddings] β β
β β β β β β β β
β βββββββββββΌββββββββββββ ββββββββββββββΌββββββββββββββββββββ β
β β β β
β ββββββββββββββββ¬ββββββββββββββββββββββββ β
β β β
β βΌ β
β DOT PRODUCT SIMILARITY β
β (Finds most similar posts) β
β β β
β βΌ β
β TOP-K RETRIEVAL β
β (Returns thousands of candidates) β
β β
β STRATEGY: Consistent topical posting β Stronger author embedding β
β β Easier for relevant users to find you β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Author Diversity Penalty
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AUTHOR DIVERSITY: POST ATTENUATION β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β Position 1: ββββββββββββββββββββ 100% (full score) β
β Position 2: βββββββββββββββββββββ ~60% (Γ decay_factor) β
β Position 3: ββββββββββββββββββββββ ~36% (Γ decay_factorΒ²) β
β Position 4: ββββββββββββββββββββββ ~22% (Γ decay_factorΒ³) β
β β
β STRATEGY: Every post should be substantial. Avoid frequent low-value posts. β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
In-Network vs Out-of-Network
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β NETWORK STRATEGY: THE COMPOUNDING ADVANTAGE β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β OUT-OF-NETWORK (OON) IN-NETWORK β
β βββββββββββββββββββββββββββ βββββββββββββββββββββββββββ β
β β β’ Two-tower similarity β β β’ Always in candidate β β
β β gate β βββββββββββΆ β pool β β
β β β’ May have score β Convert! β β’ No retrieval penalty β β
β β adjustment β β β’ Maximum reach β β
β βββββββββββββββββββββββββββ βββββββββββββββββββββββββββ β
β β
β Every follower you convert from OON β In-Network is a PERMANENT upgrade β
β β
β STRATEGY: Create content that makes OON viewers WANT to follow you β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π Response Format
The skill provides structured, algorithm-backed feedback:
VERDICT: [WILL GO VIRAL / GOOD START / NEEDS WORK / WILL FLOP]
SIGNAL ANALYSIS:
- Reply: [High/Medium/Low] - [reasoning]
- Repost/Quote: [High/Medium/Low] - [reasoning]
- Dwell: [High/Medium/Low] - [reasoning]
- Follow: [High/Medium/Low] - [reasoning]
- Profile Click: [High/Medium/Low] - [reasoning]
WEAKNESSES:
1. [Specific issue with signal impact]
2. [Specific issue with signal impact]
OPTIMIZED VERSION:
[Your improved version]
WHY THIS WORKS BETTER:
[Algorithm explanation]
π¨ Compound Patterns
The Multi-Signal Thread
Hook (curiosity) β Claim (debate-able) β Evidence (specific) β
Extension (open question) β CTA (follow for more)
Signals: dwell, reply, quote, profile_click, follow_author
Example:
I reviewed 200 failed startups for Y Combinator.
Here's what most people get wrong:
1. They pivoted too late, not too early
2. The cofounder conflicts started before the idea
3. "Running out of money" was the symptom, not the cause
4. The winners had customers before they had product
The real lesson: Speed of learning beats everything else.
What did I miss?
The Network Bridge
Quote high-authority post β Your unique angle β
Specific insight β "Follow me for [niche] insights"
Signals: quote, profile_click, follow_author
The Value Share
Clear promise β Scannable content β
Save-worthy insight β Reference value
Signals: dwell, share, profile_click
β οΈ Anti-Patterns to Avoid
Immediately Reject If:
| Anti-Pattern | Why It Fails | Algorithm Impact |
|---|---|---|
| Explicit CTA ("like/repost if") | Learned inauthenticity | not_interested β |
| Generic AI vocabulary | Structural tell | Reduces all signals |
| Perfect 3-item lists | AI structural pattern | Reduces dwell |
| Every thought as thread | Diversity penalty | Score Γ decay^position |
| Posting >3x/day | Embedding dilution | Weaker retrieval |
| Reposting same content | Deduplication filter | Filtered out entirely |
Red Flag Warnings:
- Punching down β
block_author,mute_authorβ - Rage bait β Short-term
replygain, long-term damage - "Not just X, but Y" β AI structural tell
- Em dash overuse β AI structural pattern
π§ͺ Example Usage
Input
Review this post:
"3 tips for better productivity:
1. Wake up early
2. Make a to-do list
3. Take breaks
What would you add?"
Output
VERDICT: WILL FLOP
SIGNAL ANALYSIS:
- Reply: Low - Generic question, no debate-worthy claim
- Quote: Low - No unique angle worth sharing
- Dwell: Low - Common knowledge, no new insights
- Follow: Low - Doesn't demonstrate unique expertise
- Profile Click: Low - No credibility signals
WEAKNESSES:
1. Generic AI vocabulary ("tips", "better", "productivity")
2. Perfectly structured 3-item list (structural tell)
3. Every point is common knowledge (no unique value)
4. Weak CTA that adds nothing
OPTIMIZED VERSION:
I tracked my time for 30 days to find my productivity killer.
It wasn't social media. It wasn't meetings.
It was "productive procrastination"βdoing easy tasks to avoid hard ones.
The fix that actually worked:
β’ One "frog" (hard task) before anything else
β’ Time-boxed deep work (90min max)
β’ Zero notifications during focus blocks
My deep work hours increased 3x.
What's your weirdest productivity discovery?
WHY THIS WORKS BETTER:
β’ Specific personal story (dwell signal)
β’ Non-obvious insight (reply/quote signals)
β’ Clear numbers (credibility β follow signal)
β’ Open question about "weird" (encourages unique replies)
β’ Contractions and natural voice (avoids AI detection)
π Technical Reference
Key Components
- Home Mixer: Orchestration layer with 7-stage pipeline
- Thunder: In-memory in-network post store (sub-millisecond lookups)
- Phoenix: Two-tower retrieval + Grok-based transformer ranking
- Candidate Pipeline: Composable framework for recommendation systems
Design Principles
- No Hand-Engineered Features - The transformer learns everything from engagement sequences
- Candidate Isolation - Posts don't attend to each other during scoring (consistent, cacheable scores)
- Hash-Based Embeddings - Multiple hash functions for efficient embedding lookup
- Multi-Action Prediction - 15 engagement types, not a single "relevance" score
Official Source
This skill is based entirely on the open-sourced algorithm at:
https://github.com/xai-org/x-algorithm
π€ Contributing
Contributions welcome! Please ensure all changes trace back to the official documentation.
π License
MIT License - see LICENSE.txt for details.
π Acknowledgments
- xAI for open-sourcing the recommendation algorithm
- home-mixer, thunder, and phoenix teams
- Claude Code team for the skills framework
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.