AgentSkillsCN

Gamma Export

Gamma Export

SKILL.md

Gamma Export Skill

Purpose

Export MARP presentations to Gamma.app for enhanced visual design and sharing. This skill transforms MARP markdown into Gamma-compatible format and pushes it via the Gamma Generate API.


Prerequisites

  1. Gamma Pro account (or higher) with API access
  2. API key generated at https://gamma.app/settings → API key tab
  3. Environment variable GAMMA_API_KEY set in .env file

Workflow

code
MARP Markdown → Transform → Gamma API → Poll for completion → Return Gamma URL

What the transformation does:

  1. Strips MARP front matter (---\nmarp: true\n...---)
  2. Preserves --- slide separators (Gamma uses \n---\n for card breaks)
  3. Converts speaker notes <!-- ... --> into inline instructions for Gamma
  4. Cleans up MARP-specific directives (<!-- _class: lead -->, etc.)
  5. Outputs clean text ready for Gamma's inputText parameter

Commands

/export-gamma

Export current MARP presentation to Gamma.

Usage:

code
/export-gamma [options]

Options:

  • --theme <themeId> – Gamma theme ID (default: workspace default)
  • --style <style> – Image style description (default: "professional, minimal")
  • --format <format> – Output format: presentation, document, webpage (default: presentation)
  • --dimensions <dim> – Slide dimensions: fluid, 16x9, 4x3 (default: 16x9)
  • --images <source> – Image source: ai, unsplash, pictographic, none (default: ai)
  • --export <type> – Also export as: pdf, pptx (optional)
  • --dry-run – Show transformed content without sending to Gamma

Examples:

code
/export-gamma
/export-gamma --style "watercolor, soft, warm tones" --dimensions 16x9
/export-gamma --images none --export pptx
/export-gamma --dry-run

/gamma-themes

List available Gamma themes from your workspace.

/gamma-preview

Show how the current MARP file will be transformed for Gamma (without sending).


Configuration

Environment Setup

Create .env file in repo root:

code
GAMMA_API_KEY=sk-gamma-xxxxxxxx

Default Settings

In gamma.config.json (optional):

json
{
  "defaultTheme": "Oasis",
  "defaultImageStyle": "professional, minimal, clean",
  "defaultImageModel": "imagen-4-pro",
  "defaultDimensions": "16x9",
  "defaultFormat": "presentation",
  "speakerNotesHandling": "include",
  "pollingIntervalMs": 2000,
  "maxPollingAttempts": 60
}

Image Tuning Guide

Image Source Options

SourceUse When
aiGeneratedWant unique, context-aware images
pictographicWant clean, icon-style graphics
unsplashWant professional stock photos
webFreeToUseCommerciallyNeed commercial-safe web images
noImagesAdding your own images later

Image Style Examples

Professional/Corporate:

code
"professional, minimal, blue tones, clean backgrounds"
"corporate, modern, geometric shapes, muted colors"

Creative/Artistic:

code
"watercolor, soft edges, warm palette, artistic"
"flat illustration, vibrant colors, playful"

Technical/Educational:

code
"technical diagram style, clean lines, informative"
"infographic style, data visualization, clear"

Photography-like:

code
"photorealistic, high quality, dramatic lighting"
"natural photography, candid, authentic feel"

For David's presentation style:

code
"professional yet warm, human-centered, approachable, subtle blue-green tones"

Image Model Options

  • imagen-4-pro – Google's latest, good general quality
  • flux-1-pro – Strong at artistic styles
  • (Check Gamma docs for current model list)

Transformation Rules

MARP Front Matter

Before:

yaml
---
marp: true
theme: default
paginate: true
header: 'My Talk'
footer: 'David Cobb | 2026'
---

After: Stripped entirely (Gamma has its own theming)

Slide Separators

Before (MARP):

markdown
# Slide 1

Content here

---

# Slide 2

More content

