.fyi
SkillsMCPPluginsSubagents

Browse by category

DevOps & CI/CD SkillsProductivity & Workflow SkillsOther SkillsProduct & Project Management SkillsDocumentation & Knowledge SkillsCode Review & Refactor SkillsBackend & APIs SkillsAgent Meta & Communication SkillsResearch SkillsSecurity SkillsUX UI & Design SkillsTesting & QA SkillsSee all →

Every Claude Code skill, MCP server, plugin and subagent in one directory. Searchable, comparable, and one command from installed. Live stats from GitHub, npm and PyPI.

We're on Product HuntYour agent's app storeCheck it out →
Agent SkillsMCP ServersPluginsSubagentsCoding Agents
CollectionsOfficial publishersGlossaryFAQBlogSearchSavedFeedback
PrivacyTermsllms.txtSitemap

made with ♥ · © 2026 aaaa.fyi

Independent project · real data from public registries

…/baoyu-skills/baoyu-post-to-x
home/skills/jimliu/baoyu-skills/baoyu-post-to-x
jimliu avatar

baoyu-post-to-x

byjimliu· 68 skills

Installs

27k

Stars

24k

Forks

2.7k

Category

Marketing & SEO

View on GitHub

TL;DR

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".

How to install baoyu-post-to-x?

jimliu/baoyu-skills/baoyu-post-to-x
$npx -y skills add jimliu/baoyu-skills --skill baoyu-post-to-x

Installs into the current project.

›Prefer a prompt? Paste this to your agent

Use this skill

Run `npx skills use "https://github.com/jimliu/baoyu-skills" --skill "jimliu/baoyu-skills/baoyu-post-to-x"` and follow the generated skill instructions now. Read its complete output, redirecting it to a temporary file first if necessary. Resolve relative paths from the supporting-files directory it provides.

Use the whole pack

Use the skills in "https://github.com/jimliu/baoyu-skills" that are relevant to the current task. Run `npx skills add "https://github.com/jimliu/baoyu-skills"` and select the relevant skills, then follow their instructions.

Files · 1

