xiaohongshu
xiaohongshu
marp-image-generator
Generate optimized images for Marp slides using Playwright MCP with theme-matching color palettes and guideline-compliant sizes
Full skill instructions
This skill generates images optimized for Marp presentations (16:9 format) using Playwright MCP. It creates HTML-based diagrams with theme-matching color palettes (canyon-custom or github-dark) and converts them to PNG screenshots at guideline-compliant sizes.
Image Size Reference (from docs/spec/marp/image-size-guideline.md):
| Use Case | Recommended Size | Aspect Ratio |
|---|---|---|
| Full-size image | 1216px × 582px | 2.09:1 |
| Safe area (recommended) | 1100px × 550px | 2:1 |
| 16:9 image | 1034px × 582px | 16:9 |
| Two-column (per image) | 550px × 400px | 1.375:1 |
| imageCenter | 900px × 600px | 3:2 |
| imageFull | 1280px × 720px | 16:9 |
| Retina (2x) | 2200px × 1100px | 2:1 |
Most Common Use Cases:
Canyon-Custom Theme Colors:
#d4ed00 (yellow-green)#333333 (dark gray)#00bcd4 (cyan)#ffffff (white)#d4ed00 border on #f0f7d8 background#01ad09 border on #dbecdc background#b47800 border on #f5f0c6 background#ad0140 border on #f0dce3 backgroundGitHub-Dark Theme Colors:
#0d1117#161b22#21262d#f0f6fc#7d8590#30363d#1f6feb (blue)#238636 (green)#da3633 (red)#9e6a03 (yellow)Design Principle: NO GRADIENTS - Use solid colors and subtle color variations only
HTML files should be saved to application/marp/src/html/ with this template:
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Diagram Title</title>
<script src="https://cdn.tailwindcss.com"></script>
<script>
tailwind.config = {
theme: {
extend: {
fontFamily: {
'sans': ['"Hiragino Sans"', '"ヒラギノ角ゴシック"', '"Yu Gothic"', '"游ゴシック"', '"Noto Sans JP"', 'sans-serif']
},
colors: {
// Canyon-Custom theme colors
'canyon-primary': '#d4ed00',
'canyon-secondary': '#333333',
'canyon-accent': '#00bcd4',
'canyon-bg': '#ffffff',
'canyon-box-blue': '#f0f7d8',
'canyon-box-green': '#dbecdc',
'canyon-box-yellow': '#f5f0c6',
'canyon-box-red': '#f0dce3',
// GitHub-Dark theme colors
'gh-bg-primary': '#0d1117',
'gh-bg-secondary': '#161b22',
'gh-bg-tertiary': '#21262d',
'gh-text-primary': '#f0f6fc',
'gh-text-secondary': '#7d8590',
'gh-border': '#30363d',
'gh-accent': '#1f6feb',
'gh-success': '#238636',
'gh-danger': '#da3633',
'gh-warning': '#9e6a03',
}
}
}
}
</script>
<style>
body {
width: 1100px; /* Adjust based on target size */
height: 550px;
}
</style>
</head>
<body class="bg-white font-sans flex items-center justify-center p-10">
<!-- Canyon-Custom example -->
<!-- For GitHub-Dark: change class to "bg-gh-bg-primary text-gh-text-primary" -->
<div class="w-full h-full">
<!-- Diagram content here -->
</div>
</body>
</html>
Naming Convention: Use snake_case (e.g., comparison_chart.html, workflow_diagram.html)
Use Playwright MCP:
Navigate to: file:///home/node/workspace/application/marp/src/html/[filename].html
Browser Resize (set body width/height to match target dimensions):
Use mcp__playwright__browser_take_screenshot:
filename: application/marp/src/assets/[diagram-name].pngtype: pngfullPage: false (capture viewport only for exact size)IMPORTANT - Move to Correct Location: After taking screenshot, ALWAYS move from Playwright MCP directory to assets directory:
mv /home/node/workspace/.playwright-mcp/application/marp/src/assets/[diagram-name].png /home/node/workspace/application/marp/src/assets/[diagram-name].png

