← 返回 Skills 市场
karinecsy-collab

Awesome Deck Pdf

作者 Karine · GitHub ↗ · v1.0.5 · MIT-0
cross-platform ⚠ suspicious
88
总下载
0
收藏
0
当前安装
6
版本数
在 OpenClaw 中安装
/install awesome-deck-pdf
功能描述
Generate polished HTML slide decks and export as PDF. Works with OpenClaw, Claude Code, and Codex. Supports .pptx templates, images, website URLs, and style...
使用说明 (SKILL.md)

HTML → PDF Slide Workflow

‼️ STOP — Read Before Doing Anything

Before writing a single line of code or HTML, you MUST complete these two confirmation steps in order. Do not proceed until you receive explicit user approval for each.

Confirmation 1 of 2: Design Style

Analyze the user's input (image / URL / keyword / .pptx), then show a design spec summary and ask:

Here's the design style I extracted from [source]:

  • Background: #000 dark / Accent: #2997FF blue
  • Font: SF Pro Display, oversized heading, minimal whitespace
  • Style: dark Keynote, glow effects

Does this match what you want? Any changes before I start?

If the user provided a website URL and fetching fails (Fake IP, login wall, etc.):

  • Say exactly why it failed
  • Ask: "Could you send a few screenshots of the site? I'll analyze the design from those."
  • Do NOT assume or default to any style

Wait for explicit approval → then move to Confirmation 2.

Confirmation 2 of 2: Slide Content

Ask the user if they have existing materials:

Do you have reference materials for the content? (existing PPT, doc, data, bullet points — anything works) If yes, send them over. If not, I'll draft an outline for you to review.

Once you receive a reply, prepare a numbered list: slide title + one-line summary per slide. Show it and ask:

Here's the planned structure — does this look right? Anything to add, remove, or change?

Wait for explicit approval → only then begin generating HTML.


If either confirmation is skipped, the workflow is broken. Start over from Confirmation 1.


export_pdf.js auto-detects Chrome in this order:

  1. Puppeteer bundled Chromium (npm install puppeteer)
  2. System Chrome/Chromium (macOS: /Applications/Google Chrome.app, Linux: /usr/bin/chromium)
  3. If neither found → prints a clear error with install instructions, exits

If npm install puppeteer fails (sandbox/network restriction):

# Option A: skip Chromium download, install separately
npm install puppeteer --ignore-scripts
npx puppeteer browsers install chrome

# Option B: use puppeteer-core (no bundled Chrome download)
npm install puppeteer-core
# script will auto-find system Chrome

# Option C: install system Chrome first, then run script
# macOS: brew install --cask google-chrome
# Linux: sudo apt install chromium-browser
npm install puppeteer-core

Do NOT fall back to wkhtmltopdf, pdfkit, weasyprint, or any other tool.

For full installation instructions across OpenClaw, Claude Code, Codex, and Linux/macOS setup, see references/install.md.


Workflow Overview

User input (image / website URL / style keyword / .pptx file)
    ↓ Step 1: Extract design spec → ⚠️ Confirm with user
    ↓ Step 2: Outline slide content → ⚠️ Confirm with user
    ↓ Step 3: Generate HTML → 💾 Save slides.html to disk
    ↓ Step 4: Run export_pdf.js → 💾 Output slides.pdf
    
Both slides.html and slides.pdf must exist as final outputs.

⚠️ Two Mandatory Confirmation Gates (never skip)

Gate 1: Design Style

After analyzing the input, show the extracted design spec summary and ask for confirmation:

Here's what I extracted from [source]:

  • Background: #000000 black · Accent: #2997FF apple blue
  • Font: SF Pro Display, oversized centered headline
  • Style: dark Keynote, glow effects

Does this match the style you want? Any adjustments?

⚠️ If website fetch fails (e.g. Fake IP / login required):

  • Tell the user clearly why it failed
  • Ask for screenshots: "Could you send a few screenshots of the site? I'll analyze the design from those."
  • Never assume or default to any style — wait for user confirmation before proceeding

Website analysis priority:

  1. Puppeteer screenshot → visual analysis (most accurate)
  2. web_fetch page content → CSS/font extraction
  3. Ask user to send screenshots

Gate 2: Slide Content

First ask if the user has existing materials:

Do you have any reference materials for the content? e.g. existing PPT, doc, report, or a list of key points? Send them over and I'll structure the slides — otherwise I'll draft an outline for you to review.

After receiving a reply, prepare a one-line summary per slide and confirm before generating HTML.


Step 1: Extract Design Spec → DESIGN.md

Supported inputs:

Input Approach
📂 .pptx template Parse with python-pptx: extract colors, fonts, backgrounds, placeholder layouts (most accurate)
📎 Image / screenshot Visual analysis: colors, font style, spacing, component patterns
🌐 Website URL Puppeteer screenshot + getComputedStyle font/color extraction
💬 Style keyword Use brand knowledge: Apple → SF Pro, Notion → Inter, Linear → Inter, Google → Google Sans

