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-author 和 pitch-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 会话打开/保存。
路演幻灯片的幻灯片类型清单
典型的投行路演幻灯片遵循以下结构。并非强制性规定,但可作为起始骨架参考:
- 封面 / 标题页
- 免责声明
- 目录
- 情况概述
- 公司概况(目标公司)
- 市场 / 行业背景
- 估值摘要(足球场的图)——关键幻灯片
- 可比交易详情
- 先例交易详情
- DCF 摘要
- 示意性 LBO / 赞助商案例
- 流程考量
- 附录
何时不使用此技能
- 用户在拥有可用 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