brainstorming
Structured design dialogue that validates ideas before implementation begins.
marp-html-to-png
Create HTML diagrams for Marp slides and capture them as PNG screenshots using Playwright MCP
Full skill instructions
This skill helps create interactive HTML diagrams for Marp presentations and converts them to PNG screenshots using Playwright MCP. HTML files are created in application/marp/src/html/ and screenshots are saved to application/marp/src/assets/.
HTML files should be saved to application/marp/src/html/ with the following template structure:
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>図解タイトル</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700;900&display=swap" rel="stylesheet">
<script src="https://cdn.tailwindcss.com"></script>
<script>
tailwind.config = {
theme: {
extend: {
fontFamily: {
'sans': ['"Noto Sans JP"', 'sans-serif']
}
}
}
}
</script>
</head>
<body class="bg-gradient-to-br from-gray-900 via-blue-900 to-purple-900 min-h-screen flex items-center justify-center font-sans overflow-hidden">
<!-- Diagram content -->
<!-- IMPORTANT: DO NOT include diagram title in HTML - Marp slides will add titles -->
</body>
</html>
Naming Convention: Use snake_case for HTML files (e.g., fullscreen_comparison.html, pdca_cycle.html)
IMPORTANT - No Titles in Diagrams:
Use Playwright MCP to navigate to the local HTML file:
file:///home/node/workspace/application/marp/src/html/[filename].html
Browser Resize (IMPORTANT - Follow Marp Image Size Guideline):
docs/spec/marp/image-size-guideline.mdUse the mcp__playwright__browser_take_screenshot tool with:
filename: application/marp/src/assets/[diagram-name].pngtype: png.playwright-mcp/application/marp/src/assets/ to application/marp/src/assets/ using:
mv /home/node/workspace/.playwright-mcp/application/marp/src/assets/[diagram-name].png /home/node/workspace/application/marp/src/assets/[diagram-name].png
Reference the screenshot in Marp markdown:

IMPORTANT: All HTML diagrams should be designed to fit within Marp's safe area size.
Recommended (Default): 1100px × 550px (Safe area size)
body to: width: 1100px; height: 550px;1100px × 550pxFull Content Area: 1216px × 582px
body to: width: 1216px; height: 582px;1216px × 582pxReference: docs/spec/marp/image-size-guideline.md
Light Background:
<body class="bg-white min-h-screen p-8">
Dark Gradient Background:
<body class="bg-gradient-to-br from-gray-900 via-blue-900 to-purple-900 min-h-screen flex items-center justify-center">
text-6xl (60px)text-4xl (36px)text-2xl (24px)text-xl (20px)green-500, green-300red-500, red-300blue-500, blue-300yellow-400, orange-500Existing Reference: application/marp/src/html/fullscreen_comparison.html
Features:
Existing Reference: application/marp/src/html/pdca_cycle.html
Features:
Create an HTML diagram for a Marp slide.
**Content**:
- Title: [Title]
- Elements:
- [Element 1]
- [Element 2]
- [Element 3]
**Design**:
- Layout: [2-column / centered / grid]
- Background: [light / dark gradient]
- Color scheme: [success=green / warning=red]
**Reference**: @application/marp/src/html/fullscreen_comparison.html
**Save to**: application/marp/src/html/[filename].html
Open the HTML diagram and take a screenshot:
**HTML File**:
file:///home/node/workspace/application/marp/src/html/[filename].html
**Browser Size** (Follow Marp Image Size Guideline):
- Width: 1100px
- Height: 550px
**Screenshot Options**:
- Save to: application/marp/src/assets/[diagram-name].png
- Type: PNG
**Post-Screenshot**:
Move file from Playwright MCP directory to assets directory:
```bash
mv /home/node/workspace/.playwright-mcp/application/marp/src/assets/[diagram-name].png /home/node/workspace/application/marp/src/assets/[diagram-name].png
## Troubleshooting
### Issue 1: HTML File Not Displaying
**Cause**: Incorrect file path
**Solution**:
- Use `file://` protocol
- Absolute path: `/home/node/workspace/application/marp/src/html/[filename].html`
### Issue 2: Screenshot Size Not Matching Guidelines
**Cause**: Browser viewport not following Marp image size guideline
**Solution**:
- Use `mcp__playwright__browser_resize` tool
- **Default**: width=1100, height=550 (Safe area size - recommended)
- Alternative: width=1216, height=582 (Full content area)
- Reference: `docs/spec/marp/image-size-guideline.md`
### Issue 3: Fonts Not Rendering
**Cause**: Japanese fonts not loaded
**Solution**:
- Ensure Tailwind config includes font family (see template)
- Use system fonts: Hiragino Sans, Yu Gothic
### Issue 4: Colors Not Matching
**Cause**: Incorrect Tailwind class names
**Solution**:
- Check Tailwind docs for correct color classes
- Use prefixes: `bg-`, `text-`, `border-`
## Best Practices
1. **Follow Size Guidelines**: Always use 1100px × 550px (default) or 1216px × 582px (full area)
2. **Keep It Simple**: One diagram = one concept
3. **Reusability**: Template similar layouts
4. **Accessibility**: Ensure sufficient contrast (minimum 4.5:1)
5. **Performance**: Use emojis instead of external images
6. **Consistency**: Follow existing HTML diagram patterns
7. **Move to Correct Location**: Always move (not copy) screenshot from `.playwright-mcp/` to `application/marp/src/assets/` to keep directories clean
## Permissions Required
This skill requires Playwright MCP to be configured in `.mcp.json`:
```json
{
"mcpServers": {
"playwright": {
"type": "stdio",
"command": "npx",
"args": ["@playwright/mcp@latest", "--headless", "--isolated"]
}
}
}
application/marp/src/html/application/marp/CLAUDE.mddocs/features/tool-playwright-mcp-setup/Structured design dialogue that validates ideas before implementation begins.
Comprehensive design intelligence for web and mobile UI/UX across 10 technology stacks.
Comprehensive implementation plans for multi-step tasks, breaking down specs into bite-sized, testable steps.
Introduction to the obra skills system with mandatory skill invocation rules and best practices.
Execute a written implementation plan with critical review and task checkpoints.
Delegate independent tasks to specialized agents working concurrently with isolated context.
Isolated git worktrees with smart directory selection and safety verification.
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
Plan searchable and shareable content that drives traffic, builds authority, and generates leads.
README-first repository scanner that extracts commands and classifies reproduction candidates without executing them.
Brainstorm and prioritize marketing strategies tailored to your SaaS stage, budget, and goals.
Plan and optimize your website's page hierarchy, navigation, URL structure, and internal linking.
The world's fastest calendar for remote work
Capture, organize, and utilize your knowledge effortlessly.
Instant Summaries of Audio & Video Interviews with AnySummary
Transform PDFs into engaging mind maps.
Chat with any PDF instantly
Create an optimal daily plan using your voice
A productivity platform to centralize organizational knowledge and workflows with contextual AI assistance.
AskYourPDF Pricing Plans: Tailored to Your Needs