sickn33/agentic-awesome-skills / plugins/agentic-awesome-skills-claude/skills/2slides-ppt-generator
2slides-ppt-generator
VerifiedAI-powered presentation generation via the 2slides API — create slides from text, match a reference image style, summarize documents into decks, add AI voice narration, and export pages/audio. Use for any "make slides", "create a deck", or "slides from this document" request.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.0 KB |
| references/api-reference.md | markdown | 13.0 KB |
| references/detailed-guide.md | markdown | 20.9 KB |
| references/mcp-integration.md | markdown | 8.7 KB |
| references/pricing.md | markdown | 6.5 KB |
| requirements.txt | manifest | 43 B |
| scripts/api_constants.py | script | 1.5 KB |
| scripts/create_pdf_slides.py | script | 5.7 KB |
| scripts/download_slides_pages_voices.py | script | 8.0 KB |
| scripts/generate_narration.py | script | 5.9 KB |
| scripts/generate_slides.py | script | 8.9 KB |
| scripts/get_job_status.py | script | 3.2 KB |
| scripts/search_themes.py | script | 3.4 KB |
scripts/create_pdf_slides.py
View on GitHub#!/usr/bin/env python3
"""
Generate custom-designed slides from text using the 2slides API.
Similar to create-like-this but without needing a reference image.
"""
import os
import sys
import json
import argparse
from typing import Optional, Dict, Any
API_BASE_URL = "https://2slides.com/api/v1"
def get_api_key() -> str:
"""Get API key from environment variable."""
api_key = os.environ.get("SLIDES_2SLIDES_API_KEY")
if not api_key:
raise ValueError(
"API key not found. Set SLIDES_2SLIDES_API_KEY environment variable.\n"
"Get your API key from: https://2slides.com/api"
)
return api_key
def create_pdf_slides(
user_input: str,
response_language: str = "Auto",
aspect_ratio: str = "16:9",
resolution: str = "2K",
page: int = 1,
content_detail: str = "concise",
design_spec: Optional[str] = None,
api_key: Optional[str] = None
) -> Dict[str, Any]:
"""
Generate custom-designed slides from text with optional design specifications.
Args:
user_input: Content to convert into slides
response_language: Language (default: "Auto")
Options: Auto, English, Simplified Chinese, Traditional Chinese, Spanish,
Arabic, Portuguese, Indonesian, Japanese, Russian, Hindi, French, German,
Vietnamese, Turkish, Polish, Italian, Korean
aspect_ratio: Aspect ratio in width:height format (default: "16:9")
resolution: Output quality - "1K", "2K", or "4K" (default: "2K")
page: Number of slides, 0 for auto-detection, max 100 (default: 1)
content_detail: "concise" (brief) or "standard" (detailed) (default: "concise")
design_spec: Optional design specifications (e.g., "modern minimalist", "corporate blue")
api_key: API key (uses env var if not provided)
Returns:
Dict with generation result
"""
import requests
if api_key is None:
api_key = get_api_key()
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
payload = {
"userInput": user_input,
"responseLanguage": response_language,
"aspectRatio": aspect_ratio,
"resolution": resolution,
"page": page,
"contentDetail": content_detail
}
if design_spec:
payload["designStyle"] = design_spec
url = f"{API_BASE_URL}/slides/create-pdf-slides"
if isinstance(page, bool) or not isinstance(page, int) or not 0 <= page <= 100:
raise ValueError("page must be an integer from 0 to 100")
# Calculate dynamic timeout: ~30s per page, minimum 120s
timeout = max(120, page * 40)
print("Generating custom-designed slides...", file=sys.stderr)
print(f"(Timeout set to {timeout}s for {page} page(s))", file=sys.stderr)
response = requests.post(url, headers=headers, json=payload, timeout=timeout, allow_redirects=False)
response.raise_for_status()
result = response.json()
# Handle the actual API response structure
if result.get("success") and "data" in result:
data = result["data"]
# Transform to expected format for consistency
normalized_result = {
"slideUrl": data.get("jobUrl"),
"pdfUrl": data.get("downloadUrl"),
"status": "completed" if data.get("status") == "success" else data.get("status"),
"message": data.get("message"),
"slidePageCount": data.get("slidePageCount"),
"jobId": data.get("jobId")
}
print(f"Request accepted; generation status: {data.get('status', 'unknown')}", file=sys.stderr)
print(f" Pages: {data.get('slidePageCount')}", file=sys.stderr)
return normalized_result
else:
raise ValueError("Generation failed or returned an unexpected response envelope")
def main():
parser = argparse.ArgumentParser(
description="Generate custom-designed slides using 2slides API",
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog="""
Examples:
# Generate slides with auto design
%(prog)s --content "Sales Report Q4 2025"
# Generate with specific design
%(prog)s --content "Marketing Plan" --design-spec "modern minimalist, blue color scheme"
# Generate in 4K resolution
%(prog)s --content "Product Launch" --resolution 4K --page 5
"""
)
parser.add_argument("--content", required=True, help="Content for slides")
parser.add_argument("--design-spec", "--design-style", dest="design_spec", help="Optional design specifications")
parser.add_argument("--language", default="Auto", help="Response language (default: Auto)")
parser.add_argument("--aspect-ratio", default="16:9", help="Aspect ratio in width:height format (default: 16:9)")
parser.add_argument("--resolution", choices=["1K", "2K", "4K"], default="2K",
help="Output quality (default: 2K)")
parser.add_argument("--page", type=int, default=1, help="Number of slides, 0 for auto (default: 1, max: 100)")
parser.add_argument("--content-detail", choices=["concise", "standard"], default="concise",
help="Content detail level (default: concise)")
args = parser.parse_args()
try:
result = create_pdf_slides(
user_input=args.content,
response_language=args.language,
aspect_ratio=args.aspect_ratio,
resolution=args.resolution,
page=args.page,
content_detail=args.content_detail,
design_spec=args.design_spec
)
print(json.dumps(result, indent=2))
except Exception as e:
print(f"Error: {e}", file=sys.stderr)
sys.exit(1)
if __name__ == "__main__":
main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |