PPT COM Scene Renderer
Overview
Use this skill to turn visual intent into an editable .pptx by writing a JSON scene and rendering it with PowerPoint COM. Prefer native PPT shapes for geometry, lines, arrows, labels, and grids; insert local PNG/JPG/SVG/EMF assets only for details that are impractical to draw with PowerPoint primitives.
Supported input modes:
- Single-image recreation: reproduce the supplied reference as an editable PPT figure.
- Multi-image composition: take selected elements from several images and unify them into one figure.
- Description-driven original design: start from a text description, create a Figure Design Plan, optionally research visual inspiration only when the user explicitly asks for it, then render the final editable PPT.
- Preview QA: inspect a rendered preview image and identify corrections before finalizing the PPT.
Bundled resources:
scripts/Render-PptScene.ps1: JSON scene to PPTX renderer.
references/scene-json-v1.md: supported JSON schema and examples.
references/design-research-workflow.md: description-driven planning, reference research, originality, and handoff templates.
references/vision-planning-workflow.md: Vision-assisted image decomposition, planning, and preview QA templates.
assets/sample/: sample scene and PNG asset for smoke testing.
Workflow
- Classify the input mode.
- Supplied image → single-image recreation.
- Multiple supplied images → multi-image composition.
- Text-only request / original figure → description-driven design.
- Rendered preview image → preview QA.
- If images are involved, run Vision analysis first.
- Single-image / multi-image / preview QA: read
references/vision-planning-workflow.md and produce vision-analysis.md (one analysis per source image for multi-image tasks) before writing scene.json.
- Vision only analyzes and plans; it does not render PPTX.
- If the task is description-driven, read
references/design-research-workflow.md and produce a Figure Design Plan (design-plan.md) before writing scene.json.
- Reference research (Nature / Science / design galleries) is opt-in, not default. Trigger it only when the user explicitly says one of: "参考 / 灵感 / Nature 风 / Science 风 / 设计网站 / benchmark / find inspiration / look up references" or equivalent. Otherwise skip search and design from the user's description plus local knowledge.
- When research is triggered, extract only abstract patterns (hierarchy, layout grammar, color role, annotation strategy); never copy figures, icons, palettes, or layouts. Keep
inspiration-notes.md with URLs and how the final design differs.
- If the user opted into a design plan, do not call the renderer until the plan is approved, unless the user said "直接生成 / no confirmation / skip plan".
- Preserve editability by default.
- Use PowerPoint-native shapes, text, lines, curves, groups, components, gradients, transparency, and theme references wherever practical.
- Generate or insert local PNG/SVG/EMF assets only for complex pictograms, equipment images, textures, and details that are not practical as native PPT shapes.
- Create a task folder under the project's
output/ directory.
- Path:
output/<slug>/, where <slug> is a short kebab-case name derived from the user's request (e.g. agent-workflow, chemcrow-figure). Do not place artifacts in the project root.
output/<slug>/vision-analysis.md (when applicable)
output/<slug>/design-plan.md (when applicable)
output/<slug>/inspiration-notes.md (when applicable)
output/<slug>/scene.json
output/<slug>/assets/ for generated or extracted assets
output/<slug>/<slug>.pptx for the final deck
output/<slug>/preview.png (or preview/ for multi-page exports)
- Write
scene.json using the v1 schema (references/scene-json-v1.md).
- Default canvas:
1280 x 720. For portrait figures set both canvas and page to the desired ratio.
- Draw elements in z-order: lower layers first, foreground labels and icons last.
- Use
rect, ellipse, line, polyline, freeform, path, text for editable content; svg/emf/vector for local vector files; image for raster.
- Use
group, zIndex, theme references, and built-in component elements for repeated structure.
- Follow the Typography Scale rules in
references/scene-json-v1.md — font sizes must match canvas size; do not default to small fonts.
- Save JSON as UTF-8; the renderer reads UTF-8 strictly to avoid Chinese text, bullets, and symbols becoming mojibake.
- Render with PowerShell (only after step 3's confirmation gate, if applicable):
.\scripts\Render-PptScene.ps1 `
-SceneJson .\output\example\scene.json `
-OutputPptx .\output\example\example.pptx `
-AssetRoot .\output\example
By default the renderer suppresses PowerPoint alerts, marks the presentation saved, closes the generated deck, and quits the COM PowerPoint instance to avoid AutoSave/Save prompts. When running from outside the skill directory, call the bundled script by absolute path or copy it into the workspace. If PowerPoint COM fails in a sandboxed command with a logon/session error, rerun the same command with escalated permissions.
- Use live preview when the user wants to see PowerPoint draw the diagram:
.\scripts\Render-PptScene.ps1 `
-SceneJson .\output\example\scene.json `
-OutputPptx .\output\example\example-live.pptx `
-AssetRoot .\output\example `
-LivePreview `
-StepDelayMs 120
-LivePreview shows the drawing process but still closes PowerPoint when done. Add -KeepPowerPointOpen only when the user explicitly wants the final deck left open for inspection.
Export a preview in the same COM session when visual QA is needed:
.\scripts\Render-PptScene.ps1 `
-SceneJson .\output\example\scene.json `
-OutputPptx .\output\example\example.pptx `
-AssetRoot .\output\example `
-ExportPreview `
-PreviewPath .\output\example\preview.png `
-PreviewWidth 1920 `
-PreviewHeight 1080
- Verify the output.
Reference Pointers
Detailed rules live in the references; only consult them on demand:
references/vision-planning-workflow.md — image / preview tasks (analysis template, mapping rules, preview QA).
references/design-research-workflow.md — description-driven tasks (Figure Design Plan template, opt-in reference-research rules, originality guardrails).
references/scene-json-v1.md — JSON schema, coordinate system, typography scale, component catalog, error diagnosis.
Cross-cutting rules:
- Reference research (Nature/Science/design galleries) is opt-in; trigger keywords listed in step 3 above.
- Do not place reference URLs in the final PPT unless the user asks for an appendix.
- Vision outputs are structural planning, not exact geometry — refine coordinates in
scene.json.
- For description-driven tasks, the renderer runs after plan approval (step 7 gate).
Image Composition Guidance
For rough reference-image recreation:
- Convert simple visual structures into editable PPT primitives.
- Use
freeform/path for curved arrows, smooth brackets, loops, and Bezier-like connector shapes.
- Prefer EMF/SVG insertion for complex icons that should remain crisp; fall back to generated PNG when Office vector import is unreliable.
- Match layout, relative proportions, color families, labels, arrows, and hierarchy.
- Avoid tracing every pixel; create a clean PowerPoint diagram that communicates the same structure.
- Use generated local image assets for complex pictograms or decorative fragments, then insert them with
image.
For multi-image composition:
- Normalize all source elements to one canvas coordinate system.
- Resolve style conflicts deliberately: one palette, one font system, consistent stroke widths.
- Keep provenance in element ids when helpful, such as
img1-grid, img2-arrow-style, generated-icon-reactor.
For repeated figure grammar:
- Use
component.stepCircle for numbered workflow steps.
- Use
component.skillCard for repeated skill/library cards.
- Use
component.legendItem for legend rows.
- Use
component.bracket and component.flowArrow for recurring framework connectors.
Smoke Test
From the skill directory (skills/ppt-com-scene-renderer/):
.\scripts\Render-PptScene.ps1 `
-SceneJson .\assets\sample\scene.basic.json `
-OutputPptx .\assets\sample\output\basic-grid.pptx `
-AssetRoot .\assets\sample
Expected result: a one-slide editable PowerPoint grid diagram with an inserted PNG icon. From any other working directory, call the script by absolute path.
1---2name: ppt-com-scene-renderer3description: Use whenever the user wants an editable PowerPoint (.pptx) figure, diagram, or slide — including "给我/输出/生成/做一个可编辑的 PPT"、"画一张 PPT 图"、"PPT 示意图/流程图/架构图/网络图/框架图/概念图"、"editable PPT/PPTX"、"make a PowerPoint diagram"、"draw this in PPT". Produces a real .pptx via JSON scene + PowerPoint COM, so every shape, arrow, and label stays editable in PowerPoint. Also covers recreating a reference image as a PPT figure, composing elements from multiple images into one slide, designing an original scientific or design-style figure from a text description (with optional reference research when the user explicitly asks for it), inserting generated raster/SVG/EMF assets where native PPT shapes fall short, QA-ing a rendered preview image, and live-drawing mode where the user watches PowerPoint build the slide. SKIP for plain text-only decks with no diagram intent, for read-only image export (PNG/SVG only with no .pptx requested), or when the user explicitly asks to edit an existing .pptx file in place.4---56# PPT COM Scene Renderer78## Overview910Use this skill to turn visual intent into an editable `.pptx` by writing a JSON scene and rendering it with PowerPoint COM. Prefer native PPT shapes for geometry, lines, arrows, labels, and grids; insert local PNG/JPG/SVG/EMF assets only for details that are impractical to draw with PowerPoint primitives.1112Supported input modes:1314- Single-image recreation: reproduce the supplied reference as an editable PPT figure.15- Multi-image composition: take selected elements from several images and unify them into one figure.16- Description-driven original design: start from a text description, create a Figure Design Plan, optionally research visual inspiration **only when the user explicitly asks for it**, then render the final editable PPT.17- Preview QA: inspect a rendered preview image and identify corrections before finalizing the PPT.1819Bundled resources:2021- `scripts/Render-PptScene.ps1`: JSON scene to PPTX renderer.22- `references/scene-json-v1.md`: supported JSON schema and examples.23- `references/design-research-workflow.md`: description-driven planning, reference research, originality, and handoff templates.24- `references/vision-planning-workflow.md`: Vision-assisted image decomposition, planning, and preview QA templates.25- `assets/sample/`: sample scene and PNG asset for smoke testing.2627## Workflow28291. Classify the input mode.30 - Supplied image → single-image recreation.31 - Multiple supplied images → multi-image composition.32 - Text-only request / original figure → description-driven design.33 - Rendered preview image → preview QA.342. If images are involved, run Vision analysis first.35 - Single-image / multi-image / preview QA: read `references/vision-planning-workflow.md` and produce `vision-analysis.md` (one analysis per source image for multi-image tasks) before writing `scene.json`.36 - Vision only analyzes and plans; it does not render PPTX.373. If the task is description-driven, read `references/design-research-workflow.md` and produce a `Figure Design Plan` (`design-plan.md`) before writing `scene.json`.38 - **Reference research (Nature / Science / design galleries) is opt-in, not default.** Trigger it only when the user explicitly says one of: "参考 / 灵感 / Nature 风 / Science 风 / 设计网站 / benchmark / find inspiration / look up references" or equivalent. Otherwise skip search and design from the user's description plus local knowledge.39 - When research is triggered, extract only abstract patterns (hierarchy, layout grammar, color role, annotation strategy); never copy figures, icons, palettes, or layouts. Keep `inspiration-notes.md` with URLs and how the final design differs.40 - If the user opted into a design plan, **do not call the renderer until the plan is approved**, unless the user said "直接生成 / no confirmation / skip plan".414. Preserve editability by default.42 - Use PowerPoint-native shapes, text, lines, curves, groups, components, gradients, transparency, and theme references wherever practical.43 - Generate or insert local PNG/SVG/EMF assets only for complex pictograms, equipment images, textures, and details that are not practical as native PPT shapes.445. Create a task folder under the project's `output/` directory.45 - Path: `output/<slug>/`, where `<slug>` is a short kebab-case name derived from the user's request (e.g. `agent-workflow`, `chemcrow-figure`). Do **not** place artifacts in the project root.46 - `output/<slug>/vision-analysis.md` (when applicable)47 - `output/<slug>/design-plan.md` (when applicable)48 - `output/<slug>/inspiration-notes.md` (when applicable)49 - `output/<slug>/scene.json`50 - `output/<slug>/assets/` for generated or extracted assets51 - `output/<slug>/<slug>.pptx` for the final deck52 - `output/<slug>/preview.png` (or `preview/` for multi-page exports)536. Write `scene.json` using the v1 schema (`references/scene-json-v1.md`).54 - Default canvas: `1280 x 720`. For portrait figures set both `canvas` and `page` to the desired ratio.55 - Draw elements in z-order: lower layers first, foreground labels and icons last.56 - Use `rect`, `ellipse`, `line`, `polyline`, `freeform`, `path`, `text` for editable content; `svg`/`emf`/`vector` for local vector files; `image` for raster.57 - Use `group`, `zIndex`, theme references, and built-in `component` elements for repeated structure.58 - **Follow the Typography Scale rules in `references/scene-json-v1.md` — font sizes must match canvas size; do not default to small fonts.**59 - Save JSON as UTF-8; the renderer reads UTF-8 strictly to avoid Chinese text, bullets, and symbols becoming mojibake.607. Render with PowerShell (only after step 3's confirmation gate, if applicable):6162```powershell63.\scripts\Render-PptScene.ps1 `64 -SceneJson .\output\example\scene.json `65 -OutputPptx .\output\example\example.pptx `66 -AssetRoot .\output\example67```6869By default the renderer suppresses PowerPoint alerts, marks the presentation saved, closes the generated deck, and quits the COM PowerPoint instance to avoid AutoSave/Save prompts. When running from outside the skill directory, call the bundled script by absolute path or copy it into the workspace. If PowerPoint COM fails in a sandboxed command with a logon/session error, rerun the same command with escalated permissions.70718. Use live preview when the user wants to see PowerPoint draw the diagram:7273```powershell74.\scripts\Render-PptScene.ps1 `75 -SceneJson .\output\example\scene.json `76 -OutputPptx .\output\example\example-live.pptx `77 -AssetRoot .\output\example `78 -LivePreview `79 -StepDelayMs 12080```8182`-LivePreview` shows the drawing process but still closes PowerPoint when done. Add `-KeepPowerPointOpen` only when the user explicitly wants the final deck left open for inspection.8384Export a preview in the same COM session when visual QA is needed:8586```powershell87.\scripts\Render-PptScene.ps1 `88 -SceneJson .\output\example\scene.json `89 -OutputPptx .\output\example\example.pptx `90 -AssetRoot .\output\example `91 -ExportPreview `92 -PreviewPath .\output\example\preview.png `93 -PreviewWidth 1920 `94 -PreviewHeight 108095```96979. Verify the output.98 - Confirm the `.pptx` file exists at the expected path.99 - Prefer running with `-ExportPreview` and visually inspecting `preview.png` over zip inspection.100 - Only when rendering fails or you suspect a packaging issue, inspect the PPTX package:101 ```powershell102 Add-Type -AssemblyName System.IO.Compression.FileSystem103 [IO.Compression.ZipFile]::OpenRead('output\<slug>\<slug>.pptx').Entries | Select-Object FullName104 ```105 Expect `ppt/slides/slide1.xml` (and `ppt/media/*` if images were used).106 - When a preview image is available, run Vision QA against the reference image or design plan: list missing elements, text mismatches, wrong arrows, layout drift, color drift, and font-size mismatches before rerendering.107108## Reference Pointers109110Detailed rules live in the references; only consult them on demand:111112- `references/vision-planning-workflow.md` — image / preview tasks (analysis template, mapping rules, preview QA).113- `references/design-research-workflow.md` — description-driven tasks (Figure Design Plan template, opt-in reference-research rules, originality guardrails).114- `references/scene-json-v1.md` — JSON schema, coordinate system, **typography scale**, component catalog, error diagnosis.115116Cross-cutting rules:117118- Reference research (Nature/Science/design galleries) is **opt-in**; trigger keywords listed in step 3 above.119- Do not place reference URLs in the final PPT unless the user asks for an appendix.120- Vision outputs are structural planning, not exact geometry — refine coordinates in `scene.json`.121- For description-driven tasks, the renderer runs **after** plan approval (step 7 gate).122123## Image Composition Guidance124125For rough reference-image recreation:126127- Convert simple visual structures into editable PPT primitives.128- Use `freeform`/`path` for curved arrows, smooth brackets, loops, and Bezier-like connector shapes.129- Prefer EMF/SVG insertion for complex icons that should remain crisp; fall back to generated PNG when Office vector import is unreliable.130- Match layout, relative proportions, color families, labels, arrows, and hierarchy.131- Avoid tracing every pixel; create a clean PowerPoint diagram that communicates the same structure.132- Use generated local image assets for complex pictograms or decorative fragments, then insert them with `image`.133134For multi-image composition:135136- Normalize all source elements to one canvas coordinate system.137- Resolve style conflicts deliberately: one palette, one font system, consistent stroke widths.138- Keep provenance in element ids when helpful, such as `img1-grid`, `img2-arrow-style`, `generated-icon-reactor`.139140For repeated figure grammar:141142- Use `component.stepCircle` for numbered workflow steps.143- Use `component.skillCard` for repeated skill/library cards.144- Use `component.legendItem` for legend rows.145- Use `component.bracket` and `component.flowArrow` for recurring framework connectors.146147## Smoke Test148149From the skill directory (`skills/ppt-com-scene-renderer/`):150151```powershell152.\scripts\Render-PptScene.ps1 `153 -SceneJson .\assets\sample\scene.basic.json `154 -OutputPptx .\assets\sample\output\basic-grid.pptx `155 -AssetRoot .\assets\sample156```157158Expected result: a one-slide editable PowerPoint grid diagram with an inserted PNG icon. From any other working directory, call the script by absolute path.