Skill 详情
powerpoint
Dedicated YAML-driven PowerPoint generation and management pipeline.
使用前先检查
自动化审核只检查相关性,不代表安全审查或推荐。使用前请阅读来源中的说明。
SKILL.md
这段内容是审核时保存的快照。外部来源才是完整且最新的版本。
--- name: powerpoint description: 'PowerPoint slide deck generation and management using python-pptx with YAML-driven content and styling' license: MIT compatibility: 'Requires uv, Python 3.11+, PowerShell 7+, and LibreOffice' metadata: authors: "microsoft/hve-core" spec_version: "1.0" last_updated: "2026-08-09" --- # PowerPoint Skill Generates, updates, and manages PowerPoint slide decks using `python-pptx` with YAML-driven content and styling definitions. ## Overview This skill provides Python scripts that consume YAML configuration files to produce PowerPoint slide decks. Each slide is defined by a `content.yaml` file describing its layout, text, and shapes. A `style.yaml` file defines dimensions, template configuration, layout mappings, metadata, and defaults. SKILL.md covers technical reference: prerequisites, commands, script architecture, API constraints, and troubleshooting. For conventions and design rules (element positioning, visual quality, color and contrast, contextual styling), follow `pptx.instructions.md`. ## Prerequisites ### PowerShell The `Invoke-PptxPipeline.ps1` script handles virtual environment creation and dependency installation automatically via `uv sync`. Requires `uv`, Python 3.11+, and PowerShell 7+. ### Installing uv If `uv` is not installed: ```bash # macOS / Linux curl -LsSf https://astral.sh/uv/install.sh | sh # Windows powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" # Via pip (fallback) pip install uv ``` ### System Dependencies (Export and Validation) The Export and Validate actions require LibreOffice for PPTX-to-PDF conversion and optionally `pdftoppm` from poppler for PDF-to-JPG rendering. When `pdftoppm` is not available, PyMuPDF handles the image rendering. The Validate action's vision-based checks require the GitHub Copilot CLI for model access. ```bash # macOS brew install --cask libreoffice brew install poppler # optional, provides pdftoppm # Linux sudo apt-get install libreoffice poppler-utils # Windows (winget preferred, choco fallback) winget install TheDocumentFoundation.LibreOffice # choco install libreoffice-still # alternative # poppler: no winget package; use choco install poppler (optional, provides pdftoppm) ``` ### Copilot CLI (Vision Validation) The `validate_slides.py` script uses the GitHub Copilot SDK to send slide images to vision-capable models. The Copilot CLI must be installed and authenticated: ```bash # Install Copilot CLI npm install -g @github/copilot-cli # Authenticate (uses the same GitHub account as VS Code Copilot) copilot auth login # Verify copilot --version ``` ### Required Files * `style.yaml` — Dimensions, defaults, template configuration, and metadata * `content.yaml` — Per-slide content definition (text, shapes, images, layout) * (Optional) `content-extra.py` — Custom Python for complex slide drawings ## Content Directory Structure All slide content lives under the working directory's `content/` folder: ```text content/ ├── global/ │ ├── style.yaml # Dimensions, defaults, template config, and theme metadata │ └── voice-guide.md # Voice and tone guidelines ├── slide-001/ │ ├── content.yaml # Slide 1 content and layout │ └── images/ # Slide-specific images │ ├── background.png │ └── background.yaml # Image metadata sidecar ├── slide-002/ │ ├── content.yaml # Slide 2 content and layout │ ├── content-extra.py # Custom Python for complex drawings │ └── images/ │ └── screenshot.png ├── slide-003/ │ ├── content.yaml │ └── images/ │ ├── diagram.png │ └── diagram.yaml └── ... ``` ## Global Style Definition (`style.yaml`) The global `style.yaml` defines dimensions, template configuration, layout mappings, metadata, and defaults. Color and font choices are specified per-element in each slide's `content.yaml` rather than centralized in the style file. See the [s在 GitHub 阅读完整来源 (打开外部页面)