
Xiaohongshu Cover Generator
Generate a Xiaohongshu-style cover PNG from a topic for posts aimed at Chinese social audiences.
Overview
Xiaohongshu Cover Generator is an agent skill for the Grow phase that creates Xiaohongshu-style cover images from a topic via the Canghe API and saves PNGs to the project folder.
Install
npx skills add https://github.com/freestylefly/xiaohongshu-skills --skill xiaohongshu-cover-generatorWhat is this skill?
- Triggers on 小红书封面, Xiaohongshu cover, 封面生成, or topic-based cover requests
- Runs scripts/handler.ts with npx tsx and saves xiaohongshu-cover-{timestamp}.png to the project directory
- Uses CANGHE_API_KEY (env or argument) against api.canghe.ai
- Confirms topic with the user when ambiguous before generation
- Output filename pattern xiaohongshu-cover-{timestamp}.png
- Handler at scripts/handler.ts invoked via npx tsx
Adoption & trust: 1.5k installs on skills.sh; 90 GitHub stars; 1/3 security scanners passed (skills.sh audits).
What problem does it solve?
You have a post topic for 小红书 but no on-brand cover and no time to design one manually.
Who is it for?
Indie builders publishing on Xiaohongshu who want one-click topic-to-cover generation inside the agent.
Skip if: Teams needing brand-locked Figma systems, non-Chinese platform formats only, or offline image generation without a Canghe key.
When should I use this skill?
User wants a Xiaohongshu-style cover image, mentions 小红书封面 / Xiaohongshu cover / 封面生成, or provides a topic for cover generation.
What do I get? / Deliverables
A timestamped xiaohongshu-cover PNG lands in your repo directory, ready to attach to a Xiaohongshu post.
- PNG file xiaohongshu-cover-{timestamp}.png in the current working directory
Recommended Skills
Journey fit
Grow is where solo builders produce recurring social creative assets to feed distribution channels. Content is the natural shelf for cover art generation tied to posts and campaigns rather than app-store or SEO copy.
How it compares
A topic-driven image generator skill—not a full Canva-style layout editor or analytics suite.
Common Questions / FAQ
Who is xiaohongshu-cover-generator for?
Solo builders and creators distributing on Xiaohongshu who want agent-driven cover art from a short topic prompt.
When should I use xiaohongshu-cover-generator?
Use it in Grow when drafting social content and the user asks for 小红书封面, Xiaohongshu cover, 封面生成, or supplies a topic for a cover image.
Is xiaohongshu-cover-generator safe to install?
Check the Security Audits panel on this page; the skill calls an external API with your CANGHE_API_KEY and writes files to your project directory.
SKILL.md
READMESKILL.md - Xiaohongshu Cover Generator
# Xiaohongshu Cover Generator This skill generates Xiaohongshu-style cover images based on user-provided topics. ## Usage When a user requests a Xiaohongshu cover image: 1. Confirm the topic with the user if not clear 2. Check for API key (CANGHE_API_KEY environment variable or ask user to provide it) 3. Run the generation script with the topic 4. The image will be saved to the current working directory with filename format: `xiaohongshu-cover-{timestamp}.png` ## Running the Script The script is located at `scripts/handler.ts` and requires: - Topic (required): The subject for the cover image - API Key (required): Either via environment variable `CANGHE_API_KEY` or passed as argument Execute with: ```bash cd ~/.codebuddy/skills/xiaohongshu-cover-generator npx tsx scripts/handler.ts "<topic>" "<api-key-optional>" ``` Or with environment variable: ```bash cd ~/.codebuddy/skills/xiaohongshu-cover-generator CANGHE_API_KEY="your-api-key" npx tsx scripts/handler.ts "<topic>" ``` ## API Key Users need a valid API key from https://api.canghe.ai/ If the API key is missing or invalid, provide the user with clear instructions to obtain one. ## Output The generated image will be saved to **the directory where the skill was invoked** (current working directory), not the skill's directory. The filename format is `xiaohongshu-cover-{timestamp}.png` where timestamp is in milliseconds. ## Style Specifications The generated images follow these specifications: - Aspect ratio: 3:4 (vertical, mobile-friendly) - Style: Clean, refined, youthful aesthetic - Automatic removal of watermarks and logos - High-quality output suitable for mobile viewing - Text should be clear and readable with appropriate sizing import { request } from 'https'; interface GenerationOptions { topic: string; referenceImage?: string; apiKey?: string; } interface ChatMessage { role: 'user' | 'assistant'; content: Array<{ type: 'text' | 'image_url'; text?: string; image_url?: { url: string; }; }>; } interface APIResponse { id: string; model: string; object: string; created: number; choices: Array<{ index: number; message: { role: string; content: string; }; finish_reason: string; }>; usage: { prompt_tokens: number; completion_tokens: number; total_tokens: number; }; } // 系统提示词 const SYSTEM_PROMPT = `请生成一张小红书风格的图文内容图片。 【合规特别注意的】注意不要带有任何小红书的logo,不要有右下角的用户id以及logo 【合规特别注意的】用户给到的参考图片里如果有水印和logo(尤其是注意右下角,左上角),请一定要去掉 页面内容:{page_content} 页面类型:{page_type} 如果当前页面类型不是封面页的话,你要参考最后一张图片作为封面的样式 后续生成风格要严格参考封面的风格,要保持风格统一。 设计要求: 1. 整体风格 - 小红书爆款图文风格 - 清新、精致、有设计感 - 适合年轻人审美 - 配色和谐,视觉吸引力强 2. 文字排版 - 文字清晰可读,字号适中 - 重要信息突出显示 - 排版美观,留白合理 - 支持 emoji 和符号 - 如果是封面,标题要大而醒目 3. 视觉元素 - 背景简洁但不单调 - 可以有装饰性元素(如图标、插画) - 配色温暖或清新 - 保持专业感 4. 页面类型特殊要求 [封面] 类型: - 标题占据主要位置,字号最大 - 副标题居中或在标题下方 - 整体设计要有吸引力和冲击力 - 背景可以更丰富,有视觉焦点 [内容] 类型: - 信息层次分明 - 列表项清晰展示 - 重点内容用颜色或粗体强调 - 可以有小图标辅助说明 [总结] 类型: - 总结性文字突出 - 可以有勾选框或完成标志 - 给人完成感和满足感 - 鼓励性的视觉元素 5. 技术规格 - 竖版 3:4 比例(小红书标准) - 高清画质 - 适合手机屏幕查看 - 所有文字内容必须完整呈现 - 【特别注意】无论是给到的图片还是参考文字,请仔细思考,让其符合正确的竖屏观看的排版,不能左右旋转或者是倒置。 6. 整体风格一致性 为确保所有页面风格统一,请参考完整的内容大纲和用户原始需求来确定: - 整体色调和配色方案 - 设计风格(清新/科技/温暖/专业等) - 视觉元素的一致性 - 排版布局的统一风格 用户原始需求: {user_topic} 完整内容大纲参考: --- {full_outline} --- 请根据以上要求,生成一张精美的小红书风格图片。请直接给出图片,不要有任何手机边框,或者是白色留边。`; export async function generate(options: GenerationOptions): Promise<Buffer> { const { topic, referenceImage, apiKey } = options; // 验证 API Key if (!apiKey) { throw new Error( '缺少 API Key。请前往 https://api.canghe.ai/ 获取您的 API Key。' ); } // 构建系统提示词,替