siril9/presentation-skill / plugins/presentation-skill/skills/presentation-skill
presentation-skill
FlaggedBuild, 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.
scripts/extract_outline.py
View on GitHub#!/usr/bin/env python3
"""Extract slide titles, body bullets, and notes from a PPTX file."""
from __future__ import annotations
import argparse
import json
from pathlib import Path
from typing import Any
from pptx import Presentation
def _title_text(slide: Any) -> str:
try:
title_shape = slide.shapes.title
if title_shape is not None:
return (title_shape.text or "").strip()
except Exception:
pass
return ""
def _body_lines(slide: Any, title_text: str) -> list[dict[str, Any]]:
rows: list[dict[str, Any]] = []
for shape in slide.shapes:
if not hasattr(shape, "text_frame"):
continue
shape_text = (shape.text or "").strip()
if shape_text and title_text and shape_text == title_text:
continue
frame = shape.text_frame
for paragraph in frame.paragraphs:
text = paragraph.text.strip()
if not text:
continue
rows.append({"text": text, "level": int(getattr(paragraph, "level", 0))})
return rows
def _notes_text(slide: Any) -> str:
if not getattr(slide, "has_notes_slide", False):
return ""
notes_frame = slide.notes_slide.notes_text_frame
lines: list[str] = []
for paragraph in notes_frame.paragraphs:
text = paragraph.text.strip()
if text:
lines.append(text)
return "\n".join(lines)
def _to_markdown(data: dict[str, Any]) -> str:
lines: list[str] = []
lines.append("# Deck Outline")
lines.append("")
lines.append(f"- File: {data['file']}")
lines.append(f"- Slides: {data['slide_count']}")
lines.append("")
for slide in data["slides"]:
title = slide["title"] or "(No title)"
lines.append(f"## Slide {slide['index']}: {title}")
lines.append("")
if slide["body"]:
lines.append("Body:")
for item in slide["body"]:
prefix = " " * int(item["level"])
lines.append(f"- {prefix}{item['text']}")
else:
lines.append("Body: (empty)")
if slide["notes"]:
lines.append("")
lines.append("Notes:")
for note_line in slide["notes"].splitlines():
lines.append(f"- {note_line}")
lines.append("")
return "\n".join(lines).strip() + "\n"
def _args() -> argparse.Namespace:
parser = argparse.ArgumentParser(description="Extract an outline from a .pptx file.")
parser.add_argument("--input", required=True, help="Input .pptx path")
parser.add_argument(
"--format",
choices=["markdown", "json"],
default="markdown",
help="Output format",
)
parser.add_argument("--output", help="Optional output file path")
return parser.parse_args()
def main() -> int:
args = _args()
input_path = Path(args.input).expanduser().resolve()
if not input_path.exists():
raise FileNotFoundError(f"Input file not found: {input_path}")
presentation = Presentation(str(input_path))
slides: list[dict[str, Any]] = []
for idx, slide in enumerate(presentation.slides, start=1):
title = _title_text(slide)
slides.append(
{
"index": idx,
"title": title,
"body": _body_lines(slide, title),
"notes": _notes_text(slide),
}
)
payload = {
"file": str(input_path),
"slide_count": len(slides),
"slides": slides,
}
if args.format == "json":
content = json.dumps(payload, indent=2, ensure_ascii=False) + "\n"
else:
content = _to_markdown(payload)
if args.output:
output_path = Path(args.output).expanduser().resolve()
output_path.parent.mkdir(parents=True, exist_ok=True)
output_path.write_text(content, encoding="utf-8")
else:
print(content, end="")
return 0
if __name__ == "__main__":
try:
raise SystemExit(main())
except Exception as exc: # pragma: no cover - CLI error path
print(f"Error: {exc}")
raise SystemExit(1)
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 |