内容测试
- 作者仓库星标 21,713
- 叉子 2,492
- 作者更新于 2026年6月13日 05:00
- 作者仓库 baoyu-skills
- 领域
- 文档
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 92 / 100 · 已通过审计
- 作者 / 版本 / 许可
- @JimLiu · v1.117.3 · 未声明 license
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- macOS · Linux · Windows
- 底层运行要求
- Bun
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 网络行为
- 仅限本地
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: baoyu-post-to-weibo
description: Posts content to Weibo (微博). Supports regular posts with text, images, and videos, and headline…
category: 文档
runtime: Bun
---
# baoyu-post-to-weibo 输出预览
## PART A: 任务判断
- 适用问题:PRD、RFC、README、项目说明或知识库整理。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Script Directory / Preferences (EXTEND.md) / Prerequisites”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于PRD、RFC、README、项目说明或知识库整理,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Script Directory / Preferences (EXTEND.md) / Prerequisites”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、执行终端命令、主要在本地完成、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件、执行终端命令;主要在本地完成;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文没有稳定的斜杠命令要求。安装验证后通常全局生效,直接在对话里点名这个 Skill 并描述任务即可。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件、执行终端命令。
先用一个小任务确认它会围绕“Script Directory / Preferences (EXTEND.md) / Prerequisites”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: baoyu-post-to-weibo
description: Posts content to Weibo (微博). Supports regular posts with text, images, and videos, and headline…
category: 文档
source: JimLiu/baoyu-skills
---
# baoyu-post-to-weibo
## 什么时候使用
- 把长文章按字数限制拆成微博串——自动接顺序、保留图、写好引导句 适合处理README、PRD、RFC、教程和知识库文档,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续…
- 面向PRD、RFC、README、项目说明或知识库整理,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Script Directory / Preferences (EXTEND.md) / Prerequisites」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件、执行终端命令;主要在本地完成;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "baoyu-post-to-weibo" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Script Directory / Preferences (EXTEND.md) / Prerequisites
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> Bun | 读取文件、写入/修改文件、执行终端命令 | 主要在本地完成
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} 发布到微博
通过真实的 Chrome 浏览器发布文本、图片、视频和长篇文章到微博(绕过反机器人检测)。
脚本目录
重要提示:所有脚本都位于此技能的 scripts/ 子目录中。
Agent 执行说明:
- 确定此 SKILL.md 文件的目录路径为
{baseDir} - 脚本路径 =
{baseDir}/scripts/<script-name>.ts - 将本文档中的所有
{baseDir}替换为实际路径 - 解析
${BUN_X}运行时:如果安装了bun→bun;如果npx可用 →npx -y bun;否则建议安装 bun
脚本参考:
| 脚本 | 用途 |
|---|---|
scripts/weibo-post.ts |
常规帖子(文本 + 图片) |
scripts/weibo-article.ts |
头条文章发布(Markdown) |
scripts/copy-to-clipboard.ts |
复制内容到剪贴板 |
scripts/paste-from-clipboard.ts |
发送真实的粘贴按键 |
首选项 (EXTEND.md)
按优先级顺序检查 EXTEND.md — 找到的第一个生效:
| 优先级 | 路径 | 范围 |
|---|---|---|
| 1 | .baoyu-skills/baoyu-post-to-weibo/EXTEND.md |
项目 |
| 2 | ${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-post-to-weibo/EXTEND.md |
XDG |
| 3 | $HOME/.baoyu-skills/baoyu-post-to-weibo/EXTEND.md |
用户主目录 |
如果未找到,则使用默认值。
EXTEND.md 支持:默认 Chrome 配置文件
先决条件
- Google Chrome 或 Chromium
bun运行时- 首次运行:手动登录微博(会话已保存)
常规帖子
文本 + 图片/视频(总计最多 18 个文件)。发布到微博主页。
${BUN_X} {baseDir}/scripts/weibo-post.ts "Hello Weibo!" --image ./photo.png
${BUN_X} {baseDir}/scripts/weibo-post.ts "Watch this" --video ./clip.mp4
参数:
| 参数 | 描述 |
|---|---|
<text> |
帖子内容(位置参数) |
--image <path> |
图片文件(可重复) |
--video <path> |
视频文件(可重复) |
--profile <dir> |
自定义 Chrome 配置文件 |
注意:脚本会打开浏览器并填充内容。用户需手动审核并发布。
头条文章
长篇 Markdown 文章发布到 https://card.weibo.com/article/v3/editor。
${BUN_X} {baseDir}/scripts/weibo-article.ts article.md
${BUN_X} {baseDir}/scripts/weibo-article.ts article.md --cover ./cover.jpg
参数:
| 参数 | 描述 |
|---|---|
<markdown> |
Markdown 文件(位置参数) |
--cover <path> |
封面图片 |
--title <text> |
覆盖标题(最多 32 个字符,如果更长则截断) |
--summary <text> |
覆盖摘要(最多 44 个字符,如果更长则自动重新生成) |
--profile <dir> |
自定义 Chrome 配置文件 |
Frontmatter:YAML front matter 中支持 title、summary、cover_image。
字符限制:
- 标题:最多 32 个字符(如果更长则截断并发出警告)
- 摘要/导语:最多 44 个字符(如果更长则从内容中自动重新生成)
Markdown 转 HTML:将 Markdown 转换为 HTML 时,请勿传递任何 --theme 参数。使用默认主题(无主题参数)。
文章工作流程:
- 打开
https://card.weibo.com/article/v3/editor - 点击「写文章」按钮,等待编辑器变为可编辑状态
- 填写标题(验证 32 字符限制)
- 填写摘要/导语(验证 44 字符限制)
- 通过粘贴将 HTML 内容插入到 ProseMirror 编辑器中
- 逐一替换图片占位符(复制图片 → 选择占位符 → 粘贴)
撰写后检查:脚本会在所有图片插入后自动验证:
- 编辑器内容中剩余的
WBIMGPH_占位符 - 预期与实际的图片数量
如果检查失败(输出中出现警告),在用户发布前向其提示具体问题。
帖子类型选择
除非用户明确指定帖子类型:
- Markdown 文件 (
.md) → 头条文章 - 纯文本 / 带图片的文本 → 常规帖子
故障排除
Chrome 调试端口未就绪
如果脚本因 Chrome debug port not ready 或 Unable to connect 而失败,请仅终止 CDP Chrome 实例(那些带有 --remote-debugging-port 和 baoyu-skills 配置文件的实例),然后重试:
pkill -f "remote-debugging-port.*baoyu-skills/chrome-profile" 2>/dev/null; sleep 2
关键:切勿终止所有 Chrome 进程 (pkill -f "Google Chrome")。只终止由 CDP 启动的、使用 baoyu-skills 配置文件目录的 Chrome 实例。用户可能打开了常规 Chrome 窗口。
重要提示:这应该自动完成——当遇到此错误时,终止 CDP Chrome 实例并重试命令,无需询问用户。
注意事项
- 首次运行:需要手动登录(会话会持久化)
- 所有脚本只将内容填充到浏览器中,用户必须手动审核并发布
- 跨平台:macOS、Linux、Windows
扩展支持
通过 EXTEND.md 进行自定义配置。请参阅「首选项」部分了解路径和支持的选项。
Post to Weibo
Posts text, images, videos, and long-form articles to Weibo via real Chrome browser (bypasses anti-bot detection).
Script Directory
Important: All scripts are located in the scripts/ subdirectory of this skill.
Agent Execution Instructions:
- Determine this SKILL.md file's directory path as
{baseDir} - Script path =
{baseDir}/scripts/<script-name>.ts - Replace all
{baseDir}in this document with the actual path - Resolve
${BUN_X}runtime: ifbuninstalled →bun; ifnpxavailable →npx -y bun; else suggest installing bun
Script Reference:
| Script | Purpose |
|---|---|
scripts/weibo-post.ts |
Regular posts (text + images) |
scripts/weibo-article.ts |
Headline article publishing (Markdown) |
scripts/copy-to-clipboard.ts |
Copy content to clipboard |
scripts/paste-from-clipboard.ts |
Send real paste keystroke |
Preferences (EXTEND.md)
Check EXTEND.md in priority order — the first one found wins:
| Priority | Path | Scope |
|---|---|---|
| 1 | .baoyu-skills/baoyu-post-to-weibo/EXTEND.md |
Project |
| 2 | ${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-post-to-weibo/EXTEND.md |
XDG |
| 3 | $HOME/.baoyu-skills/baoyu-post-to-weibo/EXTEND.md |
User home |
If none found, use defaults.
EXTEND.md supports: Default Chrome profile
Prerequisites
- Google Chrome or Chromium
bunruntime- First run: log in to Weibo manually (session saved)
Regular Posts
Text + images/videos (max 18 files total). Posted on Weibo homepage.
${BUN_X} {baseDir}/scripts/weibo-post.ts "Hello Weibo!" --image ./photo.png
${BUN_X} {baseDir}/scripts/weibo-post.ts "Watch this" --video ./clip.mp4
Parameters:
| Parameter | Description |
|---|---|
<text> |
Post content (positional) |
--image <path> |
Image file (repeatable) |
--video <path> |
Video file (repeatable) |
--profile <dir> |
Custom Chrome profile |
Note: Script opens browser with content filled in. User reviews and publishes manually.
Headline Articles (头条文章)
Long-form Markdown articles published at https://card.weibo.com/article/v3/editor.
${BUN_X} {baseDir}/scripts/weibo-article.ts article.md
${BUN_X} {baseDir}/scripts/weibo-article.ts article.md --cover ./cover.jpg
Parameters:
| Parameter | Description |
|---|---|
<markdown> |
Markdown file (positional) |
--cover <path> |
Cover image |
--title <text> |
Override title (max 32 chars, truncated if longer) |
--summary <text> |
Override summary (max 44 chars, auto-regenerated if longer) |
--profile <dir> |
Custom Chrome profile |
Frontmatter: title, summary, cover_image supported in YAML front matter.
Character Limits:
- Title: 32 characters max (truncated with warning if longer)
- Summary/导语: 44 characters max (auto-regenerated from content if longer)
Markdown-to-HTML: Do NOT pass any --theme parameter when converting markdown to HTML. Use the default theme (no theme argument).
Article Workflow:
- Opens
https://card.weibo.com/article/v3/editor - Clicks "写文章" button, waits for editor to become editable
- Fills title (validated for 32-char limit)
- Fills summary/导语 (validated for 44-char limit)
- Inserts HTML content into ProseMirror editor via paste
- Replaces image placeholders one by one (copy image → select placeholder → paste)
Post-Composition Check: The script automatically verifies after all images are inserted:
- Remaining
WBIMGPH_placeholders in editor content - Expected vs actual image count
If the check fails (warnings in output), alert the user with the specific issues before they publish.
Post Type Selection
Unless the user explicitly specifies the post type:
- Markdown file (
.md) → Headline Article (头条文章) - Plain text / text with images → Regular Post
Troubleshooting
Chrome debug port not ready
If a script fails with Chrome debug port not ready or Unable to connect, kill only the CDP Chrome instances (those with --remote-debugging-port AND the baoyu-skills profile), then retry:
pkill -f "remote-debugging-port.*baoyu-skills/chrome-profile" 2>/dev/null; sleep 2
CRITICAL: Never kill all Chrome processes (pkill -f "Google Chrome"). Only kill Chrome instances launched by CDP with the baoyu-skills profile directory. The user may have regular Chrome windows open.
Important: This should be done automatically -- when encountering this error, kill the CDP Chrome instances and retry the command without asking the user.
Notes
- First run: manual login required (session persists)
- All scripts only fill content into the browser, user must review and publish manually
- Cross-platform: macOS, Linux, Windows
Extension Support
Custom configurations via EXTEND.md. See Preferences section for paths and supported options.
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核