Pptx

From phuetz/code-buddy · View interactive version

Pptx is an AI agent skill from the GitHub repository phuetz/code-buddy. Create and edit PowerPoint presentations (.pptx): title slides, bullet layouts, tables, images, and speaker notes. Use whenever the user asks to build, modify, or populate a presentation/slide deck/PowerPoint.

How to use this skill

Skill file

Create & edit PowerPoint with python-pptx

Build real .pptx files with the open-source python-pptx library

(python3 -c "import pptx"). Work in visible steps; verify before reporting done.

Workflow

  1. Outline the deck: a title slide + one slide per section; note any tables,

images, or speaker notes.

  1. Write a Python script (heredoc via the bash tool) that builds the deck

with python-pptx and saves it.

  1. Verify: reopen with Presentation(path) and assert the slide count / title;

print(path).

  1. Report the saved path + a one-line summary.

Quality conventions

(slide_layouts[1] for bullets, slide_layouts[5] "Title Only" for custom layouts/tables).

for sub-bullets) — not one big text blob.

the header row.

everywhere; keep ≤ ~6 bullets per slide.

Example

python3 - <<'PY'
from pptx import Presentation
from pptx.util import Inches, Pt
from pptx.dml.color import RGBColor
p = Presentation()
s = p.slides.add_slide(p.slide_layouts[0])
s.shapes.title.text = 'Q2 Robotics Budget'
s.placeholders[1].text = 'Funding 120k EUR — on track'

s2 = p.slides.add_slide(p.slide_layouts[5]); s2.shapes.title.text = 'Line items'
tbl = s2.shapes.add_table(3, 3, Inches(0.6), Inches(1.6), Inches(8.5), Inches(2)).table
for j, h in enumerate(['Item', 'Cost', 'Status']):
    cell = tbl.cell(0, j); cell.text = h
    cell.text_frame.paragraphs[0].runs[0].font.bold = True
for i, row in enumerate([['Actuators', '8000', 'ordered'], ['Compute', '3500', 'done']], 1):
    for j, v in enumerate(row):
        tbl.cell(i, j).text = v
p.save('deck.pptx')

assert len(Presentation('deck.pptx').slides) == 2
print('deck.pptx')
PY

Reading / editing existing files

existing theme, layout, and fonts.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.