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
fix(svg-authoring): clarify contracts and actionable diagnostics
hugohe346590d9b776c
diff --git a/skills/ppt-master/references/executor-base.md b/skills/ppt-master/references/executor-base.mdindex 222fcdbb..c8cca775 100644--- a/skills/ppt-master/references/executor-base.md+++ b/skills/ppt-master/references/executor-base.md@@ -4,7 +4,7 @@**Hard rule — complete page SVG**: Every visible object intended for the exported slide MUST exist in the final page SVG or be explicitly referenced by it. Templates and `spec_lock.md` guide construction; they are not export-time overlays for missing visible content.-**Hard rule — route-specific PowerPoint structure**: Free-design and brand-only projects use `pptx_structure.mode: flat`: write no root Master/Layout identity, `data-pptx-layer`, or `data-pptx-placeholder`; every visible object remains Slide-local. Export materializes one clean project-owned Master plus one Blank Layout from the current lock. Deck/layout template projects use `mode: structured`: every page reads its locked Master/Layout row and declares the four root identity attributes from the first draft. Do not add `data-pptx-layout-kind` or duplicate identity with `data-pptx-page-role`. Add `data-pptx-role` only to structural page-frame objects whose package, page-number, or animation behavior is not already expressed by specialized metadata; the marked element uses a stable unique `id`. See [`semantic-svg.md`](./semantic-svg.md).+**Hard rule — route-specific PowerPoint structure**: Free-design and brand-only projects use `pptx_structure.mode: flat`: write no root Master/Layout identity, `data-pptx-layer`, or `data-pptx-placeholder`; every visible object remains Slide-local, and the root declares exactly one canonical `data-pptx-page-role` (`cover` / `toc` / `section` / `content` / `ending`). Export materializes one clean project-owned Master plus one Blank Layout from the current lock. Deck/layout template projects use `mode: structured`: every page reads its locked Master/Layout row and declares the four root identity attributes from the first draft. Do not add `data-pptx-layout-kind` or duplicate identity with `data-pptx-page-role`. Add `data-pptx-role` only to structural page-frame objects whose package, page-number, or animation behavior is not already expressed by specialized metadata; the marked element uses a stable unique `id`. See [`semantic-svg.md`](./semantic-svg.md).**Hard rule — supported PPTX route**: The only supported generated-PPTX path is `svg_output/` through the project SVG-to-DrawingML converter. Step 7.2 still generates `svg_final/` as a mandatory self-contained visual preview that may be inserted as an SVG picture. Do not treat PowerPoint's manual Convert-to-Shape operation as an authoring target or compatibility requirement.@@ -165,7 +165,7 @@ Before the first SVG page, output a confirmation listing: canvas dimensions, bod- Images MUST reference files listed under `images`; no invented filenames- Formula PNGs are images with `Acquire Via: formula` / `Status: Rendered`; place them only from the listed file path and never recreate the formula as text.-If a page needs a value not in `spec_lock.md`, surface it — do not silently invent one.+If a page needs a value not in `spec_lock.md`, surface it — do not silently invent one. When an intentional deck-wide or recurring color, type role/size, icon, or image is approved, extend `spec_lock.md` **before** drawing the first affected object, re-read the lock, and only then author the page; do not draw with a temporary hardcoded value and retroactively silence drift warnings.**Per-page layout rhythm — `page_rhythm` section**:@@ -195,7 +195,7 @@ Do **not** invent a prototype entry, and do **not** assume a template just becau**Per-page PowerPoint layout lookup — structured deck/layout templates only**:-- When `pptx_structure.mode` is `flat`, skip this lookup and the structured scaffold below. `pptx_masters`, `pptx_layouts`, `page_layouts`, and the corresponding SVG metadata must all be absent.+- When `pptx_structure.mode` is `flat`, skip this lookup and the structured scaffold below. `pptx_masters`, `pptx_layouts`, `page_layouts`, and the corresponding SVG metadata must all be absent; each root still declares its canonical `data-pptx-page-role`.- When a deck/layout template is active, `pptx_structure.mode` must equal `structured`; any other or missing value routes to legacy restoration.- Read the current page row as `<master_key> | <layout_key> | <layout name>` and resolve `master_key` in `pptx_masters`. Missing, malformed, or partial mappings stop before drawing.- Write matching root Master/Layout key and picker names. Do not write `data-pptx-layout-kind` or `data-pptx-page-role`.@@ -345,6 +345,8 @@ grep "chart-plot-area" <project_path>/svg_output/<current_page>.svg**Hard rule**: every data chart whose type appears in the **Supported chart types** list of [shared-standards.md](shared-standards.md) "Native PPTX Table / Chart Markers" (the single authority for the eligible set, marker contract, and JSON schemas) gets `data-pptx-native="chart"` plus a `<metadata data-pptx-native="chart">` JSON child on its top-level `<g>`, transcribing the same data just plotted. Every pure text-grid data table gets `data-pptx-native="table"` the same way, transcribing all visible cell text into `columns` / `rows`.+`data-pptx-native` is a **data-backed replacement claim**, not a generic label for a group that contains numbers. Add it only when the matching JSON payload can be written in the same edit; if the object is meant to remain SVG geometry, do not add the marker.+- Chart types absent from that list and conceptual/diagrammatic graphics (process flows, cycles, quadrant cards, timelines, KPI cards) get **no marker** — `svg_quality_checker.py` rejects unsupported marker types.- Canonical rectangular merged text cells may carry a table marker by putting anchor-only `row_span` / `col_span` in metadata and leaving covered cells blank. Nonrectangular/overlapping merges, nonblank covered cells, and graphical cells (icons, harvey balls, rating dots) get **no table marker** and stay on the SVG fallback route.- Transcribe, don't restyle: `categories` / `series[].values` are the numbers just plotted; `style.colors` carries the series HEX values already used on the page (from `spec_lock.colors`).@@ -380,6 +382,8 @@ Strategist chooses the library and inventory; Executor only implements. Library> **Resolution is project-first.** Strategist copied the chosen icons into `<project_path>/icons/<lib>/` (via `icon_sync.py`); `finalize_svg.py embed-icons` embeds from there, falling back to the global library per-icon. **Custom icons**: drop an `.svg` into `<project_path>/icons/<lib>/` (any `<lib>`, e.g. `custom/`) and reference it as `data-icon="<lib>/<name>"` — it embeds like any other. Reference only icons in the `spec_lock.md` inventory.+> **Icon identifiers are case-sensitive filenames.** For bundled libraries, copy the verified lowercase basename exactly (`tabler-outline/award`, never `tabler-outline/Award`) into `spec_lock.md` and every `data-icon` value. Custom icon identifiers preserve the custom file's exact case; the pipeline never silently lowercases names.+**Built-in icons — Placeholder method (recommended)**:```xmldiff --git a/skills/ppt-master/references/semantic-svg.md b/skills/ppt-master/references/semantic-svg.mdindex 8e1ae683..2e57943f 100644--- a/skills/ppt-master/references/semantic-svg.md+++ b/skills/ppt-master/references/semantic-svg.md@@ -6,6 +6,7 @@ PPT Master uses rendering-neutral compiler hints only where ordinary SVG cannot| Marker | Placement | Purpose ||---|---|---|+| `data-pptx-page-role` | Root `<svg>` on flat pages only | Classify a free-design/brand-only page as `cover`, `toc`, `section`, `content`, or `ending`. || `data-pptx-master` / `data-pptx-master-name` | Root `<svg>` | Bind the page to one named PowerPoint Slide Master. || `data-pptx-layout` / `data-pptx-layout-name` | Root `<svg>` | Bind the page to one named Layout under that Master. || `data-pptx-layer="master"` | Direct atomic child of root | Promote one fixed visual object to the named Master. |@@ -15,7 +16,7 @@ PPT Master uses rendering-neutral compiler hints only where ordinary SVG cannotThe completed SVG remains the full visible page. Removing the metadata must not change browser rendering. Do not copy visible text, geometry, style, or asset values into metadata.-**Hard rule — route boundary**: Free-design and brand-only pages use `pptx_structure.mode: flat` and omit every Master/Layout/layer/placeholder marker in this document. Deck/layout template pages declare their final Master and Layout before drawing begins; the structured exporter compiles that contract and never selects, clusters, distills, or visually infers it.+**Hard rule — route boundary**: Free-design and brand-only pages use `pptx_structure.mode: flat`, declare one canonical root `data-pptx-page-role`, and omit every Master/Layout/layer/placeholder marker in this document. Deck/layout template pages declare their final Master and Layout before drawing begins and omit `data-pptx-page-role`; the structured exporter compiles that contract and never selects, clusters, distills, or visually infers it.**Hard rule — specialized metadata wins**: Use Master/Layout/placeholder metadata for native structure, `data-pptx-native` for chart/table reconstruction, and the imported/authored shape metadata defined in [`shared-standards.md`](./shared-standards.md) §§1.4–1.5. Do not duplicate those facts with `data-pptx-role`.diff --git a/skills/ppt-master/references/shared-standards.md b/skills/ppt-master/references/shared-standards.mdindex 6519a2f8..0fd9503d 100644--- a/skills/ppt-master/references/shared-standards.md+++ b/skills/ppt-master/references/shared-standards.md@@ -455,7 +455,7 @@ continue without modification.### 4.1 Semantic SVG Marker Contract-Semantic markers are minimal compiler hints orthogonal to native SVG semantics. Free-design and brand-only pages use flat export and omit Master/Layout/layer/placeholder markers. On deck/layout template routes, root Master/Layout identity, atomic layer elements, grouped slots, and native-object metadata are authoritative and read first; each page carries its final structured contract from the start of SVG authoring. Add `data-pptx-role` only when no specialized marker expresses the required page-frame behavior; the element also uses a stable unique `id`. Do not classify ordinary page content or move visible facts out of SVG attributes/text into metadata. See [`semantic-svg.md`](semantic-svg.md) for the canonical vocabulary and examples.+Semantic markers are minimal compiler hints orthogonal to native SVG semantics. Free-design and brand-only pages use flat export, declare one canonical root `data-pptx-page-role` (`cover` / `toc` / `section` / `content` / `ending`), and omit Master/Layout/layer/placeholder markers. On deck/layout template routes, root Master/Layout identity, atomic layer elements, grouped slots, and native-object metadata are authoritative and read first; each page carries its final structured contract from the start of SVG authoring and omits `data-pptx-page-role`. Add `data-pptx-role` only when no specialized marker expresses the required page-frame behavior; the element also uses a stable unique `id`. Do not classify ordinary page content or move visible facts out of SVG attributes/text into metadata. See [`semantic-svg.md`](semantic-svg.md) for the canonical vocabulary and examples.- **Canvas authority**: `viewBox` MUST match the selected canvas dimensions.Root `width` and `height` are optional and do not override it. Root `<svg>`diff --git a/skills/ppt-master/references/strategist.md b/skills/ppt-master/references/strategist.mdindex f40c0982..ae49e58e 100644--- a/skills/ppt-master/references/strategist.md+++ b/skills/ppt-master/references/strategist.md@@ -172,7 +172,7 @@ See [`../templates/icons/README.md`](../templates/icons/README.md) for the curre>> 3. Enumerate the concepts the deck actually needs (home, chart, users, …) based on the confirmed outline.> 4. Search for each concept's filename in the chosen library: `ls skills/ppt-master/templates/icons/<chosen-library>/ | grep <keyword>`-> 5. Use the verified filename (without `.svg`) as the icon name; always include the library prefix (e.g., `chunk-filled/home`).+> 5. Use the verified filename (without `.svg`) as the icon name; always include the library prefix (e.g., `chunk-filled/home`). Icon identifiers are case-sensitive: bundled-library basenames are lowercase and MUST be copied exactly (`tabler-outline/award`, never `tabler-outline/Award`). Do not rely on downstream lowercasing; custom icons preserve their file's exact case.> 6. **Copy each chosen icon into the project as you confirm it** — `python3 skills/ppt-master/scripts/icon_sync.py <project_path> <lib/name> [<lib/name> …]`. This populates `<project>/icons/<lib>/` (the set the Executor embeds from) and, more importantly, **validates existence on the spot**.> 7. List the final icon inventory and chosen library in `design_spec.md` §VI; record the same in `spec_lock.md icons` (including `stroke_width` for stroke-style libraries). Executor may only use icons from this list.>diff --git a/skills/ppt-master/scripts/svg_finalize/embed_icons.py b/skills/ppt-master/scripts/svg_finalize/embed_icons.pyindex 7f10e303..46603f37 100644--- a/skills/ppt-master/scripts/svg_finalize/embed_icons.py+++ b/skills/ppt-master/scripts/svg_finalize/embed_icons.py@@ -72,6 +72,7 @@ ICON_BASE_SIZES = {'phosphor-duotone': 256,'simple-icons': 24,}+_ICON_LIBRARY_ALIASES = {'chunk': 'chunk-filled'}DEFAULT_ICON_BASE_SIZE = 24BaseGeometry = float | tuple[float, float, float, float]@@ -168,12 +169,9 @@ def _extract_shape_elements(content: str, color: str) -> list[str]:def _resolve_in_dir(icon_name: str, icons_dir: Path) -> tuple[Path, float]:"""Resolve `icon_name` against a single icons dir (no fallback)."""- # Backward compat: 'chunk/name' → 'chunk-filled/name'- _LIB_ALIASES = {'chunk': 'chunk-filled'}-if '/' in icon_name:lib, name = icon_name.split('/', 1)- lib = _LIB_ALIASES.get(lib, lib) # resolve aliases+ lib = _ICON_LIBRARY_ALIASES.get(lib, lib) # resolve aliasesicon_path = icons_dir / lib / f'{name}.svg'base_size = ICON_BASE_SIZES.get(lib, 24)else:@@ -187,6 +185,59 @@ def _resolve_in_dir(icon_name: str, icons_dir: Path) -> tuple[Path, float]:return icon_path, base_size+def _casefold_icon_name_in_dir(icon_name: str, icons_dir: Path) -> str | None:+ """Return the exact on-disk identifier when only casing differs."""+ if not icons_dir.is_dir():+ return None++ search_dirs: list[Path] = []+ expected_name = icon_name+ if '/' in icon_name:+ raw_lib, expected_name = icon_name.split('/', 1)+ requested_lib = _ICON_LIBRARY_ALIASES.get(raw_lib.casefold(), raw_lib)+ library_dir = icons_dir / requested_lib+ if not library_dir.is_dir():+ library_dir = next(+ (+ path for path in icons_dir.iterdir()+ if path.is_dir()+ and path.name.casefold() == requested_lib.casefold()+ ),+ library_dir,+ )+ search_dirs.append(library_dir)+ else:+ search_dirs.extend((icons_dir / 'chunk-filled', icons_dir))++ expected_filename = f'{expected_name}.svg'.casefold()+ for search_dir in search_dirs:+ if not search_dir.is_dir():+ continue+ matches = sorted(+ path for path in search_dir.iterdir()+ if path.is_file()+ and path.suffix.casefold() == '.svg'+ and path.name.casefold() == expected_filename+ )+ if len(matches) != 1:+ continue+ relative = matches[0].relative_to(icons_dir).with_suffix('')+ return relative.as_posix()+ return None+++def suggest_icon_name(+ icon_name: str,+ icons_dir: Path,+ fallback_dir: Path | None = None,+) -> str | None:+ """Suggest an exact project-first icon identifier without auto-correcting it."""+ suggestion = _casefold_icon_name_in_dir(icon_name, icons_dir)+ if suggestion is None and fallback_dir is not None:+ suggestion = _casefold_icon_name_in_dir(icon_name, fallback_dir)+ return suggestion++def resolve_icon_path(icon_name: str, icons_dir: Path, fallback_dir: Path | None = None) -> tuple[Path, float]:"""Resolve icon name to file path and base size, e.g. "chunk-filled/home" →@@ -419,11 +470,25 @@ def process_svg_file(svg_path: Path, icons_dir: Path, dry_run: bool = False, vercontinueicon_path, _ = resolve_icon_path(str(icon_name), icons_dir, fallback_dir)+ if not icon_path.exists():+ suggestion = suggest_icon_name(str(icon_name), icons_dir, fallback_dir)+ hint = (+ f"; identifiers are case-sensitive; use '{suggestion}'"+ if suggestion else ""+ )+ print(+ f"[WARN] Icon not found: {icon_name}{hint} "+ f"(in {svg_path.name})"+ )+ continue+elements, style, base_size = extract_paths_from_icon(icon_path)color = resolve_icon_color(attrs, style)-if not elements:- print(f"[WARN] Icon not found: {icon_name} (in {svg_path.name})")+ print(+ f"[WARN] Icon has no embeddable shapes: {icon_name} "+ f"(in {svg_path.name})"+ )continuereplacement = generate_icon_group(attrs, elements, style, base_size)diff --git a/skills/ppt-master/scripts/svg_quality_checker.py b/skills/ppt-master/scripts/svg_quality_checker.pyindex 49e15b14..d408b492 100644--- a/skills/ppt-master/scripts/svg_quality_checker.py+++ b/skills/ppt-master/scripts/svg_quality_checker.py@@ -212,9 +212,11 @@ except ImportError:try:from svg_finalize.embed_icons import (resolve_icon_path as _resolve_icon_path,+ suggest_icon_name as _suggest_icon_name,)except ImportError:_resolve_icon_path = None+ _suggest_icon_name = Nonetry:from resource_paths import (@@ -653,6 +655,12 @@ PPT_SAFE_FONTS = {RAMP_MIN_RATIO = 0.5RAMP_MAX_RATIO = 5.0+# Oversampling alone does not imply distortion and is often harmless for small+# logos. Warn about downscaling only when the source also has material on-disk+# weight, because PPTX embeds the compressed source asset rather than raw pixels.+IMAGE_DOWNSIZE_WARN_RATIO = 4.0+IMAGE_DOWNSIZE_WARN_MIN_BYTES = 1024 * 1024+# Modes / visual styles that legitimately use unbounded hero / poster type# (huge cover numerals, act dividers, single-number reveals). For these the# size-drift upper bound is dropped — the oversize is the design, not Executor@@ -2305,16 +2313,23 @@ class SVGQualityChecker:from PIL import Image as PILImagewith PILImage.open(img_path) as img:actual_w, actual_h = img.size+ source_bytes = img_path.stat().st_sizeif actual_w < display_w or actual_h < display_h:result['warnings'].append(f"Image {href} is {actual_w}x{actual_h} but displayed at "f"{int(display_w)}x{int(display_h)} — may appear blurry")- elif actual_w > display_w * 4 and actual_h > display_h * 4:+ elif (+ actual_w > display_w * IMAGE_DOWNSIZE_WARN_RATIO+ and actual_h > display_h * IMAGE_DOWNSIZE_WARN_RATIO+ and source_bytes >= IMAGE_DOWNSIZE_WARN_MIN_BYTES+ ):+ source_mib = source_bytes / (1024 * 1024)result['warnings'].append(f"Image {href} is {actual_w}x{actual_h} but displayed at "- f"{int(display_w)}x{int(display_h)} — consider downsizing "- f"to reduce file size")+ f"{int(display_w)}x{int(display_h)} and the source is "+ f"{source_mib:.1f} MiB — file-size advisory only, not an "+ f"aspect-ratio warning; consider a smaller source asset")except ImportError:pass # PIL not available, skip resolution checkexcept Exception:@@ -2356,9 +2371,17 @@ class SVGQualityChecker:icon_path, _ = _resolve_icon_path(icon_name, icons_dir, fallback_dir)if not icon_path.exists():fallback_msg = f", then {fallback_dir}" if fallback_dir else ""+ suggestion = (+ _suggest_icon_name(icon_name, icons_dir, fallback_dir)+ if _suggest_icon_name is not None else None+ )+ hint = (+ f"; identifiers are case-sensitive; use '{suggestion}'"+ if suggestion else ""+ )result['errors'].append(f"Icon not found: {icon_name} (searched {icons_dir}"- f"{fallback_msg})"+ f"{fallback_msg}){hint}")def _check_unsupported_visual_elements(diff --git a/skills/ppt-master/scripts/svg_to_pptx/native_objects/marker_common.py b/skills/ppt-master/scripts/svg_to_pptx/native_objects/marker_common.pyindex aae32d00..afaf7ca3 100644--- a/skills/ppt-master/scripts/svg_to_pptx/native_objects/marker_common.py+++ b/skills/ppt-master/scripts/svg_to_pptx/native_objects/marker_common.py@@ -800,7 +800,12 @@ def _load_payload(elem: ET.Element, kind: str) -> dict[str, Any]:breakif not raw:- raise RuntimeError(f"Native PPTX {kind} marker requires JSON metadata")+ raise RuntimeError(+ f"Native PPTX {kind} marker requires JSON metadata; add a matching "+ f"<metadata data-pptx-native=\"{kind}\"> payload for a real "+ "data-backed object, or remove data-pptx-native from SVG-only "+ "KPI/diagram groups"+ )try:payload = json.loads(raw)diff --git a/skills/ppt-master/templates/icons/README.md b/skills/ppt-master/templates/icons/README.mdindex 754e5f1d..e61e524d 100644--- a/skills/ppt-master/templates/icons/README.md+++ b/skills/ppt-master/templates/icons/README.md@@ -53,6 +53,8 @@ Use placeholder syntax **during SVG generation**:- `width`, `height` — Size (recommend 32–48px for legibility)- `fill` — Color+`data-icon` is case-sensitive because it resolves a real filename. Bundled library directories and basenames are canonical lowercase: use `tabler-outline/award`, not `tabler-outline/Award`. Custom icons retain the exact case of their files; the resolver intentionally does not lowercase identifiers.+`finalize_svg.py` auto-embeds all placeholders during post-processing. To run manually:```bashdiff --git a/skills/ppt-master/templates/spec_lock_reference.md b/skills/ppt-master/templates/spec_lock_reference.mdindex e603061a..a78e8f76 100644--- a/skills/ppt-master/templates/spec_lock_reference.md+++ b/skills/ppt-master/templates/spec_lock_reference.md@@ -86,7 +86,7 @@- brand_library: simple-icons- inventory: target, bolt, shield, users, chart-bar, lightbulb-> `library` MUST be exactly one of `chunk-filled` / `tabler-filled` / `tabler-outline` / `phosphor-duotone` — mixing is forbidden. `brand_library: simple-icons` is optional; include only when the deck uses real company / product brand marks, otherwise omit. `inventory` lists approved icon names (no library prefix); Executor may only use icons from this list.+> `library` MUST be exactly one of `chunk-filled` / `tabler-filled` / `tabler-outline` / `phosphor-duotone` — mixing is forbidden. `brand_library: simple-icons` is optional; include only when the deck uses real company / product brand marks, otherwise omit. `inventory` lists approved icon names (no library prefix); Executor may only use icons from this list. Names are case-sensitive filenames: bundled-library inventory values are the exact verified lowercase basenames (`award`, never `Award`); custom icon names preserve the custom file's exact case.>> **`stroke_width` (stroke-style libraries only)** — required when `library` is stroke-based (currently `tabler-outline`); allowed values `1.5` / `2` / `3`. Executor MUST apply this value to every `<use data-icon="...">` placeholder via `stroke-width`, deck-wide. Omit for non-stroke libraries (`chunk-filled` / `tabler-filled` / `phosphor-duotone`) — ignored there. For heavier weight switch library; do not exceed `3` (at 24×24 strokes merge and the icon stops reading as line art).>