All skills
jwynia avatar

/pptx-generator

@99a8797
by J Wyniajwynia/agent-skills160 stars
20

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-scratch creation. Keywords: PowerPoint, PPTX, presentation, slides, template, deck, slideshow, corporate, branding.

Use this Skill: https://skilld.dev/gh/jwynia/agent-skills/pptx-generator

This session only. Nothing lands on disk.

referencestemplate-workflow.md

≈1.2k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Template-Based PPTX Generation Workflow

This document provides detailed guidance for working with existing PPTX templates.

Overview

Template mode enables you to:

  1. Preserve corporate branding and design standards
  2. Replace placeholder content while maintaining formatting
  3. Combine pre-approved slides into new presentations

Preparing Templates

Best Practices for Template Design

  1. Use Clear Placeholder Tags: Use consistent format like {{PLACEHOLDER_NAME}}

    • Keep tags in single text runs (don't format parts of the tag differently)
    • Use uppercase for clarity: {{TITLE}}, {{AUTHOR}}, {{DATE}}
  2. Name Your Shapes: In PowerPoint, select a shape and use Selection Pane to give it a meaningful name

    • This helps with debugging and targeted replacements
  3. Use Placeholder Types: When possible, use PowerPoint's built-in placeholder types (Title, Subtitle, Content)

    • These are easier to identify programmatically

Analyze & Replace Workflow

Step 1: Analyze the Template

deno run --allow-read scripts/analyze-template.ts template.pptx --pretty > inventory.json

The inventory JSON contains:

  • filename: Original template name
  • slideCount: Total number of slides
  • slideWidth/slideHeight: Dimensions in inches
  • textElements: Array of all text shapes with:
    • slideNumber: Which slide (1-indexed)
    • shapeId: Unique identifier
    • shapeName: PowerPoint shape name
    • placeholderType: "title", "ctrTitle", "subTitle", "body", or null
    • position: { x, y, width, height } in inches
    • paragraphs: Array of paragraph objects with text and formatting

Step 2: Create Replacement Specification

{
  "textReplacements": [
    {
      "tag": "{{TITLE}}",
      "value": "Replacement Text"
    },
    {
      "tag": "{{DATE}}",
      "value": "January 2025",
      "slideNumbers": [1, 2]
    }
  ]
}

Fields:

  • tag: The text to find and replace (include {{}} if used in template)
  • value: The replacement text
  • slideNumbers (optional): Limit replacement to specific slides

Step 3: Generate Output

deno run --allow-read --allow-write scripts/generate-from-template.ts \
  template.pptx replacements.json output.pptx

Slide Library Workflow

Step 1: Preview Available Slides

# Get slide information
deno run --allow-read scripts/generate-thumbnails.ts library.pptx

# Extract presentation thumbnail
deno run --allow-read --allow-write scripts/generate-thumbnails.ts \
  library.pptx --extract-thumb --output-dir ./previews

Step 2: Select Slides

Create a selection specification:

{
  "slideSelections": [
    { "slideNumber": 1 },
    { "slideNumber": 5 },
    { "slideNumber": 3 },
    { "slideNumber": 12 }
  ]
}

Notes:

  • Slides are added to output in the order specified
  • Same slide can be included multiple times
  • Original slide numbers are preserved for reference

Step 3: Combine with Text Replacements

{
  "slideSelections": [
    { "slideNumber": 1 },
    { "slideNumber": 5 }
  ],
  "textReplacements": [
    { "tag": "{{CLIENT}}", "value": "Acme Corp" }
  ]
}

Including/Excluding Slides

Instead of selecting specific slides, you can filter:

Include Only Specific Slides

{
  "includeSlides": [1, 2, 5, 10]
}

Exclude Specific Slides

{
  "excludeSlides": [3, 4, 7]
}

Troubleshooting

Tags Not Being Replaced

Cause: Text is split across multiple XML runs

PowerPoint may internally split text like:

<a:r><a:t>{{TI</a:t></a:r>
<a:r><a:t>TLE}}</a:t></a:r>

Solutions:

  1. Re-create the placeholder in PowerPoint by typing it fresh
  2. Select all text in the shape and apply uniform formatting
  3. Use simpler tag names without special characters

Formatting Lost After Replacement

Cause: The replacement process preserves paragraph-level formatting but may not preserve character-level formatting within runs.

Solution: Apply formatting at the paragraph level in your template, not to individual characters within the placeholder.

Wrong Slides Selected

Cause: Slide numbering mismatch

Solution:

  1. Run generate-thumbnails.ts to verify slide numbers
  2. Remember slides are 1-indexed
  3. Hidden slides are still counted

Advanced: Multiple Source Templates

For combining slides from different templates:

{
  "slideSelections": [
    { "slideNumber": 1 },
    { "sourceTemplate": "./other-template.pptx", "slideNumber": 3 }
  ]
}

Note: This feature requires slides to have compatible layouts and masters. Cross-template slide combination works best with templates from the same design family.

Source: SKILL.md on GitHub

2 warnings14d5 checks · Risk SAFE
  • Gen Agent Trust Hub14d

    The skill allows generating and modifying PowerPoint files using Deno scripts. It processes external documents, creating a potential surface for indirect prompt injection, but no malicious behavior was found.

  • Socket14d

    No alerts

  • Snyk14d

    Risk: MEDIUM · 1 issue

  • Runlayer7mo

    8/8 files flagged

  • ZeroLeaks5mo

    1 finding · Score: 86/100

Signed by skilld at 99a8797. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Dormantupdated 8 months ago
compatibility
Requires Deno with --allow-read, --allow-write permissions
Other metadata
metadata
{
  "author": "agent-skills",
  "version": "1.0",
  "type": "generator",
  "mode": "generative",
  "domain": "documents"
}

README badge

README badge for jwynia/agent-skills/pptx-generator