Score X (Twitter) drafts against the documented X algorithm signal weights before you hit Post.
No third-party API key. The extension talks to a local daemon on your own machine, which shells out to the Gemini CLI under your OAuth subscription. Your drafts never touch a server we control.
Click the Pre-flight button in the X compose toolbar. A side panel opens with:
- A 0-100 score
- Ten algorithm dimensions, each with a 0-10 bar and a one-line rationale
- Three suggested rewrites you can drop into the compose box with one click
Scoring dimensions (weights set in src/lib/scoring.ts, easy to tune):
| Dimension | Weight | What it measures |
|---|---|---|
| Reply hook | 3.0 | Does the post invite a real reply (replies are weighted ~27x a like) |
| Quote-tweet bait | 2.0 | Is there a clear stance someone would quote to agree or disagree |
| Bookmark potential | 2.0 | Lists, frameworks, how-to material worth saving |
| Profile-click trigger | 2.0 | Does it pull a cold reader to your profile (24x weight) |
| Dwell time | 1.5 | Substantive enough to read all the way through |
| Specificity | 1.5 | Concrete numbers, names, dates over vague claims |
| Hot-take strength | 1.5 | Defensible stance vs fence-sitting |
| Identity pull | 1.5 | Will readers self-identify and reply or share |
| Compression | 1.0 | Every line earns its place |
| Block risk | -3.0 | Penalty: does it bait a tribe that will block (block is weighted -150) |
The extension expects a daemon listening on a configurable URL (default http://127.0.0.1:7321) that accepts:
POST /gemini
Authorization: Bearer <your-token>
Content-Type: application/json
{ "prompt": "<scoring prompt>", "model": "flash" | "pro", "timeout_ms": 60000 }
And responds with:
{ "ok": true, "text": "<gemini stdout>", "rateLimited": false, "durationMs": 1234 }The reference implementation is ej-brain-pc-agent. Any local daemon that satisfies the above contract works. Write your own if you prefer.
- Chrome or Edge (Chromium 116+)
- Node 20+ (for building from source)
- A local daemon implementing the
POST /geminicontract above - The Gemini CLI installed and OAuth-authed under the user the daemon runs as:
npm i -g @google/gemini-cli && gemini(run once interactively to sign in)
git clone https://github.com/PythonLuvr/x-preflight
cd x-preflight
npm install
npm run buildThen in Chrome or Edge:
- Open
chrome://extensions - Toggle Developer mode on
- Click Load unpacked, point at the
dist/folder - Click the extension icon to open settings, paste your daemon URL and bearer token, hit Test connection
- Open X.com, click into the compose box
- Type a draft (at least 20 characters)
- Trigger Pre-flight by any of:
- Clicking the extension icon in your browser toolbar
- Pressing
Ctrl+Shift+P(orCmd+Shift+Pon Mac) - Clicking the Pre-flight pill in the compose toolbar, if X's current DOM exposes one
- Read the breakdown, click Use this on a suggestion, or Re-score after editing
- Post
When you're not on x.com, clicking the extension icon opens settings instead.
- Bearer token and settings live in
chrome.storage.synconly. - Each Pre-flight call is one
POST /geminito your local daemon. No third-party server we control. - The extension declares one
host_permissionsentry:http://127.0.0.1:7321/*. It cannot reach anywhere else on the internet. - The repo is MIT. Audit the network calls yourself in src/lib/bridge.ts.
MIT. See LICENSE.