pptx-generator

Create and manipulate PowerPoint PPTX files programmatically. Use when the user needs to generate presentations, modify PPTX templates, extract slide content, create thumbnail previews, or automate PowerPoint workflows. Supports both template-based generation (for branding compliance) and from-scrat

By jwynia · 533 installs

npx skills add jwynia/agent-skills --skill pptx-generator

Source repository · Upstream listing

PPTX Generator When to Use This Skill Use this skill when: Creating presentations programmatically from data or specifications Populating branded templates with dynamic content while preserving corporate styling Extracting text and structure from existing PPTX files for analysis Combining slides from a library of approved templates Automating presentation generation workflows Do NOT use this skill when: User wants to open/view presentations (use native PowerPoint or viewer) Complex animations or transitions are required (limited support) Working with older .ppt format (PPTX only) Prerequisites Deno installed (https://deno.land/) Input PPTX files for template based operations JSON specification for scratch generation Quick Start Two Modes of Operation 1. Template Mode : Modify existing branded templates Analyze & Replace: Find {{PLACEHOLDERS}} and replace with content Slide Library: Select and combine slides from a template library 2. Scratch Mode : Create presentations from nothing using JSON specifications Instructions Mode 1: Template Based Generation Step 1a: Analyze the Template Extract text inventory to understand what can be replaced: Output (inventory.json): Step 1b: Create Replacement Specification Create replacements.json : Step 1c: Generate Output Mode 1 (Alternative): Slide Library Step 2a: Preview Template Slides Get information about available slides: For visual preview, extract the thumbnail: Step 2b: Select and Combine Slides Create selections.json : Step 2c: Generate Combined Presentation Mode 2: From Scratch Generation Step 3a: Create Specification Create spec.json : Step 3b: Generate Presentation Examples Example 1: Corporate Quarterly Report Scenario : Generate quarterly report from branded template. Steps : Example 2: Custom Pitch Deck from Slide Library Scenario : Combine approved slides for a specific client pitch. Steps : Example 3: Data Driven Presentation Scenario : Generate presentation from JSON data (e.g., API response). Steps : Script Reference Script Purpose Permissions analyze template.ts Extract text inventory from PPTX allow read generate thumbnails.ts Get slide info and extract previews allow read allow write generate from template.ts Modify templates (replace/combine) allow read allow write generate scratch.ts Create PPTX from JSON specification allow read allow write Element Types (Scratch Mode) Type Description Key Options text Text box text , fontSize , bold , color , align image Image from file or base64 path , data , sizing table Data table rows , colW , border , fill shape Geometric shapes type , fill , line , text chart Charts and graphs type , data , title , showLegend Common Issues and Solutions Issue: Text not being replaced Symptoms : Output PPTX still contains {{PLACEHOLDER}} tags. Solution : 1. Run analyze template.ts to verify exact tag text 2. Tags may be split across XML runs ensure your template has tags in single text runs 3. Check slideNumbers filter in replacements Issue: Slide order incorrect Symptoms : Slides appear in wrong order after combining. Solution : Slides are added in the order specified in slideSelections Verify slide numbers match original template (1 indexed) Issue: Images not appearing Symptoms : Image elements are blank in output. Solution : 1. Use absolute paths or paths relative to spec.json location 2. Verify image file exists and is readable 3. Check supported formats: PNG, JPEG, GIF OOXML Placeholder Inheritance (Advanced) Understanding how PowerPoint's OOXML format handles placeholders is crucial for template development. The Inheritance Chain PowerPoint uses a hierarchical inheritance model: Theme : Defines colors, fonts, effects Slide Master : Defines default placeholder positions and formatting (including bullets) Slide Layout : Overrides master settings for specific layout types (e.g., Title Slide, Content) Slide : Contains actual content, inherits formatting from layout Key Principles 1. Text Content Does NOT Inherit : Slides must contain their own text content. The {{placeholder}} text in a layout does NOT automatically appear on slides using that layout. 2. Text Formatting CAN Inherit : When a slide shape has an empty <a:lstStyle/ , it inherits formatting (color, size, bullets) from the layout's <a:lstStyle . 3. Placeholder Linking : Slides link to layouts via <p:ph type="..." idx="..."/ . The type (e.g., "title", "body", "ctrTitle") and idx must match. 4. Bullet Suppression : To prevent bullets on a placeholder that would normally inherit them from the master's bodyStyle, add <a:buNone/ in the layout's lstStyle. Defining Inheritable Formatting In layout placeholders, define colors in <a:lstStyle (inheritable), not in <a:rPr (run specific): Slide Shape Structure For slides to properly inherit from layouts: Common Issues Issue Cause Solution Text shows as black instead of white Color defined in <a:rPr not <a:lstStyle Move color to layout's <a:defRPr in <a:lstStyle Unwanted bullets appearing Master's bodyStyle has bullets, layout doesn't override Add <a:buNone/ to layout's <a:lvl1pPr Placeholder text not appearing Text only in layout, not in slide Include text content in slide's <p:txBody Formatting not applying Slide has explicit formatting Use empty <a:lstStyle/ and <a:rPr lang="en US"/ Reference: Placeholder Types Type Usage ctrTitle Centered title (title slides) title Standard title subTitle Subtitle body Content area (use idx for multiple) pic Picture placeholder dt Date/time ftr Footer sldNum Slide number Limitations No slide rendering : Cannot render slides to images directly (use LibreOffice for this) Limited animation support : Basic animations only in scratch mode No master slide editing : Template mode preserves but doesn't modify masters PPTX only : Does not support legacy .ppt format Text run splitting : Complex formatting in templates may split tags across XML elements Related Skills pdf generator : For creating PDF documents instead of presentations docx generator : For creating Word documents xlsx generator : For creating Excel spreadsheets