Skip to content

siril9/presentation-skill / plugins/presentation-skill/skills/presentation-skill

presentation-skill

Flagged

Build, edit, redesign, render, and verify content-led, structurally diverse, clean, editable, reproducible PowerPoint `.pptx` decks. Use for scientific, lab, clinical, consulting, board, investor, editorial, policy, and operational presentations where alignment, readability, contrast, and balanced density matter.

FileKindSize
DESIGN.mdmarkdown13.7 KB
DISCOVERY.mdmarkdown6.6 KB
LICENSEother1.0 KB
SKILL.mdskill md14.7 KB
agents/discovery.jsonconfig8.2 KB
agents/openai.yamlconfig309 B
examples/outline.jsonconfig3.4 KB
package-lock.jsonmanifest22.0 KB
package.jsonmanifest1.8 KB
references/agent_picker.mdmarkdown1.9 KB
references/alignment_and_coherence.mdmarkdown2.1 KB
references/assets/visual_references/editorial_chart.jpgbinary53.2 KB
references/assets/visual_references/editorial_decision.jpgbinary100.4 KB
references/assets/visual_references/editorial_focal_metric.jpgbinary45.4 KB
references/assets/visual_references/editorial_pilot.jpgbinary62.0 KB
references/assets/visual_references/lab-native-method.jpgbinary53.9 KB
references/assets/visual_references/lab-residual-panels.jpgbinary64.8 KB
references/assets/visual_references/lab_cover.jpgbinary39.8 KB
references/assets/visual_references/lab_endpoints.jpgbinary70.8 KB
references/assets/visual_references/lab_evidence_gate.jpgbinary67.3 KB
references/assets/visual_references/lab_trend.jpgbinary60.5 KB
references/assets/visual_references/operations_handoffs.jpgbinary87.2 KB
references/assets/visual_references/operations_owner_register.jpgbinary87.2 KB
references/assets/visual_references/operations_queue.jpgbinary81.8 KB
references/assets/visual_references/operations_tradeoff.jpgbinary99.9 KB
references/benchmark_protocol.mdmarkdown12.1 KB
references/codex_guardrails.mdmarkdown10.3 KB
references/composition_grammar_catalog.mdmarkdown4.0 KB
references/deck_creation.mdmarkdown1.4 KB
references/deck_workspace_mode.mdmarkdown34.4 KB
references/design_philosophy.mdmarkdown5.5 KB
references/dynamic_design_and_subagents.mdmarkdown12.3 KB
references/editing.mdmarkdown12.4 KB
references/external_best_practices.mdmarkdown1.7 KB
references/large_style_corpus_sources.jsonconfig22.7 KB
references/model_adaptive_workflow.mdmarkdown6.6 KB
references/outline_schema.mdmarkdown44.8 KB
references/planning_schema.mdmarkdown54.8 KB
references/pptxgenjs.mdmarkdown7.6 KB
references/preview_extension.mdmarkdown1.7 KB
references/reference_script_patterns.mdmarkdown13.5 KB
references/renderer_role_contracts_v2.jsonconfig38.2 KB
references/reproducible_workflow.mdmarkdown5.1 KB
references/speed_and_rendering.mdmarkdown4.6 KB
references/style_grammar_index.jsonconfig364.2 KB
references/style_inspiration_corpus.jsonconfig32.9 KB
references/style_reference_catalog.mdmarkdown23.9 KB
references/style_reference_sources.jsonconfig35.8 KB
references/style_token_atlas.jsonconfig174.7 KB
references/subagent_patterns.mdmarkdown10.2 KB
references/visual_qa_prompt.mdmarkdown4.9 KB
references/visual_reference_catalog.jsonconfig26.6 KB
references/visual_reference_catalog.mdmarkdown6.0 KB
schemas/deck_ir.schema.jsonconfig9.5 KB
schemas/renderer_capabilities_v2.jsonconfig701 B
scripts/accessibility_qa.pyscript24.8 KB
scripts/action_registry.pyscript12.5 KB
scripts/add_slide.pyscript8.6 KB
scripts/advance_delivery.pyscript88.2 KB
scripts/advance_workspace.pyscript150.3 KB
scripts/apply_artifact_manifest_bindings.pyscript54.1 KB
scripts/apply_atom_composition.pyscript8.2 KB
scripts/apply_data_analysis_handoff.pyscript67.0 KB
scripts/apply_deck_intake_answers.pyscript35.6 KB
scripts/apply_design_contract.pyscript71.7 KB
scripts/apply_outline_authoring_handoff.pyscript23.7 KB
scripts/apply_pptx_style_fragment.pyscript19.7 KB
scripts/asset_stage.pyscript24.6 KB
scripts/audition_styles.pyscript8.7 KB
scripts/benchmark_decks.pyexecutablescript45.4 KB
scripts/build_deck.pyexecutablescript173.6 KB
scripts/build_deck_pptxgenjs.jsexecutablescript72.7 KB
scripts/build_large_style_corpus_contact_sheets.pyscript18.1 KB
scripts/build_workspace.pyscript126.2 KB
scripts/clean_unpacked.pyscript12.9 KB
scripts/compact_source_footers.pyscript17.8 KB
scripts/composition_grammar_catalog.pyscript30.3 KB
scripts/deck_benchmark.pyscript71.1 KB
scripts/deck_intake.pyscript6.9 KB
scripts/deck_ir.pyscript47.5 KB
scripts/design_catalog_selector.pyscript17.4 KB
scripts/design_rules_qa.pyscript24.8 KB
scripts/design_tokens.pyscript20.3 KB
scripts/edit_deck.pyscript8.4 KB
scripts/emit_content_research.pyscript4.6 KB
scripts/emit_data_analysis_prompt.pyscript30.1 KB
scripts/emit_deck_intake_prompt.pyexecutablescript19.9 KB
scripts/emit_deck_start_packet.pyscript97.1 KB
scripts/emit_design_contract_prompt.pyscript66.2 KB
scripts/emit_outline_authoring_prompt.pyscript35.4 KB
scripts/emit_outline_critique.pyscript11.6 KB
scripts/emit_style_content_router.pyscript49.6 KB
scripts/extract_outline.pyexecutablescript4.1 KB
scripts/extract_pptx_style.pyscript33.2 KB
scripts/fetch_wikimedia_cc.pyscript8.6 KB
scripts/finalize_quick_deck.pyscript17.6 KB
scripts/generate_openai_image.pyscript5.6 KB
scripts/init_deck_workspace.pyscript74.4 KB
scripts/inspect_artifact_manifest.pyscript29.8 KB
scripts/inventory.pyscript10.6 KB
scripts/iterate_deck.pyexecutablescript10.2 KB
scripts/layout_lint.pyscript40.4 KB
scripts/log_skill_telemetry.pyscript6.9 KB
scripts/model_adaptive_workflow.pyscript28.0 KB
scripts/office_package_hash.pyscript1.6 KB
scripts/pack_pptx.pyscript5.7 KB
scripts/palette_from_topic.pyscript4.1 KB
scripts/plan_research_assets.pyscript13.1 KB
scripts/preflight.pyscript136.9 KB
scripts/present.pyscript9.6 KB
scripts/python_runtime.pyscript787 B
scripts/qa_gate.pyexecutablescript27.4 KB
scripts/qa_visual_gate.pyexecutablescript8.5 KB
scripts/reference_deck.pyscript12.7 KB
scripts/render_cache.pyscript3.9 KB
scripts/render_mermaid.pyscript8.9 KB
scripts/render_slides.pyexecutablescript19.4 KB
scripts/repair_packet.pyscript14.7 KB
scripts/report_delivery_readiness.pyscript107.6 KB
scripts/report_workspace_readiness.pyscript244.6 KB
scripts/requirements-runtime.txtmarkdown472 B
scripts/role_layout_contracts.pyscript10.6 KB
scripts/runtime_doctor.pyscript6.3 KB
scripts/scaffold_figure_artifacts.pyscript92.3 KB
scripts/source_fidelity.pyscript30.5 KB
scripts/structural_diversity_v2.pyscript32.5 KB
scripts/style_atom_router.pyscript14.5 KB
scripts/style_inspiration_corpus.pyscript15.1 KB
scripts/style_reference_catalog.pyscript142.8 KB
scripts/style_reference_sources.pyscript12.7 KB
scripts/style_treatment_profiles.pyscript26.0 KB
scripts/summarize_skill_log.pyscript7.0 KB
scripts/taste_grammar_catalog.pyscript27.0 KB
scripts/test_structural_diversity_v2.pyscript4.9 KB
scripts/text_fit.pyscript23.6 KB
scripts/thumbnail.pyscript9.2 KB
scripts/trim_image_whitespace.pyexecutablescript5.4 KB
scripts/unpack_pptx.pyscript8.3 KB
scripts/upgrade_renderer_role_contracts_v2.pyscript7.3 KB
scripts/validate_planning.pyscript169.2 KB
scripts/verify_narration.pyscript10.6 KB
scripts/visual_qa.pyscript7.7 KB
scripts/visual_review.pyscript41.1 KB
scripts/visual_review_receipt.pyscript8.3 KB
scripts/workflow_atom_context.pyscript17.3 KB
templates/pptxgenjs/README.mdmarkdown8.4 KB
templates/pptxgenjs/presets.jsscript5.6 KB
templates/pptxgenjs/readable_role_layouts.jsscript17.5 KB
templates/pptxgenjs/render_plan.jsscript12.6 KB
templates/pptxgenjs/role_layout_contracts.jsscript4.7 KB
templates/pptxgenjs/slides.jsscript451.0 KB
templates/pptxgenjs/space_allocation.jsscript1.6 KB

