baoyu-post-to-x
Install this skill
npx skills add jimliu/baoyu-skillsWorks across Claude Code, Cursor, Codex, Copilot & Antigravity
The baoyu-post-to-x skill provides automated X publishing via a live Chrome browser instance. By running scripts locally, it circumvents standard API limitations and bot-detection filters. The tool handles various content types including plain text, multimedia posts, quote tweets, and long-form articles. Users initiate tasks through a CLI-driven workflow that requires an initial manual login to establish a persistent session profile. The system emphasizes safety through a mandatory preview-first design, ensuring posts are verified before the final --submit flag executes the action. It is intended for developers or content creators needing to script their social media presence directly from local machine resources or automated CI/CD environments, keeping all operational logic within their control.
When to Use This Skill
- •Scheduling regular status updates from a local Markdown file
- •Posting recurring video clips or product demos to a brand account
- •Automating the publication of research notes or technical articles
- •Engaging with community content via automated quote tweeting
- •Integrating social media updates into a terminal-based publishing workflow
How to Invoke This Skill
Example prompts that trigger this skill in Claude Code, Cursor, or Antigravity:
- “Post this text to my X account
- “Share this video on X with a caption
- “Quote this tweet with a comment about its findings
- “Convert this Markdown article into an X post
- “Automate my Twitter workflow for new content
Pro Tips
- 💡Ensure Google Chrome and `bun` are installed on the execution environment and perform a manual login to X on the first run to avoid automation blocks.
- 💡Leverage the `x-article.ts` script for in-depth content distribution, transforming your Markdown into engaging long-form posts directly on X.
- 💡Integrate this skill with content generation agents to create a full pipeline from content creation to automated social media publishing.
What this skill does
- •Automated publishing of text and up to 4 image attachments
- •Video file processing for standard and long-form tweet content
- •Quote tweet generation with customized commentary
- •Direct transformation and publishing of Markdown files into X Articles
- •Browser session management via persistent Chrome profile directories
When not to use it
- ✕If your account requires high-frequency API-based analytics tracking
- ✕When you need to interact with platform-native polling or specific X ad campaign features
- ✕If running on a headless server without a local environment for Chromium and session persistence
Example workflow
- Ensure Google Chrome and Bun runtime are installed
- Execute the relevant script in preview mode to confirm content formatting
- Verify the output within the opened browser window
- Add the --submit flag to the command to finalize the post
- Review the resulting URL or post confirmation
Prerequisites
- –Google Chrome or Chromium browser
- –Bun runtime environment
- –Existing X account with valid session access
Pitfalls & limitations
- !Requires manual login during the first run to authenticate the browser profile
- !Video publishing is subject to native X duration limits based on account tier
- !The browser window opens on the host machine, which may interrupt local focus
- !No built-in error recovery if X updates its DOM structure or anti-bot layout
FAQ
How it compares
Unlike generic API-based tools that face strict rate limits and developer costs, this approach uses standard browser automation to interact with the site as a human user would.
📄 Full skill instructions — original source: jimliu/baoyu-skills
Post content, images, videos, and long-form articles to X using 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_DIR2. Script path =
${SKILL_DIR}/scripts/<script-name>.ts3. Replace all
${SKILL_DIR} in this document with the actual path**Script Reference**:
| Script | Purpose |
|--------|---------|
|
scripts/x-browser.ts | Regular posts (text + images) ||
scripts/x-video.ts | Video posts (text + video) ||
scripts/x-quote.ts | Quote tweet with comment ||
scripts/x-article.ts | Long-form article publishing (Markdown) ||
scripts/md-to-html.ts | Markdown → HTML conversion ||
scripts/copy-to-clipboard.ts | Copy content to clipboard ||
scripts/paste-from-clipboard.ts | Send real paste keystroke |## Prerequisites
- Google Chrome or Chromium installed
-
bun installed (for running scripts)- First run: log in to X in the opened browser window
## 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.
# Preview mode (doesn't post)
npx -y bun ${SKILL_DIR}/scripts/x-browser.ts "Hello from Claude!" --image ./screenshot.png
# Actually post
npx -y bun ${SKILL_DIR}/scripts/x-browser.ts "Hello!" --image ./photo.png --submit> **Note**:
${SKILL_DIR} represents this skill's installation directory. Agent replaces with actual path at runtime.**Parameters**:
| Parameter | Description |
|-----------|-------------|
|
<text> | Post content (positional argument) ||
--image <path> | Image file path (can be repeated, max 4) ||
--submit | Actually post (default: preview only) ||
--profile <dir> | Custom Chrome profile directory |---
## Video Posts
Text + video file (MP4, MOV, WebM).
# Preview mode (doesn't post)
npx -y bun ${SKILL_DIR}/scripts/x-video.ts "Check out this video!" --video ./clip.mp4
# Actually post
npx -y bun ${SKILL_DIR}/scripts/x-video.ts "Amazing content" --video ./demo.mp4 --submit**Parameters**:
| Parameter | Description |
|-----------|-------------|
|
<text> | Post content (positional argument) ||
--video <path> | Video file path (required) ||
--submit | Actually post (default: preview only) ||
--profile <dir> | Custom Chrome profile directory |**Video Limits**:
- Regular accounts: 140 seconds max
- X Premium: up to 60 minutes
- Supported formats: MP4, MOV, WebM
- Processing time: 30-60 seconds depending on file size
---
## Quote Tweets
Quote an existing tweet with your comment - a way to share content while giving credit to the original creator.
# Preview mode (doesn't post)
npx -y bun ${SKILL_DIR}/scripts/x-quote.ts https://x.com/user/status/123456789 "Great insight!"
# Actually post
npx -y bun ${SKILL_DIR}/scripts/x-quote.ts https://x.com/user/status/123456789 "I agree!" --submit**Parameters**:
| Parameter | Description |
|-----------|-------------|
|
<tweet-url> | URL of the tweet to quote (positional argument) ||
<comment> | Your comment text (positional argument, optional) ||
--submit | Actually post (default: preview only) ||
--profile <dir> | Custom Chrome profile directory |---
## X Articles
Long-form Markdown articles (requires X Premium).
# Preview mode
npx -y bun ${SKILL_DIR}/scripts/x-article.ts article.md
# With cover image
npx -y bun ${SKILL_DIR}/scripts/x-article.ts article.md --cover ./cover.jpg
# Publish
npx -y bun ${SKILL_DIR}/scripts/x-article.ts article.md --submit**Parameters**:
| Parameter | Description |
|-----------|-------------|
|
<markdown> | Markdown file path (positional argument) ||
--cover <path> | Cover image path ||
--title <text> | Override article title ||
--submit | Actually publish (default: preview only) |**Frontmatter** (optional):
---
title: My Article Title
cover_image: /path/to/cover.jpg
------
## Notes
- First run requires manual login (session is saved)
- Always preview before using
--submit- Browser closes automatically after operation
- Supports macOS, Linux, and Windows
## Extension Support
Custom configurations via EXTEND.md.
**Check paths** (priority order):
1.
.baoyu-skills/baoyu-post-to-x/EXTEND.md (project)2.
~/.baoyu-skills/baoyu-post-to-x/EXTEND.md (user)If found, load before workflow. Extension content overrides defaults.
How to Use This Skill Unit
Option A: Project-Specific (Recommended)
- Click "Download" above
- In your project, create the directory:
.agent/skills/baoyu-post-to-x/ - Save the file as
SKILL.md - The agent will automatically discover the skill based on its description.
Option B: Global Installation (All Agents)
Save the file to these locations to make it available across all projects:
- Claude Code:
~/.claude/skills/jimliu/baoyu-skills/baoyu-post-to-x/SKILL.md - Cursor:
~/.cursor/skills/jimliu/baoyu-skills/baoyu-post-to-x/SKILL.md - Antigravity:
~/.gemini/antigravity/skills/jimliu/baoyu-skills/baoyu-post-to-x/SKILL.md
🚀 Install with CLI:npx skills add jimliu/baoyu-skills
