pptx
できること
このスキルは、アウトラインからPowerPointのスライドを作る方法と、既存の資料を変更する方法をエージェントに教えます。プレゼンテーションを作ったり更新したりする人向けです。
使う場面
- ✓アウトラインやメモから、新しいスライドのデッキを作りたいとき。
- ✓既存のPowerPointファイルから、テキストやスピーカーノートを取り出したいとき。
- ✓既存のデッキの画像、表、グラフを入れ替えたいとき。
スキルのリンク
https://github.com/HKUDS/DeepTutor/blob/main/deeptutor/skills/builtin/pptx/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“このアウトラインを、10枚のスライドからなるPowerPointのデッキにしてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、PowerPointファイルの各部分を読み書きするPythonライブラリを使います。変更を加えて、完成したデッキを返します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
pptx
Work with PowerPoint .pptx files using python-pptx (preinstalled). A .pptx
is a ZIP of XML parts; python-pptx handles the structure so you rarely touch XML.
Drop to raw OOXML only for the few things the library can't express (see Advanced).
Use exec with complete Python source (language: python). Keep asset creation,
deck generation, reopening, and structural verification in one call when
possible; later calls can revise the same relative filename. Follow the turn's
User workspace instructions for locating inputs, output boundaries, and
presenting the finished deck.
Mental model
- A presentation has slides; each slide is built from a layout; layouts
live on slide masters. Layouts define placeholders (title, body,
picture, etc.) by
idxand type. - A slide holds shapes: placeholders, text boxes, pictures, tables, charts.
- Shapes with text expose
.text_frame→.paragraphs→.runs. A run is the unit that carries formatting (font, size, bold, color). - Units are EMU. Use the helpers:
from pptx.util import Inches, Pt, Emu.
Read / extract
from pptx import Presentation
prs = Presentation("deck.pptx")
print(len(prs.slides), prs.slide_width, prs.slide_height) # EMU dims
for i, slide in enumerate(prs.slides, 1):
print(f"--- slide {i} (layout: {slide.slide_layout.name}) ---")
for shape in slide.shapes:
if shape.has_text_frame:
print(shape.text_frame.text) # \n-joined paragraphs
elif shape.has_table:
for row in shape.table.rows:
print([c.text for c in row.cells])
if slide.has_notes_slide:
notes = slide.notes_slide.notes_text_frame.text
if notes:
print("NOTES:", notes)
Iterate slide.placeholders to see placeholder idx / placeholder_format.type.
For a fast text-only dump, just collect shape.text_frame.text across slides.
Create from an outline
List the layouts first — indices vary by template. With the default template, layout 0 = Title, 1 = Title+Content, 5 = Title Only, 6 = Blank.
from pptx import Presentation
from pptx.util import Inches, Pt
prs = Presentation() # or Presentation("template.pptx") to inherit a theme
for idx, lay in enumerate(prs.slide_layouts):
print(idx, lay.name, [(p.placeholder_format.idx, p.name) for p in lay.placeholders])
# Title slide
s = prs.slides.add_slide(prs.slide_layouts[0])
s.shapes.title.text = "My Deck"
s.placeholders[1].text = "Subtitle" # idx from the listing above
# Title + bullets
s = prs.slides.add_slide(prs.slide_layouts[1])
s.shapes.title.text = "Agenda"
tf = s.placeholders[1].text_frame
tf.text = "First point" # first paragraph
for line, lvl in [("Second", 0), ("Sub-point", 1)]:
p = tf.add_paragraph()
p.text = line
p.level = lvl
prs.save("out.pptx")
Always set text via placeholders/shapes — never hand-write bullet glyphs (•);
indentation/bullets come from the layout via paragraph.level.
Add a free text box or picture on any slide:
tb = s.shapes.add_textbox(Inches(1), Inches(1), Inches(8), Inches(1))
r = tb.text_frame.paragraphs[0].add_run()
r.text = "Hi"
r.font.size = Pt(28)
r.font.bold = True
s.shapes.add_picture("logo.png", Inches(0.5), Inches(0.5), height=Inches(1)) # omit w to keep ratio
Edit existing
Edit at the run level to preserve a run's formatting; rewriting
text_frame.text collapses to one run and drops inline formatting.
for slide in prs.slides:
for shape in slide.shapes:
if not shape.has_text_frame:
continue
for para in shape.text_frame.paragraphs:
for run in para.runs:
if "{{NAME}}" in run.text:
run.text = run.text.replace("{{NAME}}", "Frank")
To delete a shape/placeholder: sp = shape._element; sp.getparent().remove(sp).
If the template has more slots than your data, remove the extra shapes entirely
rather than leaving empty placeholders.
Replace an image in place (keep size/position)
python-pptx has no direct setter; swap the bytes of the related image part. Read
the picture's r:embed rId off its <a:blip>, then overwrite the part's blob.
The replacement bytes must use the same image encoding as the original part
(for example PNG for PNG). A different encoding also requires a new correctly
typed media part and relationship; changing _blob alone would leave invalid
content-type metadata.
from pptx.oxml.n
よくある質問
デッキをPDFに書き出せますか?
はい。PDFや画像への書き出しは、スキルの選択肢の一つとして挙げられています。
既存のデッキのスピーカーノートを読めますか?
はい。既存のデッキからスライドのテキストとスピーカーノートを取り出せます。
既存のデッキのデザインを変えられますか?
図形、テキスト、表、グラフは編集できます。大きなデザイン変更は、ファイルにすでにあるレイアウトに依存します。
詳細
作者による元の説明
Read, create, or edit PowerPoint .pptx decks — build slides from an outline, extract slide text/speaker notes, edit shapes/tables/charts, replace images, or export to PDF/images. Use whenever a .pptx (or .ppt) file is an input or output, or the user mentions a deck, slides, or a presentation.
repo: HKUDS/DeepTutor
人気
- GitHubのスター
- 54k
- ランキング
- #3370
- ライセンス
- Apache-2.0
- 更新日
- 2026/10/31
コメント
- …
このリポジトリの他のスキル
deeptutor-cli
54kエージェントが、学習プラットフォームDeepTutorのセットアップと実行を、コマンドラインから行えるよう支援します。知識ベース、ノートブック、Webアプリを含みます。
docx
54kエージェントが、Wordの.docxファイルを読んだり作成したり編集したりできるよう支援します。レポート、表、検索と置換、変更履歴とコメントを含みます。
エージェントが、PDFファイルの読み取り、結合、分割、フォーム入力、作成を行えるよう支援します。PDFからテキストや表を取り出すこともできます。
skill-creator
54kエージェントが、DeepTutorのスキル、すなわち特定のタスクをAIに教える短い指示のパッケージを作成、改善できるよう支援します。
似ているスキル
feishu-doc
394kテキスト、画像、表を含むFeishuのクラウドドキュメントを、ドキュメントツールを使って読み、作成し、編集するようエージェントを支援します。
feishu-drive
394kボットと共有されたFeishuのクラウドフォルダ内のファイルを閲覧、整理、コメントできるようエージェントを支援します。
feishu-perm
394kFeishuのファイルにアクセスできる人を確認し、変更するようエージェントを支援します。依頼を満たす最小の権限を選びます。