AI turns documents or topics into real, native PowerPoint decks—with native shapes, transitions and animations, data-backed charts and tables on demand, audio narration from speaker notes, and support for your own .pptx templates. · by Hugo He
docs(ppt): clarify canvas dimensions
hugohe3cbc209a6caa1
diff --git a/skills/ppt-master/SKILL.md b/skills/ppt-master/SKILL.mdindex a38062af..610ec2f9 100644--- a/skills/ppt-master/SKILL.md+++ b/skills/ppt-master/SKILL.md@@ -184,7 +184,7 @@ When the user provides non-Markdown content, convert immediately:python3 ${SKILL_DIR}/scripts/project_manager.py init <project_name> --format <format>```-Format options: `ppt169` (default), `ppt43`, `xhs`, `story`, etc. For the full format list, see `references/canvas-formats.md`.+Format options must be named with concrete dimensions. Default: `ppt169` = `1280x720`, `viewBox="0 0 1280 720"`. Other examples: `ppt43` = `1024x768`, `story` = `1080x1920`, `banner` = `1920x1080`. For the full format list, see `references/canvas-formats.md`.Import source content (choose based on the situation):diff --git a/skills/ppt-master/references/canvas-formats.md b/skills/ppt-master/references/canvas-formats.mdindex c5863f21..0be72bf4 100644--- a/skills/ppt-master/references/canvas-formats.md+++ b/skills/ppt-master/references/canvas-formats.md@@ -4,17 +4,18 @@## Format Quick Reference-| Format | viewBox | Ratio | Use Case |-|--------|---------|-------|----------|-| PPT 16:9 | `0 0 1280 720` | 16:9 | Business presentations, meetings |-| PPT 4:3 | `0 0 1024 768` | 4:3 | Traditional projectors, academic talks |-| Xiaohongshu (RED) | `0 0 1242 1660` | 3:4 | Image-text sharing, knowledge posts |-| WeChat Moments / IG | `0 0 1080 1080` | 1:1 | Square posters, brand showcases |-| Story / TikTok | `0 0 1080 1920` | 9:16 | Vertical stories, short video covers |-| WeChat Article Header | `0 0 900 383` | 2.35:1 | WeChat article cover images |-| Landscape Banner | `0 0 1920 1080` | 16:9 | Web banners, digital screens |-| Portrait Poster | `0 0 1080 1920` | 9:16 | Phone screens, elevator ads |-| A4 Print | `0 0 1240 1754` | 1:sqrt(2) | Print posters, flyers |+| ID | Format | Size | viewBox | Ratio | Use Case |+|----|--------|------|---------|-------|----------|+| `ppt169` | PPT 16:9 | `1280x720` | `0 0 1280 720` | 16:9 | Business presentations, meetings |+| `ppt43` | PPT 4:3 | `1024x768` | `0 0 1024 768` | 4:3 | Traditional projectors, academic talks |+| `xiaohongshu` | Xiaohongshu (RED) | `1242x1660` | `0 0 1242 1660` | 3:4 | Image-text sharing, knowledge posts |+| `moments` | WeChat Moments / IG | `1080x1080` | `0 0 1080 1080` | 1:1 | Square posters, brand showcases |+| `story` | Story / TikTok | `1080x1920` | `0 0 1080 1920` | 9:16 | Vertical stories, short video covers |+| `wechat` | WeChat Article Header | `900x383` | `0 0 900 383` | 2.35:1 | WeChat article cover images |+| `banner` | Landscape Banner | `1920x1080` | `0 0 1920 1080` | 16:9 | Web banners, digital screens |+| `a4` | A4 Print | `1240x1754` | `0 0 1240 1754` | 1:sqrt(2) | Print posters, flyers |++`ppt169` is the canonical PPT wide-screen canvas in this repo: `1280x720`, not any arbitrary 16:9 size. Same-ratio canvases such as `banner` (`1920x1080`) must be treated as different coordinate systems.## Format Selection Decision Treediff --git a/skills/ppt-master/references/template-designer.md b/skills/ppt-master/references/template-designer.mdindex dec0df80..37b88825 100644--- a/skills/ppt-master/references/template-designer.md+++ b/skills/ppt-master/references/template-designer.md@@ -130,6 +130,13 @@ summary: <one-line tone & use case>keywords: [tag1, tag2, tag3]primary_color: "#......"canvas_format: ppt169+canvas_width: 1280+canvas_height: 720+canvas_viewbox: "0 0 1280 720"+# Required when a PPTX/SVG source canvas is known; keep equal to canvas_* unless explicitly normalized.+source_canvas_width: 1280+source_canvas_height: 720+source_viewbox: "0 0 1280 720"replication_mode: standard | fidelity | mirror# Optional — only when this template overrides canonical placeholder vocabulary.# Omit entirely for `mirror` mode (mirror has no placeholders).@@ -187,7 +194,8 @@ When rewriting an existing template that contains the omitted sections, delete t### 2. Inherit Design SpecificationTemplates must strictly follow the finalized template brief and the generated `design_spec.md`:-- **Canvas dimensions**: viewBox matches the design spec+- **Canvas dimensions**: `canvas_format` is not enough; root SVG `width` / `height` / `viewBox` match `canvas_width`, `canvas_height`, and `canvas_viewbox` in the design spec+- **Source canvas**: when a PPTX/SVG reference is used, record `source_canvas_width`, `source_canvas_height`, and `source_viewbox`. If the output canvas differs from the source, normalize all geometry, typography, line heights, strokes, and image crop coordinates explicitly instead of relying on the shared aspect ratio.- **Color scheme**: Uses primary, secondary, and accent colors from the spec- **Font plan**: Uses the per-role font families declared in the spec- **Layout principles**: Margins and spacing conform to the specdiff --git a/skills/ppt-master/scripts/confirm_ui/static/app.js b/skills/ppt-master/scripts/confirm_ui/static/app.jsindex 00829f9e..d09da2f8 100644--- a/skills/ppt-master/scripts/confirm_ui/static/app.js+++ b/skills/ppt-master/scripts/confirm_ui/static/app.js@@ -326,7 +326,7 @@// Render an enumerable field: ALL options from the catalog, recommended one// badged, current selection from STATE, plus a trailing Custom box.- // `list` is either a flat array of {id,label,desc,dim} or a grouped array+ // `list` is either a flat array of {id,label,desc,dim,viewbox} or a grouped array// of {group, items:[...]}.function enumField(parent, list, recommendedId, getVal, setVal, opts2) {list = list || [];@@ -364,12 +364,16 @@function deselect() { allChips.forEach(function (c) { c.classList.remove("selected"); }); }function makeChip(o) {var label = optionLabel(o);- if (o.dim) label += " · " + o.dim;var desc = optionDesc(o);- if (desc) label += (LANG === "zh" ? ":" : " — ") + desc;var spec = specById[o.id];- if (spec && spec.note) label += " · " + spec.note;var chip = el("div", "chip");+ if (o.viewbox) {+ label = o.id + (o.dim ? " · " + o.dim : "");+ } else {+ if (o.dim) label += " · " + o.dim;+ if (desc) label += (LANG === "zh" ? ":" : " — ") + desc;+ if (spec && spec.note) label += " · " + spec.note;+ }chip.appendChild(el("span", "chip-text", label));if (spec) {// spectrum pick: badge shows its temperament tag, not the generic ★diff --git a/skills/ppt-master/scripts/confirm_ui/static/catalogs.json b/skills/ppt-master/scripts/confirm_ui/static/catalogs.jsonindex 73686c48..8560c83f 100644--- a/skills/ppt-master/scripts/confirm_ui/static/catalogs.json+++ b/skills/ppt-master/scripts/confirm_ui/static/catalogs.json@@ -7,6 +7,7 @@"label_zh": "宽屏演示 16:9","label_en": "PPT 16:9","dim": "1280×720",+ "viewbox": "0 0 1280 720","use_zh": "现代投影 / 在线演示","use_en": "Modern projectors / online"},@@ -16,6 +17,7 @@"label_zh": "传统演示 4:3","label_en": "PPT 4:3","dim": "1024×768",+ "viewbox": "0 0 1024 768","use_zh": "传统投影","use_en": "Traditional projectors"},@@ -25,6 +27,7 @@"label_zh": "微信公众号头图","label_en": "WeChat Article Header","dim": "900×383",+ "viewbox": "0 0 900 383","use_zh": "微信公众号文章封面","use_en": "WeChat article cover"},@@ -34,6 +37,7 @@"label_zh": "小红书图文","label_en": "Xiaohongshu (RED)","dim": "1242×1660",+ "viewbox": "0 0 1242 1660","use_zh": "知识分享 / 种草封面","use_en": "Knowledge sharing"},@@ -43,6 +47,7 @@"label_zh": "社交方图","label_en": "WeChat Moments / IG","dim": "1080×1080",+ "viewbox": "0 0 1080 1080","use_zh": "社交媒体方图","use_en": "Social square"},@@ -52,6 +57,7 @@"label_zh": "竖屏短视频","label_en": "Story / TikTok","dim": "1080×1920",+ "viewbox": "0 0 1080 1920","use_zh": "短视频 / 竖屏封面","use_en": "Short-video / story cover"},@@ -61,6 +67,7 @@"label_zh": "横幅","label_en": "Landscape Banner","dim": "1920×1080",+ "viewbox": "0 0 1920 1080","use_zh": "网页横幅 / 大屏","use_en": "Web banner / big screen"},@@ -70,6 +77,7 @@"label_zh": "A4 打印","label_en": "A4 Print","dim": "1240×1754",+ "viewbox": "0 0 1240 1754","use_zh": "打印 / 文档导出","use_en": "Print / PDF export"}diff --git a/skills/ppt-master/workflows/create-template.md b/skills/ppt-master/workflows/create-template.mdindex 31ed5bed..a84dfb19 100644--- a/skills/ppt-master/workflows/create-template.md+++ b/skills/ppt-master/workflows/create-template.md@@ -126,7 +126,7 @@ Before composing Step 2, extract the template's reusable norms from the previous| Norm area | Extract from | Record as ||---|---|---|-| Canvas / page geometry | `manifest.json` slide size, SVG `viewBox` | `[fact]` canvas format and aspect ratio |+| Canvas / page geometry | `manifest.json` slide size, SVG `width` / `height` / `viewBox` | `[fact]` canvas format, pixel dimensions, source `viewBox`, and aspect ratio || Identity system | theme colors, font usage, logo / emblem assets, recurring backgrounds | `[fact]` when imported; `[suggested]` only for visual estimates || Layout grammar | masters / layouts, repeated chrome, margins, columns, card grids, section dividers | Template-specific rules, not generic spacing boilerplate || Image system | image crops, masks, full-bleed zones, hero-image placement, mosaic rules, caption / overlay treatment | Template-specific image-placement rules with source examples |@@ -202,7 +202,7 @@ Compose a single message that surfaces every Required brief item to the user, **| Template kind | Recommended localized label with English ID, plus both options and the rule for choosing || Category | Recommended localized category with English ID, plus `brand` / `general` / `scenario` / `government` / `special` with localized explanations || Theme mode | Recommended localized mode with English ID, plus available modes such as `light` / `dark` / `mixed` with localized explanations |-| Canvas format | Recommended canvas, plus other supported formats from [`canvas-formats.md`](../references/canvas-formats.md) that fit the source aspect ratio or user intent |+| Canvas format | Recommended canvas, plus other supported formats from [`canvas-formats.md`](../references/canvas-formats.md) that fit the source aspect ratio or user intent. Always show the concrete pixel size and `viewBox`; do not treat two same-ratio formats such as `ppt169` (`1280x720`) and `banner` (`1920x1080`) as interchangeable. || Replication mode | Recommended localized mode with English ID, plus all modes available for the current input type; list forbidden modes for type C / D as unavailable with localized reasons || Visual fidelity for fixed pages | Recommended localized choice with English ID, plus both `literal` / `adapted` options when applicable || Asset bundling | Recommended included assets, plus excluded candidate assets with a one-line reason when reference assets exist |@@ -217,7 +217,7 @@ Items to surface:| Applicable scenarios | Yes | `[suggested]` from analysis; user confirms || Tone summary | Yes | `[suggested]` from analysis (e.g. `Modern, restrained, data-driven`) || Theme mode | Yes | A: `[fact]` from `manifest.json` background colors. B: `[fact]` from SVG `fill`. C: `[suggested]` from visual estimate. D: `[decision]` |-| Canvas format | Yes | A/B: `[fact]` from slide size or SVG `viewBox`. C: `[suggested]` from image aspect ratio. D: `[decision]`, default `ppt169` |+| Canvas format and dimensions | Yes | A/B: `[fact]` from slide size or SVG `width` / `height` / `viewBox`; show `canvas_format`, `canvas_width`, `canvas_height`, `canvas_viewbox`, and `source_viewbox`. C: `[suggested]` from image aspect ratio. D: `[decision]`, default `ppt169` (`1280x720`, `0 0 1280 720`) || Replication mode | Yes | `[decision]` — `standard` always available; `fidelity` and `mirror` available for type A (canonical, manifest-anchored) and type B (AI visual clustering / direct 1:1 copy — see Step 1 caveats); reject `fidelity` / `mirror` upfront for type C / D || Visual fidelity for fixed pages | Yes for `standard` / `fidelity` when reference exists; **N/A for `mirror`** (mirror is implicitly literal) | `[decision]` — `literal` (preserve original geometry / decoration / sprite crops as-is; for cover / chapter / ending especially) or `adapted` (use the reference for tone/structure but allow design evolution). Different page types may take different settings || Basic template norms | Yes when reference exists | `[fact]` / `[suggested]` — layout grammar, image system, density rhythm, page roster semantics, and asset policy extracted in Step 1 |@@ -235,7 +235,7 @@ For type A, also include in this message:The user replies with corrections, additions, or "all good".-> **Persist the brief into `design_spec.md`**. When the Template_Designer writes `design_spec.md` in Step 4, declare a YAML frontmatter block at the top with the confirmed brief (`template_id`, `category`, `summary`, `keywords`, `primary_color`, `canvas_format`, `replication_mode`, etc.). `register_template.py` reads this in Step 6, so the brief flows directly into the index without the AI re-deriving it from prose. See Step 6 for the recommended frontmatter shape.+> **Persist the brief into `design_spec.md`**. When the Template_Designer writes `design_spec.md` in Step 4, declare a YAML frontmatter block at the top with the confirmed brief (`template_id`, `category`, `summary`, `keywords`, `primary_color`, `canvas_format`, `canvas_width`, `canvas_height`, `canvas_viewbox`, `source_viewbox`, `replication_mode`, etc.). `register_template.py` reads this in Step 6, so the brief flows directly into the index without the AI re-deriving it from prose. See Step 6 for the recommended frontmatter shape.---@@ -350,7 +350,8 @@ python3 skills/ppt-master/scripts/svg_quality_checker.py "skills/ppt-master/temp- [ ] Every page declared in `design_spec.md §V Page Roster` exists as an SVG file in the template directory (and vice versa — no orphan files)- [ ] Variant filenames follow the letter-suffix convention (e.g. `03a_content_two_col.svg`); variants typically reuse the parent type's placeholder set unless the spec frontmatter declares otherwise- [ ] If TOC exists, placeholder pattern uses the canonical indexed form-- [ ] SVG viewBox matches the chosen canvas format (for `ppt169`: `0 0 1280 720`)+- [ ] `design_spec.md` frontmatter declares `canvas_format`, `canvas_width`, `canvas_height`, and `canvas_viewbox`; PPTX/SVG-backed templates also declare `source_canvas_width`, `source_canvas_height`, and `source_viewbox`+- [ ] SVG `width` / `height` / `viewBox` match the declared canvas dimensions, not just the aspect ratio (for `ppt169`: `1280x720`, `0 0 1280 720`; for `banner`: `1920x1080`, `0 0 1920 1080`)- [ ] Placeholder names follow the canonical convention where applicable; templates with intentionally different vocabularies (e.g. `{{KEY_MESSAGE}}` instead of `{{PAGE_TITLE}}`) should declare a `placeholders:` frontmatter block to silence advisory warnings- [ ] Asset files referenced by SVGs actually exist in the template package- [ ] If any SVG references an extracted vector `data-icon`, the corresponding SVG asset exists directly under the package's `icons/` directory; do not add a separate illustration embedding script@@ -394,6 +395,12 @@ The index file is a **discovery index** — it lets the AI answer "what template> kind: deck> summary: ...> canvas_format: ppt169+> canvas_width: 1280+> canvas_height: 720+> canvas_viewbox: "0 0 1280 720"+> source_canvas_width: 1280+> source_canvas_height: 720+> source_viewbox: "0 0 1280 720"> page_count: 5> primary_color: "#005587"> ---@@ -404,6 +411,12 @@ The index file is a **discovery index** — it lets the AI answer "what template> kind: layout> summary: ...> canvas_format: ppt169+> canvas_width: 1280+> canvas_height: 720+> canvas_viewbox: "0 0 1280 720"+> source_canvas_width: 1280+> source_canvas_height: 720+> source_viewbox: "0 0 1280 720"> page_count: 5> page_types: [cover, toc, chapter, content, ending]> ---