lainXXX

Blog Auto Poster Skill — Development skill for Claude Code

Development community

多平台文章统一发布 Skill — 支持 CSDN、51CTO、博客园、掘金一键分发.

How to install Blog Auto Poster Skill

This entry records only its repository, not the path inside it, so there is no exact command to give. Open lainXXX/blog-auto-poster-skill and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Blog Auto Poster Skill does

多平台文章统一发布 Skill — 支持 CSDN、51CTO、博客园、掘金一键分发.

Alternatives in Development

README

Blog Auto Poster — Claude Code Skill:多平台博客一键分发

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) ![Python Version](https://img.shields.io/badge/Python-3.8%2B-blue)

一个 **Claude Code Skill**,让 AI 帮你把文章一键分发到 CSDN、51CTO、博客园、掘金四个平台。 你说"发篇文章到所有平台",Claude 自动完成凭证检查、模板选型、内容准备、逐平台发布、结果汇总。

为什么做这个 Skill?

作为一个技术博主,我经常遇到这样的场景:写了一篇文章,为了覆盖更多读者,需要在 CSDN、掘金、博客园、51CTO 等多个平台分别发布。每个平台的编辑器都不一样——有的用 HTML、有的用 Markdown、有的格式渲染还有自己的「癖好」。更别提各个平台的 API 鉴权方式五花八门:CSDN 需要算 CA 签名头,掘金的标签要传数字 ID……每次发布都是一次重复劳动。

这个 Skill 就是为了解决这个问题而生的——**把「发文章到多个平台」这件事,变成一句话就能搞定的事情。**

解决了什么问题?

  1. 消除重复劳动 — 一次写作,多平台自动分发,节省大量重复的人工发布时间
  2. 屏蔽平台差异 — 各平台不同的鉴权方式、API 接口、内容格式全部封装在脚本里
  3. 降低使用门槛 — 内置 6 种文章模板,标题、标签、正文用自然语言和 AI 对话式确认
  4. 失败不中断 — 一个平台发布失败不影响其他平台继续执行,最后汇总结果一目了然
  5. 零依赖 — 所有 Python 脚本仅依赖标准库,无需 pip install

本项目就是一个开箱即用的 Skill,包含完整的编排流程(`SKILL.md`)、各平台发帖脚本和配置指南。

作为 Skill 使用(推荐)

安装

# 克隆到本地
git clone https://github.com/lainXXX/blog-auto-poster-skill.git
cd blog-auto-poster-skill

# 配置凭证
cp .env.example .env
# 编辑 .env 填入各平台 Cookie...

然后在 Claude Code 中引用此 Skill:

# Claude Code 中直接说:
# "帮我把这篇文章发布到所有平台"
# "把这个 MD 文件发到 CSDN 和掘金"
# "用工具推荐的模板写一篇文章发到全部平台"

Skill 内置的编排流程会按以下顺序处理:

  1. 检查凭证 — 验证 .env 中各平台 Cookie 是否完备
  2. 明确需求 — 引导选择发帖模板,确认标题/标签/正文/目标平台
  3. 写入文件 — 将正文写入临时 Markdown 文件
  4. 逐平台发布 — CSDN → 51CTO → 博客园 → 掘金(失败不中断)
  5. 汇总结果 — 每个平台的成功/失败状态和链接

触发场景

对 Claude Code 说这些话即可自动触发:

  • "帮我把这篇文章发布到所有平台"
  • "把这个 MD 文件发到 CSDN 和掘金"
  • "用工具推荐的模板写一篇文章,发到全部平台"
  • "帮我把上述内容总结发到 CSDN"
  • "一键分发到全平台"

作为纯 Python 脚本使用

不使用 Claude Code 也可以直接调用:

# 单平台
python scripts/csdn_poster.py post --title "标题" --file article.md --format markdown --publish

# 多平台(逐个执行,失败不中断)
python scripts/csdn_poster.py post --title "标题" --file article.md --format markdown --publish
python scripts/51cto_poster.py post --title "标题" --file article.md --tags "Python,后端"
python scripts/cnblogs_poster.py post --title "标题" --file article.md --tags "