← 返回 Skills 市场
csdn文章发布
作者
love254443233
· GitHub ↗
· v1.0.4
· MIT-0
130
总下载
1
收藏
0
当前安装
5
版本数
在 OpenClaw 中安装
/install csdn-article-publish-plus
功能描述
将 Markdown 文章通过用户目录浏览器会话发布到 CSDN。支持保存草稿、预览排版、人工确认发布;默认保持浏览器打开并复用登录态。
使用说明 (SKILL.md)
CSDN 文章发布(会话保持版)
核心要求
- 使用用户目录浏览器会话(Edge/Chrome),复用已有登录态。
- 默认不关闭浏览器、不丢失上一次会话。
- 不硬编码文章路径、标题、文章 ID、标签等业务信息;全部参数化。
- 发布流程内置“页面排版模块”,默认在回填编辑器前执行。
目录结构
csdn-article-publish/
├── SKILL.md
├── skill-config.json
├── scripts/
│ └── csdn_browser_publish.js
└── docs/
└── usage.md
何时调用
- 用户要求“发布到 CSDN”“保存到 CSDN 草稿”“先预览再发布”。
- 用户明确要求保持浏览器会话、复用登录态。
脚本说明(参数化,无硬编码)
脚本:scripts/csdn_browser_publish.js
--mode draft:打开发布弹窗并保存草稿--mode draft-preview:保存草稿后关闭弹窗并切换预览--mode publish:打开发布弹窗并提交发布
通用参数:
--file \x3Cmarkdown文件路径>:必填--title \x3C标题>:可选,默认用文件名--article-id \x3C文章ID>:可选;传入则打开指定草稿--browser edge|chrome:可选,默认edge--profile-dir \x3C浏览器用户目录>:可选;不传则按浏览器类型取默认用户目录--keep-open true|false:可选,默认true--typeset true|false:可选,默认true--typeset-profile readable|compact:可选,默认readable--page-typeset true|false:可选,默认true(页面层排版:尝试关闭 AI 助手侧栏并进入预览态)
二维码文末策略(从配置文件读取):
- 从
skill-config.json的env字段读取:CSDN_VERTICAL_QR_IMAGE_URLCSDN_VERTICAL_QR_DESCRIPTION(可选)
- 若配置不存在,则自动追加“请添加公众号二维码图片及相关说明”的占位提示。
排版模块策略(回填编辑器前):
- 统一标题/列表与正文空行
- 统一代码块前后留白
- 压缩异常连续空行
readable:偏可读性(推荐)compact:偏紧凑展示
页面排版模块策略(浏览器页面层):
- 自动尝试关闭 AI 助手侧栏,扩大阅读区域
- 自动切换到预览态,便于发布前检查
- 结果 JSON 返回
pageTypesetActions
推荐执行顺序
draft-preview:保存草稿并预览排版- 需要时重复
draft-preview做排版迭代 - 最终执行
publish或让用户人工确认后发布
异常处理
- 若出现
ProcessSingleton/SingletonLock:说明浏览器目录被占用。- 优先复用已打开会话,不强制重启。
- 仅在用户同意下重启浏览器恢复可控会话。
- 若页面元素变更导致按钮失效:更新选择器,不要写死
ref。
结果输出
- 每次执行输出 JSON 结果(按钮命中、当前 URL、截图路径)。
- 输出会包含二维码变量状态(
wechatQrConfigured)。 - 截图默认保存到当前工作目录:
csdn_\x3Cmode>_result.png。
安全使用建议
What to consider before installing/running:
- Dependencies: the script requires Node.js and the 'playwright' package (and a compatible Chromium build). The skill provides no install instructions — install Playwright yourself (npm i playwright) or provide an install spec first.
- Browser profile access: the script intentionally opens your browser's profile directory to reuse login cookies. That gives it access to all sessions and cookies stored in that profile. Only run it on a browser profile you are comfortable exposing (recommend creating/using a dedicated profile for this skill).
- Platform assumptions: default profile-path resolution targets macOS (Library/Application Support). On Linux/Windows you must pass --profile-dir explicitly or adjust the script.
- Privacy: the skill takes a screenshot of the editor and prints the current page URL to stdout. If that contains sensitive details, consider where outputs are stored and who can see them.
- Operation: by default the script keeps the browser process open (keeps the session alive); it will not exfiltrate data by itself, but it interacts with the live browser context — review the script if you have concerns.
- Configuration: check skill-config.json for the QR image URL and description before use to avoid adding unwanted content.
Recommended actions: inspect/verify the included script locally, run it with a dedicated browser profile, install Playwright in a controlled environment, and if you need broader platform support add or pass an explicit --profile-dir. If you want an install step, add a package.json and an install spec so dependencies are explicit.
功能分析
Type: OpenClaw Skill
Name: csdn-article-publish-plus
Version: 1.0.4
The skill automates CSDN article publishing but employs a high-risk method by accessing the user's full browser profile directory (Chrome/Edge) to reuse login sessions in `scripts/csdn_browser_publish.js`. This grants the script access to all cookies, history, and sensitive session data for all websites within the user's primary browser profile. While this aligns with the stated goal of session persistence, it is an over-privileged approach. Additionally, `skill-config.json` contains hardcoded local paths and a specific CSDN-hosted image URL (i-blog.csdnimg.cn) for a QR code, which may be used for tracking or unintended content insertion.
能力评估
Purpose & Capability
The name/description match the code: the script reads a Markdown file, optionally appends a QR section from skill-config.json, opens a persistent Playwright Chromium context pointed at a browser profile directory to reuse login state, fills the editor, interacts with publish/save/preview buttons, screenshots the page, and emits a JSON result. Requesting access to a browser profile is coherent with 'reuse login session'.
Instruction Scope
Runtime instructions and the script stay within publishing scope: they read only the provided Markdown file and the skill's skill-config.json, operate in the browser editor page, and output a screenshot and JSON. Important scope notes: the script will open and reuse a browser profile (accessing cookies/session data in that profile) and will keep the browser process open by default (process.stdin.resume). It also uses heuristics (DOM selectors) to find editor fields, which may require updates if the site changes.
Install Mechanism
There is no install spec yet the script requires Node and the Playwright package (require('playwright')). The skill does not declare these runtime dependencies or how to install them; without them the script will fail. This lack of declared install steps is a practical coherence gap (not necessarily malicious) that the user should address before running.
Credentials
The skill requests no external secrets or environment variables. It reads env-like values only from its own skill-config.json (CSDN_VERTICAL_QR_IMAGE_URL/CSDN_VERTICAL_QR_DESCRIPTION) to build the QR section — this is proportional to its publishing purpose.
Persistence & Privilege
always is false and the skill does not request to persist or modify other skills or system-wide agent settings. Its behavior of keeping the browser open and reusing the user's profile is a functional feature, not an elevated platform privilege; still, it has privacy implications (see guidance).
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install csdn-article-publish-plus - 安装完成后,直接呼叫该 Skill 的名称或使用
/csdn-article-publish-plus触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.4
No user-visible changes in this version.
- Version bump to 1.0.4 with no detected file modifications.
- Functionality, parameters, and documentation remain unchanged.
v1.0.3
- Changed二维码文末策略 from环境变量读取 to读取自skill-config.json配置文件的env字段(CSDN_VERTICAL_QR_IMAGE_URL与CSDN_VERTICAL_QR_DESCRIPTION)。
- 移除二维码相关的wechat-qr参数说明与环境变量依赖。
- 优化二维码文末策略说明,更贴合实际配置文件场景。
- 其他功能和参数未作更改。
v1.0.2
- Added skill-config.json to the project directory for enhanced configuration management.
- No changes to existing functionality or documentation.
v1.0.1
CSDN 文章发布增强版 1.0.1
- 新增 scripts/csdn_browser_publish.js,支持参数化的 CSDN Markdown 文章自动发布、草稿保存与预览,包括二维码和排版模块。
- 移除 skill-config.json,统一配置由脚本参数与环境变量管理。
- 默认保持和复用浏览器会话,不强制退出浏览器或丢失登录态。
- 输出 JSON,包括操作结果、二维码配置状态与截图路径,便于后续自动化与追溯。
- 明确异常处理与排版行为,提升脚本健壮性与可维护性。
v1.0.0
CSDN 文章发布技能增强版(v1.0.0)
- 支持通过浏览器自动化,将 Markdown 技术文章发布到 CSDN 博客,包括登录验证与审核状态提示。
- 覆盖完整自动化流程:进入编辑器、自动填写标题和正文、自动点击发布、反馈发布结果及链接。
- 强化错误处理:对未登录、标题不合规、正文为空等常见问题进行智能提示与引导。
- 支持本地 Markdown 文件读取与发布,兼容多种内容创作工具协作。
- 详细参考与 SkillHub 社区主流方案,并附同步/安装原版指引。
- 输出与技能配置文件一致,支持固定本地输出目录。
元数据
常见问题
csdn文章发布 是什么?
将 Markdown 文章通过用户目录浏览器会话发布到 CSDN。支持保存草稿、预览排版、人工确认发布;默认保持浏览器打开并复用登录态。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 130 次。
如何安装 csdn文章发布?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install csdn-article-publish-plus」即可一键安装,无需额外配置。
csdn文章发布 是免费的吗?
是的,csdn文章发布 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
csdn文章发布 支持哪些平台?
csdn文章发布 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 csdn文章发布?
由 love254443233(@love254443233)开发并维护,当前版本 v1.0.4。
推荐 Skills