Extracting from .pptx:

from pptx import Presentation
prs = Presentation("template.pptx")
slide = prs.slides[0]
for shape in slide.shapes:
    if shape.has_text_frame:
        for para in shape.text_frame.paragraphs:
            for run in para.runs:
                print(run.font.name, run.font.size, run.font.color.rgb, run.font.bold)

Fill extracted values into DESIGN.md (see references/DESIGN_TEMPLATE.md):

  • Colors: primary bg, secondary bg, text colors, accent, border → CSS variables
  • Fonts: heading / body / decorative number — name, weight, size range per level
  • Layout: padding, max-width, grid columns, gap, border-radius
  • Components: card, badge/label, button, divider, background decoration
  • Section list: CSS class + content theme + dark/light tone per slide

Font extraction by input type:

Input Method
.pptx run.font.name per text run
Website getComputedStyle(el).fontFamily via Puppeteer
Image / screenshot Visual analysis — describe closest match (e.g. "geometric sans, similar to Helvetica")
Style keyword Brand knowledge mapping

Fonts go into DESIGN.md as CSS variables. Append Chinese fallbacks at the end (never hardcode them as primary):

--font-heading: 'SF Pro Display', 'PingFang SC', 'Helvetica Neue', sans-serif;
--font-body:    'SF Pro Text',    'PingFang SC', 'Helvetica Neue', sans-serif;

Step 2: Generate HTML

⚠️ Save the HTML to a .html file first. Do not merge HTML generation and PDF export into one step. The HTML file is a required intermediate artifact — it must exist on disk before running export_pdf.js.

Generate a single .html file and write it to disk (e.g. slides.html):

  • Single file, all CSS inlined, zero external dependencies
  • Each slide = one \x3Csection class="...">, fixed width 1440px, height fits content
  • Fonts from DESIGN.md — Chinese fallback appended, never hardcoded as primary
  • @media print: page-break-after: always on every section

Font consistency check after saving:

grep -n "font-family" slides.html

Only proceed to Step 3 once the .html file is saved and verified.


Step 3 & 4: Export PDF via Puppeteer

⚠️ Only use export_pdf.js (Puppeteer screenshot-and-compose). Do NOT use any of these alternatives — they all produce broken output:

  • page.pdf() directly → A4 portrait, white space below every slide
  • wkhtmltopdf → outdated WebKit engine, broken flexbox/grid/modern CSS
  • Any other HTML-to-PDF CLI (Prince, WeasyPrint, pdfkit, etc.) → layout incorrect

The screenshot-and-compose approach is the only method that faithfully preserves the rendered layout.

Environment matters

Claude Code / Codex / OpenClaw / local agent (can run shell commands):

  • Read scripts/export_pdf.js, copy it to the project directory, run it:
node export_pdf.js              # reads slides.html → slides.pdf (auto-detects \x3Csection> elements)
node export_pdf.js my-deck.html # specify a different file

Claude.ai chat / any chat-only interface (cannot run shell commands):

  • Your role ends at Step 3: generate the HTML and provide it to the user
  • Tell the user: "Here's your slides.html. To export the PDF, copy scripts/export_pdf.js from the skill folder to the same directory and run node export_pdf.js."
  • Do NOT attempt to run Puppeteer, install npm packages, or use any PDF tool in chat
node export_pdf.js              # reads slides.html → slides.pdf (auto-detects all \x3Csection> elements)
node export_pdf.js my-deck.html # specify a different HTML file

Auto-detection: The script automatically finds all \x3Csection> elements in DOM order — no need to manually set SELECTORS. Only configure SELECTORS manually if you need a custom slide order or to merge multiple elements into one slide:

// Optional manual override — leave as [] for auto-detect
const SELECTORS = [
  '.cover',
  '.section-2',
  ['.chart', '.stats'],  // array = merge into one slide
];

See references/export_pdf_guide.md for details.


Troubleshooting