Target Size: 1100px × 550px Use Case: Before/After, Pros/Cons
<body class="bg-white text-canyon-secondary font-sans flex items-center justify-center p-10">
<div class="w-full h-full flex gap-10">
<div class="flex-1 border-3 border-canyon-primary bg-canyon-box-blue p-8 flex flex-col rounded-lg">
<h2 class="text-canyon-primary text-3xl font-bold mb-5 border-b-2 border-canyon-primary pb-2">
Before
</h2>
<ul class="list-none text-xl leading-relaxed space-y-2">
<li class="flex items-start">
<span class="text-canyon-primary mr-3">●</span>
<span>Item 1</span>
</li>
<li class="flex items-start">
<span class="text-canyon-primary mr-3">●</span>
<span>Item 2</span>
</li>
<li class="flex items-start">
<span class="text-canyon-primary mr-3">●</span>
<span>Item 3</span>
</li>
</ul>
</div>
<div class="flex-1 border-3 border-canyon-primary bg-canyon-box-blue p-8 flex flex-col rounded-lg">
<h2 class="text-canyon-primary text-3xl font-bold mb-5 border-b-2 border-canyon-primary pb-2">
After
</h2>
<ul class="list-none text-xl leading-relaxed space-y-2">
<li class="flex items-start">
<span class="text-canyon-primary mr-3">●</span>
<span>Item 1</span>
</li>
<li class="flex items-start">
<span class="text-canyon-primary mr-3">●</span>
<span>Item 2</span>
</li>
<li class="flex items-start">
<span class="text-canyon-primary mr-3">●</span>
<span>Item 3</span>
</li>
</ul>
</div>
</div>
</body>
Target Size: 1100px × 550px Use Case: Feature highlights, key points
<body class="bg-gh-bg-primary text-gh-text-primary font-sans flex items-center justify-center p-10">
<div class="w-full h-full flex items-center justify-center">
<div class="bg-gh-bg-secondary border-2 border-gh-accent border-l-8 p-10 rounded-lg max-w-4xl">
<h1 class="text-gh-accent text-5xl font-bold mb-8">
Key Features
</h1>
<ul class="list-none text-3xl leading-loose space-y-4">
<li class="flex items-start">
<span class="text-gh-success text-4xl mr-4">✓</span>
<span>Feature 1</span>
</li>
<li class="flex items-start">
<span class="text-gh-success text-4xl mr-4">✓</span>
<span>Feature 2</span>
</li>
<li class="flex items-start">
<span class="text-gh-success text-4xl mr-4">✓</span>
<span>Feature 3</span>
</li>
</ul>
</div>
</div>
</body>
Target Size: 1100px × 550px Use Case: Workflow, step-by-step guide
<body class="bg-white text-canyon-secondary font-sans flex items-center justify-center p-10">
<div class="w-full h-full flex items-center justify-between px-5">
<div class="flex-1 text-center p-5">
<div class="w-20 h-20 bg-canyon-primary text-canyon-secondary rounded-full flex items-center justify-center text-4xl font-bold mx-auto mb-5">
1
</div>
<div class="text-2xl font-bold mb-2">Plan</div>
<div class="text-lg text-gray-600">Define requirements</div>
</div>
<div class="text-6xl text-canyon-accent">→</div>
<div class="flex-1 text-center p-5">
<div class="w-20 h-20 bg-canyon-primary text-canyon-secondary rounded-full flex items-center justify-center text-4xl font-bold mx-auto mb-5">
2
</div>
<div class="text-2xl font-bold mb-2">Build</div>
<div class="text-lg text-gray-600">Implement features</div>
</div>
<div class="text-6xl text-canyon-accent">→</div>
<div class="flex-1 text-center p-5">
<div class="w-20 h-20 bg-canyon-primary text-canyon-secondary rounded-full flex items-center justify-center text-4xl font-bold mx-auto mb-5">
3
</div>
<div class="text-2xl font-bold mb-2">Test</div>
<div class="text-lg text-gray-600">Verify quality</div>
</div>
</div>
</body>
Target Size: 1280px × 720px (imageFull) Use Case: Section divider, key message
<style>
body {
width: 1280px;
height: 720px;
}
</style>
</head>
<body class="bg-gh-bg-primary text-gh-text-primary font-sans flex items-center justify-center">
<div class="h-full flex flex-col items-center justify-center text-center">
<h1 class="text-7xl font-bold mb-8 text-gh-text-primary">
Main Message
</h1>
<div class="w-52 h-1.5 bg-gh-accent my-8"></div>
<p class="text-4xl text-gh-text-secondary max-w-4xl">
Supporting description goes here
</p>
</div>
</body>
Canyon-Custom Theme:
#d4ed00 (use for borders, headings, icons)#00bcd4 (use for highlights, links)#ffffff or light tints (#f0f7d8, #dbecdc)#333333 (dark gray, never pure black)GitHub-Dark Theme:
#1f6feb (use for borders, headings, links)#238636 (use for checkmarks, success states)#9e6a03 (use for caution, alerts)#da3633 (use for errors, critical info)#0d1117, #161b22, #21262d#f0f6fc (primary), #7d8590 (secondary)Avoid:
linear-gradient()radial-gradient()Use Instead:
Create a Marp image diagram using the marp-image-generator skill.
**Content**:
- Type: [comparison / info-panel / process / message]
- Title: [Title]
- Elements:
- [Element 1]
- [Element 2]
- [Element 3]
**Theme**: [canyon-custom / github-dark]
**Size**: [1100x550 / 1280x720 / 550x400]
**Reference**: @docs/spec/marp/image-size-guideline.md
**Output**:
- HTML: application/marp/src/html/[filename].html
- PNG: application/marp/src/assets/[filename].png
Cause: Using incorrect color codes
Solution:
application/marp/theme/canyon-custom.cssapplication/marp/theme/github-dark.cssCause: Body dimensions not matching target size
Solution:
body { width: XXXpx; height: YYYpx; } to exact target dimensionsfullPage: false when taking screenshotCause: Font sizes not optimized for target dimensions
Solution:
Cause: Using linear-gradient() or radial-gradient()
Solution:
<div> elements with different background colors.playwright-mcp/ to application/marp/src/assets/ to keep directories cleandocs/spec/marp/image-size-guideline.mdapplication/marp/CLAUDE.mdapplication/marp/theme/application/marp/src/html/docs/features/tool-playwright-mcp-setup/This skill requires Playwright MCP configured in .mcp.json:
{
"mcpServers": {
"playwright": {
"type": "stdio",
"command": "npx",
"args": ["@playwright/mcp@latest", "--headless", "--isolated"]
}
}
}
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience