Skip to content

Akxan/ppt-agent-skill

ppt-agent

Verified

专业 PPT 演示文稿全流程 AI 生成助手。模拟顶级 PPT 设计公司的完整工作流(需求调研 -> 资料搜集 -> 大纲策划 -> 策划稿 -> 设计稿),输出高质量 HTML 格式演示文稿。当用户提到制作 PPT、做演示文稿、做 slides、做幻灯片、做汇报材料、做培训课件、做路演 deck、做产品介绍页面时触发此技能。即使用户只说"帮我做个关于 X 的介绍"或"我要给老板汇报 Y",只要暗示需要结构化的多页演示内容,都应该触发。也适用于用户说"帮我把这篇文档做成 PPT"、"把这个主题做成演示"等需要将内容转化为演示格式的场景。

FileKindSize
SKILL.mdskill md20.3 KB
assets/architecture.pngbinary2.0 MB
assets/architecture.svgother17.7 KB
assets/hero-all.pngbinary1.3 MB
assets/hero-cultural-oriental.pngbinary250.3 KB
assets/hero-dark-professional.pngbinary585.1 KB
assets/hero-light-premium.pngbinary639.5 KB
assets/hero-natural-retro.pngbinary403.2 KB
assets/hero-vibrant.pngbinary279.1 KB
assets/logo.svgother1.7 KB
references/README.mdmarkdown2.9 KB
references/bento-grid.mdmarkdown6.2 KB
references/blocks/README.mdmarkdown2.1 KB
references/blocks/card-styles.mdmarkdown5.6 KB
references/blocks/comparison.mdmarkdown1.8 KB
references/blocks/diagram.mdmarkdown1.9 KB
references/blocks/image-hero.mdmarkdown1.9 KB
references/blocks/matrix-chart.mdmarkdown1.9 KB
references/blocks/people.mdmarkdown1.6 KB
references/blocks/quote.mdmarkdown1.6 KB
references/blocks/timeline.mdmarkdown1.7 KB
references/charts/advanced.mdmarkdown39.0 KB
references/charts/basic.mdmarkdown57.9 KB
references/charts/complex.mdmarkdown83.7 KB
references/charts/index.mdmarkdown4.9 KB
references/design-runtime/css-weapons.mdmarkdown10.9 KB
references/design-runtime/data-type-visual-mapping.mdmarkdown7.9 KB
references/layouts/README.mdmarkdown4.8 KB
references/layouts/asymmetric.mdmarkdown1.2 KB
references/layouts/hero-top.mdmarkdown2.0 KB
references/layouts/l-shape.mdmarkdown1.6 KB
references/layouts/mixed-grid.mdmarkdown2.3 KB
references/layouts/primary-secondary.mdmarkdown1.8 KB
references/layouts/single-focus.mdmarkdown1.5 KB
references/layouts/symmetric.mdmarkdown1.5 KB
references/layouts/t-shape.mdmarkdown1.4 KB
references/layouts/three-column.mdmarkdown1.5 KB
references/layouts/waterfall.mdmarkdown1.3 KB
references/method.mdmarkdown2.8 KB
references/page-templates/cover.mdmarkdown2.4 KB
references/page-templates/end.mdmarkdown2.3 KB
references/page-templates/section.mdmarkdown1.9 KB
references/page-templates/toc.mdmarkdown1.9 KB
references/pipeline-compat.mdmarkdown7.5 KB
references/principles/README.mdmarkdown2.1 KB
references/principles/cognitive-load.mdmarkdown2.2 KB
references/principles/color-psychology.mdmarkdown2.2 KB
references/principles/composition.mdmarkdown2.6 KB
references/principles/data-visualization.mdmarkdown2.1 KB
references/principles/failure-modes.mdmarkdown4.9 KB
references/principles/narrative-arc.mdmarkdown2.7 KB
references/principles/visual-hierarchy.mdmarkdown2.9 KB
references/prompts.mdmarkdown32.8 KB
references/strict-mode.mdmarkdown6.4 KB
references/styles/cultural.mdmarkdown8.3 KB
references/styles/dark.mdmarkdown21.3 KB
references/styles/index.mdmarkdown11.8 KB
references/styles/light.mdmarkdown21.9 KB
references/styles/natural.mdmarkdown11.1 KB
references/styles/vibrant.mdmarkdown10.6 KB
references/typography.mdmarkdown8.6 KB
scripts/README.mdmarkdown2.3 KB
scripts/build_hero.pyscript7.2 KB
scripts/contracts.pyscript12.8 KB
scripts/gallery.pyscript10.3 KB
scripts/html2png.pyscript2.9 KB
scripts/html2svg.pyscript24.2 KB
scripts/html_packager.pyscript10.1 KB
scripts/png2pptx.pyscript2.4 KB
scripts/pptx_motion.pyscript8.8 KB
scripts/resource_loader.pyscript7.0 KB
scripts/smoke_test.pyscript16.3 KB
scripts/svg2pptx.pyscript45.3 KB
scripts/validate.pyscript23.0 KB

