ppt-agent
Verified专业 PPT 演示文稿全流程 AI 生成助手。模拟顶级 PPT 设计公司的完整工作流(需求调研 -> 资料搜集 -> 大纲策划 -> 策划稿 -> 设计稿),输出高质量 HTML 格式演示文稿。当用户提到制作 PPT、做演示文稿、做 slides、做幻灯片、做汇报材料、做培训课件、做路演 deck、做产品介绍页面时触发此技能。即使用户只说"帮我做个关于 X 的介绍"或"我要给老板汇报 Y",只要暗示需要结构化的多页演示内容,都应该触发。也适用于用户说"帮我把这篇文档做成 PPT"、"把这个主题做成演示"等需要将内容转化为演示格式的场景。
scripts/html2png.py
View on GitHub#!/usr/bin/env python3
"""HTML -> PNG 截图(像素级保真,文字不可编辑)
Puppeteer 以 1280x720 视口截图;--scale 为设备像素比(2 -> 2560x1440)。
依赖与 html2svg.py 共用 skill 根目录的 node_modules。
用法:
python3 scripts/html2png.py <html_dir_or_file> [-o output_dir] [--scale 2]
"""
from __future__ import annotations
import argparse
import sys
from pathlib import Path
from html2svg import ensure_puppeteer, natural_key, run_node
SCREENSHOT_SCRIPT = r"""
const puppeteer = require('puppeteer');
const path = require('path');
(async () => {
const config = JSON.parse(process.argv[2]);
const browser = await puppeteer.launch({
headless: 'new',
args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-gpu', '--font-render-hinting=none']
});
for (const item of config.files) {
const page = await browser.newPage();
await page.setViewport({ width: 1280, height: 720, deviceScaleFactor: config.scale });
await page.goto('file://' + item.html, { waitUntil: 'networkidle0', timeout: 30000 });
await page.evaluate(async () => {
await document.fonts.ready;
await Promise.all(Array.from(document.images).map((img) =>
img.complete ? null : new Promise((r) => { img.onload = r; img.onerror = r; })));
});
await page.screenshot({ path: item.png, type: 'png', clip: { x: 0, y: 0, width: 1280, height: 720 } });
console.log('PNG: ' + path.basename(item.html));
await page.close();
}
await browser.close();
})();
"""
def convert(html_path: Path, output_dir: Path, scale: float = 2.0) -> bool:
html_files = [html_path] if html_path.is_file() else sorted(html_path.glob("*.html"), key=natural_key)
if not html_files:
print(f"No HTML files in {html_path}", file=sys.stderr)
return False
if not ensure_puppeteer():
return False
output_dir.mkdir(parents=True, exist_ok=True)
config = {"scale": scale,
"files": [{"html": str(f), "png": str(output_dir / (f.stem + ".png"))} for f in html_files]}
print(f"Converting {len(html_files)} HTML files -> PNG ({scale}x)...")
if not run_node(SCREENSHOT_SCRIPT, config, ".html2png_tmp.js"):
return False
print(f"Done! {len(html_files)} PNGs -> {output_dir}")
return True
def main():
parser = argparse.ArgumentParser(description="HTML -> PNG screenshots")
parser.add_argument("path", help="HTML file or directory of slides")
parser.add_argument("-o", "--output", help="Output directory (default: <slides parent>/png)")
parser.add_argument("--scale", type=float, default=2.0, help="Device pixel ratio (default: 2)")
args = parser.parse_args()
html_path = Path(args.path).resolve()
output_dir = Path(args.output).resolve() if args.output else html_path.parent / "png"
sys.exit(0 if convert(html_path, output_dir, args.scale) else 1)
if __name__ == "__main__":
main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |