Publish Markdown articles to X (Twitter) Articles with one command. Say goodbye to tedious rich text editing.
$ npx -y skills add wshuyi/x-article-publisher-skill --agent claude-code
Run the curl in your terminal, the rest in Claude Code.
Repo: wshuyi/x-article-publisher-skill
What's inside
Publish Markdown articles to X (Twitter) Articles with one command. Say goodbye to tedious rich text editing.
v1.2.0 β Now with divider support, table-to-image, Mermaid support, and cross-platform clipboard
If you're used to writing in Markdown, publishing to X Articles is a painful process:
| Pain Point | Description |
|---|---|
| Format Loss | Copy from Markdown editor β Paste to X β All formatting gone |
| Manual Formatting | Set each H2, bold, link manually β 15-20 min per article |
| Tedious Image Upload | 5 clicks per image: Add media β Media β Add photo β Select β Wait |
| Position Errors | Hard to remember where each image should go |
| Task | Manual | With This Skill |
|---|---|---|
| Format conversion | 15-20 min | 0 (automatic) |
| Cover image | 1-2 min | 10 sec |
| 5 content images | 5-10 min | 1 min |
| Total | 20-30 min | 2-3 min |
10x efficiency improvement
This skill automates the entire publishing workflow:
Markdown File
β Python parsing
Structured Data (title, images with block_index, HTML)
β Playwright MCP
X Articles Editor (browser automation)
β
Draft Saved (never auto-publishes)
| Feature | Before | After |
|---|---|---|
| Image positioning | Text matching (fragile) | Block index (precise) |
| Insertion order | Sequential | Reverse (highβlow) |
| Wait behavior | Fixed delay | Immediate return on condition |
Previously, images were positioned by matching surrounding text β this failed when:
Now, each image has a block_index indicating exactly which block element it follows. This is deterministic and reliable.
| Requirement | Details |
|---|---|
| Claude Code | claude.ai/code |
| Playwright MCP | Browser automation |
| X Premium Plus | Required for Articles feature |
| Python 3.9+ | With dependencies below |
| OS | macOS or Windows |
# macOS
pip install Pillow pyobjc-framework-Cocoa
# Windows
pip install Pillow pywin32 clip-util
# For Mermaid diagrams (optional)
npm install -g @mermaid-js/mermaid-cli
git clone https://github.com/wshuyi/x-article-publisher-skill.git
cp -r x-article-publisher-skill/skills/x-article-publisher ~/.claude/skills/
/plugin marketplace add wshuyi/x-article-publisher-skill
/plugin install x-article-publisher@wshuyi/x-article-publisher-skill
Publish /path/to/article.md to X
Help me post this article to X Articles: ~/Documents/my-post.md
/x-article-publisher /path/to/article.md
[1/7] Parse Markdown...
β Extract title, cover image, content images with block_index
β Convert to HTML, count total blocks
[2/7] Open X Articles editor...
β Navigate to x.com/compose/articles
[3/7] Upload cover image...
β First image becomes cover
[4/7] Fill title...
β H1 used as title (not included in body)
[5/7] Paste article content...
β Rich text via clipboard
β All formatting preserved
[6/7] Insert content images (reverse order)...
β Sort by block_index descending
β Click block element at index β Paste image
β Wait for upload (returns immediately when done)
[7/7] Save draft...
β β
Review and publish manually
| Syntax | Result | Notes |
|---|---|---|
# H1 | Article title | Extracted, not in body |
## H2 | Section headers | Native support |
**bold** | Bold text | Native support |
*italic* | Italic text | Native support |
[text](url) | Hyperlinks | Native support |
> quote | Blockquotes | Native support |
- item | Unordered lists | Native support |
1. item | Ordered lists | Native support |
 | Images | First = cover |
--- | Dividers | Via Insert menu (v1.2) |
| Tables | PNG images | Via table_to_image.py (v1.2) |
| Mermaid | PNG images | Via mmdc CLI (v1.2) |
article.md# 5 AI Tools Worth Watching in 2024

AI tools exploded in 2024. Here are 5 worth your attention.
## 1. Claude: Best Conversational AI
**Claude** by Anthropic excels at long-context understanding.
> Claude's context window reaches 200K tokens.

## 2. Midjourney: AI Art Leader
[Midjourney](https://midjourney.com) is the most popular AI art tool.

{
"title": "5 AI Tools Worth Watching in 2024",
"cover_image": "./images/cover.jpg",
"content_images": [
{"path": "./images/claude-demo.png", "block_index": 4},
{"path": "./images/midjourney.jpg", "block_index": 6}
],
"total_blocks": 7
}
Images inserted in reverse: block_index=6 first, then block_index=4.
cover.jpg uploadedx-article-publisher-skill/
βββ .claude-plugin/
β βββ plugin.json # Plugin config
βββ skills/
β βββ x-article-publisher/
β βββ SKILL.md # Skill instructions
β βββ scripts/
β βββ parse_markdown.py # Extracts block_index + dividers
β βββ copy_to_clipboard.py # Cross-platform clipboard
β βββ table_to_image.py # Markdown table β PNG (v1.2)
βββ docs/
β βββ GUIDE.md # Detailed guide
βββ README.md # This file
βββ README_CN.md # Chinese version
βββ LICENSE
Q: Why Premium Plus? A: X Articles is exclusive to Premium Plus subscribers.
Q: Windows/Linux support? A: Windows is now supported (v1.2). Linux support is still in progress β PRs welcome!
Q: Image upload failed? A: Check: valid path, supported format (jpg/png/gif/webp), stable network.
Q: Can I publish to multiple accounts? A: Not automatically. Switch accounts in browser manually before running.
Q: Why insert images in reverse order? A: Each inserted image shifts subsequent block indices. Inserting from highest to lowest ensures earlier indices remain valid.
Q: What if text matching was used before?
A: v1.1 replaces text matching with block_index. The after_text field is kept for debugging but not used for positioning.
Q: Why does wait return immediately sometimes?
A: browser_wait_for textGone="..." returns as soon as the text disappears. The time parameter is just a maximum, not a fixed delay.
--- in Markdown, insert via X Articles menutable_to_image.py script converts Markdown tables to PNGmmdc to convert diagramsMIT License - see LICENSE
v1.2.0 features were inspired by and adapted from:
publish-x-article skill contributed ideas for:
Thank you to the community for building upon and improving this skill!
.claude-plugin/
plugin.json
.gitignore
docs/
GUIDE.md
LICENSE
README_CN.md
README.md
skills/
x-article-publisher/
scripts/
copy_to_clipboard.py
parse_markdown.py
table_to_image.py
SKILL.mdFAQ
x-article-publisher is a Claude Code plugin with 1 hand-picked skill for content work, indexed on Flowy. Install it with the command on its page. It includes x-article-publisher. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.