home / skills / jeremylongshore / claude-code-plugins-plus-skills / gamma-core-workflow-b

This skill edits and exports presentations by updating slides, managing assets, and exporting to formats like pdf and pptx.

npx playbooks add skill jeremylongshore/claude-code-plugins-plus-skills --skill gamma-core-workflow-b

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
4.0 KB
---
name: gamma-core-workflow-b
description: |
  Implement core Gamma workflow for presentation editing and export.
  Use when modifying existing presentations, exporting to various formats,
  or managing presentation assets.
  Trigger with phrases like "gamma edit presentation", "gamma export",
  "gamma PDF", "gamma update slides", "gamma modify".
allowed-tools: Read, Write, Edit
version: 1.0.0
license: MIT
author: Jeremy Longshore <[email protected]>
---

# Gamma Core Workflow B: Editing and Export

## Overview
Implement workflows for editing existing presentations and exporting to various formats.

## Prerequisites
- Completed `gamma-core-workflow-a` setup
- Existing presentation to work with
- Understanding of export formats

## Instructions

### Step 1: Retrieve and Edit Presentation
```typescript
import { GammaClient } from '@gamma/sdk';

const gamma = new GammaClient({ apiKey: process.env.GAMMA_API_KEY });

async function editPresentation(presentationId: string) {
  // Retrieve existing presentation
  const presentation = await gamma.presentations.get(presentationId);

  // Update title and style
  const updated = await gamma.presentations.update(presentationId, {
    title: 'Updated: ' + presentation.title,
    style: 'modern',
  });

  return updated;
}
```

### Step 2: Slide-Level Editing
```typescript
async function editSlide(presentationId: string, slideIndex: number, content: object) {
  const presentation = await gamma.presentations.get(presentationId);

  // Update specific slide
  const updatedSlide = await gamma.slides.update(
    presentationId,
    slideIndex,
    {
      title: content.title,
      content: content.body,
      layout: content.layout || 'content',
    }
  );

  return updatedSlide;
}

async function addSlide(presentationId: string, position: number, content: object) {
  return gamma.slides.insert(presentationId, position, {
    title: content.title,
    content: content.body,
    generateImage: content.imagePrompt,
  });
}

async function deleteSlide(presentationId: string, slideIndex: number) {
  return gamma.slides.delete(presentationId, slideIndex);
}
```

### Step 3: Export to Various Formats
```typescript
type ExportFormat = 'pdf' | 'pptx' | 'png' | 'html';

async function exportPresentation(
  presentationId: string,
  format: ExportFormat,
  options: object = {}
) {
  const exportJob = await gamma.exports.create(presentationId, {
    format,
    quality: options.quality || 'high',
    includeNotes: options.includeNotes ?? true,
    ...options,
  });

  // Wait for export to complete
  const result = await gamma.exports.wait(exportJob.id, {
    timeout: 60000,
    pollInterval: 2000,
  });

  return result.downloadUrl;
}

// Usage examples
const pdfUrl = await exportPresentation('pres-123', 'pdf');
const pptxUrl = await exportPresentation('pres-123', 'pptx', { includeNotes: false });
const pngUrl = await exportPresentation('pres-123', 'png', { slideIndex: 0 }); // First slide only
```

### Step 4: Asset Management
```typescript
async function uploadAsset(presentationId: string, filePath: string) {
  const fileBuffer = await fs.readFile(filePath);

  const asset = await gamma.assets.upload(presentationId, {
    file: fileBuffer,
    filename: path.basename(filePath),
    type: 'image',
  });

  return asset.url;
}

async function listAssets(presentationId: string) {
  return gamma.assets.list(presentationId);
}
```

## Output
- Updated presentation with modifications
- Exported files in various formats
- Managed presentation assets
- Download URLs for exports

## Error Handling
| Error | Cause | Solution |
|-------|-------|----------|
| Export Timeout | Large presentation | Increase timeout or reduce slides |
| Format Not Supported | Invalid export format | Check supported formats |
| Asset Too Large | File exceeds limit | Compress or resize image |
| Slide Not Found | Invalid index | Verify slide exists |

## Resources
- [Gamma Export API](https://gamma.app/docs/export)
- [Gamma Asset Management](https://gamma.app/docs/assets)

## Next Steps
Proceed to `gamma-common-errors` for error handling patterns.

Overview

This skill implements the core Gamma workflow for editing existing presentations and exporting them to common formats. It helps update presentation-level metadata, modify individual slides, manage assets, and produce downloadable exports like PDF, PPTX, PNG, and HTML. Use it to automate presentation edits and generate distribution-ready files.

How this skill works

The skill retrieves a presentation, applies updates at the presentation and slide level, and can insert, update, or delete slides. It uploads and lists assets tied to a presentation and kicks off export jobs for multiple formats, polling until the export completes and returning download URLs. Built-in options include export quality, inclusion of speaker notes, and targeting single slides for image exports.

When to use it

  • You need to update titles, theme, or global styles across an existing presentation.
  • You want to programmatically edit, add, or remove individual slides at scale.
  • You need reliable exports to PDF, PPTX, PNG, or HTML for distribution.
  • You must upload or manage images and other assets used in slides.
  • You want to automate conversion and delivery of presentation files to users or storage.

Best practices

  • Validate slide indices before update or delete operations to avoid not-found errors.
  • Use reasonable polling timeouts for exports; increase timeout for very large decks.
  • Compress or resize images before upload to avoid asset-size limits and faster uploads.
  • Include clear content and layout payloads when updating slides to preserve formatting.
  • Test export options (includeNotes, quality) on a sample presentation before batch runs.

Example use cases

  • Automate weekly report slides: update data slides, add a summary slide, export PDF for distribution.
  • Bulk update branding: change presentation titles and switch to a modern theme across many decks.
  • Generate a single-slide PNG preview for a web gallery by exporting slideIndex 0 as PNG.
  • Prepare a downloadable PPTX without speaker notes for client handoff.
  • Upload new product images to a presentation and replace outdated visuals programmatically.

FAQ

What export formats are supported?

Common formats include pdf, pptx, png, and html. Check the API for additional or updated formats.

How do I handle export timeouts?

Increase the polling timeout for large presentations or reduce slide count before exporting.

What if an asset upload fails due to size?

Compress or resize the file, then retry the upload. Monitor returned error details for limits.