Article to Infographic
Transform any article or text content into a visually compelling, self-contained HTML infographic. Output is a single HTML file with inline CSS/JS -- zero dependencies, opens in any browser, print-ready for PDF export.
Core Philosophy
- 1. Content-First -- Analyze the article before choosing layout.
- Smart Layout -- Match infographic type to content type automatically.
- Distinctive Design -- No generic AI aesthetics. Every infographic feels custom-crafted.
- Zero Dependencies -- Single HTML file with inline CSS/JS.
- Print-Ready -- Include print media queries for clean PDF export.
Workflow Overview
Strict 3-Step Confirmation Process:
CODEBLOCK0
CRITICAL RULE: Each step requires explicit user confirmation before proceeding. Do NOT batch confirmations. Do NOT proceed to next step until current step is confirmed.
Detailed Workflow
- 1. Acquire and analyze article content
- Extract key information and classify content type
- Step 1: Present outline → Get explicit confirmation
- Step 2a: Present layout options → Get explicit confirmation
- Step 2b: Present style options → Get explicit confirmation
- Step 2c: Present illustration options → Get explicit confirmation
- Step 3: Present output format options → Get explicit confirmation
- Generate the HTML infographic (only after all confirmations)
- Export to PNG if selected in Step 3
- Deliver the final output
Confirmation Flow Summary (For AI Reference)
When executing this skill, follow this EXACT sequence:
| Phase | Step | Action | User Confirmation Required |
|---|
| 1 | Content Acquisition | Get article URL/file/text | ❌ No |
| 2 |
Content Analysis | Extract info, classify type | ❌ No |
| 2.5 |
Step 1 | Present outline table | ✅
MUST CONFIRM |
| 3a |
Step 2a | Present layout options | ✅
MUST CONFIRM |
| 3b |
Step 2b | Present style options | ✅
MUST CONFIRM |
| 3c |
Step 2c | Present illustration options | ✅
MUST CONFIRM |
| 4 |
Step 3 | Present output format options | ✅
MUST CONFIRM |
| 5 | Generation | Create HTML | ❌ Automatic |
| 6 | Delivery | Present results | ❌ Automatic |
| 7 | PNG Export | If selected in Step 3 | ❌ Automatic |
FORBIDDEN ACTIONS:
- - ❌ Never combine Step 1 + Step 2 confirmations
- ❌ Never combine Step 2a + 2b + 2c into one question
- ❌ Never combine Step 2 + Step 3 confirmations
- ❌ Never proceed to generation without all 3 steps confirmed
Phase 1: Content Acquisition
Determine the content source:
- - URL -- Use WebFetch to retrieve article content
- File -- Read the file directly
- Pasted text -- Use as-is
If content is ambiguous or too short, ask for clarification.
Phase 2: Content Analysis
Extract from the article:
- 1. Title and subtitle -- Main topic and secondary context
- Key statistics -- Numbers, percentages, data points
- Key points -- 4-8 most important takeaways
- Quotes -- Notable statements
- Comparisons -- Before/after, pros/cons, A vs B
- Sequential steps -- Process flows, timelines, chronological events
- Categories -- Natural groupings
- Entities -- People, organizations, places
Classify the best infographic type:
| Content Signal | Infographic Type |
|---|
| Dates, milestones, chronological events | Timeline |
| Numbers, percentages, survey data |
Statistics Dashboard |
| A vs B, pros/cons, before/after |
Comparison |
| Step-by-step, how-to, tutorial |
Process Flow |
| Multiple independent tips/facts |
Listicle / Card Grid |
| Mixed content types |
Magazine / Editorial |
Phase 2.5: Step 1 - Outline Confirmation (BLOCKING)
⚠️ CRITICAL: Must get explicit user confirmation before proceeding to Phase 3.
After content analysis, present the user with a structured outline in table form:
CODEBLOCK1
DO NOT proceed until user explicitly confirms.
Using AskUserQuestion:
- - Header: "Step 1/3: Outline Confirmation"
- Question: "Please review the outline above with [N] blocks. Confirm to proceed or request changes:"
- Options:
- "✅ Outline confirmed - proceed to style selection" -- ONLY THEN go to Phase 3
- "📝 Need adjustments" -- User specifies changes (add/remove/modify blocks), then RE-CONFIRM
- "🔄 Simplify to core blocks" -- Auto-trim to core blocks only, then RE-CONFIRM
Hard rule: If user chooses adjustments, update the outline and return to this same confirmation step. Do NOT proceed to Phase 3 until "✅ Outline confirmed" is selected.
Phase 3: Step 2 - Style Selection (BLOCKING)
⚠️ CRITICAL: Must get explicit user confirmation for BOTH layout AND style before proceeding to Phase 4.
This phase requires TWO separate confirmations:
Step 2a: Layout Selection (BLOCKING)
Using AskUserQuestion:
- - Header: "Step 2a/3: Layout Selection"
- Question: "Based on your article, I recommend a [detected type] layout. Confirm your choice:"
- Options:
- "✅ [detected type] - recommended"
- "📊 Statistics Dashboard"
- "📅 Timeline"
- "⚖️ Comparison"
- "🔄 Process Flow"
- "📝 Listicle / Card Grid"
- "📖 Magazine / Editorial"
STOP HERE. Wait for user selection. Do NOT show style options yet.
Step 2b: Style Selection (BLOCKING)
ONLY after layout is confirmed, present style options:
Using AskUserQuestion:
- - Header: "Step 2b/3: Visual Style Selection"
- Question: "What visual style for the [confirmed layout] infographic?"
- Options (show 4-5 most relevant):
Standard Styles:
- "🎨 Bold & Vibrant" -- High contrast, saturated colors, strong visual impact
- "🌿 Clean & Minimal" -- Whitespace, subtle colors, elegant typography
- "🌃 Dark & Techy" -- Dark backgrounds, neon accents, modern feel
- "📰 Warm & Editorial" -- Magazine-style, warm tones, serif typography
Premium Styles:
- "🚀 Sci-fi HUD" -- Cyberpunk terminal, particle network, neon glow
- "💎 Premium Magazine" -- Luxury editorial, massive serif typography
- "🔮 Glassmorphism Aurora" -- Frosted glass, animated aurora blobs
STOP HERE. Wait for user selection.
Step 2c: Illustrations (optional, but ASK)
Using AskUserQuestion:
- - Header: "Step 2c/3: Illustrations (Optional)"
- Question: "Add illustrations to the [confirmed style] infographic?"
- Options:
- "🚫 No illustrations - text and data only"
- "🔹 Decorative icons - small SVG icons next to headings"
- "👤 Character illustrations - full SVG characters from open-source libraries"
ONLY after all 2a→2b→2c are confirmed, proceed to Phase 4.
For detailed color palettes and font pairings per style, see references/style-presets.md.
Phase 4: Step 3 - Output Format Confirmation (BLOCKING)
⚠️ CRITICAL: Must get explicit user confirmation for output format BEFORE generating anything.
Using AskUserQuestion:
- - Header: "Step 3/3: Output Format"
- Question: "How would you like to receive the [confirmed style] infographic?"
- Options:
- "📄 HTML only - single file, opens in browser"
- "🖼️ HTML + PNG - include high-res image export"
- "📦 Both formats - explicit delivery of both files"
ONLY after output format is confirmed, proceed to Phase 5 (Generation).
Phase 5: Generate Infographic
HTML Architecture
Single self-contained HTML file:
CODEBLOCK2
Design Rules
Typography:
- - Distinctive Google Fonts or Fontshare fonts -- NEVER Inter, Roboto, Arial, or system fonts
- Display font for headings, clean font for body
- Responsive sizing with INLINECODE0
Color:
- - CSS custom properties for entire palette
- Max 3-4 colors: one dominant, one accent, one-two neutrals
- WCAG AA contrast for readability
Layout:
- - CSS Grid for overall structure, Flexbox for components
- Max-width 1200px, centered
- Compact spacing: Use
2-3rem between sections, NOT 5rem+. Infographics should feel dense and information-rich, not stretched out. Header padding: 2-2.5rem. Section padding: 2-3rem. Grid gaps: 2-2.5rem. - Responsive: stack on mobile, multi-column on desktop
Data Visualization:
- - Pure CSS for simple charts (bar via width%, pie via conic-gradient)
- Inline SVG for complex shapes
- Animate numbers with counter effect (Intersection Observer)
- Always label data clearly
Animations:
- - Intersection Observer triggers
.visible class - Stagger children with animation-delay
- Subtle fade + translateY baseline
- INLINECODE3 media query required
Print:
- -
@media print rules: linearize layout, remove animations, ensure readability - Appropriate page breaks between sections
Layout Patterns
Timeline:
- - Vertical center line, alternating left/right entries
- Date badges on line, content cards offset
- Mobile: single-column stack
Statistics Dashboard:
- - Hero stat at top (large number + context)
- Grid of stat cards (2-3 columns)
- CSS bar/pie charts where appropriate
- Counter animation on scroll
Comparison:
- - Side-by-side columns with central divider
- Matching rows, color-coded sides
- Mobile: vertical stack with labels
Process Flow:
- - Numbered steps with connecting lines/arrows
- Icon + title + description per step
- Progress indicator
Listicle / Card Grid:
- - Numbered/icon cards in responsive grid (2-3 cols desktop, 1 mobile)
- Each card: icon/number + title + description
- Hover effects
Magazine / Editorial:
- - Mix of full-width, card grids, pull quotes, stat highlights
- Alternate dense and spacious sections
- Strong typographic hierarchy
Anti-Patterns -- NEVER
- - Purple gradient on white background
- Generic card layouts with no visual character
- Font Awesome or emoji spam as decoration
- Flat, lifeless color schemes
- Walls of small text (defeats infographic purpose)
- Charts without labels
- Cookie-cutter layouts
Phase 6: Delivery
All 3 confirmation steps completed. Generating final output...
Write the HTML file and present a summary:
CODEBLOCK3
Generation is complete. No further confirmations needed.
Edge Cases
Short articles (< 200 words): Compact single-section, 3-5 key points as cards.
Long articles (> 3000 words): Summarize to 6-10 key sections max. Prioritize data and takeaways.
No statistics: Focus on quotes, process flows, or listicle. Use icons instead of charts.
Technical/code-heavy: Code snippet sections, architecture diagrams with CSS shapes, conceptual flow.
Non-English content: Set lang attribute correctly on <html>. Use appropriate fonts for CJK, RTL, etc.
Phase 7: PNG Export (if selected in Step 3)
After generating the HTML, if PNG was selected in Step 3, proceed with export:
Method A: Browser tool (preferred in Claude Code / HappyCapy)
If a browser CLI tool is available:
- 1. Start a local HTTP server serving the HTML file
- Navigate browser to the page
- Force all
.reveal elements to visible state (skip scroll animations) - Force all bar fills and counters to final values
- Take a full-page screenshot
- Close browser
CODEBLOCK4
Method B: Playwright script (standalone environments)
Run the bundled script:
CODEBLOCK5
The script uses headless Chromium via Playwright. It auto-installs dependencies if needed.
Arguments:
- -
--width : viewport width in px (default 1200) - INLINECODE10 : HiDPI scale factor (default 2, produces 2400px wide image)
When to export PNG
Ask the user after HTML delivery:
- - Header: "Export"
- Question: "Want a PNG image export as well?"
- Options:
- "Yes, export PNG" -- Run export
- "HTML only is fine" -- Skip
OpenClaw / Non-Interactive Adaptation
When deploying to environments without interactive question-answer support (e.g., OpenClaw, API-only setups), the skill operates in parameterized mode where ALL options must be specified upfront.
⚠️ CRITICAL: In parameterized mode, you MUST provide ALL confirmations in a single prompt because the system cannot ask follow-up questions.
Parameterized Invocation (Single Prompt)
Users must specify ALL 3 confirmation steps in one prompt:
CODEBLOCK6
Example complete prompt:
CODEBLOCK7
Parameter Reference
Style options:
- -
bold-vibrant -- High contrast, saturated colors - INLINECODE12 -- Whitespace, subtle colors, serif typography
- INLINECODE13 -- Dark background, neon accents
- INLINECODE14 -- Magazine-style, warm tones
- INLINECODE15 -- Cyberpunk terminal, particle network, neon glow (premium)
- INLINECODE16 -- Luxury editorial, massive serif, cream/charcoal/vermillion (premium)
- INLINECODE17 -- Frosted glass, aurora blobs, Apple-inspired depth (premium)
Layout options:
- -
timeline -- Chronological events - INLINECODE19 -- Data dashboard
- INLINECODE20 -- Side-by-side
- INLINECODE21 -- Step-by-step flow
- INLINECODE22 -- Card grid
- INLINECODE23 -- Mixed editorial (default for complex articles)
- INLINECODE24 -- Let the skill decide based on content analysis
Outline adjustments (natural language):
- - "remove [block name]"
- "add [block description]"
- "replace [block] with [new content]"
- "simplify" / "expand"
Export options:
- -
html -- HTML only (default) - INLINECODE26 -- HTML + PNG export
- INLINECODE27 -- Explicitly output both
Fallback Behavior
If no style/layout is specified and AskUserQuestion is not available, use these defaults:
- - Layout:
auto (detect from content) - Style:
dark-techy for technical content, warm-editorial for narrative content, bold-vibrant for data-heavy content - Export:
html only
Font CDN for China Deployment
When deployed behind the GFW, replace Google Fonts CDN:
CODEBLOCK8
Alternatively, for CJK-heavy content, use system fonts as fallback:
CODEBLOCK9