scripts/thumbnail.py

View on GitHub
#!/usr/bin/env python3
"""Create thumbnail grids from a PPTX for bird's-eye review.

Renders each slide to a JPG, arranges them in a labeled grid, and writes
one or more grid images. Useful for (a) analyzing an unfamiliar template
deck before duplicating from it, and (b) a fast visual-QA scan of the
finished deck that's faster than paging through per-slide JPGs.

Hidden slides are rendered as diagonal-hatch placeholders so the grid
still numbers correctly.

Usage:
    python3 thumbnail.py --input deck.pptx
    # Creates: thumbnails.jpg

    python3 thumbnail.py --input template.pptx --output grid --cols 4
    # Creates: grid.jpg (or grid-1.jpg, grid-2.jpg for large decks)

Dependencies: Pillow, LibreOffice (`soffice` or `unoconvert`), `pdftoppm`.
"""

from __future__ import annotations

import argparse
import re
import subprocess
import sys
import tempfile
import xml.etree.ElementTree as ET
import zipfile
from pathlib import Path

from PIL import Image, ImageDraw, ImageFont

# Reuse the render helper so we pick up unoserver when available.
sys.path.insert(0, str(Path(__file__).resolve().parent))
from render_slides import _render_with_daemon_or_fallback  # type: ignore

