본문으로 건너뛰기
cccskills
무료GitHub에 공개

x-article-publisher

Prepare Markdown articles as drafts in the X Articles editor, converting text into formatted content and filling in the title. Saved browser authentication supports repeat use, while cover selection and final publication remain manual steps.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

自媒体创作者与内容创作者在需要将 Markdown 长文发布到 X (Twitter) Articles 编辑器时使用。技能自动将 Markdown 转换为富文本并完美保留排版,支持持久化免密登录与封面上传,一键完成发布,大幅提升长文分发效率。

연동 도구X (Twitter)
설치 방법 보기

이럴 때 유용합니다

  • Import a Markdown article into X Articles as a draft
  • Transfer headings, lists, and links with formatting
  • Suggest a title for an article without an H1 heading
  • Prepare repeated article drafts using saved authentication

포함된 파일(34)

  • SKILL.md7.6 KB
  • .gitignore736 B
  • CHANGELOG.md1.5 KB
  • data/.gitignore701 B
  • data/.gitkeep0 B
  • data/browser_state/.gitkeep53 B
  • LICENSE1.0 KB
  • metadata.json702 B
  • qiaomu-x-article-publisher-github/.gitignore392 B
  • qiaomu-x-article-publisher-github/CHANGELOG.md1.5 KB
  • qiaomu-x-article-publisher-github/CONTRIBUTING.md2.4 KB
  • qiaomu-x-article-publisher-github/data/.gitignore701 B
  • qiaomu-x-article-publisher-github/data/.gitkeep0 B
  • qiaomu-x-article-publisher-github/data/browser_state/.gitkeep53 B
  • qiaomu-x-article-publisher-github/LICENSE1.0 KB
  • qiaomu-x-article-publisher-github/metadata.json702 B
  • qiaomu-x-article-publisher-github/README_FULL.md5.0 KB
  • qiaomu-x-article-publisher-github/README.md3.4 KB
  • qiaomu-x-article-publisher-github/scripts/auth_manager.py8.9 KB
  • qiaomu-x-article-publisher-github/scripts/copy_to_clipboard.py6.0 KB
  • qiaomu-x-article-publisher-github/scripts/debug_editor.py4.9 KB
  • qiaomu-x-article-publisher-github/scripts/debug_page.py2.3 KB
  • qiaomu-x-article-publisher-github/scripts/parse_markdown.py16.7 KB
  • qiaomu-x-article-publisher-github/scripts/publish_article.py39.5 KB
  • qiaomu-x-article-publisher-github/scripts/site_config.py1.7 KB
  • qiaomu-x-article-publisher-github/SKILL.md7.5 KB
  • README.md4.8 KB
  • scripts/auth_manager.py8.9 KB
  • scripts/copy_to_clipboard.py6.0 KB
  • scripts/debug_editor.py4.9 KB
  • scripts/debug_page.py2.3 KB
  • scripts/parse_markdown.py21.9 KB
  • scripts/publish_article.py41.1 KB
  • scripts/site_config.py1.7 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

X Article Publisher

Publish Markdown content to X (Twitter) Articles editor, preserving formatting with rich text conversion.

Prerequisites

  • X Premium Plus subscription
  • Python 3.9+ with dependencies: pip install Pillow pyobjc-framework-Cocoa patchright

🎉 首次使用:一次认证,告别重复登录

X Article Publisher 现在支持持久化认证,无需每次手动登录!

🔧 初始化认证(仅需一次)

首次使用前,运行认证设置:

cd ~/.claude/skills/x-article-publisher/scripts
python auth_manager.py setup

流程:

  1. ✅ 浏览器窗口自动打开 X 登录页面
  2. 🔐 手动登录你的 X 账号(需 Premium+ 订阅)
  3. ✅ 完成 2FA 验证(如已启用)
  4. 🏠 登录成功后自动跳转到 Home 时间线
  5. 💾 认证状态自动保存(有效期 7 天)

📋 认证管理命令

# 检查认证状态
python auth_manager.py status

# 验证认证是否有效
python auth_manager.py validate

# 清除认证数据(需重新登录)
python auth_manager.py clear

# 重新认证(清除 + 设置)
python auth_manager.py reauth

🚀 自动化工作流

