跳转到内容

baoyu-skill

21 个 AI Agent 技能组成的自媒体内容工厂——从图文生成、多平台发布到翻译润色,覆盖自媒体创作的完整链路。

  • 内容生成:小红书图文卡片(12 种风格 × 8 种布局 × 3 种配色)、信息图(21 种布局 × 17 种风格)、知识漫画(5 种画风 × 7 种氛围)、幻灯片(16 种预设风格)、封面图(5 维设计系统)、文章插图(6 种类型 × 8 种风格)
  • AI 图像后端:统一 10+ 图像生成 API(OpenAI、Google、Azure、DashScope、MiniMax、Jimeng、Seedream、Replicate 等),自动选择最可用后端
  • 多平台发布:支持微信公众号(API + 浏览器 + 远程 SSH 代理三种模式)、微博、X/Twitter 的自动化发布,Chrome CDP 驱动反反自动化
  • 内容处理:Markdown 格式化与自动排版、多语言翻译(快速/标准/精细三档)、URL 转 Markdown、YouTube 字幕下载、X 推文提取、图片压缩
  • 模块化架构:3 个共享 npm 包(Chrome CDP、Markdown 渲染、Codex 图像后端代理)+ 21 个独立可分发的 skill

当用户提到”生成小红书图片”、“公众号排版发布”、“信息图制作”、“知识漫画”、“封面图生成”、“幻灯片制作”、“将文章翻译成英文”、“YouTube 字幕”、“URL 转文章”等自媒体内容创作与发布需求时触发对应子 skill。也适用于批量内容生产和多平台分发场景。

A self-media content factory of 21 AI Agent skills — from visual content generation and multi-platform publishing to translation and polishing, covering the complete content creation pipeline.

  • Content Generation: Xiaohongshu image cards (12 styles × 8 layouts × 3 palettes), infographics (21 layouts × 17 styles), knowledge comics (5 art styles × 7 tones), slide decks (16 style presets), cover images (5D design system), article illustrations (6 types × 8 styles)
  • AI Image Backend: Unified interface over 10+ image generation APIs (OpenAI, Google, Azure, DashScope, MiniMax, Jimeng, Seedream, Replicate, etc.), auto-selecting the best available backend
  • Multi-Platform Publishing: Automated posting to WeChat Official Accounts (API + browser + remote SSH proxy modes), Weibo, and X/Twitter, using Chrome CDP to bypass anti-automation
  • Content Processing: Markdown formatting with typography correction, multi-language translation (quick/normal/refined modes), URL-to-Markdown conversion, YouTube transcript download, X tweet extraction, image compression
  • Modular Architecture: 3+ shared npm packages (Chrome CDP, Markdown renderer, Codex image backend proxy) + 21 independently distributable skills

Triggers when users mention “generate Xiaohongshu images”, “WeChat Official Account publishing”, “infographic creation”, “knowledge comic”, “cover image generation”, “slide deck creation”, “translate article”, “YouTube transcript”, “URL to article”, or other self-media content creation and publishing needs. Also suited for batch content production and multi-platform distribution.

  • baoyu-skill 769 files / 102,386 lines total
    • CLAUDE.md
    • README.md / README.zh.md
    • package.json
    • skills/ 21 个独立 skill
      • baoyu-xhs-images/
        • SKILL.md
        • references/ 3 篇参考文档
      • baoyu-infographic/
        • SKILL.md
        • references/ 4 篇参考文档
      • baoyu-diagram/
        • SKILL.md + scripts/ + references/ SVG 图表生成
      • baoyu-cover-image/
        • SKILL.md + references/ 5D 封面图系统
      • baoyu-slide-deck/
        • SKILL.md + scripts/ + references/ 幻灯片生成 + PPTX/PDF 合并
      • baoyu-comic/
        • SKILL.md + scripts/ + references/ 知识漫画创作
      • baoyu-article-illustrator/
        • SKILL.md + references/ 文章插图生成
      • baoyu-image-gen/
        • SKILL.md + scripts/ 10+ 图像生成后端 (1249 行主脚本)
      • baoyu-danger-gemini-web/ Gemini Web 交互
      • baoyu-post-to-wechat/
        • SKILL.md + scripts/ 微信公众号发布 (741 行浏览器脚本)
      • baoyu-post-to-weibo/ 微博发布
      • baoyu-post-to-x/ X/Twitter 发布
      • baoyu-translate/ 三档翻译工作流
      • baoyu-format-markdown/ Markdown 格式化 + 排版
      • baoyu-url-to-markdown/ URL 转 Markdown
      • baoyu-danger-x-to-markdown/ X 推文转 Markdown
      • baoyu-youtube-transcript/ YouTube 字幕下载
      • baoyu-markdown-to-html/ Markdown 转微信 HTML
      • baoyu-compress-image/ 图片压缩
      • baoyu-electron-extract/ Electron 内容提取
      • baoyu-wechat-summary/ 微信文章摘要
    • packages/ 4 个共享 npm 包
      • baoyu-chrome-cdp/ Chrome CDP 浏览器自动化
      • baoyu-md/ Markdown 渲染引擎 (14 个源文件)
      • baoyu-fetch/ URL 抓取 + 多适配器
      • baoyu-codex-imagegen/ Codex 图像后端代理
    • scripts/ 7 个仓库维护脚本
    • docs/ 8 篇作者参考文档
    • screenshots/ 大量样式/布局预览图 (.webp)

