publish-x-article
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseX Article Publisher
X 文章发布工具
Publish Markdown content into X (Twitter) Articles as a draft, preserving formatting via rich text paste and deterministic image insertion.
将Markdown内容以草稿形式发布到X(Twitter)文章,通过富文本粘贴和固定规则插入图片来保留格式。
Hard Rules (Safety)
硬性规则(安全要求)
- Never auto-publish (draft only; user publishes manually).
- User must be logged in before automation starts.
- First image = cover image (if any).
- 绝不自动发布(仅生成草稿;需用户手动发布)。
- 自动化开始前用户必须已登录。
- 首张图片将作为封面图(如果存在图片的话)。
Prerequisites
前置条件
- Browser automation available (Playwright MCP or equivalent)
- X account can access Articles (Premium / Premium Plus)
- macOS recommended (clipboard helper uses Cocoa)
- Python 3.9+ with:
pip install Pillow pyobjc-framework-Cocoa
- 具备浏览器自动化能力(如Playwright MCP或同类工具)
- X账号可访问Articles功能(需Premium或Premium Plus会员)
- 推荐使用macOS系统(剪贴板助手依赖Cocoa)
- Python 3.9及以上版本,并安装以下依赖:
pip install Pillow pyobjc-framework-Cocoa
Inputs / Outputs (Recommended)
输入/输出(推荐配置)
Inputs (paths only):
- : Markdown file to publish
article_md_path - Optional: for artifacts (otherwise use
run_dir)/tmp/
Outputs (recommended artifacts):
- (parsed structure)
/tmp/x_article.json - (HTML body for paste)
/tmp/x_article.html - Optional: (what was done + links)
run_dir/05-final/x-article-draft.md
输入(仅支持路径):
- :待发布的Markdown文件路径
article_md_path - 可选::用于存储产物的目录(默认使用
run_dir)/tmp/
输出(推荐产物):
- (解析后的结构文件)
/tmp/x_article.json - (用于粘贴的HTML主体内容)
/tmp/x_article.html - 可选:(记录操作内容及链接)
run_dir/05-final/x-article-draft.md
Bundled Scripts
内置脚本
Installed path (typical):
~/.claude/skills/publish-x-article/scripts/parse_markdown.py~/.claude/skills/publish-x-article/scripts/copy_to_clipboard.py
默认安装路径:
~/.claude/skills/publish-x-article/scripts/parse_markdown.py~/.claude/skills/publish-x-article/scripts/copy_to_clipboard.py
Runbook (Step-by-step)
操作手册(分步指南)
Follow:
references/runbook.md请参考:
references/runbook.md