Catalog
JimLiu/baoyu-post-to-weibo

JimLiu

baoyu-post-to-weibo

Posts content to Weibo (微博). Supports regular posts with text, images, and videos, and headline articles (头条文章) with Markdown input via Chrome CDP. Use when user asks to "post to Weibo", "发微博", "发布微博", "publish to Weibo", "share on Weibo", "写微博", or "微博头条文章".

NewUpdated Nov 3, 2026

Post to Weibo

Posts via a real Chrome browser (CDP), which avoids anti-bot detection. Scripts only fill content in the browser — the user reviews and publishes manually.

Script Directory

{baseDir} = this SKILL.md's directory; scripts are at {baseDir}/scripts/<script-name>.ts. Resolve ${BUN_X}: bun if installed → else npx -y bun → else suggest installing bun.

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)

First 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

None found → use defaults. Supported: default Chrome profile.

Prerequisites

Google Chrome or Chromium; bun. First run: user logs in to Weibo manually (session persists). Works on macOS, Linux, Windows.

Post Type Selection

Unless the user specifies: Markdown file (.md) → Headline Article (头条文章); plain text / text with images → Regular Post.

Regular Posts

Text + images/videos (max 18 files total), posted on the 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
Parameter Description
<text> Post content (positional)
--image <path> Image file (repeatable)
--video <path> Video file (repeatable)
--profile <dir> Custom Chrome profile

Headline Articles (头条文章)

Editor: 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
Parameter Description
<markdown> Markdown file (positional)
--cover <path> Cover image
--title <text> Override title (max 32 chars, truncated with warning if longer)
--summary <text> Override summary/导语 (max 44 chars, auto-regenerated from content if longer)
--profile <dir> Custom Chrome profile

Frontmatter: title, summary, cover_image.

Markdown-to-HTML: do NOT pass any --theme when converting; use the default theme.

Script flow: opens the editor → clicks "写文章" and waits until editable → fills title and summary → pastes HTML into the ProseMirror editor → replaces image placeholders one by one (copy image → select placeholder → paste).

Post-composition check: the script then reports remaining WBIMGPH_ placeholders and expected vs actual image count. If it prints warnings, tell the user the specific issues before they publish.

Troubleshooting

Chrome debug port not ready / Unable to connect: automatically, without asking, kill only the CDP Chrome instances (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

Never kill all Chrome processes (pkill -f "Google Chrome") — the user may have regular Chrome windows open.

Extension Support

Custom configuration via EXTEND.md — see Preferences.

Files9
9 files · 107.3 KB

Select a file to preview

Overall Score

78/100

Grade

B

Good

Grades are signals, not a certification. Always review a skill yourself before use.

Safety

75

Quality

82

Clarity

78

Completeness

72

Summary

Skill that posts content to Weibo via Chrome DevTools Protocol (CDP), automating regular posts (text + images/videos) and headline articles (Markdown). Scripts fill content in a real browser window while user reviews and publishes manually, avoiding anti-bot detection.

Static Analysis Findings

1 finding

Patterns detected by deterministic static analysis before AI scoring. Hover over any finding code for detailed information and remediation guidance.

Credential Exposure
SEC-020Direct .env File Access

Direct .env file access

scripts/weibo-utils.ts.env

Detected Capabilities

file readfile write (temp dirs, HTML cache)shell execution (bun, npm, osascript, xdotool, powershell)browser automation (Chrome CDP)clipboard operations (image/HTML copy-paste)process spawning and process management (pkill)

Trigger Keywords

Phrases that agents use to match this skill to user intent.

post to weibopublish weibo articleweibo headline article微博发布share on weiboweibo markdownweibo with images

Risk Signals

INFO

Direct .env file access in weibo-utils.ts (getWslWindowsHome function accesses environment but no .env file operations detected)

scripts/weibo-utils.ts
INFO

Environment variable reads (WEIBO_BROWSER_CHROME_PATH, BAOYU_CHROME_PROFILE_DIR, WEIBO_BROWSER_PROFILE_DIR, WSL_DISTRO_NAME) — expected for browser path configuration

scripts/weibo-utils.ts
WARNING

Process spawning and potential process termination via pkill with profile-scoped filter (killChromeByProfile) — scoped to CDP Chrome instances only

scripts/weibo-utils.ts
INFO

Shell invocation via spawnSync for osascript, xdotool, ydotool, powershell — standard for clipboard and keyboard automation on macOS/Linux/Windows

scripts/paste-from-clipboard.ts, scripts/copy-to-clipboard.ts
INFO

File input via DOM.setFileInputFiles in weibo-post.ts — standard CDP file upload pattern, files are resolved locally

scripts/weibo-post.ts
INFO

Temporary directory creation (mkdtemp) for HTML cache and image staging — cleaned up after use

scripts/md-to-html.ts, scripts/copy-to-clipboard.ts

Referenced Domains

External domains referenced in skill content, detected by static analysis.

...card.weibo.comgithub.comweibo.com

Use Cases

  • Post regular Weibo updates with text and images
  • Publish formatted headline articles (Markdown-to-HTML)
  • Automate multi-image/video uploads to Weibo
  • Convert Markdown articles with embedded Mermaid diagrams for Weibo publishing
  • Manage Chrome browser sessions for persistent Weibo login

Quality Notes

  • Clear skill scope: posts to Weibo only, user reviews and publishes manually (no auto-publish).
  • Well-documented prerequisites and platform support (macOS, Linux, Windows).
  • Script directory structure and parameter table help users understand what each script does.
  • Troubleshooting section addresses a specific known issue (Chrome debug port conflicts) with safe remediation (profile-scoped pkill).
  • Error handling in scripts includes fallbacks (e.g., execCommand if Input.insertText fails) and verification checks (title length truncation, image placeholder detection).
  • Preference system (EXTEND.md) allows user customization but docs don't explain what settings are supported — would benefit from specific examples.
  • Markdown-to-HTML conversion includes support for Mermaid diagrams and image placeholder replacement, with warnings for content mismatches.
  • File upload validation (18 file max, file existence checks) prevents common user errors.
  • Cross-platform clipboard implementation (macOS Swift, Linux xclip/wl-copy, Windows PowerShell) is comprehensive but adds complexity.
  • Minor: SKILL.md mentions `.env` configuration but scripts do not read from .env files — environment variables are used directly, which is appropriate.
  • Post composition check reports placeholder/image count mismatches — helps user catch incomplete uploads before publishing.
Model: claude-haiku-4-5-20251001Analyzed: Nov 3, 2026

Reviews

Add this skill to your library to leave a review.

No reviews yet

Be the first to share your experience.

Version History

  1. v1.1

    Content updated

    ✦ AIClarifies that script fills content in browser and user must review and publish manually; reorganizes and compresses documentation.

    2026-11-03

    LATEST
  2. v1.0

    2026-07-12

    View This VersionInitial version

Use JimLiu/baoyu-post-to-weibo in your dev environment

Command Palette

Search for a command to run...