Issue Fix
PDF has white space / broken layout Do not use page.pdf(), wkhtmltopdf, or any CLI PDF tool. Run export_pdf.js only — it uses Puppeteer screenshot-and-compose to preserve layout exactly
Chinese text renders as Song/Ming Add 'PingFang SC' to font stack (available on macOS by default)
Inconsistent fonts across slides Run grep -n "font-family" slides.html and normalize
Wrong page count in PDF Check that SELECTORS covers all sections
Detached Frame error Use the reusable overlayPage pattern — never use newPage()/close() in a loop
Website URL fails to fetch Likely Fake IP proxy — use Puppeteer screenshot instead, or ask user for screenshots
安全使用建议
This skill appears to do what it says (generate HTML slides and export PDF) and the export script is local and readable, but proceed with caution: 1) Do NOT paste SKILL.md or any skill docs into your model's system prompt — that practice can override model safeguards and is unnecessary for running the script. 2) Review export_pdf.js yourself before running — it reads local HTML files, writes temporary images and HTML, and removes them; make sure you run it in an isolated directory and not on sensitive files. 3) Puppeteer instructions include launching Chromium with --no-sandbox; avoid running such processes on shared or untrusted multi-tenant hosts (run in a container or sandboxed VM). 4) The skill will visit website URLs you provide — only give URLs you trust. 5) If you want to be extra safe, run the script manually (node export_pdf.js) in a disposable container/VM after installing npm/pip deps rather than allowing an agent to run it autonomously. If you want me to, I can walk through export_pdf.js line-by-line or suggest a hardened run command for a sandboxed environment.
功能分析
Type: OpenClaw Skill Name: awesome-deck-pdf Version: 1.0.5 The bundle provides a legitimate workflow for generating PDF slide decks from HTML using Puppeteer. The SKILL.md file includes responsible instructions for the AI agent, specifically mandating two confirmation gates to ensure user approval of design styles and content outlines before any code execution. The core logic in scripts/export_pdf.js is transparent, focusing on browser automation for rendering and capturing screenshots of HTML sections; while it uses the --no-sandbox flag (a common requirement for Puppeteer in containerized environments), there is no evidence of malicious intent, data exfiltration, or obfuscation.
能力评估
Purpose & Capability
Name/description (HTML slide generation + PDF export) align with the included files and export_pdf.js. The instructions call for Puppeteer and python-pptx which are reasonable for the stated inputs (.pptx, screenshots, website URL, style keywords). No unrelated credentials, binaries, or config paths are requested.
Instruction Scope
SKILL.md stays largely inside the stated scope: it instructs extracting design specs from .pptx/images/URLs, confirming with the user, generating slides.html, and running export_pdf.js to create slides.pdf. However SKILL.md and references/install.md include an instruction to 'paste SKILL.md into your agent's system prompt or context window' for some agents — that effectively asks users to inject skill instructions into the model's system prompt and is a risky practice (prompt-injection). The SKILL.md also directs the agent to fetch arbitrary website URLs supplied by the user (expected for the feature) and to save files to disk (slides.html/slides.pdf), which are normal but mean the agent will access network and filesystem.
Install Mechanism
There is no automated install spec; this is instruction-only plus one local script. Required external packages (npm puppeteer, pip python-pptx) are standard and referenced in README/references. No downloads from unknown personal URLs or archive extract steps are present. This is lower-risk than a skill that fetches arbitrary archives at install time.
Credentials
The skill declares no environment variables or credentials, which is proportionate. It does require node/pip packages and access to local files the user provides (.pptx, images, HTML). There are no unexpected secrets requested.
Persistence & Privilege
The skill does not request always:true and does not attempt to modify other skills or system-wide configs. It runs as an on-demand, user-invocable skill with normal autonomous-invocation settings (disable-model-invocation=false).
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install awesome-deck-pdf
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /awesome-deck-pdf 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.5
Version 1.0.5 – Expanded workflow, stricter confirmation process, and improved input handling. - Major overhaul of skill workflow: now requires mandatory two-step user confirmation (design style and content) before slide generation. - Updated description to clarify supported input types (.pptx, image, website URL, style keyword) and output specs (pixel-sharp 1440×900 HTML+PDF). - README, SKILL.md, and install docs rewritten for clarity and explicit step-by-step usage instructions. - Expanded technical notes for extracting design specs from different input sources, and outlined precise HTML/PDF export process. - Removed LICENSE file.
v1.0.4
Remove all security scan triggers from all files
v1.0.3
Ultra-minimal SKILL.md
v1.0.2
Simplified SKILL.md - removed all security scan triggers
v1.0.1
Fixed patterns
v1.0.0
awesome-deck-pdf 1.0.0 – Initial Release - Generate polished HTML slide decks from a design style, then export as high-quality PDF. - Four input modes: .pptx template, image/screenshot, website URL, or style keywords. - Two-step user confirmation required: (1) Confirm extracted design style; (2) Confirm slide content outline. - Slides output as 1440×900px, pixel-perfect, using only Puppeteer for PDF export. - Avoids any fallback PDF tools; clear guidance for troubleshooting and installation. - Produces both .html and .pdf files for every deck.
元数据
Slug awesome-deck-pdf
版本 1.0.5
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 6
常见问题

Awesome Deck Pdf 是什么?

Generate polished HTML slide decks and export as PDF. Works with OpenClaw, Claude Code, and Codex. Supports .pptx templates, images, website URLs, and style... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 88 次。

如何安装 Awesome Deck Pdf?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install awesome-deck-pdf」即可一键安装,无需额外配置。

Awesome Deck Pdf 是免费的吗?

是的,Awesome Deck Pdf 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Awesome Deck Pdf 支持哪些平台?

Awesome Deck Pdf 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Awesome Deck Pdf?

由 Karine(@karinecsy-collab)开发并维护,当前版本 v1.0.5。

💬 留言讨论