跳到主要內容

Pptx Author

使用 python-pptx 無頭(headless)構建 PowerPoint 演示文稿。與 excel-author 搭配使用,可創建由模型支持的演示文稿,其中每個數字均可追溯至工作簿單元格。適用於路演幻燈片、投資委員會備忘錄、財報筆記等場景。

技能元數據

來源可選 — 使用 hermes skills install official/finance/pptx-author 安裝
路徑optional-skills/finance/pptx-author
版本1.0.0
作者Anthropic(由 Nous Research 改編)
許可證Apache-2.0
平臺linux, macos, windows
標籤powerpoint, pptx, python-pptx, presentation, finance
相關技能excel-author, powerpoint

參考:完整 SKILL.md

信息

以下是 Hermes 在觸發此技能時加載的完整技能定義。這是技能激活時代理所看到的指令。

pptx-author

使用 python-pptx 在磁盤上生成 .pptx 文件。當需要將演示文稿作為文件產物交付,而非驅動實時 PowerPoint 會話時使用。

改編自 anthropics/financial-services 中 Anthropic 的 pptx-authorpitch-deck 技能。原始技能中的 MCP / Office-JS 分支已被移除——此處假設使用無頭 Python 環境。

對於更廣泛、已內置的 PowerPoint 創作技能(包含幻燈片、演講者備註、嵌入內容、媒體),請參閱內置的 powerpoint 技能。本技能是一種更輕量級的模式,專為模型支持的演示文稿(如路演幻燈片、投資委員會備忘錄、財報筆記)而優化,要求每個數字都必須可追溯至源工作簿。

輸出契約

  • 寫入 ./out/<name>.pptx。如果 ./out/ 不存在,則創建該目錄。
  • 在最終消息中返回相對路徑。

設置

pip install "python-pptx>=0.6"

核心約定

每頁幻燈片一個觀點

標題陳述核心結論;正文提供支撐。題為“Q3 收入”的幻燈片較弱;“Q3 收入同比增長加速至 14%”則更強有力。

每個數字均可追溯至模型

如果幻燈片上的某個數字來自 ./out/model.xlsx,請在腳註中標明工作表和單元格。

Revenue: $1,250M  (Source: model.xlsx, Inputs!C3)

切勿憑記憶或從摘要中轉錄數字——打開工作簿,讀取命名區域,並在可能時以編程方式將演示文稿值綁定到該區域。

存在公司模板時使用該模板

如果 ./templates/firm-template.pptx 存在,請加載它,以便演示文稿繼承品牌顏色、字體和母版佈局。

from pptx import Presentation
from pathlib import Path

template = Path("./templates/firm-template.pptx")
prs = Presentation(str(template)) if template.exists() else Presentation()

圖表:源自模型的 PNG 優於原生 pptx 圖表

當保真度至關重要(模型的圖表樣式必須與演示文稿完全匹配)時,從源工作簿將圖表渲染為 PNG 並嵌入圖像。原生 pptx.chart 圖表較為脆弱,且往往不符合公司規範。

from pptx.util import Inches
slide.shapes.add_picture("./out/charts/football_field.png",
Inches(1), Inches(2),
width=Inches(8))

無外部發送

此技能僅寫入文件。它從不發送郵件、上傳或發佈。交付由編排層處理。

骨架結構

from pptx import Presentation
from pptx.util import Inches, Pt
from pptx.dml.color import RGBColor
from pathlib import Path

template = Path("./templates/firm-template.pptx")
prs = Presentation(str(template)) if template.exists() else Presentation()

# Title slide
slide = prs.slides.add_slide(prs.slide_layouts[0])
slide.shapes.title.text = "Project Aurora — Strategic Alternatives"
slide.placeholders[1].text = "Preliminary Discussion Materials"

# Valuation summary slide (title-only layout)
slide = prs.slides.add_slide(prs.slide_layouts[5])
slide.shapes.title.text = "Valuation implies $38–$52 per share across methodologies"

# Add a table bound to model outputs
rows, cols = 5, 4
tbl_shape = slide.shapes.add_table(rows, cols,
Inches(0.5), Inches(1.5),
Inches(9), Inches(3))
tbl = tbl_shape.table
headers = ["Methodology", "Low ($)", "Mid ($)", "High ($)"]
for c, h in enumerate(headers):
tbl.cell(0, c).text = h

# In a real deck, read these from the model workbook with openpyxl
data = [
("Trading comps", "35", "41", "48"),
("Precedent M&A", "39", "45", "52"),
("DCF (base)", "36", "43", "51"),
("LBO (10% IRR)", "33", "38", "44"),
]
for r, row in enumerate(data, start=1):
for c, val in enumerate(row):
tbl.cell(r, c).text = val

# Embed a chart rendered from the model
slide = prs.slides.add_slide(prs.slide_layouts[5])
slide.shapes.title.text = "Football field — current price $42"
slide.shapes.add_picture("./out/charts/football_field.png",
Inches(1), Inches(1.8), width=Inches(8))

Path("./out").mkdir(exist_ok=True)
prs.save("./out/pitch-aurora.pptx")

將演示文稿數字綁定至源工作簿

從 Excel 模型中讀取命名區域或特定單元格,確保演示文稿中的數字不會偏離。

from openpyxl import load_workbook

wb = load_workbook("./out/model.xlsx", data_only=True)
def nr(name):
"""Resolve a named range to its current computed value."""
rng = wb.defined_names[name]
sheet, coord = next(rng.destinations)
return wb[sheet][coord].value

revenue_fy24 = nr("RevenueFY24")
implied_mid = nr("ImpliedSharePriceBase")

然後使用這些值構建演示文稿內容:

slide.shapes.title.text = f"Implied share price of ${implied_mid:.2f} (base case)"

請記住在讀取工作簿之前重新計算——如果尚未計算工作表,openpyxl 只能看到未計算的值。首先運行 excel-author 技能中的重新計算輔助程序,或通過真實的 Excel 會話打開/保存。

路演幻燈片的幻燈片類型清單

典型的投行路演幻燈片遵循以下結構。並非強制性規定,但可作為起始骨架參考:

  1. 封面 / 標題頁
  2. 免責聲明
  3. 目錄
  4. 情況概述
  5. 公司概況(目標公司)
  6. 市場 / 行業背景
  7. 估值摘要(足球場的圖)——關鍵幻燈片
  8. 可比交易詳情
  9. 先例交易詳情
  10. DCF 摘要
  11. 示意性 LBO / 贊助商案例
  12. 流程考量
  13. 附錄

何時不使用此技能

  • 用戶在擁有可用 Office MCP 的實時 PowerPoint 會話中——應驅動其實時文檔。
  • 非金融類幻燈片材料(季度全員會議、營銷演示文稿)——使用更廣泛的 powerpoint 技能。
  • 包含大量動畫、過渡效果或演講者備註的演示文稿——使用更廣泛的 powerpoint 技能。

歸屬

約定改編自 Anthropic 的 Claude for Financial Services 插件套件,採用 Apache-2.0 許可證。原始來源:https://github.com/anthropics/financial-services/tree/main/plugins/agent-plugins/pitch-agent/skills/pptx-author