
Baoyu Post To X
Publish a long-form Markdown article into the X Articles rich-text editor with images without hand-formatting in the browser.
Overview
baoyu-post-to-x is an agent skill for the Launch phase that publishes Markdown articles to the X Articles editor using Chrome-based automation and rich-text clipboard paste.
Install
npx skills add https://github.com/jimliu/baoyu-skills --skill baoyu-post-to-xWhat is this skill?
- Three explicit browser modes: Codex Chrome Plugin workflow, Computer Use workflow, and CDP Script workflow—never the in-
- Markdown → HTML via bun script with saved body HTML and JSON image map for the paste step
- Rich-text clipboard copy script so the agent pastes formatted content into the X Articles editor
- Mode selection rules: honor @chrome / Codex Chrome wording first; Computer Use when available; CDP fallback when blocked
- Hard prerequisites: X Premium (Articles), Google Chrome, and bun installed
- Three browser-control workflows: Codex Chrome Plugin, Computer Use, and CDP Script
- Scripts: md-to-html.ts and copy-to-clipboard.ts run via bun
Adoption & trust: 21.8k installs on skills.sh; 20.9k GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You have a finished Markdown article but X Articles expects rich text and images in the browser, so manual reformatting and upload steps eat your launch time.
Who is it for?
Solo builders with X Premium who draft in Markdown and use Codex or similar agents with Chrome extension or Computer Use access.
Skip if: Teams without X Premium, users who only need short tweets or threads, or environments where Chrome/bun cannot be used and no approved fallback mode is acceptable.
When should I use this skill?
User wants to publish a Markdown file to X Articles and may specify Codex Chrome plugin, Computer Use, or CDP/script mode.
What do I get? / Deliverables
You get generated HTML, an image map, and clipboard-ready rich text so the article can be pasted into X Articles after following the chosen Chrome workflow end to end.
- Saved HTML article body and JSON metadata from md-to-html
- Clipboard HTML ready to paste into the X Articles editor
Recommended Skills
Journey fit
Canonical shelf is Launch because the skill’s outcome is publishing and distributing written content on X, not building the product itself. Distribution matches posting finished articles to a social channel as part of go-to-market and audience reach.
How it compares
A guided browser publishing workflow for long-form X Articles—not a generic social scheduler MCP or a Markdown-to-static-site generator.
Common Questions / FAQ
Who is baoyu-post-to-x for?
Indie builders and marketers who write in Markdown, have X Premium for Articles, and want an agent to handle HTML conversion and browser paste steps instead of redoing formatting manually.
When should I use baoyu-post-to-x?
Use it in Launch (distribution) when a long article is ready to go live on X Articles; use the Codex Chrome path when you explicitly want the Chrome plugin, Computer Use when that is available, or CDP when scripts are requested or other modes are blocked.
Is baoyu-post-to-x safe to install?
It drives real browser sessions against X and runs local bun scripts on your article files—review the Security Audits panel on this page and only use accounts and machines you trust for authenticated publishing.
SKILL.md
READMESKILL.md - Baoyu Post To X
# X Articles - Detailed Guide Publish Markdown articles to X Articles editor with rich text formatting and images. ## Mode Selection In Codex, choose the browser-control mode from the user's wording: 1. If the user says "Codex Chrome plugin", "Codex 自带的 Chrome 插件", `@chrome`, or Chrome Extension, use **Codex Chrome Plugin Workflow**. Do not try Computer Use first. 2. If the user explicitly asks for Chrome Computer Use, use **Computer Use Workflow**. 3. If the user explicitly asks for CDP/script mode, use **CDP Script Workflow**. 4. Otherwise, use Computer Use when available; if unavailable or blocked, use CDP Script Workflow. Never use the in-app Browser for X Article publishing. Never switch away from an explicitly requested mode without explaining the blocker and getting approval. ## Prerequisites - X Premium subscription (required for Articles) - Google Chrome installed - `bun` installed ## Usage ### Codex Chrome Plugin (When Requested) Use the `chrome:Chrome` skill and its Node REPL browser client. Verify the connection with a lightweight call such as `browser.user.openTabs()`. If it fails, wait 2 seconds and retry once, then follow the Chrome skill's health checks. Prepare the article HTML and image map: ```bash ${BUN_X} {baseDir}/scripts/md-to-html.ts article.md --save-html /tmp/x-article-body.html > /tmp/x-article.json ``` Copy generated HTML as rich text: ```bash ${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts html --file /tmp/x-article-body.html ``` Use the Chrome plugin's tab, Playwright-wrapper, CUA, clipboard, and file chooser APIs for all X UI operations. If upload fails with `Not allowed`, stop and tell the user to enable file URL access for the Codex Chrome Extension in `chrome://extensions` → Details. ### Chrome Computer Use Prepare the article HTML and image map: ```bash ${BUN_X} {baseDir}/scripts/md-to-html.ts article.md --save-html /tmp/x-article-body.html > /tmp/x-article.json ``` Copy the generated HTML as rich text: ```bash ${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts html --file /tmp/x-article-body.html ``` Then use Codex Computer Use against `Google Chrome` for all X UI operations. ### CDP Script Fallback ```bash # Publish markdown article (preview mode) ${BUN_X} {baseDir}/scripts/x-article.ts article.md # With custom cover image ${BUN_X} {baseDir}/scripts/x-article.ts article.md --cover ./cover.jpg # Actually publish ${BUN_X} {baseDir}/scripts/x-article.ts article.md --submit ``` Do not use `--submit` unless the user has explicitly confirmed the final public publish action. ## Markdown Format ```markdown --- title: My Article Title cover_image: /path/to/cover.jpg --- # Title (becomes article title) Regular paragraph text with **bold** and *italic*. ## Section Header More content here.  - List item 1 - List item 2 1. Numbered item 2. Another item > Blockquote text [Link text](https://example.com) \`\`\` Code blocks become blockquotes (X doesn't support code) \`\`\` ``` ## Frontmatter Fields | Field | Description | |-------|-------------| | `title` | Article title (or uses first H1) | | `cover_image` | Cover image path or URL | | `cover` | Alias for cover_image | | `image` | Alias for cover_image | ## Image Handling 1. **Cover Image**: First image or `cover_image` from frontmatter 2. **Remote Images**: Automatically downloaded to temp directory 3. **Placeholders**: Images in content use `XIMGPH_N` format 4. **Insertion**: Placeholders are found, selected, and replaced with actual images ## Markdown to HTML Script Convert markdown and inspect structure: ```bash # Get JSON with all metadata ${BUN_X} {baseDir}/scripts/md-to-html.ts article.md # Output HTML only ${BUN_X} {baseDir}/scripts/md-to-html.ts article.md --html-only # Save HTML to file ${BUN_X} {baseDir}/scripts/md-to-html.ts article.md --save-html /tmp/article.html ``` JSON output: ```json { "title": "Article Title", "coverImage": "/path/to/cover.jpg", "contentIm