THUMBNAIL_WIDTH = 300
CONVERSION_DPI = 100
MAX_COLS = 6
DEFAULT_COLS = 3
JPEG_QUALITY = 95
GRID_PADDING = 20
BORDER_WIDTH = 2
FONT_SIZE_RATIO = 0.10
LABEL_PADDING_RATIO = 0.4

_REL_NS = "{http://schemas.openxmlformats.org/package/2006/relationships}"
_PML = "{http://schemas.openxmlformats.org/presentationml/2006/main}"
_REL_OFFICE = "{http://schemas.openxmlformats.org/officeDocument/2006/relationships}"


def _slide_info(pptx: Path) -> list[dict]:
    """Read sldIdLst + .rels to return ordered slide metadata, including
    `hidden` status (from `show="0"` attribute).
    """
    info: list[dict] = []
    with zipfile.ZipFile(pptx, "r") as zf:
        rels_text = zf.read("ppt/_rels/presentation.xml.rels").decode("utf-8")
        rid_to_name: dict[str, str] = {}
        rels_tree = ET.fromstring(rels_text)
        for rel in rels_tree.findall(f"{_REL_NS}Relationship"):
            rtype = rel.get("Type", "")
            target = rel.get("Target", "")
            if "slide" in rtype and target.startswith("slides/"):
                rid_to_name[rel.get("Id", "")] = target[len("slides/"):]

        pres_text = zf.read("ppt/presentation.xml").decode("utf-8")
        pres_tree = ET.fromstring(pres_text)
        sld_id_lst = pres_tree.find(f"{_PML}sldIdLst")
        if sld_id_lst is None:
            return info
        for sld_id in sld_id_lst.findall(f"{_PML}sldId"):
            rid = sld_id.get(f"{_REL_OFFICE}id") or ""
            if not rid:
                # ElementTree doesn't expand namespace in attribute names
                # the same way on all systems; fall back to raw regex.
                match = re.search(r'r:id="([^"]+)"', ET.tostring(sld_id, encoding="unicode"))
                if match:
                    rid = match.group(1)
            hidden = sld_id.get("show") == "0"
            if rid in rid_to_name:
                info.append({"name": rid_to_name[rid], "hidden": hidden})
    return info