baoyu-skill 不是单一 skill,而是一个技能市场(Skill Marketplace),包含 21 个独立可分发的 skill、4 个共享 npm 包、和 7 个仓库级维护脚本。整体架构遵循”每个 skill 自包含”原则——每个 skills/baoyu-*/ 目录可以独立提取到其他项目中使用,决不依赖同级 skill 或外部 docs/

顶级目录分为四个功能区:

  • skills/:21 个业务 skill,每个遵循 SKILL.md + 可选 scripts/ + 可选 references/ + 可选 prompts/ 的结构
  • packages/:4 个共享 npm 包,提供跨 skill 复用能力(Chrome CDP、Markdown 渲染、URL 抓取、Codex 图像代理)
  • scripts/:仓库级工具脚本(发布同步、测试运行、Git hooks 安装)
  • docs/:面向仓库维护者的参考文档,禁止被 skill 内部引用

每个 skill 都是纯 TypeScript 实现,使用 Bun 运行时无需编译步骤。CLI 风格统一为 /baoyu-<功能名> <必选参数> [--可选参数]

每个子 skill 的 SKILL.md 遵循标准的 YAML frontmatter + Markdown body 结构。Frontmatter 包含 namedescriptionversionmetadata 四个核心字段。Body 采用分层指令模式:

  1. 用户交互工具声明## User Input Tools)——内联声明工具选择优先级,不依赖外部文档
  2. 图像生成工具声明## Image Generation Tools)——声明后端选择策略和 prompt 文件写盘要求
  3. 核心功能指令——详细的操作流程和命令参数说明
  4. 参考文档references/)——分析框架、base prompt 模板、风格清单等

这种”内联约定 + 外挂参考”的结构是可分发 skill 的最佳实践:确保 skill 在脱离仓库环境后仍能正常工作。

baoyu-skill is not a single skill but a skill marketplace containing 21 independently distributable skills, 4 shared npm packages, and 7 repo-level maintenance scripts. The overall architecture follows the “each skill is self-contained” principle — every skills/baoyu-*/ directory can be independently extracted and used in other projects, never depending on sibling skills or external docs/.

The top-level directory is divided into four functional areas:

  • skills/: 21 business skills, each following SKILL.md + optional scripts/ + optional references/ + optional prompts/ structure
  • packages/: 4 shared npm packages providing cross-skill capabilities (Chrome CDP, Markdown rendering, URL fetching, Codex image proxy)
  • scripts/: Repo-level tooling (publish sync, test runner, git hooks)
  • docs/: Reference docs for repo maintainers, forbidden from being referenced by skills

Each skill is a pure TypeScript implementation using the Bun runtime — no build step needed. CLI style is uniformly /baoyu-<feature> <required> [--options].

