OfficeCLI PPTX Skill
BEFORE YOU START (CRITICAL)
Every time before using officecli, run this check:
CODEBLOCK0
Quick Reference
| Task | Action |
|---|
| Read / analyze content | Use view and get commands below |
| Edit existing presentation |
Read
editing.md |
| Create from scratch | Read
creating.md |
Reading & Analyzing
Text Extraction
CODEBLOCK1
Structure Overview
CODEBLOCK2
Output shows slide titles, shape counts, and picture counts per slide.
Detailed Inspection
CODEBLOCK3
Shows shape types, fonts, sizes, pictures with alt text status, tables with dimensions.
Statistics
CODEBLOCK4
Slide count, shape count, font usage, missing titles, missing alt text.
Element Inspection
CODEBLOCK5
CSS-like Queries
CODEBLOCK6
Visual Inspection
CODEBLOCK7
Note: SVG renders only one slide per invocation (the first in the range). Use html --browser for multi-slide preview with full chart/gradient/table rendering.
Design Principles
Don't create boring slides. Plain bullets on a white background won't impress anyone.
Before Starting
- - Pick a bold, content-informed color palette: The palette should feel designed for THIS topic. If swapping your colors into a completely different presentation would still "work," you haven't made specific enough choices.
- Dominance over equality: One color should dominate (60-70% visual weight), with 1-2 supporting tones and one sharp accent. Never give all colors equal weight.
- Dark/light contrast: Dark backgrounds for title + conclusion slides, light for content ("sandwich" structure). Or commit to dark throughout for a premium feel.
- Commit to a visual motif: Pick ONE distinctive element and repeat it -- rounded image frames, icons in colored circles, thick single-side borders. Carry it across every slide.
Color Palettes
Choose colors that match your topic -- don't default to generic blue:
| Theme | Primary | Secondary | Accent | Text | Muted/Caption |
|---|
| Coral Energy | INLINECODE3 (coral) | INLINECODE4 (gold) | INLINECODE5 (navy) | INLINECODE6 (charcoal) | INLINECODE7 (warm gray) |
| Midnight Executive |
1E2761 (navy) |
CADCFC (ice blue) |
FFFFFF (white) |
333333 (charcoal) |
8899BB (slate) |
|
Forest & Moss |
2C5F2D (forest) |
97BC62 (moss) |
F5F5F5 (cream) |
2D2D2D (near-black) |
6B8E6B (faded green) |
|
Charcoal Minimal |
36454F (charcoal) |
F2F2F2 (off-white) |
212121 (black) |
333333 (dark gray) |
7A8A94 (cool gray) |
|
Warm Terracotta |
B85042 (terracotta) |
E7E8D1 (sand) |
A7BEAE (sage) |
3D2B2B (brown-black) |
8C7B75 (dusty brown) |
|
Berry & Cream |
6D2E46 (berry) |
A26769 (dusty rose) |
ECE2D0 (cream) |
3D2233 (dark berry) |
8C6B7A (mauve gray) |
|
Ocean Gradient |
065A82 (deep blue) |
1C7293 (teal) |
21295C (midnight) |
2B3A4E (dark slate) |
6B8FAA (steel blue) |
|
Teal Trust |
028090 (teal) |
00A896 (seafoam) |
02C39A (mint) |
2D3B3B (dark teal) |
5E8C8C (muted teal) |
|
Sage Calm |
84B59F (sage) |
69A297 (eucalyptus) |
50808E (slate) |
2D3D35 (dark green) |
7A9488 (faded sage) |
|
Cherry Bold |
990011 (cherry) |
FCF6F5 (off-white) |
2F3C7E (navy) |
333333 (charcoal) |
8B6B6B (dusty red) |
Use Text for body copy on light backgrounds, Muted for captions, labels, and axis text. On dark backgrounds, use the Secondary or FFFFFF for body text and Muted for captions.
Need a color not in the table? These palettes are starting points. You can add accent colors (e.g., gold D4A843 with Forest & Moss) or blend palettes to match the topic. If a user requests a palette that doesn't exist by name (e.g., "Forest & Gold"), use the closest match and supplement with appropriate accent tones.
Typography
Choose an interesting font pairing -- don't default to Arial.
| Header Font | Body Font | Best For |
|---|
| Georgia | Calibri | Formal business, finance, executive reports |
| Arial Black |
Arial | Bold marketing, product launches |
| Calibri | Calibri Light | Clean corporate, minimal design |
| Cambria | Calibri | Traditional professional, legal, academic |
| Trebuchet MS | Calibri | Friendly tech, startups, SaaS |
| Impact | Arial | Bold headlines, event decks, keynotes |
| Palatino | Garamond | Elegant editorial, luxury, nonprofit |
| Consolas | Calibri | Developer tools, technical/engineering |
| Element | Size |
|---|
| Slide title | 36-44pt bold |
| Section header |
20-24pt bold |
| Body text | 14-16pt |
| Captions | 10-12pt muted |
Layout Variety
Every slide needs a visual element -- image, chart, icon, or shape. Text-only slides are forgettable.
Vary across these layout types:
- - Two-column (text left, visual right)
- Icon + text rows (icon in colored circle, bold header, description)
- 2x2 or 2x3 grid (content blocks)
- Half-bleed image (full left/right side) with content overlay
- Large stat callouts (big numbers 60-72pt with small labels below)
- Comparison columns (before/after, pros/cons)
- Timeline or process flow (numbered steps, arrows)
Content-to-Layout Quick Guide
These are starting points. Adapt based on content density and narrative flow.
| Content Type | Recommended Layout | Why |
|---|
| Pricing / plan tiers | 2-3 column cards (comparison) | Side-by-side enables instant comparison |
| Team / people |
Icon grid or 2x3 cards | Faces/avatars need equal visual weight |
| Timeline / roadmap | Process flow with arrows or numbered steps | Left-to-right communicates sequence |
| Key metrics / KPIs | Large stat callouts (3-4 big numbers) | Big numbers grab attention; labels below |
| Testimonials / quotes | Full-width quote with attribution | Generous whitespace signals credibility |
| Feature comparison | Two-column before/after or table | Parallel structure aids scanning |
| Architecture / system | Shapes + connectors diagram | Spatial relationships need visual expression |
| Financial data | Chart + summary table side-by-side | Chart shows trend; table provides precision |
Spacing
- - 0.5" (1.27cm) minimum margins from slide edges
- 0.3-0.5" (0.76-1.27cm) between content blocks
- Leave breathing room -- don't fill every inch
Avoid (Common Mistakes)
- - Don't repeat the same layout -- vary columns, cards, and callouts across slides
- Don't center body text -- left-align paragraphs and lists; center only titles
- Don't skimp on size contrast -- titles need 36pt+ to stand out from 14-16pt body
- Don't default to blue -- pick colors that reflect the specific topic
- Don't mix spacing randomly -- choose 0.3" or 0.5" gaps and use consistently
- Don't style one slide and leave the rest plain -- commit fully or keep it simple throughout
- Don't create text-only slides -- add images, icons, charts, or visual elements
- Don't forget text box padding -- when aligning shapes with text edges, set
margin=0 on the text box or offset to account for default padding - Don't use low-contrast elements -- icons AND text need strong contrast against the background
- NEVER use accent lines under titles -- these are a hallmark of AI-generated slides; use whitespace or background color instead
QA (Required)
Assume there are problems. Your job is to find them.
Your first render is almost never correct. Approach QA as a bug hunt, not a confirmation step. If you found zero issues on first inspection, you weren't looking hard enough.
Content QA
CODEBLOCK8
Note: view issues reports "Slide has no title" for all blank-layout slides. This is expected when using layout=blank (the recommended approach for custom designs). These warnings can be safely ignored.
When editing templates, check for leftover placeholder text:
CODEBLOCK9
Visual QA
Use subagents -- even for 2-3 slides. You've been staring at the code and will see what you expect, not what's there. Subagents have fresh eyes.
CODEBLOCK10
SVG limitations: SVG renders only one slide (the first in the --start/--end range). Gradient backgrounds, charts, and tables are not visible in SVG output. For full-fidelity multi-slide preview including charts and gradients, use HTML mode:
CODEBLOCK11
Prompt for visual QA subagent:
CODEBLOCK12
Editing-specific QA checklist (in addition to the above):
- - [ ] On every template slide (not new blank slides), verify that NO decorative element (
!!-prefixed shape) overlaps or obscures content text - [ ] Verify all hero numbers / key metrics are visible (not hidden by card fills or same-color-as-background)
- [ ] On dark background slides, verify chart bars/lines, axis labels, and gridlines are visible
Validation
CODEBLOCK13
Pre-Delivery Checklist
Before declaring a presentation complete, verify:
- - [ ] Speaker notes on all content slides (not just title/closing)
- [ ] At least one transition style applied (fade for title, push or wipe for content)
- [ ] Alt text on all pictures
- [ ] At least 3 different layout types used across slides
- [ ] No two consecutive slides share the same layout pattern
Verification Loop
- 1. Generate slides
- Run
view issues + validate + visual inspection - List issues found (if none found, look again more critically)
- Fix issues
- Re-verify affected slides -- one fix often creates another problem
- Repeat until a full pass reveals no new issues
Do not declare success until you've completed at least one fix-and-verify cycle.
Common Pitfalls
| Pitfall | Correct Approach |
|---|
| INLINECODE63 | Use --prop name="foo" -- all attributes go through INLINECODE65 |
| INLINECODE66 |
Negative coordinates not supported. Use
x=0cm instead |
|
/shape[myname] | Name indexing not supported. Use numeric index:
/shape[3] |
| Guessing property names | Run
officecli pptx set shape to see exact names |
|
\n in shell strings | Use
\\n for newlines in
--prop text="line1\\nline2" |
| Modifying an open file | Close the file in PowerPoint/WPS first |
| Hex colors with
# | Use
FF0000 not
#FF0000 -- no hash prefix |
| Theme colors | Use
accent1..
accent6,
dk1,
dk2,
lt1,
lt2 -- not hex |
| Forgetting alt text | Always set
--prop alt="description" on pictures for accessibility |
| Paths are 1-based |
/slide[1],
/shape[1] -- XPath convention |
|
--index is 0-based |
--index 0 = first position -- array convention |
| Unquoted
[N] in zsh/bash | Shell glob-expands
/slide[1] -- always quote paths:
"/slide[1]" |
| Z-order (shapes overlapping) | Use
--prop zorder=back or
zorder=front /
forward /
backward / absolute position number.
WARNING: Z-order changes cause shape index renumbering -- re-query with
get --depth 1 after any z-order change before referencing shapes by index. Process highest index first when changing multiple shapes. |
|
gap/
gapwidth on chart add | Ignored during
add -- set it after creation:
officecli set ... /slide[N]/chart[M] --prop gap=80 |
|
$ and
' in batch JSON text | Use heredoc:
cat <<'EOF' \| officecli batch -- single-quoted delimiter prevents shell expansion of
$, apostrophes, and backticks |
| Template text at wrong size | Template shapes have baked-in font sizes. Always include
size,
font, and
color in every
set on template shapes. See editing.md "Font Cascade from Template Shapes" section. |
Performance: Resident Mode
For multi-step workflows (3+ commands on the same file), use open/close:
CODEBLOCK14
Performance: Batch Mode
Execute multiple operations in a single open/save cycle:
CODEBLOCK15
Batch supports: add, set, get, query, remove, move, view, raw, raw-set, validate.
Batch mode works with resident mode. Run officecli open file.pptx first, then pipe batch commands, then officecli close file.pptx. This combines batch efficiency with resident mode's persistent file handle.
Batch fields: command, path, parent, type, from, to, index, props (dict), selector, mode, depth, part, xpath, action, xml.
INLINECODE137 = container to add into (for add, including clone via from field). path = element to modify (for set, get, remove, move).
Known Issues
| Issue | Workaround |
|---|
Chart series cannot be added after creation: set --prop data= and set --prop seriesN= on an existing chart can only update existing series -- they cannot add new series. The series count is fixed at creation time. | Include all series in the add command (using series1+series2 props or the data prop). Both forms work reliably in single commands and in batch mode. If you need to add series to an existing chart, delete it and recreate: officecli remove file.pptx "/slide[N]/chart[M]" then officecli add with all series. See creating.md "Multi-Series Column Chart" and editing.md "Update Charts". |
Chart schema validation warning: Some modern chart styling combinations produce a ChartShapeProperties schema warning from officecli validate. This does not affect PowerPoint rendering. |
Ignore the warning if the chart opens correctly in PowerPoint. |
|
Table font cascade overwritten by row set: Setting
size/
font on the table path and then setting row content with
set tr[N] resets font properties on that row to defaults. | Set table-level
size/
font after all row content is populated, or include
size/
font in each row-level
set command. |
|
Shell quoting in batch with echo:
echo '...' \| officecli batch fails when JSON values contain apostrophes or
$ characters (common in English text and currency). | Use a heredoc instead:
cat <<'EOF' \| officecli batch file.pptx ...
EOF. The single-quoted heredoc delimiter prevents all shell interpolation. |
|
Batch intermittent failure: Approximately 1-in-15 batch operations may fail with "Failed to send to resident" when using batch mode with resident mode (
open/
close). | Retry the failed batch command. If the error persists, close and re-open the file:
officecli close file.pptx && officecli open file.pptx, then retry. For critical workflows, consider splitting large batch arrays into smaller chunks (10-15 operations each). |
|
Table cell solidFill schema warning: Setting
color on table cell run properties may produce
solidFill schema validation errors. The table renders correctly in PowerPoint. | Ignore if the table opens correctly. Alternatively, set text color at the row level (
set tr[N] --prop color=HEX) instead of the cell level. |
|
Multi-series chart rendering in SVG/screenshot: SVG and screenshot renders may show fewer series than actually exist in the chart data. The chart data is correct but the rendering engine does not always display all series visually. | Verify multi-series charts by opening the .pptx in PowerPoint or by using
get /slide[N]/chart[M] to confirm all series are present in the data. Do not rely solely on SVG/screenshot visual QA for multi-series verification. |
Help System
When unsure about property names, value formats, or command syntax, run help instead of guessing. One help query is faster than guess-fail-retry loops.
CODEBLOCK16
OfficeCLI PPTX 技能
开始前(关键)
每次使用 officecli 前,运行此检查:
bash
if ! command -v officecli &> /dev/null; then
echo 正在安装 officecli...
curl -fsSL https://raw.githubusercontent.com/iOfficeAI/OfficeCli/main/install.sh -o /tmp/officecliinstall.sh && bash /tmp/officecliinstall.sh && rm -f /tmp/officecli_install.sh
# Windows: irm https://raw.githubusercontent.com/iOfficeAI/OfficeCli/main/install.ps1 -OutFile $env:TEMP\officecliinstall.ps1; & $env:TEMP\officecliinstall.ps1
else
CURRENT=$(officecli --version 2>&1 | grep -oE [0-9]+\.[0-9]+\.[0-9]+ | head -1)
LATEST=$(curl -fsSL https://api.github.com/repos/iOfficeAI/OfficeCLI/releases/latest | grep tag_name | sed -E s/.v?([0-9.]+)./\1/)
if [ $CURRENT != $LATEST ]; then
echo 正在升级 officecli $CURRENT → $LATEST...
curl -fsSL https://raw.githubusercontent.com/iOfficeAI/OfficeCli/main/install.sh -o /tmp/officecliinstall.sh && bash /tmp/officecliinstall.sh && rm -f /tmp/officecli_install.sh
else
echo officecli $CURRENT 已是最新版本
fi
fi
officecli --version
快速参考
| 任务 | 操作 |
|---|
| 读取/分析内容 | 使用下面的 view 和 get 命令 |
| 编辑现有演示文稿 |
阅读
editing.md |
| 从头创建 | 阅读
creating.md |
读取与分析
文本提取
bash
officecli view slides.pptx text
officecli view slides.pptx text --start 1 --end 5
结构概览
bash
officecli view slides.pptx outline
输出显示每张幻灯片的标题、形状数量和图片数量。
详细检查
bash
officecli view slides.pptx annotated
显示形状类型、字体、大小、图片及其替代文本状态、表格及其尺寸。
统计信息
bash
officecli view slides.pptx stats
幻灯片数量、形状数量、字体使用情况、缺失标题、缺失替代文本。
元素检查
bash
列出幻灯片上的所有形状
officecli get slides.pptx /slide[1] --depth 1
获取形状详情(位置、填充、字体、动画等)
officecli get slides.pptx /slide[1]/shape[1]
获取图表数据和配置
officecli get slides.pptx /slide[1]/chart[1]
获取表格结构
officecli get slides.pptx /slide[1]/table[1] --depth 3
按类型获取占位符
officecli get slides.pptx /slide[1]/placeholder[title]
CSS 风格查询
bash
查找包含特定文本的形状
officecli query slides.pptx shape:contains(收入)
查找没有替代文本的图片
officecli query slides.pptx picture:no-alt
查找具有特定填充颜色的形状
officecli query slides.pptx shape[fill=#4472C4]
查找宽度大于10cm的形状
officecli query slides.pptx shape[width>=10cm]
查找特定幻灯片上的形状
officecli query slides.pptx slide[2] > shape[font=Arial]
视觉检查
bash
SVG渲染(单张幻灯片,自包含,无依赖)
officecli view slides.pptx svg --start 1 --end 1 --browser
HTML渲染(所有幻灯片,交互式,包含图表和3D -- 推荐)
officecli view slides.pptx html --browser
注意: SVG每次调用只渲染一张幻灯片(范围内的第一张)。如需多张幻灯片预览并包含完整的图表/渐变/表格渲染,请使用 html --browser。
设计原则
不要创建无聊的幻灯片。 白色背景上的纯项目符号不会给任何人留下深刻印象。
开始前
- - 选择大胆且与内容相关的配色方案:配色方案应针对当前主题进行设计。如果将你的颜色换到完全不同的演示文稿中仍然适用,说明你的选择不够具体。
- 主次分明:一种颜色应占主导地位(60-70%的视觉权重),搭配1-2种辅助色调和一种鲜明的强调色。切勿让所有颜色权重相等。
- 明暗对比:标题和结论幻灯片使用深色背景,内容幻灯片使用浅色背景(三明治结构)。或者全程使用深色背景以获得高级感。
- 确定视觉主题:选择一个独特的元素并重复使用——圆角图片框、彩色圆圈中的图标、粗的单侧边框。在每张幻灯片上保持一致。
配色方案
选择与主题匹配的颜色——不要默认使用通用蓝色:
| 主题 | 主色 | 辅助色 | 强调色 | 文本色 | 柔和/说明色 |
|---|
| 珊瑚能量 | F96167(珊瑚色) | F9E795(金色) | 2F3C7E(海军蓝) | 333333(炭灰色) | 8B7E6A(暖灰色) |
| 午夜行政 |
1E2761(海军蓝) | CADCFC(冰蓝色) | FFFFFF(白色) | 333333(炭灰色) | 8899BB(石板灰) |
|
森林与苔藓 | 2C5F2D(森林绿) | 97BC62(苔藓绿) | F5F5F5(奶油色) | 2D2D2D(近黑色) | 6B8E6B(褪色绿) |
|
炭灰极简 | 36454F(炭灰色) | F2F2F2(米白色) | 212121(黑色) | 333333(深灰色) | 7A8A94(冷灰色) |
|
暖陶土 | B85042(陶土色) | E7E8D1(沙色) | A7BEAE(鼠尾草绿) | 3D2B2B(棕黑色) | 8C7B75(土棕色) |
|
浆果与奶油 | 6D2E46(浆果色) | A26769(灰玫瑰色) | ECE2D0(奶油色) | 3D2233(深浆果色) | 8C6B7A(紫灰色) |
|
海洋渐变 | 065A82(深蓝色) | 1C7293(蓝绿色) | 21295C(午夜蓝) | 2B3A4E(深石板色) | 6B8FAA(钢蓝色) |
|
蓝绿色信任 | 028090(蓝绿色) | 00A896(海沫绿) | 02C39A(薄荷绿) | 2D3B3B(深蓝绿色) | 5E8C8C(柔和蓝绿色) |
|
鼠尾草宁静 | 84B59F(鼠尾草绿) | 69A297(桉树绿) | 50808E(石板色) | 2D3D35(深绿色) | 7A9488(褪色鼠尾草绿) |
|
樱桃大胆 | 990011(樱桃红) | FCF6F5(米白色) | 2F3C7E(海军蓝) | 333333(炭灰色) | 8B6B6B(暗红色) |
在浅色背景上使用文本色作为正文,使用柔和色作为说明文字、标签和坐标轴文本。在深色背景上,使用辅助色或 FFFFFF 作为正文,使用柔和色作为说明文字。
需要表中没有的颜色? 这些配色方案是起点。你可以添加强调色(例如,在森林与苔藓方案中添加金色 D4A843)或混合配色方案以匹配主题。如果用户请求一个按名称不存在的配色方案(例如,森林与金色),请使用最接近的匹配并补充适当的强调色调。
排版
选择有趣的字体搭配——不要默认使用Arial。
| 标题字体 | 正文字体 | 最适合 |
|-------------