agentleFS
Gamma-SoftwareGamma-Software/post-to-x-skill/SKILL.md

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

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. GPTtang/skill-atlas★ 4same name
    2. 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
  1. Very specific:

    If check flags the session, authenticate once — opens real Chrome, the user logs in by hand (password + 2FA), the session persists to …

    line 48
  2. Distinctive:

    no separators → the whole file is one tweet.

    line 66
  3. Distinctive:

    Keep each tweet ≤ 280 chars — the script prints the count and flags any over.

    line 73
  4. Distinctive:

    Always compose visibly without sending first, so the user sees the real thread in the X composer:

    line 77
  5. Very specific:

    Only after the user approves, drop --dry-run:

    line 90

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 real

ToS + 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 check

It checks four things and prints ✓/✗ per line:

CheckFix if ✗
Node ≥ 18upgrade Node
Playwright installedcd <skill-dir> && npm install (driver only — no browser download)
Google Chromeinstall 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 login

The 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:
    1. **N/M** markers per tweet (build-in-public x-thread.md style), else
    2. tweets separated by a line containing only ---, else
    3. no separators → the whole file is one tweet.
  • Images — per tweet, add a line _image: path_ or ![](path) inside 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-run

It 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-only prints 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 in scripts/post-x.mjs if 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.