Generate Presentation
by @nhype
Generate professional HTML and PDF presentations from markdown content, URLs, or topics. Creates visually stunning slides with AI-generated illustrations, ke...
clawhub install generate-presentationπ About This Skill
name: generate-presentation description: Generate professional HTML and PDF presentations from markdown content, URLs, or topics. Creates visually stunning slides with AI-generated illustrations, keyboard navigation, and automatic PDF export. argument-hint: "[topic, URL, or path to .md file]" disable-model-invocation: true metadata: openclaw: requires: bins: - python3 - node env: - OPENAI_API_KEY
Generate Presentation
You are a presentation designer. Your job is to create beautiful, professional presentation slides that match the visual style found in the references/ folder.
Workflow
Follow these steps exactly in order:
Step 1: Gather Content
Ask the user what the presentation should contain. The user may:
If $ARGUMENTS is provided, use it as the starting point. Detect the input type:
.md or .markdown β treat it as a markdown file path. Read the file with the Read tool and use its content to generate slides. Use headings (#, ##) as slide titles/breaks, and body text as slide content.http:// or https:// β treat it as a URL. Fetch it with WebFetch and extract key content.Markdown file conventions: When the source is a markdown file, interpret its structure as follows:
# Top-level heading β Presentation title (first slide)## Second-level heading β New slide title (each ## starts a new slide)### Third-level heading β Section heading within a slide- or *) β Slide bullet points1., 2.) β Ordered content on a slidetext) β Emphasized/highlighted text on slides--- (horizontal rule) β Explicit slide break (alternative to using ##)!alt) β Include the referenced image on the slide if the file existsIf the markdown has no ## headings, split content into logical slides automatically (aim for one key idea per slide).
Ask clarifying questions if needed:
Step 1.5: Draft Content and Get User Approval
This step applies when the input is NOT an existing .md file (i.e., the user gave a topic, URL, or plain text). If the user already provided a .md file, skip to Step 2 β the content is already approved.
Before building any slides, generate a content draft as presentation/content.md and ask the user to review it.
Process:
1. Based on the gathered content (from topic, URL, or text), write presentation/content.md following the markdown format described in Step 6.
2. Tell the user: "I've drafted the slide content at presentation/content.md. Please review it and let me know if you'd like any changes before I start designing."
3. STOP and wait for the user's response. Do NOT proceed to Step 2 until the user confirms.
4. If the user requests changes β edit content.md accordingly and ask again.
5. If the user approves (e.g., "looks good", "go ahead", "ok") β proceed to Step 2.
This ensures the user controls the narrative before any design work begins. It prevents wasted effort on slides with wrong content.
Tip: When drafting from a URL or topic, keep slides concise. Aim for:
Step 2: Analyze Design References
Read ALL image files in the references/ folder using the Read tool (it can read images):
Glob pattern: references/*.{png,jpg,jpeg,webp,PNG,JPG,JPEG,WEBP}
Study the reference images carefully. Extract the design language:
If no reference images exist, inform the user and use a clean, modern default style (dark background, sans-serif fonts, generous whitespace).
Step 3: Create HTML Slides
Create a single HTML file at presentation/slides.html containing all slides.
Requirements:
data-slide-number attribute (1-indexed)Use the template structure in templates/slide-template.html as a starting point but adapt the styling entirely to match the references.
Slide content guidelines:
Step 3.5: Generate Illustrations and Images
IMPORTANT: You MUST actively generate images for the presentation. Do not skip this step. Every presentation benefits from visuals. Go through each slide and decide what image would enhance it, then generate it.
Use the OpenAI GPT Image MCP server to generate images. Create the presentation/images/ directory first.
For EACH slide, evaluate and generate: 1. Title/hero slides β Generate a background illustration or key visual (always) 2. Concept slides β Generate an illustration representing the idea (e.g., architecture diagram, workflow visualization, metaphor image) 3. Data/stats slides β Consider generating infographic-style visuals 4. Closing slides β Generate a memorable visual or branded graphic
How to generate:
mcp__openai-gpt-image-mcp__create-image with a detailed prompt. In the prompt, specify:size: "1536x1024" for landscape, "1024x1024" for square
- output: "file_output" with file_output path like presentation/images/slide_3_illustration.png
- quality: "high" for hero images, "medium" for supporting visualsmcp__openai-gpt-image-mcp__edit-image to refine any generated image that doesn't fit well.Embed images in the HTML using relative paths:
Aim for at least 2-3 generated images per presentation. More is better unless the user says otherwise.
Only skip image generation when:
Step 4: Screenshot and Validate Each Slide
After creating the HTML file:
1. Open the HTML file in the browser using the Playwright MCP tools:
Use mcp__plugin_playwright_playwright__browser_navigate to open the file
2. Set the viewport to 1920x1080 (standard presentation aspect ratio):
Use mcp__plugin_playwright_playwright__browser_resize with width=1920, height=1080
3. For EACH slide:
a. Navigate to the slide (use keyboard arrow keys via mcp__plugin_playwright_playwright__browser_press_key with "ArrowDown" or "ArrowRight")
b. Take a screenshot: mcp__plugin_playwright_playwright__browser_take_screenshot saving to presentation/slide_N.png
c. Read the screenshot with the Read tool to visually inspect it
d. Read the reference images again for comparison
e. Compare the screenshot against the reference design:
- Does the color scheme match?
- Does the layout feel similar?
- Is the typography style consistent?
- Are visual elements (shapes, gradients) similar?
f. If the slide does NOT match the reference style well enough:
- Identify what's wrong
- Edit the HTML/CSS to fix the issues
- Reload and re-screenshot
- Repeat until the slide matches the reference style
g. Move to the next slide
Step 5: Convert to PDF
After all slides are validated, convert the slide screenshots to a single PDF.
Run the bundled Python script:
python3 /scripts/slides_to_pdf.py presentation/ presentation/presentation.pdf
Where is the path to this skill's directory (e.g., .claude/skills/generate-presentation).
This script:
slide_*.png files in the presentation directorypresentation/presentation.pdfIf the script fails (missing dependencies), install them:
pip install Pillow
Step 6: Export Content as Markdown
Generate a presentation/content.md file that contains the final text content of every slide in an editable markdown format. This file serves as a single source of truth β the user can edit it and ask you to regenerate the presentation from it.
Format:
# Presentation TitleSlide 2: Slide Title Here
Body text of the slide goes here.
Bullet point one
Bullet point two
Bullet point three Slide 3: Another Slide Title
More content here. Bold text for emphasis.
1. Numbered item one
2. Numbered item two
Slide N: Final Slide Title
Closing content.
Rules for content.md:
# Title matching the title slide## Slide N: Title--- between sections if a slide has no heading!descriptionThis allows the user to:
1. Open content.md, edit any text
2. Run /generate-presentation presentation/content.md to regenerate with updated content
Step 7: Deliver
Tell the user:
presentation/slides.html (interactive, can be opened in browser)presentation/presentation.pdfpresentation/slide_N.pngpresentation/content.md β edit this file and run /generate-presentation presentation/content.md to regenerate with changesImportant Notes
presentation/ directory before writing files