View on GitHub
SKILL.md
1# Post to X (Twitter)
2 
3Posts text, images, videos, and long-form articles to X via a real Chrome browser.
4 
5In Codex, do not conflate these browser paths:
6- **Codex Chrome plugin / `@chrome` / Chrome Extension**: use the bundled `chrome:Chrome` skill and its Node REPL browser client. This is required whenever the user says "Codex Chrome plugin", "Codex 自带的 Chrome 插件", `@chrome`, or similar.
7- **Chrome Computer Use**: use `mcp__computer_use__.*` against the visible Google Chrome UI only when the user asks for Computer Use or no Chrome-plugin preference is stated and Computer Use is available.
8- **CDP script mode**: use only as a fallback when the selected mode is unavailable or the user explicitly asks for CDP/script mode.
9 
10## Script Directory
11 
12**Important**: All scripts are located in the `scripts/` subdirectory of this skill.
13 
14**Agent Execution Instructions**:
151. Determine this SKILL.md file's directory path as `{baseDir}`
162. Script path = `{baseDir}/scripts/<script-name>.ts`
173. Replace all `{baseDir}` in this document with the actual path
184. Resolve `${BUN_X}` runtime: if `bun` installed → `bun`; if `npx` available → `npx -y bun`; else suggest installing bun
19 
20**Script Reference**:
21| Script | Purpose |
22|--------|---------|
23| `scripts/x-browser.ts` | Regular posts (text + images), CDP fallback |
24| `scripts/x-video.ts` | Video posts (text + video), CDP fallback |
25| `scripts/x-quote.ts` | Quote tweet with comment, CDP fallback |
26| `scripts/x-article.ts` | Long-form article publishing (Markdown), CDP fallback |
27| `scripts/md-to-html.ts` | Markdown → HTML conversion |
28| `scripts/copy-to-clipboard.ts` | Copy content to clipboard |
29| `scripts/paste-from-clipboard.ts` | Send real paste keystroke |
30| `scripts/check-paste-permissions.ts` | Verify environment & permissions |
31 
32## Execution Mode Selection (Required)
33 
34Choose exactly one mode before interacting with X:
35 
361. If the user explicitly asks for the Codex Chrome plugin, `@chrome`, the Chrome extension, or "Codex 自带的 Chrome 插件", use **Codex Chrome Plugin Mode**. Do not call Computer Use first.
372. If the user explicitly asks for Chrome Computer Use, use **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.
383. If the user explicitly asks for CDP/script mode, use **CDP Script Mode**.
394. Otherwise, prefer **Chrome Computer Use Mode**. For Markdown **X Articles with local content images**, use the tested X editor flow: insert each body image from the toolbar (`Insert` -> `Media` -> dialog icon button `Add photos or video`) at its placeholder, then delete the placeholder text. Use CDP Script Mode only when the selected browser-control mode is unavailable or the UI upload/selection flow is unreliable.
40 
41Never use the in-app Browser for X publishing workflows.
42 
43## Codex Chrome Plugin Mode
44 
45Use this mode whenever the user requests the Codex Chrome plugin, `@chrome`, or the Chrome Extension path. This uses the user's real Chrome profile and X login through the bundled Chrome plugin, not Computer Use and not CDP.
46 
47**Setup**
481. Load the `chrome:Chrome` skill before browser work.
492. Use `tool_search` for `node_repl js` if the Node REPL `js` tool is not already visible.
503. Initialize the Chrome browser client exactly as the Chrome skill specifies, then run a lightweight call such as `browser.user.openTabs()` to verify the extension connection.
514. If the first lightweight call fails, wait 2 seconds and retry once. If it still fails, 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.
52 
53**General rules**
54- Use the Chrome plugin's `browser.tabs.*`, `tab.playwright.*`, `tab.cua.*`, and file chooser APIs for X UI actions.
55- 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 editor's `Insert` -> `Media` upload flow.
56- If a file upload fails with `Not allowed`, 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.`
57- If the Chrome plugin reports `native pipe is closed`, 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 browser actions through the broken pipe.
58- Never click `Publish`, `Post`, or any externally visible submit action without explicit final confirmation from the user in the current conversation.
59 
60**X Articles**
611. Convert Markdown and keep the image map:
62 ```bash
63 ${BUN_X} {baseDir}/scripts/md-to-html.ts article.md --save-html /tmp/x-article-body.html > /tmp/x-article.json
64 ```
652. Read the JSON output for `title`, `coverImage`, and `contentImages` (`placeholder` → `localPath`).
663. Open or create the article draft at `https://x.com/compose/articles`.
674. Upload the cover with the Chrome plugin file chooser flow. If upload is blocked by extension permissions, stop and report the exact permission fix above.
685. Fill the title, then copy rich HTML:
69 ```bash
70 ${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts html --file /tmp/x-article-body.html
71 ```
726. Paste into the article body with a real paste keystroke through the Chrome plugin. On macOS use `Meta+V`.
737. Verify the editor text contains the article body and `XIMGPH_` placeholders. Do not rely on `tab.clipboard.readText()` as proof of the system clipboard after shell clipboard writes; on macOS verify with `pbpaste` if needed.
748. For each `contentImages` item in placeholder order:
75 - Locate the visible placeholder text (`XIMGPH_N`) and click it to place the caret there.
76 - Open the toolbar menu `Insert` -> `Media`.
77 - In the modal, click the icon button with `aria-label="Add photos or video"`; do not click the text/dropzone or hidden file input.
78 - Use the file chooser to upload that image's `localPath`.
79 - After the image appears, if `XIMGPH_N` remains above it, 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.
80 - Verify the placeholder count for that `XIMGPH_N` is `0`.
819. Open Preview and verify title, cover, body, links, and images.
8210. Ask for explicit confirmation before clicking `Publish`.
83 
84## Preferences (EXTEND.md)
85 
86Check EXTEND.md in priority order — the first one found wins:
87 
88| Priority | Path | Scope |
89|----------|------|-------|
90| 1 | `.baoyu-skills/baoyu-post-to-x/EXTEND.md` | Project |
91| 2 | `${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-post-to-x/EXTEND.md` | XDG |
92| 3 | `$HOME/.baoyu-skills/baoyu-post-to-x/EXTEND.md` | User home |
93 
94If none found, use defaults.
95 
96**EXTEND.md supports**: Default Chrome profile
97 
98## Prerequisites
99 
100- Google Chrome or Chromium
101- `bun` runtime
102- First run: log in to X manually (session saved)
103 
104## Pre-flight Check (Optional)
105 
106Before first use, suggest running the environment check. User can skip if they prefer.
107 
108```bash
109${BUN_X} {baseDir}/scripts/check-paste-permissions.ts
110```
111 
112Checks: Chrome, profile isolation, Bun, Accessibility, clipboard, paste keystroke, Chrome conflicts.
113 
114**If any check fails**, provide fix guidance per item:
115 
116| Check | Fix |
117|-------|-----|
118| Chrome | Install Chrome or set `X_BROWSER_CHROME_PATH` env var |
119| Profile dir | Shared profile at `baoyu-skills/chrome-profile` (see CLAUDE.md Chrome Profile section) |
120| Bun runtime | `brew install oven-sh/bun/bun` (macOS) or `npm install -g bun` |
121| Accessibility (macOS) | System Settings → Privacy & Security → Accessibility → enable terminal app |
122| Clipboard copy | Ensure Swift/AppKit available (macOS Xcode CLI tools: `xcode-select --install`) |
123| Paste keystroke (macOS) | Same as Accessibility fix above |
124| Paste keystroke (Linux) | Install `xdotool` (X11) or `ydotool` (Wayland) |
125 
126## References
127 
128- **Regular Posts**: See `references/regular-posts.md` for manual workflow, troubleshooting, and technical details
129- **X Articles**: See `references/articles.md` for long-form article publishing guide
130 
131---
132 
133## Chrome Computer Use Mode
134 
135Use this mode when the user explicitly asks for Chrome Computer Use, or when no Chrome-plugin preference is stated and Codex can control `Google Chrome` with Computer Use. This uses the user's existing Chrome window, cookies, login, extensions, and X session.
136 
137**General rules**:
138- Start each assistant turn that controls Chrome by calling `get_app_state` for `Google Chrome`.
139- Prefer element-index actions when available; use coordinates only for editor text selection or drag selection.
140- 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.
141- Never click `Publish`, `Post`, or any externally visible submit action without an explicit final confirmation from the user in the current conversation.
142 
143**Regular posts**:
1441. Open or navigate Chrome to `https://x.com/compose/post`.
1452. Type the post text into the composer using Computer Use.
1463. For each image, run:
147 ```bash
148 ${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts image /absolute/path/to/image.png
149 ```
1504. Paste with Computer Use (`super+v` on macOS, `control+v` on Windows/Linux), then wait until X finishes uploading media.
1515. Ask for confirmation before clicking `Post`.
152 
153**Video posts**:
1541. Open or navigate Chrome to `https://x.com/compose/post`.
1552. Type the post text into the composer.
1563. Use the visible media upload/file picker UI to attach the video.
1574. Wait for upload and processing to complete.
1585. Ask for confirmation before clicking `Post`.
159 
160**Quote tweets**:
1611. Open the tweet URL in Chrome.
1622. Use the visible quote/repost UI to choose Quote.
1633. Type the comment.
1644. Ask for confirmation before clicking `Post`.
165 
166**X Articles**:
1671. Convert Markdown and keep the image map:
168 ```bash
169 ${BUN_X} {baseDir}/scripts/md-to-html.ts article.md --save-html /tmp/x-article-body.html > /tmp/x-article.json
170 ```
1712. Read the JSON output for `title`, `coverImage`, and `contentImages` (`placeholder` → `localPath`).
1723. In Chrome, open `https://x.com/compose/articles`, create or open the draft, upload the cover if present, and fill the title.
1734. Copy rich HTML to the clipboard:
174 ```bash
175 ${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts html --file /tmp/x-article-body.html
176 ```
1775. Paste into the article body with Computer Use.
1786. For each `contentImages` entry in placeholder order:
179 - Locate the exact visible placeholder text such as `XIMGPH_3` and click it to set the insertion point.
180 - Open the toolbar `Insert` dropdown, choose `Media`, then click the modal's icon button labeled `Add photos or video`.
181 - Use the native file picker to choose the image's `localPath`.
182 - Wait until the image block appears and any upload activity is finished.
183 - If the placeholder remains above the inserted image, reselect exactly that placeholder text and press `Delete` first. Use `Backspace` only if `Delete` fails and the selected text is confirmed to be exactly the placeholder.
1847. Verify no `XIMGPH_` placeholders remain and the expected images appear.
1858. Open Preview and verify title, cover, body, links, and images.
1869. Ask for explicit confirmation before clicking `Publish`.
187 
188If Computer Use selection, toolbar upload, or file-picker control becomes unreliable, stop and report the blocker instead of switching to the Chrome plugin or CDP silently.
189 
190---
191 
192## CDP Script Mode (Fallback)
193 
194Use the script sections below only when the selected browser-control mode is unavailable, unreliable, or explicitly not requested. These scripts launch or reuse a real Chrome instance via CDP and keep the browser open for review.
195 
196Do not use CDP Script Mode when the user explicitly requires the Codex Chrome plugin or Chrome Computer Use unless the user approves the fallback after you explain the blocker.
197 
198---
199 
200## Post Type Selection
201 
202Unless the user explicitly specifies the post type:
203- **Plain text** + within 10,000 characters → **Regular Post** (Premium members support up to 10,000 characters, non-Premium: 280)
204- **Markdown file** (.md) → **X Article**
205 
206## Regular Posts
207 
208```bash
209${BUN_X} {baseDir}/scripts/x-browser.ts "Hello!" --image ./photo.png
210```
211 
212**Parameters**:
213| Parameter | Description |
214|-----------|-------------|
215| `<text>` | Post content (positional) |
216| `--image <path>` | Image file (repeatable, max 4) |
217| `--profile <dir>` | Custom Chrome profile |
218 
219**Note**: Script opens browser with content filled in. User reviews and publishes manually.
220 
221**Codex mode note**: If the user explicitly requested the Codex Chrome plugin, use **Codex Chrome Plugin Mode**. Otherwise, if Chrome Computer Use is enabled, use **Chrome Computer Use Mode** instead of running `x-browser.ts`.
222 
223---
224 
225## Video Posts
226 
227Text + video file.
228 
229```bash
230${BUN_X} {baseDir}/scripts/x-video.ts "Check this out!" --video ./clip.mp4
231```
232 
233**Parameters**:
234| Parameter | Description |
235|-----------|-------------|
236| `<text>` | Post content (positional) |
237| `--video <path>` | Video file (MP4, MOV, WebM) |
238| `--profile <dir>` | Custom Chrome profile |
239 
240**Note**: Script opens browser with content filled in. User reviews and publishes manually.
241 
242**Codex mode note**: If the user explicitly requested the Codex Chrome plugin, use **Codex Chrome Plugin Mode**. Otherwise, if Chrome Computer Use is enabled, use **Chrome Computer Use Mode** instead of running `x-video.ts`.
243 
244**Limits**: Regular 140s max, Premium 60min. Processing: 30-60s.
245 
246---
247 
248## Quote Tweets
249 
250Quote an existing tweet with comment.
251 
252```bash
253${BUN_X} {baseDir}/scripts/x-quote.ts https://x.com/user/status/123 "Great insight!"
254```
255 
256**Parameters**:
257| Parameter | Description |
258|-----------|-------------|
259| `<tweet-url>` | URL to quote (positional) |
260| `<comment>` | Comment text (positional, optional) |
261| `--profile <dir>` | Custom Chrome profile |
262 
263**Note**: Script opens browser with content filled in. User reviews and publishes manually.
264 
265**Codex mode note**: If the user explicitly requested the Codex Chrome plugin, use **Codex Chrome Plugin Mode**. Otherwise, if Chrome Computer Use is enabled, use **Chrome Computer Use Mode** instead of running `x-quote.ts`.
266 
267---
268 
269## X Articles
270 
271Long-form Markdown articles (requires X Premium).
272 
273```bash
274${BUN_X} {baseDir}/scripts/x-article.ts article.md
275${BUN_X} {baseDir}/scripts/x-article.ts article.md --cover ./cover.jpg
276```
277 
278**Parameters**:
279| Parameter | Description |
280|-----------|-------------|
281| `<markdown>` | Markdown file (positional) |
282| `--cover <path>` | Cover image |
283| `--title <text>` | Override title |
284 
285**Frontmatter**: `title`, `cover_image` supported in YAML front matter.
286 
287**Codex mode note**: If the user explicitly requested the Codex Chrome plugin, follow **Codex Chrome Plugin Mode** above. If the user explicitly requested Chrome Computer Use, follow **Chrome Computer Use Mode**. Otherwise, prefer Chrome Computer Use; for Markdown articles with local content images, use the toolbar `Insert` -> `Media` image-upload workflow before falling back to `x-article.ts` in **CDP Script Mode**.
288 
289**CDP fallback note**: The script opens browser with article filled in. User reviews and publishes manually unless `--submit` is used.
290 
291**Publish safety**: Do not use `--submit` or click `Publish` unless the user explicitly confirms the final public publish action.
292 
293**Post-Composition Check**: The script automatically verifies after all images are inserted:
294- Remaining `XIMGPH_` placeholders in editor content
295- Expected vs actual image count
296 
297If the check fails (warnings in output), alert the user with the specific issues before they publish.
298 
299---
300 
301## Troubleshooting
302 
303### Chrome debug port not ready
304 
305CDP fallback only: if a script fails with `Chrome debug port not ready` or `Unable to connect`, kill existing Chrome CDP instances first, then retry:
306 
307```bash
308pkill -f "Chrome.*remote-debugging-port" 2>/dev/null; pkill -f "Chromium.*remote-debugging-port" 2>/dev/null; sleep 2
309```
310 
311**Important**: This should be done automatically — when encountering this error, kill Chrome CDP instances and retry the command without asking the user.
312 
313## Notes
314 
315- First run: manual login required (session persists)
316- In Codex Chrome Plugin Mode and Chrome Computer Use Mode, use the user's existing Chrome session and do not launch a separate CDP profile
317- CDP scripts only fill content into the browser by default; user must review and publish manually unless `--submit` is explicitly used
318- Cross-platform: macOS, Linux, Windows
319 
320## Extension Support
321 
322Custom configurations via EXTEND.md. See **Preferences** section for paths and supported options.

