mugpeng/oh-my-skills-diy/archive-peng-post-to-xhs

Claude Code and agent skill by mugpeng/oh-my-skills-diy

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Generates Xiaohongshu image cards via Google Gemini and publishes them to 小红书. Single Gemini provider with custom GOOGLE_BASE_URL support. Combined image generation + publishing workflow. Use when user asks to create XHS cards, generate 小红书 images, or post to 小红书.

Install

npx vskill@latest install mugpeng/oh-my-skills-diy/archive-peng-post-to-xhs

SKILL.md

The same SKILL.md was published earlier as mugpeng/oh-my-skills-diy/archive-peng-post-to-xhs.

Post to Xiaohongshu

Generate Xiaohongshu image cards from prompts using Google Gemini image models, then publish them to 小红书 — all in one workflow.

Script Directory

{baseDir} = this SKILL.md's directory. Resolve ${BUN_X}: prefer bun; else npx -y bun; else suggest brew install oven-sh/bun/bun.

ScriptPurpose
scripts/main.tsGenerate image(s) via Gemini — single or batch
scripts/publish.tsFull workflow: generate images + publish to 小红书
XHS MCP Scripts (scripts/xhs/)

Wraps xiaohongshu-mcp for 小红书 publish.

ScriptPurpose
xhs/mcp-call.shUniversal MCP tool caller
xhs/start-mcp.shStart MCP service
xhs/stop-mcp.shStop MCP service
xhs/status.shCheck login status
xhs/install-check.shCheck dependencies (xiaohongshu-mcp, jq)

Prerequisites

  1. xiaohongshu-mcp binary: install from GitHub Releases to ~/.local/bin/
  2. jq: brew install jq
  3. GOOGLE_API_KEY env var set for image generation

Preferences (EXTEND.md)

Check these paths in order; first hit wins:

PathScope
.peng-skills/peng-post-to-xhs/EXTEND.mdProject
${XDG_CONFIG_HOME:-$HOME/.config}/peng-skills/peng-post-to-xhs/EXTEND.mdXDG
$HOME/.peng-skills/peng-post-to-xhs/EXTEND.mdUser home

Found -> read, parse, apply. Not found -> use defaults.

Supported keys:

KeyDefaultDescription
default_modelgemini-3.1-flash-image-previewGemini model ID
default_quality2knormal or 2k
default_aspect_ratio9:16Aspect ratio (9:16 for XHS portrait cards)
google_base_url(Google default)Custom base URL for proxy (e.g., https://openclaw.chatgo.best)

Value priority: CLI args -> EXTEND.md -> env vars -> defaults.

Environment Variables

VariableDescription
GOOGLE_API_KEYGoogle API key (required for image generation)
GEMINI_API_KEYAlias for GOOGLE_API_KEY
GOOGLE_BASE_URLOverride base URL (same as EXTEND.md google_base_url)
MCP_URLMCP endpoint (default http://localhost:18060/mcp)

Usage

Image Generation Only
bash
# Single image
${BUN_X} {baseDir}/scripts/main.ts --prompt "A cute cat" --image out.png
# With aspect ratio and quality
${BUN_X} {baseDir}/scripts/main.ts --prompt "XHS cover card" --image cover.png --ar 9:16 --quality 2k
# Prompt from files (concatenated)
${BUN_X} {baseDir}/scripts/main.ts --promptfiles style.md content.md --image out.png
# Batch mode from a directory of prompt files
${BUN_X} {baseDir}/scripts/main.ts --batchdir prompts/ --images-dir output/
Generate + Publish (recommended)
bash
# Full workflow: generate images from prompts then publish to 小红书
${BUN_X} {baseDir}/scripts/publish.ts \
--batchdir prompts/ \
--title "我的小红书标题" \
--content "正文内容,最多1000字" \
--tags "标签1" "标签2"
# Skip image generation, publish existing images
${BUN_X} {baseDir}/scripts/publish.ts \
--skip-gen \
--images output/01-cover.png output/02-content.png \
--title "标题" \
--content "正文" \
--tags "AI工具" "效率"
# Publish with content from a markdown file
${BUN_X} {baseDir}/scripts/publish.ts \
--images cover.png content.png \
--title "标题" \
--content-file article.md \
--tags "教程" "小红书"
# Schedule publish (1 hour ~ 14 days later)
${BUN_X} {baseDir}/scripts/publish.ts \
--batchdir prompts/ \
--title "标题" \
--content "正文" \
--schedule-at "2026-06-02T10:00:00+08:00"
First-time Login

The publish script checks login automatically. If not logged in, it prompts you to scan a QR code:

bash
# Manual login (if needed)
cd {baseDir}/scripts/xhs && ./start-mcp.sh
cd {baseDir}/scripts/xhs && ./mcp-call.sh get_login_qrcode
# → scan QR with 小红书 app

Batch Mode

Place .md prompt files in a directory. Each file becomes one image card.

prompts/
├── 01-cover.md
├── 02-content-1.md
├── 03-content-2.md
├── 04-content-3.md
├── 05-content-4.md
└── 06-ending.md

Generate images:

bash
${BUN_X} {baseDir}/scripts/main.ts --batchdir prompts/ --images-dir output/

Or generate and publish in one step:

bash
${BUN_X} {baseDir}/scripts/publish.ts \
--batchdir prompts/ \
--title "标题" \
--content "正文" \
--tags "aweskill" "AI Agent"

Publish Options

OptionDescription
--title <text>Post title (max 20 chars)
--content <text>Post body (max 1000 chars)
--content-file <path>Read body from file
--images <paths...>Image file paths
--tags <tags...>Topic tags
--batchdir <dir>Generate images from prompt dir, then publish
--images-dir <dir>Output dir for generated images (with --batchdir)
--schedule-at <ISO8601>Schedule publish (1h~14d)
--skip-genSkip generation, publish existing images only
--jsonJSON output

小红书 Restrictions

  • Title: max 20 characters
  • Body: max 1000 characters
  • Images: at least 1, formats PNG/JPG
  • Tags: topic labels, optional
  • Daily limit: 50 posts
  • Schedule: 1 hour to 14 days in advance (ISO8601 format)

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/mugpeng/oh-my-skills-diy/archive-peng-post-to-xhs/badge)](https://verified-skill.com/skills/mugpeng/oh-my-skills-diy/archive-peng-post-to-xhs)

Something wrong with this skill or its page? Tell us.