gamma-core-workflow-b
Generate from templates, retrieve exports, and manage sharing via Gamma API. Use when creating content from template gammas, downloading PDF/PPTX/PNG exports, or configuring sharing and folder organization. Trigger: "gamma template", "gamma export", "gamma download PDF", "gamma PPTX", "gamma sharing", "gamma from template".
What this skill does
# Gamma Core Workflow B: Templates & Export
## Overview
Use Gamma's template-based generation (`POST /v1.0/generations/from-template`) and export retrieval (`GET /v1.0/generations/{id}/files`) endpoints. Template generation lets you replicate a single-page gamma template across multiple variations. Export retrieval gives you downloadable PDF, PPTX, and PNG files.
## Prerequisites
- Completed `gamma-core-workflow-a`
- A template gamma with exactly one page (created in the Gamma app)
- Understanding of the generate-poll-retrieve pattern
## Key Concepts
- **Template gamma**: A regular gamma with exactly one page, used as a repeatable template
- **gammaId**: Found in the gamma URL or copied from the app
- **Export URLs**: Temporary download links returned after generation — download promptly as they expire
## Instructions
### Step 1: Create from Template
```typescript
import { createGammaClient, pollUntilDone } from "./lib/gamma";
const gamma = createGammaClient({ apiKey: process.env.GAMMA_API_KEY! });
// POST /v1.0/generations/from-template
// The template gamma MUST have exactly one page
async function generateFromTemplate(
templateGammaId: string,
prompt: string,
options: {
themeId?: string;
exportAs?: "pdf" | "pptx" | "png";
imageStyle?: string;
} = {}
) {
const { generationId } = await gamma.generateFromTemplate({
gammaId: templateGammaId,
prompt,
themeId: options.themeId,
exportAs: options.exportAs,
imageOptions: options.imageStyle
? { style: options.imageStyle }
: undefined,
});
return pollUntilDone(gamma, generationId);
}
// Usage: generate a sales proposal from a template
const result = await generateFromTemplate(
"gamma_template_abc123", // Your one-page template ID
"Create a sales proposal for Acme Corp. Highlight our cloud migration services, 99.9% uptime SLA, and 24/7 support.",
{ exportAs: "pdf", imageStyle: "corporate professional" }
);
console.log(`View: ${result.gammaUrl}`);
console.log(`Download: ${result.exportUrl}`);
```
### Step 2: Batch Template Generation
```typescript
// Generate multiple variations from the same template
const clients = [
{ name: "Acme Corp", focus: "cloud migration" },
{ name: "TechStart Inc", focus: "AI implementation" },
{ name: "GlobalBank", focus: "security compliance" },
];
import pLimit from "p-limit";
const limit = pLimit(2); // Respect rate limits
const proposals = await Promise.allSettled(
clients.map((client) =>
limit(() =>
generateFromTemplate(
"gamma_template_abc123",
`Proposal for ${client.name} focusing on ${client.focus}. Include pricing tier for enterprise. Reference their industry.`,
{ exportAs: "pptx" }
)
)
)
);
proposals.forEach((r, i) => {
const status = r.status === "fulfilled" ? r.value.gammaUrl : `FAILED: ${r.reason}`;
console.log(`${clients[i].name}: ${status}`);
});
```
### Step 3: Export Format Selection
```typescript
// Export is specified at generation time via `exportAs`
// You cannot export an already-generated gamma via the API
// Instead, generate with the desired export format
// PDF export — best for sharing externally
const pdfResult = await gamma.generate({
content: "Annual report for 2025",
outputFormat: "document",
exportAs: "pdf",
});
// PPTX export — for editing in PowerPoint/Google Slides
// Note: PPTX exports may have layout shifts and font differences
const pptxResult = await gamma.generate({
content: "Team kickoff presentation",
outputFormat: "presentation",
exportAs: "pptx",
});
// PNG export — for thumbnails or social sharing
const pngResult = await gamma.generate({
content: "Product announcement graphic",
outputFormat: "social_post",
exportAs: "png",
});
```
### Step 4: Retrieve Export Files
```typescript
// After generation completes, exportUrl is in the poll response
// Download files promptly — URLs expire after a period
import { writeFile } from "node:fs/promises";
async function downloadExport(generationId: string, outputPath: string) {
// Poll until complete
const result = await pollUntilDone(gamma, generationId);
if (!result.exportUrl) {
throw new Error("No export URL — did you specify exportAs?");
}
// Download the file
const response = await fetch(result.exportUrl);
if (!response.ok) throw new Error(`Download failed: ${response.status}`);
const buffer = Buffer.from(await response.arrayBuffer());
await writeFile(outputPath, buffer);
console.log(`Saved to ${outputPath} (${buffer.length} bytes)`);
}
// Usage
const { generationId } = await gamma.generate({
content: "Sales deck for Q1 review",
outputFormat: "presentation",
exportAs: "pdf",
});
await downloadExport(generationId, "./output/q1-review.pdf");
```
### Step 5: Sharing Configuration
```typescript
// Configure who can access the generated gamma
const { generationId } = await gamma.generate({
content: "Internal strategy document",
outputFormat: "document",
sharingOptions: {
// Workspace members
workspaceAccess: "comment", // noAccess | view | comment | edit | fullAccess
// External (non-workspace) visitors
externalAccess: "noAccess", // Lock down for internal docs
// Share with specific people via email
emailOptions: {
emails: ["[email protected]"],
accessLevel: "view",
},
},
});
```
### Step 6: curl Reference
```bash
# Generate from template
curl -X POST "https://public-api.gamma.app/v1.0/generations/from-template" \
-H "X-API-KEY: ${GAMMA_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"gammaId": "your_template_gamma_id",
"prompt": "Create a proposal for Acme Corp focusing on cloud services",
"exportAs": "pdf",
"themeId": "theme_abc123",
"imageOptions": { "style": "photorealistic" },
"sharingOptions": {
"workspaceAccess": "edit",
"externalAccess": "view"
}
}'
# Poll for result
curl "https://public-api.gamma.app/v1.0/generations/${GEN_ID}" \
-H "X-API-KEY: ${GAMMA_API_KEY}" | jq '{status, gammaUrl, exportUrl, creditsUsed}'
```
## Export Format Comparison
| Format | Best For | Fidelity | Editable? |
|--------|----------|----------|-----------|
| PDF | Sharing, printing | High | No |
| PPTX | Editing in PowerPoint/Slides | Medium (layout shifts possible) | Yes |
| PNG | Thumbnails, social media | High (single image) | No |
## Error Handling
| Error | Cause | Solution |
|-------|-------|----------|
| "Template must have exactly one page" | Multi-page template | Edit template to single page |
| Empty `exportUrl` | `exportAs` not specified | Add `exportAs` to generation request |
| Download URL expired | Too slow to download | Download immediately after completion |
| 422 on template generation | Invalid `gammaId` | Verify template ID from Gamma app URL |
## Resources
- [Create from Template](https://developers.gamma.app/reference/create-from-template)
- [Template Parameters Explained](https://developers.gamma.app/guides/create-from-template-api-parameters-explained)
- [Receive Generated File URLs](https://developers.gamma.app/reference/get-gamma-file-urls)
## Next Steps
Proceed to `gamma-common-errors` for troubleshooting API issues.
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.