认证设置完成后,skill 执行时会自动:

  1. ✅ 检查认证状态
  2. 🔓 如已认证,直接使用保存的浏览器状态(无需登录)
  3. ⚠️ 如未认证,提示运行 auth_manager.py setup

注意:认证数据存储在 ~/.claude/skills/x-article-publisher/data/browser_state/,已通过 .gitignore 排除,不会提交到 Git。


Scripts

Located in ~/.claude/skills/x-article-publisher/scripts/:

publish_article.py (主脚本 - 一键发布)

推荐使用 - 自动完成所有发布步骤:

# 基本用法(默认显示浏览器)
python publish_article.py --file article.md

# 隐藏浏览器(后台运行)
python publish_article.py --file article.md --headless

# 自定义标题
python publish_article.py --file article.md --title "自定义标题"

parse_markdown.py

Parse Markdown and extract structured data:

python parse_markdown.py <markdown_file> [--output json|html] [--html-only]

Returns JSON with: title, cover_image, content_images (with block_index for positioning), html, total_blocks

copy_to_clipboard.py

Copy image or HTML to system clipboard:

# Copy image (with optional compression)
python copy_to_clipboard.py image /path/to/image.jpg [--quality 80]

# Copy HTML for rich text paste
python copy_to_clipboard.py html --file /path/to/content.html

Workflow (简化版)

前提:已完成认证设置(python auth_manager.py setup)

🚀 一键发布(推荐)

直接运行 publish_article.py,自动完成所有步骤:

cd ~/.claude/skills/x-article-publisher/scripts
python publish_article.py --file /path/to/article.md

脚本会自动:

  1. ✅ 检查认证状态
  2. 📄 解析 Markdown 文件
  3. 🌐 启动已认证的浏览器
  4. 📍 导航到 X Articles 编辑器
  5. 🔘 点击 create 按钮
  6. 🖼️ 上传封面图(如有)
  7. 📝 填写标题
  8. 📋 粘贴 HTML 内容
  9. ✅ 保存草稿(不会自动发布)

手动工作流(高级用户)

如需更精细控制,可分步执行:

  1. Parse Markdown: python parse_markdown.py article.md
  2. 手动操作浏览器发布

🧠 智能增强功能

智能标题生成

当文章没有 H1 标题时,parse_markdown.py 会返回 needs_title_generation: true。

Claude 应该自动:

  1. 阅读文章内容,理解核心观点
  2. 生成一个吸引人点击的标题(15-25字为佳)
  3. 使用 --title "生成的标题" 参数发布

好标题的特点:

  • 包含数字或具体细节("3个方法"、"90%的人不知道")
  • 激发好奇心("为什么..."、"如何..."、"...的真相")
  • 与读者切身相关
  • 避免标题党,但要有吸引力

示例:

# 解析文章
python parse_markdown.py article.md

# 如果 needs_title_generation: true,Claude 生成标题后:
python publish_article.py --file article.md --title "AI时代,普通人的3个生存法则"

智能封面图生成

当文章没有封面图时,parse_markdown.py 会返回 needs_cover_generation: true。

Claude 应该自动:

  1. 阅读文章,提炼核心概念(1-3个关键词)
  2. 调用 gemini-image-generator 或 jimeng-image-generator skill 生成封面图
  3. 封面图风格建议:
    • 简洁大气,避免复杂细节
    • 可以是抽象概念的可视化
    • 或是带有核心关键词的文字海报
  4. 将生成的图片路径插入到文章开头作为封面

封面图生成提示词模板:

为一篇关于「{文章主题}」的文章生成封面图。
风格:简洁、现代、科技感
元素:{1-3个核心视觉元素}
文字:可选,如果加文字只放{1-3个关键词}
尺寸:16:9 横版

工作流示例:

# 1. 解析文章
python parse_markdown.py article.md
# 输出: needs_cover_generation: true

# 2. Claude 调用生图 skill 生成封面(假设保存到 /tmp/cover.png)

# 3. 将封面图插入文章开头,或手动上传

注意:封面图上传目前需要在浏览器中手动操作,脚本会打开编辑器后等待用户操作。


技术细节

parse_markdown.py 输出格式

{
  "title": "Article Title",
  "title_source": "h1",           // "h1", "h2", "first_line", or "none"
  "needs_title_generation": false, // true if no H1 title
  "cover_image": "/path/to/first-image.jpg",
  "needs_cover_generation": false, // true if no cover image
  "content_images": [
    {"path": "/path/to/img2.jpg", "block_index": 5}
  ],
  "html": "<p>Content...</p><h2>Section</h2>...",
  "total_blocks": 45
}

字段说明:

  • title_source: 标题来源
    • h1: 来自 H1 标题(最理想)
    • h2: 来自第一个 H2 标题
    • first_line: 来自第一行文本
    • none: 无法提取标题
  • needs_title_generation: 是否需要 Claude 生成更好的标题
  • needs_cover_generation: 是否需要 Claude 生成封面图

Critical Rules

  1. NEVER auto-publish - Only save as draft
  2. NO automatic cover images - User adds cover manually, never insert first image as cover
  3. Clean placeholders - Remove all remaining @@@IMG_X@@@ markers after image insertion
  4. H1 title handling - H1 is used as title only, not included in body

Supported Formatting

  • H2 headers (## )
  • Blockquotes (> )
  • Code blocks (converted to blockquotes)
  • Bold text (**)
  • Hyperlinks (text)
  • Ordered/Unordered lists
  • Paragraphs

Example

User: "Publish /path/to/article.md to X"

cd ~/.claude/skills/x-article-publisher/scripts
python publish_article.py --file /path/to/article.md

Output:

📄 解析文件:/path/to/article.md
  📝 标题:文章标题
  🖼️  封面图:/path/to/cover.jpg
  📷 内容图:2 张

🌐 启动浏览器...
  📍 导航到 X Articles...
  🔘 点击 create 按钮...
  📝 填写标题...
  📋 粘贴内容...

✅ 草稿已创建!
  💡 请在浏览器中检查并手动发布
  🖥️  浏览器保持打开,请检查草稿并手动发布
  ⏎  完成后按回车键关闭浏览器...

技术经验参考: 浏览器自动化调试技巧详见 skill-development-guide

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Organize AI agents into execution, management, and review roles for complex projects. Choose preset or custom teams, share project context and decisions, and combine their discussions and work into meeting records, feasibility reports, or implementation outputs.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Reviewing a technical architecture from several perspectives
  • Discussing product pricing across market and cost considerations
  • Assessing a new product's feasibility
anbeime/skill8.3천2026년 10월 18일 업데이트

Generate character images, backgrounds, synthetic speech, and music for product videos featuring 小省导购员, a digital shopping presenter. Coordinate these assets with InfiniteTalk to produce a 25-second vertical video made from five scenes.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Producing a 25-second vertical product presentation video
  • Generating reference images for the 小省导购员 character
  • Creating business setting backgrounds for a video
anbeime/skill8.3천2026년 10월 18일 업데이트

Convert PDF, Word, and Excel documents into structured Markdown for search and knowledge bases. The skill tries three parsers in sequence when needed and returns metadata, a confidence score, and the parser used.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Prepare documents for retrieval-augmented generation
  • Structure documents for an internal knowledge base
  • Extract structured text from contracts
anbeime/skill8.3천2026년 10월 18일 업데이트

Organize parsed documents into four color-coded cards covering facts, explanations, risks, and actions. Preserve source references and generation details so readers can review evidence, identify uncertainty, and consider next steps in research, financial, or legal analysis.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Separating facts from interpretations in financial reports
  • Organizing evidence and risks in legal documents
  • Turning research documents into evidence-linked analysis cards
anbeime/skill8.3천2026년 10월 18일 업데이트

Record operations across multiple AI agents and connect events into a traceable history. Search records by tracking ID, time window, or responsible component to support audits and investigations, with local storage available when the vector database fails.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Trace task dispatch and execution across agents
  • Search audit records by time or responsible component
  • Keep recording events during vector database failures
anbeime/skill8.3천2026년 10월 18일 업데이트

Screen documents and external URLs before they enter a processing workflow. Check blocked domains and document permissions, then produce a pass or reject decision, a risk report, and a tracking ID for later review.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Screening documents before adding them to a knowledge base
  • Checking external URLs against a domain blocklist
  • Reviewing document permissions before processing
anbeime/skill8.3천2026년 10월 18일 업데이트

anbeime의 스킬 모두 보기

이 스킬의 문제 신고