After (Gamma inputText):

code
# Slide 1

Content here

---

# Slide 2

More content

Preserved as-is. Gamma uses \n---\n for card breaks when cardSplit: "inputTextBreaks".

Speaker Notes

Before:

markdown
# My Point

- Bullet one
- Bullet two

<!-- 
This is the full story I'll tell verbally.
Include the example about cost spikes.
Mention the 14x increase.
-->

After:

markdown
# My Point

- Bullet one
- Bullet two

[Speaker context: This is the full story I'll tell verbally. Include the example about cost spikes. Mention the 14x increase.]

Converted to inline text with [Speaker context: ...] wrapper so Gamma can incorporate the depth.

MARP Directives

Before:

markdown
<!-- _class: lead -->
<!-- _paginate: false -->
<!-- _backgroundColor: #123 -->

# Section Title

After:

markdown
# Section Title

Directives stripped (Gamma handles styling differently).

Fit Directive

Before:

markdown
# <!-- fit --> Big Title

After:

markdown
# Big Title

<!-- fit --> removed; Gamma auto-sizes.


API Reference

Generate Endpoint

code
POST https://public-api.gamma.app/v1.0/generations

Headers:

code
Content-Type: application/json
X-API-KEY: sk-gamma-xxxxxxxx

Request Body (for preserved text with speaker notes):

json
{
  "inputText": "Transformed markdown content...",
  "textMode": "preserve",
  "format": "presentation",
  "cardSplit": "inputTextBreaks",
  "additionalInstructions": "Speaker context sections marked with [Speaker context: ...] contain additional depth and stories. Use this context to enrich the visual design and ensure the slides support rather than duplicate this content. Keep slide text minimal; the speaker context is for understanding, not display.",
  "imageOptions": {
    "source": "aiGenerated",
    "model": "imagen-4-pro",
    "style": "professional, minimal, approachable"
  },
  "cardOptions": {
    "dimensions": "16x9"
  },
  "textOptions": {
    "language": "en"
  }
}

Response:

json
{
  "generationId": "abc123xyz"
}

Poll for Completion

code
GET https://public-api.gamma.app/v1.0/generations/{generationId}

Response (pending):

json
{
  "status": "pending",
  "generationId": "abc123xyz"
}

Response (completed):

json
{
  "status": "completed",
  "generationId": "abc123xyz",
  "gammaUrl": "https://gamma.app/docs/abc123xyz",
  "credits": {"deducted": 150, "remaining": 2850}
}

Error Handling

ErrorCauseFix
401 UnauthorizedInvalid API keyCheck GAMMA_API_KEY in .env
403 ForbiddenNo creditsTop up at gamma.app/settings/billing
422 FailedGeneration failedCheck input parameters
429 Too Many RequestsRate limitedWait and retry

Script Location

The export script is at: scripts/export-to-gamma.js

Run directly:

bash
node scripts/export-to-gamma.js slides/my-presentation.marp.md

Or via npm script (if configured in package.json):

bash
npm run gamma slides/my-presentation.marp.md

Typical Workflow

  1. Create/edit MARP presentation in /slides/
  2. Preview locally with npx @marp-team/marp-cli -p slides/my-talk.marp.md
  3. When ready, run /export-gamma or node scripts/export-to-gamma.js slides/my-talk.marp.md
  4. Get Gamma URL in terminal output
  5. Fine-tune in Gamma's web editor if needed
  6. Present from Gamma or export PDF/PPTX

Limitations

  • Gamma may reformat text slightly even in preserve mode
  • Complex MARP layouts (columns, background images) don't translate 1:1
  • Speaker notes become context hints, not hidden notes in Gamma
  • API has credit costs (check your balance)

Future Enhancements

  • MCP server integration for direct Claude Code commands
  • Template support (Gamma's Create from Template API)
  • Batch export for multiple presentations
  • Theme preview/selection tool
  • Image URL injection from local assets