document-pptx by vasilyu1983/ai-agents-public
npx skills add https://github.com/vasilyu1983/ai-agents-public --skill document-pptx此技能支持以编程方式创建和编辑 PowerPoint 演示文稿。当用户需要生成推介演示文稿、报告、培训材料或自动化演示文稿工作流时,Claude 应应用这些模式。
现代最佳实践(2026年1月):
| 任务 | 工具/库 | 语言 | 使用场景 |
|---|---|---|---|
| 创建 PPTX | python-pptx | Python | 演示文稿、幻灯片组 |
| 创建 PPTX | PptxGenJS | Node.js | 服务器端生成 |
| 模板驱动 | PPTX-Automizer | Node.js | 企业品牌、模板注入 |
| 模板 | python-pptx | Python | 母版幻灯片、主题 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 图表 | python-pptx | Python | 数据可视化 |
| 提取内容 | python-pptx | Python | 解析现有演示文稿 |
选择指南
from pptx import Presentation
prs = Presentation()
# 标题幻灯片
title_layout = prs.slide_layouts[0] # Title Slide layout
slide = prs.slides.add_slide(title_layout)
title = slide.shapes.title
subtitle = slide.placeholders[1]
title.text = "Q4 2025 Business Review"
subtitle.text = "Presented by Product Team"
# 带项目符号的内容幻灯片
bullet_layout = prs.slide_layouts[1] # Title and Content
slide = prs.slides.add_slide(bullet_layout)
slide.shapes.title.text = "Key Highlights"
body = slide.placeholders[1]
tf = body.text_frame
tf.text = "Revenue grew 25% YoY"
p = tf.add_paragraph()
p.text = "Customer base expanded to 10,000+"
p.level = 0
p = tf.add_paragraph()
p.text = "New enterprise tier launched"
p.level = 1 # Indented bullet
# 添加演讲者备注
notes_slide = slide.notes_slide
notes_slide.notes_text_frame.text = "Emphasize the enterprise growth story here."
prs.save('presentation.pptx')
import pptxgen from 'pptxgenjs';
async function main() {
const pptx = new pptxgen();
pptx.author = 'Product Team';
pptx.title = 'Q4 Business Review';
// 标题幻灯片
let slide = pptx.addSlide();
slide.addText('Q4 2025 Business Review', {
x: 1, y: 2, w: '80%',
fontSize: 36, bold: true, color: '363636',
align: 'center',
});
slide.addText('Presented by Product Team', {
x: 1, y: 3.5, w: '80%',
fontSize: 18, color: '666666',
align: 'center',
});
// 带项目符号的内容幻灯片
slide = pptx.addSlide();
slide.addText('Key Highlights', {
x: 0.5, y: 0.5, w: '90%',
fontSize: 28, bold: true,
});
slide.addText([
{ text: 'Revenue grew 25% YoY', options: { bullet: true } },
{ text: 'Customer base expanded to 10,000+', options: { bullet: true } },
{ text: 'New enterprise tier launched', options: { bullet: true, indentLevel: 1 } },
], { x: 0.5, y: 1.5, w: '90%', fontSize: 18 });
// 添加图表
slide = pptx.addSlide();
slide.addChart(pptx.ChartType.bar, [
{ name: 'Sales', labels: ['Q1', 'Q2', 'Q3', 'Q4'], values: [100, 150, 180, 225] },
], { x: 1, y: 1.5, w: 8, h: 4 });
await pptx.writeFile({ fileName: 'presentation.pptx' });
}
main();
from pptx import Presentation
from pptx.util import Inches
from pptx.chart.data import CategoryChartData
from pptx.enum.chart import XL_CHART_TYPE
prs = Presentation()
slide = prs.slides.add_slide(prs.slide_layouts[6]) # Blank
# Chart data
chart_data = CategoryChartData()
chart_data.categories = ['Q1', 'Q2', 'Q3', 'Q4']
chart_data.add_series('Revenue', (100, 150, 180, 225))
chart_data.add_series('Expenses', (80, 90, 100, 110))
# Add chart
x, y, cx, cy = Inches(1), Inches(1.5), Inches(8), Inches(5)
chart = slide.shapes.add_chart(
XL_CHART_TYPE.COLUMN_CLUSTERED,
x, y, cx, cy,
chart_data
).chart
chart.has_legend = True
chart.legend.include_in_layout = False
prs.save('charts.pptx')
from pptx import Presentation
from pptx.util import Inches
prs = Presentation()
slide = prs.slides.add_slide(prs.slide_layouts[6]) # Blank
# Add image
slide.shapes.add_picture('logo.png', Inches(0.5), Inches(0.5), width=Inches(2))
# Add table
rows, cols = 4, 3
table = slide.shapes.add_table(rows, cols, Inches(1), Inches(2), Inches(8), Inches(3)).table
# Set column headers
table.cell(0, 0).text = 'Product'
table.cell(0, 1).text = 'Sales'
table.cell(0, 2).text = 'Growth'
# Fill data
data = [
('Widget A', '$1.2M', '+25%'),
('Widget B', '$800K', '+15%'),
('Widget C', '$500K', '+40%'),
]
for row_idx, (product, sales, growth) in enumerate(data, 1):
table.cell(row_idx, 0).text = product
table.cell(row_idx, 1).text = sales
table.cell(row_idx, 2).text = growth
prs.save('images_and_tables.pptx')
from pptx import Presentation
prs = Presentation('existing.pptx')
for slide_num, slide in enumerate(prs.slides, 1):
print(f"\n--- Slide {slide_num} ---")
for shape in slide.shapes:
if shape.has_text_frame:
for paragraph in shape.text_frame.paragraphs:
print(paragraph.text)
if shape.has_table:
table = shape.table
for row in table.rows:
row_text = [cell.text for cell in row.cells]
print(row_text)
| 版式索引 | 名称 | 使用场景 |
|---|---|---|
| 0 | 标题幻灯片 | 开场、章节分隔 |
| 1 | 标题和内容 | 标准项目符号幻灯片 |
| 2 | 节标题 | 章节过渡 |
| 3 | 两栏内容 | 并排比较 |
| 4 | 比较 | 优点/缺点、之前/之后 |
| 5 | 仅标题 | 自定义内容布局 |
| 6 | 空白 | 完全创意控制 |
| 7 | 带标题的内容 | 图像 + 描述 |
PITCH DECK STRUCTURE
1. Title (company, tagline)
2. Problem (pain point)
3. Solution (your product)
4. Market Size (TAM/SAM/SOM)
5. Business Model (how you make money)
6. Traction (metrics, growth)
7. Team (founders, advisors)
8. Competition (landscape)
9. Financials (projections)
10. Ask (funding, next steps)
QUARTERLY REVIEW STRUCTURE
1. Title + Agenda
2. Executive Summary (KPIs dashboard)
3. Revenue & Growth
4. Product Updates
5. Customer Highlights
6. Challenges & Learnings
7. Next Quarter Goals
8. Q&A
仅在明确要求且符合政策时使用。
资源
模板
相关技能
每周安装次数
81
代码仓库
GitHub 星标数
49
首次出现
2026年1月23日
安全审计
安装于
gemini-cli72
cursor72
opencode71
codex70
github-copilot67
cline66
This skill enables creation and editing of PowerPoint presentations programmatically. Claude should apply these patterns when users need to generate pitch decks, reports, training materials, or automate presentation workflows.
Modern Best Practices (Jan 2026) :
| Task | Tool/Library | Language | When to Use |
|---|---|---|---|
| Create PPTX | python-pptx | Python | Presentations, slide decks |
| Create PPTX | PptxGenJS | Node.js | Server-side generation |
| Template-driven | PPTX-Automizer | Node.js | Corporate branding, template injection |
| Templates | python-pptx | Python | Master slides, themes |
| Charts | python-pptx | Python | Data visualizations |
| Extract content | python-pptx | Python | Parse existing decks |
Selection guide
from pptx import Presentation
prs = Presentation()
# Title slide
title_layout = prs.slide_layouts[0] # Title Slide layout
slide = prs.slides.add_slide(title_layout)
title = slide.shapes.title
subtitle = slide.placeholders[1]
title.text = "Q4 2025 Business Review"
subtitle.text = "Presented by Product Team"
# Content slide with bullets
bullet_layout = prs.slide_layouts[1] # Title and Content
slide = prs.slides.add_slide(bullet_layout)
slide.shapes.title.text = "Key Highlights"
body = slide.placeholders[1]
tf = body.text_frame
tf.text = "Revenue grew 25% YoY"
p = tf.add_paragraph()
p.text = "Customer base expanded to 10,000+"
p.level = 0
p = tf.add_paragraph()
p.text = "New enterprise tier launched"
p.level = 1 # Indented bullet
# Add speaker notes
notes_slide = slide.notes_slide
notes_slide.notes_text_frame.text = "Emphasize the enterprise growth story here."
prs.save('presentation.pptx')
import pptxgen from 'pptxgenjs';
async function main() {
const pptx = new pptxgen();
pptx.author = 'Product Team';
pptx.title = 'Q4 Business Review';
// Title slide
let slide = pptx.addSlide();
slide.addText('Q4 2025 Business Review', {
x: 1, y: 2, w: '80%',
fontSize: 36, bold: true, color: '363636',
align: 'center',
});
slide.addText('Presented by Product Team', {
x: 1, y: 3.5, w: '80%',
fontSize: 18, color: '666666',
align: 'center',
});
// Content slide with bullets
slide = pptx.addSlide();
slide.addText('Key Highlights', {
x: 0.5, y: 0.5, w: '90%',
fontSize: 28, bold: true,
});
slide.addText([
{ text: 'Revenue grew 25% YoY', options: { bullet: true } },
{ text: 'Customer base expanded to 10,000+', options: { bullet: true } },
{ text: 'New enterprise tier launched', options: { bullet: true, indentLevel: 1 } },
], { x: 0.5, y: 1.5, w: '90%', fontSize: 18 });
// Add chart
slide = pptx.addSlide();
slide.addChart(pptx.ChartType.bar, [
{ name: 'Sales', labels: ['Q1', 'Q2', 'Q3', 'Q4'], values: [100, 150, 180, 225] },
], { x: 1, y: 1.5, w: 8, h: 4 });
await pptx.writeFile({ fileName: 'presentation.pptx' });
}
main();
from pptx import Presentation
from pptx.util import Inches
from pptx.chart.data import CategoryChartData
from pptx.enum.chart import XL_CHART_TYPE
prs = Presentation()
slide = prs.slides.add_slide(prs.slide_layouts[6]) # Blank
# Chart data
chart_data = CategoryChartData()
chart_data.categories = ['Q1', 'Q2', 'Q3', 'Q4']
chart_data.add_series('Revenue', (100, 150, 180, 225))
chart_data.add_series('Expenses', (80, 90, 100, 110))
# Add chart
x, y, cx, cy = Inches(1), Inches(1.5), Inches(8), Inches(5)
chart = slide.shapes.add_chart(
XL_CHART_TYPE.COLUMN_CLUSTERED,
x, y, cx, cy,
chart_data
).chart
chart.has_legend = True
chart.legend.include_in_layout = False
prs.save('charts.pptx')
from pptx import Presentation
from pptx.util import Inches
prs = Presentation()
slide = prs.slides.add_slide(prs.slide_layouts[6]) # Blank
# Add image
slide.shapes.add_picture('logo.png', Inches(0.5), Inches(0.5), width=Inches(2))
# Add table
rows, cols = 4, 3
table = slide.shapes.add_table(rows, cols, Inches(1), Inches(2), Inches(8), Inches(3)).table
# Set column headers
table.cell(0, 0).text = 'Product'
table.cell(0, 1).text = 'Sales'
table.cell(0, 2).text = 'Growth'
# Fill data
data = [
('Widget A', '$1.2M', '+25%'),
('Widget B', '$800K', '+15%'),
('Widget C', '$500K', '+40%'),
]
for row_idx, (product, sales, growth) in enumerate(data, 1):
table.cell(row_idx, 0).text = product
table.cell(row_idx, 1).text = sales
table.cell(row_idx, 2).text = growth
prs.save('images_and_tables.pptx')
from pptx import Presentation
prs = Presentation('existing.pptx')
for slide_num, slide in enumerate(prs.slides, 1):
print(f"\n--- Slide {slide_num} ---")
for shape in slide.shapes:
if shape.has_text_frame:
for paragraph in shape.text_frame.paragraphs:
print(paragraph.text)
if shape.has_table:
table = shape.table
for row in table.rows:
row_text = [cell.text for cell in row.cells]
print(row_text)
| Layout Index | Name | Use Case |
|---|---|---|
| 0 | Title Slide | Opening, section dividers |
| 1 | Title and Content | Standard bullet slides |
| 2 | Section Header | Section transitions |
| 3 | Two Content | Side-by-side comparison |
| 4 | Comparison | Pros/cons, before/after |
| 5 | Title Only | Custom content placement |
| 6 | Blank | Full creative control |
| 7 | Content with Caption | Image + description |
PITCH DECK STRUCTURE
1. Title (company, tagline)
2. Problem (pain point)
3. Solution (your product)
4. Market Size (TAM/SAM/SOM)
5. Business Model (how you make money)
6. Traction (metrics, growth)
7. Team (founders, advisors)
8. Competition (landscape)
9. Financials (projections)
10. Ask (funding, next steps)
QUARTERLY REVIEW STRUCTURE
1. Title + Agenda
2. Executive Summary (KPIs dashboard)
3. Revenue & Growth
4. Product Updates
5. Customer Highlights
6. Challenges & Learnings
7. Next Quarter Goals
8. Q&A
Use only when explicitly requested and policy-compliant.
Resources
Templates
Related Skills
Weekly Installs
81
Repository
GitHub Stars
49
First Seen
Jan 23, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
gemini-cli72
cursor72
opencode71
codex70
github-copilot67
cline66
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
44,900 周安装