Skip to content

Guide · Agent skill

How to use the Post to X (Twitter) agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The Post to X (Twitter) skill, baoyu-post-to-x, lets an AI agent write and publish content to X for you by driving a real Chrome browser that is logged into your account. It is aimed at creators who post regularly and writers who keep articles in Markdown. By the end of this guide you will know what the skill does, how to install it, how to trigger it with a normal request, and what safety points to check first.

Post to X (Twitter)JimLiu/baoyu-skills · MIT

Quick start

  1. 1Download and unzip. Download the skill ZIP from this page and unzip it so you have a baoyu-post-to-x folder.
  2. 2Place the folder. Move the folder into ~/.claude/skills/ for personal use, or into .claude/skills/ in a project.
  3. 3Install prerequisites. Make sure Google Chrome is installed and that bun is available, or npx to run it.
  4. 4Log in to X. On first run, log in to X manually in the Chrome window so the session is saved.
  5. 5Ask in plain language. Request a post or article using phrases like post to X, tweet, or publish to Twitter.
  6. 6Review and confirm. Check the draft the agent prepared, then explicitly confirm before it clicks Publish.

What is the Post to X skill and what does it make the agent do?

An agent skill is a folder of instructions and helper scripts that an AI agent loads when your request matches the skill's description. This one covers posting to X (formerly Twitter). It handles regular posts with images or video, and X Articles, which are long-form pieces written in Markdown.

Once installed, the agent follows the skill's playbook. It opens your real Google Chrome, which must be logged into X, fills in the post or article editor, uploads images or video, and stops before the final Publish button so you can confirm.

  • Regular posts: text plus images or video.
  • X Articles: converts Markdown to rich HTML, copies it to the clipboard and pastes it into X's editor, then uploads body images one at a time.
  • Helper scripts handle Markdown conversion, clipboard copying and checking paste permissions.

How do you install the Post to X skill?

Download the ZIP for this skill from this page and unzip it. Place the baoyu-post-to-x folder in one of two locations: your personal skills folder at ~/.claude/skills/, or a project's .claude/skills/ folder if you want it limited to one project.

Alternatively, in the Claude apps, open Settings, go to Capabilities, then Skills, and upload the skill there.

  • Personal install: ~/.claude/skills/baoyu-post-to-x
  • Project install: .claude/skills/baoyu-post-to-x inside your project folder

What do you need before the first run?

You need Google Chrome or Chromium, and the bun runtime. The skill's metadata also accepts npx as a way to run bun. Scripts depend on the Node packages listed in scripts/package.json.

On first use, log in to X manually in the Chrome window the skill opens. The session is then saved. The skill can optionally run an environment check before first use, and you can skip it.

  • Google Chrome or Chromium
  • bun runtime (or npx, which can run bun)
  • Logged in to X in Chrome on first run
  • Optional: Codex Chrome plugin or Chrome Computer Use for some modes

How do you trigger the skill with a natural request?

You do not need special syntax. Ask the agent in plain language and include the content. The skill is triggered by phrases such as "post to X", "tweet", "publish to Twitter" or "share on X".

For articles, point the agent at your Markdown file. Say so explicitly so it uses the article workflow rather than a short post.

  • "Post to X: our new docs are live at the link below, with the screenshot."
  • "Tweet this image and caption it with one line about the release."
  • "Publish article.md to X as an article."
  • "Share on X the video at ~/Videos/demo.mp4 with this text."

What happens during a post, step by step?

The agent first chooses one browser-control mode. In most cases it uses Chrome Computer Use when available. If you explicitly name the Codex Chrome plugin or @chrome, it uses that path instead. CDP script mode is a fallback that runs only when the other modes are unavailable or you ask for it.

For a regular post, the agent fills in the text, attaches images or video and then stops. For an article, it converts Markdown to HTML with the md-to-html script, copies the rich HTML with copy-to-clipboard, pastes it into the editor and inserts each body image at its placeholder.

  • Articles convert Markdown and keep a map of image placeholders to local files.
  • Body images are inserted through the editor's Insert, then Media, then Add photos or video flow.
  • The agent asks for explicit confirmation before clicking Publish.

What about safety and what the scripts can do?

This skill runs local scripts and uses the network. It operates on your real Chrome profile and your X session, so a mistake could affect your account. Review the agent's plan and the draft before you confirm anything.

The skill is built around a human confirming each post. It is not designed for unattended bulk or scheduled posting, and X may restrict automated activity. Only use it on a setup you have checked, and keep the scripts' behaviour in mind if you run them in a different environment.

  • Runs scripts: yes. Uses network: yes.
  • Uses your logged-in Chrome profile and X session.
  • Preferences can set a default Chrome profile through an EXTEND.md file.

What tips help you get good results?

Keep the request concrete: say what the post should say, which files to attach and whether it is a post or an article. Preview the draft before confirming. For articles, check the cover, body, links and images in preview.

If you keep articles in Obsidian, the skill is designed to handle notes with images, so keep image paths in the Markdown and let the agent map them.

  • Check the draft in the browser window before confirming.
  • Name the mode if you have a preference, such as Codex Chrome plugin or CDP script mode.
  • Use a default Chrome profile through EXTEND.md if you have several profiles.

What people use it for

  • Post a short update with a screenshot to X from your own account.
  • Publish a long Markdown article to the X Articles editor with its images in place.
  • Share a video clip with a caption without typing it into the composer yourself.
  • Turn an Obsidian note with images into an X Article draft for review.

Frequently asked questions

Is the Post to X skill free?

The skill is published under the MIT licence, as stated on this page. This page does not list prices for X or Chrome. X Articles requires an X Premium subscription according to the skill's reference notes.

What do I need to install the Post to X skill?

You need Google Chrome or Chromium, the bun runtime (or npx to run it), and to be logged in to X in Chrome. Install the skill by unzipping it into ~/.claude/skills/ or a project's .claude/skills/ folder.

Where do I put the baoyu-post-to-x skill folder?

Put it in ~/.claude/skills/ for all your projects, or in .claude/skills/ inside one project. You can also upload it in the Claude apps under Settings, Capabilities, Skills.

Will the agent post automatically without asking me?

No. The skill is built so the agent stops before the final Publish or Post action and waits for your explicit confirmation.

Why is the agent using my real Chrome browser?

The skill drives your real Chrome profile so it can use your existing X login. This means it can affect your account, so review each draft before confirming.

Can I use this for scheduled or bulk posting?

The skill is not designed for fully automated bulk or scheduled posting. It assumes a human confirms each post, and X may restrict automated activity.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Use this skill if you post regularly to X, want an agent to handle typing and uploads, or keep articles in Markdown and want them formatted for X Articles, and you are comfortable with Bun and Chrome. Pick something else if you do not want an agent controlling your logged-in browser, or if you need fully automated scheduled posting.

Download the skill