def _convert_to_images(pptx: Path, out_dir: Path) -> list[Path]:
    pdf_path = _render_with_daemon_or_fallback(pptx, out_dir)
    subprocess.run(
        [
            "pdftoppm",
            "-jpeg",
            "-r",
            str(CONVERSION_DPI),
            str(pdf_path),
            str(out_dir / "slide"),
        ],
        check=True,
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE,
    )
    return sorted(out_dir.glob("slide-*.jpg"))


def _hidden_placeholder(size: tuple[int, int]) -> Image.Image:
    img = Image.new("RGB", size, color="#F0F0F0")
    draw = ImageDraw.Draw(img)
    line_w = max(5, min(size) // 100)
    draw.line([(0, 0), size], fill="#CCCCCC", width=line_w)
    draw.line([(size[0], 0), (0, size[1])], fill="#CCCCCC", width=line_w)
    return img


def _build_slide_list(
    slide_info: list[dict],
    visible_images: list[Path],
    workdir: Path,
) -> list[tuple[Path, str]]:
    if visible_images:
        with Image.open(visible_images[0]) as probe:
            placeholder_size = probe.size
    else:
        placeholder_size = (1920, 1080)

    slides: list[tuple[Path, str]] = []
    visible_idx = 0
    for info in slide_info:
        if info["hidden"]:
            pph_path = workdir / f"hidden-{info['name']}.jpg"
            _hidden_placeholder(placeholder_size).save(pph_path, "JPEG")
            slides.append((pph_path, f"{info['name']} (hidden)"))
        else:
            if visible_idx < len(visible_images):
                slides.append((visible_images[visible_idx], info["name"]))
                visible_idx += 1
    return slides


def _build_grid(
    slides: list[tuple[Path, str]],
    cols: int,
    thumb_width: int,
) -> Image.Image:
    font_size = int(thumb_width * FONT_SIZE_RATIO)
    label_pad = int(font_size * LABEL_PADDING_RATIO)

    with Image.open(slides[0][0]) as probe:
        aspect = probe.height / probe.width
    thumb_h = int(thumb_width * aspect)

    rows = (len(slides) + cols - 1) // cols
    grid_w = cols * thumb_width + (cols + 1) * GRID_PADDING
    grid_h = rows * (thumb_h + font_size + label_pad * 2) + (rows + 1) * GRID_PADDING

    grid = Image.new("RGB", (grid_w, grid_h), "white")
    draw = ImageDraw.Draw(grid)
    try:
        font = ImageFont.load_default(size=font_size)
    except Exception:  # pragma: no cover - old Pillow
        font = ImageFont.load_default()

    for i, (src_path, label) in enumerate(slides):
        row, col = divmod(i, cols)
        x = col * thumb_width + (col + 1) * GRID_PADDING
        y_base = row * (thumb_h + font_size + label_pad * 2) + (row + 1) * GRID_PADDING

        bbox = draw.textbbox((0, 0), label, font=font)
        text_w = bbox[2] - bbox[0]
        draw.text(
            (x + (thumb_width - text_w) // 2, y_base + label_pad),
            label,
            fill="black",
            font=font,
        )
        y_thumb = y_base + label_pad + font_size + label_pad

        with Image.open(src_path) as img:
            img.thumbnail((thumb_width, thumb_h), Image.Resampling.LANCZOS)
            w, h = img.size
            tx = x + (thumb_width - w) // 2
            ty = y_thumb + (thumb_h - h) // 2
            grid.paste(img, (tx, ty))
            if BORDER_WIDTH > 0:
                draw.rectangle(
                    [
                        (tx - BORDER_WIDTH, ty - BORDER_WIDTH),
                        (tx + w + BORDER_WIDTH - 1, ty + h + BORDER_WIDTH - 1),
                    ],
                    outline="gray",
                    width=BORDER_WIDTH,
                )
    return grid


def _write_grids(
    slides: list[tuple[Path, str]],
    cols: int,
    thumb_width: int,
    output_path: Path,
) -> list[Path]:
    max_per_grid = cols * (cols + 1)
    grid_files: list[Path] = []
    chunks = list(range(0, len(slides), max_per_grid))

    for chunk_idx, start in enumerate(chunks):
        end = min(start + max_per_grid, len(slides))
        chunk = slides[start:end]
        grid = _build_grid(chunk, cols, thumb_width)
        if len(chunks) == 1:
            target = output_path
        else:
            target = output_path.with_name(
                f"{output_path.stem}-{chunk_idx + 1}{output_path.suffix}"
            )
        target.parent.mkdir(parents=True, exist_ok=True)
        grid.save(str(target), quality=JPEG_QUALITY)
        grid_files.append(target)
    return grid_files


def main() -> int:
    parser = argparse.ArgumentParser(
        description="Render a .pptx as labeled thumbnail grid(s)."
    )
    parser.add_argument("--input", required=True, help="Input .pptx path")
    parser.add_argument(
        "--output",
        default="thumbnails.jpg",
        help="Output JPG path. Large decks emit <stem>-1.jpg, <stem>-2.jpg, ...",
    )
    parser.add_argument(
        "--cols",
        type=int,
        default=DEFAULT_COLS,
        help=f"Columns per grid (default {DEFAULT_COLS}, max {MAX_COLS})",
    )
    parser.add_argument(
        "--width",
        type=int,
        default=THUMBNAIL_WIDTH,
        help=f"Thumbnail width in pixels (default {THUMBNAIL_WIDTH})",
    )
    args = parser.parse_args()

    input_path = Path(args.input).expanduser().resolve()
    if not input_path.exists() or input_path.suffix.lower() != ".pptx":
        print(f"Error: invalid .pptx path: {args.input}", file=sys.stderr)
        return 1

    cols = min(args.cols, MAX_COLS)
    if args.cols > MAX_COLS:
        print(f"Warning: --cols clamped to {MAX_COLS}", file=sys.stderr)

    output_path = Path(args.output).expanduser().resolve()
    if output_path.suffix.lower() != ".jpg":
        output_path = output_path.with_suffix(".jpg")

    slide_info = _slide_info(input_path)
    with tempfile.TemporaryDirectory(prefix="pptx-thumb-") as tmp:
        tmp_path = Path(tmp)
        visible = _convert_to_images(input_path, tmp_path)
        if not visible and not any(s["hidden"] for s in slide_info):
            print("Error: no slides rendered", file=sys.stderr)
            return 2
        slides = _build_slide_list(slide_info, visible, tmp_path)
        grids = _write_grids(slides, cols, args.width, output_path)

    print(f"Created {len(grids)} grid(s):")
    for g in grids:
        print(f"  {g}")
    return 0


if __name__ == "__main__":
    raise SystemExit(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: 197kUpdated 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: 197kUpdated 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: 197kUpdated 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: 197kUpdated Claude CodeCodexVerifiedInstall