Each sub-skill’s SKILL.md follows the standard YAML frontmatter + Markdown body structure. Frontmatter contains name, description, version, and metadata fields. The body uses a layered instruction pattern:

  1. User Input Tool Declaration (## User Input Tools) — Inlines tool selection priority, no external doc dependency
  2. Image Generation Tool Declaration (## Image Generation Tools) — Declares backend selection strategy and prompt file write-to-disk requirement
  3. Core Feature Instructions — Detailed workflows and command parameters
  4. Reference Documents (references/) — Analysis frameworks, base prompt templates, style catalogs

This “inline conventions + external references” structure is a best practice for distributable skills: ensuring the skill works correctly even when extracted from the repo.

SKILL.md — YAML Frontmatter 规范 ↗ 源文件
1 --- 2 name: baoyu-xhs-images 3 description: Generates infographic image card series with 12 visual styles... 4 version: 2.0.1 5 metadata: 6 openclaw: 7 homepage: https://github.com/JimLiu/baoyu-skills#baoyu-xhs-images 8 ---
代码解读
L2 name 字段使用 baoyu- 前缀,确保 ClawHub/插件市场命名空间不冲突 L3 description 包含具体功能和搜索关键词,用于 Agent 的 skill 匹配触发 L4 version 使用语义化版本,与 marketplace.json 和 CHANGELOG 三者同步 L5 metadata.openclaw 为 ClawHub 注册提供 homepage URL,体现多平台分发设计

baoyu-skill 的架构呈现星型依赖packages/ 中的共享包被多个 skill 引用,但 skill 之间彼此独立。这种设计避免了 skill 间的耦合,同时通过共享包复用核心能力。

baoyu-skill’s architecture exhibits a star dependency pattern: shared packages in packages/ are referenced by multiple skills, but skills are independent of each other. This design avoids inter-skill coupling while reusing core capabilities through shared packages.

baoyu-skill 模块关系图

graph TD
  subgraph Skills["21 个独立 Skill"]
    XHS["baoyu-xhs-images"]
    INFO["baoyu-infographic"]
    COVER["baoyu-cover-image"]
    SLIDE["baoyu-slide-deck"]
    COMIC["baoyu-comic"]
    ILLUS["baoyu-article-illustrator"]
    DIAG["baoyu-diagram"]
    IMG_GEN["baoyu-image-gen"]
    GEMINI["baoyu-danger-gemini-web"]
    WECHAT["baoyu-post-to-wechat"]
    WEIBO["baoyu-post-to-weibo"]
    X_POST["baoyu-post-to-x"]
    TRANS["baoyu-translate"]
    FMT_MD["baoyu-format-markdown"]
    URL2MD["baoyu-url-to-markdown"]
    X2MD["baoyu-danger-x-to-markdown"]
    YT["baoyu-youtube-transcript"]
    MD2HTML["baoyu-markdown-to-html"]
    COMPRESS["baoyu-compress-image"]
    WECHAT_SUM["baoyu-wechat-summary"]
    ELEC["baoyu-electron-extract"]
  end

  subgraph Packages["共享 npm 包"]
    CDP["baoyu-chrome-cdp"]
    MD["baoyu-md"]
    FETCH["baoyu-fetch"]
    CODEX_IMG["baoyu-codex-imagegen"]
  end

  IMG_GEN --> CODEX_IMG
  IMG_GEN --> FETCH
  WECHAT --> CDP
  WEIBO --> CDP
  X_POST --> CDP
  MD2HTML --> MD
  FMT_MD --> MD
  URL2MD --> CDP
  URL2MD --> FETCH
  X2MD --> FETCH
脚本/包语言行数复杂度功能
skills/baoyu-image-gen/scripts/main.tsTypeScript~1249⭐⭐⭐⭐⭐10+ AI 图像后端统一接口,含批量生成、Provider 自动选择、重试机制
skills/baoyu-post-to-wechat/scripts/wechat-browser.tsTypeScript~741⭐⭐⭐⭐⭐Chrome CDP 驱动微信公众号后台,含远程 SOCKS5 代理发布模式
skills/baoyu-post-to-wechat/scripts/cdp.tsTypeScript~255⭐⭐⭐跨平台 Chrome CDP 启动器,Windows/Mac/Linux/WSL 全适配
packages/baoyu-md/src/document.tsTypeScript~206⭐⭐⭐⭐Markdown→HTML 完整渲染管道,11 套微信兼容主题
skills/baoyu-danger-x-to-markdown/scripts/thread.tsTypeScript~311⭐⭐⭐⭐X/Twitter 线程解析与 Markdown 转换
skills/baoyu-translate/scripts/main.tsTypeScript~55⭐⭐三档翻译工作流路由器(快速/标准/精细)
packages/baoyu-chrome-cdp/src/index.tsTypeScript~300⭐⭐⭐⭐Chrome 启动/连接/CDP 通信封装
packages/baoyu-codex-imagegen/src/main.tsTypeScript~200⭐⭐⭐Codex CLI 图像生成代理,含缓存和重试验证
packages/baoyu-fetch/src/cli.tsTypeScript~150⭐⭐⭐多适配器 URL 抓取,含 Hacker News 等站点专用适配器
scripts/publish-skill.mjsJavaScript~200⭐⭐⭐单 skill 独立发布到 ClawHub 的工具
Script/PackageLanguageLinesComplexityPurpose
skills/baoyu-image-gen/scripts/main.tsTypeScript~1249⭐⭐⭐⭐⭐Unified interface for 10+ AI image backends with batch generation and auto provider selection
skills/baoyu-post-to-wechat/scripts/wechat-browser.tsTypeScript~741⭐⭐⭐⭐⭐Chrome CDP-driven WeChat Official Account backend with SOCKS5 remote proxy publishing
skills/baoyu-post-to-wechat/scripts/cdp.tsTypeScript~255⭐⭐⭐Cross-platform Chrome CDP launcher with Windows/Mac/Linux/WSL support
packages/baoyu-md/src/document.tsTypeScript~206⭐⭐⭐⭐Full Markdown→HTML rendering pipeline with 11 WeChat-compatible themes
skills/baoyu-danger-x-to-markdown/scripts/thread.tsTypeScript~311⭐⭐⭐⭐X/Twitter thread parsing and Markdown conversion
skills/baoyu-translate/scripts/main.tsTypeScript~55⭐⭐Three-tier translation workflow router (quick/normal/refined)
packages/baoyu-chrome-cdp/src/index.tsTypeScript~300⭐⭐⭐⭐Chrome launch/connect/CDP communication wrapper
packages/baoyu-codex-imagegen/src/main.tsTypeScript~200⭐⭐⭐Codex CLI image generation proxy with caching and retry validation
packages/baoyu-fetch/src/cli.tsTypeScript~150⭐⭐⭐Multi-adapter URL fetcher with site-specific adapters (Hacker News, etc.)
scripts/publish-skill.mjsJavaScript~200⭐⭐⭐Tool for independently publishing a single skill to ClawHub

baoyu-image-gen/main.ts — 多后端图像生成引擎

Section titled “baoyu-image-gen/main.ts — 多后端图像生成引擎”

main.ts 是整个 skill 集中规模最大的单文件(1249 行),实现了 10+ AI 图像生成后端的统一抽象层。核心设计是 Provider 插件模式——每个后端实现 ProviderModule 接口(getDefaultModel / generateImage / validateArgs),通过 Provider 自动选择算法决定使用哪个后端。

main.ts is the largest single file in the entire skill set (1249 lines), implementing a unified abstraction layer over 10+ AI image generation backends. The core design is a Provider plugin pattern — each backend implements the ProviderModule interface (getDefaultModel / generateImage / validateArgs), with a Provider auto-selection algorithm deciding which backend to use.

main.ts — Provider 插件模式与并发控制 ↗ 源文件
1 type ProviderModule = { 2 getDefaultModel: () => string; 3 generateImage: (prompt: string, model: string, args: CliArgs) => Promise<Uint8Array>; 4 validateArgs?: (model: string, args: CliArgs) => void; 5 getDefaultOutputExtension?: (model: string, args: CliArgs) => string; 6 }; 7 8 const DEFAULT_PROVIDER_RATE_LIMITS: Record<Provider, ProviderRateLimit> = { 9 replicate: { concurrency: 5, startIntervalMs: 700 }, 10 google: { concurrency: 3, startIntervalMs: 1100 }, 11 openai: { concurrency: 3, startIntervalMs: 1100 }, 12 // ... 7 more providers with specific rate limits 13 "codex-cli": { concurrency: 1, startIntervalMs: 2000 }, 14 }; 15 16 const MAX_ATTEMPTS = 3;
代码解读
L1 ProviderModule 接口是核心抽象——每个 AI 后端只需实现 2 个必需方法即可接入。validateArgs 和 getDefaultOutputExtension 是可选的差异化钩子 L8 DEFAULT_PROVIDER_RATE_LIMITS 为每个 Provider 定制并发数和启动间隔。replicate 有最高的 5 并发(因为其 API 支持),codex-cli 只有 1 并发(CLI 进程互斥) L14 MAX_ATTEMPTS = 3 提供自动重试能力——API 调用失败时不会立即放弃,而是最多重试 3 次 L15 整个设计体现了「对扩展开放,对修改关闭」的开闭原则——新增 Provider 只需实现接口并注册,无需改动核心调度逻辑

baoyu-post-to-wechat/scripts/cdp.ts — 跨平台 Chrome CDP 启动器

Section titled “baoyu-post-to-wechat/scripts/cdp.ts — 跨平台 Chrome CDP 启动器”

cdp.ts 封装了 Chrome CDP(Chrome DevTools Protocol)的完整启动生命周期。最精妙的设计是 WSL 路径桥接——当检测到 WSL 环境时,自动通过 cmd.exe 获取 Windows 用户目录并在 WSL 中映射路径。此外,跨平台 Chrome 候选路径覆盖 macOS/Windows/Linux 三大平台和多种 Chrome 衍生浏览器。

cdp.ts encapsulates the complete Chrome CDP launch lifecycle. The most elegant design is the WSL path bridging — when a WSL environment is detected, it automatically retrieves the Windows user directory via cmd.exe and maps the path in WSL. Cross-platform Chrome candidate paths cover all three major platforms and multiple Chrome-derived browsers.

cdp.ts — WSL 路径桥接与跨平台适配 ↗ 源文件
1 function getWslWindowsHome(): string | null { 2 if (wslHome !== undefined) return wslHome; 3 if (!process.env.WSL_DISTRO_NAME) { 4 wslHome = null; 5 return null; 6 } 7 const raw = execSync('cmd.exe /C "echo %USERPROFILE%"', { 8 encoding: 'utf-8', 9 timeout: 5_000, 10 }).trim().replace(/\r/g, ''); 11 wslHome = execSync(`wslpath -u "${raw}"`, { 12 encoding: 'utf-8', 13 timeout: 5_000, 14 }).trim() || null; 15 return wslHome; 16 } 17 18 const CHROME_CANDIDATES_FULL: PlatformCandidates = { 19 darwin: [ 20 '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', 21 '/Applications/Google Chrome Canary.app/.../Google Chrome Canary', 22 // Chromium, Edge also listed 23 ], 24 win32: [ 25 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe', 26 // Edge also listed 27 ], 28 default: [ // Linux 29 '/usr/bin/google-chrome', 30 '/usr/bin/chromium', 31 '/snap/bin/chromium', 32 ], 33 };
代码解读
L1 getWslWindowsHome 实现了 WSL→Windows 的用户目录路径映射。缓存变量 wslHome 初始值为 undefined(未检测)、null(非 WSL)、或具体路径(WSL 已解析)——三态设计避免重复调用 L5 WSL_DISTRO_NAME 环境变量是判断是否在 WSL 中的可靠标志——只有真正的 WSL 才会设置此变量 L9 通过 cmd.exe 在 Windows 侧执行命令获取 USERPROFILE——这是跨 Linux↔Windows 边界通信的标准 WSL 模式 L12 wslpath -u 将 Windows 路径转换为 WSL 可访问的格式——WSL 内置工具,保证路径可访问性 L18 CHROME_CANDIDATES_FULL 覆盖 3 个平台 10+ 种 Chrome 变体路径——平台键使用 Node.js process.platform 的标准值(darwin/win32/default=linux) L20 macOS 优先使用 Google Chrome Stable,然后按 Canary → Beta → Chromium → Edge 降级。Canary 用于测试最新 CDP 特性

packages/baoyu-md/src/document.ts — Markdown 渲染管道

Section titled “packages/baoyu-md/src/document.ts — Markdown 渲染管道”

document.ts 是 Markdown→HTML 渲染管道的核心编排器。该模块将渲染过程拆分为独立可组合的阶段:Frontmatter 解析 → 渲染器初始化 → Markdown 转 HTML → HTML 后处理 → 主题 CSS 注入 → 内联样式。每个阶段都有独立的模块和可替换实现。最值得学习的设计是主题系统——11 套微信兼容主题,通过 ThemeName 类型安全地切换。

document.ts is the core orchestrator of the Markdown→HTML rendering pipeline. The module splits the rendering process into independently composable stages: Frontmatter parsing → Renderer init → Markdown to HTML → HTML post-processing → Theme CSS injection → Inline styles. Each stage has independent modules and swappable implementations. The most instructive design is the theme system — 11 WeChat-compatible themes, switchable via the type-safe ThemeName.

document.ts — 管道编排与类型安全主题 ↗ 源文件
1 export interface RenderMarkdownDocumentOptions { 2 codeTheme?: string; 3 countStatus?: boolean; 4 citeStatus?: boolean; 5 fontFamily?: string; 6 fontSize?: string; 7 isMacCodeBlock?: boolean; 8 isShowLineNumber?: boolean; 9 primaryColor?: string; 10 theme?: ThemeName; 11 themeMode?: IOpts["themeMode"]; 12 } 13 14 export interface RenderMarkdownDocumentResult { 15 contentHtml: string; 16 html: string; 17 meta: HtmlDocumentMeta; 18 readingTime: ReadTimeResults; 19 style: StyleConfig; 20 yamlData: Record<string, unknown>; 21 } 22 23 export function buildMarkdownDocumentMeta( 24 markdown: string, 25 yamlData: Record<string, unknown>, 26 defaultTitle = "document", 27 ): HtmlDocumentMeta { 28 const title = pickFirstString(yamlData, ["title"]) 29 || extractTitleFromMarkdown(markdown) 30 || defaultTitle; 31 // ... summary extraction, cover image detection 32 }
代码解读
L1 RenderMarkdownDocumentOptions 接口包含 10+ 个可选配置项——每个对应一个渲染维度。使用 TypeScript 的 ? 标记而非 Partial 泛型提供每个字段的 IDE 补全 L8 theme 字段使用 ThemeName 联合类型而非 string——编译期确保只能传入已注册的主题名,防止运行时找不到 CSS 文件 L13 RenderMarkdownDocumentResult 同时返回 contentHtml(纯内容)和 html(完整文档)——调用方可根据场景选择嵌入文章或生成独立页面 L18 yamlData: Record 保留所有 frontmatter 数据——不丢失用户自定义字段,体现了「不破坏原始数据」的设计原则 L23 buildMarkdownDocumentMeta 的 title 提取有三层兜底:YAML title → Markdown H1 → 默认值。每层都使用了空值合并运算符 || 而非 ?? ——因为空字符串需要也被兜底
  1. Skill 自包含原则:每个 skills/baoyu-*/ 目录可独立分发——禁止从 SKILL.md 引用 ../../docs/ 或其他 skill。共享约定内联复制到每个 SKILL.md 的专用章节(如 ## User Input Tools),确保提取后仍可用
  2. Provider 插件模式:图像生成后端通过 ProviderModule 接口统一——新增后端只需实现 2 个方法,不改核心调度代码。并发控制按 Provider 粒度定制,replicate 5 并发 vs codex-cli 1 并发
  3. 三态缓存设计:WSL 路径检测中 wslHome 变量使用 undefined(未检测)/ null(已检测但非 WSL)/ string(WSL 路径)三态——单次检测、永久缓存、零重复开销
  4. Chrome CDP 反反自动化:通过真实 Chrome 浏览器 + CDP 协议操作公众号/微博后台——绕过前端反自动化检测,同时保留用户的登录 Session。远程 SOCKS5 SSH 代理模式解决了微信 IP 白名单限制
  5. 多档位工作流:翻译 skill 提供 quick/normal/refined 三档——快速满足简单需求,精细满足出版级质量。用户根据场景选择,不强制一刀切
  6. Starship 风格 TypeScript:全项目无注释、async/await、短变量名、类型安全的接口——代码即文档的设计风格,适合有经验的开发者快速阅读
模式应用位置说明
Provider 插件模式baoyu-image-gen/scripts/main.ts通过接口抽象多后端,新增后端不改调度逻辑
三态缓存baoyu-post-to-wechat/scripts/cdp.tsundefined/null/value 区分未检测/已检测无结果/已检测有结果
自包含 Skill 布局所有 skills/baoyu-*/SKILL.md内联约定 + 外挂参考,确保独立可分发性
多档位工作流baoyu-translate/SKILL.md快速/标准/精细三档满足不同品质需求
CDP 浏览器自动化baoyu-post-to-wechat/scripts/通过 Chrome DevTools Protocol 操作需要登录的 Web 后台
管道式渲染packages/baoyu-md/src/document.ts解析→渲染→后处理→主题→内联,每阶段独立可替换
PatternLocationDescription
Provider Plugin Patternbaoyu-image-gen/scripts/main.tsAbstract multiple backends via interface; add backends without changing scheduling logic
Three-State Cachingbaoyu-post-to-wechat/scripts/cdp.tsundefined/null/value distinguishes unchecked/checked-empty/checked-found
Self-Contained Skill LayoutAll skills/baoyu-*/SKILL.mdInline conventions + external references ensure independent distributability
Multi-Tier Workflowbaoyu-translate/SKILL.mdQuick/normal/refined tiers meet different quality needs
CDP Browser Automationbaoyu-post-to-wechat/scripts/Use Chrome DevTools Protocol to operate login-required web backends
Pipeline Renderingpackages/baoyu-md/src/document.tsParse→Render→Postprocess→Theme→Inline, each stage independently replaceable

baoyu-skill 的核心价值在于 将复杂的自媒体工作流编码为 AI Agent 可执行的指令+脚本。如果要移植这套体系到其他 Agent 平台:

  1. 提取特定 skill 目录(如 skills/baoyu-post-to-wechat/)——因为每个 skill 自包含
  2. 适配 Chrome CDP 启动逻辑——cdp.ts 的跨平台路径可能需要根据目标环境微调
  3. 替换 AI 图像后端——baoyu-image-gen 的 Provider 接口设计使替换只需实现一个模块
  4. 对于纯指令型 skill(如 baoyu-cover-imagebaoyu-comic)——直接复制 SKILL.md + references/ 即可在其他 Agent 中使用
  • ⚠️ Bun 运行时依赖:所有 TypeScript 脚本使用 Bun 运行(bun scripts/main.ts),无编译步骤。如果目标环境没有 Bun,需要改造为 Node.js + tsx 或提前编译。CLAUDE.md 提供了 fallback:npx -y bun
  • ⚠️ Chrome 版本兼容性:CDP 协议版本与 Chrome 版本绑定。如果目标环境 Chrome 版本过老(低于 100),某些 CDP 命令可能不可用
  • ⚠️ 微信 IP 白名单:公众号 API 发布需要将运行机器的 IP 加入微信白名单。baoyu-skill 提供了 SOCKS5 SSH 代理模式绕过此限制——但需要一台 IP 已被加白的远程服务器
  • ⚠️ Skill 间不共享状态:21 个 skill 彼此独立,没有共享数据库或配置文件。如果需要「翻译后自动发布」这类流水线,需要在 Agent 层编排多 skill 调用
  • ⚠️ 环境变量命名约定:多个图像后端各自读取不同的环境变量(如 DASHSCOPE_API_KEYJIMENG_ACCESS_KEY_ID)——初次配置时容易遗漏
  1. Skill Self-Containment Principle: Each skills/baoyu-*/ directory is independently distributable — SKILL.md is forbidden from referencing ../../docs/ or other skills. Shared conventions are inlined into each SKILL.md in dedicated sections (e.g., ## User Input Tools), ensuring functionality after extraction
  2. Provider Plugin Pattern: Image generation backends unified via ProviderModule interface — adding a new backend requires only implementing 2 methods without touching core scheduling. Concurrency control is per-Provider granular: replicate at 5 vs codex-cli at 1
  3. Three-State Caching: The WSL path detection variable uses undefined (unchecked) / null (checked, not WSL) / string (WSL path) — one detection, permanent caching, zero repeat overhead
  4. Chrome CDP Anti-Anti-Automation: Operates WeChat Official Account/Weibo backends through real Chrome browser + CDP — bypassing frontend anti-automation while preserving user login sessions. Remote SOCKS5 SSH proxy mode solves WeChat IP allowlist restrictions
  5. Multi-Tier Workflow: The translation skill offers quick/normal/refined tiers — fast for simple needs, refined for publication quality. Users choose based on context, no forced one-size-fits-all
  6. Starship-Style TypeScript: Project-wide: no comments, async/await, short variable names, type-safe interfaces — code-as-documentation style suited for experienced developers
模式应用位置说明
Provider 插件模式baoyu-image-gen/scripts/main.ts通过接口抽象多后端
三态缓存baoyu-post-to-wechat/scripts/cdp.tsundefined/null/value 三态区分
自包含 Skill 布局所有 skills/baoyu-*/SKILL.md内联约定 + 外挂参考
多档位工作流baoyu-translate/SKILL.md快速/标准/精细三档
CDP 浏览器自动化baoyu-post-to-wechat/scripts/Chrome DevTools Protocol 操作 Web 后台
管道式渲染packages/baoyu-md/src/document.ts解析→渲染→后处理→主题→内联
PatternLocationDescription
Provider Plugin Patternbaoyu-image-gen/scripts/main.tsAbstract multiple backends via interface
Three-State Cachingbaoyu-post-to-wechat/scripts/cdp.tsundefined/null/value three-state
Self-Contained Skill LayoutAll skills/baoyu-*/SKILL.mdInline conventions + external references
Multi-Tier Workflowbaoyu-translate/SKILL.mdQuick/normal/refined tiers
CDP Browser Automationbaoyu-post-to-wechat/scripts/Chrome DevTools Protocol for web backends
Pipeline Renderingpackages/baoyu-md/src/document.tsParse→Render→Postprocess→Theme→Inline

baoyu-skill’s core value is encoding complex self-media workflows as AI Agent-executable instructions + scripts. To port this system to another Agent platform:

  1. Extract a specific skill directory (e.g., skills/baoyu-post-to-wechat/) — each skill is self-contained
  2. Adapt the Chrome CDP launch logic — cdp.ts cross-platform paths may need tweaking for the target environment
  3. Swap AI image backends — baoyu-image-gen’s Provider interface makes replacement just implementing one module
  4. For pure-instruction skills (e.g., baoyu-cover-image, baoyu-comic) — directly copy SKILL.md + references/ for use in other Agents
  • ⚠️ Bun Runtime Dependency: All TypeScript scripts run via Bun (bun scripts/main.ts) without compilation. If Bun isn’t available in the target environment, refactor to Node.js + tsx or pre-compile. CLAUDE.md provides a fallback: npx -y bun
  • ⚠️ Chrome Version Compatibility: CDP protocol versions are tied to Chrome versions. If the target Chrome is too old (below 100), some CDP commands may be unavailable
  • ⚠️ WeChat IP Allowlist: WeChat Official Account API publishing requires the running machine’s IP in WeChat’s allowlist. baoyu-skill provides a SOCKS5 SSH proxy mode to bypass this — but requires a remote server with an allowlisted IP
  • ⚠️ No Cross-Skill State: The 21 skills are independent with no shared database or config files. If you need a pipeline like “translate then auto-publish”, orchestrate multiple skill calls at the Agent level
  • ⚠️ Env Var Naming Conventions: Multiple image backends read different env vars (e.g., DASHSCOPE_API_KEY, JIMENG_ACCESS_KEY_ID) — easy to miss during initial setup