post-to-x
Skill0 starsChanged 5 months agoMITView on GitHub
Post a tweet or a multi-tweet thread to X/Twitter from text or a file by driving the real x.com web UI with Playwright (reused browser session, no paid API). Trigger when the user says "post this to X", "tweet this", "post a thread on X/Twitter", "publish this on X", "share this on Twitter", or wants to auto-post to X without the paid API.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- 973803318/gino-skillstheir own version, first seen Nov 29, 2026
- GPTtang/skill-atlastheir own version, first seen Mar 22, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- GPTtang/skill-atlas★ 4same name
- 973803318/gino-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 48
If check flags the session, authenticate once — opens real Chrome, the user logs in by hand (password + 2FA), the session persists to …
- Distinctive: line 66
no separators → the whole file is one tweet.
- Distinctive: line 73
Keep each tweet ≤ 280 chars — the script prints the count and flags any over.
- Distinctive: line 77
Always compose visibly without sending first, so the user sees the real thread in the X composer:
- Very specific: line 90
Only after the user approves, drop --dry-run:
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Post to X
Publishes a tweet or thread to X/Twitter by driving x.com in a real browser, not the API. X removed the free API in Feb 2026 (pay-per-use: $0.015/post, $0.20 with a link), so this reuses a browser session you log into once by hand and posts through the site itself. It uses the real Chrome binary + strips the automation flags to get past X's "browser not trusted" check.
Login once (manual) → parse text/thread → compose in a headed dry-run → [user OK] → post for realToS + risk. Automated posting is against X's ToS and can get an account flagged. This is for low-volume, human-paced self-posting — a release thread, a build-in-public update — not a bulk bot. Always dry-run first, keep delays human, and never post on the user's behalf without an explicit go.
0. Onboarding — run check first
Always start here. The check command is the preflight gate: it verifies every
prerequisite and tells you exactly what's missing, so you never hit a cryptic
failure mid-post.
node scripts/post-x.mjs checkIt checks four things and prints ✓/✗ per line:
| Check | Fix if ✗ |
| Node ≥ 18 | upgrade Node |
| Playwright installed | cd <skill-dir> && npm install (driver only — no browser download) |
| Google Chrome | install Google Chrome — the trusted binary it drives via channel:"chrome" (not just Chromium) |
| X session (login) | run the login step below |
Resolve every ✗ and re-run check until it prints ✓ ready to post. Only then
proceed. Do NOT skip to post — a missing prereq surfaces as an opaque Playwright
error otherwise.
Login (the one manual step)
If check flags the session, authenticate once — opens real Chrome, the user logs
in by hand (password + 2FA), the session persists to ~/.config/post-to-x/x-profile
and is reused for every later post:
node scripts/post-x.mjs loginThe login window waits up to 5 min for a logged-in state.
1. Prepare the content
Accept either inline text or a file:
- Single tweet —
--text "…". - Thread file —
--file <path>. Tweet boundaries are auto-detected:**N/M**markers per tweet (build-in-publicx-thread.mdstyle), else- tweets separated by a line containing only
---, else - no separators → the whole file is one tweet.
- Images — per tweet, add a line
_image: path_orinside that tweet; or attach to the first tweet with repeatable--image <path>. X takes up to 4 per tweet. Paths are relative to the file. - Auto-stripped:
> …blockquotes (DRAFT banners),# …headings,_(…chars…)_notes.
Keep each tweet ≤ 280 chars — the script prints the count and flags any over.
2. Dry-run (mandatory gate)
Always compose visibly without sending first, so the user sees the real thread in the X composer:
node scripts/post-x.mjs post --file thread.md --headed --dry-runIt types every tweet into the compose modal (adding thread posts via the "+" button), attaches images, then holds 30 s and closes — nothing is posted. Show the user; get an explicit OK.
3. Post for real
Only after the user approves, drop --dry-run:
node scripts/post-x.mjs post --file thread.md # or --text "…"
node scripts/post-x.mjs post --file thread.md --image shot.png --headed--headed shows the browser; default is headless. The script clicks X's
"Post all" (thread) / "Post" (single) and confirms the composer closed.
4. Validate
- Parse gate —
--parse-onlyprints the parsed tweets + char counts + image paths and exits. Run it whenever the file format is non-obvious. - Dry-run gate — the headed compose above is the real proof it will post correctly; skipping it has shipped a broken thread before (ambiguous selectors, wrong tweet split).
- Session gate — if the composer never loads, the session expired → re-run
login.
5. Report
Tell the user: how many tweets posted (or composed, for a dry-run), any tweet
over 280, images attached, and the profile dir used. If a selector failed, say
which step and that X's UI likely changed (the data-testids in post-x.mjs
are the brittle part).
Notes
- Selectors used:
tweetTextarea_<i>,addButton,fileInput,tweetButton— scoped to the compose[role="dialog"]. Update these inscripts/post-x.mjsif X reworks the composer. - The session lives in
~/.config/post-to-x/x-profile(override--profile). It's outside the repo — never commit it. - X only; LinkedIn/Mastodon/Bluesky have free APIs — use a scheduler (Postiz, Buffer, Typefully) for those instead of scraping.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

