{"id":"1c44c05f-9bf8-4449-ae3e-da8b8224a9e0","shortId":"GEejsj","kind":"skill","title":"baoyu-post-to-x","tagline":"Posts content and articles to X (Twitter). Supports regular posts with images/videos and X Articles (long-form Markdown). Uses real Chrome with CDP to bypass anti-automation. Use when user asks to \"post to X\", \"tweet\", \"publish to Twitter\", or \"share on X\".","description":"# Post to X (Twitter)\n\nPosts text, images, videos, and long-form articles to X via real Chrome browser (bypasses anti-bot detection).\n\n## Script Directory\n\n**Important**: All scripts are located in the `scripts/` subdirectory of this skill.\n\n**Agent Execution Instructions**:\n1. Determine this SKILL.md file's directory path as `{baseDir}`\n2. Script path = `{baseDir}/scripts/<script-name>.ts`\n3. Replace all `{baseDir}` in this document with the actual path\n4. Resolve `${BUN_X}` runtime: if `bun` installed → `bun`; if `npx` available → `npx -y bun`; else suggest installing bun\n\n**Script Reference**:\n| Script | Purpose |\n|--------|---------|\n| `scripts/x-browser.ts` | Regular posts (text + images) |\n| `scripts/x-video.ts` | Video posts (text + video) |\n| `scripts/x-quote.ts` | Quote tweet with comment |\n| `scripts/x-article.ts` | Long-form article publishing (Markdown) |\n| `scripts/md-to-html.ts` | Markdown → HTML conversion |\n| `scripts/copy-to-clipboard.ts` | Copy content to clipboard |\n| `scripts/paste-from-clipboard.ts` | Send real paste keystroke |\n| `scripts/check-paste-permissions.ts` | Verify environment & permissions |\n\n## Preferences (EXTEND.md)\n\nCheck EXTEND.md in priority order — the first one found wins:\n\n| Priority | Path | Scope |\n|----------|------|-------|\n| 1 | `.baoyu-skills/baoyu-post-to-x/EXTEND.md` | Project |\n| 2 | `${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-post-to-x/EXTEND.md` | XDG |\n| 3 | `$HOME/.baoyu-skills/baoyu-post-to-x/EXTEND.md` | User home |\n\nIf none found, use defaults.\n\n**EXTEND.md supports**: Default Chrome profile\n\n## Prerequisites\n\n- Google Chrome or Chromium\n- `bun` runtime\n- First run: log in to X manually (session saved)\n\n## Pre-flight Check (Optional)\n\nBefore first use, suggest running the environment check. User can skip if they prefer.\n\n```bash\n${BUN_X} {baseDir}/scripts/check-paste-permissions.ts\n```\n\nChecks: Chrome, profile isolation, Bun, Accessibility, clipboard, paste keystroke, Chrome conflicts.\n\n**If any check fails**, provide fix guidance per item:\n\n| Check | Fix |\n|-------|-----|\n| Chrome | Install Chrome or set `X_BROWSER_CHROME_PATH` env var |\n| Profile dir | Shared profile at `baoyu-skills/chrome-profile` (see CLAUDE.md Chrome Profile section) |\n| Bun runtime | `brew install oven-sh/bun/bun` (macOS) or `npm install -g bun` |\n| Accessibility (macOS) | System Settings → Privacy & Security → Accessibility → enable terminal app |\n| Clipboard copy | Ensure Swift/AppKit available (macOS Xcode CLI tools: `xcode-select --install`) |\n| Paste keystroke (macOS) | Same as Accessibility fix above |\n| Paste keystroke (Linux) | Install `xdotool` (X11) or `ydotool` (Wayland) |\n\n## References\n\n- **Regular Posts**: See `references/regular-posts.md` for manual workflow, troubleshooting, and technical details\n- **X Articles**: See `references/articles.md` for long-form article publishing guide\n\n---\n\n## Post Type Selection\n\nUnless the user explicitly specifies the post type:\n- **Plain text** + within 10,000 characters → **Regular Post** (Premium members support up to 10,000 characters, non-Premium: 280)\n- **Markdown file** (.md) → **X Article**\n\n## Regular Posts\n\n```bash\n${BUN_X} {baseDir}/scripts/x-browser.ts \"Hello!\" --image ./photo.png\n```\n\n**Parameters**:\n| Parameter | Description |\n|-----------|-------------|\n| `<text>` | Post content (positional) |\n| `--image <path>` | Image file (repeatable, max 4) |\n| `--profile <dir>` | Custom Chrome profile |\n\n**Note**: Script opens browser with content filled in. User reviews and publishes manually.\n\n---\n\n## Video Posts\n\nText + video file.\n\n```bash\n${BUN_X} {baseDir}/scripts/x-video.ts \"Check this out!\" --video ./clip.mp4\n```\n\n**Parameters**:\n| Parameter | Description |\n|-----------|-------------|\n| `<text>` | Post content (positional) |\n| `--video <path>` | Video file (MP4, MOV, WebM) |\n| `--profile <dir>` | Custom Chrome profile |\n\n**Note**: Script opens browser with content filled in. User reviews and publishes manually.\n\n**Limits**: Regular 140s max, Premium 60min. Processing: 30-60s.\n\n---\n\n## Quote Tweets\n\nQuote an existing tweet with comment.\n\n```bash\n${BUN_X} {baseDir}/scripts/x-quote.ts https://x.com/user/status/123 \"Great insight!\"\n```\n\n**Parameters**:\n| Parameter | Description |\n|-----------|-------------|\n| `<tweet-url>` | URL to quote (positional) |\n| `<comment>` | Comment text (positional, optional) |\n| `--profile <dir>` | Custom Chrome profile |\n\n**Note**: Script opens browser with content filled in. User reviews and publishes manually.\n\n---\n\n## X Articles\n\nLong-form Markdown articles (requires X Premium).\n\n```bash\n${BUN_X} {baseDir}/scripts/x-article.ts article.md\n${BUN_X} {baseDir}/scripts/x-article.ts article.md --cover ./cover.jpg\n```\n\n**Parameters**:\n| Parameter | Description |\n|-----------|-------------|\n| `<markdown>` | Markdown file (positional) |\n| `--cover <path>` | Cover image |\n| `--title <text>` | Override title |\n\n**Frontmatter**: `title`, `cover_image` supported in YAML front matter.\n\n**Note**: Script opens browser with article filled in. User reviews and publishes manually.\n\n**Post-Composition Check**: The script automatically verifies after all images are inserted:\n- Remaining `XIMGPH_` placeholders in editor content\n- Expected vs actual image count\n\nIf the check fails (warnings in output), alert the user with the specific issues before they publish.\n\n---\n\n## Troubleshooting\n\n### Chrome debug port not ready\n\nIf a script fails with `Chrome debug port not ready` or `Unable to connect`, kill existing Chrome CDP instances first, then retry:\n\n```bash\npkill -f \"Chrome.*remote-debugging-port\" 2>/dev/null; pkill -f \"Chromium.*remote-debugging-port\" 2>/dev/null; sleep 2\n```\n\n**Important**: This should be done automatically — when encountering this error, kill Chrome CDP instances and retry the command without asking the user.\n\n## Notes\n\n- First run: manual login required (session persists)\n- All scripts only fill content into the browser, user must review and publish manually\n- Cross-platform: macOS, Linux, Windows\n\n## Extension Support\n\nCustom configurations via EXTEND.md. See **Preferences** section for paths and supported options.","tags":["baoyu","post","skills","jimliu","agent-skills","claude-skills","codex-skills","openclaw-skills"],"capabilities":["skill","source-jimliu","skill-baoyu-post-to-x","topic-agent-skills","topic-claude-skills","topic-codex-skills","topic-openclaw-skills"],"categories":["baoyu-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/JimLiu/baoyu-skills/baoyu-post-to-x","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add JimLiu/baoyu-skills","source_repo":"https://github.com/JimLiu/baoyu-skills","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 16958 github stars · SKILL.md body (6,157 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-03T00:52:27.761Z","embedding":null,"createdAt":"2026-04-18T21:53:35.722Z","updatedAt":"2026-05-03T00:52:27.761Z","lastSeenAt":"2026-05-03T00:52:27.761Z","tsv":"'-60':515 '/baoyu-post-to-x/extend.md':201 '/baoyu-skills/baoyu-post-to-x/extend.md':208 '/bun/bun':318 '/chrome-profile':305 '/clip.mp4':477 '/cover.jpg':585 '/dev/null':698,707 '/photo.png':433 '/scripts':106 '/scripts/check-paste-permissions.ts':263 '/scripts/x-article.ts':577,582 '/scripts/x-browser.ts':430 '/scripts/x-quote.ts':529 '/scripts/x-video.ts':472 '/user/status/123':532 '000':403,413 '1':92,197 '10':402,412 '140s':509 '2':102,203,697,706,709 '280':418 '3':108,210 '30':514 '4':119,445 '60min':512 'access':269,325,331,353 'actual':117,641 'agent':89 'alert':651 'anti':33,72 'anti-autom':32 'anti-bot':71 'app':334 'articl':9,20,63,161,378,385,423,564,569,612 'article.md':578,583 'ask':38,729 'autom':34 'automat':626,715 'avail':130,339 'baoyu':2,199,303 'baoyu-post-to-x':1 'baoyu-skil':198,302 'basedir':101,105,111,262,429,471,528,576,581 'bash':259,426,468,525,573,689 'bot':73 'brew':313 'browser':69,292,453,497,553,610,747 'bun':121,125,127,133,137,229,260,268,311,324,427,469,526,574,579 'bypass':31,70 'cdp':29,684,722 'charact':404,414 'check':184,243,252,264,277,284,473,623,646 'chrome':27,68,222,226,265,273,286,288,293,308,448,492,548,662,672,683,692,721 'chromium':228,701 'claude.md':307 'cli':342 'clipboard':172,270,335 'command':727 'comment':156,524,542 'composit':622 'config':205 'configur':763 'conflict':274 'connect':680 'content':7,170,438,455,482,499,555,638,744 'convers':167 'copi':169,336 'count':643 'cover':584,592,593,600 'cross':755 'cross-platform':754 'custom':447,491,547,762 'debug':663,673,695,704 'default':218,221 'descript':436,480,537,588 'detail':376 'detect':74 'determin':93 'dir':298 'directori':76,98 'document':114 'done':714 'editor':637 'els':134 'enabl':332 'encount':717 'ensur':337 'env':295 'environ':180,251 'error':719 'execut':90 'exist':521,682 'expect':639 'explicit':394 'extend.md':183,185,219,765 'extens':760 'f':691,700 'fail':278,647,670 'file':96,420,442,467,486,590 'fill':456,500,556,613,743 'first':190,231,246,686,733 'fix':280,285,354 'flight':242 'form':23,62,160,384,567 'found':192,216 'front':605 'frontmatt':598 'g':323 'googl':225 'great':533 'guid':387 'guidanc':281 'hello':431 'home':206,213 'home/.baoyu-skills/baoyu-post-to-x/extend.md':211 'home/.config':207 'html':166 'imag':57,146,432,440,441,594,601,630,642 'images/videos':17 'import':77,710 'insert':632 'insight':534 'instal':126,136,287,314,322,347,359 'instanc':685,723 'instruct':91 'isol':267 'issu':657 'item':283 'keystrok':177,272,349,357 'kill':681,720 'limit':507 'linux':358,758 'locat':81 'log':233 'login':736 'long':22,61,159,383,566 'long-form':21,60,158,382,565 'maco':319,326,340,350,757 'manual':237,371,462,506,562,619,735,753 'markdown':24,163,165,419,568,589 'matter':606 'max':444,510 'md':421 'member':408 'mov':488 'mp4':487 'must':749 'non':416 'non-premium':415 'none':215 'note':450,494,550,607,732 'npm':321 'npx':129,131 'one':191 'open':452,496,552,609 'option':244,545,773 'order':188 'output':650 'oven':316 'oven-sh':315 'overrid':596 'paramet':434,435,478,479,535,536,586,587 'past':176,271,348,356 'path':99,104,118,195,294,770 'per':282 'permiss':181 'persist':739 'pkill':690,699 'placehold':635 'plain':399 'platform':756 'port':664,674,696,705 'posit':439,483,541,544,591 'post':3,6,15,40,51,55,144,149,367,388,397,406,425,437,464,481,621 'post-composit':620 'pre':241 'pre-flight':240 'prefer':182,258,767 'premium':407,417,511,572 'prerequisit':224 'prioriti':187,194 'privaci':329 'process':513 'profil':223,266,297,300,309,446,449,490,493,546,549 'project':202 'provid':279 'publish':44,162,386,461,505,561,618,660,752 'purpos':141 'quot':153,517,519,540 'readi':666,676 'real':26,67,175 'refer':139,365 'references/articles.md':380 'references/regular-posts.md':369 'regular':14,143,366,405,424,508 'remain':633 'remot':694,703 'remote-debugging-port':693,702 'repeat':443 'replac':109 'requir':570,737 'resolv':120 'retri':688,725 'review':459,503,559,616,750 'run':232,249,734 'runtim':123,230,312 'save':239 'scope':196 'script':75,79,84,103,138,140,451,495,551,608,625,669,741 'scripts/check-paste-permissions.ts':178 'scripts/copy-to-clipboard.ts':168 'scripts/md-to-html.ts':164 'scripts/paste-from-clipboard.ts':173 'scripts/x-article.ts':157 'scripts/x-browser.ts':142 'scripts/x-quote.ts':152 'scripts/x-video.ts':147 'section':310,768 'secur':330 'see':306,368,379,766 'select':346,390 'send':174 'session':238,738 'set':290,328 'sh':317 'share':48,299 'skill':88,200,304 'skill-baoyu-post-to-x' 'skill.md':95 'skip':255 'sleep':708 'source-jimliu' 'specif':656 'specifi':395 'subdirectori':85 'suggest':135,248 'support':13,220,409,602,761,772 'swift/appkit':338 'system':327 'technic':375 'termin':333 'text':56,145,150,400,465,543 'titl':595,597,599 'tool':343 'topic-agent-skills' 'topic-claude-skills' 'topic-codex-skills' 'topic-openclaw-skills' 'troubleshoot':373,661 'ts':107 'tweet':43,154,518,522 'twitter':12,46,54 'type':389,398 'unabl':678 'unless':391 'url':538 'use':25,35,217,247 'user':37,212,253,393,458,502,558,615,653,731,748 'var':296 'verifi':179,627 'via':66,764 'video':58,148,151,463,466,476,484,485 'vs':640 'warn':648 'wayland':364 'webm':489 'win':193 'window':759 'within':401 'without':728 'workflow':372 'x':5,11,19,42,50,53,65,122,236,261,291,377,422,428,470,527,563,571,575,580 'x.com':531 'x.com/user/status/123':530 'x11':361 'xcode':341,345 'xcode-select':344 'xdg':204,209 'xdotool':360 'ximgph':634 'y':132 'yaml':604 'ydotool':363","prices":[{"id":"0370d2fc-d0ba-4a93-9fb3-66eecf87a2c1","listingId":"1c44c05f-9bf8-4449-ae3e-da8b8224a9e0","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"JimLiu","category":"baoyu-skills","install_from":"skills.sh"},"createdAt":"2026-04-18T21:53:35.722Z"}],"sources":[{"listingId":"1c44c05f-9bf8-4449-ae3e-da8b8224a9e0","source":"github","sourceId":"JimLiu/baoyu-skills/baoyu-post-to-x","sourceUrl":"https://github.com/JimLiu/baoyu-skills/tree/main/skills/baoyu-post-to-x","isPrimary":false,"firstSeenAt":"2026-04-18T21:53:35.722Z","lastSeenAt":"2026-05-03T00:52:27.761Z"}],"details":{"listingId":"1c44c05f-9bf8-4449-ae3e-da8b8224a9e0","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"JimLiu","slug":"baoyu-post-to-x","github":{"repo":"JimLiu/baoyu-skills","stars":16958,"topics":["agent-skills","claude-skills","codex-skills","openclaw-skills"],"license":null,"html_url":"https://github.com/JimLiu/baoyu-skills","pushed_at":"2026-04-25T20:03:31Z","description":null,"skill_md_sha":"8c45457f5f4c9e352f3eca8e1bd7e31567e415c3","skill_md_path":"skills/baoyu-post-to-x/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/JimLiu/baoyu-skills/tree/main/skills/baoyu-post-to-x"},"layout":"multi","source":"github","category":"baoyu-skills","frontmatter":{"name":"baoyu-post-to-x","description":"Posts content and articles to X (Twitter). Supports regular posts with images/videos and X Articles (long-form Markdown). Uses real Chrome with CDP to bypass anti-automation. Use when user asks to \"post to X\", \"tweet\", \"publish to Twitter\", or \"share on X\"."},"skills_sh_url":"https://skills.sh/JimLiu/baoyu-skills/baoyu-post-to-x"},"updatedAt":"2026-05-03T00:52:27.761Z"}}