Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
ideacco avatar

Baoyu Post To X

  • 16 installs
  • 12 repo stars
  • Updated March 4, 2026
  • ideacco/baoyu-skills-openclaw

Turn a Markdown draft into a formatted X Article with cover image and inline images, preview in Chrome, then publish when you are ready.

About

baoyu-post-to-x is an agent skill backed by a Bun script that opens Google Chrome and loads your Markdown into the X Articles editor with formatting and images. Solo and indie builders who write essays, launch threads as articles, or repurpose blog Markdown for X can stay in one source file instead of reformatting by hand. Frontmatter and the first H1 supply the title; cover and inline images are resolved locally or downloaded to a temp folder before placeholder replacement in the UI. Preview mode is the default so you can review layout before `--submit` actually publishes. You need an X Premium subscription for Articles, Chrome installed, and Bun available for the script runner. It fits the launch phase when distribution is the bottleneck, not when you are still validating copy or building the product itself.

  • CLI via `npx -y bun` and `x-article.ts` with default preview and `--submit` to publish
  • YAML frontmatter for title and cover (`cover_image`, `cover`, `image` aliases)
  • Maps Markdown (headers, lists, blockquotes, links) into X Article rich text; code blocks become blockquotes
  • Downloads remote images, uses `XIMGPH_N` placeholders, then inserts images in the editor
  • Optional custom cover: `--cover ./cover.jpg`

Baoyu Post To X by the numbers

  • 16 all-time installs (skills.sh)
  • Ranked #1,488 of 1,879 Marketing & SEO skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Aug 2, 2026 (Skillselion catalog sync)
npx skills add https://github.com/ideacco/baoyu-skills-openclaw --skill baoyu-post-to-x

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs16
repo stars12
Security audit1 / 3 scanners passed
Last updatedMarch 4, 2026
Repositoryideacco/baoyu-skills-openclaw

What it does

Turn a Markdown draft into a formatted X Article with cover image and inline images, preview in Chrome, then publish when you are ready.

Files

SKILL.mdMarkdownGitHub ↗

Post to X (Twitter)

Posts text, images, videos, and long-form articles to X via real Chrome browser (bypasses anti-bot detection).

Script Directory

Important: All scripts are located in the scripts/ subdirectory of this skill.

Agent Execution Instructions: 1. Determine this SKILL.md file's directory path as SKILL_DIR 2. Script path = ${SKILL_DIR}/scripts/<script-name>.ts 3. Replace all ${SKILL_DIR} in this document with the actual path

Script Reference:

ScriptPurpose
scripts/x-browser.tsRegular posts (text + images)
scripts/x-video.tsVideo posts (text + video)
scripts/x-quote.tsQuote tweet with comment
scripts/x-article.tsLong-form article publishing (Markdown)
scripts/md-to-html.tsMarkdown → HTML conversion
scripts/copy-to-clipboard.tsCopy content to clipboard
scripts/paste-from-clipboard.tsSend real paste keystroke
scripts/check-paste-permissions.tsVerify environment & permissions

Preferences (EXTEND.md)

Use Bash to check EXTEND.md existence (priority order):

# Check project-level first
test -f .baoyu-skills/baoyu-post-to-x/EXTEND.md && echo "project"

# Then user-level (cross-platform: $HOME works on macOS/Linux/WSL)
test -f "$HOME/.baoyu-skills/baoyu-post-to-x/EXTEND.md" && echo "user"

┌──────────────────────────────────────────────────┬───────────────────┐ │ Path │ Location │ ├──────────────────────────────────────────────────┼───────────────────┤ │ .baoyu-skills/baoyu-post-to-x/EXTEND.md │ Project directory │ ├──────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.baoyu-skills/baoyu-post-to-x/EXTEND.md │ User home │ └──────────────────────────────────────────────────┴───────────────────┘

┌───────────┬───────────────────────────────────────────────────────────────────────────┐ │ Result │ Action │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Found │ Read, parse, apply settings │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Not found │ Use defaults │ └───────────┴───────────────────────────────────────────────────────────────────────────┘

EXTEND.md Supports: Default Chrome profile

Prerequisites

  • Google Chrome or Chromium
  • bun runtime
  • First run: log in to X manually (session saved)

Pre-flight Check (Optional)

Before first use, suggest running the environment check. User can skip if they prefer.

npx -y bun ${SKILL_DIR}/scripts/check-paste-permissions.ts

Checks: Chrome, profile isolation, Bun, Accessibility, clipboard, paste keystroke, Chrome conflicts.

If any check fails, provide fix guidance per item:

