/SKILL.md
Expert PowerPoint design agent for macOS. python-pptx + lxml is the sole editing engine — all content and design changes go there. AppleScript is used only for app lifecycle (open, quit, navigate, slideshow, screenshot). Use when: (1) Creating new PowerPoint presentations from scratch, (2) Editing or redesigning existing .pptx files, (3) Building slide decks with custom design (gradients, cards, KPI panels, charts, tables), (4) Refreshing/previewing presentations in PowerPoint on macOS via the quit-rebuild-reopen cycle, (5) Generating AI images for slide backgrounds and content, (6) Any task requiring python-pptx code generation with design best practices. Features request-sized workflow gate (simple tweaks skip planning; 5+ slide decks use the 3-phase plan), 27 critical rules grouped into 5 clusters (including mandatory subject-bbox declaration and subject-side panel placement to prevent gradient-over-subject collisions), mandatory dark-BG + targeted-gradient contrast strategy, add_gradient_shape() for overlay shapes, width-first text box sizing, 12 curated design styles, 11 layout types, 10 image composition patterns, and a mandatory audit loop with snapshot-and-rollback on regression.
npx skillsauth add tivojn/pptx-design-agent pptx-designInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Expert PowerPoint design agent on macOS. python-pptx + lxml is the sole editing engine; AppleScript is only for app lifecycle (open, close, quit, navigate, slideshow, screenshot); AI image generation is used for visual content when requested.
Core doctrine: python-pptx edits the file. AppleScript moves the window. Do not cross these streams.
> explaining the purpose.Choose the workflow by request size. This is the authoritative rule — it overrides any "always plan" wording elsewhere.
| Request | Workflow | |---|---| | Small tweak (1 slide, font change, color swap) | Just do it. Edit → save → reopen. No plan. | | New deck, 1–4 slides, or edit of < half the deck | Combined proposal. Propose structure + style + image mode in ONE message. One approval gate. | | New deck of 5+ slides, or redesign | Full 3-phase plan (content → style → images). See Pre-Build Workflow. |
Small tweaks should never trigger the planning workflow. When in doubt, err toward the lighter workflow and escalate only if the user asks.
Every PPTX build — whether 2 slides or 20 — creates a task list at the start via TaskCreate. A build is: any new deck, any redesign, any edit touching 2+ slides, or any job that includes image generation. Only single-property tweaks (one color / one font size / one text change on one slide) skip the task list.
Why mandatory for every build, not just large ones: long builds drift context — by slide 8 Claude may have forgotten the STYLE-02 crimson hex from Phase 2. Approval gates need visibility — user sees in one line where the build is. Audit iteration has stakes — regressions become invisible if not logged. Recovery from interruption becomes one-line instead of re-reading the transcript.
Scale the template to request size — a 2-slide deck uses the short form, a 10-slide BG-image deck uses the full form.
Short form (2–4 slides, no images):
1. Content + style decisions [in_progress]
2. Build all slides (python-pptx) [pending]
3. Audit Pass A (iterate with rollback) [pending]
4. Open + visual verify + deliver [pending]
Full form (5+ slides, or any deck with BG images):
1. Phase 1 — Content structure [in_progress]
2. Phase 2 — Style selection [pending]
3. Phase 3a — Global image strategy [pending] (only if images)
4. Phase 3b — Per-slide composition plan [pending] (only if images)
5. Phase 3c — Prompt preview gate [pending] (only if images)
6. Pilot image (slide 1) + verify [pending] (only if images)
7. Image batch 1 (slides 2–4) + verify [pending] (only if images)
8. Image batch 2 (slides 5–7) + verify [pending] (only if images)
9. Image batch 3 (slides 8–10) + verify [pending] (only if images)
10. Build slide 1 (python-pptx) [pending]
11. Build slide 2 [pending]
...
N-2. Audit Pass A (iterate with rollback) [pending]
N-1. Audit Pass B (optional, if installed) [pending]
N. Open + visual verify + deliver [pending]
completed AND Task 2 in_progress in the same response. Never batch status updates across phases.For decks that cross the "full plan" threshold above, complete all three phases in order. Wait for the user's approval between phases.
This phase comes FIRST — before style, before images, before any code.
Analyze the topic. What is the subject? Content type (narrative / educational / data-driven / persuasive / portfolio / event)? Audience? Narrative arc?
Propose a slide structure table:
| # | Purpose | Content Summary | Layout Type |
|---|---------|-----------------|-------------|
| 1 | Opening | Title + subtitle | Title Page |
| 2 | Setup | Background context | Narrative Page |
| 3 | Key moment | Dramatic quote | Quote Page |
| ... | ... | ... | ... |
Validate layout diversity BEFORE presenting the table. If 3+ consecutive slides share a layout type, restructure. A 10-slide deck should use at least 4 different layout types. See the Layout Type Catalog for 11 options and Layout Rhythm for patterns.
Wait for user approval. They may want to add, remove, or reorder slides.
Content-type → layout-mix cheat sheet:
| Content Type | Typical Layout Mix | |---|---| | Narrative / Story | Title Page, Chapter Dividers, Narrative Pages, Quote Pages, Full-Bleed Images | | Educational | Title Page, Narrative Pages, Diagram/Process, Comparison Pages, Data Tables | | Data-Driven | Title Page, KPI Cards, Data Tables, Charts, Comparison Pages | | Persuasive / Pitch | Title Page, Narrative Pages, KPI Cards, Comparison Pages, Quote Pages | | Portfolio / Showcase | Title Page, Full-Bleed Images, Grid/Mosaic, Narrative Pages | | Event / Agenda | Title Page, Timeline, Data Tables, Narrative Pages |
If the user specified a style (e.g., "use STYLE-01", "McKinsey style") → confirm and proceed.
Otherwise, recommend one style based on the content type, then offer:
Based on your content, I recommend:
**STYLE-XX — [Name]** — [1-line reason why it fits]
Want me to go with this? Or would you like to:
• See the full list of all 12 styles with descriptions?
• Pick a different style by name or number?
If the user doesn't respond or doesn't care, default to STYLE-02 (Executive Editorial).
Content-type → style recommendation:
| Content Type | Recommended Style | |---|---| | Data-Driven (finance, KPIs, charts) | STYLE-01 (Strategy Consulting) | | Persuasive (thought leadership, exec) | STYLE-02 (Executive Editorial) | | Educational (brainstorm, concepts) | STYLE-03 (Sketch / Hand-Drawn) | | Narrative (kids, lifestyle, fun) | STYLE-04 (Kawaii / Cute) | | Persuasive (product launch, SaaS) | STYLE-05 (Professional / Corporate Modern) | | Narrative (story-driven, cinematic) | STYLE-06 (Anime / Manga) | | Portfolio (playful showcase, app) | STYLE-07 (3D Clay / Claymation) | | Data-Driven (editorial, annual report) | STYLE-08 (Editorial / Magazine Spread) | | Educational (process flow, UX) | STYLE-09 (Storyboard / Sequential) | | Data-Driven (feature overview, dashboard) | STYLE-10 (Bento Grid) | | Portfolio (gallery, mood board) | STYLE-11 (Bricks / Masonry) | | Event (poster, indie, retro) | STYLE-12 (Retro / Risograph) | | Generic / unclear | STYLE-02 (default) |
Custom style on the fly — if none of the 12 fits, design a bespoke style dict matching the required schema and present it to the user for confirmation. Audit CHECK 11 uses whatever style is active, including custom ones.
See Design Styles Catalog for full descriptions and Style → python-pptx Mapping for implementation values.
After style is confirmed, determine the image approach.
Default — NO Background Images. Use solid/gradient backgrounds from the active palette. BG images add complexity (overlay management, contrast issues) that isn't always needed.
Only use BG images when the user explicitly requests them — e.g., "with bg image", "add background images", "use photos", "cinematic slides".
When they do, follow the BG Image Contrast Strategy documented once in image-prompts.md and summarized by Rule 11 below.
When to ask for clarification (only if ambiguous):
Would you like AI-generated images for the slides?
• Yes, full backgrounds — Dark, atmospheric images as full-bleed BG with targeted
gradient shapes where text sits.
• Yes, content images — In-slide illustrations inside cards or as visual elements.
• Yes, mixed — Some slides backgrounds, others content images.
• No (Default) — Solid/gradient backgrounds from the style palette only.
If user answers yes, produce a per-slide composition plan table (columns: # | Layout Type | Image Role | Composition Pattern | Image Concept | Subject Bbox | Panel Side | Focal Point | Text Zone | Overlay Strategy | Image Dimensions). Column definitions and full guidance live in design-system.md. Wait for user approval of the composition plan before proceeding to Phase 3c.
Subject Bbox + Panel Side are NOT optional — they are the primary defense against the gradient-over-subject bug (see Rule 27). Rules for filling these two columns:
left-third, center, right-third, or full-bleed (no directional subject). This is a fact about the photo you are going to ask for.left / right / full-bleed. Hard rule: Panel Side MUST MATCH Subject Bbox side. If Subject Bbox = left-third → Panel Side = left (subject lands at outer-left edge of the slide, clear of any inner-edge gradient). If Subject Bbox = right-third → Panel Side = right. Mismatched rows are rejected — regenerate the plan row before prompt preview.Image prompt engineering: see references/image-prompts.md for Sections A (full-bleed BG), A2 (side panels), B (content images), C (prompt quality checklist), and D (post-generation AR + text-zone verification). Read that file before generating any image.
This gate exists because composition-plan approval is not the same as prompt approval. A user who approves "Image Role: Full-bleed BG / Text Zone: bottom 35%" has not seen the actual prompt string that will be sent to the image tool. A systemic prompt bug — wrong palette hex, missing negative-space directive, wrong AR directive — will be faithfully reproduced across all parallel API calls.
Before ANY image-gen tool call, output all N prompts as a review table:
| # | Role | Intended AR | Subject Bbox | Panel Side | Text Zone | Focal Zone | Full Prompt Text (verbatim) |
|---|---------------|-------------|--------------|------------|-------------------|-------------------|----------------------------------------------|
| 1 | Full-bleed BG | 1.78 (16:9) | center | full-bleed | bottom 35% (white)| upper-center | [actual prompt string, 40-80 words] |
| 2 | Side panel L | 0.75 (3:4) | left-third | left | right (cream) | left of frame | [actual prompt string] |
| 3 | Full-bleed BG | 1.78 (16:9) | right-third | full-bleed | left 40% (white) | right of frame | [actual prompt string] |
| … | … | … | … | … | … | … | … |
The Text Zone column must include the intended text color — white, cream, dark, etc. — because that determines which direction the luminance check runs in Phase 3d.
Prompt preview validator — check BEFORE asking the user to approve:
left or both right). Any mismatch → fix the row before showing the table.left, one right) but the deck feels cluttered, consider which layout each image's source composition naturally lends itself to — don't force a side that puts the subject at the inner edge.Wait for user approval. User may edit prompts verbatim, add missing directives, or swap a composition pattern. Once approved, the prompts are frozen for the pilot and batch phases.
The skill defaults to 16:9 widescreen (slide_width=12192000, slide_height=6858000 EMU). To use a different ratio, set prs.slide_width / prs.slide_height before adding slides, and pass the matching dimensions to helpers that accept them (add_bg_image, check_overlaps, etc.).
| Ratio | Use Case | EMU (W × H) | |---|---|---| | 16:9 | Widescreen (default) | 12192000 × 6858000 | | 4:3 | Legacy projectors | 9144000 × 6858000 | | 1:1 | Social post (LinkedIn, Instagram) | 6858000 × 6858000 | | 9:16 | Mobile / vertical | 6858000 × 12192000 |
When using a non-default ratio, ALL image generation prompts must specify the matching aspect ratio (not 16:9). CHECK 12 (image AR distortion) uses geometry-based logic and adapts automatically — no code changes needed.
The presentation file path is stored in PPTX_PATH. Every Python script must read os.environ['PPTX_PATH'].
Ensure dependencies before first use:
python3 -m pip install python-pptx lxml Pillow --quiet
Two engines, one role each:
The rule that eliminates 90% of bugs: If you're about to write AppleScript that SETS any property on a shape or text, stop. Rebuild with python-pptx instead. AppleScript's "live edit" API is missing half the properties you need (letter-spacing, gradient, alpha, corner radius) and unreliable on the other half (font color, top of shape).
The standard edit cycle:
1. Check PowerPoint presence (see applescript-patterns.md#powerpoint-presence-check).
2. Quit PowerPoint (if running and installed):
osascript -e 'tell application "Microsoft PowerPoint" to quit saving no'
3. Wait for the process to exit:
while pgrep -x "Microsoft PowerPoint" > /dev/null; do sleep 0.2; done
4. Rebuild with python-pptx (creates or overwrites the .pptx file).
5. Reopen (if PowerPoint is installed):
open -a "Microsoft PowerPoint" /abs/path/file.pptx
Why every step matters: Skipping the quit step causes the #1 silent-failure bug — PowerPoint holds the file open, open -a just raises the stale window instead of re-reading from disk. Always check presence → quit → wait → rebuild → reopen.
For in-place edits on a file with unsaved changes, ask first — do not silently quit-discard the user's work.
If PowerPoint is not installed (Keynote-only machine, etc.), skip steps 2, 3, and 5 — report the .pptx file path and tell the user to open it in their preferred app. See AppleScript reference.
pal dict with style_to_pal() before calling layout helpers. Vary layouts (see layout rhythm).verify_generated_image(path, role, intended_ar, text_zone=..., text_color=...) — AR check + text-zone luminance check. Show result to the user (path + verification report). If bad: adjust the prompt template and regenerate slide 1 BEFORE batching. This catches systemic prompt bugs at 1 API call cost, not N.nanobanana, seedance-api) → parallel. Browser-based (grok-image-gen, baoyu-danger-gemini-web) → strictly serial.make_title_page(), make_chapter_divider(), make_narrative_page(), make_quote_page(), make_comparison_page(), make_kpi_card(), etc.prs.save(pptx_path).Always through python-pptx — not AppleScript: quit → read → edit → save → reopen.
Every new or redesigned presentation MUST pass the full audit before delivery.
Pass A runs all 13 checks from Audit System iteratively (max 5 passes) with snapshot-and-rollback on regression. Pass B runs the optional pptx-audit-and-fix tool if installed.
Report the audit summary to the user: CRITICAL count, WARNING count, fixes applied, passes needed.
Anti-patterns (never do these):
Grouped into 5 clusters. Each rule is one short directive — read the linked reference for details.
run_width_emu() (in python-pptx-reference.md). If the longest paragraph's width exceeds the box, widen the box. Unexpected wrap → cascading overflow bugs. Never guess frame sizes.frame_dims() for multi-run paragraphs.radius=10000 (= adj=10000, "moderate/pleasant"). Scale: 3000 (barely visible), 10000 (default), 16667 (PowerPoint default), 50000 (pill — avoid on rectangular content cards).add_gradient_shape(). Writing etree.SubElement(spPr, ...) to add gradFill is the #1 cause of "mystery blue rectangles." add_gradient_shape() handles theme override, element ordering, and schema compliance. See python-pptx-reference.md — add_gradient_shape.add_gradient_shape() covering ONLY text zones (use add_bg_image(..., text_zone=...) as the canonical helper); (c) use light text colors (white, cream); (d) EXCEPTION: on slides where all content is in opaque cards (KPI cards, data tables), add NO overlay — the cards handle contrast, and the BG image shows through gaps (which is the point). Full-slide semi-transparent rectangles wash out the image uniformly and defeat the purpose of using BG images at all. Full details in image-prompts.md.add_picture(path, l, t, w, h) STRETCHES the image. For non-full-bleed placements use add_picture_fit() (letterbox, preserves full image) or add_picture_cover() (fill-and-crop, no blank space). Choose based on whether you need the whole image visible (fit) or a filled rectangle (cover). Details in python-pptx-reference.md — Adding Images.verify_generated_image() immediately. If >15% deviation from intended AR, regenerate with a stronger directive OR adapt the role. See image-prompts.md Section D.left-third / center / right-third). The prompt must NOT pre-commit the slide's text column (no "leave the LEFT 2/3 for typography"). Text column is the build layer's decision, derived from Subject Bbox.prs.save(pptx_path).& → &, < → <, > → >.EMU = points × 12700.Detailed reference documentation lives in focused files. Read the relevant file when the task requires it:
make_title_page(), make_kpi_card(), etc.), pal dict contract, style_to_pal() adapter, check_overlaps(), add_gradient_shape(), add_picture_fit(), add_picture_cover(), verify_generated_image(). Read before writing any python-pptx code.development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.
development
Run, watch, debug, and extend OpenClaw QA testing with qa-lab and qa-channel. Use when Codex needs to execute the repo-backed QA suite, inspect live QA artifacts, debug failing scenarios, add new QA scenarios, or explain the OpenClaw QA workflow. Prefer the live OpenAI lane with regular openai/gpt-5.4 in fast mode; do not use gpt-5.4-pro or gpt-5.4-mini unless the user explicitly overrides that policy.
development
End-to-end Parallels smoke, upgrade, and rerun workflow for OpenClaw across macOS, Windows, and Linux guests. Use when Codex needs to run, rerun, debug, or interpret VM-based install, onboarding, gateway smoke tests, latest-release-to-main upgrade checks, fresh snapshot retests, or optional Discord roundtrip verification under Parallels.