agentleFS
augchan42augchan42/inkstone/skills/swapping-pptx-templates/SKILL.md

swapping-pptx-templates

Skill5 starsChanged 5 months agoMITView on GitHub

Use when re-rendering an existing .pptx deck's content into a different template/theme (PowerPoint, slides, brand swap, "use the template from X but content from Y"), especially with bilingual/CJK text or a template whose background is a baked-in image. For the underlying unpack/edit/pack mechanics, see the official pptx skill.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    REQUIRED BACKGROUND: Use the official pptx skill (Anthropic document-skills plugin) for the unpack → add_slide → edit → clean → pack …

    line 17
  2. Distinctive:

    Before packing, run the audit (path in Claude Code shown.

    line 39

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Swapping PPTX Templates

Overview

Moving a deck's content into a different template's look. PowerPoint has no "reflow into another template" operation, so this is a slide-by-slide rebuild in raw OOXML. This skill is the judgment layer on top of the mechanical workflow.

REQUIRED BACKGROUND: Use the official pptx skill (Anthropic document-skills plugin) for the unpack → add_slide → edit → clean → pack mechanics and its scripts. This skill covers the four things that skill does NOT warn about, each of which caused a real defect.

The four non-obvious rules

1. Redesign, don't relocate

A "template" usually ships 3-5 generic layouts (title / banded-header / framed-card / blank), not equivalents of the source's custom diagrams. Copy-pasting shapes drags the source's colors and geometry into the new deck. Instead: extract each slide's content (text, data, image refs) and rebuild the visual from scratch in the template's palette, using its layouts only as background/chrome. Match content type to the closest layout; layer plain text boxes + shapes on top for anything beyond title+body.

2. Never hand-type CJK (or any non-ASCII) as numeric XML entities

Deriving 住... decimal codepoints from memory for Chinese/Japanese/Korean text is the single highest-risk step. Each wrong codepoint decodes to a valid but wrong character (圈→圭, 驗→鰓, 輪→載), so pack/validate never errors and the corruption is silent.

  • Get ground truth: python -m markitdown source.pptx > source_text.md
  • Insert CJK by script substitution from that file (str.replace), never by typing entities or characters into an edit by hand.
  • Before packing, run the audit (path in Claude Code shown; elsewhere use the repo path):
AUDIT="$CLAUDE_PLUGIN_ROOT/skills/swapping-pptx-templates/scripts/audit_cjk.py"
python "$AUDIT" source_text.md <build_dir>   # exit 1 = suspicious chars, stop and fix

It flags any CJK char in the build absent from the source (near-zero false positives).

3. Template backgrounds are hazard zones

A template's p:bg is often a rasterized blipFill, not theme colors — so it can contain baked-in text (a tagline) and a logo that your content must avoid. Detect their bounds programmatically, don't eyeball a thumbnail:

from PIL import Image
im = Image.open("ppt/media/image1.PNG").convert("RGB")  # the bg blip
# scan for tagline/logo pixels vs the known flat bg color; get px bbox, then:
# EMU_per_px = slide_width_emu / image_width_px   # e.g. 12192000/1280 = 9525

Convert the bbox to EMU and treat it as a keep-clear rectangle for every slide on that bg.

4. Visual QA is an adversarial pass by fresh eyes

After packing: soffice --headless --convert-to pdf out.pptx && pdftoppm -jpeg -r 150 out.pdf slide. Then dispatch a subagent (no authoring context) told to find problems — overlaps with the bg watermark/logo, text overflow, low-contrast label/fill pairings, lopsided whitespace. You will not catch these yourself; you've been staring at the coordinates. Fix and re-render until a pass is clean.

Red flags — STOP

  • About to type a Chinese/Japanese/Korean character or &#NNNN; entity into an edit → don't; substitute from the markitdown extraction instead.
  • Packing without having run audit_cjk.py → run it first.
  • Placing content in the top-right or a bottom band without checking the bg image's logo/tagline bbox.
  • Declaring done after only self-review of the rendered slides → dispatch the fresh-eyes QA subagent.

Common mistakes

MistakeConsequenceFix
Copy-paste source shapes into templateOld palette/geometry bleeds inRebuild visuals in template's colors
Hand-typed CJK codepointsSilent wrong charactersScript-substitute from markitdown; run audit
Assume <Default Extension> covers new image typesPack drops images / corrupt fileAdd jpg/png defaults to [Content_Types].xml when copying source media
Eyeballing clearance from a thumbnailText collides with baked-in logo/taglinePixel-detect bbox → EMU keep-clear zone
Self-review onlyOverlaps/whitespace shippedFresh-eyes subagent QA loop

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.