Security

Review

  • Gen Agent Trust Hubpass
  • Socketwarn
  • Snykpass
  • Runlayerpass
  • ZeroLeakspass

Preview

jimliu/baoyu-skillsjimliu/baoyu-skills

$ npx -y skills add jimliu/baoyu-skills --skill baoyu-post-to-x

▸ installing to .claude/skills…

✓ baoyu-post-to-x ready

Repojimliu/baoyu-skills
TypeSkills
CategoryMarketing & SEO
ForContent CreatorMarketer
UpdatedJul 2026
License—
First seenJul 26, 2026

Tags

Skill

Related

6 picks
Type
  1. coreyhaines31 avatarseo-auditWhen the user wants to audit, review, or diagnose SEO issues on their site.SkillsJul 2026173k42k
  2. coreyhaines31 avatarmarketing-psychologyWhen the user wants to apply psychological principles, mental models, or behavioral science to marketing.SkillsJul 2026119k42k
  3. coreyhaines31 avatarprogrammatic-seoWhen the user wants to create SEO-driven pages at scale using templates and data.SkillsJul 2026110k42k
  4. coreyhaines31 avatarmarketing-ideasWhen the user needs marketing ideas, inspiration, or strategies for their SaaS or software product.SkillsJul 2026107k42k
  5. coreyhaines31 avatarai-seoWhen the user wants to optimize content for AI search engines, get cited by LLMs, or appear in AI-generated answers.SkillsJul 202699k42k
  6. coreyhaines31 avatarad-creativeWhen the user wants to generate, iterate, or scale ad creative — headlines, descriptions, primary text, or full ad variations — for any paid advertising…SkillsJul 202689k42k