
Pptx Generator
- 1 installs
- 128 repo stars
- Updated May 18, 2026
- coleam00/ai-transformation-workshop
This is a copy of pptx-generator by coleam00 - installs and ranking accrue to the original listing.
Helps with ai & agent building tasks.
About
pptx-generator is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted development.
- pptx-generator
- AI & Agent Building
- AI-coding skill
Pptx Generator by the numbers
- 1 all-time installs (skills.sh)
- Data as of Jul 30, 2026 (Skillselion catalog sync)
npx skills add https://github.com/coleam00/ai-transformation-workshop --skill pptx-generatorAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1 |
|---|---|
| repo stars | ★ 128 |
| Last updated | May 18, 2026 |
| Repository | coleam00/ai-transformation-workshop ↗ |
What it does
Helps with ai & agent building tasks.
Files
PPTX Slide Generator
Generate professional, on-brand presentation slides using python-pptx. This skill supports:
- Slide Generation - Create presentations for any brand in
brands/ - Carousel Generation - Create LinkedIn carousels (square format, exports to PDF)
- Slide Editing - Modify existing PPTX files
- Layout Management - Create, edit, update cookbook layouts
IMPORTANT: All skill resources are in .claude/skills/pptx-generator/. Always use Glob patterns starting with .claude/skills/pptx-generator/ to find files.
---
⚠️ CRITICAL: Batch Generation Rules
NEVER generate more than 5 slides at once.
| Rule | Details |
|---|---|
| Max slides per batch | 5 (can be 1, 2, 3, 4, or 5) |
| After each batch | STOP and validate output |
| Validation required | Check: no duplicate titles, proper spacing, correct colors |
| Continue when | Validation passes |
| After ALL batches | COMBINE into single file and DELETE part files |
This prevents token limit errors and catches quality issues early.
CRITICAL: Always clean up part files after combining. The user should only see ONE final PPTX file, not multiple part files.
---
⚠️ PREREQUISITE: Brand Check
Before generating slides, check if any brands exist.
Glob: .claude/skills/pptx-generator/brands/*/brand.jsonIf NO brands found (only `template/` exists):
1. STOP - Do not proceed with slide generation 2. Ask the user:
"No brands are configured yet. Would you like me to help you create a brand first?
I'll need your brand colors, fonts, and style guidelines to set this up."
3. If user wants to create a brand, follow the Creating a New Brand section below.
4. If user declines, explain that slides require a brand configuration and offer to use generic styling as a fallback.
---
Creating a New Brand
When no brands exist or user requests a new brand:
Step 1: Read the Template
Read: .claude/skills/pptx-generator/brands/template/README.md
Read: .claude/skills/pptx-generator/brands/template/brand.json
Read: .claude/skills/pptx-generator/brands/template/config.jsonStep 2: Gather Brand Information
Ask the user for (or extract from provided materials):
| Required | Description |
|---|---|
| Brand name | Folder name (lowercase, no spaces) |
| Colors | Background, text, accent colors (hex codes) |
| Fonts | Heading font, body font, code font |
| Optional | Description |
|---|---|
| Output directory | Where to save generated files (default: output/{brand}) |
| Logo | Path to logo file (PNG/SVG) |
| Brand guidelines | Existing style guide or website to reference |
| Tone of voice | Writing style, vocabulary preferences |
Step 3: Create Brand Files
1. Create the brand folder:
mkdir -p .claude/skills/pptx-generator/brands/{brand-name}2. Create brand.json with the gathered values:
{
"name": "Brand Name",
"description": "One-line description",
"colors": {
"background": "hex-without-hash",
"background_alt": "hex-without-hash",
"text": "hex-without-hash",
"text_secondary": "hex-without-hash",
"accent": "hex-without-hash",
"accent_secondary": "hex-without-hash",
"accent_tertiary": "hex-without-hash",
"code_bg": "hex-without-hash",
"card_bg": "hex-without-hash",
"card_bg_alt": "hex-without-hash"
},
"fonts": {
"heading": "Font Name",
"body": "Font Name",
"code": "Monospace Font"
},
"assets": {
"logo": "assets/logo.png",
"logo_dark": null,
"icon": null
}
}3. Create config.json with output settings:
{
"output": {
"directory": "output/{brand}",
"naming": "{name}-{date}",
"keep_parts": false
},
"generation": {
"slides_per_batch": 5,
"auto_combine": true,
"open_after_generate": false
},
"defaults": {
"slide_width_inches": 13.333,
"slide_height_inches": 7.5
}
}4. Create brand-system.md - Copy from template and fill in brand guidelines
5. Create tone-of-voice.md - Copy from template and fill in voice guidelines
6. Add assets - Copy logo/images to brands/{brand-name}/assets/
Step 4: Verify
After creating the brand, verify with:
Glob: .claude/skills/pptx-generator/brands/{brand-name}/*Then proceed to slide generation.
---
Skill Modes
This skill operates in three modes:
Mode 1: Generate Presentation Slides
User wants presentation slides (16:9) created using a brand's styling. → Follow: Brand Discovery → Layout Selection → Content Adaptation → Execute → Layouts in: cookbook/*.py
Mode 2: Generate LinkedIn Carousels
User wants a LinkedIn carousel (square 1:1 format) for social media. → Follow: Brand Discovery → Carousel Planning → Generate → Export PDF → Layouts in: cookbook/carousels/*.py
Mode 3: Manage Cookbook Layouts
User wants to create, edit, or improve layout templates. → Follow: Layout CRUD Operations section
---
Mode 1: Generate Presentation Slides
Step 1: Brand Discovery
1. List available brands:
Glob: .claude/skills/pptx-generator/brands/*/brand.jsonExtract unique brand names from paths (e.g., brands/rasmus/... → "rasmus")
2. Read the brand configuration files:
Read: .claude/skills/pptx-generator/brands/{brand-name}/brand.json
Read: .claude/skills/pptx-generator/brands/{brand-name}/config.jsonbrand.json- Colors, fonts, assetsconfig.json- Output directory, generation settings
3. Read supporting markdown files for context:
Glob: .claude/skills/pptx-generator/brands/{brand-name}/*.mdThese provide voice, tone, and design philosophy.
4. Extract from brand files:
- From brand.json: Colors (hex without #), fonts, asset paths
- From config.json: Output directory, slides per batch, naming convention
- From markdown: Voice, tone, vocabulary, visual principles
If brand not found, list available brands and ask user to choose.
Step 2: Layout Discovery (READ ALL FRONTMATTERS)
⚠️ MANDATORY: Read ALL layout frontmatters before selecting any layout.
This step is critical for making informed layout decisions. You must understand what ALL layouts offer before choosing.
Step 2a: Discover all layouts:
Glob: .claude/skills/pptx-generator/cookbook/*.pyStep 2b: Read EVERY layout file (not just one or two):
For each .py file found, read the first 40 lines to extract the # /// layout frontmatter block. Build a mental map of:
- What each layout is for (
purpose,best_for) - What each layout should NOT be used for (
avoid_when) - Limits and constraints (
max_*,min_*,*_max_chars)
The frontmatter block looks like this:
# /// layout
# name = "floating-cards-slide"
# purpose = "Feature highlights, process steps, multiple equal items with depth"
# best_for = [
# "Exactly 3 related features or concepts",
# "Process with 3 steps",
# ]
# avoid_when = [
# "More than 3 items - use multi-card-slide instead",
# "Long card titles (over 15 characters)",
# ]
# max_cards = 3
# card_title_max_chars = 15
# instructions = [
# "EXACTLY 3 cards required - no more, no less",
# "Card titles must be SHORT: 1-2 words, max 15 characters",
# ]
# ///Key frontmatter fields:
| Field | Description |
|---|---|
name | Layout identifier |
purpose | What this layout is for |
best_for | Ideal use cases (array) |
avoid_when | When NOT to use this layout (array) |
max_* / min_* | Item limits (cards, bullets, stats) |
instructions | Specific tips for using this layout |
Step 2c: Select layouts (only AFTER reading all frontmatters):
Now that you know all available layouts and their constraints:
1. User specifies layout → Use that layout (but verify it fits the content) 2. User describes content → Match to best-fitting best_for criteria 3. Check `avoid_when` → Don't use a layout in situations it warns against 4. Respect limits → If content exceeds max_*, use a different layout 5. Multiple slides needed → Select appropriate layout for each 6. No good fit → Create a custom layout (see Mode 2)
Example selection process:
- User wants "5 pillars of AI infrastructure"
- You've read all frontmatters and know:
floating-cards-slide:max_cards = 3→ Won't workmulti-card-slide:max_cards = 5→ Perfect fit- Select
multi-card-slide
Why read ALL frontmatters?
- Layouts reference each other in
avoid_when(e.g., "use multi-card-slide instead") - You can't make the right choice without knowing all options
- Prevents backtracking when a layout doesn't fit
Step 2d: Visual-First Layout Selection (CRITICAL FOR VARIETY)
🎨 DEFAULT TO VISUAL LAYOUTS. Content-slide is the LAST RESORT, not the default.
The Variety Problem
The biggest mistake in presentation generation is defaulting to content-slide (title + bullets) whenever you have information to convey. This creates repetitive, boring presentations.
Common failure pattern:
- 11 out of 30 slides = content-slide (37% repetition)
- User says "this lacks variety"
- You think "but I used 11 different layout types!"
- Reality: Layout variety exists, but distribution is terrible
Variety Enforcement Rules
HARD LIMITS: 1. Never use the same layout more than 2-3 times consecutively 2. Content-slide should be <25% of total slides (not 35-40%) 3. Visual layouts (cards, stats, columns, hero, diagonal) should be 50%+ of slides 4. Section breaks are NOT variety - they're structural (don't count toward variety)
Decision Tree: "Should I Use content-slide?"
Ask these questions IN ORDER before defaulting to content-slide:
Do I have 3-5 equal items?
YES → Use multi-card-slide (not content-slide)
Do I have 2-4 big numbers/metrics?
YES → Use stats-slide (not content-slide)
Am I comparing two things?
YES → Use two-column-slide (not content-slide)
Do I have a central concept with surrounding items?
YES → Use circular-hero-slide (not content-slide)
Do I have exactly 3 related items?
YES → Use floating-cards-slide (not content-slide)
Do I have 1-3 words I want to emphasize dramatically?
YES → Use giant-focus-slide or bold-diagonal-slide (not content-slide)
Do I have a powerful quote or principle?
YES → Use quote-slide (not content-slide)
Is this the ONLY way to present this information?
YES → NOW you can use content-slide
NO → Go back through the decision treeTransforming Bullets Into Visual Layouts
Example 1: "Validation Patterns"
❌ BAD (content-slide):
Title: Validation Patterns
Bullets:
- Run comprehensive test suites
- Type checking and linting
- Code review by humans and AI
- Deployment previews✅ GOOD (multi-card-slide):
Title: Validation Patterns
Cards:
1. Testing | Run comprehensive test suites after every change
2. Linting | Type checking and formatting as guardrails
3. Review | Human and AI code review process
4. Preview | Deployment previews for visual regressionExample 2: "Why PIV Works"
❌ BAD (content-slide):
Title: Why PIV Works
Bullets:
- Forces planning before implementation
- Validation catches issues immediately
- Iterative improvements compound
- System gets smarter with every bug✅ GOOD (floating-cards-slide with 3 cards):
Title: Why PIV Works
Cards:
1. Plan First | Forces architectural thinking before coding
2. Fast Feedback | Validation catches issues immediately
3. Compounds | System improves with every bug(Note: Reduced from 4 to 3 items to fit floating-cards-slide max_cards limit)
Example 3: "Human-in-the-Loop Strategy"
❌ BAD (content-slide):
Title: Human-in-the-Loop Strategy
Bullets:
- In-the-loop: Human approves before execution
- On-the-loop: Human reviews after completion
- Code review remains critical
- AI generates, humans validate✅ GOOD (two-column-slide):
Title: Human-in-the-Loop Strategy
Left: In-the-Loop
- Human approves before execution
- Critical for production changes
- Quality gateway
Right: On-the-Loop
- Human reviews after completion
- Faster iteration cycles
- AI generates, human validatesActive Visual Thinking
Before planning any slide, ask yourself:
1. "Can this be more visual?" - The answer is almost always YES 2. "Have I used content-slide in the last 2 slides?" - If yes, use something else 3. "Does this slide look like the previous slide?" - If yes, change the layout 4. "Am I falling into a pattern?" - Break it immediately 5. "Would this be more engaging as cards/columns/stats?" - Usually yes
When content-slide IS Appropriate
Use content-slide ONLY when:
- You've genuinely tried all other layouts and they don't fit
- The information is inherently linear and textual (rare)
- You need a "breather" slide between two complex visuals
- You're at your layout distribution limits (already used all the visual ones recently)
Never use content-slide as your default thinking.
Quick Reference: Content Type → Best Layout
| Content Type | Best Layout | Why |
|---|---|---|
| 3-5 equal features/steps | multi-card-slide | Cards create visual hierarchy |
| Exactly 3 featured items | floating-cards-slide | Elevated cards add depth |
| 2-4 metrics/KPIs | stats-slide | Big numbers grab attention |
| Before/after comparison | two-column-slide | Side-by-side shows contrast |
| Hub concept with types | circular-hero-slide | Radiating pattern shows relationships |
| Dramatic emphasis (1-3 words) | giant-focus-slide | Scale creates impact |
| High-energy warning | bold-diagonal-slide | Dynamic shapes convey urgency |
| Powerful quote/principle | quote-slide | Attribution adds authority |
| List of related items | multi-card-slide | Better than bullets |
| Process with steps | floating-cards-slide | Visual flow beats text |
| Technical comparison | two-column-slide | Structured comparison |
Only use content-slide when:
- None of the above fit
- Information is truly linear
- Need a text-heavy breather between visual slides
- Already hit variety limits
Step 3: Slide Planning (ALWAYS DO THIS)
Before generating ANY slides, create a written plan.
This applies to single slides, batches, and full presentations. Planning prevents:
- Duplicate content across slides
- Wrong layout choices
- Missing key information
- Poor flow and structure
Create a slide plan table:
| # | Layout | Title | Key Content | Notes |
|---|--------|-------|-------------|-------|
| 1 | title-slide | [Title] | [Subtitle, author] | Opening slide |
| 2 | content-slide | [Title] | [3-4 bullet points] | Main concepts |
| 3 | stats-slide | [Title] | [2-3 metrics] | Impact data |
| ... | ... | ... | ... | ... |For each slide, specify:
- Slide number - Position in presentation
- Layout - Which cookbook layout to use
- Title - Exact title text (check for duplicates!)
- Key content - Bullet points, stats, quotes, etc.
- Notes - Any special considerations
Planning checklist:
- [ ] No duplicate titles across slides
- [ ] Logical flow from slide to slide
- [ ] Appropriate layout for each content type
- [ ] Content fits the chosen layout
- [ ] Batches are logically grouped (5 slides max each)
- [ ] VARIETY CHECK: Content-slide used <25% of total slides
- [ ] VARIETY CHECK: No more than 2-3 consecutive slides with same layout
- [ ] VARIETY CHECK: Visual layouts (cards, stats, columns, hero) are 50%+ of slides
- [ ] VARIETY CHECK: Each content-slide was evaluated against decision tree first
After planning, briefly present the plan before generating.
Example of good variety distribution for 30-slide presentation:
- Content-slide: 6-7 slides (20-23%)
- Section breaks: 5 slides (17%)
- Visual layouts: 15-16 slides (50-53%)
- Multi-card: 3-4 slides
- Two-column: 2-3 slides
- Stats: 1-2 slides
- Floating-cards: 2-3 slides
- Circular-hero: 1-2 slides
- Giant-focus/Bold-diagonal: 2-3 slides
- Quote: 1 slide
- Title/Closing: 2-3 slides (7-10%)
Step 4: Content Adaptation
For each slide in your plan:
Presentation Text Formatting Rules
IMPORTANT: Follow these rules for ALL slide text.
| Element | Rule | Example |
|---|---|---|
| Titles | No trailing periods or commas | "Why AI Matters" not "Why AI Matters." |
| Subtitles | No trailing punctuation | "The future of coding" not "The future of coding." |
| Bullet points | No trailing periods (unless full sentences) | "Faster development" not "Faster development." |
| Headlines | Minimal punctuation, no ellipsis | "What's Next" not "What's Next..." |
| Stats/Numbers | Clean format, no trailing punctuation | "50%" not "50%." |
| CTAs | No trailing punctuation | "Get Started" not "Get Started." |
| Labels | Short, no punctuation | "Step 1" not "Step 1:" |
Avoid:
- Trailing periods on titles, bullets, labels
- Ellipsis (...) in headlines
- Excessive commas in short phrases
- Colons at end of labels/headers
- Semicolons in bullet points
Exception: Full sentence descriptions or quotes may use appropriate punctuation.
Brand Value Mapping
1. Map brand.json values to layout placeholders:
| Layout Placeholder | brand.json Path |
|---|---|
BRAND_BG | colors.background |
BRAND_BG_ALT | colors.background_alt |
BRAND_TEXT | colors.text |
BRAND_TEXT_SECONDARY | colors.text_secondary |
BRAND_ACCENT | colors.accent |
BRAND_ACCENT_SECONDARY | colors.accent_secondary |
BRAND_ACCENT_TERTIARY | colors.accent_tertiary |
BRAND_CODE_BG | colors.code_bg |
BRAND_CARD_BG | colors.card_bg |
BRAND_CARD_BG_ALT | colors.card_bg_alt |
BRAND_HEADING_FONT | fonts.heading |
BRAND_BODY_FONT | fonts.body |
BRAND_CODE_FONT | fonts.code |
Note: All color values in brand.json are hex WITHOUT the # prefix.
2. Write content in brand's voice (from tone-of-voice.md) 3. Preserve layout structure (decorative elements, spacing, hierarchy)
Step 5: Batch Generation (CRITICAL)
MAXIMUM 5 SLIDES PER BATCH. This is a hard limit.
When generating multiple slides: 1. Generate 1-5 slides in a single PPTX file 2. STOP and review the output before generating more 3. Only after validation passes, continue with the next batch 4. Repeat until all slides are generated
Why batching matters:
- Prevents token limit errors
- Allows quality checks between batches
- Catches issues early before they propagate
⚠️ CRITICAL BACKGROUND BUG FIX:
EVERY slide MUST have its background explicitly set. If you don't set slide.background.fill.solid() and slide.background.fill.fore_color.rgb, the slide will use PowerPoint's default WHITE background, making text unreadable on dark-themed brands.
Mandatory for every slide:
slide = prs.slides.add_slide(prs.slide_layouts[6])
slide.background.fill.solid() # ← REQUIRED
slide.background.fill.fore_color.rgb = hex_to_rgb(BRAND_BG) # ← REQUIREDThis is especially critical when:
- Generating multiple batches (each batch is a new Presentation object)
- Using helper functions to create slides
- Combining separate PPTX files
Execution:
PREFERRED: Use heredoc (no files created):
uv run --with python-pptx==1.0.2 python << 'EOF'
# [Adapted code with brand values and content]
EOFIF heredoc fails (Windows issues): Use temp directory:
# Create temp directory if needed
mkdir -p .claude/skills/pptx-generator/.tmp
# Write script to temp directory
# (create file at .claude/skills/pptx-generator/.tmp/gen.py)
# Execute
uv run --with python-pptx==1.0.2 python .claude/skills/pptx-generator/.tmp/gen.py
# MANDATORY: Clean up immediately after execution
rm .claude/skills/pptx-generator/.tmp/gen.pyCRITICAL: Never create Python files in the repository root. Always use heredoc or temp directory within the skill folder.
Step 6: Quality Validation (MANDATORY)
After EVERY batch, validate before continuing:
1. Open the generated PPTX and visually inspect it 2. Check for these common issues:
| Issue | What to Look For | Fix |
|---|---|---|
| White background | Slide has white background instead of brand color | Add slide.background.fill.solid() and set fore_color.rgb |
| Duplicate titles | Same title text appearing twice on a slide | Remove duplicate text boxes |
| Spacing problems | Title too close to subtitle/content | Increase Y position of lower elements |
| Text overflow | Content extending beyond slide bounds | Reduce font size or split content |
| Missing elements | Decorative elements not rendering | Check shape positions and colors |
| Wrong colors | Colors not matching brand | Verify hex values (no # prefix in code) |
| Bad punctuation | Trailing periods/commas on titles/bullets | Remove unnecessary punctuation |
3. If issues found:
- Fix the current batch before continuing
- Note the issue to avoid repeating in future batches
4. If validation passes:
- Continue to next batch of slides
Step 7: Output
Use the output settings from config.json:
| Config Setting | Default | Description |
|---|---|---|
output.directory | output/{brand} | Where to save files |
output.naming | {name}-{date} | File naming pattern |
output.keep_parts | false | Keep part files after combining |
Resolve placeholders:
{brand}→ Brand folder name{name}→ Presentation name from user request{date}→ Current date (YYYY-MM-DD)
# Create output directory from config
mkdir -p {resolved-output-directory}Batched generation workflow: 1. Generate each batch as {name}-part1.pptx, {name}-part2.pptx, etc. 2. Validate each batch before continuing 3. After ALL batches complete, combine into final file (if auto_combine is true) 4. Delete part files (if keep_parts is false)
Step 8: Combine Batches (for multi-batch presentations)
🚨 CRITICAL BUG WARNING: BACKGROUND MUST BE SET WHEN COMBINING 🚨
When combining presentations, add_slide() creates slides with DEFAULT WHITE BACKGROUNDS. Shape copying does NOT copy the slide background property. You MUST explicitly set the background immediately after creating each new slide.
This is the most common source of white slides in combined presentations.
After all batches are validated, combine them into a single PPTX:
uv run --with python-pptx==1.0.2 python << 'SCRIPT'
from pptx import Presentation
from pptx.dml.color import RGBColor
from pathlib import Path
import shutil
def hex_to_rgb(hex_color: str) -> RGBColor:
h = hex_color.lstrip("#")
return RGBColor(int(h[0:2], 16), int(h[2:4], 16), int(h[4:6], 16))
# Brand background color (get from brand.json)
BRAND_BG = "REPLACE_WITH_BRAND_BACKGROUND" # e.g., "07090F"
# List all part files in order
output_dir = Path("output/{brand-name}")
part_files = sorted(output_dir.glob("{name}-part*.pptx"))
if len(part_files) > 1:
# Start with first part as base
combined = Presentation(part_files[0])
# Add slides from remaining parts
for part_file in part_files[1:]:
part_prs = Presentation(part_file)
for slide in part_prs.slides:
# Copy slide layout and add to combined
blank_layout = combined.slide_layouts[6]
new_slide = combined.slides.add_slide(blank_layout)
# 🚨 CRITICAL: Set background IMMEDIATELY after creating slide
# PowerPoint defaults to WHITE background - this MUST be set before copying shapes
new_slide.background.fill.solid()
new_slide.background.fill.fore_color.rgb = hex_to_rgb(BRAND_BG)
# Copy all shapes from source slide
for shape in slide.shapes:
# Clone shape to new slide
el = shape.element
new_slide.shapes._spTree.insert_element_before(
el, 'p:extLst'
)
# Save combined file
combined.save(output_dir / "{name}-final.pptx")
print(f"Combined {len(part_files)} parts into {name}-final.pptx")
# MANDATORY: Clean up part files - user should only see final file
for part_file in part_files:
part_file.unlink()
print(f"Deleted {part_file.name}")
else:
# Single part, just rename
shutil.move(part_files[0], output_dir / "{name}-final.pptx")
SCRIPTFinal output: output/{brand-name}/{name}-final.pptx
Why this bug happens:
combined.slides.add_slide()creates a NEW slide object with PowerPoint's default white backgroundshapes._spTree.insert_element_before()copies shapes (text, rectangles, images) but NOT the background- The background is a slide property, not a shape, so it must be set separately
- Without explicit background setting, slides 6-30 (or however many are added after the base) will be white
Testing checklist after combining:
- [ ] Open the combined PPTX
- [ ] Scroll through ALL slides (not just the first few)
- [ ] Verify EVERY slide has the correct background color
- [ ] If any white slides found, the combination code is missing the background setting
---
Mode 2: Generate LinkedIn Carousels
LinkedIn carousels are multi-page PDFs in square (1:1) format. Each page is a swipeable slide.
Carousel vs Presentation
| Aspect | Presentation | Carousel |
|---|---|---|
| Dimensions | 16:9 (13.333" × 7.5") | 1:1 (7.5" × 7.5") |
| Layouts | cookbook/*.py | cookbook/carousels/*.py |
| Output | PPTX | PDF (via PPTX conversion) |
| Slides | 10-50+ typical | 5-10 optimal |
| Text size | Standard | Larger (mobile readable) |
| Content | Detailed | One idea per slide |
Step 1: Brand Discovery
Same as Mode 1 - read brand.json, config.json, and tone-of-voice.md.
Step 2: Carousel Layout Discovery
Discover carousel-specific layouts:
Glob: .claude/skills/pptx-generator/cookbook/carousels/*.pyAvailable carousel layouts:
| Layout | Purpose | Best For |
|---|---|---|
hook-slide | Opening attention-grabber | First slide only |
single-point-slide | One key point with explanation | Body content |
numbered-point-slide | Numbered list item with big number | Listicles, steps |
quote-slide | Quote with attribution | Social proof, insights |
cta-slide | Call to action | Last slide only |
Read frontmatters to understand limits and constraints for each.
Step 3: Carousel Planning
Typical carousel structure (5-10 slides):
| # | Layout | Content |
|---|--------|---------|
| 1 | hook-slide | Attention-grabbing hook |
| 2-8 | single-point or numbered-point | Body content |
| 9/10 | cta-slide | Call to action |Carousel content rules:
- One idea per slide - Don't cram multiple points
- Large text - Must be readable on mobile
- Short copy - Max 50 chars for headlines, 150 for body
- Clear flow - Each slide should make sense if viewed alone
- Strong hook - First slide stops the scroll
- Clear CTA - Last slide tells them what to do
Step 4: Generate Carousel
Carousel dimensions (square 1:1):
prs.slide_width = Inches(7.5)
prs.slide_height = Inches(7.5)Generate all slides as a single PPTX file (carousels are typically 5-10 slides, so batching rarely needed).
Execution:
uv run --with python-pptx==1.0.2 python << 'SCRIPT'
# Carousel generation code with 7.5" x 7.5" dimensions
SCRIPTStep 5: Export to PDF
LinkedIn requires PDF for carousel posts. Convert the PPTX to PDF:
Option A: Using LibreOffice (recommended)
libreoffice --headless --convert-to pdf --outdir output/rasmus output/rasmus/carousel.pptxOption B: Using soffice
soffice --headless --convert-to pdf output/rasmus/carousel.pptxNote: LibreOffice must be installed. On macOS: brew install --cask libreoffice
Step 6: Output
Save both files:
output/{brand}/{name}-carousel.pptx- Editable sourceoutput/{brand}/{name}-carousel.pdf- LinkedIn-ready
Carousel Checklist
- [ ] Read brand configuration
- [ ] Read carousel layout frontmatters from
cookbook/carousels/ - [ ] Plan carousel structure (hook → body → CTA)
- [ ] Keep text SHORT (check character limits in frontmatter)
- [ ] Use 7.5" × 7.5" dimensions
- [ ] Generate PPTX
- [ ] Validate output
- [ ] Export to PDF
- [ ] Test PDF in LinkedIn preview
---
Mode 3: Layout CRUD Operations
Creating New Layouts
When user requests a new layout type:
1. Study existing layouts for patterns:
Glob: .claude/skills/pptx-generator/cookbook/*.pyRead 2-3 layouts to understand:
- Code structure and imports
- How brand variables are used
- Decorative element patterns
- Positioning conventions
2. Design with these quality standards:
MUST be production-ready:
- Professional, polished appearance
- Visually engaging (not plain or generic)
- Distinctive decorative elements
- Strong visual hierarchy
- Proper use of whitespace
Use appropriate elements:
- Charts - Pie, doughnut, bar, column for data visualization
- Images - Placeholder shapes for screenshots, photos
- Shapes - Circles, rectangles, parallelograms for visual interest
- Cards - Floating cards with shadows for depth
- Geometric patterns - Bold shapes anchored to corners/edges
Avoid:
- Plain text-only layouts
- Generic bullet points without styling
- Tiny decorative elements that don't make impact
- Centered-everything boring compositions
3. Write the layout file with detailed frontmatter:
⚠️ CRITICAL: The frontmatter is documentation for future AI agents.
Every layout MUST include comprehensive frontmatter that teaches future AI agents:
- WHEN to use this layout (and when NOT to)
- HOW to use it correctly
- WHAT limits and constraints exist
- WHY certain choices matter
#!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "python-pptx==1.0.2",
# ]
# ///
# /// layout
# name = "layout-name"
# purpose = "When to use this layout - be specific"
# best_for = [
# "Ideal use case 1",
# "Ideal use case 2",
# ]
# avoid_when = [
# "Situation to avoid 1 - and what to use instead",
# "Situation to avoid 2 - and what to use instead",
# ]
# max_items = 5 # or other relevant limits
# instructions = [
# "Specific tip 1",
# "Specific tip 2",
# ]
# ///
"""
LAYOUT: [Name]
PURPOSE: [When to use this layout - be specific]
CUSTOMIZE:
- [List customizable elements]
"""
# ... implementationRequired frontmatter fields (be DETAILED and SPECIFIC):
| Field | Description | Example |
|---|---|---|
name | Layout identifier (matches filename) | "multi-card-slide" |
purpose | Clear one-line description | "Multiple items as cards in a row, 3-5 cards" |
best_for | Detailed array of ideal scenarios | ["Exactly 3 related features", "Process with 3 steps"] |
avoid_when | Specific situations with alternatives | ["More than 3 items - use multi-card-slide instead"] |
instructions | Actionable tips for correct usage | ["Card titles must be SHORT: 1-2 words, max 15 chars"] |
Optional but recommended fields:
| Field | Description | Example |
|---|---|---|
max_* / min_* | Hard limits on items | max_cards = 3, min_surrounding_items = 4 |
*_max_chars | Character limits for text | card_title_max_chars = 15 |
Writing good frontmatter:
✅ DO: Be specific and actionable
# avoid_when = [
# "More than 3 items - use multi-card-slide instead",
# "Long card titles (over 15 characters) - abbreviate or use content-slide",
# ]
# instructions = [
# "EXACTLY 3 cards required - no more, no less",
# "Card titles must be SHORT: 1-2 words, max 15 characters",
# "If titles are too long, abbreviate or use different layout",
# ]❌ DON'T: Be vague or unhelpful
# avoid_when = ["Too many items", "Wrong content"]
# instructions = ["Use correctly", "Follow the pattern"]Think of frontmatter as teaching a colleague - what would they need to know to use this layout correctly without asking you questions?
4. Save to cookbook:
.claude/skills/pptx-generator/cookbook/{layout-name}-slide.py5. Test by generating a sample with the new layout
Editing Existing Layouts
1. Find the layout:
Glob: .claude/skills/pptx-generator/cookbook/*{name}*.py2. Read and understand current structure including the frontmatter
3. Make modifications while preserving:
- The script header format
- Brand variable naming conventions
- Docstring format (LAYOUT, PURPOSE, CUSTOMIZE)
4. Update the frontmatter if your changes affect:
- What the layout is best for (
best_for) - When to avoid it (
avoid_when) - Item limits (
max_*,min_*) - Usage instructions (
instructions)
5. Save back to the same file
6. Test the modified layout
Updating/Improving Layouts
When asked to improve layout quality:
1. Analyze current weaknesses:
- Is it visually engaging?
- Does it have enough decorative elements?
- Is there good visual hierarchy?
- Does it use space well?
2. Apply improvements:
- Add bold geometric shapes
- Improve color usage
- Add depth (shadows, overlapping)
- Better typography sizing
- More distinctive decorative elements
3. Preserve functionality - Don't break what works
4. Review and enhance frontmatter:
- Are
best_forandavoid_whenstill accurate? - Do
instructionsreflect any new constraints? - Add any lessons learned from the improvements
- Update limits if element sizes/counts changed
Deleting Layouts
Simply remove the file:
rm .claude/skills/pptx-generator/cookbook/{layout-name}.py---
Editing Existing PPTX Files
When user provides an existing PPTX:
1. Read the file:
from pptx import Presentation
prs = Presentation("path/to/existing.pptx")2. Analyze: Number of slides, styling, content structure
3. Apply changes: Add/remove slides, update content, modify styling
4. Save to output directory (don't overwrite original unless requested)
---
Technical Reference
Slide dimensions (16:9):
- Width: 13.333 inches
- Height: 7.5 inches
- Safe margins: 0.5 inches
Always use:
- Blank layout:
prs.slide_layouts[6] - python-pptx version: 1.0.2
Common imports:
from pptx import Presentation
from pptx.chart.data import CategoryChartData
from pptx.dml.color import RGBColor
from pptx.enum.chart import XL_CHART_TYPE, XL_LEGEND_POSITION
from pptx.enum.shapes import MSO_SHAPE
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.util import Inches, PtChart types available:
XL_CHART_TYPE.PIE- Pie chartXL_CHART_TYPE.DOUGHNUT- Doughnut chartXL_CHART_TYPE.BAR_CLUSTERED- Horizontal barsXL_CHART_TYPE.COLUMN_CLUSTERED- Vertical columnsXL_CHART_TYPE.LINE- Line chart
Adding charts:
chart_data = CategoryChartData()
chart_data.categories = ["A", "B", "C"]
chart_data.add_series("Values", [10, 20, 30])
slide.shapes.add_chart(
XL_CHART_TYPE.DOUGHNUT,
Inches(x), Inches(y),
Inches(width), Inches(height),
chart_data
)Adding images:
slide.shapes.add_picture(
"path/to/image.png",
Inches(x), Inches(y),
width=Inches(w) # Height auto-calculated
)---
Preview All Layouts
To see all available layouts:
uv run .claude/skills/pptx-generator/generate-cookbook-preview.pyThis generates cookbook-preview.pptx with every layout.
---
Checklist
For Slide Generation:
- [ ] Read brand.json for colors/fonts
- [ ] Read config.json for output directory and settings
- [ ] Read markdown files for voice/tone
- [ ] Read ALL cookbook layout frontmatters (first 40 lines of each .py):
- [ ] Glob all
.claude/skills/pptx-generator/cookbook/*.py - [ ] Read every file to extract
# /// layoutblocks - [ ] Build understanding of all
best_for,avoid_when, limits - [ ] Then select layouts based on complete knowledge:
- [ ] Match content to
best_forcriteria - [ ] Respect
avoid_whenwarnings - [ ] Check
max_*/min_*limits - [ ] Follow
instructionsfor chosen layouts - [ ] Create slide plan table BEFORE generating:
- [ ] List all slides with layout, title, content
- [ ] Check for duplicate titles
- [ ] Verify logical flow
- [ ] Group into batches (max 5 per batch)
- [ ] VARIETY CHECK: Content-slide <25% of total
- [ ] VARIETY CHECK: No 3+ consecutive same-layout slides
- [ ] VARIETY CHECK: Visual layouts 50%+ of presentation
- [ ] VARIETY CHECK: Used decision tree to evaluate each content-slide
- [ ] Present plan briefly before proceeding
- [ ] Apply brand colors and fonts
- [ ] Write content in brand's voice
- [ ] Generate MAX 5 slides per batch (or
slides_per_batchfrom config) - [ ] Execute via UV REPL
- [ ] Validate output before continuing:
- [ ] No duplicate titles
- [ ] Proper spacing between elements
- [ ] Content fits within bounds
- [ ] Colors match brand
- [ ] No trailing punctuation on titles/bullets
- [ ] Save batch to output directory from config
- [ ] Repeat for next batch if needed
- [ ] Combine all batches into final PPTX (if
auto_combineis true) - [ ] Clean up part files (if
keep_partsis false)
For Creating Layouts:
- [ ] Study existing layouts for patterns
- [ ] Design with production-ready quality
- [ ] Include distinctive decorative elements
- [ ] Use charts/images/shapes appropriately
- [ ] Add TOML-style frontmatter with:
- [ ]
name,purpose - [ ]
best_for,avoid_whenarrays - [ ]
instructionsarray with usage tips - [ ]
max_*/min_*limits as needed - [ ] Write proper docstring (LAYOUT, PURPOSE, CUSTOMIZE)
- [ ] Test the new layout
# Place brand assets here:
# - logo.png (primary logo)
# - logo-dark.png (logo for dark backgrounds, if different)
# - icon.png (square icon/favicon)
# - Any other brand imagery
[Brand Name] — Brand System
REPLACE with a one-line brand description.
---
Brand Philosophy
Core Principles
1. Principle One REPLACE with description.
2. Principle Two REPLACE with description.
3. Principle Three REPLACE with description.
---
Color System
Primary Accent
| Name | Hex | Use |
|---|---|---|
| Accent | #REPLACE | Primary buttons, links, highlights |
| Accent Dark | #REPLACE | Hover states, outlines |
| Accent Light | #REPLACE | Secondary accents |
Theme Base
Background: #REPLACE
Background Alt: #REPLACE
Surface: #REPLACE
Text Primary: #REPLACE
Text Secondary: #REPLACE---
Typography
Font Stack
- Heading: REPLACE (headlines, titles, buttons)
- Body: REPLACE (paragraphs, descriptions)
- Code: REPLACE (code blocks, terminal)
Usage Guidelines
| Element | Font | Weight | Size |
|---|---|---|---|
| Display | Heading | 700 | 36px+ |
| H1 | Heading | 700 | 30px |
| H2 | Heading | 600 | 24px |
| Body | Body | 400 | 16-18px |
| Code | Code | 400 | 14px |
---
Signature Elements
REPLACE: Describe any unique visual patterns, decorative elements, or signature design choices for this brand.
---
Last updated: REPLACE
{
"name": "REPLACE",
"description": "REPLACE with a one-line description of the brand",
"colors": {
"background": "REPLACE",
"background_alt": "REPLACE",
"text": "REPLACE",
"text_secondary": "REPLACE",
"accent": "REPLACE",
"accent_secondary": "REPLACE",
"accent_tertiary": "REPLACE",
"code_bg": "REPLACE",
"card_bg": "REPLACE",
"card_bg_alt": "REPLACE"
},
"fonts": {
"heading": "REPLACE",
"body": "REPLACE",
"code": "REPLACE"
},
"assets": {
"logo": null,
"logo_dark": null,
"icon": null
}
}
{
"output": {
"directory": "output/{brand}",
"naming": "{name}-{date}",
"keep_parts": false
},
"generation": {
"slides_per_batch": 5,
"auto_combine": true,
"open_after_generate": false
},
"defaults": {
"slide_width_inches": 13.333,
"slide_height_inches": 7.5
}
}
Brand Template
Use this template to add a new brand to the PPTX generator skill.
Setup Instructions
1. Copy this folder to a new folder with your brand name:
cp -r template/ your-brand-name/2. Edit `brand.json` with your brand's values:
- All color values should be hex codes WITHOUT the
#prefix (e.g.,"1e1e2e") - Font names should match fonts installed on the system
- Asset paths are relative to the brand folder
3. Edit `brand-system.md` with your brand guidelines:
- This file provides context to the AI when generating content
- Include color rationale, typography rules, and visual principles
4. Edit `tone-of-voice.md` with writing guidelines:
- This file guides the AI in writing slide content
- Include voice attributes, example phrases, and dos/don'ts
5. Add assets to the assets/ folder:
logo.png- Primary logologo-dark.png- Logo variant for dark backgrounds (optional)icon.png- Square icon (optional)
6. Edit `config.json` with output and generation settings:
- Output directory (where PPTX files are saved)
- Batch generation settings
- File naming conventions
config.json Reference
{
"output": {
"directory": "output/{brand}", // Where to save files ({brand} = brand name)
"naming": "{name}-{date}", // File naming pattern
"keep_parts": false // Keep part files after combining?
},
"generation": {
"slides_per_batch": 5, // Slides per batch (max 5)
"auto_combine": true, // Auto-combine batches into final?
"open_after_generate": false // Open file after generation?
},
"defaults": {
"slide_width_inches": 13.333, // 16:9 aspect ratio
"slide_height_inches": 7.5
}
}Placeholders for `directory` and `naming`:
{brand}- Brand folder name{name}- Presentation name (from user request){date}- Current date (YYYY-MM-DD){timestamp}- Unix timestamp
brand.json Reference
{
"name": "Brand Name",
"description": "One-line brand description",
"colors": {
"background": "1e1e2e", // Main slide background
"background_alt": "181825", // Darker variant for contrast
"text": "cdd6f4", // Primary text color
"text_secondary": "bac2de", // Muted/secondary text
"accent": "fab387", // Primary accent (CTAs, highlights)
"accent_secondary": "89b4fa", // Secondary accent (variety)
"accent_tertiary": "a6e3a1", // Third accent (optional)
"code_bg": "11111b", // Code block background
"card_bg": "313244", // Card/surface background
"card_bg_alt": "45475a" // Alternate card background
},
"fonts": {
"heading": "JetBrains Mono", // Headlines, titles, buttons
"body": "Inter", // Body text, descriptions
"code": "JetBrains Mono" // Code blocks, terminal
},
"assets": {
"logo": "assets/logo.png", // Path to primary logo
"logo_dark": null, // Path to dark variant (or null)
"icon": null // Path to icon (or null)
}
}Notes
- Color hex codes should NOT include the
#prefix - The AI reads both
brand.json(for exact values) and the markdown files (for context) - Keep markdown files updated if you change values in
brand.json
[Brand Name] — Tone of Voice
Voice Character
REPLACE: Describe the brand's personality in 2-3 sentences. How should it "sound" when speaking?
Core Attributes
1. REPLACE Attribute
REPLACE with description of how this attribute manifests in writing.
2. REPLACE Attribute
REPLACE with description.
3. REPLACE Attribute
REPLACE with description.
---
Writing Guidelines
Do
- REPLACE with positive writing guideline
- REPLACE
- REPLACE
Don't
- REPLACE with what to avoid
- REPLACE
- REPLACE
---
Example Phrases
Headlines
- "REPLACE with example headline"
- "REPLACE"
CTAs
- "REPLACE with example CTA"
- "REPLACE"
Descriptions
- "REPLACE with example description style"
---
Last updated: REPLACE
#!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "python-pptx==1.0.2",
# ]
# ///
# /// layout
# name = "bold-diagonal-slide"
# purpose = "High-energy statements, disruption themes, modern/dynamic feel"
# best_for = [
# "Bold proclamations",
# "Disruption or change themes",
# "High-energy moments",
# "Startup/innovation vibes",
# ]
# avoid_when = [
# "Content needs structure or bullets",
# "Conservative/formal audience",
# "Already used multiple dynamic layouts",
# ]
# instructions = [
# "Headline should be punchy: 2-5 words maximum",
# "Subtext provides context but keep it brief",
# "Diagonal shapes create energy - use sparingly in presentation",
# "Text is right-aligned to balance the left diagonal shapes",
# ]
# ///
"""
LAYOUT: Bold Diagonal
PURPOSE: High-energy statements, disruption themes, modern/dynamic feel
CUSTOMIZE:
- BRAND_* colors and fonts
- HEADLINE: Bold statement (2-5 words)
- SUBTEXT: Supporting context
"""
from pathlib import Path
from pptx import Presentation
from pptx.dml.color import RGBColor
from pptx.enum.shapes import MSO_SHAPE
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.util import Inches, Pt
def hex_to_rgb(hex_color: str) -> RGBColor:
h = hex_color.lstrip("#")
return RGBColor(int(h[0:2], 16), int(h[2:4], 16), int(h[4:6], 16))
def main() -> None:
# === BRAND COLORS (get from brands/{name}/brand-system.md) ===
BRAND_BG = "REPLACE" # background color
BRAND_TEXT = "REPLACE" # primary text color
BRAND_TEXT_SECONDARY = "REPLACE" # secondary/muted text color
BRAND_ACCENT = "REPLACE" # accent color (for primary diagonal)
BRAND_ACCENT_SECONDARY = "REPLACE" # secondary accent (for layered diagonal)
BRAND_HEADING_FONT = "REPLACE" # heading font name
BRAND_BODY_FONT = "REPLACE" # body font name
# === CONTENT (from user request, written in brand voice) ===
HEADLINE = "REPLACE" # bold statement (2-5 words)
SUBTEXT = "REPLACE" # supporting context
# === SLIDE SETUP ===
prs = Presentation()
prs.slide_width = Inches(13.333)
prs.slide_height = Inches(7.5)
slide = prs.slides.add_slide(prs.slide_layouts[6])
# Background
slide.background.fill.solid()
slide.background.fill.fore_color.rgb = hex_to_rgb(BRAND_BG)
# Large diagonal accent block (using parallelogram)
# Create diagonal effect with rotated freeform or multiple shapes
# Since python-pptx doesn't support rotation easily, we fake it with overlapping shapes
# Main diagonal block (bottom-left to top-right feel)
# We'll create a series of rectangles to simulate diagonal
diagonal_colors = [BRAND_ACCENT, BRAND_ACCENT_SECONDARY]
# Large accent rectangle anchored to bottom-left, extending up
block1 = slide.shapes.add_shape(
MSO_SHAPE.PARALLELOGRAM,
Inches(-1), Inches(3),
Inches(8), Inches(5)
)
block1.fill.solid()
block1.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT)
block1.line.fill.background()
# Second parallelogram for layered effect
block2 = slide.shapes.add_shape(
MSO_SHAPE.PARALLELOGRAM,
Inches(-2), Inches(4.5),
Inches(7), Inches(4)
)
block2.fill.solid()
block2.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT_SECONDARY)
block2.line.fill.background()
# Headline - positioned in the clear area (right side)
headline_box = slide.shapes.add_textbox(
Inches(5.5), Inches(2.0),
Inches(7.3), Inches(2.0)
)
tf = headline_box.text_frame
tf.word_wrap = True
p = tf.paragraphs[0]
p.text = HEADLINE
p.font.name = BRAND_HEADING_FONT
p.font.size = Pt(64)
p.font.bold = True
p.font.color.rgb = hex_to_rgb(BRAND_TEXT)
p.alignment = PP_ALIGN.RIGHT
# Subtext
subtext_box = slide.shapes.add_textbox(
Inches(5.5), Inches(4.2),
Inches(7.3), Inches(1.0)
)
p = subtext_box.text_frame.paragraphs[0]
p.text = SUBTEXT
p.font.name = BRAND_BODY_FONT
p.font.size = Pt(24)
p.font.color.rgb = hex_to_rgb(BRAND_TEXT_SECONDARY)
p.alignment = PP_ALIGN.RIGHT
# Small accent detail - top right corner
corner = slide.shapes.add_shape(
MSO_SHAPE.RIGHT_TRIANGLE,
Inches(12.333), Inches(0),
Inches(1), Inches(1)
)
corner.fill.solid()
corner.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT)
corner.line.fill.background()
# Save
output = Path("bold-diagonal-slide.pptx")
prs.save(output)
print(f"Created {output}")
if __name__ == "__main__":
main()
#!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "python-pptx==1.0.2",
# ]
# ///
# /// layout
# name = "carousel-cta-slide"
# format = "carousel"
# dimensions = "square"
# purpose = "Closing slide with call to action - the conversion slide"
# best_for = [
# "Last slide of any carousel",
# "Follow/subscribe prompts",
# "Link to resource or content",
# "Summary with next step",
# ]
# avoid_when = [
# "First or middle slides - save CTA for the end",
# "Multiple CTAs - pick ONE action",
# "No clear action - every carousel needs a CTA",
# ]
# headline_max_chars = 30
# cta_max_chars = 25
# handle_max_chars = 20
# instructions = [
# "HEADLINE should summarize value or prompt action - max 30 chars",
# "CTA_TEXT is the specific action - max 25 chars (e.g., 'Follow for more')",
# "HANDLE is your social handle - max 20 chars",
# "Keep it simple - one clear action beats multiple options",
# ]
# ///
"""
LAYOUT: Carousel CTA Slide
PURPOSE: Closing slide with call to action
FORMAT: Square (1:1) for LinkedIn carousels
CUSTOMIZE:
- BRAND_* colors and fonts
- HEADLINE: Summary or prompt (max 30 chars)
- CTA_TEXT: The action (max 25 chars)
- HANDLE: Your social handle (max 20 chars)
"""
from pathlib import Path
from pptx import Presentation
from pptx.dml.color import RGBColor
from pptx.enum.shapes import MSO_SHAPE
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.util import Inches, Pt
def hex_to_rgb(hex_color: str) -> RGBColor:
h = hex_color.lstrip("#")
return RGBColor(int(h[0:2], 16), int(h[2:4], 16), int(h[4:6], 16))
def main() -> None:
# === BRAND COLORS ===
BRAND_BG = "1e1e2e"
BRAND_BG_ALT = "181825"
BRAND_TEXT = "cdd6f4"
BRAND_TEXT_SECONDARY = "bac2de"
BRAND_ACCENT = "fab387"
BRAND_HEADING_FONT = "JetBrains Mono"
BRAND_BODY_FONT = "Inter"
# === CONTENT ===
HEADLINE = "REPLACE" # Max 30 chars
CTA_TEXT = "REPLACE" # Max 25 chars
HANDLE = "@RasmusWiding" # Max 20 chars
# === SLIDE SETUP (Square 1:1) ===
prs = Presentation()
prs.slide_width = Inches(7.5)
prs.slide_height = Inches(7.5)
slide = prs.slides.add_slide(prs.slide_layouts[6])
# Background
slide.background.fill.solid()
slide.background.fill.fore_color.rgb = hex_to_rgb(BRAND_BG)
# Top accent bar
top_bar = slide.shapes.add_shape(
MSO_SHAPE.RECTANGLE,
Inches(0), Inches(0),
Inches(7.5), Inches(0.15)
)
top_bar.fill.solid()
top_bar.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT)
top_bar.line.fill.background()
# Bottom block
bottom_block = slide.shapes.add_shape(
MSO_SHAPE.RECTANGLE,
Inches(0), Inches(5.0),
Inches(7.5), Inches(2.5)
)
bottom_block.fill.solid()
bottom_block.fill.fore_color.rgb = hex_to_rgb(BRAND_BG_ALT)
bottom_block.line.fill.background()
# Headline
headline_box = slide.shapes.add_textbox(
Inches(0.5), Inches(2.0),
Inches(6.5), Inches(2.0)
)
tf = headline_box.text_frame
tf.word_wrap = True
p = tf.paragraphs[0]
p.text = HEADLINE
p.font.name = BRAND_HEADING_FONT
p.font.size = Pt(44)
p.font.bold = True
p.font.color.rgb = hex_to_rgb(BRAND_TEXT)
p.alignment = PP_ALIGN.CENTER
# CTA text
cta_box = slide.shapes.add_textbox(
Inches(0.5), Inches(5.3),
Inches(6.5), Inches(1.0)
)
tf = cta_box.text_frame
p = tf.paragraphs[0]
p.text = CTA_TEXT
p.font.name = BRAND_HEADING_FONT
p.font.size = Pt(28)
p.font.bold = True
p.font.color.rgb = hex_to_rgb(BRAND_ACCENT)
p.alignment = PP_ALIGN.CENTER
# Handle
handle_box = slide.shapes.add_textbox(
Inches(0.5), Inches(6.3),
Inches(6.5), Inches(0.8)
)
tf = handle_box.text_frame
p = tf.paragraphs[0]
p.text = HANDLE
p.font.name = BRAND_HEADING_FONT
p.font.size = Pt(20)
p.font.color.rgb = hex_to_rgb(BRAND_TEXT_SECONDARY)
p.alignment = PP_ALIGN.CENTER
# Save
output = Path("carousel-cta-slide.pptx")
prs.save(output)
print(f"Created {output}")
if __name__ == "__main__":
main()
#!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "python-pptx==1.0.2",
# ]
# ///
# /// layout
# name = "carousel-hook-slide"
# format = "carousel"
# dimensions = "square"
# purpose = "Opening slide to grab attention - the scroll-stopper"
# best_for = [
# "First slide of any carousel",
# "Bold provocative statements",
# "Questions that create curiosity",
# "Controversial or surprising claims",
# ]
# avoid_when = [
# "Middle of carousel - use single-point-slide instead",
# "Long explanatory text - save that for body slides",
# "Multiple points - this is ONE hook only",
# ]
# hook_max_chars = 50
# instructions = [
# "Hook text should be SHORT and PUNCHY - max 50 characters",
# "Use confrontational or curiosity-driven language",
# "Subtext is optional - only if it adds value",
# "This slide makes people stop scrolling",
# ]
# ///
"""
LAYOUT: Carousel Hook Slide
PURPOSE: Opening slide that stops the scroll - bold statement or question
FORMAT: Square (1:1) for LinkedIn carousels
CUSTOMIZE:
- BRAND_* colors and fonts
- HOOK_TEXT: The attention-grabbing statement (max 50 chars)
- SUBTEXT: Optional supporting line
"""
from pathlib import Path
from pptx import Presentation
from pptx.dml.color import RGBColor
from pptx.enum.shapes import MSO_SHAPE
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.util import Inches, Pt
def hex_to_rgb(hex_color: str) -> RGBColor:
h = hex_color.lstrip("#")
return RGBColor(int(h[0:2], 16), int(h[2:4], 16), int(h[4:6], 16))
def main() -> None:
# === BRAND COLORS ===
BRAND_BG = "1e1e2e"
BRAND_TEXT = "cdd6f4"
BRAND_TEXT_SECONDARY = "bac2de"
BRAND_ACCENT = "fab387"
BRAND_HEADING_FONT = "JetBrains Mono"
BRAND_BODY_FONT = "Inter"
# === CONTENT ===
HOOK_TEXT = "REPLACE" # Max 50 chars, punchy
SUBTEXT = "" # Optional
# === SLIDE SETUP (Square 1:1) ===
prs = Presentation()
prs.slide_width = Inches(7.5)
prs.slide_height = Inches(7.5)
slide = prs.slides.add_slide(prs.slide_layouts[6])
# Background
slide.background.fill.solid()
slide.background.fill.fore_color.rgb = hex_to_rgb(BRAND_BG)
# Top accent bar
top_bar = slide.shapes.add_shape(
MSO_SHAPE.RECTANGLE,
Inches(0), Inches(0),
Inches(7.5), Inches(0.15)
)
top_bar.fill.solid()
top_bar.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT)
top_bar.line.fill.background()
# Large hook text - centered vertically
hook_box = slide.shapes.add_textbox(
Inches(0.5), Inches(2.5),
Inches(6.5), Inches(2.5)
)
tf = hook_box.text_frame
tf.word_wrap = True
p = tf.paragraphs[0]
p.text = HOOK_TEXT
p.font.name = BRAND_HEADING_FONT
p.font.size = Pt(48)
p.font.bold = True
p.font.color.rgb = hex_to_rgb(BRAND_TEXT)
p.alignment = PP_ALIGN.CENTER
# Optional subtext
if SUBTEXT:
sub_box = slide.shapes.add_textbox(
Inches(0.5), Inches(5.2),
Inches(6.5), Inches(1.0)
)
tf = sub_box.text_frame
tf.word_wrap = True
p = tf.paragraphs[0]
p.text = SUBTEXT
p.font.name = BRAND_BODY_FONT
p.font.size = Pt(24)
p.font.color.rgb = hex_to_rgb(BRAND_TEXT_SECONDARY)
p.alignment = PP_ALIGN.CENTER
# Bottom accent line
bottom_line = slide.shapes.add_shape(
MSO_SHAPE.RECTANGLE,
Inches(2.5), Inches(6.8),
Inches(2.5), Inches(0.06)
)
bottom_line.fill.solid()
bottom_line.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT)
bottom_line.line.fill.background()
# Save
output = Path("carousel-hook-slide.pptx")
prs.save(output)
print(f"Created {output}")
if __name__ == "__main__":
main()
#!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "python-pptx==1.0.2",
# ]
# ///
# /// layout
# name = "carousel-numbered-point-slide"
# format = "carousel"
# dimensions = "square"
# purpose = "Numbered list item with big number - for listicle carousels"
# best_for = [
# "Listicle content (5 tips, 7 mistakes, etc.)",
# "Step-by-step processes",
# "Ranked items",
# "Sequential content where order matters",
# ]
# avoid_when = [
# "Standalone points without sequence - use single-point-slide",
# "First slide - use hook-slide with the list premise",
# "Last slide - use cta-slide",
# ]
# point_text_max_chars = 60
# supporting_max_chars = 100
# instructions = [
# "NUMBER should be the position (1, 2, 3, etc.)",
# "POINT_TEXT is the main content - max 60 chars",
# "SUPPORTING_TEXT is optional explanation - max 100 chars",
# "Keep consistent numbering style across carousel",
# ]
# ///
"""
LAYOUT: Carousel Numbered Point Slide
PURPOSE: Single numbered item from a list - big number with point
FORMAT: Square (1:1) for LinkedIn carousels
CUSTOMIZE:
- BRAND_* colors and fonts
- NUMBER: The list position (1, 2, 3, etc.)
- POINT_TEXT: The main point (max 60 chars)
- SUPPORTING_TEXT: Optional explanation (max 100 chars)
"""
from pathlib import Path
from pptx import Presentation
from pptx.dml.color import RGBColor
from pptx.enum.shapes import MSO_SHAPE
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.util import Inches, Pt
def hex_to_rgb(hex_color: str) -> RGBColor:
h = hex_color.lstrip("#")
return RGBColor(int(h[0:2], 16), int(h[2:4], 16), int(h[4:6], 16))
def main() -> None:
# === BRAND COLORS ===
BRAND_BG = "1e1e2e"
BRAND_BG_ALT = "181825"
BRAND_TEXT = "cdd6f4"
BRAND_TEXT_SECONDARY = "bac2de"
BRAND_ACCENT = "fab387"
BRAND_HEADING_FONT = "JetBrains Mono"
BRAND_BODY_FONT = "Inter"
# === CONTENT ===
NUMBER = "1" # Position in list
POINT_TEXT = "REPLACE" # Max 60 chars
SUPPORTING_TEXT = "" # Optional, max 100 chars
# === SLIDE SETUP (Square 1:1) ===
prs = Presentation()
prs.slide_width = Inches(7.5)
prs.slide_height = Inches(7.5)
slide = prs.slides.add_slide(prs.slide_layouts[6])
# Background
slide.background.fill.solid()
slide.background.fill.fore_color.rgb = hex_to_rgb(BRAND_BG)
# Number block (left side)
num_block = slide.shapes.add_shape(
MSO_SHAPE.RECTANGLE,
Inches(0), Inches(0),
Inches(2.5), Inches(7.5)
)
num_block.fill.solid()
num_block.fill.fore_color.rgb = hex_to_rgb(BRAND_BG_ALT)
num_block.line.fill.background()
# Big number
num_box = slide.shapes.add_textbox(
Inches(0), Inches(2.5),
Inches(2.5), Inches(2.5)
)
p = num_box.text_frame.paragraphs[0]
p.text = NUMBER
p.font.name = BRAND_HEADING_FONT
p.font.size = Pt(120)
p.font.bold = True
p.font.color.rgb = hex_to_rgb(BRAND_ACCENT)
p.alignment = PP_ALIGN.CENTER
# Accent divider
divider = slide.shapes.add_shape(
MSO_SHAPE.RECTANGLE,
Inches(2.5), Inches(1.5),
Inches(0.08), Inches(4.5)
)
divider.fill.solid()
divider.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT)
divider.line.fill.background()
# Point text
point_box = slide.shapes.add_textbox(
Inches(3.0), Inches(2.2),
Inches(4.0), Inches(2.5)
)
tf = point_box.text_frame
tf.word_wrap = True
p = tf.paragraphs[0]
p.text = POINT_TEXT
p.font.name = BRAND_HEADING_FONT
p.font.size = Pt(32)
p.font.bold = True
p.font.color.rgb = hex_to_rgb(BRAND_TEXT)
# Supporting text
if SUPPORTING_TEXT:
support_box = slide.shapes.add_textbox(
Inches(3.0), Inches(4.8),
Inches(4.0), Inches(2.0)
)
tf = support_box.text_frame
tf.word_wrap = True
p = tf.paragraphs[0]
p.text = SUPPORTING_TEXT
p.font.name = BRAND_BODY_FONT
p.font.size = Pt(20)
p.font.color.rgb = hex_to_rgb(BRAND_TEXT_SECONDARY)
# Save
output = Path("carousel-numbered-point-slide.pptx")
prs.save(output)
print(f"Created {output}")
if __name__ == "__main__":
main()
#!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "python-pptx==1.0.2",
# ]
# ///
# /// layout
# name = "carousel-quote-slide"
# format = "carousel"
# dimensions = "square"
# purpose = "Quote with attribution - for social proof or memorable statements"
# best_for = [
# "Social proof from customers or experts",
# "Memorable statements worth highlighting",
# "Your own quotable insights",
# "Breaking up content with a different format",
# ]
# avoid_when = [
# "Long quotes over 120 characters - paraphrase instead",
# "Quotes that need context - add context in previous slide",
# "First slide - use hook-slide instead",
# ]
# quote_max_chars = 120
# attribution_max_chars = 40
# instructions = [
# "Quote should be IMPACTFUL and max 120 characters",
# "Attribution is optional but recommended for credibility",
# "Use quotation marks in the design, not the text",
# "If it's your own quote, attribution can be your handle",
# ]
# ///
"""
LAYOUT: Carousel Quote Slide
PURPOSE: Featured quote with attribution
FORMAT: Square (1:1) for LinkedIn carousels
CUSTOMIZE:
- BRAND_* colors and fonts
- QUOTE_TEXT: The quote (max 120 chars, no quotation marks)
- ATTRIBUTION: Who said it (max 40 chars, optional)
"""
from pathlib import Path
from pptx import Presentation
from pptx.dml.color import RGBColor
from pptx.enum.shapes import MSO_SHAPE
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.util import Inches, Pt
def hex_to_rgb(hex_color: str) -> RGBColor:
h = hex_color.lstrip("#")
return RGBColor(int(h[0:2], 16), int(h[2:4], 16), int(h[4:6], 16))
def main() -> None:
# === BRAND COLORS ===
BRAND_BG = "1e1e2e"
BRAND_TEXT = "cdd6f4"
BRAND_TEXT_SECONDARY = "bac2de"
BRAND_ACCENT = "fab387"
BRAND_ACCENT_SECONDARY = "89b4fa"
BRAND_HEADING_FONT = "JetBrains Mono"
BRAND_BODY_FONT = "Inter"
# === CONTENT ===
QUOTE_TEXT = "REPLACE" # Max 120 chars, no quotation marks
ATTRIBUTION = "" # Optional, max 40 chars
# === SLIDE SETUP (Square 1:1) ===
prs = Presentation()
prs.slide_width = Inches(7.5)
prs.slide_height = Inches(7.5)
slide = prs.slides.add_slide(prs.slide_layouts[6])
# Background
slide.background.fill.solid()
slide.background.fill.fore_color.rgb = hex_to_rgb(BRAND_BG)
# Large opening quote mark
open_quote = slide.shapes.add_textbox(
Inches(0.3), Inches(1.0),
Inches(2.0), Inches(2.0)
)
p = open_quote.text_frame.paragraphs[0]
p.text = """
p.font.name = BRAND_HEADING_FONT
p.font.size = Pt(180)
p.font.bold = True
p.font.color.rgb = hex_to_rgb(BRAND_ACCENT)
# Quote text
quote_box = slide.shapes.add_textbox(
Inches(0.5), Inches(2.5),
Inches(6.5), Inches(3.0)
)
tf = quote_box.text_frame
tf.word_wrap = True
p = tf.paragraphs[0]
p.text = QUOTE_TEXT
p.font.name = BRAND_BODY_FONT
p.font.size = Pt(28)
p.font.italic = True
p.font.color.rgb = hex_to_rgb(BRAND_TEXT)
p.alignment = PP_ALIGN.CENTER
# Attribution
if ATTRIBUTION:
attr_box = slide.shapes.add_textbox(
Inches(0.5), Inches(5.8),
Inches(6.5), Inches(0.8)
)
tf = attr_box.text_frame
p = tf.paragraphs[0]
p.text = f"— {ATTRIBUTION}"
p.font.name = BRAND_HEADING_FONT
p.font.size = Pt(18)
p.font.color.rgb = hex_to_rgb(BRAND_ACCENT_SECONDARY)
p.alignment = PP_ALIGN.CENTER
# Bottom accent line
bottom_line = slide.shapes.add_shape(
MSO_SHAPE.RECTANGLE,
Inches(2.5), Inches(6.8),
Inches(2.5), Inches(0.06)
)
bottom_line.fill.solid()
bottom_line.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT)
bottom_line.line.fill.background()
# Save
output = Path("carousel-quote-slide.pptx")
prs.save(output)
print(f"Created {output}")
if __name__ == "__main__":
main()
#!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "python-pptx==1.0.2",
# ]
# ///
# /// layout
# name = "carousel-single-point-slide"
# format = "carousel"
# dimensions = "square"
# purpose = "One key point with supporting text - the workhorse slide"
# best_for = [
# "Main content slides in carousel body",
# "Single concept that needs explanation",
# "Key takeaways or insights",
# "Standalone valuable points",
# ]
# avoid_when = [
# "First slide - use hook-slide instead",
# "Last slide - use cta-slide instead",
# "Numbered lists - use numbered-point-slide instead",
# "Quotes - use quote-slide instead",
# ]
# headline_max_chars = 40
# body_max_chars = 150
# instructions = [
# "Headline should be the KEY POINT in 40 chars or less",
# "Body text expands on the headline - max 150 chars",
# "One idea per slide - if you have multiple, split them",
# "Make headline readable at thumbnail size",
# ]
# ///
"""
LAYOUT: Carousel Single Point Slide
PURPOSE: One key point with supporting explanation
FORMAT: Square (1:1) for LinkedIn carousels
CUSTOMIZE:
- BRAND_* colors and fonts
- HEADLINE: The main point (max 40 chars)
- BODY_TEXT: Supporting explanation (max 150 chars)
"""
from pathlib import Path
from pptx import Presentation
from pptx.dml.color import RGBColor
from pptx.enum.shapes import MSO_SHAPE
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.util import Inches, Pt
def hex_to_rgb(hex_color: str) -> RGBColor:
h = hex_color.lstrip("#")
return RGBColor(int(h[0:2], 16), int(h[2:4], 16), int(h[4:6], 16))
def main() -> None:
# === BRAND COLORS ===
BRAND_BG = "1e1e2e"
BRAND_TEXT = "cdd6f4"
BRAND_TEXT_SECONDARY = "bac2de"
BRAND_ACCENT = "fab387"
BRAND_HEADING_FONT = "JetBrains Mono"
BRAND_BODY_FONT = "Inter"
# === CONTENT ===
HEADLINE = "REPLACE" # Max 40 chars
BODY_TEXT = "REPLACE" # Max 150 chars
# === SLIDE SETUP (Square 1:1) ===
prs = Presentation()
prs.slide_width = Inches(7.5)
prs.slide_height = Inches(7.5)
slide = prs.slides.add_slide(prs.slide_layouts[6])
# Background
slide.background.fill.solid()
slide.background.fill.fore_color.rgb = hex_to_rgb(BRAND_BG)
# Left accent bar
left_bar = slide.shapes.add_shape(
MSO_SHAPE.RECTANGLE,
Inches(0), Inches(0),
Inches(0.1), Inches(7.5)
)
left_bar.fill.solid()
left_bar.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT)
left_bar.line.fill.background()
# Headline
headline_box = slide.shapes.add_textbox(
Inches(0.5), Inches(2.0),
Inches(6.5), Inches(2.0)
)
tf = headline_box.text_frame
tf.word_wrap = True
p = tf.paragraphs[0]
p.text = HEADLINE
p.font.name = BRAND_HEADING_FONT
p.font.size = Pt(40)
p.font.bold = True
p.font.color.rgb = hex_to_rgb(BRAND_TEXT)
# Accent underline
underline = slide.shapes.add_shape(
MSO_SHAPE.RECTANGLE,
Inches(0.5), Inches(4.1),
Inches(2.0), Inches(0.06)
)
underline.fill.solid()
underline.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT)
underline.line.fill.background()
# Body text
body_box = slide.shapes.add_textbox(
Inches(0.5), Inches(4.5),
Inches(6.5), Inches(2.5)
)
tf = body_box.text_frame
tf.word_wrap = True
p = tf.paragraphs[0]
p.text = BODY_TEXT
p.font.name = BRAND_BODY_FONT
p.font.size = Pt(24)
p.font.color.rgb = hex_to_rgb(BRAND_TEXT_SECONDARY)
# Save
output = Path("carousel-single-point-slide.pptx")
prs.save(output)
print(f"Created {output}")
if __name__ == "__main__":
main()
#!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "python-pptx==1.0.2",
# ]
# ///
# /// layout
# name = "chart-slide"
# purpose = "Data visualization, metrics breakdown, distribution charts"
# best_for = [
# "Showing data distribution (pie/doughnut)",
# "Comparing categories (bar/column)",
# "Visualizing survey results",
# "Budget or resource allocation",
# ]
# avoid_when = [
# "More than 6 data categories - simplify first",
# "Trend over time - consider line chart (not in template)",
# "Exact numbers matter more than visual - use stats-slide",
# ]
# chart_types = ["pie", "bar", "column", "doughnut"]
# max_categories = 6
# instructions = [
# "Chart types: 'pie', 'bar', 'column', or 'doughnut'",
# "Keep to 3-6 categories for readability",
# "INSIGHT box on right explains the key takeaway",
# "Title should explain what the data represents",
# "Chart uses PowerPoint default theme colors",
# ]
# ///
"""
LAYOUT: Chart Slide
PURPOSE: Data visualization, metrics breakdown, distribution charts
CUSTOMIZE:
- BRAND_* colors and fonts
- TITLE: What the data shows
- CHART_TYPE: "pie", "bar", "column", "doughnut"
- CHART_DATA: List of (category, value) tuples
- INSIGHT: Key takeaway from the data
"""
from pathlib import Path
from pptx import Presentation
from pptx.chart.data import CategoryChartData
from pptx.dml.color import RGBColor
from pptx.enum.chart import XL_CHART_TYPE, XL_LEGEND_POSITION
from pptx.enum.shapes import MSO_SHAPE
from pptx.enum.text import PP_ALIGN
from pptx.util import Inches, Pt
def hex_to_rgb(hex_color: str) -> RGBColor:
h = hex_color.lstrip("#")
return RGBColor(int(h[0:2], 16), int(h[2:4], 16), int(h[4:6], 16))
def main() -> None:
# === BRAND COLORS (get from brands/{name}/brand-system.md) ===
BRAND_BG = "REPLACE" # background color
BRAND_TEXT = "REPLACE" # primary text color
BRAND_TEXT_SECONDARY = "REPLACE" # secondary/muted text color
BRAND_ACCENT = "REPLACE" # accent color
BRAND_HEADING_FONT = "REPLACE" # heading font name
BRAND_BODY_FONT = "REPLACE" # body font name
# === CONTENT (from user request, written in brand voice) ===
TITLE = "REPLACE" # what the data shows
CHART_TYPE = "REPLACE" # "pie", "bar", "column", or "doughnut"
CHART_DATA = [
("REPLACE", 0), # (category, value) tuples
("REPLACE", 0),
("REPLACE", 0),
("REPLACE", 0),
]
INSIGHT = "REPLACE" # key takeaway from the data
# === SLIDE SETUP ===
prs = Presentation()
prs.slide_width = Inches(13.333)
prs.slide_height = Inches(7.5)
slide = prs.slides.add_slide(prs.slide_layouts[6])
# Background
slide.background.fill.solid()
slide.background.fill.fore_color.rgb = hex_to_rgb(BRAND_BG)
# Title
title_box = slide.shapes.add_textbox(
Inches(0.5), Inches(0.4),
Inches(12.333), Inches(0.8)
)
p = title_box.text_frame.paragraphs[0]
p.text = TITLE
p.font.name = BRAND_HEADING_FONT
p.font.size = Pt(36)
p.font.bold = True
p.font.color.rgb = hex_to_rgb(BRAND_TEXT)
# Accent underline
underline = slide.shapes.add_shape(
MSO_SHAPE.RECTANGLE,
Inches(0.5), Inches(1.2),
Inches(2.0), Inches(0.06)
)
underline.fill.solid()
underline.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT)
underline.line.fill.background()
# Prepare chart data
chart_data = CategoryChartData()
chart_data.categories = [item[0] for item in CHART_DATA]
chart_data.add_series("Values", [item[1] for item in CHART_DATA])
# Determine chart type
chart_types = {
"pie": XL_CHART_TYPE.PIE,
"bar": XL_CHART_TYPE.BAR_CLUSTERED,
"column": XL_CHART_TYPE.COLUMN_CLUSTERED,
"doughnut": XL_CHART_TYPE.DOUGHNUT,
}
xl_chart_type = chart_types.get(CHART_TYPE, XL_CHART_TYPE.PIE)
# Add chart
chart_left = Inches(0.5)
chart_top = Inches(1.8)
chart_width = Inches(7.5)
chart_height = Inches(5.0)
chart_shape = slide.shapes.add_chart(
xl_chart_type, chart_left, chart_top, chart_width, chart_height, chart_data
)
chart = chart_shape.chart
# Style the chart
chart.has_legend = True
chart.legend.position = XL_LEGEND_POSITION.RIGHT
chart.legend.include_in_layout = False
# Note: Full chart styling (colors, fonts) requires more complex XML manipulation
# The chart will use PowerPoint's default theme colors
# Insight box (right side)
insight_bg = slide.shapes.add_shape(
MSO_SHAPE.ROUNDED_RECTANGLE,
Inches(8.5), Inches(2.5),
Inches(4.3), Inches(2.5)
)
insight_bg.fill.solid()
insight_bg.fill.fore_color.rgb = hex_to_rgb("313244")
insight_bg.line.fill.background()
# Insight label
insight_label = slide.shapes.add_textbox(
Inches(8.8), Inches(2.7),
Inches(3.7), Inches(0.5)
)
p = insight_label.text_frame.paragraphs[0]
p.text = "KEY INSIGHT"
p.font.name = BRAND_HEADING_FONT
p.font.size = Pt(12)
p.font.bold = True
p.font.color.rgb = hex_to_rgb(BRAND_ACCENT)
# Insight text
insight_box = slide.shapes.add_textbox(
Inches(8.8), Inches(3.2),
Inches(3.7), Inches(1.5)
)
tf = insight_box.text_frame
tf.word_wrap = True
p = tf.paragraphs[0]
p.text = INSIGHT
p.font.name = BRAND_BODY_FONT
p.font.size = Pt(18)
p.font.color.rgb = hex_to_rgb(BRAND_TEXT)
# Bottom accent bar
bottom_bar = slide.shapes.add_shape(
MSO_SHAPE.RECTANGLE,
Inches(0), Inches(7.35),
Inches(13.333), Inches(0.15)
)
bottom_bar.fill.solid()
bottom_bar.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT)
bottom_bar.line.fill.background()
# Save
output = Path("chart-slide.pptx")
prs.save(output)
print(f"Created {output}")
if __name__ == "__main__":
main()
#!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "python-pptx==1.0.2",
# ]
# ///
# /// layout
# name = "circular-hero-slide"
# purpose = "Central concept, core idea, focus point with surrounding context"
# best_for = [
# "Core concept with 4-6 related aspects",
# "Hub-and-spoke relationships",
# "Central theme with supporting elements",
# "Ecosystem or component overview",
# ]
# avoid_when = [
# "Items are sequential (use process/timeline instead)",
# "More than 6 surrounding items",
# "Center concept needs long text",
# ]
# min_surrounding_items = 4
# max_surrounding_items = 6
# instructions = [
# "Center text should be 1-2 words maximum",
# "Surrounding items are positioned in a circle - keep them short",
# "4-6 surrounding items work best for visual balance",
# "All items should relate to the central concept",
# "Subtitle under center text is optional",
# ]
# ///
"""
LAYOUT: Circular Hero
PURPOSE: Central concept, core idea, focus point with surrounding context
CUSTOMIZE:
- BRAND_* colors and fonts
- CENTER_TEXT: Word or short phrase in the circle
- SURROUNDING_ITEMS: List of related concepts around the circle (4-6 items)
"""
from pathlib import Path
import math
from pptx import Presentation
from pptx.dml.color import RGBColor
from pptx.enum.shapes import MSO_SHAPE
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.util import Inches, Pt
def hex_to_rgb(hex_color: str) -> RGBColor:
h = hex_color.lstrip("#")
return RGBColor(int(h[0:2], 16), int(h[2:4], 16), int(h[4:6], 16))
def main() -> None:
# === BRAND COLORS (get from brands/{name}/brand-system.md) ===
BRAND_BG = "REPLACE" # background color
BRAND_TEXT = "REPLACE" # primary text color
BRAND_TEXT_SECONDARY = "REPLACE" # secondary/muted text color
BRAND_ACCENT = "REPLACE" # accent color (for main circle)
BRAND_ACCENT_SECONDARY = "REPLACE" # secondary accent (for surrounding dots)
BRAND_HEADING_FONT = "REPLACE" # heading font name
BRAND_BODY_FONT = "REPLACE" # body font name
# === CONTENT (from user request, written in brand voice) ===
CENTER_TEXT = "REPLACE" # word or short phrase in the circle
SUBTITLE = "REPLACE" # subtitle below center text
SURROUNDING_ITEMS = [
"REPLACE", # related concepts around the circle (4-6 items)
"REPLACE",
"REPLACE",
"REPLACE",
"REPLACE",
"REPLACE",
]
# === SLIDE SETUP ===
prs = Presentation()
prs.slide_width = Inches(13.333)
prs.slide_height = Inches(7.5)
slide = prs.slides.add_slide(prs.slide_layouts[6])
# Background
slide.background.fill.solid()
slide.background.fill.fore_color.rgb = hex_to_rgb(BRAND_BG)
# Center coordinates
center_x = 6.666 # Middle of slide
center_y = 3.75 # Middle of slide
# Outer ring (subtle)
outer_ring = slide.shapes.add_shape(
MSO_SHAPE.OVAL,
Inches(center_x - 3.2), Inches(center_y - 3.2),
Inches(6.4), Inches(6.4)
)
outer_ring.fill.background()
outer_ring.line.color.rgb = hex_to_rgb("313244")
outer_ring.line.width = Pt(2)
# Main circle
circle_size = 3.5
main_circle = slide.shapes.add_shape(
MSO_SHAPE.OVAL,
Inches(center_x - circle_size/2), Inches(center_y - circle_size/2),
Inches(circle_size), Inches(circle_size)
)
main_circle.fill.solid()
main_circle.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT)
main_circle.line.fill.background()
# Center text
center_box = slide.shapes.add_textbox(
Inches(center_x - 1.75), Inches(center_y - 0.6),
Inches(3.5), Inches(1.0)
)
tf = center_box.text_frame
p = tf.paragraphs[0]
p.text = CENTER_TEXT
p.font.name = BRAND_HEADING_FONT
p.font.size = Pt(48)
p.font.bold = True
p.font.color.rgb = hex_to_rgb(BRAND_BG)
p.alignment = PP_ALIGN.CENTER
# Subtitle below center
subtitle_box = slide.shapes.add_textbox(
Inches(center_x - 2), Inches(center_y + 0.4),
Inches(4), Inches(0.5)
)
p = subtitle_box.text_frame.paragraphs[0]
p.text = SUBTITLE
p.font.name = BRAND_BODY_FONT
p.font.size = Pt(14)
p.font.color.rgb = hex_to_rgb(BRAND_BG)
p.alignment = PP_ALIGN.CENTER
# Surrounding items positioned in a circle
num_items = len(SURROUNDING_ITEMS)
radius = 3.0 # Distance from center
for i, item in enumerate(SURROUNDING_ITEMS):
# Calculate position on circle
angle = (2 * math.pi * i / num_items) - math.pi / 2 # Start from top
item_x = center_x + radius * math.cos(angle)
item_y = center_y + radius * math.sin(angle)
# Small accent dot
dot = slide.shapes.add_shape(
MSO_SHAPE.OVAL,
Inches(item_x - 0.1), Inches(item_y - 0.1),
Inches(0.2), Inches(0.2)
)
dot.fill.solid()
dot.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT_SECONDARY)
dot.line.fill.background()
# Item text - positioned based on which side of circle
text_width = 1.8
if item_x < center_x - 1:
text_x = item_x - text_width - 0.2
align = PP_ALIGN.RIGHT
elif item_x > center_x + 1:
text_x = item_x + 0.3
align = PP_ALIGN.LEFT
else:
text_x = item_x - text_width / 2
align = PP_ALIGN.CENTER
text_y = item_y - 0.2 if item_y < center_y else item_y - 0.1
item_box = slide.shapes.add_textbox(
Inches(text_x), Inches(text_y),
Inches(text_width), Inches(0.5)
)
p = item_box.text_frame.paragraphs[0]
p.text = item
p.font.name = BRAND_BODY_FONT
p.font.size = Pt(16)
p.font.bold = True
p.font.color.rgb = hex_to_rgb(BRAND_TEXT)
p.alignment = align
# Save
output = Path("circular-hero-slide.pptx")
prs.save(output)
print(f"Created {output}")
if __name__ == "__main__":
main()
#!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "python-pptx==1.0.2",
# ]
# ///
# /// layout
# name = "closing-slide"
# purpose = "Final slide, call to action, contact info, thank you, next steps"
# best_for = [
# "Presentation ending",
# "Call to action",
# "Contact information",
# "Next steps or resources",
# "Q&A slide",
# ]
# avoid_when = [
# "Not the final slide - use title-slide instead",
# "Need detailed content - this is for impact, not information",
# ]
# max_cta_items = 4
# instructions = [
# "Headline should be actionable or memorable",
# "CTA items are optional - use for next steps or resources",
# "Subtext is for URL, email, or social handle",
# "Keep it simple - this is the lasting impression",
# ]
# ///
"""
LAYOUT: Closing/CTA Slide
PURPOSE: Final slide, call to action, contact info, thank you, next steps
CUSTOMIZE:
- BRAND_* colors and fonts
- HEADLINE: The takeaway or CTA (e.g., "Start Building Today", "Questions?")
- SUBTEXT: Supporting info (e.g., URL, email, social handle)
- CTA_ITEMS: Optional list of next steps or resources
"""
from pathlib import Path
from pptx import Presentation
from pptx.dml.color import RGBColor
from pptx.enum.shapes import MSO_SHAPE
from pptx.enum.text import PP_ALIGN
from pptx.util import Inches, Pt
def hex_to_rgb(hex_color: str) -> RGBColor:
h = hex_color.lstrip("#")
return RGBColor(int(h[0:2], 16), int(h[2:4], 16), int(h[4:6], 16))
def main() -> None:
# === BRAND COLORS (get from brands/{name}/brand-system.md) ===
BRAND_BG = "REPLACE" # background color
BRAND_BG_ALT = "REPLACE" # slightly darker variant for contrast
BRAND_TEXT = "REPLACE" # primary text color
BRAND_TEXT_SECONDARY = "REPLACE" # secondary/muted text color
BRAND_ACCENT = "REPLACE" # accent color
BRAND_HEADING_FONT = "REPLACE" # heading font name
BRAND_BODY_FONT = "REPLACE" # body font name
# === CONTENT (from user request, written in brand voice) ===
HEADLINE = "REPLACE" # takeaway or CTA (e.g., "Start Building Today")
SUBTEXT = "REPLACE" # URL, email, or social handle
CTA_ITEMS = [
"REPLACE", # next steps or resources (2-4 items)
"REPLACE",
"REPLACE",
]
# === SLIDE SETUP ===
prs = Presentation()
prs.slide_width = Inches(13.333)
prs.slide_height = Inches(7.5)
slide = prs.slides.add_slide(prs.slide_layouts[6])
# Background
slide.background.fill.solid()
slide.background.fill.fore_color.rgb = hex_to_rgb(BRAND_BG)
# Large accent gradient-like block (bottom portion)
bottom_block = slide.shapes.add_shape(
MSO_SHAPE.RECTANGLE,
Inches(0), Inches(5.0),
Inches(13.333), Inches(2.5)
)
bottom_block.fill.solid()
bottom_block.fill.fore_color.rgb = hex_to_rgb(BRAND_BG_ALT)
bottom_block.line.fill.background()
# Top accent bar
top_bar = slide.shapes.add_shape(
MSO_SHAPE.RECTANGLE,
Inches(0), Inches(0),
Inches(13.333), Inches(0.12)
)
top_bar.fill.solid()
top_bar.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT)
top_bar.line.fill.background()
# Large headline - centered
headline_box = slide.shapes.add_textbox(
Inches(0.5), Inches(2.0),
Inches(12.33), Inches(1.5)
)
tf = headline_box.text_frame
tf.word_wrap = True
p = tf.paragraphs[0]
p.text = HEADLINE
p.font.name = BRAND_HEADING_FONT
p.font.size = Pt(56)
p.font.bold = True
p.font.color.rgb = hex_to_rgb(BRAND_TEXT)
p.alignment = PP_ALIGN.CENTER
# Accent underline below headline
underline = slide.shapes.add_shape(
MSO_SHAPE.RECTANGLE,
Inches(5.5), Inches(3.6),
Inches(2.33), Inches(0.08)
)
underline.fill.solid()
underline.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT)
underline.line.fill.background()
# CTA Items (horizontal layout in bottom section)
if CTA_ITEMS:
num_items = len(CTA_ITEMS)
item_width = 12.0 / num_items
start_x = 0.66
for i, item in enumerate(CTA_ITEMS):
x_pos = start_x + (i * item_width)
# Number badge
badge = slide.shapes.add_shape(
MSO_SHAPE.OVAL,
Inches(x_pos + (item_width / 2) - 0.25), Inches(5.3),
Inches(0.5), Inches(0.5)
)
badge.fill.solid()
badge.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT)
badge.line.fill.background()
badge_text = slide.shapes.add_textbox(
Inches(x_pos + (item_width / 2) - 0.25), Inches(5.35),
Inches(0.5), Inches(0.5)
)
p = badge_text.text_frame.paragraphs[0]
p.text = str(i + 1)
p.font.name = BRAND_HEADING_FONT
p.font.size = Pt(16)
p.font.bold = True
p.font.color.rgb = hex_to_rgb(BRAND_BG)
p.alignment = PP_ALIGN.CENTER
# Item text
item_box = slide.shapes.add_textbox(
Inches(x_pos), Inches(5.95),
Inches(item_width), Inches(0.8)
)
tf = item_box.text_frame
tf.word_wrap = True
p = tf.paragraphs[0]
p.text = item
p.font.name = BRAND_BODY_FONT
p.font.size = Pt(18)
p.font.color.rgb = hex_to_rgb(BRAND_TEXT)
p.alignment = PP_ALIGN.CENTER
# Subtext (URL/contact) - bottom center
if SUBTEXT:
subtext_box = slide.shapes.add_textbox(
Inches(0.5), Inches(7.0),
Inches(12.33), Inches(0.4)
)
p = subtext_box.text_frame.paragraphs[0]
p.text = SUBTEXT
p.font.name = BRAND_HEADING_FONT
p.font.size = Pt(14)
p.font.color.rgb = hex_to_rgb(BRAND_ACCENT)
p.alignment = PP_ALIGN.CENTER
# Save
output = Path("closing-slide.pptx")
prs.save(output)
print(f"Created {output}")
if __name__ == "__main__":
main()
#!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "python-pptx==1.0.2",
# ]
# ///
# /// layout
# name = "code-slide"
# purpose = "Display code snippets, terminal output, configuration examples"
# best_for = [
# "Showing code examples",
# "Terminal/CLI output",
# "Configuration snippets",
# "API request/response examples",
# ]
# avoid_when = [
# "Code is longer than 12 lines - split into multiple slides",
# "Code needs syntax highlighting (consider screenshot instead)",
# "Audience won't understand code - use pseudocode in content-slide",
# ]
# max_lines = 12
# instructions = [
# "Keep code to 5-12 lines - less is better for readability",
# "Include language label badge (Python, TypeScript, etc.)",
# "Use caption to explain what the code does or key insight",
# "Remove unnecessary comments/whitespace to save space",
# "If code is complex, highlight the important part only",
# ]
# ///
"""
LAYOUT: Code Slide
PURPOSE: Display code snippets, terminal output, configuration examples
CUSTOMIZE:
- BRAND_* colors and fonts
- TITLE: What the code demonstrates
- CODE_CONTENT: The actual code (keep it short, 5-12 lines ideal)
- LANGUAGE_LABEL: Optional language badge (e.g., "Python", "TypeScript")
- CAPTION: Optional explanation below code
"""
from pathlib import Path
from pptx import Presentation
from pptx.dml.color import RGBColor
from pptx.enum.shapes import MSO_SHAPE
from pptx.enum.text import PP_ALIGN
from pptx.util import Inches, Pt
def hex_to_rgb(hex_color: str) -> RGBColor:
h = hex_color.lstrip("#")
return RGBColor(int(h[0:2], 16), int(h[2:4], 16), int(h[4:6], 16))
def main() -> None:
# === BRAND COLORS (get from brands/{name}/brand-system.md) ===
BRAND_BG = "REPLACE" # background color
BRAND_TEXT = "REPLACE" # primary text color
BRAND_TEXT_SECONDARY = "REPLACE" # secondary/muted text color
BRAND_ACCENT = "REPLACE" # accent color
BRAND_ACCENT_SECONDARY = "REPLACE" # secondary accent (for code block)
BRAND_CODE_BG = "REPLACE" # darker color for code block bg
BRAND_HEADING_FONT = "REPLACE" # heading font name
BRAND_BODY_FONT = "REPLACE" # body font name
BRAND_CODE_FONT = "REPLACE" # monospace font for code
# === CONTENT (from user request) ===
TITLE = "REPLACE" # what the code demonstrates
LANGUAGE_LABEL = "REPLACE" # e.g., "Python", "TypeScript"
CODE_CONTENT = '''REPLACE''' # the actual code (5-12 lines)
CAPTION = "REPLACE" # explanation below code
# === SLIDE SETUP ===
prs = Presentation()
prs.slide_width = Inches(13.333)
prs.slide_height = Inches(7.5)
slide = prs.slides.add_slide(prs.slide_layouts[6])
# Background
slide.background.fill.solid()
slide.background.fill.fore_color.rgb = hex_to_rgb(BRAND_BG)
# Title
title_box = slide.shapes.add_textbox(
Inches(0.5), Inches(0.4),
Inches(10.0), Inches(0.8)
)
p = title_box.text_frame.paragraphs[0]
p.text = TITLE
p.font.name = BRAND_HEADING_FONT
p.font.size = Pt(32)
p.font.bold = True
p.font.color.rgb = hex_to_rgb(BRAND_TEXT)
# Language label badge (top right of code block)
if LANGUAGE_LABEL:
badge_bg = slide.shapes.add_shape(
MSO_SHAPE.ROUNDED_RECTANGLE,
Inches(11.5), Inches(1.15),
Inches(1.3), Inches(0.4)
)
badge_bg.fill.solid()
badge_bg.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT)
badge_bg.line.fill.background()
badge_text = slide.shapes.add_textbox(
Inches(11.5), Inches(1.18),
Inches(1.3), Inches(0.4)
)
p = badge_text.text_frame.paragraphs[0]
p.text = LANGUAGE_LABEL
p.font.name = BRAND_CODE_FONT
p.font.size = Pt(12)
p.font.bold = True
p.font.color.rgb = hex_to_rgb(BRAND_CODE_BG)
p.alignment = PP_ALIGN.CENTER
# Code block background (terminal-like)
code_bg = slide.shapes.add_shape(
MSO_SHAPE.ROUNDED_RECTANGLE,
Inches(0.5), Inches(1.4),
Inches(12.33), Inches(4.8)
)
code_bg.fill.solid()
code_bg.fill.fore_color.rgb = hex_to_rgb(BRAND_CODE_BG)
code_bg.line.color.rgb = hex_to_rgb("313244") # Subtle border
# Terminal chrome dots (top left of code block)
dot_colors = ["f38ba8", "f9e2af", "a6e3a1"] # Red, yellow, green
for i, color in enumerate(dot_colors):
dot = slide.shapes.add_shape(
MSO_SHAPE.OVAL,
Inches(0.8 + (i * 0.35)), Inches(1.65),
Inches(0.18), Inches(0.18)
)
dot.fill.solid()
dot.fill.fore_color.rgb = hex_to_rgb(color)
dot.line.fill.background()
# Code content
code_box = slide.shapes.add_textbox(
Inches(0.8), Inches(2.2),
Inches(11.7), Inches(3.8)
)
tf = code_box.text_frame
tf.word_wrap = False
p = tf.paragraphs[0]
p.text = CODE_CONTENT
p.font.name = BRAND_CODE_FONT
p.font.size = Pt(18)
p.font.color.rgb = hex_to_rgb(BRAND_TEXT)
p.alignment = PP_ALIGN.LEFT
# Caption below code
if CAPTION:
caption_box = slide.shapes.add_textbox(
Inches(0.5), Inches(6.4),
Inches(12.33), Inches(0.6)
)
p = caption_box.text_frame.paragraphs[0]
p.text = CAPTION
p.font.name = BRAND_BODY_FONT
p.font.size = Pt(18)
p.font.italic = True
p.font.color.rgb = hex_to_rgb(BRAND_TEXT_SECONDARY)
p.alignment = PP_ALIGN.CENTER
# Accent bar at bottom
bottom_bar = slide.shapes.add_shape(
MSO_SHAPE.RECTANGLE,
Inches(0), Inches(7.35),
Inches(13.333), Inches(0.15)
)
bottom_bar.fill.solid()
bottom_bar.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT_SECONDARY)
bottom_bar.line.fill.background()
# Save
output = Path("code-slide.pptx")
prs.save(output)
print(f"Created {output}")
if __name__ == "__main__":
main()
#!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "python-pptx==1.0.2",
# ]
# ///
# /// layout
# name = "content-slide"
# purpose = "Key points, takeaways, feature lists, explanations"
# best_for = [
# "Listing 3-6 related points",
# "Feature lists",
# "Takeaways or summaries",
# "Step-by-step instructions",
# ]
# avoid_when = [
# "More than 6 bullet points - split into multiple slides",
# "Need visual comparisons",
# "Single big idea - use title-slide or giant-focus instead",
# ]
# max_bullets = 6
# instructions = [
# "Keep bullets parallel in structure (all start with verbs, or all noun phrases)",
# "Title should describe WHAT these points prove, not 'Key Points'",
# "Each bullet should be 1-2 lines max",
# "No trailing periods on bullets unless full sentences",
# ]
# ///
"""
LAYOUT: Content Slide
PURPOSE: Key points, takeaways, feature lists, explanations
CUSTOMIZE:
- BRAND_* colors and fonts
- TITLE: What this slide proves or explains (not "Key Points")
- BULLETS: 3-6 points, parallel structure, action-oriented
"""
from pathlib import Path
from pptx import Presentation
from pptx.dml.color import RGBColor
from pptx.enum.shapes import MSO_SHAPE
from pptx.enum.text import PP_ALIGN
from pptx.util import Inches, Pt
def hex_to_rgb(hex_color: str) -> RGBColor:
h = hex_color.lstrip("#")
return RGBColor(int(h[0:2], 16), int(h[2:4], 16), int(h[4:6], 16))
def main() -> None:
# === BRAND COLORS (get from brands/{name}/brand-system.md) ===
BRAND_BG = "REPLACE" # background color
BRAND_TEXT = "REPLACE" # primary text color
BRAND_TEXT_SECONDARY = "REPLACE" # secondary/muted text color
BRAND_ACCENT = "REPLACE" # accent color
BRAND_ACCENT_SECONDARY = "REPLACE" # secondary accent color
BRAND_HEADING_FONT = "REPLACE" # heading font name
BRAND_BODY_FONT = "REPLACE" # body font name
# === CONTENT (from user request, written in brand voice) ===
TITLE = "REPLACE" # slide title
BULLETS = [
"REPLACE", # 3-6 bullet points
"REPLACE",
"REPLACE",
]
# === SLIDE SETUP ===
prs = Presentation()
prs.slide_width = Inches(13.333)
prs.slide_height = Inches(7.5)
slide = prs.slides.add_slide(prs.slide_layouts[6])
# Background
slide.background.fill.solid()
slide.background.fill.fore_color.rgb = hex_to_rgb(BRAND_BG)
# Left accent bar (vertical stripe)
left_bar = slide.shapes.add_shape(
MSO_SHAPE.RECTANGLE,
Inches(0), Inches(0),
Inches(0.08), Inches(7.5)
)
left_bar.fill.solid()
left_bar.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT)
left_bar.line.fill.background()
# Title with accent underline
title_box = slide.shapes.add_textbox(
Inches(0.6), Inches(0.5),
Inches(12.0), Inches(1.0)
)
tf = title_box.text_frame
p = tf.paragraphs[0]
p.text = TITLE
p.font.name = BRAND_HEADING_FONT
p.font.size = Pt(36)
p.font.bold = True
p.font.color.rgb = hex_to_rgb(BRAND_TEXT)
# Accent underline below title
underline = slide.shapes.add_shape(
MSO_SHAPE.RECTANGLE,
Inches(0.6), Inches(1.5),
Inches(2.5), Inches(0.06)
)
underline.fill.solid()
underline.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT_SECONDARY)
underline.line.fill.background()
# Bullets with custom styling
bullet_start_y = 2.0
bullet_spacing = 1.1
for i, bullet_text in enumerate(BULLETS):
y_pos = bullet_start_y + (i * bullet_spacing)
# Bullet indicator (small accent square)
indicator = slide.shapes.add_shape(
MSO_SHAPE.RECTANGLE,
Inches(0.6), Inches(y_pos + 0.15),
Inches(0.12), Inches(0.12)
)
indicator.fill.solid()
indicator.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT)
indicator.line.fill.background()
# Bullet text
text_box = slide.shapes.add_textbox(
Inches(1.0), Inches(y_pos),
Inches(11.5), Inches(0.9)
)
tf = text_box.text_frame
tf.word_wrap = True
p = tf.paragraphs[0]
p.text = bullet_text
p.font.name = BRAND_BODY_FONT
p.font.size = Pt(22)
p.font.color.rgb = hex_to_rgb(BRAND_TEXT)
# Slide number indicator (bottom right)
num_box = slide.shapes.add_textbox(
Inches(12.5), Inches(7.0),
Inches(0.5), Inches(0.3)
)
p = num_box.text_frame.paragraphs[0]
p.text = "02"
p.font.name = BRAND_HEADING_FONT
p.font.size = Pt(12)
p.font.color.rgb = hex_to_rgb(BRAND_TEXT_SECONDARY)
p.alignment = PP_ALIGN.RIGHT
# Save
output = Path("content-slide.pptx")
prs.save(output)
print(f"Created {output}")
if __name__ == "__main__":
main()
#!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "python-pptx==1.0.2",
# ]
# ///
# /// layout
# name = "corner-anchor-slide"
# purpose = "Bold statement with strong visual anchor, asymmetric modern design"
# best_for = [
# "Bold statements with supporting text",
# "Modern/asymmetric visual style",
# "Key points with emphasis",
# "Visual variety in presentation",
# ]
# avoid_when = [
# "Need lots of text or bullets",
# "Already used this layout recently",
# "Conservative/traditional audience",
# ]
# anchor_corners = ["top-left", "top-right", "bottom-left", "bottom-right"]
# instructions = [
# "ANCHOR_CORNER determines where the large circle appears",
# "Text is positioned opposite to the anchor for balance",
# "Headline can be longer than title-slide (full statement)",
# "Body text provides supporting context or details",
# "Use sparingly for visual variety",
# ]
# ///
"""
LAYOUT: Corner Anchor
PURPOSE: Bold statement with strong visual anchor, asymmetric modern design
CUSTOMIZE:
- BRAND_* colors and fonts
- HEADLINE: Main statement
- BODY_TEXT: Supporting paragraph or points
- ANCHOR_CORNER: "top-left", "top-right", "bottom-left", "bottom-right"
"""
from pathlib import Path
from pptx import Presentation
from pptx.dml.color import RGBColor
from pptx.enum.shapes import MSO_SHAPE
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.util import Inches, Pt
def hex_to_rgb(hex_color: str) -> RGBColor:
h = hex_color.lstrip("#")
return RGBColor(int(h[0:2], 16), int(h[2:4], 16), int(h[4:6], 16))
def main() -> None:
# === BRAND COLORS (get from brands/{name}/brand-system.md) ===
BRAND_BG = "REPLACE" # background color
BRAND_TEXT = "REPLACE" # primary text color
BRAND_TEXT_SECONDARY = "REPLACE" # secondary/muted text color
BRAND_ACCENT = "REPLACE" # accent color (for main anchor shape)
BRAND_ACCENT_SECONDARY = "REPLACE" # secondary accent (for layered shape)
BRAND_HEADING_FONT = "REPLACE" # heading font name
BRAND_BODY_FONT = "REPLACE" # body font name
# === CONTENT (from user request, written in brand voice) ===
HEADLINE = "REPLACE" # main statement
BODY_TEXT = "REPLACE" # supporting paragraph or points
ANCHOR_CORNER = "REPLACE" # "top-left", "top-right", "bottom-left", "bottom-right"
# === SLIDE SETUP ===
prs = Presentation()
prs.slide_width = Inches(13.333)
prs.slide_height = Inches(7.5)
slide = prs.slides.add_slide(prs.slide_layouts[6])
# Background
slide.background.fill.solid()
slide.background.fill.fore_color.rgb = hex_to_rgb(BRAND_BG)
# Large anchor shape based on corner
anchor_size = 5.5
if ANCHOR_CORNER == "top-right":
# Large quarter circle in top-right
anchor = slide.shapes.add_shape(
MSO_SHAPE.OVAL,
Inches(13.333 - anchor_size/2), Inches(-anchor_size/2),
Inches(anchor_size), Inches(anchor_size)
)
text_x, text_y = 0.8, 3.0
text_align = PP_ALIGN.LEFT
elif ANCHOR_CORNER == "top-left":
anchor = slide.shapes.add_shape(
MSO_SHAPE.OVAL,
Inches(-anchor_size/2), Inches(-anchor_size/2),
Inches(anchor_size), Inches(anchor_size)
)
text_x, text_y = 5.5, 3.0
text_align = PP_ALIGN.RIGHT
elif ANCHOR_CORNER == "bottom-right":
anchor = slide.shapes.add_shape(
MSO_SHAPE.OVAL,
Inches(13.333 - anchor_size/2), Inches(7.5 - anchor_size/2),
Inches(anchor_size), Inches(anchor_size)
)
text_x, text_y = 0.8, 1.5
text_align = PP_ALIGN.LEFT
else: # bottom-left
anchor = slide.shapes.add_shape(
MSO_SHAPE.OVAL,
Inches(-anchor_size/2), Inches(7.5 - anchor_size/2),
Inches(anchor_size), Inches(anchor_size)
)
text_x, text_y = 5.5, 1.5
text_align = PP_ALIGN.RIGHT
anchor.fill.solid()
anchor.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT)
anchor.line.fill.background()
# Secondary smaller shape for layering
small_anchor = slide.shapes.add_shape(
MSO_SHAPE.OVAL,
Inches(13.333 - 2.5), Inches(-0.5),
Inches(2.5), Inches(2.5)
)
small_anchor.fill.solid()
small_anchor.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT_SECONDARY)
small_anchor.line.fill.background()
# Headline
headline_box = slide.shapes.add_textbox(
Inches(text_x), Inches(text_y),
Inches(7.0), Inches(1.5)
)
tf = headline_box.text_frame
p = tf.paragraphs[0]
p.text = HEADLINE
p.font.name = BRAND_HEADING_FONT
p.font.size = Pt(56)
p.font.bold = True
p.font.color.rgb = hex_to_rgb(BRAND_TEXT)
p.alignment = text_align
# Accent line
if text_align == PP_ALIGN.LEFT:
line_x = text_x
else:
line_x = text_x + 7.0 - 2.5
accent_line = slide.shapes.add_shape(
MSO_SHAPE.RECTANGLE,
Inches(line_x), Inches(text_y + 1.6),
Inches(2.5), Inches(0.08)
)
accent_line.fill.solid()
accent_line.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT)
accent_line.line.fill.background()
# Body text
body_box = slide.shapes.add_textbox(
Inches(text_x), Inches(text_y + 2.0),
Inches(7.0), Inches(2.5)
)
tf = body_box.text_frame
tf.word_wrap = True
p = tf.paragraphs[0]
p.text = BODY_TEXT
p.font.name = BRAND_BODY_FONT
p.font.size = Pt(20)
p.font.color.rgb = hex_to_rgb(BRAND_TEXT_SECONDARY)
p.alignment = text_align
# Save
output = Path("corner-anchor-slide.pptx")
prs.save(output)
print(f"Created {output}")
if __name__ == "__main__":
main()
#!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "python-pptx==1.0.2",
# ]
# ///
# /// layout
# name = "floating-cards-slide"
# purpose = "Feature highlights, process steps, multiple equal items with depth"
# best_for = [
# "Exactly 3 related features or concepts",
# "Process with 3 steps",
# "Three pillars or principles",
# "Visual depth and modern aesthetic",
# ]
# avoid_when = [
# "More than 3 items - use multi-card-slide instead",
# "Less than 3 items - use content-slide instead",
# "Long card titles (over 15 characters)",
# "Long descriptions needed",
# ]
# max_cards = 3
# card_title_max_chars = 15
# instructions = [
# "EXACTLY 3 cards required - no more, no less",
# "Card titles must be SHORT: 1-2 words, max 15 characters",
# "Descriptions should be 1-2 short sentences",
# "Cards overlap intentionally for depth - do not use for 4+ items",
# "If titles are too long, abbreviate or use different layout",
# ]
# ///
"""
LAYOUT: Floating Cards
PURPOSE: Feature highlights, process steps, multiple equal items with depth
CUSTOMIZE:
- BRAND_* colors and fonts
- TITLE: What these cards represent
- CARDS: List of (title, description) tuples - EXACTLY 3 cards required
"""
from pathlib import Path
from pptx import Presentation
from pptx.dml.color import RGBColor
from pptx.enum.shapes import MSO_SHAPE
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.util import Inches, Pt
def hex_to_rgb(hex_color: str) -> RGBColor:
h = hex_color.lstrip("#")
return RGBColor(int(h[0:2], 16), int(h[2:4], 16), int(h[4:6], 16))
def main() -> None:
# === BRAND COLORS (get from brands/{name}/brand-system.md) ===
BRAND_BG = "REPLACE" # background color
BRAND_CARD_BG = "REPLACE" # card background color
BRAND_CARD_BG_ALT = "REPLACE" # alternate card background (for variety)
BRAND_TEXT = "REPLACE" # primary text color
BRAND_TEXT_SECONDARY = "REPLACE" # secondary/muted text color
BRAND_ACCENT = "REPLACE" # accent color (card 1)
BRAND_ACCENT_SECONDARY = "REPLACE" # secondary accent (card 2)
BRAND_ACCENT_TERTIARY = "REPLACE" # tertiary accent (card 3)
BRAND_HEADING_FONT = "REPLACE" # heading font name
BRAND_BODY_FONT = "REPLACE" # body font name
# === CONTENT (from user request, written in brand voice) ===
TITLE = "REPLACE" # what these cards represent
CARDS = [
("REPLACE", "REPLACE"), # (title, description) - 3 cards works best
("REPLACE", "REPLACE"),
("REPLACE", "REPLACE"),
]
# === SLIDE SETUP ===
prs = Presentation()
prs.slide_width = Inches(13.333)
prs.slide_height = Inches(7.5)
slide = prs.slides.add_slide(prs.slide_layouts[6])
# Background
slide.background.fill.solid()
slide.background.fill.fore_color.rgb = hex_to_rgb(BRAND_BG)
# Title
title_box = slide.shapes.add_textbox(
Inches(0.5), Inches(0.5),
Inches(12.333), Inches(1.0)
)
p = title_box.text_frame.paragraphs[0]
p.text = TITLE
p.font.name = BRAND_HEADING_FONT
p.font.size = Pt(40)
p.font.bold = True
p.font.color.rgb = hex_to_rgb(BRAND_TEXT)
# Card configurations - staggered positions for depth
card_configs = [
{"x": 0.8, "y": 2.0, "accent": BRAND_ACCENT, "bg": BRAND_CARD_BG},
{"x": 4.5, "y": 2.4, "accent": BRAND_ACCENT_SECONDARY, "bg": BRAND_CARD_BG_ALT},
{"x": 8.2, "y": 1.8, "accent": BRAND_ACCENT_TERTIARY, "bg": BRAND_CARD_BG},
]
card_width = 4.2
card_height = 4.0
for i, (card_title, card_desc) in enumerate(CARDS):
config = card_configs[i % len(card_configs)]
x = config["x"]
y = config["y"]
accent = config["accent"]
bg = config["bg"]
# Card shadow (offset rectangle)
shadow = slide.shapes.add_shape(
MSO_SHAPE.ROUNDED_RECTANGLE,
Inches(x + 0.15), Inches(y + 0.15),
Inches(card_width), Inches(card_height)
)
shadow.fill.solid()
shadow.fill.fore_color.rgb = hex_to_rgb("11111b")
shadow.line.fill.background()
# Card background
card = slide.shapes.add_shape(
MSO_SHAPE.ROUNDED_RECTANGLE,
Inches(x), Inches(y),
Inches(card_width), Inches(card_height)
)
card.fill.solid()
card.fill.fore_color.rgb = hex_to_rgb(bg)
card.line.fill.background()
# Accent bar at top of card
accent_bar = slide.shapes.add_shape(
MSO_SHAPE.RECTANGLE,
Inches(x + 0.3), Inches(y + 0.3),
Inches(0.8), Inches(0.12)
)
accent_bar.fill.solid()
accent_bar.fill.fore_color.rgb = hex_to_rgb(accent)
accent_bar.line.fill.background()
# Card number
num_box = slide.shapes.add_textbox(
Inches(x + 0.3), Inches(y + 0.6),
Inches(1.0), Inches(0.8)
)
p = num_box.text_frame.paragraphs[0]
p.text = f"0{i + 1}"
p.font.name = BRAND_HEADING_FONT
p.font.size = Pt(32)
p.font.bold = True
p.font.color.rgb = hex_to_rgb(accent)
# Card title (with word wrap for longer titles)
card_title_box = slide.shapes.add_textbox(
Inches(x + 0.3), Inches(y + 1.5),
Inches(card_width - 0.6), Inches(1.0)
)
tf = card_title_box.text_frame
tf.word_wrap = True
p = tf.paragraphs[0]
p.text = card_title
p.font.name = BRAND_HEADING_FONT
p.font.size = Pt(20)
p.font.bold = True
p.font.color.rgb = hex_to_rgb(BRAND_TEXT)
# Card description
card_desc_box = slide.shapes.add_textbox(
Inches(x + 0.3), Inches(y + 2.6),
Inches(card_width - 0.6), Inches(1.1)
)
tf = card_desc_box.text_frame
tf.word_wrap = True
p = tf.paragraphs[0]
p.text = card_desc
p.font.name = BRAND_BODY_FONT
p.font.size = Pt(16)
p.font.color.rgb = hex_to_rgb(BRAND_TEXT_SECONDARY)
# Save
output = Path("floating-cards-slide.pptx")
prs.save(output)
print(f"Created {output}")
if __name__ == "__main__":
main()
#!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "python-pptx==1.0.2",
# ]
# ///
# /// layout
# name = "giant-focus-slide"
# purpose = "Single powerful word/number, dramatic emphasis, memorable moments"
# best_for = [
# "Single impactful word or number",
# "Dramatic reveal moments",
# "Key statistics (e.g., '47%', '$1B')",
# "Memorable one-word themes",
# ]
# avoid_when = [
# "Need to explain context in detail",
# "More than 3 words needed",
# "Already used this layout recently",
# ]
# max_words = 3
# instructions = [
# "BIG_TEXT should be 1-3 words maximum - ideally just ONE word",
# "Context above/below are optional but help frame the big text",
# "Use for dramatic effect - sparingly in a presentation",
# "Best for numbers, single concepts, or emotional words",
# ]
# ///
"""
LAYOUT: Giant Focus
PURPOSE: Single powerful word/number, dramatic emphasis, memorable moments
CUSTOMIZE:
- BRAND_* colors and fonts
- BIG_TEXT: The single word or short phrase (1-3 words max)
- CONTEXT_ABOVE: Small text above the big text
- CONTEXT_BELOW: Small text below the big text
"""
from pathlib import Path
from pptx import Presentation
from pptx.dml.color import RGBColor
from pptx.enum.shapes import MSO_SHAPE
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.util import Inches, Pt
def hex_to_rgb(hex_color: str) -> RGBColor:
h = hex_color.lstrip("#")
return RGBColor(int(h[0:2], 16), int(h[2:4], 16), int(h[4:6], 16))
def main() -> None:
# === BRAND COLORS (get from brands/{name}/brand-system.md) ===
BRAND_BG = "REPLACE" # background color
BRAND_TEXT = "REPLACE" # primary text color
BRAND_TEXT_SECONDARY = "REPLACE" # secondary/muted text color
BRAND_ACCENT = "REPLACE" # accent color (for the giant text)
BRAND_HEADING_FONT = "REPLACE" # heading font name
BRAND_BODY_FONT = "REPLACE" # body font name
# === CONTENT (from user request, written in brand voice) ===
BIG_TEXT = "REPLACE" # single word or short phrase (1-3 words max)
CONTEXT_ABOVE = "REPLACE" # small text above the big text
CONTEXT_BELOW = "REPLACE" # small text below the big text
# === SLIDE SETUP ===
prs = Presentation()
prs.slide_width = Inches(13.333)
prs.slide_height = Inches(7.5)
slide = prs.slides.add_slide(prs.slide_layouts[6])
# Background
slide.background.fill.solid()
slide.background.fill.fore_color.rgb = hex_to_rgb(BRAND_BG)
# Large background accent shape (subtle)
bg_circle = slide.shapes.add_shape(
MSO_SHAPE.OVAL,
Inches(3.5), Inches(0.5),
Inches(6.333), Inches(6.333)
)
bg_circle.fill.solid()
bg_circle.fill.fore_color.rgb = hex_to_rgb("232333") # Very subtle
bg_circle.line.fill.background()
# Context above
if CONTEXT_ABOVE:
above_box = slide.shapes.add_textbox(
Inches(0.5), Inches(1.8),
Inches(12.333), Inches(0.6)
)
p = above_box.text_frame.paragraphs[0]
p.text = CONTEXT_ABOVE.upper()
p.font.name = BRAND_BODY_FONT
p.font.size = Pt(14)
p.font.color.rgb = hex_to_rgb(BRAND_TEXT_SECONDARY)
p.alignment = PP_ALIGN.CENTER
# Letter spacing would be nice but not supported
# GIANT TEXT
big_box = slide.shapes.add_textbox(
Inches(0), Inches(2.2),
Inches(13.333), Inches(3.5)
)
tf = big_box.text_frame
tf.word_wrap = False
p = tf.paragraphs[0]
p.text = BIG_TEXT
p.font.name = BRAND_HEADING_FONT
p.font.size = Pt(200)
p.font.bold = True
p.font.color.rgb = hex_to_rgb(BRAND_ACCENT)
p.alignment = PP_ALIGN.CENTER
# Context below
if CONTEXT_BELOW:
below_box = slide.shapes.add_textbox(
Inches(0.5), Inches(5.6),
Inches(12.333), Inches(0.6)
)
p = below_box.text_frame.paragraphs[0]
p.text = CONTEXT_BELOW
p.font.name = BRAND_BODY_FONT
p.font.size = Pt(20)
p.font.color.rgb = hex_to_rgb(BRAND_TEXT)
p.alignment = PP_ALIGN.CENTER
# Accent line below context
accent_line = slide.shapes.add_shape(
MSO_SHAPE.RECTANGLE,
Inches(5.5), Inches(6.4),
Inches(2.333), Inches(0.04)
)
accent_line.fill.solid()
accent_line.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT)
accent_line.line.fill.background()
# Save
output = Path("giant-focus-slide.pptx")
prs.save(output)
print(f"Created {output}")
if __name__ == "__main__":
main()
#!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "python-pptx==1.0.2",
# ]
# ///
# /// layout
# name = "image-caption-slide"
# purpose = "Screenshots, diagrams, photos with explanatory text"
# best_for = [
# "Product screenshots",
# "Architecture diagrams",
# "Photos with context",
# "Visual demonstrations",
# ]
# avoid_when = [
# "No image available - use another layout",
# "Image needs full slide - create custom full-bleed layout",
# "Multiple images needed - consider a collage or multiple slides",
# ]
# instructions = [
# "Image displays on right, text on left (adjustable in code)",
# "If no image provided, shows styled placeholder",
# "Caption should explain what to notice in the image",
# "Image path should be absolute or relative to script location",
# ]
# ///
"""
LAYOUT: Image with Caption Slide
PURPOSE: Screenshots, diagrams, photos with explanatory text
CUSTOMIZE:
- BRAND_* colors and fonts
- IMAGE_PATH: Path to the image file (PNG, JPG, etc.)
- CAPTION: Explanation of what the image shows
- TITLE: Optional title above image
"""
from pathlib import Path
from pptx import Presentation
from pptx.dml.color import RGBColor
from pptx.enum.shapes import MSO_SHAPE
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.util import Inches, Pt
def hex_to_rgb(hex_color: str) -> RGBColor:
h = hex_color.lstrip("#")
return RGBColor(int(h[0:2], 16), int(h[2:4], 16), int(h[4:6], 16))
def main() -> None:
# === BRAND COLORS (get from brands/{name}/brand-system.md) ===
BRAND_BG = "REPLACE" # background color
BRAND_TEXT = "REPLACE" # primary text color
BRAND_TEXT_SECONDARY = "REPLACE" # secondary/muted text color
BRAND_ACCENT = "REPLACE" # accent color
BRAND_HEADING_FONT = "REPLACE" # heading font name
BRAND_BODY_FONT = "REPLACE" # body font name
# === CONTENT (from user request, written in brand voice) ===
TITLE = "REPLACE" # title above image
CAPTION = "REPLACE" # explanation of what the image shows
IMAGE_PATH = None # path to image file (PNG, JPG, etc.)
# === SLIDE SETUP ===
prs = Presentation()
prs.slide_width = Inches(13.333)
prs.slide_height = Inches(7.5)
slide = prs.slides.add_slide(prs.slide_layouts[6])
# Background
slide.background.fill.solid()
slide.background.fill.fore_color.rgb = hex_to_rgb(BRAND_BG)
# Left side: Text content
# Title
title_box = slide.shapes.add_textbox(
Inches(0.5), Inches(1.5),
Inches(5.5), Inches(1.2)
)
tf = title_box.text_frame
tf.word_wrap = True
p = tf.paragraphs[0]
p.text = TITLE
p.font.name = BRAND_HEADING_FONT
p.font.size = Pt(36)
p.font.bold = True
p.font.color.rgb = hex_to_rgb(BRAND_TEXT)
# Accent underline
underline = slide.shapes.add_shape(
MSO_SHAPE.RECTANGLE,
Inches(0.5), Inches(2.8),
Inches(2.0), Inches(0.06)
)
underline.fill.solid()
underline.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT)
underline.line.fill.background()
# Caption text
caption_box = slide.shapes.add_textbox(
Inches(0.5), Inches(3.2),
Inches(5.5), Inches(3.0)
)
tf = caption_box.text_frame
tf.word_wrap = True
p = tf.paragraphs[0]
p.text = CAPTION
p.font.name = BRAND_BODY_FONT
p.font.size = Pt(20)
p.font.color.rgb = hex_to_rgb(BRAND_TEXT_SECONDARY)
p.line_spacing = 1.4
# Right side: Image placeholder
# If no image provided, show a styled placeholder
image_x = Inches(6.5)
image_y = Inches(0.8)
image_width = Inches(6.33)
image_height = Inches(5.9)
if IMAGE_PATH and Path(IMAGE_PATH).exists():
slide.shapes.add_picture(
str(IMAGE_PATH),
image_x, image_y,
width=image_width
)
else:
# Placeholder box (styled to look intentional)
placeholder = slide.shapes.add_shape(
MSO_SHAPE.ROUNDED_RECTANGLE,
image_x, image_y,
image_width, image_height
)
placeholder.fill.solid()
placeholder.fill.fore_color.rgb = hex_to_rgb("181825")
placeholder.line.color.rgb = hex_to_rgb("313244")
# Placeholder icon (camera/image symbol made of shapes)
# Mountain shape (simplified image icon)
icon_center_x = 6.5 + (6.33 / 2)
icon_center_y = 0.8 + (5.9 / 2)
# Outer frame
frame = slide.shapes.add_shape(
MSO_SHAPE.ROUNDED_RECTANGLE,
Inches(icon_center_x - 1.0), Inches(icon_center_y - 0.7),
Inches(2.0), Inches(1.4)
)
frame.fill.background()
frame.line.color.rgb = hex_to_rgb(BRAND_ACCENT)
frame.line.width = Pt(2)
# "Image" text
img_text = slide.shapes.add_textbox(
Inches(icon_center_x - 1.0), Inches(icon_center_y - 0.2),
Inches(2.0), Inches(0.5)
)
p = img_text.text_frame.paragraphs[0]
p.text = "IMAGE"
p.font.name = BRAND_HEADING_FONT
p.font.size = Pt(16)
p.font.color.rgb = hex_to_rgb(BRAND_ACCENT)
p.alignment = PP_ALIGN.CENTER
# Decorative corner accent (top right)
corner_bar = slide.shapes.add_shape(
MSO_SHAPE.RECTANGLE,
Inches(12.833), Inches(0),
Inches(0.5), Inches(0.08)
)
corner_bar.fill.solid()
corner_bar.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT)
corner_bar.line.fill.background()
corner_bar_v = slide.shapes.add_shape(
MSO_SHAPE.RECTANGLE,
Inches(13.253), Inches(0),
Inches(0.08), Inches(0.5)
)
corner_bar_v.fill.solid()
corner_bar_v.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT)
corner_bar_v.line.fill.background()
# Save
output = Path("image-caption-slide.pptx")
prs.save(output)
print(f"Created {output}")
if __name__ == "__main__":
main()
#!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "python-pptx==1.0.2",
# ]
# ///
# /// layout
# name = "multi-card-slide"
# purpose = "Multiple items displayed as cards in a row, flexible 3-5 cards"
# best_for = [
# "3-5 equal items (pillars, features, steps)",
# "Process steps displayed horizontally",
# "Feature comparison cards",
# "Team members or product tiers",
# ]
# avoid_when = [
# "Only 2 items - use two-column-slide instead",
# "More than 5 items - split across multiple slides",
# "Items need detailed descriptions - use content-slide",
# ]
# min_cards = 3
# max_cards = 5
# card_title_max_chars = 12
# instructions = [
# "Supports 3, 4, or 5 cards - layout adjusts automatically",
# "Card titles must be SHORT: 1-2 words max (12 characters)",
# "Descriptions should be 1 short sentence",
# "Cards are evenly spaced with no overlap",
# "For longer titles, abbreviate or use content-slide",
# ]
# ///
"""
LAYOUT: Multi-Card Slide
PURPOSE: Multiple items displayed as cards in a row, flexible 3-5 cards
CUSTOMIZE:
- BRAND_* colors and fonts
- TITLE: What these cards represent
- CARDS: List of (title, description) tuples - 3 to 5 cards supported
"""
from pathlib import Path
from pptx import Presentation
from pptx.dml.color import RGBColor
from pptx.enum.shapes import MSO_SHAPE
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.util import Inches, Pt
def hex_to_rgb(hex_color: str) -> RGBColor:
h = hex_color.lstrip("#")
return RGBColor(int(h[0:2], 16), int(h[2:4], 16), int(h[4:6], 16))
def main() -> None:
# === BRAND COLORS (get from brands/{name}/brand-system.md) ===
BRAND_BG = "REPLACE" # background color
BRAND_CARD_BG = "REPLACE" # card background color
BRAND_TEXT = "REPLACE" # primary text color
BRAND_TEXT_SECONDARY = "REPLACE" # secondary/muted text color
BRAND_ACCENT = "REPLACE" # accent color
BRAND_ACCENT_SECONDARY = "REPLACE" # secondary accent
BRAND_HEADING_FONT = "REPLACE" # heading font name
BRAND_BODY_FONT = "REPLACE" # body font name
# === CONTENT (from user request, written in brand voice) ===
TITLE = "REPLACE" # what these cards represent
CARDS = [
("REPLACE", "REPLACE"), # (title, description) - 3 to 5 cards
("REPLACE", "REPLACE"),
("REPLACE", "REPLACE"),
("REPLACE", "REPLACE"),
("REPLACE", "REPLACE"),
]
# === SLIDE SETUP ===
prs = Presentation()
prs.slide_width = Inches(13.333)
prs.slide_height = Inches(7.5)
slide = prs.slides.add_slide(prs.slide_layouts[6])
# Background
slide.background.fill.solid()
slide.background.fill.fore_color.rgb = hex_to_rgb(BRAND_BG)
# Title
title_box = slide.shapes.add_textbox(
Inches(0.5), Inches(0.4),
Inches(12.333), Inches(0.9)
)
tf = title_box.text_frame
p = tf.paragraphs[0]
p.text = TITLE
p.font.name = BRAND_HEADING_FONT
p.font.size = Pt(36)
p.font.bold = True
p.font.color.rgb = hex_to_rgb(BRAND_TEXT)
# Accent underline below title
underline = slide.shapes.add_shape(
MSO_SHAPE.RECTANGLE,
Inches(0.5), Inches(1.35),
Inches(2.5), Inches(0.06)
)
underline.fill.solid()
underline.fill.fore_color.rgb = hex_to_rgb(BRAND_ACCENT)
underline.line.fill.background()
# Calculate card dimensions based on number of cards
num_cards = len(CARDS)
margin = 0.5 # Left/right margin
gap = 0.3 # Gap between cards
total_width = 13.333 - (2 * margin) - ((num_cards - 1) * gap)
card_width = total_width / num_cards
card_height = 4.8
start_y = 1.8
# Alternate accent colors for variety
accent_colors = [BRAND_ACCENT, BRAND_ACCENT_SECONDARY, BRAND_ACCENT, BRAND_ACCENT_SECONDARY, BRAND_ACCENT]
for i, (card_title, card_desc) in enumerate(CARDS):
x = margin + (i * (card_width + gap))
y = start_y
accent = accent_colors[i % len(accent_colors)]
# Card background
card = slide.shapes.add_shape(
MSO_SHAPE.ROUNDED_RECTANGLE,
Inches(x), Inches(y),
Inches(card_width), Inches(card_height)
)
card.fill.solid()
card.fill.fore_color.rgb = hex_to_rgb(BRAND_CARD_BG)
card.line.fill.background()
# Accent bar at top of card
accent_bar = slide.shapes.add_shape(
MSO_SHAPE.RECTANGLE,
Inches(x), Inches(y),
Inches(card_width), Inches(0.1)
)
accent_bar.fill.solid()
accent_bar.fill.fore_color.rgb = hex_to_rgb(accent)
accent_bar.line.fill.background()
# Card number
num_box = slide.shapes.add_textbox(
Inches(x + 0.2), Inches(y + 0.3),
Inches(0.8), Inches(0.6)
)
p = num_box.text_frame.paragraphs[0]
p.text = f"0{i + 1}"
p.font.name = BRAND_HEADING_FONT
p.font.size = Pt(24)
p.font.bold = True
p.font.color.rgb = hex_to_rgb(accent)
# Card title (with word wrap)
card_title_box = slide.shapes.add_textbox(
Inches(x + 0.2), Inches(y + 1.0),
Inches(card_width - 0.4), Inches(1.2)
)
tf = card_title_box.text_frame
tf.word_wrap = True
p = tf.paragraphs[0]
p.text = card_title
p.font.name = BRAND_HEADING_FONT
p.font.size = Pt(18)
p.font.bold = True
p.font.color.rgb = hex_to_rgb(BRAND_TEXT)
# Card description (with word wrap)
card_desc_box = slide.shapes.add_textbox(
Inches(x + 0.2), Inches(y + 2.3),
Inches(card_width - 0.4), Inches(2.2)
)
tf = card_desc_box.text_frame
tf.word_wrap = True
p = tf.paragraphs[0]
p.text = card_desc
p.font.name = BRAND_BODY_FONT
p.font.size = Pt(14)
p.font.color.rgb = hex_to_rgb(BRAND_TEXT_SECONDARY)
# Save
output = Path("multi-card-slide.pptx")
prs.save(output)
print(f"Created {output}")
if __name__ == "__main__":
main()