Agent Skills: Post to X (Twitter) - Video Enhanced

Post content, images, and VIDEOS to X (Twitter). Enhanced version with video upload support. Uses real Chrome with CDP to bypass anti-automation.

UncategorizedID: mr-funny/youtube-clipper/baoyu-post-to-x-video

Install this agent skill to your local

pnpm dlx add-skill https://github.com/Mr-funny/Youtube-clipper/tree/HEAD/.claude/skills/baoyu-post-to-x-video

Skill Files

Browse the full folder contents for baoyu-post-to-x-video.

Download Skill

Loading file tree…

.claude/skills/baoyu-post-to-x-video/SKILL.md

Skill Metadata

Name
baoyu-post-to-x-video
Description
Post content, images, and VIDEOS to X (Twitter). Enhanced version with video upload support. Uses real Chrome with CDP to bypass anti-automation.

Post to X (Twitter) - Video Enhanced

Post content, images, and videos to X using real Chrome browser (bypasses anti-bot detection).

🎥 新增功能: 支持视频上传 (MP4, MOV 等格式)

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: | Script | Purpose | |--------|---------| | scripts/x-browser.ts | Regular posts (text + images) | | 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 or 1 video.

# 图片示例 (Preview mode)
npx -y bun ${SKILL_DIR}/scripts/x-browser.ts "Hello from Claude!" --image ./screenshot.png

# 视频示例 (Preview mode)
npx -y bun ${SKILL_DIR}/scripts/x-browser.ts "Check out this video!" --video ./clip.mp4

# 正式发布视频
npx -y bun ${SKILL_DIR}/scripts/x-browser.ts "Amazing content!" --video ./final.mp4 --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) | | --video <path> | Video file path (MP4, MOV, etc. Max 512MB) | | --submit | Actually post (default: preview only) | | --profile <dir> | Custom Chrome profile directory |

视频限制:

  • 格式: MP4, MOV, AVI, MKV
  • 大小: 最大 512MB
  • 时长: 最长 2 分 20 秒 (普通账号) / 10 分钟 (Premium)
  • 分辨率: 最高 1920x1200, 最低 32x32

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.