scripts/build_hero.py

View on GitHub
#!/usr/bin/env python3
"""build_hero.py -- 把 26 张风格截图拼成 5 板块 hero 拼图

输出:
  assets/hero-all.png         总览:26 风格 5 板块网格(适合 README 顶部)
  assets/hero-<category>.png  每个板块单独一张
"""

from __future__ import annotations

import sys
from pathlib import Path

try:
    from PIL import Image, ImageDraw, ImageFont
except ImportError:
    print("Pillow not installed. Run: pip install Pillow", file=sys.stderr)
    sys.exit(1)

import contracts as C

GALLERY = C.SKILL_DIR / "ppt-output" / "style-gallery"
ASSETS = C.SKILL_DIR / "assets"
ASSETS.mkdir(exist_ok=True)


def load_categories() -> dict:
    """板块 -> {cn, en, ids},顺序与内容都取自风格库。"""
    categories = {key: {"cn": label["cn"], "en": label["en"], "ids": []}
                  for key, label in C.STYLE_CATEGORIES.items()}
    for style in C.load_styles():
        categories[style["category"]]["ids"].append(style["style_id"])
    return categories


CATEGORIES = load_categories()

THUMB_W, THUMB_H = 480, 270  # 16:9 缩略图
GAP = 20
PADDING = 60
LABEL_HEIGHT = 60
BG_COLOR = (10, 10, 12)
LABEL_COLOR = (255, 255, 255)


def get_font(size: int, bold: bool = False, cjk: bool = False):
    """获取字体。cjk=True 优先选含中文字符的字体。"""
    if cjk:
        candidates = [
            "/System/Library/Fonts/STHeiti Medium.ttc",
            "/System/Library/Fonts/Hiragino Sans GB.ttc",
            "/System/Library/Fonts/PingFang.ttc",
            "/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc",
        ]
    else:
        candidates = [
            "/System/Library/Fonts/HelveticaNeue.ttc",
            "/System/Library/Fonts/SFNS.ttf",
            "/System/Library/Fonts/Helvetica.ttc",
            "/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf" if bold else "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf",
        ]
    for c in candidates:
        if Path(c).exists():
            try:
                return ImageFont.truetype(c, size)
            except OSError:
                continue
    return ImageFont.load_default()


def make_thumbnail(img_path: Path, w: int = THUMB_W, h: int = THUMB_H) -> Image.Image:
    if not img_path.exists():
        thumb = Image.new("RGB", (w, h), (40, 40, 48))
        return thumb
    img = Image.open(img_path).convert("RGB")
    img.thumbnail((w * 2, h * 2))  # high-res first
    img = img.resize((w, h), Image.LANCZOS)
    return img


def build_category_image(cat_key: str, cat_data: dict) -> Image.Image:
    ids = cat_data["ids"]
    n = len(ids)
    cols = 4 if n >= 6 else (3 if n >= 4 else n)
    rows = (n + cols - 1) // cols

    width = PADDING * 2 + cols * THUMB_W + (cols - 1) * GAP
    height = PADDING + LABEL_HEIGHT + rows * THUMB_H + (rows - 1) * GAP + PADDING

    canvas = Image.new("RGB", (width, height), BG_COLOR)
    draw = ImageDraw.Draw(canvas)

    title_font = get_font(28, bold=True, cjk=True)
    caption_font = get_font(12)
    accent_font = get_font(11, bold=True)

    draw.text((PADDING, PADDING - 10), cat_data["cn"], fill=LABEL_COLOR, font=title_font)
    sub_text = f"{cat_data['en'].upper()}  ·  {n} STYLES"
    draw.text((PADDING, PADDING + 26), sub_text, fill=(110, 200, 230), font=accent_font)
    accent_y = PADDING + 22
    draw.line([(PADDING + len(cat_data["cn"]) * 30 + 12, accent_y), (PADDING + len(cat_data["cn"]) * 30 + 60, accent_y)], fill=(34, 211, 238), width=2)

    for i, sid in enumerate(ids):
        row = i // cols
        col = i % cols
        x = PADDING + col * (THUMB_W + GAP)
        y = PADDING + LABEL_HEIGHT + row * (THUMB_H + GAP)

        thumb = make_thumbnail(GALLERY / f"{sid}.png")
        canvas.paste(thumb, (x, y))

        draw.rectangle([(x, y), (x + THUMB_W - 1, y + THUMB_H - 1)], outline=(40, 50, 65), width=1)

        label_overlay = Image.new("RGBA", (THUMB_W, 28), (0, 0, 0, 180))
        canvas.paste(label_overlay, (x, y + THUMB_H - 28), label_overlay)
        draw.text((x + 10, y + THUMB_H - 22), sid, fill=(220, 230, 240), font=caption_font)

    return canvas