CheckFix
ChromeInstall Chrome or set X_BROWSER_CHROME_PATH env var
Profile dirEnsure ~/.local/share/x-browser-profile is writable
Bun runtime`curl -fsSL https://bun.sh/install \
Accessibility (macOS)System Settings → Privacy & Security → Accessibility → enable terminal app
Clipboard copyEnsure Swift/AppKit available (macOS Xcode CLI tools: xcode-select --install)
Paste keystroke (macOS)Same as Accessibility fix above
Paste keystroke (Linux)Install xdotool (X11) or ydotool (Wayland)

References

  • Regular Posts: See references/regular-posts.md for manual workflow, troubleshooting, and technical details
  • X Articles: See references/articles.md for long-form article publishing guide

---

Regular Posts

Text + up to 4 images.

npx -y bun ${SKILL_DIR}/scripts/x-browser.ts "Hello!" --image ./photo.png

Parameters:

ParameterDescription
<text>Post content (positional)
--image <path>Image file (repeatable, max 4)
--profile <dir>Custom Chrome profile

Note: Script opens browser with content filled in. User reviews and publishes manually.

---

Video Posts

Text + video file.

npx -y bun ${SKILL_DIR}/scripts/x-video.ts "Check this out!" --video ./clip.mp4

Parameters:

ParameterDescription
<text>Post content (positional)
--video <path>Video file (MP4, MOV, WebM)
--profile <dir>Custom Chrome profile

Note: Script opens browser with content filled in. User reviews and publishes manually.

Limits: Regular 140s max, Premium 60min. Processing: 30-60s.

---

Quote Tweets

Quote an existing tweet with comment.

npx -y bun ${SKILL_DIR}/scripts/x-quote.ts https://x.com/user/status/123 "Great insight!"

Parameters:

ParameterDescription
<tweet-url>URL to quote (positional)
<comment>Comment text (positional, optional)
--profile <dir>Custom Chrome profile

Note: Script opens browser with content filled in. User reviews and publishes manually.

---

X Articles

Long-form Markdown articles (requires X Premium).

npx -y bun ${SKILL_DIR}/scripts/x-article.ts article.md
npx -y bun ${SKILL_DIR}/scripts/x-article.ts article.md --cover ./cover.jpg

Parameters:

ParameterDescription
<markdown>Markdown file (positional)
--cover <path>Cover image
--title <text>Override title

Frontmatter: title, cover_image supported in YAML front matter.

Note: Script opens browser with article filled in. User reviews and publishes manually.

---

Troubleshooting

Chrome debug port not ready

If a script fails with Chrome debug port not ready or Unable to connect, kill existing Chrome CDP instances first, then retry:

pkill -f "Chrome.*remote-debugging-port" 2>/dev/null; pkill -f "Chromium.*remote-debugging-port" 2>/dev/null; sleep 2

Important: This should be done automatically — when encountering this error, kill Chrome CDP instances and retry the command without asking the user.

Notes

  • First run: manual login required (session persists)
  • All scripts only fill content into the browser, user must review and publish manually
  • Cross-platform: macOS, Linux, Windows

Extension Support

Custom configurations via EXTEND.md. See Preferences section for paths and supported options.

OpenClaw Migration Notes

  • Migration mode: OpenClaw native first
  • Preserved directories:
  • scripts: yes
  • references: yes
  • prompts: no
  • External dependencies: bun, chrome, external-ai-api, social-platform-access
  • Risk level: high
  • Environment variables (detected): HOME, X_BROWSER_CHROME_PATH
  • Config compatibility: keep original .baoyu-skills/<skill>/EXTEND.md behavior and add OpenClaw-compatible path in runtime wrappers when needed.

OpenClaw Preflight Checks

  • Confirm bun is available when script examples use npx -y bun ....
  • Confirm Chrome is installed and launchable for CDP/browser automation flows.
  • Confirm required API credentials are exported before execution.
  • Confirm account session/cookies are valid before posting or scraping operations.

Detected env vars: HOME, X_BROWSER_CHROME_PATH

OpenClaw Failure Fallback

  • If runtime dependency is missing, stop execution and return exact install/setup command.
  • If API call fails, suggest retry with explicit provider/model flags and validate key scope.
  • If browser automation fails, switch to manual/wait mode where available.
  • If platform blocks automation, return manual publish/export instructions instead of retry loops.
  • For high-risk workflows, require explicit user confirmation before irreversible actions.

Related skills

FAQ

Is Baoyu Post To X safe to install?

skills.sh reports 1 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

Marketing & SEOdistributioncontent

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.