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: zero-padded page numbers compile to slidenum fields; placeholder slots on structured pages are rejected as Morph endpoints at validate; Create Template docs name the import workspace path, propagated sample bitmaps, the kind mapping, and the delegated gate
hugohe36e3ce9c5a3b9
diff --git a/skills/ppt-master/references/animations.md b/skills/ppt-master/references/animations.mdindex 61ea3c37..50a38ffa 100644--- a/skills/ppt-master/references/animations.md+++ b/skills/ppt-master/references/animations.md@@ -107,7 +107,7 @@ When one semantic object continues across adjacent slides, the destination slide|---|---|| Owner | `morph` belongs to the destination; `morph.from` is the immediately preceding stem in export order || Source of pairs | `scaffold` never guesses identity — add pairs from the motion plan after inspecting final direct-root ids |-| Pair key | A stable identity whose `from`/`to` are unique direct-root `<g>` ids on the two slides, written without `!!` (export writes the Selection Pane name `!!<key>` on both); a root primitive with a static role marker is not pairable, and neither is a `Native-ready=yes` chart or table — `--native-charts-and-tables` turns it into a graphicFrame and the pair fails at export |+| Pair key | A stable identity whose `from`/`to` are unique direct-root `<g>` ids on the two slides, written without `!!` (export writes the Selection Pane name `!!<key>` on both); a root primitive with a static role marker is not pairable, neither is a `Native-ready=yes` chart or table — `--native-charts-and-tables` turns it into a graphicFrame and the pair fails at export — nor a `data-pptx-placeholder` slot on a structured page, which export rewrites into a layout placeholder; pair a Slide-local group there || Destination effect | A destination with pairs sets `effect: morph` explicitly (`morph_by` omitted or `object`; `word`/`character` rejected; a CLI override that changes the effect fails) || Chains | A middle slide may continue an object into another Morph under the same key || Uniqueness | One key never names two objects on a slide; one object never carries two keys; every `!!` key shared by adjacent Morph pages must be declared |diff --git a/skills/ppt-master/scripts/docs/template-tools.md b/skills/ppt-master/scripts/docs/template-tools.mdindex 82a101b1..f9670783 100644--- a/skills/ppt-master/scripts/docs/template-tools.md+++ b/skills/ppt-master/scripts/docs/template-tools.md@@ -8,7 +8,7 @@ Tool behavior behind [`create-template.md`](../../workflows/create-template.md)python3 skills/ppt-master/scripts/pptx_template_import.py "<reference_template.pptx>" [--inheritance-mode layered|both|flat]```-Produces one import workspace (typically under `/tmp/pptx_template_import/`; an analysis intermediate, never a final template):+Produces one import workspace (default `<pptx_stem>_template_import/` beside the source file; pass `-o` to place it elsewhere; an analysis intermediate, never a final template):| Output | Content ||---|---|diff --git a/skills/ppt-master/scripts/svg_to_pptx/animation_config.py b/skills/ppt-master/scripts/svg_to_pptx/animation_config.pyindex d1c5f76f..ca6891e4 100644--- a/skills/ppt-master/scripts/svg_to_pptx/animation_config.py+++ b/skills/ppt-master/scripts/svg_to_pptx/animation_config.py@@ -90,6 +90,8 @@ class GroupTarget:structurally_static: bool = Falsehas_hyperlink: bool = Falsehidden_reason: str | None = None+ placeholder: str | None = None+ on_structured_page: bool = False@dataclass(frozen=True)@@ -282,6 +284,8 @@ def scan_svg_targets(chrome=chrome,structurally_static=structurally_static,hidden_reason=hidden_reason,+ placeholder=placeholder,+ on_structured_page=root.get('data-pptx-layout') is not None,has_hyperlink=any(_tag_name(descendant) == 'a'or descendant.get(SHAPE_HYPERLINK_ATTR) is not None@@ -1735,9 +1739,42 @@ def validate_animation_config('animations.json Morph references structural group: 'f'{slide_name}/{group_id}')+ elif (+ target.placeholder is not None+ and target.on_structured_page+ and _lock_structure_mode(project_path) != 'flat'+ ):+ warnings.append(+ f'animations.json Morph endpoint {slide_name}/{group_id} '+ f'is the placeholder slot {target.placeholder!r}: structured '+ 'export rewrites a slot into a layout placeholder, so it '+ 'cannot carry a Morph name; pair a Slide-local group instead'+ )return list(dict.fromkeys(warnings))+def _lock_structure_mode(project_path: Path) -> str | None:+ """Return ``spec_lock.md``'s ``pptx_structure.mode``, or None without one."""+ lock_path = project_path / 'spec_lock.md'+ try:+ text = lock_path.read_text(encoding='utf-8-sig')+ except OSError:+ return None+ section = re.search(+ r'^##[ \t]+pptx_structure[ \t]*$(?P<body>.*?)(?=^##[ \t]|\Z)',+ text,+ flags=re.MULTILINE | re.DOTALL,+ )+ if section is None:+ return None+ mode = re.search(+ r'^-[ \t]+mode[ \t]*:[ \t]*([A-Za-z_-]+)',+ section.group('body'),+ flags=re.MULTILINE,+ )+ return mode.group(1).lower() if mode else None++def build_scaffold(project_path: Path) -> dict[str, Any]:"""Build an editable animation override scaffold from current SVGs.diff --git a/skills/ppt-master/scripts/svg_to_pptx/pptx_package/builder.py b/skills/ppt-master/scripts/svg_to_pptx/pptx_package/builder.pyindex 45950e68..a6d1ab28 100644--- a/skills/ppt-master/scripts/svg_to_pptx/pptx_package/builder.py+++ b/skills/ppt-master/scripts/svg_to_pptx/pptx_package/builder.py@@ -4475,8 +4475,16 @@ def _replace_literal_run_with_slidenum_field(if tx_body is None:return Falsea_t = f"{{{DML_NS}}}t"++ def _is_expected(text: str) -> bool:+ # A zero-padded literal ("02") names the same slide as "2".+ stripped = text.strip()+ return stripped == expected_text or (+ stripped.isdigit() and str(int(stripped)) == expected_text+ )+total_text = "".join(t.text or "" for t in tx_body.iter(a_t))- if total_text.strip() != expected_text:+ if not _is_expected(total_text):return Falsetext_runs = [(paragraph, run)@@ -4487,7 +4495,7 @@ def _replace_literal_run_with_slidenum_field(if len(text_runs) != 1:return Falseparagraph, run = text_runs[0]- if (run.findtext(a_t) or "").strip() != expected_text:+ if not _is_expected(run.findtext(a_t) or ""):return Falsefld = ET.Element(f"{{{DML_NS}}}fld", {"id": field_guid, "type": "slidenum"})diff --git a/skills/ppt-master/scripts/tests/test_dogfood_template_route_fixes.py b/skills/ppt-master/scripts/tests/test_dogfood_template_route_fixes.pynew file mode 100644index 00000000..3f2bafcb--- /dev/null+++ b/skills/ppt-master/scripts/tests/test_dogfood_template_route_fixes.py@@ -0,0 +1,117 @@+#!/usr/bin/env python3+"""Regression tests for the 2026-09-12 Create Template dogfood fixes.++A zero-padded page-number literal ("02") is the same slide number as "2" and+compiles into a slidenum field; a placeholder slot on a structured page is+rejected as a Morph endpoint by the sidecar validator instead of failing only+at export.+"""++from __future__ import annotations++import sys+import tempfile+import unittest+from pathlib import Path+from xml.etree import ElementTree as ET++SCRIPTS_DIR = Path(__file__).resolve().parents[1]+if str(SCRIPTS_DIR) not in sys.path:+ sys.path.insert(0, str(SCRIPTS_DIR))++from svg_to_pptx.animation_config import validate_animation_config # noqa: E402+from svg_to_pptx.pptx_package.builder import ( # noqa: E402+ _replace_literal_run_with_slidenum_field,+)++PML = 'http://schemas.openxmlformats.org/presentationml/2006/main'+DML = 'http://schemas.openxmlformats.org/drawingml/2006/main'+++def _shape(text: str) -> ET.Element:+ return ET.fromstring(+ f'<p:sp xmlns:p="{PML}" xmlns:a="{DML}"><p:txBody><a:bodyPr/>'+ f'<a:p><a:r><a:rPr lang="zh-CN"/><a:t>{text}</a:t></a:r></a:p></p:txBody></p:sp>'+ )+++def _page(structured: bool) -> str:+ root_attrs = ' data-pptx-master="m" data-pptx-layout="body"' if structured else ''+ return (+ f'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 720"{root_attrs}>'+ '<g id="title-slot" data-pptx-placeholder="title" data-pptx-bounds="80 60 1120 90">'+ '<text x="80" y="120">T</text></g>'+ '<g id="mark" data-pptx-bounds="80 600 40 40"><rect x="80" y="600" width="40" height="40"/></g>'+ '</svg>\n'+ )+++def _project(tmp: str, structured: bool, lock_mode: str | None) -> Path:+ root = Path(tmp)+ (root / 'svg_output').mkdir()+ for name in ('01_a.svg', '02_b.svg'):+ (root / 'svg_output' / name).write_text(_page(structured), encoding='utf-8')+ if lock_mode:+ (root / 'spec_lock.md').write_text(+ f'# Execution Lock\n\n## pptx_structure\n- mode: {lock_mode}\n\n## colors\n- primary: #000000\n',+ encoding='utf-8',+ )+ return root+++def _config(group: str) -> dict:+ return {+ 'version': 1,+ 'defaults': {'animation': {'effect': 'none'}},+ 'slides': {+ '02_b': {+ 'transition': {'effect': 'morph', 'duration': 1},+ 'morph': {'from': '01_a', 'pairs': {'key': {'from': group, 'to': group}}},+ },+ },+ }+++class SlideNumberFieldTests(unittest.TestCase):+ def test_zero_padded_literal_becomes_field(self) -> None:+ shape = _shape('02')+ self.assertTrue(_replace_literal_run_with_slidenum_field(shape, '2', '{GUID}'))+ fld = shape.find(f'.//{{{DML}}}fld')+ self.assertIsNotNone(fld)+ self.assertEqual(fld.attrib['type'], 'slidenum')+ self.assertEqual(fld.findtext(f'{{{DML}}}t'), '2')++ def test_plain_literal_still_becomes_field(self) -> None:+ self.assertTrue(_replace_literal_run_with_slidenum_field(_shape('12'), '12', '{GUID}'))++ def test_other_number_is_left_alone(self) -> None:+ shape = _shape('03')+ self.assertFalse(_replace_literal_run_with_slidenum_field(shape, '2', '{GUID}'))+ self.assertIsNone(shape.find(f'.//{{{DML}}}fld'))+++class PlaceholderMorphEndpointTests(unittest.TestCase):+ def test_slot_on_structured_page_is_rejected(self) -> None:+ with tempfile.TemporaryDirectory() as tmp:+ root = _project(tmp, structured=True, lock_mode='structured')+ messages = validate_animation_config(root, _config('title-slot'))+ self.assertTrue(any('placeholder slot' in m for m in messages), messages)++ def test_slide_local_group_on_structured_page_is_fine(self) -> None:+ with tempfile.TemporaryDirectory() as tmp:+ root = _project(tmp, structured=True, lock_mode='structured')+ self.assertEqual(validate_animation_config(root, _config('mark')), [])++ def test_flat_lock_keeps_slot_pairable(self) -> None:+ with tempfile.TemporaryDirectory() as tmp:+ root = _project(tmp, structured=True, lock_mode='flat')+ self.assertEqual(validate_animation_config(root, _config('title-slot')), [])++ def test_page_without_layout_metadata_keeps_slot_pairable(self) -> None:+ with tempfile.TemporaryDirectory() as tmp:+ root = _project(tmp, structured=False, lock_mode=None)+ self.assertEqual(validate_animation_config(root, _config('title-slot')), [])+++if __name__ == '__main__':+ unittest.main()diff --git a/skills/ppt-master/workflows/create-template.md b/skills/ppt-master/workflows/create-template.mdindex c10a0707..65ab2c25 100644--- a/skills/ppt-master/workflows/create-template.md+++ b/skills/ppt-master/workflows/create-template.md@@ -35,7 +35,7 @@ Never create an optional directory or placeholder solely to keep an empty path;| Create Layout | Reuse a brand-neutral structural skeleton without a recurring application | `templates/layouts/<layout_id>/` | Canvas, page grammar, semantic text roles, Master/Layout/slot contract, SVG roster; no identity or application contract || Create Deck | Reuse a branded structural system or a recurring application | `templates/decks/<deck_id>/` | Descriptive application context, integrated identity/structure, SVG roster |-A complete source PPTX does not determine the kind — classify only the stable rules worth reusing. Ask one discriminator only when the requested artifact is genuinely ambiguous. Once selected, never reopen kind selection inside the child's gate, execute two children for one workspace, or blend schemas. Shared kind and workspace model: [`templates/README.md`](../templates/README.md); application: [`apply-template-workspace`](./stages/apply-template-workspace.md).+A complete source PPTX does not determine the kind — classify only the stable rules worth reusing. A request for one organisation's "layout and style" for a recurring deck is Deck; a brand-neutral skeleton alone is Layout; a communication method without identity or roster is Style; identity alone is Brand. Ask one discriminator only when the requested artifact is genuinely ambiguous. Once selected, never reopen kind selection inside the child's gate, execute two children for one workspace, or blend schemas. Shared kind and workspace model: [`templates/README.md`](../templates/README.md); application: [`apply-template-workspace`](./stages/apply-template-workspace.md).## Process Overview@@ -71,7 +71,7 @@ Future decks need not keep source page count/order.### 1A. `.pptx` reference-Run `pptx_template_import.py "<reference.pptx>"`; the workspace it produces and each artifact's role are [`template-tools.md`](../scripts/docs/template-tools.md). Type A is the canonical mirror path; in `standard` / `fidelity`, imported facts do not define output topology. Never copy lossless or flat pages into `templates/`. For Type A `mirror`, `mirror_template_materialize.py` validates and publishes after review, fidelity edits, and the readability pass; authored modes never use it.+Run `pptx_template_import.py "<reference.pptx>" -o "<import_workspace>"` (without `-o` the workspace lands beside the source file); the workspace it produces and each artifact's role are [`template-tools.md`](../scripts/docs/template-tools.md). Type A is the canonical mirror path; in `standard` / `fidelity`, imported facts do not define output topology. Never copy lossless or flat pages into `templates/`. For Type A `mirror`, `mirror_template_materialize.py` validates and publishes after review, fidelity edits, and the readability pass; authored modes never use it.**Explicit complex-SVG picture normalization** (`standard` / `fidelity` only): when one imported native group is deliberately retained as one complex SVG picture rather than rebuilt as editable paths, select its exact id in the layered IR with `extract_svg_pictures.py ... --select "<group_id>" --resource-root "<import_workspace>" --images-dir "<import_workspace>/picture-assets" --inplace` (repeat `--select` for independent siblings; select the outer group when an ancestor carries a transform, style, clip, or opacity). If chosen for a Master or Layout, copy the asset into the image pool and author the fixed atom as a direct `<image data-pptx-layer="master|layout">`. This is a semantic decision, never automatic, never by repetition, never a way to infer ownership. Not for placeholders, individual native shapes, table/chart fallbacks, icon placeholders, authored presets, or `mirror`.@@ -82,7 +82,7 @@ Run `pptx_template_import.py "<reference.pptx>"`; the workspace it produces and| `standard` / `fidelity` | `analysis/manifest.json`, exported resources, `svg/inheritance.json`, `authoring_summary.json`, and every cleaned layered IR document (Masters, Layouts, Slides — the complete read surface, including Layouts unused by any sample slide); flat pages are optional spot checks; never `authoring_manifest.json` || `mirror` | Both manifests, inheritance, the summary, every source Slide SVG, and only reachable Master/Layout SVGs |-Use manifest facts for orientation and screenshots or the original PPTX only for visual cross-checking; never bulk-read opaque payload.+Use manifest facts for orientation and screenshots or the original PPTX only for visual cross-checking; never bulk-read opaque payload. If the reference was also brought in with `import-sources`, its extracted bitmaps were propagated into the project's `images/`; keep only identity assets there (a logo, an emblem) before Step 4, or `apply_template.py` carries the sample pictures into every downstream project.**Mirror reachable-graph gate**: before offering `mirror`, compare every source Slide and referenced Layout/Master with the authoring summary; missing reachable evidence or ambiguous parentage blocks; omit unused identities. The publisher verifies source SHA, refs, graph/assignment closure, and subtree hashes; an authored change never triggers visible XML restoration.@@ -192,7 +192,7 @@ Compose one concise natural-language proposal, in the user's language, describin## Step 3: User Confirmation Gate-**MANDATORY interactive gate — blocks Steps 4 onward.** Echo the finalized brief in one message, then emit `[TEMPLATE_BRIEF_CONFIRMED]` on its own line. Silently inferring values from files, direct text, an opened IDE file, or prior conversation is a route violation: even a complete PPTX, website, or written brief only informs the brief.+**MANDATORY interactive gate — blocks Steps 4 onward.** Echo the finalized brief in one message, then emit `[TEMPLATE_BRIEF_CONFIRMED]` on its own line. Silently inferring values from files, direct text, an opened IDE file, or prior conversation is a route violation: even a complete PPTX, website, or written brief only informs the brief. When the user has explicitly delegated this confirmation, decide the open items yourself, record each decision with its reason in the brief and the completion summary, and emit the marker — never fabricate a reply ([`confirm-surface.md`](../references/confirm-surface.md) §1).Before emitting the marker, all of these hold: