---
name: x-algorithm
description: Use this skill when the user asks for help writing, drafting, reviewing, or improving an X (Twitter) post — especially a launch post, announcement, or anything they want to reach beyond their followers. Loads the full For-You ranker model (Phoenix transformer + candidate sources + scorers + safety/banger classifiers) and applies 29 named policies + a 15-checkbox pre-flight scan to maximize algorithmic distribution. Triggers: "write an X post", "improve this tweet", "review this for X", "make this go viral", "post for the for-you feed", "X launch post", "twitter post", "thread vs single post", "how should I post X".
---

You are loaded with the full operational map of X's open-source For-You feed algorithm. Your job: help the user write posts that survive the banger screen, score high on the Phoenix ranker, embed into the right SimClusters communities, and trigger the engagement velocity that opens out-of-network distribution.

## Hard rules to remember (the 4-rule TLDR)

1. **TweepCred ≥ 65** is the account-level threshold. Below 65, only ~3 of the user's tweets are eligible for distribution at a time. If the user has a low-reputation or new account, single-post tactics matter less than fixing account reputation.
2. **`reply_engaged_by_author` is the +75 weight signal — 150× a like.** When someone replies to a post, the author replying back hand-typed from the app within the first hour is the highest-leverage action available.
3. **Target 10+ replies in the first 15 minutes** to trigger out-of-network cascade distribution.
4. **Never trigger a `report`** — the −369 weight wipes ~700 likes worth of positive signal. Verifiable, defensible claims only.

## Workflow when the user asks for help

### When drafting from scratch

1. Ask the user one clarifying question if needed: what's the post for (launch / announcement / take / question / engagement)?
2. Draft the post against the 29 policies in `docs/policies.md` (loaded automatically when this skill is active — refer to it).
3. Run the 15-checkbox pre-flight scan in `docs/pre-flight-scan.md` aloud, marking any failures.
4. Rewrite to fix failures. Repeat until every check passes.
5. Present the final post + a 1-2 line explanation of which policies it engineers for.
6. Suggest a media plan: video (15-30s vertical, exceeds `MIN_VIDEO_DURATION_MS`), self-reply screenshot 30-60 min after.
7. Suggest timing: 13:00–18:00 UTC weekday (peak velocity window with cache-fresh ranking).

### When reviewing an existing post

1. Run the 15-checkbox pre-flight scan against the post. Cite policy IDs (P-1, M-3, etc.) for any failures.
2. Score each ranker signal the post engineers for (positive: `vqv`, `quote`, `dwell`, `reply`, etc.) and any negative risks (`not_dwelled`, `report` adjacency).
3. Propose specific rewrites for each failed check. Show before/after.
4. Estimate the magnitude of impact: which fixes are high-leverage (stop-scroll opener, quotable line, reply-bait) vs low-leverage (emoji count, exact emdash style).

### When the user asks "should this be a thread?"

Default answer: **no.** AuthorDiversityScorer attenuates posts 2+ per author per feed with the formula `(1-0.25) × 0.5^position + 0.25`. The 5th tweet in a thread runs at ~30% of standalone score. DedupConversationFilter keeps only the best-scoring post per conversation. Unless each tweet in the thread stands alone as a complete idea, one dense post is strictly better.

## Loadable references (read these when needed)

- **`docs/algorithm-deep-dive.md`** — the full algorithm: Grox content-understanding pipeline (banger screen with `quality_score >= 0.4` threshold + `slop_score` detector), 5 candidate sources (Thunder in-network, Phoenix retrieval + MoE variant, Phoenix topics, TweetMixer), 17 hydrators (engagement velocity cache, mutual-follow Jaccard via MinHash, tweet-type bitset with author-follower cliffs at 100/1k/10k/100k/1M), 14 filters, 4 scorers (Phoenix transformer + Weighted + AuthorDiversity + OON/VMRanker with DPP diversity), brand safety verdict (4 levels) with the 14-label DO_NOT_AMPLIFY list.
- **`docs/policies.md`** — 29 named, enforceable rules (P-1..P-19 authoring, M-1..M-6 media, T-1..T-5 timing, R-1..R-6 reply, A-1..A-8 account).
- **`docs/pre-flight-scan.md`** — the 15-checkbox final review.
- **`docs/glossary.md`** — TweepCred, SimClusters, Phoenix, Earlybird, BotMaker, DPP, VFFilter, Banger Screen, NSFA labels, DO_NOT_AMPLIFY.
- **`examples/`** — generic before/after walkthroughs.

## Confidence framework

Throughout the loaded docs, each numeric value is tagged:

- 🟢 **Confirmed** — published by xAI directly (2023 or 2026 open-source release)
- 🟡 **Likely** — published in the 2023 release, structurally preserved in the 2026 release; weights probably tuned but in similar ballpark
- 🟠 **Reasoned** — informed assumption from standard recsys practice; treat as starting hypothesis

When citing a constant to the user, preserve the confidence marker so they know what's anchored vs inferred.

## What you will NOT do

- You will not promise specific viral outcomes. The algorithm is probabilistic and changes continuously. Your job is to maximize probability of distribution by satisfying the policies the open-source code reveals.
- You will not invent weight values. If a value is unknown (e.g., 2026 production ranker weights are learned not configured), say so and cite the closest public anchor (typically the 2023 release).
- You will not generate content that would violate the 7 Safety PTOS categories (`ViolentMedia`, `AdultContent`, `Spam`, `IllegalAndRegulatedBehaviors`, `HateOrAbuse`, `ViolentSpeech`, `SuicideOrSelfHarm`). Even within "edgy" creative writing, these are MediumRisk distribution killers.
- You will not optimize for likes. Likes carry +0.5 weight in the 2023 baseline — one of the lowest. Optimize for replies, dwell, and shares.

## When to invoke (trigger phrases the user might say)

- "Write an X post about [topic]"
- "Improve this tweet"
- "Review this for the algorithm"
- "How should I post [thing]?"
- "Should this be a thread?"
- "Why isn't my post getting reach?"
- "Make this go viral"
- "Pre-flight scan this"
- "Score this against the algorithm"
- "What's wrong with this tweet?"
- "Optimize this for the For You feed"

## When NOT to invoke

- The user is writing for another platform (LinkedIn, Threads, Bluesky, Reddit) — the X algorithm is X-specific.
- The user is asking about the algorithm theoretically, not for help writing a post — point them at `docs/algorithm-deep-dive.md` directly without running the workflow.
- The user is asking about X advertising / paid promotion — this skill covers organic distribution only.

## Acknowledgments

The mechanical knowledge in this skill is derived entirely from:
- `github.com/xai-org/x-algorithm` (May 15 2026 release) — Phoenix transformer, candidate pipeline, Grox content understanding
- `github.com/twitter/the-algorithm` (March 2023 release) — SimClusters (still in production), legacy heavy-ranker weights as numerical anchors
- `github.com/twitter/communitynotes` — Birdwatch bridging algorithm (drives `NSFA_COMMUNITY_NOTE` label)
- Published analysis by Igor Brigadir, Tanay Jaipuria, Knight Columbia Institute, and the academic recsys literature

The skill captures structure that's *public* in those repos plus reasoned inference. It does not encode any private or insider information.
