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/clean_unpacked.py

View on GitHub
#!/usr/bin/env python3
"""Remove orphaned files from an unpacked PPTX directory.

After editing an unpacked .pptx (typically via `unpack_pptx.py` → hand-edit
→ `pack_pptx.py`), the directory may contain files no longer referenced
from presentation.xml / rels graphs. Packing orphans back in bloats the
deck and can confuse some consumers. This pass removes them.

What it cleans:
- Slides not in presentation.xml's <p:sldIdLst> (+ matching .rels)
- [trash]/ directory
- Media, embeddings, charts, diagrams, tags, drawings, ink not reachable
  from any slide's rels graph
- Theme files not referenced in rels
- Notes slides with no corresponding content slide
- Orphan .rels files whose target resource no longer exists
- Matching <Override> entries in [Content_Types].xml

Loops until no further orphans are removed (removing a resource may
unreference another).

Usage:
    python3 clean_unpacked.py --input /path/to/unpacked_dir [--dry-run]
"""

from __future__ import annotations

import argparse
import sys
import xml.etree.ElementTree as ET
from pathlib import Path

_REL_ROOT = "{http://schemas.openxmlformats.org/package/2006/relationships}"
_CT_ROOT = "{http://schemas.openxmlformats.org/package/2006/content-types}"
_PML = "{http://schemas.openxmlformats.org/presentationml/2006/main}"
_REL_OFFICE = "{http://schemas.openxmlformats.org/officeDocument/2006/relationships}"


# Register default namespaces so ElementTree serializes them with
# `xmlns=` instead of `ns0:` / `ns1:` prefixes. Without this,
# presentation.xml.rels ends up with `<ns0:Relationships>`, which
# breaks downstream regex-based editors (e.g., add_slide.py looking
# for `</Relationships>`) and mismatches PowerPoint's expected form.
ET.register_namespace("", "http://schemas.openxmlformats.org/package/2006/relationships")
ET.register_namespace(
    "pkg_ct",
    "http://schemas.openxmlformats.org/package/2006/content-types",
)
# Content-Types.xml specifically uses the ct namespace as DEFAULT
# (xmlns="..."), so we re-register at write-time as empty for that file.

ET.register_namespace("p", "http://schemas.openxmlformats.org/presentationml/2006/main")
ET.register_namespace("a", "http://schemas.openxmlformats.org/drawingml/2006/main")
ET.register_namespace(
    "r",
    "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
)


def _parse(path: Path) -> ET.ElementTree:
    return ET.parse(str(path))


def _write(tree: ET.ElementTree, path: Path) -> None:
    # ElementTree emits its own XML declaration but without standalone="yes"
    # which PPTX consumers expect. Write to a buffer and prepend the
    # canonical declaration manually.
    import io

    # [Content_Types].xml uses the content-types namespace as the default
    # (xmlns=...). Swap our default-prefix registration right before
    # writing so the serialized output matches PowerPoint's expected form.
    if path.name == "[Content_Types].xml":
        ET.register_namespace(
            "",
            "http://schemas.openxmlformats.org/package/2006/content-types",
        )
    else:
        ET.register_namespace(
            "",
            "http://schemas.openxmlformats.org/package/2006/relationships",
        )

    buf = io.BytesIO()
    tree.write(buf, xml_declaration=False, encoding="UTF-8")
    declaration = b'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n'
    path.write_bytes(declaration + buf.getvalue())


def _relationships(rels_path: Path) -> list[tuple[str, str, str]]:
    """Return list of (Id, Type, Target) for a .rels file. [] if missing."""
    if not rels_path.exists():
        return []
    tree = _parse(rels_path)
    out: list[tuple[str, str, str]] = []
    for rel in tree.getroot().findall(f"{_REL_ROOT}Relationship"):
        out.append(
            (
                rel.get("Id", ""),
                rel.get("Type", ""),
                rel.get("Target", ""),
            )
        )
    return out


def _slides_in_sldidlst(unpacked: Path) -> set[str]:
    pres = unpacked / "ppt" / "presentation.xml"
    pres_rels = unpacked / "ppt" / "_rels" / "presentation.xml.rels"
    if not pres.exists() or not pres_rels.exists():
        return set()

    rid_to_slide: dict[str, str] = {}
    for rid, rtype, target in _relationships(pres_rels):
        if "slide" in rtype and target.startswith("slides/"):
            rid_to_slide[rid] = target[len("slides/"):]

    referenced: set[str] = set()
    tree = _parse(pres)
    sld_id_lst = tree.getroot().find(f"{_PML}sldIdLst")
    if sld_id_lst is None:
        return referenced
    for sld_id in sld_id_lst.findall(f"{_PML}sldId"):
        rid = sld_id.get(f"{_REL_OFFICE}id") or sld_id.get("r:id") or ""
        if rid in rid_to_slide:
            referenced.add(rid_to_slide[rid])
    return referenced


def _remove_orphaned_slides(unpacked: Path, removed: list[Path]) -> None:
    slides_dir = unpacked / "ppt" / "slides"
    if not slides_dir.exists():
        return
    keep = _slides_in_sldidlst(unpacked)
    for slide_file in slides_dir.glob("slide*.xml"):
        if slide_file.name not in keep:
            removed.append(slide_file)
            slide_file.unlink()
            rels_file = slides_dir / "_rels" / f"{slide_file.name}.rels"
            if rels_file.exists():
                removed.append(rels_file)
                rels_file.unlink()

    # Drop matching <Relationship> entries from presentation.xml.rels.
    pres_rels = unpacked / "ppt" / "_rels" / "presentation.xml.rels"
    if not pres_rels.exists():
        return
    tree = _parse(pres_rels)
    root = tree.getroot()
    changed = False
    for rel in list(root.findall(f"{_REL_ROOT}Relationship")):
        target = rel.get("Target", "")
        if target.startswith("slides/") and target[len("slides/"):] not in keep:
            root.remove(rel)
            changed = True
    if changed:
        _write(tree, pres_rels)


def _remove_trash(unpacked: Path, removed: list[Path]) -> None:
    trash = unpacked / "[trash]"
    if trash.exists() and trash.is_dir():
        for f in sorted(trash.rglob("*")):
            if f.is_file():
                removed.append(f)
                f.unlink()
        # Remove now-empty directories deepest-first.
        for d in sorted(trash.rglob("*"), reverse=True):
            if d.is_dir():
                try:
                    d.rmdir()
                except OSError:
                    pass
        try:
            trash.rmdir()
        except OSError:
            pass


def _all_referenced_parts(unpacked: Path) -> set[Path]:
    """Walk every .rels file and return the set of referenced file paths
    (relative to unpacked/ root, resolved), so an orphan pass can compare.
    """
    referenced: set[Path] = set()
    root = unpacked.resolve()
    for rels_file in unpacked.rglob("*.rels"):
        try:
            rels = _relationships(rels_file)
        except ET.ParseError:
            continue
        for _, _, target in rels:
            if not target:
                continue
            # External (mode="External") relationships won't resolve locally.
            if target.startswith("http://") or target.startswith("https://"):
                continue
            target_path = (rels_file.parent.parent / target).resolve()
            try:
                referenced.add(target_path.relative_to(root))
            except ValueError:
                pass
    return referenced


def _remove_orphan_resources(unpacked: Path, removed: list[Path]) -> int:
    """Remove unreferenced files in ppt/media, embeddings, charts, diagrams,
    tags, drawings, ink, notesSlides, and theme. Returns count removed.
    """
    referenced = _all_referenced_parts(unpacked)
    count = 0
    resource_dirs = [
        "media",
        "embeddings",
        "charts",
        "diagrams",
        "tags",
        "drawings",
        "ink",
    ]
    for name in resource_dirs:
        rdir = unpacked / "ppt" / name
        if not rdir.exists():
            continue
        for f in rdir.glob("*"):
            if not f.is_file():
                continue
            rel = f.relative_to(unpacked)
            if rel not in referenced:
                removed.append(f)
                f.unlink()
                count += 1

    # Theme files.
    theme_dir = unpacked / "ppt" / "theme"
    if theme_dir.exists():
        for f in theme_dir.glob("theme*.xml"):
            rel = f.relative_to(unpacked)
            if rel not in referenced:
                removed.append(f)
                f.unlink()
                count += 1
                # Matching theme rels.
                theme_rels = theme_dir / "_rels" / f"{f.name}.rels"
                if theme_rels.exists():
                    removed.append(theme_rels)
                    theme_rels.unlink()
                    count += 1

    # Notes slides whose corresponding content slide is gone.
    notes_dir = unpacked / "ppt" / "notesSlides"
    if notes_dir.exists():
        for f in notes_dir.glob("*.xml"):
            rel = f.relative_to(unpacked)
            if rel not in referenced:
                removed.append(f)
                f.unlink()
                count += 1
        notes_rels_dir = notes_dir / "_rels"
        if notes_rels_dir.exists():
            for rf in notes_rels_dir.glob("*.rels"):
                corresponding = notes_dir / rf.name.replace(".rels", "")
                if not corresponding.exists():
                    removed.append(rf)
                    rf.unlink()
                    count += 1
    return count


def _remove_orphan_rels(unpacked: Path, removed: list[Path]) -> int:
    """Remove .rels files whose target resource file no longer exists."""
    count = 0
    for rels_file in unpacked.rglob("*.rels"):
        target_base = rels_file.name.replace(".rels", "")
        if target_base == "":
            continue
        expected = rels_file.parent.parent / target_base
        # presentation.xml.rels, *.xml.rels variants — keep if the target exists.
        if target_base.endswith(".xml") and expected.exists():
            continue
        # chart1.xml.rels etc — check if the chart1.xml still exists.
        if expected.exists() or expected.is_file():
            continue
        removed.append(rels_file)
        rels_file.unlink()
        count += 1
    return count


def _update_content_types(unpacked: Path, removed_files: list[Path]) -> None:
    ct_path = unpacked / "[Content_Types].xml"
    if not ct_path.exists():
        return
    tree = _parse(ct_path)
    root = tree.getroot()
    removed_parts = {f"/{p.relative_to(unpacked).as_posix()}" for p in removed_files}
    changed = False
    for override in list(root.findall(f"{_CT_ROOT}Override")):
        part_name = override.get("PartName", "")
        if part_name in removed_parts:
            root.remove(override)
            changed = True
    if changed:
        _write(tree, ct_path)


def clean(unpacked: Path, *, dry_run: bool = False) -> list[Path]:
    removed: list[Path] = []
    if dry_run:
        # Run through without mutating: compute what would go and return it.
        # Simplest approach: do a real pass into a copy-on-write sandbox
        # later if we add it. For v1, dry_run is the same pass without
        # writing — we don't delete in dry-run, so we cheat by collecting
        # candidates via a shadow list. Keep simple: dry-run unsupported
        # for v1, raise instead of silently deleting.
        raise NotImplementedError("--dry-run not yet implemented")

    _remove_orphaned_slides(unpacked, removed)
    _remove_trash(unpacked, removed)

    # Iterate until no further orphans — removing a file can free its .rels
    # which can free another resource.
    while True:
        pass_removed_before = len(removed)
        _remove_orphan_resources(unpacked, removed)
        _remove_orphan_rels(unpacked, removed)
        if len(removed) == pass_removed_before:
            break

    if removed:
        _update_content_types(unpacked, removed)
    return removed


def main() -> int:
    parser = argparse.ArgumentParser(
        description="Remove orphaned files from an unpacked PPTX directory."
    )
    parser.add_argument(
        "--input",
        required=True,
        help="Path to unpacked PPTX directory (from unpack_pptx.py)",
    )
    parser.add_argument(
        "--quiet",
        action="store_true",
        help="Suppress per-file removal log on stdout.",
    )
    args = parser.parse_args()

    unpacked = Path(args.input).expanduser().resolve()
    if not unpacked.exists() or not unpacked.is_dir():
        print(f"Error: {unpacked} not found or not a directory", file=sys.stderr)
        return 1

    removed = clean(unpacked)
    if removed:
        if not args.quiet:
            print(f"Removed {len(removed)} unreferenced file(s):")
            for f in removed:
                try:
                    print(f"  {f.relative_to(unpacked)}")
                except ValueError:
                    print(f"  {f}")
        else:
            print(f"Removed {len(removed)} unreferenced file(s)")
    else:
        print("No unreferenced files found")
    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