{"slug":"jimliu-baoyu-post-to-x-252140","title":"X \u63a8\u6587\u4e0e\u957f\u6587\u53d1\u5e03\uff08\u591a\u6a21\u5f0f\uff09","description":"\u901a\u8fc7\u771f\u5b9e Chrome \u4f1a\u8bdd\u628a\u6587\u5b57\u3001\u56fe\u7247\u3001\u89c6\u9891\u3001\u5f15\u7528\u63a8\u6587\u6216 Markdown \u957f\u6587\u586b\u5165 X \u7f16\u8f91\u5668\uff0c\u533a\u5206 Codex Chrome \u63d2\u4ef6\u3001Chrome Computer Use \u4e0e CDP \u811a\u672c\u4e09\u79cd\u6a21\u5f0f\uff0c\u5f3a\u5236\u53d1\u5e03\u524d\u7528\u6237\u786e\u8ba4\u3002\u542b\u5360\u4f4d\u7b26\u4e0e\u56fe\u7247\u6570\u91cf\u6821\u9a8c\uff0c\u4e0d\u81ea\u52a8\u63d0\u4ea4\u3002","category":"\u53d1\u5e03\u4e0e\u8fd0\u8425","tags":["JimLiu","\u5b9d\u7389","\u53d1\u5e03\u4e0e\u8fd0\u8425"],"author":"\u5b9d\u7389 \u00b7 JimLiu","source_url":"https://github.com/JimLiu/baoyu-skills/blob/0a27d7d40e79cfe42334e2e9130a1e41a499ca54/skills/baoyu-post-to-x/SKILL.md","license":"MIT","status":"published","verification":"source_reviewed","verification_notes":"\u5df2\u6838\u5bf9\u539f\u59cb\u4ed3\u5e93\u3001\u56fa\u5b9a\u63d0\u4ea4\u3001\u8bb8\u53ef\u3001\u6280\u80fd\u6b63\u6587\u4e0e\u5305\u7ed3\u6784\uff0c\u5e76\u8865\u5145\u4e2d\u6587\u6267\u884c\u9a8c\u6536\u8bf4\u660e\uff1b\u672a\u8fd0\u884c\u5305\u5185\u811a\u672c\u3002","revision":"f0d047af3e4d4adba461f08c0a483d67","created_at":"2026-11-02T14:47:08+00:00","updated_at":"2026-11-02T14:47:08+00:00","source_repo":"JimLiu/baoyu-skills","source_path":"skills/baoyu-post-to-x/SKILL.md","source_commit":"0a27d7d40e79cfe42334e2e9130a1e41a499ca54","source_updated_at":"2026-11-02T14:46:04+00:00","stars":0,"proxy_score":null,"score":null,"grade":null,"dimensions":{},"evaluation":{},"installs":0,"platforms":[],"formats":[],"category_slug":"publishing","category_name":"\u53d1\u5e03\u4e0e\u8fd0\u8425","quality":{"review_type":"text_and_package_review","readiness":"requires_setup","reviewed_at":"2026-11-02T14:46:04+00:00","review_summary":"\u6a21\u5f0f\u5212\u5206\u4e0e\u53d1\u5e03\u95e8\u7981\u5199\u5f97\u5177\u4f53\uff0c\u957f\u6587\u6709\u5360\u4f4d\u7b26\u6821\u9a8c\uff0c\u9002\u5408\u4f5c\u4e3a\u53d1\u5e03\u8f85\u52a9\uff1b\u4f46\u5f3a\u4f9d\u8d56\u5916\u90e8 Chrome \u63d2\u4ef6\u6280\u80fd\u4e0e CLAUDE.md \u8bf4\u660e\uff0c\u4e14\u9700\u7528\u6237\u81ea\u5907\u767b\u5f55\u6001\u4e0e\u6743\u9650\uff0c\u5c5e\u9700\u914d\u7f6e\u540e\u4f7f\u7528\u3002","cost_notes":"\u811a\u672c\u65e0\u4ed8\u8d39 API\uff1bX Premium \u4e3a\u5e73\u53f0\u8ba2\u9605\uff0c\u662f\u5426\u5177\u5907\u7531\u7528\u6237\u81ea\u884c\u786e\u8ba4\uff0c\u4e0d\u4ee3\u62a5\u4ef7\u3002","source_sha256":"e3854754a77fcea6a6d8f3798a1187f8f9be8cae5f7c9b8e6332ff5465547b49","prerequisites":["Google Chrome \u6216 Chromium\uff0c\u4e14\u7528\u6237\u5df2\u767b\u5f55 X","bun \u8fd0\u884c\u65f6\uff08\u6216 npx -y bun\uff09","\u6309\u6a21\u5f0f\u4e0d\u540c\uff1aCodex Chrome \u63d2\u4ef6\u53ca\u5176 Node REPL \u5ba2\u6237\u7aef\uff0c\u6216 Computer Use \u5de5\u5177\uff0c\u6216 CDP \u8c03\u8bd5\u7aef\u53e3","macOS \u9700\u6388\u4e88\u7ec8\u7aef\u8f85\u52a9\u529f\u80fd\u4e0e\u526a\u8d34\u677f\u6743\u9650\uff1bLinux \u9700 xdotool\uff08X11\uff09\u6216 ydotool\uff08Wayland\uff09","\u957f\u6587\u53d1\u5e03\u9700 X Premium \u8d26\u53f7"],"checks":["\u6267\u884c\u524d\u5df2\u660e\u786e\u9009\u5b9a\u4e00\u79cd\u6a21\u5f0f\uff0c\u4e14\u672a\u5728\u672a\u544a\u77e5\u7528\u6237\u7684\u60c5\u51b5\u4e0b\u5207\u6362\u6a21\u5f0f","\u4efb\u4f55\u63d0\u4ea4\u52a8\u4f5c\uff08Publish/Post/--submit\uff09\u524d\u5747\u6709\u7528\u6237\u5728\u5f53\u524d\u5bf9\u8bdd\u4e2d\u7684\u660e\u786e\u786e\u8ba4","\u957f\u6587\u6d41\u7a0b\u7ed3\u675f\u65f6 XIMGPH_ \u5360\u4f4d\u7b26\u8ba1\u6570\u4e3a 0\uff0c\u53ef\u89c1\u56fe\u7247\u6570\u4e0e contentImages \u6570\u91cf\u4e00\u81f4","\u666e\u901a\u5e16\u56fe\u7247\u4e0d\u8d85\u8fc7 4 \u5f20\uff0c\u89c6\u9891\u683c\u5f0f\u4e0e\u65f6\u957f\u7b26\u5408\u6240\u9009\u8d26\u53f7\u7b49\u7ea7\u9650\u5236","\u9884\u89c8\u9875\u4e2d\u6807\u9898\u3001\u5c01\u9762\u3001\u6b63\u6587\u3001\u94fe\u63a5\u4e0e\u56fe\u7247\u5747\u5df2\u4eba\u5de5\u6838\u5bf9"],"limitations":["\u4e09\u79cd\u6a21\u5f0f\u7684\u5b9e\u9645\u53ef\u7528\u6027\u53d6\u51b3\u4e8e\u7528\u6237\u73af\u5883\uff0c\u672c\u6b21\u5ba1\u9605\u672a\u8fd0\u884c\u4efb\u4f55\u811a\u672c\u6216\u6d4f\u89c8\u5668\u64cd\u4f5c","\u4f9d\u8d56 X \u7f51\u9875 DOM \u4e0e\u7f16\u8f91\u5668\u884c\u4e3a\uff0c\u5e73\u53f0\u6539\u7248\u53ef\u80fd\u5bfc\u81f4\u9009\u62e9\u5668\u6216\u4e0a\u4f20\u6d41\u7a0b\u5931\u6548","\u4e0d\u6821\u9a8c\u5185\u5bb9\u662f\u5426\u8fdd\u53cd X \u89c4\u5219\uff0c\u4e5f\u4e0d\u4fdd\u8bc1\u53d1\u5e03\u6210\u529f\u6216\u901a\u8fc7\u5ba1\u6838","\u63d2\u4ef6\u6a21\u5f0f\u7684\u6587\u4ef6\u4e0a\u4f20\u9700\u7528\u6237\u81ea\u884c\u5728 chrome://extensions \u5f00\u542f\u6587\u4ef6 URL \u8bbf\u95ee\u6743\u9650"],"issues":["SKILL.md \u5f15\u7528 CLAUDE.md \u7684 Chrome Profile \u7ae0\u8282\u4e0e chrome:Chrome \u6280\u80fd\uff0c\u4e8c\u8005\u5747\u672a\u968f\u5305\u63d0\u4f9b\uff0c\u5c5e\u5916\u90e8\u4f9d\u8d56\uff0c\u9700\u7528\u6237\u81ea\u5907","check-paste-permissions.ts \u7684\u68c0\u67e5\u9879\u4e0e\u5931\u8d25\u4fee\u590d\u8868\u8f83\u5b8c\u6574\uff0c\u4f46\u672a\u8bf4\u660e\u68c0\u67e5\u901a\u8fc7\u540e\u4ecd\u5931\u8d25\u65f6\u7684\u5224\u5b9a\u6807\u51c6","md-to-html.test.ts \u4e0e x-utils.test.ts \u5b58\u5728\u4f46\u672a\u8fd0\u884c\uff0c\u6d4b\u8bd5\u662f\u5426\u901a\u8fc7\u5f85\u6838\u5b9e"],"missing_files":[]},"quality_url":"https://shiliuai.cn/api/v2/skills/jimliu-baoyu-post-to-x-252140/files/SHILIU-QUALITY.md","usage_guide":{"task":"\u628a\u5df2\u5199\u597d\u7684\u63a8\u6587\u3001\u89c6\u9891\u5e16\u3001\u5f15\u7528\u63a8\u6587\u6216 Markdown \u957f\u6587\u586b\u5165 X \u7f51\u9875\u7f16\u8f91\u5668\uff0c\u6309\u7528\u6237\u6307\u5b9a\u7684\u6d4f\u89c8\u5668\u63a7\u5236\u6a21\u5f0f\u64cd\u4f5c\uff0c\u6700\u7ec8\u7531\u7528\u6237\u786e\u8ba4\u53d1\u5e03\u3002","inputs":"\u63a8\u6587\u6587\u672c\uff08\u666e\u901a\u8d26\u53f7 280 \u5b57\u7b26\uff0cPremium \u4e0a\u9650 10000\uff09\uff1b\u53ef\u9009\u56fe\u7247\uff08\u6700\u591a 4 \u5f20\uff09\u6216\u89c6\u9891\uff08MP4/MOV/WebM\uff09\uff1b\u5f15\u7528\u63a8\u6587\u9700\u76ee\u6807\u63a8\u6587 URL\uff1b\u957f\u6587\u9700 .md \u6587\u4ef6\u4e0e\u53ef\u9009\u5c01\u9762\u56fe\uff1b\u7528\u6237\u660e\u786e\u6307\u5b9a\u7684\u6267\u884c\u6a21\u5f0f\uff08\u63d2\u4ef6/Computer Use/CDP\uff09\uff1b\u5df2\u767b\u5f55 X \u7684 Chrome \u4f1a\u8bdd\uff1bbun \u6216 npx\u3002","outputs":"X \u7f16\u8f91\u5668\u4e2d\u5df2\u586b\u597d\u7684\u5185\u5bb9\uff1b\u957f\u6587\u573a\u666f\u4e0b\u7684\u5360\u4f4d\u7b26\u6b8b\u7559\u62a5\u544a\u4e0e\u671f\u671b/\u5b9e\u9645\u56fe\u7247\u6570\u5bf9\u6bd4\uff1b\u9884\u89c8\u68c0\u67e5\u7ed3\u8bba\uff1b\u7528\u6237\u786e\u8ba4\u540e\u7531\u7528\u6237\u70b9\u51fb\u53d1\u5e03\u4ea7\u751f\u7684\u5e16\u5b50\u3002","example_input":"\u7528 baoyu-post-to-x \u7684 Chrome Computer Use \u6a21\u5f0f\uff0c\u628a\u8fd9\u6bb5\u6587\u5b57\u548c ./img/a.png\u3001./img/b.png \u586b\u8fdb X \u53d1\u5e16\u6846\uff0c\u5148\u4e0d\u8981\u70b9 Post\uff0c\u7b49\u6211\u786e\u8ba4\u3002","example_output":"\uff08\u793a\u610f\uff0c\u975e\u771f\u5b9e\u8fd0\u884c\u7ed3\u679c\uff091) \u5df2\u5728\u73b0\u6709 Chrome \u7a97\u53e3\u6253\u5f00 x.com/compose/post \u5e76\u8f93\u5165\u6b63\u6587\uff1b2) \u4e24\u5f20\u56fe\u7247\u7ecf\u526a\u8d34\u677f\u7c98\u8d34\u4e0a\u4f20\u5b8c\u6210\uff1b3) \u672a\u70b9\u51fb Post\uff0c\u7b49\u5f85\u4f60\u786e\u8ba4\uff1b4) \u82e5\u4f60\u6539\u7528\u957f\u6587\u6a21\u5f0f\uff0c\u5c06\u5148\u8f93\u51fa XIMGPH_ \u5360\u4f4d\u7b26\u68c0\u67e5\u7ed3\u679c\u518d\u8bf7\u4f60\u9884\u89c8\u3002"},"read_url":"https://shiliuai.cn/api/v2/skills/jimliu-baoyu-post-to-x-252140","skill_url":"https://shiliuai.cn/api/v2/skills/jimliu-baoyu-post-to-x-252140/files/SKILL.md","download_url":"https://shiliuai.cn/api/v2/skills/jimliu-baoyu-post-to-x-252140/download","install_url":"https://shiliuai.cn/api/v2/skills/jimliu-baoyu-post-to-x-252140/install","files":[{"path":"LICENSE","bytes":1064,"url":"https://shiliuai.cn/api/v2/skills/jimliu-baoyu-post-to-x-252140/files/LICENSE"},{"path":"SHILIU-QUALITY.md","bytes":2350,"url":"https://shiliuai.cn/api/v2/skills/jimliu-baoyu-post-to-x-252140/files/SHILIU-QUALITY.md"},{"path":"SKILL.md","bytes":12682,"url":"https://shiliuai.cn/api/v2/skills/jimliu-baoyu-post-to-x-252140/files/SKILL.md"},{"path":"references/articles.md","bytes":5127,"url":"https://shiliuai.cn/api/v2/skills/jimliu-baoyu-post-to-x-252140/files/references/articles.md"},{"path":"references/regular-posts.md","bytes":2544,"url":"https://shiliuai.cn/api/v2/skills/jimliu-baoyu-post-to-x-252140/files/references/regular-posts.md"},{"path":"scripts/bun.lock","bytes":23955,"url":"https://shiliuai.cn/api/v2/skills/jimliu-baoyu-post-to-x-252140/files/scripts/bun.lock"},{"path":"scripts/check-paste-permissions.ts","bytes":8310,"url":"https://shiliuai.cn/api/v2/skills/jimliu-baoyu-post-to-x-252140/files/scripts/check-paste-permissions.ts"},{"path":"scripts/copy-to-clipboard.ts","bytes":12179,"url":"https://shiliuai.cn/api/v2/skills/jimliu-baoyu-post-to-x-252140/files/scripts/copy-to-clipboard.ts"},{"path":"scripts/md-to-html.test.ts","bytes":5619,"url":"https://shiliuai.cn/api/v2/skills/jimliu-baoyu-post-to-x-252140/files/scripts/md-to-html.test.ts"},{"path":"scripts/md-to-html.ts","bytes":13420,"url":"https://shiliuai.cn/api/v2/skills/jimliu-baoyu-post-to-x-252140/files/scripts/md-to-html.ts"},{"path":"scripts/package.json","bytes":379,"url":"https://shiliuai.cn/api/v2/skills/jimliu-baoyu-post-to-x-252140/files/scripts/package.json"},{"path":"scripts/paste-from-clipboard.ts","bytes":5659,"url":"https://shiliuai.cn/api/v2/skills/jimliu-baoyu-post-to-x-252140/files/scripts/paste-from-clipboard.ts"},{"path":"scripts/x-article.ts","bytes":31699,"url":"https://shiliuai.cn/api/v2/skills/jimliu-baoyu-post-to-x-252140/files/scripts/x-article.ts"},{"path":"scripts/x-browser.ts","bytes":9002,"url":"https://shiliuai.cn/api/v2/skills/jimliu-baoyu-post-to-x-252140/files/scripts/x-browser.ts"},{"path":"scripts/x-quote.ts","bytes":9112,"url":"https://shiliuai.cn/api/v2/skills/jimliu-baoyu-post-to-x-252140/files/scripts/x-quote.ts"},{"path":"scripts/x-utils.test.ts","bytes":1676,"url":"https://shiliuai.cn/api/v2/skills/jimliu-baoyu-post-to-x-252140/files/scripts/x-utils.test.ts"},{"path":"scripts/x-utils.ts","bytes":8817,"url":"https://shiliuai.cn/api/v2/skills/jimliu-baoyu-post-to-x-252140/files/scripts/x-utils.ts"},{"path":"scripts/x-video.ts","bytes":9536,"url":"https://shiliuai.cn/api/v2/skills/jimliu-baoyu-post-to-x-252140/files/scripts/x-video.ts"},{"path":"shiliu-quality.json","bytes":2197,"url":"https://shiliuai.cn/api/v2/skills/jimliu-baoyu-post-to-x-252140/files/shiliu-quality.json"},{"path":"shiliu-source.json","bytes":271,"url":"https://shiliuai.cn/api/v2/skills/jimliu-baoyu-post-to-x-252140/files/shiliu-source.json"},{"path":"usage.json","bytes":1191,"url":"https://shiliuai.cn/api/v2/skills/jimliu-baoyu-post-to-x-252140/files/usage.json"}],"content":"---\nname: baoyu-post-to-x\ndescription: Posts content and articles to X (Twitter). Supports regular posts with images/videos and X Articles (long-form Markdown). In Codex, honor explicit requests for the Codex Chrome plugin/@chrome by using the Chrome Extension workflow; otherwise use Chrome Computer Use when available and fall back to real Chrome CDP scripts only when allowed. Use when user asks to \"post to X\", \"tweet\", \"publish to Twitter\", or \"share on X\".\nversion: 1.58.1\nmetadata:\n  openclaw:\n    homepage: https://github.com/JimLiu/baoyu-skills#baoyu-post-to-x\n    requires:\n      anyBins:\n        - bun\n        - npx\n---\n\n# Post to X (Twitter)\n\nPosts text, images, videos, and long-form articles to X via a real Chrome browser.\n\nIn Codex, three distinct browser paths \u2014 do not conflate them:\n- **Codex Chrome plugin / `@chrome` / Chrome Extension**: the bundled `chrome:Chrome` skill and its Node REPL browser client. Required whenever the user says \"Codex Chrome plugin\", \"Codex \u81ea\u5e26\u7684 Chrome \u63d2\u4ef6\", `@chrome`, or similar.\n- **Chrome Computer Use**: `mcp__computer_use__.*` against the visible Google Chrome UI.\n- **CDP script mode**: the bundled scripts; fallback only.\n\n## Script Directory\n\n`{baseDir}` = this SKILL.md's directory; scripts are at `{baseDir}/scripts/<script-name>.ts`. Resolve `${BUN_X}`: `bun` if installed \u2192 else `npx -y bun` \u2192 else suggest installing bun.\n\n| Script | Purpose |\n|--------|---------|\n| `scripts/x-browser.ts` | Regular posts (text + images), CDP fallback |\n| `scripts/x-video.ts` | Video posts (text + video), CDP fallback |\n| `scripts/x-quote.ts` | Quote tweet with comment, CDP fallback |\n| `scripts/x-article.ts` | Long-form article publishing (Markdown), CDP fallback |\n| `scripts/md-to-html.ts` | Markdown \u2192 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## Execution Mode Selection (Required)\n\nChoose exactly one mode before interacting with X:\n\n1. User asks for the Codex Chrome plugin, `@chrome`, the Chrome extension, or \"Codex \u81ea\u5e26\u7684 Chrome \u63d2\u4ef6\" \u2192 **Codex Chrome Plugin Mode**. Do not call Computer Use first.\n2. User asks for Chrome Computer Use \u2192 **Chrome Computer Use Mode**. Do not fall back to CDP, Playwright, the in-app Browser, or the Chrome plugin without telling the user and getting approval.\n3. User asks for CDP/script mode \u2192 **CDP Script Mode**.\n4. Otherwise prefer **Chrome Computer Use Mode** (if available). For Markdown X Articles with local content images, use the toolbar image flow (`Insert` \u2192 `Media` \u2192 `Add photos or video`) in \"X Articles (UI Modes)\". Use CDP Script Mode only when the selected browser-control mode is unavailable or the UI upload/selection flow is unreliable.\n\nNever use the in-app Browser for X publishing. Never switch away from an explicitly requested mode without explaining the blocker and getting approval.\n\n**Publish gate (all modes)**: never click `Publish`, `Post`, or any externally visible submit action, and never pass `--submit`, without explicit final confirmation from the user in the current conversation.\n\nIn Codex Chrome Plugin Mode and Chrome Computer Use Mode, use the user's existing Chrome session (profile, cookies, X login); do not launch a separate CDP profile.\n\n## Preferences (EXTEND.md)\n\nFirst 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\nNone found \u2192 use defaults. Supported: default Chrome profile.\n\n## Prerequisites\n\nGoogle Chrome or Chromium; `bun`. First run: user logs in to X manually (session persists). Works on macOS, Linux, Windows.\n\n## Pre-flight Check (Optional)\n\nBefore first use, suggest (user can skip):\n\n```bash\n${BUN_X} {baseDir}/scripts/check-paste-permissions.ts\n```\n\n| Check fails | 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 \u2192 Privacy & Security \u2192 Accessibility \u2192 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## Post Type Selection\n\nUnless the user specifies:\n- **Plain text** within 10,000 characters \u2192 **Regular Post** (Premium: up to 10,000 characters; non-Premium: 280)\n- **Markdown file** (.md) \u2192 **X Article** (requires X Premium)\n\n---\n\n## Codex Chrome Plugin Mode\n\nUses the user's real Chrome profile and X login through the bundled Chrome plugin \u2014 not Computer Use, not CDP.\n\n**Setup**\n1. Load the `chrome:Chrome` skill before browser work.\n2. Use `tool_search` for `node_repl js` if the Node REPL `js` tool is not visible.\n3. Initialize the browser client exactly as the Chrome skill specifies, then verify the extension with a lightweight call such as `browser.user.openTabs()`.\n4. If that fails, wait 2 seconds and retry once; then follow the Chrome skill's extension checks and recovery steps. If checks pass but communication still fails, ask the user before opening a new Chrome window. Do not switch to Computer Use or CDP silently.\n\n**Rules**\n- Use the plugin's `browser.tabs.*`, `tab.playwright.*`, `tab.cua.*`, and file chooser APIs for X UI actions.\n- Shell commands are allowed for Markdown preprocessing and rich-HTML clipboard preparation. For X Article body images, do not rely on image clipboard paste; use the `Insert` \u2192 `Media` upload flow.\n- Upload fails with `Not allowed` \u2192 tell the user: `To enable file upload, go to chrome://extensions in Chrome, click Details under the Codex extension, and enable \"Allow access to file URLs.\" See https://developers.openai.com/codex/app/chrome-extension#upload-files for details.`\n- `native pipe is closed` \u2192 retry the lightweight browser call once after 2 seconds, then run the Chrome skill health checks. If Chrome is running, the extension is enabled, and the native host manifest is correct, ask permission to open a new Chrome window and retry. Do not keep sending actions through the broken pipe.\n\n## Chrome Computer Use Mode\n\nUses the user's existing Chrome window, cookies, login, extensions, and X session.\n\n**Rules**\n- Start each assistant turn that controls Chrome by calling `get_app_state` for `Google Chrome`.\n- Prefer element-index actions; use coordinates only for editor text selection or drag selection.\n- Do not use the in-app Browser, the Chrome plugin, Playwright, or CDP for X UI actions in this mode unless the user approves a mode change.\n- If selection, toolbar upload, or file-picker control becomes unreliable, stop and report the blocker instead of switching to the Chrome plugin or CDP silently.\n\n**Regular posts**\n1. Open `https://x.com/compose/post`; type the post text into the composer.\n2. For each image: `${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts image /absolute/path/to/image.png`, then paste (`super+v` macOS, `control+v` Windows/Linux) and wait until X finishes uploading.\n3. Ask for confirmation before clicking `Post`.\n\n**Video posts**: open `https://x.com/compose/post` \u2192 type text \u2192 attach the video via the visible media upload/file picker UI \u2192 wait for upload and processing \u2192 ask before clicking `Post`.\n\n**Quote tweets**: open the tweet URL \u2192 choose Quote in the visible quote/repost UI \u2192 type the comment \u2192 ask before clicking `Post`.\n\n## X Articles (UI Modes)\n\nShared by Codex Chrome Plugin Mode and Chrome Computer Use Mode. Paste keys: plugin `Meta+V` (macOS) / `Control+V`; Computer Use `super+v` (macOS) / `control+v`. File upload: plugin file chooser API; Computer Use native file picker.\n\n1. Convert Markdown and keep the image map:\n   ```bash\n   ${BUN_X} {baseDir}/scripts/md-to-html.ts article.md --save-html /tmp/x-article-body.html > /tmp/x-article.json\n   ```\n2. Read the JSON for `title`, `coverImage`, and `contentImages` (`placeholder` \u2192 `localPath`).\n3. Open `https://x.com/compose/articles`; click create/write if needed, or open the target draft.\n4. Upload the cover if present. Plugin: if blocked by extension permissions (`Not allowed`), stop and report the permission fix above. Computer Use: if the file picker can't be operated reliably, stop and ask rather than switching to CDP silently.\n5. Fill the title, then copy rich HTML:\n   ```bash\n   ${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts html --file /tmp/x-article-body.html\n   ```\n6. Click the article body and paste with a real paste keystroke.\n7. Plugin only: verify the body appeared and contains `XIMGPH_` placeholders. Don't trust `tab.clipboard.readText()` as proof of the system clipboard after shell writes; on macOS verify with `pbpaste` if needed.\n8. For each `contentImages` item, in placeholder order:\n   - Click the exact visible placeholder text (`XIMGPH_N`) to set the insertion point.\n   - Toolbar `Insert` \u2192 `Media`; in the modal click the icon button `aria-label=\"Add photos or video\"` \u2014 not the \"Choose a file or drag it here\" text/dropzone or the hidden file input.\n   - Upload that image's `localPath`; wait until the image block appears and upload activity finishes.\n   - If `XIMGPH_N` remains above the image, select exactly that placeholder and press `Delete` first; use `Backspace` only if `Delete` fails and the selected text is confirmed to be exactly the placeholder.\n   - Verify that placeholder's count is `0` before continuing.\n9. Verify no `XIMGPH_` remains and the expected number of images is visible; open Preview and check title, cover, body, links, and images.\n10. Ask for explicit confirmation before clicking `Publish`.\n\nMore (frontmatter, md-to-html output, formatting, troubleshooting): `references/articles.md`.\n\n---\n\n## CDP Script Mode (Fallback)\n\nUse only when the selected browser-control mode is unavailable or unreliable, or the user asks for CDP. If the user explicitly required the Codex Chrome plugin or Chrome Computer Use, use CDP only after explaining the blocker and getting approval.\n\nScripts launch or reuse a real Chrome via CDP, fill the content, and leave the browser open \u2014 the user reviews and publishes manually (`x-article.ts` publishes only with `--submit`, see Publish gate).\n\n### Regular Posts\n\n```bash\n${BUN_X} {baseDir}/scripts/x-browser.ts \"Hello!\" --image ./photo.png\n```\n\n| Parameter | Description |\n|-----------|-------------|\n| `<text>` | Post content (positional) |\n| `--image <path>` | Image file (repeatable, max 4) |\n| `--profile <dir>` | Custom Chrome profile |\n\nManual clipboard/paste steps, troubleshooting, internals: `references/regular-posts.md`.\n\n### Video Posts\n\n```bash\n${BUN_X} {baseDir}/scripts/x-video.ts \"Check this out!\" --video ./clip.mp4\n```\n\n| Parameter | Description |\n|-----------|-------------|\n| `<text>` | Post content (positional) |\n| `--video <path>` | Video file (MP4, MOV, WebM) |\n| `--profile <dir>` | Custom Chrome profile |\n\nLimits: regular 140s max, Premium 60min. Processing: 30-60s.\n\n### Quote Tweets\n\n```bash\n${BUN_X} {baseDir}/scripts/x-quote.ts https://x.com/user/status/123 \"Great insight!\"\n```\n\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### X Articles\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| Parameter | Description |\n|-----------|-------------|\n| `<markdown>` | Markdown file (positional) |\n| `--cover <path>` | Cover image |\n| `--title <text>` | Override title |\n\nFrontmatter: `title`, `cover_image`.\n\n**Post-composition check**: the script then reports remaining `XIMGPH_` placeholders and expected vs actual image count. If it prints warnings, tell the user the specific issues before they publish.\n\n### Troubleshooting\n\n**`Chrome debug port not ready` / `Unable to connect`** (CDP only): automatically, without asking, kill existing Chrome CDP instances and 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## Extension Support\n\nCustom configuration via EXTEND.md \u2014 see Preferences.\n","usage":"\u8bfb\u53d6 SKILL.md\uff0c\u5e76\u6309\u9700\u8bfb\u53d6\u914d\u5957\u6587\u4ef6\uff1b\u4e0b\u8f7d ZIP \u83b7\u53d6\u5b8c\u6574\u5305\u3002\u6280\u80fd\u662f\u4efb\u52a1\u65b9\u6cd5\uff0c\u4e0d\u6388\u4e88\u65b0\u589e\u8d26\u6237\u3001\u4ed8\u8d39\u6216\u7cfb\u7edf\u6743\u9650\u3002"}