def build_all_categories_grid() -> Image.Image:
    total_styles = sum(len(c["ids"]) for c in CATEGORIES.values())

    cols = 5
    n = total_styles
    rows = (n + cols - 1) // cols

    thumb_w, thumb_h = 360, 202
    gap = 14
    padding = 80
    header = 200

    width = padding * 2 + cols * thumb_w + (cols - 1) * gap
    height = padding + header + rows * thumb_h + (rows - 1) * gap + padding

    canvas = Image.new("RGB", (width, height), BG_COLOR)
    draw = ImageDraw.Draw(canvas)

    overlay = Image.new("RGBA", (width, height), (0, 0, 0, 0))
    odraw = ImageDraw.Draw(overlay)
    for x_pos, y_pos, color, radius in [
        (int(width * 0.85), 100, (99, 102, 241, 80), 400),
        (int(width * 0.15), height - 200, (34, 211, 238, 60), 350),
    ]:
        for r in range(radius, 0, -8):
            alpha = int(color[3] * (1 - r / radius) * 0.3)
            odraw.ellipse([(x_pos - r, y_pos - r), (x_pos + r, y_pos + r)],
                         fill=(color[0], color[1], color[2], alpha))
    canvas = Image.alpha_composite(canvas.convert("RGBA"), overlay).convert("RGB")
    draw = ImageDraw.Draw(canvas)

    title_font = get_font(56, bold=True, cjk=True)
    sub_font = get_font(20, cjk=True)
    accent_font = get_font(13, bold=True)
    caption_font = get_font(11)

    draw.ellipse([(padding, padding + 10), (padding + 12, padding + 22)], fill=(34, 211, 238))
    draw.text((padding + 24, padding + 8), "PPT AGENT SKILL · WORLD-CLASS", fill=(34, 211, 238), font=accent_font)
    draw.text((padding, padding + 50), f"{total_styles} 风格预览画廊", fill=(255, 255, 255), font=title_font)
    draw.text((padding, padding + 130),
              f"{len(CATEGORIES)} 板块 · {len(C.CHARTS)} 图表 · 世界级排版 · Linear / Anthropic / Stripe / Apple / NYT 标杆",
              fill=(180, 200, 220), font=sub_font)

    all_styles = []
    for cat in CATEGORIES.values():
        all_styles.extend(cat["ids"])

    for i, sid in enumerate(all_styles):
        row = i // cols
        col = i % cols
        x = padding + col * (thumb_w + gap)
        y = padding + header + row * (thumb_h + gap)

        thumb = make_thumbnail(GALLERY / f"{sid}.png", thumb_w, thumb_h)
        canvas.paste(thumb, (x, y))
        draw.rectangle([(x, y), (x + thumb_w - 1, y + thumb_h - 1)], outline=(40, 50, 65), width=1)

        label_h = 24
        label_overlay = Image.new("RGBA", (thumb_w, label_h), (0, 0, 0, 200))
        canvas.paste(label_overlay, (x, y + thumb_h - label_h), label_overlay)
        draw.text((x + 8, y + thumb_h - label_h + 6), sid, fill=(220, 230, 240), font=caption_font)

    return canvas


def main():
    print("Building category images...")
    for cat_key, cat_data in CATEGORIES.items():
        img = build_category_image(cat_key, cat_data)
        out = ASSETS / f"hero-{cat_key.replace('_', '-')}.png"
        img.save(out, optimize=True)
        print(f"  ✓ {out.name} ({img.width}x{img.height})")

    print("\nBuilding overall grid...")
    grid = build_all_categories_grid()
    out = ASSETS / "hero-all.png"
    grid.save(out, optimize=True)
    print(f"  ✓ {out.name} ({grid.width}x{grid.height})")

    print(f"\nDone. Outputs in {ASSETS}/")


if __name__ == "__main__":
    main()
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall