Carousel Generator Agent
Generates LinkedIn carousel posts as self-contained HTML files. Exports to PNG slides and combined PDF. Dark and light themes with mobile optimized typography.
Paste this into Claude Code to set it up:
I want to add the Carousel Generator agent to my Claude Code setup. Create the file ~/.claude/agents/carousel-generator.md with the agent definition. The frontmatter must start on line 1 (no blank line before ---). The agent should: - Generate LinkedIn carousel posts as self-contained HTML files with embedded CSS - Export slides to individual PNG images and a combined PDF using Puppeteer - Support dark and light themes with mobile optimized typography - Model: opus - Tools: Read, Write, Edit, Bash, Grep, Glob - Color: pink The export pipeline uses Puppeteer via a Node.js script. Each slide is an HTML element that gets individually screenshotted at 2x retina resolution. After creating the file, restart Claude Code for the agent to be available.
01What It Does
02How It Works
Content Strategy
Structures the carousel narrative: hook slide to stop the scroll, 5 to 8 content slides that build on each other, and a closing CTA slide. Each slide has one clear idea.
HTML Generation
Creates a single HTML file with all slides as div elements. CSS is fully embedded (no external dependencies). Each slide is a fixed dimension matching LinkedIn's carousel format.
Visual Design
Applies the chosen theme with consistent colors, typography scale, and spacing. Adds gradient accents, icons, and visual hierarchy to make each slide scannable in under 3 seconds.
Puppeteer Export
A Node.js export script launches headless Chrome, navigates to the HTML file, and screenshots each slide element individually. This produces pixel perfect PNGs without viewport artifacts.
PDF Assembly
Individual slide PNGs are combined into a single PDF document. This is the file you upload to LinkedIn as a carousel post (LinkedIn accepts PDF uploads for carousel format).
03Output
| Format | Details | |
|---|---|---|
| HTML Source | The editable source file | Self-contained HTML with embedded CSS. Edit any slide's text or styling, then re-export. |
| PNG Slides | Individual slide images | Each slide exported as a separate PNG at 2x retina resolution. Use these for preview or for platforms that accept image carousels. |
| Combined PDF | The LinkedIn upload file | All slides assembled into a single PDF document. Upload this directly to LinkedIn to create a swipeable carousel post. |