🦞 Buda Social Cards (Brand Storytelling Engine)
This skill generates "Apple-like" or "Buda-style" high-end presentations for social media (Xiaohongshu), perfect for brand narratives, event recaps, tutorials, and dense information.
It uses a pure HTML/Playwright rendering pipeline that seamlessly mixes:
- AI Illustrations (3D Pop style)
- Real Photos (from user workspace)
- Pure HTML Infographics (Timelines, VS comparisons, grids)
📐 The Workflow
Stage 1: Content & Layout Planning
- Extract 3-6 core scenes or punchy quotes from the text.
- Decide the card type for each scene:
image: Needs an AI illustration OR maps to a user-provided real photo/screenshot.
infographic: Needs high info-density (e.g., a VS comparison, a 3-step timeline, a checklist). Will be rendered purely with HTML/CSS.
- Check the workspace for existing real photos. If none, plan to generate AI illustrations.
Stage 2: AI Illustration Generation
- For missing visuals, use
generate_image (Size: 1024x1792).
- Brand Prompt Rule: You MUST append this exact suffix to EVERY prompt to maintain the Buda aesthetic:
, 3D pop illustration style, minimalist, abstract isometric elements, warm parchment background, matte gold accents, clean and trendy, no text.
Stage 3: HTML/Playwright Rendering Engine (Node.js)
Write a Node.js script using playwright to render cards.
CRITICAL SAFEGUARDS (Lessons Learned):
- Base64 Images: Never use
file:// paths in Playwright HTML. Read local images and convert them to base64 strings (data:image/jpeg;base64,...) before injecting them into <img> tags.
- String Templates: Avoid nested backticks or complex template literals when writing JS from the agent to prevent
SyntaxError in Bash. Use simple string concatenation ('data:image/...' + base64String) where necessary.
Strict CSS Rules:
- Viewport:
1080px × 1440px (3:4).
- Brand Colors:
- Background:
background-color: oklch(0.985 0.006 85); (Warm Parchment #F8F4E6)
- Accents:
color: oklch(0.52 0.076 78); (Matte Gold #A68A56)
- Typography: Load Google Fonts.
'Noto Serif SC', serif; for titles/quotes, and 'Inter', sans-serif; for body/numbers.
- Anti-Cutoff Layout (Flexbox):
- Container MUST use:
display: flex; flex-direction: column; flex: 1; padding-bottom: 60px; box-sizing: border-box;
- Image Wrapping (
type: "image"):
- Wrap images in a
.image-wrapper div.
- Use
object-fit: cover; and border-radius: 40px; with box-shadow: 0 30px 60px rgba(0,0,0,0.12);.
- Infographic Box (
type: "infographic"):
- Inject custom HTML directly instead of an
<img> tag.
- Example styles to implement:
.compare-card, .timeline, .step-num.
Stage 4: Headless Browser Snapshot
When taking the screenshot in Node.js:
headless: true
- Retina Sharpness: Set
deviceScaleFactor: 2.
- Wait for Network: Use
await page.setContent(html, { waitUntil: 'networkidle' }); and await page.waitForTimeout(2000); before page.screenshot().
Stage 5: Compression & Delivery
Playwright PNGs are too large and will crash Xiaohongshu automation. Compress to JPG:
convert output_card_raw.png -quality 85 final_card.jpg
Provide the user with the final compressed JPG files via standard delivery markers.
1---2name: buda-social-cards3description: Generates high-end social media image cards combining AI illustrations, real photos, and HTML infographics using Playwright.4---56# 🦞 Buda Social Cards (Brand Storytelling Engine)78This skill generates "Apple-like" or "Buda-style" high-end presentations for social media (Xiaohongshu), perfect for brand narratives, event recaps, tutorials, and dense information.910It uses a pure **HTML/Playwright rendering pipeline** that seamlessly mixes:111. **AI Illustrations** (3D Pop style)122. **Real Photos** (from user workspace)133. **Pure HTML Infographics** (Timelines, VS comparisons, grids)1415## 📐 The Workflow1617### Stage 1: Content & Layout Planning181. Extract **3-6 core scenes** or punchy quotes from the text.192. Decide the card type for each scene:20 - `image`: Needs an AI illustration OR maps to a user-provided real photo/screenshot.21 - `infographic`: Needs high info-density (e.g., a VS comparison, a 3-step timeline, a checklist). Will be rendered purely with HTML/CSS.223. Check the workspace for existing real photos. If none, plan to generate AI illustrations.2324### Stage 2: AI Illustration Generation251. For missing visuals, use `generate_image` (Size: `1024x1792`).262. **Brand Prompt Rule**: You MUST append this exact suffix to EVERY prompt to maintain the Buda aesthetic:27 > `, 3D pop illustration style, minimalist, abstract isometric elements, warm parchment background, matte gold accents, clean and trendy, no text.`2829### Stage 3: HTML/Playwright Rendering Engine (Node.js)30Write a Node.js script using `playwright` to render cards.3132**CRITICAL SAFEGUARDS (Lessons Learned):**33- **Base64 Images**: Never use `file://` paths in Playwright HTML. Read local images and convert them to base64 strings (`data:image/jpeg;base64,...`) before injecting them into `<img>` tags.34- **String Templates**: Avoid nested backticks or complex template literals when writing JS from the agent to prevent `SyntaxError` in Bash. Use simple string concatenation (`'data:image/...' + base64String`) where necessary.3536**Strict CSS Rules:**371. **Viewport**: `1080px × 1440px` (3:4).382. **Brand Colors**:39 - Background: `background-color: oklch(0.985 0.006 85);` (Warm Parchment #F8F4E6)40 - Accents: `color: oklch(0.52 0.076 78);` (Matte Gold #A68A56)413. **Typography**: Load Google Fonts. `'Noto Serif SC', serif;` for titles/quotes, and `'Inter', sans-serif;` for body/numbers.424. **Anti-Cutoff Layout (Flexbox)**:43 - Container MUST use: `display: flex; flex-direction: column; flex: 1; padding-bottom: 60px; box-sizing: border-box;`445. **Image Wrapping (`type: "image"`)**:45 - Wrap images in a `.image-wrapper` div.46 - Use `object-fit: cover;` and `border-radius: 40px;` with `box-shadow: 0 30px 60px rgba(0,0,0,0.12);`.476. **Infographic Box (`type: "infographic"`)**:48 - Inject custom HTML directly instead of an `<img>` tag.49 - Example styles to implement: `.compare-card`, `.timeline`, `.step-num`.5051### Stage 4: Headless Browser Snapshot52When taking the screenshot in Node.js:531. `headless: true`542. **Retina Sharpness**: Set `deviceScaleFactor: 2`.553. **Wait for Network**: Use `await page.setContent(html, { waitUntil: 'networkidle' });` and `await page.waitForTimeout(2000);` before `page.screenshot()`.5657### Stage 5: Compression & Delivery58Playwright PNGs are too large and will crash Xiaohongshu automation. Compress to JPG:59```bash60convert output_card_raw.png -quality 85 final_card.jpg61```62Provide the user with the final compressed JPG files via standard delivery markers.