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(pptx-layouts): compile free-design layouts from explicit contracts
hugohe3a3b0360249ed
diff --git a/docs/technical-design.md b/docs/technical-design.mdindex 783141de..181573c1 100644--- a/docs/technical-design.md+++ b/docs/technical-design.md@@ -62,7 +62,7 @@ Output:For every workflow that authors or redesigns visual slides through SVG, `svg_output/` is the complete page-design authority. Every visible text, image, shape, diagram, chart/table fallback, background, and template-derived layout element that should appear on a slide must already exist in that page SVG or be explicitly referenced by it. Templates, `design_spec.md`, and `spec_lock.md` guide SVG authoring; the exporter does not use them as a second visual layer that fills in missing page content.-Minimal semantic markers do not weaken that closure. Existing Layout/Layer/Placeholder/Native metadata remains authoritative. On baseline/free-design pages, root `data-pptx-page-role` replaces filename-only family inference; `data-pptx-role` is reserved for the few structural page-frame objects whose package or animation behavior is not already expressed by specialized metadata. Ordinary titles, body text, cards, KPIs, diagrams, charts, icons, and images are not duplicated into a metadata ontology.+Minimal semantic markers do not weaken that closure. Existing Layout/Layer/Placeholder/Native metadata remains authoritative. New baseline/free-design pages declare their locked `data-pptx-layout` key/name and explicit reusable structure; only legacy baseline pages without a `pptx_layouts` mapping use root `data-pptx-page-role` instead of filename-only family inference. `data-pptx-role` is reserved for the few structural page-frame objects whose package or animation behavior is not already expressed by specialized metadata. Ordinary titles, body text, cards, KPIs, diagrams, charts, icons, and images are not duplicated into a metadata ontology.| Domain | Authority ||---|---|@@ -452,13 +452,13 @@ These direct routes share some analysis primitives with the main pipeline, espec**Why there is only one PPTX export route.** Native export reads `svg_output/` and translates supported SVG elements into DrawingML shapes. The project does not package whole-slide SVG media or alternate raster renderings into a second PPTX. `svg_final/` is still generated on every standard run, but it is a self-contained visual-preview artifact rather than a PPTX source; users may insert it as an SVG picture, while PowerPoint's manual Convert to Shape command remains outside the supported contract.-**Why the default native deck has a baseline master, not inferred templates.** `svg_to_pptx.py` starts from the actual blank slide layout relationship in the base package and defaults to `--pptx-structure baseline`. Baseline promotes only low-risk shared structure: the strict-majority identical slide background plus a common leading prefix of repeated top-level SVG chrome explicitly marked as `logo`, `footer`, `header`, `watermark`, `chrome`, or `page-number`. Exact id tokens remain a fallback for marker-free legacy SVGs. Promotion requires identical generated OOXML, no timing reference, and z-order safety; minority pages keep their shapes slide-local and use a `Cover` layout with `showMasterSp="0"`. A later export-only pass maps root `data-pptx-page-role` to `Cover`, `Agenda`, `Section`, `Closing`, or `Content`, falling back to conservative filename tokens only when the root marker is absent. It moves an exact family-wide background and an exact leading family-wide chrome prefix into that Layout, but never compares visual similarity or infers placeholders. Actual content remains on the Slide. This gives free-design decks useful Master/Layout structure without constraining SVG authoring.+**Why baseline has explicit and compatibility routes instead of visual inference.** `svg_to_pptx.py` starts from the actual blank slide-layout relationship in the base package and defaults to `--pptx-structure baseline`. New free-design and brand-only projects write one `pptx_layouts` key/name per page and repeat the matching explicit Master/Layout/placeholder contract in every SVG. The exporter deterministically compiles those declarations: pages with the same reusable contract share one Layout, genuinely different compositions get different Layouts, and concrete content stays on the Slide. A legacy project whose whole mapping section is absent keeps the older compatibility pass: strict-majority background/chrome promotion plus coarse `data-pptx-page-role` families, with filename/id fallbacks. Neither route clusters pages by visual similarity.-**Why reusable layouts require explicit SVG metadata.** `--pptx-structure template` is the opt-in path for a generated deck that must remain reusable as a PowerPoint template. The final slide SVGs declare a layout key at the root, mark only direct root children as master/layout layers, and attach typed placeholder semantics to the slide-local prototypes that should become layout placeholders. Export validates that shared master and same-key layout declarations are structurally and visually identical, then emits real layout parts and `p:ph` references while leaving every unmarked object slide-local. This is deterministic structure compilation, not visual-template inference.+**Why reusable layouts require explicit SVG metadata.** Structured baseline and `--pptx-structure template` use the same compiler. Final slide SVGs declare a Layout key/name at the root, mark only direct root children as Master/Layout layers, and attach typed placeholder semantics to slide-local prototypes. Export validates that shared Master and same-key Layout declarations are structurally and visually identical, then emits real Layout parts and `p:ph` references while leaving every unmarked object Slide-local. Template mode additionally binds this output contract to a selected input template; baseline has `pptx_layouts` without `page_layouts`. This is deterministic structure compilation, not visual-template inference.-**Why template-mode text defaults are split between Master and Layout.** Template export writes the locked `typography.title` size to every Master `p:titleStyle` level and the locked `typography.body` size to every `p:bodyStyle` / `p:otherStyle` level. Each generated Layout text placeholder additionally copies its prototype's first direct run size into `a:lstStyle/a:lvl1pPr/a:defRPr@sz` while retaining the prompt's direct size. This preserves layout-specific scale when level-one placeholder text is inserted or reset; direct runs on generated Slides remain unchanged. Missing title/body locks fail template export, while `baseline`, `preserve`, and `flat` retain their previous behavior.+**Why explicit-Layout text defaults are split between Master and Layout.** Structured baseline and template export write the locked `typography.title` size to every Master `p:titleStyle` level and the locked `typography.body` size to every `p:bodyStyle` / `p:otherStyle` level. Each generated Layout text placeholder additionally copies its prototype's first direct run size into `a:lstStyle/a:lvl1pPr/a:defRPr@sz` while retaining the prompt's direct size. This preserves Layout-specific scale when level-one placeholder text is inserted or reset; direct runs on generated Slides remain unchanged. Missing title/body locks fail explicit Layout export, while legacy baseline, `preserve`, and `flat` retain their previous behavior.-**Why template output is read back before publication.** Metadata preflight can prove the authoring contract but cannot prove that package serialization preserved every relationship and registration. Template mode therefore reopens the temporary PPTX and validates the Slide → Layout → Master graph, Layout identity, placeholder type/effective index, reusable frame, and prompt/level-one sizes. Only a package that passes is moved to the requested output; the other structure modes are unchanged.+**Why explicit Layout output is read back before publication.** Metadata preflight can prove the authoring contract but cannot prove that package serialization preserved every relationship and registration. Structured baseline and template mode therefore reopen the temporary PPTX and validate the Slide → Layout → Master graph, Layout identity, placeholder type/effective index, reusable frame, and prompt/level-one sizes. Only a package that passes is moved to the requested output; legacy baseline, `preserve`, and `flat` skip this gate.**Why reusable templates rebuild explicit SVG structure.** `pptx_template_import.py` emits layered Master/Layout/Slide references plus source structure facts. `create-template` uses those inputs to rebuild one clean Master and semantic Layouts as complete, explicitly annotated SVG pages; it does not package the original PPTX. Strict use keeps the selected Layout contract, while adaptive use may create a new Layout under the same Master. Both export through deterministic `template` mode. Legacy `preserve` remains readable for existing projects only. Raw PPTX plus one-off generated content still routes to `template-fill-pptx`.diff --git a/docs/zh/technical-design.md b/docs/zh/technical-design.mdindex b19e15d2..86c9b550 100644--- a/docs/zh/technical-design.md+++ b/docs/zh/technical-design.md@@ -61,7 +61,7 @@凡是通过 SVG 创作或重新设计页面的工作流,`svg_output/` 都是完整的页面设计权威。最终幻灯片中应出现的文字、图片、形状、图示、图表 / 表格 fallback、背景和模板派生布局元素,都必须已经存在于对应页面 SVG 中,或被它明确引用。模板、`design_spec.md` 和 `spec_lock.md` 负责指导 SVG 创作;导出器不能把它们当成第二层画面来源,在导出阶段补入 SVG 缺失的页面内容。-最小语义标记不会削弱这条闭包。现有 Layout、Layer、Placeholder 与 Native metadata 始终优先。Baseline / 自由设计页面用根节点 `data-pptx-page-role` 取代仅靠文件名判断页面家族;`data-pptx-role` 只补充专用 metadata 尚未表达的少量页面框架、package 或动画行为。普通标题、正文、卡片、KPI、图示、图表、图标和图片不会被重复抄入一套 metadata 本体。+最小语义标记不会削弱这条闭包。现有 Layout、Layer、Placeholder 与 Native metadata 始终优先。新的 baseline / 自由设计页面会声明锁定的 `data-pptx-layout` key/name 与显式可复用结构;只有没有 `pptx_layouts` mapping 的旧 baseline 页面继续用根节点 `data-pptx-page-role` 取代纯文件名家族判断。`data-pptx-role` 只补充专用 metadata 尚未表达的少量页面框架、package 或动画行为。普通标题、正文、卡片、KPI、图示、图表、图标和图片不会被重复抄入一套 metadata 本体。| 领域 | 权威来源 ||---|---|@@ -452,13 +452,13 @@ PowerPoint 的 DrawingML 是 SVG 表达力的严格子集。在转换器已实**为什么只有项目转换器产出的 native PPTX。** Native 导出把 `svg_output/` 中受支持的 SVG 元素逐个翻译成 DrawingML 形状;这是唯一受支持的 SVG→PPTX 路线。`svg_final/` 仍由强制后处理生成,但只承担自包含视觉预览和 SVG 图片插入,不会再被封装成另一份 PPTX,也不为 PowerPoint 手工“转换为形状”提供兼容兜底。-**为什么默认 native deck 使用基线母版,而不推断模板。** `svg_to_pptx.py` 默认使用 `--pptx-structure baseline`。它只提升低风险共享结构:严格多数页面完全一致的背景,以及显式标记为 `logo`、`footer`、`header`、`watermark`、`chrome` 或 `page-number` 的共同前置 chrome;没有结构角色的旧 SVG 才回退到精确 id token。提升还要求 OOXML 完全一致、无动画引用且 z-order 安全;少数派页面继续使用隐藏母版图形的 `Cover` 版式。导出后处理优先按根节点 `data-pptx-page-role` 分配 `Cover`、`Agenda`、`Section`、`Closing` 或 `Content`,只有缺少根标记的旧 SVG 才回退到保守文件名判断。它可以把一家族所有页面完全一致的背景与前置 chrome 提升到该 Layout,但不做视觉相似度比较、不猜占位符,实际内容始终留在 Slide。+**为什么 baseline 分为显式版式与兼容回退,而不做视觉推断。** `svg_to_pptx.py` 默认使用 `--pptx-structure baseline`。新的自由设计与纯品牌项目会为每页写一条 `pptx_layouts` key/name,并在 SVG 中重复匹配的显式 Master/Layout/placeholder 合同。导出器确定性编译这些声明:合同相同的页面复用同一个 Layout,真正不同的构图生成不同 Layout,具体内容始终留在 Slide。只有整个 mapping section 都缺失的旧项目才继续走兼容路径:严格多数背景/chrome 提升,加上粗粒度 `data-pptx-page-role` 家族与文件名/id fallback。两条路径都不根据视觉相似度聚类页面。-**为什么可复用版式必须依赖显式 SVG 元数据。** `--pptx-structure template` 是生成型 deck 需要继续作为 PowerPoint 模板复用时的 opt-in 路径。最终 slide SVG 在根节点声明 layout key,只允许根节点的直接子元素标记 master/layout layer,并在应成为版式占位框的 slide-local 原型上附加类型语义。导出器会验证共享 master 与同 key layout 的声明在结构和视觉上完全一致,再生成真实 layout part 与 `p:ph` 引用;所有未标记对象仍保持 slide-local。这是确定性的结构编译,不是根据视觉相似度猜模板。+**为什么可复用版式必须依赖显式 SVG 元数据。** Structured baseline 与 `--pptx-structure template` 复用同一套编译器。最终 slide SVG 在根节点声明 Layout key/name,只允许根节点的直接子元素标记 Master/Layout layer,并在 slide-local 原型上附加占位符类型。导出器验证共享 Master 与同 key Layout 的声明在结构和视觉上完全一致,再生成真实 Layout part 与 `p:ph` 引用;所有未标记对象仍保持 Slide-local。Template 模式还会把输出合同绑定到已选输入模板;baseline 只有 `pptx_layouts`,没有 `page_layouts`。这是确定性的结构编译,不是根据视觉相似度猜模板。-**为什么 template 模式把文字默认值分在 Master 与 Layout 两层。** Template 导出把锁定的 `typography.title` 字号写入 Master `p:titleStyle` 的全部层级,把 `typography.body` 字号写入 `p:bodyStyle` / `p:otherStyle` 的全部层级。每个生成的 Layout 文字占位符还会把原型首个直接 run 的字号写入 `a:lstStyle/a:lvl1pPr/a:defRPr@sz`,同时保留提示文字的直接字号。这样,一级占位符文字在插入或重置后仍继承版式特定的字号;生成 Slide 上的直接 run 保持不变。缺少 title/body 锁会让 template 导出失败,`baseline`、`preserve`、`flat` 则维持原有行为。+**为什么显式版式把文字默认值分在 Master 与 Layout 两层。** Structured baseline 与 template 导出都会把锁定的 `typography.title` 字号写入 Master `p:titleStyle` 的全部层级,把锁定的 `typography.body` 字号写入 `p:bodyStyle` / `p:otherStyle` 的全部层级。每个生成的 Layout 文字占位符还会把原型首个直接 run 的字号写入 `a:lstStyle/a:lvl1pPr/a:defRPr@sz`,同时保留提示文字的直接字号。这样,一级占位符文字在插入或重置后仍继承版式特定的字号;生成 Slide 上的直接 run 保持不变。缺少 title/body 锁会让显式版式导出失败,旧 baseline、`preserve`、`flat` 则维持原有行为。-**为什么 template 导出要在发布前回读候选包。** 元数据预检可以证明作者合同成立,却不能证明 package 序列化完整保留了所有 relationship 与注册信息。因此 template 模式会重新打开临时 PPTX,校验 Slide → Layout → Master 关系链、Layout 身份、占位符类型与有效索引、可复用边界,以及提示文字和一级默认字号。只有通过读回校验的候选包才会移动到目标输出;其他结构模式不受影响。+**为什么显式 Layout 导出要在发布前回读候选包。** 元数据预检可以证明作者合同成立,却不能证明 package 序列化完整保留了所有 relationship 与注册信息。因此 structured baseline 与 template 模式都会重新打开临时 PPTX,校验 Slide → Layout → Master 关系链、Layout 身份、占位符类型与有效索引、可复用边界,以及提示文字和一级默认字号。只有通过读回校验的候选包才会移动到目标输出;旧 baseline、`preserve`、`flat` 跳过该门禁。**为什么可复用模板统一重建显式 SVG 结构。** `pptx_template_import.py` 输出分层的 Master/Layout/Slide 参考和源结构事实;`create-template` 据此重建一个干净 Master 与语义 Layout,并把它们重复标注在可独立预览的完整 SVG 中,不再封装原 PPTX。严格套用保持所选 Layout 契约,自适应使用可在同一 Master 下新建显式 Layout;两者都走确定性的 `template` 导出。`preserve` 只为旧项目保留兼容读取。diff --git a/skills/ppt-master/SKILL.md b/skills/ppt-master/SKILL.mdindex 235e638d..967f190c 100644--- a/skills/ppt-master/SKILL.md+++ b/skills/ppt-master/SKILL.md@@ -38,7 +38,7 @@ description: >> 5. **NO SPECULATIVE EXECUTION** — "Pre-preparing" content for subsequent Steps is FORBIDDEN (e.g., writing SVG code during the Strategist phase)> 6. **NO SUB-AGENT SVG GENERATION** — Executor Step 6 SVG generation is context-dependent and MUST be completed by the current main agent end-to-end. Delegating page SVG generation to sub-agents is FORBIDDEN> 7. **SEQUENTIAL PAGE GENERATION ONLY** — In Executor Step 6, after the global design context is confirmed, SVG pages MUST be generated sequentially page by page in one continuous pass. Grouped page batches (for example, 5 pages at a time) are FORBIDDEN-> 8. **SPEC_LOCK RE-READ PER PAGE** — Before generating each SVG page, Executor MUST `read_file <project_path>/spec_lock.md`. All colors / fonts / icons / images MUST come from this file — no values from memory or invented on the fly. Executor MUST also look up the confirmed `pptx_structure.template_adherence` when present, the current page's `page_rhythm` (`anchor` / `dense` / `breathing`), `page_layouts` (which template SVG to inherit), `page_charts` (which chart template to adapt, if any), and — when `pptx_structure.mode` is `template` or `preserve` — `pptx_layouts` (which native PowerPoint layout the page references). Deck/layout template routes require both mappings for every page: `strict` reuses the selected layout contract; `adaptive` may create a new explicit layout contract from the selected reference. Empty / absent `page_layouts` rows are reserved for free design and brand-only routes — see executor-base.md §2.1. This rule exists to resist context-compression drift on long decks and to break the uniform "every page is a card grid" default+> 8. **SPEC_LOCK RE-READ PER PAGE** — Before generating each SVG page, Executor MUST `read_file <project_path>/spec_lock.md`. All colors / fonts / icons / images MUST come from this file — no values from memory or invented on the fly. Executor MUST also look up the confirmed `pptx_structure.template_adherence` when present, the current page's `page_rhythm` (`anchor` / `dense` / `breathing`), `pptx_layouts` (the native PowerPoint Layout every newly generated page references), `page_layouts` (the input template SVG, only for a deck/layout template route), and `page_charts` (which chart template to adapt, if any). Deck/layout template routes require both Layout mappings for every page: `strict` reuses the selected contract; `adaptive` may create a new explicit contract from the selected reference. Free-design and brand-only baseline routes require `pptx_layouts` but omit `page_layouts`; only legacy projects may omit the output mapping — see executor-base.md §2.1. This rule exists to resist context-compression drift on long decks and to break the uniform "every page is a card grid" default> 9. **SVG MUST BE HAND-WRITTEN, NOT SCRIPT-GENERATED** — Every SVG page is written by the main agent directly, one page at a time (see rules 6 and 7). Writing or running a Python / Node / shell script that produces the SVG files in batch — looping over pages, templating from data, or emitting them via a generator — is FORBIDDEN, including under "save tokens", "quick draft", or "user is in a hurry" pretexts. The script-generation path was tried on a feature branch and abandoned: cross-page visual consistency depends on per-page authoring with full upstream context, which a generator script cannot reproduce. **Narrow exception**: `preset_shape_svg.py` may print one deterministic stock-shape fragment to stdout after the main agent has selected its semantic role, frame, and paint. It cannot write `svg_output/`, choose layout, batch shapes, or generate a page; the main agent reads the fragment and inserts it through the normal hand-authored page edit> 10. **FOLLOW DETERMINISTIC ROUTING RULES** — Do not add blocking routing questions when this skill defines a route. If the user request violates a route precondition, state the required prerequisite and stop that route instead of asking the user to choose around the rule. Ordinary finite options, stylistic preferences, and recoverable details are surfaced with a recommended value plus alternatives at the next existing confirmation gate.@@ -622,7 +622,7 @@ python3 ${SKILL_DIR}/scripts/svg_editor/server.py <project_path> --live --daemon> Image facts: trust the `analysis/image_analysis.csv` regenerated at the end of Step 5. If `images/` changed since (the user swapped or added files), re-run `python3 ${SKILL_DIR}/scripts/analyze_images.py <project_path>/images` before laying images out — facts are re-derived on use, never a stale store (Step 4 image-facts note).-**Per-page spec_lock re-read (Mandatory)**: before **each** SVG page, `read_file <project_path>/spec_lock.md` and use only its colors / fonts / icons / images, plus the per-page `page_rhythm` / `page_layouts` / `page_charts` lookups and the route-specific `pptx_structure` / `pptx_layouts` native-layout contract. The contract is absent only on legacy/free inputs that have not yet been normalized; it is mandatory for every current template page. Resists context-compression drift on long decks. See executor-base.md §2.1.+**Per-page spec_lock re-read (Mandatory)**: before **each** SVG page, `read_file <project_path>/spec_lock.md` and use only its colors / fonts / icons / images, plus the per-page `page_rhythm` / `page_layouts` / `page_charts` lookups and the route-specific `pptx_structure` / `pptx_layouts` native-layout contract. The output Layout contract is absent only on legacy projects that have not yet been normalized; it is mandatory for every newly generated page. Resists context-compression drift on long decks. See executor-base.md §2.1.> ⚠️ **Main-agent only**: SVG generation MUST stay in the current main agent — page design depends on full upstream context. Do NOT delegate to sub-agents.> ⚠️ **Generation rhythm**: generate pages sequentially, one at a time, in the same continuous context. Do NOT batch (e.g., 5 per group).@@ -631,7 +631,7 @@ python3 ${SKILL_DIR}/scripts/svg_editor/server.py <project_path> --live --daemonEach completed SVG MUST be a standalone, complete representation of that slide's visible design. Template SVGs and locked planning artifacts may guide construction, but export must not reach back to them to add visible objects omitted from `svg_output/`. Speaker notes, animation, narration, transitions, and direct native-PPTX workflows remain separately owned artifacts/capabilities. Before drawing a literal stock shape, apply [`native-shape-authoring.md`](references/native-shape-authoring.md): use the stdout-only helper when one PowerPoint preset exactly matches, keep basic SVG primitives for rect/round-rect/ellipse, and keep free SVG for custom semantics. Never infer a preset from contour similarity.-Every `baseline` / free-design page root MUST declare one canonical `data-pptx-page-role`; `template` / `preserve` pages already declare `data-pptx-layout` and MUST NOT duplicate that identity merely to satisfy this rule. Add `data-pptx-role` only to structural page-frame objects whose package, page-number, or animation behavior is not already expressed by `data-pptx-layer`, `data-pptx-placeholder`, or `data-pptx-native`; such an element needs a stable unique `id`. Do not add generic content roles to ordinary titles, body text, cards, KPIs, diagrams, charts, icons, or images. Full contract: [`references/semantic-svg.md`](references/semantic-svg.md).+Every newly generated page root MUST declare the locked `data-pptx-layout` and `data-pptx-layout-name`, including free-design/brand-only pages that remain in `baseline` mode. Do not duplicate that identity with `data-pptx-page-role`; only a legacy baseline project whose whole `pptx_layouts` section is absent uses the canonical page-role marker. Add `data-pptx-role` only to structural page-frame objects whose package, page-number, or animation behavior is not already expressed by `data-pptx-layer`, `data-pptx-placeholder`, or `data-pptx-native`; such an element needs a stable unique `id`. Do not add generic content roles to ordinary titles, body text, cards, KPIs, diagrams, charts, icons, or images. Full contract: [`references/semantic-svg.md`](references/semantic-svg.md).**Quality Check Gate (Mandatory)** — after all SVGs, BEFORE annotation handling and speaker notes:```bash@@ -733,8 +733,21 @@ python3 ${SKILL_DIR}/scripts/svg_to_pptx.py <project_path>> **PPTX structure mode** — native export first reads> `spec_lock.md` `pptx_structure.mode`, then falls back to `baseline` when the> section is absent. An explicit `--pptx-structure` CLI value overrides the-> lock for diagnostics. Baseline keeps the real slide master/layout-> relationship from the base deck and promotes the strict-majority identical+> lock for diagnostics. New free-design and brand-only baseline projects write+> one `pptx_layouts` key/name per page. Every SVG repeats that mapping on its+> root and explicitly marks reusable Master/Layout elements and native+> placeholders. Export uses the same deterministic Layout compiler and+> final-package read-back gate as template mode: pages with the same static+> Layout/placeholder contract reuse one Layout, genuinely different+> compositions use different Layouts, and concrete content remains Slide-local.+> `page_layouts` stays absent because no input template was selected. If any+> baseline page declares a Layout, every page must declare one and match the+> lock; partial or unlocked metadata fails export. The exporter never clusters+> pages by visual similarity.+>+> A legacy baseline project whose whole `pptx_layouts` section is absent keeps+> the real slide master/layout relationship from the base deck and promotes the+> strict-majority identical> native slide background into the slide master (every slide must carry an> explicit background; minority slides keep their own, which overrides the> master fill). Baseline may also promote a shared **leading** prefix of@@ -753,7 +766,8 @@ python3 ${SKILL_DIR}/scripts/svg_to_pptx.py <project_path>> Filename tokens remain a compatibility fallback for marker-free legacy SVGs.> It also> preserves an existing safety `Cover` assignment made while hiding promoted-> Master chrome. It does not inspect visual similarity or infer placeholders,+> Master chrome. This legacy route does not inspect visual similarity or infer+> placeholders,> and all actual page content remains slide-local. When every slide in one> family carries the exact same explicit background, that background moves to> the family layout. The same family may also promote an identical leading@@ -798,47 +812,55 @@ python3 ${SKILL_DIR}/scripts/svg_to_pptx.py <project_path>> only so existing template packages and projects remain exportable; do not> select it for newly created templates.-> **Explicit reusable template export** — deck/layout template routes set+> **Explicit reusable Layout export** — deck/layout template routes set> `spec_lock.md` `pptx_structure.mode: template`. Every SVG root declares> `data-pptx-layout`, and direct children> explicitly declare master/layout layers, an optional Slide background, or> PowerPoint placeholders. This-> mode builds named reusable layouts and placeholder mappings; it does not-> infer them from visual similarity. Static master/layout elements must be+> mode builds named reusable layouts and placeholder mappings. Structured+> baseline uses the same metadata and compiler without an input template.+> Neither route infers from visual similarity. Static master/layout elements+> must be> repeated consistently in PowerPoint paint order. Chart/table placeholders> additionally require `--native-objects`. The metadata contract and authoring> example live in-> [`references/shared-standards.md`](references/shared-standards.md#explicit-pptx-master--layout--placeholder-metadata-template-export).+> [`references/shared-standards.md`](references/shared-standards.md#explicit-pptx-master--layout--placeholder-metadata).> Raw PPTX templates still route to `template-fill-pptx`; `template` structure> mode is for explicitly annotated SVG authoring. Both `strict` and `adaptive`> template use stay on this deterministic route. Adaptive pages may define new> layout keys, but they repeat the same Master layer and one internally> consistent Layout/placeholder contract.-> Template export also installs the locked `typography.title` size into every+> Structured baseline and template export also install the locked+> `typography.title` size into every> Master `titleStyle` level and the locked `typography.body` size into every> `bodyStyle` and `otherStyle` level. Each text-bearing Layout placeholder also> writes its prototype run size to `a:lstStyle/a:lvl1pPr/a:defRPr@sz`, so a> newly inserted or reset placeholder keeps that Layout's local size before it> falls back to the Master. Generated slide runs and Layout prompt runs keep-> their direct sizes. Missing or invalid locked title/body sizes fail template-> export. Baseline, preserve, and flat modes do not apply either text-default-> update.-> Before publishing the temporary PPTX, template export reopens the finished-> package and verifies `Presentation → Master ↔ Layout ← Slide` registration,+> their direct sizes. Missing or invalid locked title/body sizes fail explicit+> Layout export. Legacy baseline, preserve, and flat modes do not apply either+> text-default update.+> Before publishing the temporary PPTX, structured baseline and template export+> reopen the finished+> package and verify `Presentation → Master ↔ Layout ← Slide` registration,> named custom Layout parts and content types, collision-free placeholder> identities, prototype bounds, and prompt/level-one sizes. This read-back gate-> is template-only and does not compare later same-Layout slides' local geometry+> does not compare later same-Layout slides' local geometry> or direct text formatting.-> In template mode, `pptx_layouts` contains exactly one locked-> layout key/name per page; reuse a key for a shared structure instead of-> creating one key per content instance.+> In every new generated deck, `pptx_layouts` contains exactly one locked layout+> key/name per page; reuse a key for a shared structure instead of creating one+> key per content instance. Only a legacy baseline project may omit the whole+> section and use page-role compatibility families.> **Paragraph editability vs line fidelity** — by default, mergeable dy-stacked> paragraph blocks collapse into one editable PowerPoint text frame with multiple> `<a:p>`, improving body-text editing and resize/reflow behavior. Add `--no-merge`> only when the user explicitly asks for strict line-layout fidelity or when a> layout-tight page must keep every dy-stacked line as its own text frame. The-> merge detector is conservative; mixed-layout text falls back to per-line frames.+> merge detector is conservative; mixed-layout text falls back to per-line+> frames. A multiline `data-pptx-placeholder` must remain one native text frame;+> do not combine it with `--no-merge`. Strict-line text stays Slide-local rather+> than claiming one PowerPoint placeholder.> **Native table/chart objects** — supported data charts and pure text-grid> tables carry `data-pptx-native` markers by default (Executor transcribesdiff --git a/skills/ppt-master/references/executor-base.md b/skills/ppt-master/references/executor-base.mdindex 1dc87187..17810898 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 — minimal semantics without semantic loss**: `baseline` / free-design roots declare `data-pptx-page-role`; `template` / `preserve` roots already use `data-pptx-layout` and do not duplicate that identity. Add `data-pptx-role` only to structural page-frame objects whose package, page-number, or animation behavior is not already expressed by layer, placeholder, or native-object metadata; the marked element uses a stable unique `id`. Ordinary page content keeps normal SVG structure without duplicate semantic classification. See [`semantic-svg.md`](./semantic-svg.md).+**Hard rule — minimal semantics without semantic loss**: Any page with a locked `pptx_layouts` row — including a new `baseline` / free-design page — declares `data-pptx-layout` and `data-pptx-layout-name` on the root and does not duplicate that identity with `data-pptx-page-role`. Only a legacy baseline project whose whole mapping section is absent uses root `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 layer, placeholder, or native-object metadata; the marked element uses a stable unique `id`. Ordinary page content keeps normal SVG structure without duplicate semantic classification. 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.@@ -102,24 +102,31 @@ Before generating each page, output which template is used:### 1.2 PowerPoint Master / Layout Mapping-`page_layouts` selects an SVG design reference; `pptx_layouts` declares the native PowerPoint layout produced at export. They are independent contracts.+`page_layouts` selects an SVG design reference and exists only for a deck/layout template route. `pptx_layouts` declares the native PowerPoint Layout produced at export and also applies to newly authored free-design and brand-only baseline routes. The contracts are independent: a baseline deck has `pptx_layouts` without `page_layouts`.`pptx_structure.template_adherence` records the Strategist's confirmed template-use policy. Both `strict` and `adaptive` require one real `page_layouts` reference and one `pptx_layouts` output mapping per page. Strict keeps the referenced Layout contract; adaptive may create a new explicit Layout while retaining the template Master.| `pptx_structure.mode` | Executor behavior ||---|---|-| `baseline` or missing | Free design or brand-only route. Author complete standalone SVG pages with root page-role and only necessary structural hints; export assigns conservative marker-backed Layout families after generation. |+| `baseline` | Free design or brand-only route. Implement every locked `pptx_layouts` row explicitly while keeping the mode `baseline`. Only a legacy lock whose whole mapping section is absent uses root page-role compatibility behavior. |+| Missing | Legacy compatibility. Use root page role; a new explicit Layout contract also writes `mode: baseline`. || `template` | Every generated SVG MUST implement the matching `pptx_layouts` row and the explicit structure contract below. || `preserve` | Legacy strict-only compatibility. Use the locked source layout key/name and retain marked preview layers for source-package reuse. |-**Hard rule — every structured page references one layout**: In `template` or `preserve` mode, read `P<NN>: <layout_key> | <layout name>` from `pptx_layouts`, then put both values on the root SVG as `data-pptx-layout` and `data-pptx-layout-name`. Strict copies the selected template key/name. Adaptive may use the new key/name already locked by Strategist; Executor must not improvise another.+**Hard rule — every mapped page references one Layout**: Whenever `pptx_layouts` contains `P<NN>: <layout_key> | <layout name>` — in `baseline`, `template`, or `preserve` mode — put both values on the root SVG as `data-pptx-layout` and `data-pptx-layout-name`. Do not also add `data-pptx-page-role`. Baseline implements the authored free-design key/name, strict copies the selected template key/name, adaptive uses the new key/name already locked by Strategist, and preserve retains the source identity. Executor must not improvise another mapping.**Hard rule — PowerPoint paint order**: Direct visual children appear in this order: Master background, Layout background, optional Slide background, shared Master shapes, same-key Layout shapes, then slide-local content/placeholders. Backgrounds are the special plane beneath all inherited shapes. Repeat the same Master contract on every page and the same Layout contract on every page sharing a key.-**Placeholder ownership**: Keep actual title/subtitle/body/picture/chart/table/object/media/date/footer/slide-number content on the Slide and add the matching `data-pptx-placeholder`. Do not duplicate placeholder identity with `data-pptx-role`; in particular, `data-pptx-placeholder="slide-number"` already owns page-number field behavior. A reconstructed `title` normally omits `data-pptx-placeholder-idx`; preserve an explicit imported title index when present. Every indexed placeholder on one layout uses a unique index. Chart/table placeholders require native markers and a later `--native-objects` export; object/media placeholders must each resolve to one top-level DrawingML object.+**Placeholder ownership**: Keep actual title/subtitle/body/picture/chart/table/object/media/date/footer/slide-number content on the Slide and add the matching `data-pptx-placeholder`. Do not duplicate placeholder identity with `data-pptx-role`; in particular, `data-pptx-placeholder="slide-number"` already owns page-number field behavior. A reconstructed `title` normally omits `data-pptx-placeholder-idx`; preserve an explicit imported title index when present. Every indexed placeholder on one Layout uses a unique index. Chart/table placeholders require native markers and a later `--native-objects` export; object/media placeholders must each resolve to one top-level DrawingML object.++**Atomic placeholder carrier exception**: A normal title/subtitle/body/date/footer/slide-number placeholder is one direct `<text>`; picture/media is one direct `<image>` or imported crop `<svg>`; object is one direct supported atomic object. These direct carriers are the narrow exception to the mandatory top-level `<g>` rule and do not count against the 3–8 content-group budget. Do not wrap multiple drawing atoms in an arbitrary `<g>` and promise that the composite is one placeholder. The separately specified chart/table native-marker group remains its own specialized contract. Any other complex `<g>` composition stays Slide-local without placeholder metadata.++**Layout-content boundary**: Mark only genuinely reusable static framing as `data-pptx-layer="master|layout"`. Never promote concrete titles, body copy, metrics, chart marks, images, or complex page-specific groups into a Layout. Do not infer Layout families from visual similarity or cluster completed pages after the fact; implement the exact authored mapping and reuse a key only when its static Layout layer plus placeholder contract is the same.**Adaptive Layout creation**: Start from the selected template SVG, keep every Master element identical, and change only the Layout layer/placeholder contract needed for the new composition. Pages sharing the new key repeat the same static Layout elements and placeholder ids/types in the same order.+**Authored baseline Layout creation**: Build the locked Layout contract directly from the §IX page composition, without selecting or inventing a `page_layouts` template reference. Pages sharing the baseline key repeat the same static Layout elements and placeholder ids/types/bounds in the same order; differing reusable compositions use differing locked keys.+**Legacy preserve identity**: In `preserve` mode only, copy source `data-pptx-placeholder-idx` values and retain the source placeholder type/index pairing. Master/Layout preview elements keep `data-pptx-layer` plus `data-pptx-editable="false"`.**Background ownership**:@@ -196,8 +203,9 @@ Do **not** invent a layout entry, and do **not** assume a template just because**Per-page PowerPoint layout lookup — `pptx_layouts` section**:+- `pptx_structure.mode: baseline` with a `pptx_layouts` section → a `P<NN>` row is mandatory; apply §1.2 to the root and direct children while keeping the deck in baseline mode. Do not read or create `page_layouts`.- `pptx_structure.mode: template` or `preserve` → a `P<NN>` row is mandatory; apply §1.2 to the root and direct children. Preserve mode uses the exact source key/name and placeholder indices.-- `pptx_structure.mode: baseline` or missing → omit explicit PPTX layer/layout metadata, but keep the root page role and only necessary structural hints. Baseline export owns conservative Master/background/chrome promotion plus page-role-backed Layout family assignment; filenames and ids are legacy fallbacks only when the corresponding marker is absent.+- `pptx_structure.mode: baseline` or missing with the whole `pptx_layouts` section absent → legacy compatibility only. Omit explicit PPTX layer/layout/placeholder metadata, keep the root page role and necessary structural hints, and let baseline export use conservative promotion plus page-role-backed Layout families. Filenames and ids are fallbacks only when the corresponding marker is absent.- A layout key may repeat across non-adjacent pages. Reuse is based on identical static/placeholder contracts, not page proximity or content wording.**Per-page chart reference — `page_charts` section**:@@ -213,7 +221,7 @@ Before drawing each page, look up its entry in `page_charts` to decide which cha## 3. Execution Guidelines- **Proximity**: group related elements with tight spacing; separate unrelated groups-- **Element grouping (Mandatory)**: wrap every logical content unit — title, core-message line, each content block, card, list item, diagram, and footer chrome — in a top-level `<g id="...">` with a descriptive id. This is a hard requirement per [`shared-standards.md`](shared-standards.md) §4.3, not an optional convenience: aim for 3–8 content groups per slide (chrome excluded), because ungrouped top-level `<text>` / `<rect>` / `<path>` loses real PowerPoint groups and per-element animation anchors, and degrades select/move/edit. Authored native preset fragments (`preset_shape_svg.py`) already are one atomic `<g id>` each and count as one group; keep their labels in a sibling parent `<g>`.+- **Element grouping (Mandatory)**: wrap every logical content unit — title, core-message line, each content block, card, list item, diagram, and footer chrome — in a top-level `<g id="...">` with a descriptive id. This is a hard requirement per [`shared-standards.md`](shared-standards.md) §4.3, not an optional convenience: aim for 3–8 content groups per slide (chrome excluded), because ungrouped top-level `<text>` / `<rect>` / `<path>` loses real PowerPoint groups and per-element animation anchors, and degrades select/move/edit. The narrow exception is one direct atomic carrier with `data-pptx-placeholder` under §1.2: it stays ungrouped so the native placeholder binding remains valid and is excluded from the group budget. This exception never authorizes an arbitrary composite `<g>` placeholder; complex grouped content remains Slide-local. Authored native preset fragments (`preset_shape_svg.py`) already are one atomic `<g id>` each and count as one group; keep their labels in a sibling parent `<g>`.- **Spec adherence**: follow color, layout, canvas format, and typography in the spec- **Template structure**: if templates exist, inherit the visual framework- **Main-agent ownership**: SVG generation must run in the main agent (not sub-agents) — pages share upstream context for cross-page visual continuitydiff --git a/skills/ppt-master/references/semantic-svg.md b/skills/ppt-master/references/semantic-svg.mdindex 4b34228d..0bd34d2c 100644--- a/skills/ppt-master/references/semantic-svg.md+++ b/skills/ppt-master/references/semantic-svg.md@@ -8,7 +8,7 @@ These markers are not a second content model and do not abbreviate SVG.| Marker | Placement | Purpose ||---|---|---|-| `data-pptx-page-role` | Root `<svg>` | Select the baseline PowerPoint Layout family. Required on newly generated baseline/free-design pages; template/preserve pages already use `data-pptx-layout`. |+| `data-pptx-page-role` | Root `<svg>` | Select the compatibility Layout family only for a legacy baseline page whose project has no `pptx_layouts` mapping. New baseline/free-design pages use `data-pptx-layout` instead. || `data-pptx-role` | A structural page-frame element | Identify the few objects whose package or animation behavior is not already expressed by specialized metadata. The element also needs a stable unique `id`. |The complete geometry, text, styles, grouping, and asset references remain in@@ -19,7 +19,7 @@ content.Use the existing specialized contracts for specialized facts:-- `data-pptx-layout` and `data-pptx-layer` own Master/Layout/Slide structure;+- `data-pptx-layout`, `data-pptx-layout-name`, and `data-pptx-layer` own Master/Layout/Slide structure. A new baseline/free-design page with a locked `pptx_layouts` row uses these markers while remaining `pptx_structure.mode: baseline`;- `data-pptx-placeholder` owns PowerPoint placeholder identity;- `data-pptx-native` owns native chart/table reconstruction.- `data-pptx-object`, `data-pptx-prst`, `data-pptx-frame`, `data-pptx-av-*`,@@ -34,6 +34,18 @@ Do not duplicate those facts with `data-pptx-role`. Consumers resolve semanticsin this order: specialized metadata, minimal compiler hints, then legacyfilename/id conventions.+Layout structure is authored, never discovered. Reuse a Layout key only when its+static Layout layer and placeholder contract match exactly. Do not cluster+visually similar pages, move concrete content into a Layout, or mark a complex+page-specific group merely to manufacture reuse.++Ordinary placeholder carriers are direct atomic objects: one text frame, image,+crop SVG, or other supported atomic shape. This is a narrow exception to the+top-level content-group budget, and the carrier does not count toward that+budget. Do not use an arbitrary composite `<g>` as a placeholder; keep complex+groups Slide-local. Native chart/table marker groups remain governed by their+separate specialized contract.+## 2. Canonical Values### Page roles@@ -65,7 +77,7 @@ continue to own that decision.## 3. Examples-### Free-design page+### Legacy baseline fallback page```xml<svg xmlns="http://www.w3.org/2000/svg"@@ -84,7 +96,11 @@ continue to own that decision.</svg>```-### Reusable template page+### Explicit authored Layout page++This form applies to a new free-design/brand-only baseline page as well as to a+template page. The structure metadata does not change baseline mode into+template mode and does not imply a `page_layouts` reference.```xml<svg xmlns="http://www.w3.org/2000/svg"@@ -119,15 +135,17 @@ continue to own that decision.## 4. Validation and CompatibilityThe quality checker validates marker placement, canonical values, and stable-unique IDs. Baseline export consumes explicit markers before compatibility-heuristics:+unique IDs. Export consumes explicit authored Layout metadata before baseline+compatibility hints and heuristics:-- root page role is preferred over filename-based Layout classification;+- root `data-pptx-layout` is authoritative when the page has a locked mapping;+- on an unmapped legacy baseline page, root page role is preferred over filename-based Layout classification;- `data-pptx-placeholder="slide-number"` is preferred over a generic role or id;- explicit structural role is preferred over id-token chrome detection;- animation target scanning uses the structural role before id-token fallback.Filename and id heuristics remain compatibility fallbacks only for older SVGs-that lack the corresponding marker. A canonical page role is authoritative over-the filename. Any explicit structural role prevents id-based reinterpretation;-an unknown role remains renderable but produces a quality-check warning.+that lack the corresponding marker. On an unmapped legacy baseline page, a+canonical page role is authoritative over the filename. Any explicit structural+role prevents id-based reinterpretation; an unknown role remains renderable but+produces a quality-check warning.diff --git a/skills/ppt-master/references/shared-standards.md b/skills/ppt-master/references/shared-standards.mdindex 5da7d982..645da79e 100644--- a/skills/ppt-master/references/shared-standards.md+++ b/skills/ppt-master/references/shared-standards.md@@ -389,12 +389,13 @@ table/chart markers are rejected; omit that flag to export their SVG fallback.Semantic markers are minimal compiler hints orthogonal to native SVG semantics.Existing `data-pptx-layout` / layer / placeholder / native-object metadata is-authoritative and read first. A `baseline` / free-design root declares-`data-pptx-page-role`; template/preserve roots already declare their Layout.-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+authoritative and read first. New free-design/brand-only baseline pages and all+template/preserve pages declare their locked Layout. Only a legacy baseline+project whose whole `pptx_layouts` section is absent uses+`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.@@ -417,17 +418,17 @@ These forms are needed only when the stated PPT behavior matters:| One editable PPT text frame with mixed inline formatting | Put the logical line in one `<text>` with non-positional `<tspan>` children. A `<tspan>` with `x`/`y`/`dy` starts a new positioned line; evenly `dy`-stacked lines that repeat the parent `<text>`'s `x` **merge into one frame as multiple paragraphs** (the default paragraph-merge), while an irregular gap or a mismatched `x` flattens to separate frames. Separate `<text>` elements stay valid when separate frames are intended. || Stable object grouping or object-level animation anchor | Wrap the intended object in `<g id="...">`. Content grouping is **mandatory** per §4.3 — a top-level `<g id>` is also the animation anchor; it is not an optional convenience. || Native PowerPoint background promotion | Use a direct, full-canvas, solid `<rect>` without transform, filter, clip, rounding, or visible stroke. Other SVG backgrounds remain ordinary slide shapes. Template routes add the ownership metadata in §7. |-| Free-design page family/chrome extraction | Use the semantic markers in §4.1. Marker-free pages retain conservative filename/id fallbacks, but no visual content is inferred. |+| Free-design PowerPoint Layout | Use the locked `pptx_layouts` key/name plus the explicit metadata in §7. A legacy baseline project without that section uses §4.1 page-family/chrome hints. No route infers visual similarity. |**Hard rule — supported shape conversion**: Every PPT editability claim in this specification refers to the project converter reading `svg_output/` and emitting native DrawingML. `svg_final/` is a self-contained visual preview that may be inserted into PowerPoint as an SVG picture. PowerPoint's manual Convert-to-Shape operation is unsupported; do not narrow the authoring contract to its undocumented SVG subset.### 4.3 Element Grouping (Mandatory)-Wrap logically related elements in top-level `<g id="...">` groups. This is **required on every generated page**, not an optional convenience: it produces real PowerPoint groups in the exported PPTX (easier to select / move / edit) and gives each content unit a stable anchor for optional per-element entrance animation. Plain `<g>` is the normal grouping primitive; `<g opacity="0..1">` additionally maps to the per-descendant alpha approximation in §2.2.+Wrap logically related elements in top-level `<g id="...">` groups. This is **required on every generated page**, not an optional convenience: it produces real PowerPoint groups in the exported PPTX (easier to select / move / edit) and gives each content unit a stable anchor for optional per-element entrance animation. Plain `<g>` is the normal grouping primitive; `<g opacity="0..1">` additionally maps to the per-descendant alpha approximation in §2.2. A direct structural background/layer atom or one direct atomic object carrying `data-pptx-placeholder` is the narrow exception defined in §7; the placeholder must remain one native carrier and neither form counts toward the group budget.-**Semantic-group rule**: direct children of `<svg>` are semantic content groups, **not** raw drawing atoms. Aim for **3–8 top-level content `<g id>` groups per slide** (the budget excludes page chrome — see below); each content group becomes one entrance step under the chosen animation trigger (one click in `on-click`, one cascade slot in `after-previous`, parallel in `with-previous`). Leaving titles, body lines, list items, cards, or decorative clusters as ungrouped top-level `<text>` / `<rect>` / `<path>` is a contract violation, not a style choice.+**Semantic-group rule**: direct children of `<svg>` are semantic content groups, **not** raw drawing atoms. Aim for **3–8 top-level content `<g id>` groups per slide** (the budget excludes page chrome and direct atomic placeholder carriers — see below); each content group becomes one entrance step under the chosen animation trigger (one click in `on-click`, one cascade slot in `after-previous`, parallel in `with-previous`). Leaving titles, body lines, list items, cards, or decorative clusters as ungrouped top-level `<text>` / `<rect>` / `<path>` is a contract violation unless that one direct atom is an explicit supported placeholder carrier.-**Chrome is excluded automatically.** Existing `data-pptx-layer` and `data-pptx-placeholder="slide-number"` semantics are read first; otherwise explicit `data-pptx-role` values (`background`, `decoration`, `header`, `footer`, `chrome`, `watermark`, `page-number`, `logo`) mark static framing (§4.1, [`semantic-svg.md`](semantic-svg.md)). Marker-free legacy SVGs keep id-token fallbacks. Keep the `<g>` wrapper on chrome for editing/grouping even though it does not count against the 3–8 content budget.+**Chrome and placeholder carriers are excluded automatically.** Existing `data-pptx-layer` and `data-pptx-placeholder` semantics are read first; otherwise explicit `data-pptx-role` values (`background`, `decoration`, `header`, `footer`, `chrome`, `watermark`, `page-number`, `logo`) mark static framing (§4.1, [`semantic-svg.md`](semantic-svg.md)). Marker-free legacy SVGs keep id-token fallbacks. Keep the `<g>` wrapper on chrome for editing/grouping even though it does not count against the 3–8 content budget. Do not wrap several drawing atoms in an arbitrary `<g>` and claim that composite as one placeholder; complex groups stay Slide-local. Native chart/table marker groups retain their specialized §7 contract.**What to group** (one `<g id>` per unit):@@ -446,7 +447,7 @@ An authored native preset fragment (§1.5) is already an atomic `<g id>` and cou**Forbidden**:- One giant `<g>` around the whole slide (collapses to a single animation step).-- Many ungrouped top-level `<rect>` / `<text>` / `<path>` — fallback animation caps at 8 primitives, dense pages may skip animation, and selection/editing degrades.+- Many ungrouped top-level `<rect>` / `<text>` / `<path>` without supported placeholder metadata — fallback animation caps at 8 primitives, dense pages may skip animation, and selection/editing degrades.- One group per icon / text line / mark (too many steps).- Anonymous top-level groups — every top-level semantic group needs a descriptive `id`.@@ -1320,10 +1321,24 @@ defaults to `bottom` and accepts `top`, `left`, or `right`.**Forbidden — native marker transforms**: Do not rotate, skew, or matrix-transform native table/chart marker groups. Translate / scale is accepted; complex transforms fail export because PowerPoint native table/chart frames do not preserve arbitrary SVG transforms.-### Baseline Layout Family Extraction+### Baseline Layout Routing-Native `baseline` export assigns layout families after every SVG page has been-converted. This package-only pass does not change SVG authoring or live preview.+Native `baseline` export has two deterministic routes. A new free-design or+brand-only project writes one `pptx_layouts` row per page and repeats that+key/name on every SVG root; export compiles the explicit Master/Layout/+placeholder contract in the next section. A legacy project whose entire mapping+section is absent keeps the compatibility family pass below. Mixing declared+and undeclared pages is invalid. Neither route performs visual clustering.++**Explicit baseline route**: Reuse one Layout key only when pages have the same+static Layout layer and placeholder type/index/bounds contract. Different+wording, data, or imagery stays Slide-local and does not create a new Layout;+a genuinely different reusable composition gets a different key, even when both+pages have the semantic role `content`.++**Legacy compatibility route**: After every unstructured SVG page has been+converted, assign the coarse page families below without changing SVG authoring+or live preview.| Root `data-pptx-page-role` | Output layout ||---|---|@@ -1342,8 +1357,9 @@ Keep an existing `Cover` assignment when the Master chrome safety pass alreadyused it to hide promoted Master shapes from a minority page.**Hard rule — no visual inference**: Keep every actual title, body, picture,-chart, table, and page-specific shape on the Slide. Baseline layouts do not-infer placeholders or promote visually similar content.+chart, table, and page-specific shape on the Slide. Explicit baseline Layouts+consume authored metadata; legacy baseline Layouts do not infer placeholders or+promote visually similar content.**Background rule**: Move a Slide `p:bg` to its family Layout only when everyslide in that family carries exactly the same explicit background. Otherwise,@@ -1358,28 +1374,28 @@ image relationships must match exactly, no animation may target the shapes,and moving them behind Slide content must preserve z-order. Keep page numbersand every non-identical object Slide-local.-### Explicit PPTX Master / Layout / Placeholder Metadata (Template Export)--**Trigger**: Deck/layout template routes set `spec_lock.md`-`pptx_structure.mode` to `template`; direct diagnostics may pass-`--pptx-structure template`. Both strict and adaptive template adherence use-this mode. Without either trigger, metadata stays visually dormant.--**Project lock**: In the standard project pipeline, template mode requires one-`pptx_layouts` row per page using-`P<NN>: <layout_key> | <PowerPoint layout name>`. The SVG root values MUST-match that row. Strict uses the selected template key/name. Adaptive may create-a new key/name while repeating the same Master contract. Reuse one layout key-only when pages share the same static Layout layer and placeholder contract;-different content is not a reason to create a new layout. Direct diagnostic-exports may select the mode with the CLI flag instead of a locked-`pptx_structure.mode` row, but still require `spec_lock.md` typography+### Explicit PPTX Master / Layout / Placeholder Metadata++**Trigger**: New free-design/brand-only routes use+`pptx_structure.mode: baseline` plus complete `pptx_layouts`; deck/layout template routes use+`pptx_structure.mode: template` plus complete `page_layouts` and+`pptx_layouts`. Preserve keeps its source-package contract. Direct diagnostics+may pass `--pptx-structure template`. In baseline, explicit Layout metadata+without a complete lock is an error rather than a dormant hint.++**Project lock**: The standard pipeline writes one `pptx_layouts` row per page+using `P<NN>: <layout_key> | <PowerPoint layout name>`. The SVG root values MUST+match that row. Baseline derives the key/name from the authored composition and+does not create `page_layouts`. Template strict uses the selected template+key/name; adaptive may create a new key/name while repeating the same Master+contract. Reuse one layout key only when pages share the same static Layout+layer and placeholder contract; different content is not a reason to create a+new Layout. Every explicit route requires numeric `spec_lock.md` typography`title` / `body` rows.-**Master text-style contract**: Template mode requires numeric `title` and-`body` rows under `spec_lock.md` `typography`. Export maps the locked `title`-size to every `a:defRPr` in Master `p:titleStyle`, and maps the locked `body`-size to every level in both `p:bodyStyle` and `p:otherStyle`.+**Master text-style contract**: Structured baseline and template export map the+locked `title` size to every `a:defRPr` in Master `p:titleStyle`, and map the+locked `body` size to every level in both `p:bodyStyle` and `p:otherStyle`.| Master style | Locked source | XML field changed ||---|---|---|@@ -1390,11 +1406,11 @@ size to every level in both `p:bodyStyle` and `p:otherStyle`.**Hard rule — narrow scope**: This Master update changes only Master`p:txStyles//a:defRPr@sz`. It does not rewrite direct run sizes on generatedslides, so the initial slide rendering remains controlled by the authored SVG.-Missing `title` or `body` rows fail template export. `baseline`, `preserve`,-and `flat` modes do not apply this Master text-style update.+Missing `title` or `body` rows fail explicit Layout export. Legacy baseline,+`preserve`, and `flat` do not apply this Master text-style update.**Layout level-one text-default contract**: For every text-bearing placeholder-whose first prototype run has a direct `a:rPr@sz`, template export copies that+whose first prototype run has a direct `a:rPr@sz`, explicit Layout export copies thatsize to the generated Layout prompt run and`p:txBody/a:lstStyle/a:lvl1pPr/a:defRPr@sz`. It does not rewrite Slide directruns or Layout levels 2–9. This preserves the layout-specific size when@@ -1413,8 +1429,9 @@ prototype size remain unchanged.| `data-pptx-placeholder-idx="1"` | placeholder element | Retains an imported source layout placeholder index; optional for reconstructed layouts || `data-pptx-editable="false"` | master/layout element or slide background | Declares intentional editing outside ordinary slide content |-**Hard rule — explicit only**: Template export never promotes visually similar-content by inference. Every SVG requires a root `data-pptx-layout`; every+**Hard rule — explicit only**: Structured baseline and template export never+promote visually similar content by inference. Every SVG requires root+`data-pptx-layout` and `data-pptx-layout-name`; everymaster/layout/placeholder element requires a unique `id` and must be a directchild of the root SVG.@@ -1444,10 +1461,16 @@ by this solid-background rule.| `object` | one direct text, image, or basic SVG shape | `obj` || `media` | direct `<image>` or imported crop `<svg>` | `media` |+**Text placeholder carrier**: A multiline text placeholder must remain one+native text frame. Use the default paragraph merge; `--no-merge` and explicit+`data-pptx-text-mode="lines"` cannot bind several line shapes to one PowerPoint+placeholder. Leave strict-line text Slide-local when separate frames are the+required result.+`title` is normally type-matched without an index in reconstructed layouts; ifan imported source title explicitly has one, preserve that exact index. Every-indexed placeholder on one layout uses a unique OOXML UInt32 index. Template-export writes the semantic type on both the Layout and Slide placeholder+indexed placeholder on one layout uses a unique OOXML UInt32 index. Explicit+Layout export writes the semantic type on both the Layout and Slide placeholder(except `obj`, whose OOXML default is already`obj`) so PowerPoint and `python-pptx` retain the same identity. Date, footer,and slide-number placeholders enable their matching Layout `p:hf` flags; a@@ -1464,8 +1487,9 @@ reusable frame; when omitted, the exporter uses the prototype object's nativeDrawingML bounds. Repeat the same placeholder ids/types on every slide usingthat layout. Actual slide content and local geometry may differ.-**Final-package read-back gate**: After writing the temporary template-mode-PPTX and before publishing it, export reopens the package and verifies that+**Final-package read-back gate**: After writing a temporary structured-baseline+or template-mode PPTX and before publishing it, export reopens the package and+verifies thateach Slide targets exactly one Layout, one layout key always resolves to thesame part, different keys do not collapse onto one part, and every Layout isregistered through its Master and the Presentation. It also verifies the@@ -1475,8 +1499,8 @@ direct prompt size, and level-one default size. Later slides may keep differentslide-local geometry; only the reusable Layout frame is checked against theexplicit/prototype contract. Any mismatch fails export without replacing therequested output.-This gate applies only to `template`; `baseline`, `preserve`, and `flat` retain-their existing behavior.+This gate applies to structured baseline and `template`; legacy baseline,+`preserve`, and `flat` retain their existing behavior.**Static structure consistency**: Repeat the same master element ids on everyslide and the same layout element ids on every slide sharing a layout. Theirdiff --git a/skills/ppt-master/references/strategist.md b/skills/ppt-master/references/strategist.mdindex 80bb18e8..d71f416b 100644--- a/skills/ppt-master/references/strategist.md+++ b/skills/ppt-master/references/strategist.md@@ -845,15 +845,16 @@ This is what makes the axis meaningful: a `presentation` deck and a `text` deck1. Read reference template: `templates/design_spec_reference.md`2. Generate complete spec from scratch based on analysis3. Save to: `projects/<project_name>.../design_spec.md`-4. **Generate execution lock**: read `templates/spec_lock_reference.md` and produce `projects/<project_name>.../spec_lock.md` — a distilled, machine-readable short form of the color / typography / icon / image / **page_rhythm** / **page_layouts** / **page_charts** decisions above. This file is what the Executor re-reads before every page (see [executor-base.md](executor-base.md) §2.1). The values in `spec_lock.md` MUST exactly match the decisions recorded in `design_spec.md`; if they ever diverge, `spec_lock.md` wins and `design_spec.md` should be treated as historical narrative.+4. **Generate execution lock**: read `templates/spec_lock_reference.md` and produce `projects/<project_name>.../spec_lock.md` — a distilled, machine-readable short form of the color / typography / icon / image / **page_rhythm** / **pptx_layouts** / **page_layouts** / **page_charts** decisions above. This file is what the Executor re-reads before every page (see [executor-base.md](executor-base.md) §2.1). The values in `spec_lock.md` MUST exactly match the decisions recorded in `design_spec.md`; if they ever diverge, `spec_lock.md` wins and `design_spec.md` should be treated as historical narrative.- **page_rhythm is mandatory**: Based on the page list in §IX Content Outline, assign each page one of `anchor` / `dense` / `breathing` (see `spec_lock_reference.md` for the full vocabulary). This is what breaks the uniform "every page is a card grid" feel — without it the Executor defaults all pages to `dense`.- **Rhythm follows narrative, not quota**: `breathing` pages mark natural pauses — chapter transitions, standalone emphasis (hero quote / big number), SCQA bridges. Dense decks may legitimately be all `dense`. **Do NOT invent filler pages** ("Thank you", empty dividers) to pad rhythm — every `breathing` page must say something independent. Delivery purpose biases the overall lean (`presentation` toward more `anchor` / `breathing`, `text` toward `dense`; see §6.1) — a bias, never a quota.- **Cover impact is mandatory**: Page `P01` is the deck's first visual contract, not a generic title slide. In `design_spec.md §IX`, add a `Cover impact` line for `P01` that names one concrete hook and one concrete composition strategy. Use the source's strongest available signal: a provocative core claim, object / scene metaphor, hero number, founder / product / audience moment, or a distilled conflict. Pair it with one concrete composition strategy — such as `full-bleed image + floating title`, `typographic poster`, `hero object`, `data hook`, `editorial scene`, `high-contrast abstract geometry`, or a fresh composition the deck's subject suggests (these are starting points, not the allowed set). If no external or AI image is available, still specify a native-SVG visual hook; do not fall back to "title + subtitle + decorative background". (Beautify / template-fill keep the source cover verbatim — this rule does not apply on those preservation paths.)- **Cover rhythm lock**: `P01` remains `anchor` in `spec_lock.md page_rhythm`, but its §IX `Cover impact` must prevent content-page patterns. Do not plan multi-card grids, agenda-like bullets, or equal-weight columns on the cover unless a template explicitly requires that structure, or a preservation path (beautify / template-fill) is transcribing the source cover verbatim.- **Closing impact (only when the deck closes)**: the deck's last page is its final visual contract — the strongest impression after the cover. When the deck genuinely lands on a conclusion / call-to-action / final-takeaway page, give it a `Closing impact` line in §IX: name the one thing the audience should leave with (a distilled takeaway, a forward call, a memorable restatement of the core claim) + one composition that delivers it — never a generic "Thank you" / contact-only slide or a centered-title reprise of the cover. **Do NOT invent a closing page to satisfy this** — the filler-page ban above still holds; apply it only to the page where the deck actually resolves. Same exemptions as the cover: skip on template / beautify / template-fill preservation paths.- **pptx_structure is mandatory**: Write `mode: baseline` for free design and brand-only routes. When a deck/layout template is confirmed, write `mode: template` plus `template_adherence: strict|adaptive`. Both adherence values stay on explicit template export. Use `mode: preserve` only when reopening a legacy strict project that already carries a validated `native_structure.json` + `source_template.pptx` pair. Do not choose `flat`; it is a CLI-only diagnostic override.- - **pptx_layouts (template/preserve structure)**: In template mode, write one `P<NN>: <layout_key> | <PowerPoint layout name>` row for every page. Strict uses the selected template SVG's exact key/name. Adaptive may introduce a new stable key/name, but pages reuse a key only when their static Layout layer and placeholder contract match. In legacy preserve mode, use the exact source key/name. Omit the whole section in baseline mode.- - **page_layouts (deck/layout templates only)**: Add one `P<NN>: <svg_basename>` row for every page. Strict inherits that SVG contract unchanged. Adaptive uses it as the architecture reference and may evolve the Layout layer under a new `pptx_layouts` key; it must not drop into free design. Omit the section only for free design and brand-only routes.+ - **pptx_layouts (native output Layout contract)**: Write one `P<NN>: <layout_key> | <PowerPoint layout name>` row for every page in every new generated deck. Free-design and brand-only routes remain `mode: baseline`; derive stable keys and picker names from the compositions planned in §IX, without adding `page_layouts`. Template strict uses the selected template SVG's exact key/name; adaptive may introduce a new stable key/name. Legacy preserve uses the exact source key/name. A legacy baseline project whose whole section is absent remains valid and uses page-role compatibility behavior.+ - **Layout-family boundary**: Reuse a key only when pages share the same reusable static Layout layer and the same placeholder type/index/bounds contract. Assign a different key when the real reusable composition changes, even if the pages share a semantic role; do not split keys merely because slide-local wording, data, or imagery differs. Decide these families from the authored page plan — never by post-hoc visual clustering, filenames, or content similarity. Keep concrete slide content and complex grouped compositions Slide-local; they are not Layout material.+ - **page_layouts (deck/layout templates only)**: Add one `P<NN>: <svg_basename>` row for every page. Strict inherits that SVG contract unchanged. Adaptive uses it as the architecture reference and may evolve the Layout layer under a new `pptx_layouts` key; it must not drop into free design. Omit the whole section for free-design and brand-only routes; their required `pptx_layouts` rows do not imply an SVG template reference.- **page_charts (write only for chart pages that match a catalog template)**: For each page in `design_spec.md §VII` whose `reference template path` points to `templates/charts/<name>.svg`, add `P<NN>: <chart_name>`. Pages with `no-template-match` in §VII MUST NOT appear here (Executor would look for a non-existent reference). If the deck has no data-visualization pages, omit the section.- **Hard rule**: Use both `page_layouts` and `page_charts` only with a compatible template shell. For a chart page without an exact roster match, adaptive mode selects the closest neutral content template and assigns a new explicit Layout key; strict mode must select an existing compatible Layout or revise the outline. Never omit `page_layouts` inside a deck/layout template route.diff --git a/skills/ppt-master/scripts/README.md b/skills/ppt-master/scripts/README.mdindex 52789938..cf5afb83 100644--- a/skills/ppt-master/scripts/README.md+++ b/skills/ppt-master/scripts/README.md@@ -132,9 +132,9 @@ python3 scripts/svg_to_pptx.py <project_path>For SVG-authoring routes, `svg_output/` is the complete visible page-design source: every exported text, image, shape, background, and template-derived layout element is present in the page SVG or explicitly referenced by it. Export may translate represented content into Master/Layout/Slide parts or native objects, but it does not retrieve missing visible content from templates or planning files. Speaker notes, animation, narration, transitions, `template-fill-pptx`, and `native-enhance-pptx` remain separately owned capabilities.-When `spec_lock.md` has no `pptx_structure` section, native `svg_to_pptx.py` falls back to `baseline`: the generated deck keeps a standard Master/Layout relationship and promotes only exact, z-order-safe shared backgrounds/chrome. Root `data-pptx-page-role` selects `Cover`, `Agenda`, `Section`, `Closing`, or `Content`; filenames are a fallback for marker-free legacy SVGs. A family-wide exact background and an exact leading structurally marked chrome prefix may move into that Layout; ids are consulted only when the structural role is absent. Actual titles, body content, pictures, charts, tables, page numbers, and page-specific shapes remain on Slide. No visual-similarity or placeholder inference is performed. Baseline also prunes unused layouts and maps locked typography/colors into the PowerPoint theme. Use `--pptx-structure flat` for slide-local diagnostics.+Native `svg_to_pptx.py` defaults to `baseline`. New free-design/brand-only projects include complete `pptx_layouts` mappings and matching explicit SVG Master/Layout/placeholder metadata; the exporter creates one reusable Layout per contract and validates the finished package. A legacy project whose whole mapping section is absent keeps the compatibility pass: exact z-order-safe shared background/chrome promotion plus coarse root `data-pptx-page-role` families, with filename/id fallbacks. Actual content remains Slide-local in both routes, and no visual-similarity inference is performed. Baseline also prunes unused layouts and maps locked typography/colors into the PowerPoint theme. Use `--pptx-structure flat` for slide-local diagnostics.-Deck/layout template routes use explicit template structure. Each complete SVG names its output Layout, repeats inherited Master/Layout preview layers, and marks supported content placeholders. Strict keeps the selected Layout contract; adaptive may create a new Layout while retaining the Master. The exporter validates cross-slide equality, creates one reusable Layout per key, removes repeated inherited copies, and keeps actual content Slide-local. The complete contract lives in [`references/shared-standards.md`](../references/shared-standards.md#explicit-pptx-master--layout--placeholder-metadata-template-export).+Structured baseline and deck/layout template routes use the same explicit Layout compiler. Each complete SVG names its output Layout, repeats reusable Master/Layout preview layers, and marks supported content placeholders. Template strict keeps the selected contract; adaptive may create a new Layout while retaining the Master. The exporter validates cross-slide equality, creates one reusable Layout per key, removes repeated inherited copies, and keeps actual content Slide-local. The complete contract lives in [`references/shared-standards.md`](../references/shared-standards.md#explicit-pptx-master--layout--placeholder-metadata).Current `create-template` output always rebuilds explicit SVG structure and does not package `native_structure.json` or `source_template.pptx`. `preserve` remains available only for existing projects that already carry the legacy pair.diff --git a/skills/ppt-master/scripts/docs/svg-pipeline.md b/skills/ppt-master/scripts/docs/svg-pipeline.mdindex b1ba1285..dee9287e 100644--- a/skills/ppt-master/scripts/docs/svg-pipeline.md+++ b/skills/ppt-master/scripts/docs/svg-pipeline.md@@ -71,16 +71,16 @@ Behavior:inputs and package-level processing.- For PPTX template-import workspaces, use `-s svg-flat` when you need a visual round-trip check. The layered `svg/` tree is the machine-readable template source and intentionally does not inline inherited master / layout decoration into each slide.- Native mode is strict about unsupported visual SVG elements: if a visual element cannot be represented or safely preserved, export fails with the SVG file, element tag, and position instead of silently dropping content.-- Omitting `--pptx-structure` reads `spec_lock.md` and falls back to `baseline`. Baseline assigns Layout families from root `data-pptx-page-role`, keeps content Slide-local, and promotes only exact family-wide backgrounds plus exact leading structurally marked chrome; filenames and ids are compatibility fallbacks for marker-free legacy SVGs. It never infers placeholders or visual similarity. Template mode builds reusable PowerPoint structure only from explicit SVG metadata and validates every `pptx_layouts` row plus cross-slide equality. Both strict and adaptive template adherence use this mode; adaptive may introduce a new Layout key under the same Master.+- Omitting `--pptx-structure` reads `spec_lock.md` and falls back to `baseline`. New baseline projects carry one locked `pptx_layouts` row per page and compile their explicit SVG Master/Layout/placeholder metadata into real reusable Layouts. A legacy baseline project whose whole mapping section is absent keeps the coarse root `data-pptx-page-role` family pass plus conservative background/chrome promotion; filenames and ids remain compatibility fallbacks. Neither branch infers visual similarity. Template mode uses the same explicit compiler while also enforcing the selected input-template contract; both strict and adaptive template adherence stay on that mode.- Template/preserve placeholder semantics distinguish title, subtitle, body, picture, chart, table, generic object, media, date, footer, and slide number. Reconstructed titles are normally type-matched without an index; explicit imported title indices and all other source indices are retained. Imported `subTitle`, `obj`, `media`, and `dt` identities remain distinct through `manifest.json`, `native_structure.json`, Layout XML, and Slide XML.- Baseline/template native export reads `spec_lock.md` typography into the PowerPoint theme: `title_family` becomes the major font and `body_family` / `font_family` becomes the minor font. Matching SVG text emits `+mj-*` / `+mn-*` tokens, while unrelated emphasis/code/brand families stay concrete. Preserve mode keeps the imported source theme; flat mode keeps fixed-font diagnostic output.-- Template mode also requires numeric `typography.title` and `typography.body` rows. It writes the title size to every Master `p:titleStyle` level and the body size to every `p:bodyStyle` / `p:otherStyle` level. Each generated Layout text placeholder also stores the prototype's first direct run size in `a:lstStyle/a:lvl1pPr/a:defRPr@sz` while retaining its prompt run size. Slide direct-run sizes remain unchanged. Missing title/body rows fail template export; baseline, preserve, and flat modes do not apply these updates.+- Structured baseline and template mode require numeric `typography.title` and `typography.body` rows. They write the title size to every Master `p:titleStyle` level and the body size to every `p:bodyStyle` / `p:otherStyle` level. Each generated Layout text placeholder also stores the prototype's first direct run size in `a:lstStyle/a:lvl1pPr/a:defRPr@sz` while retaining its prompt run size. Slide direct-run sizes remain unchanged. Missing title/body rows fail explicit Layout export; legacy baseline, preserve, and flat do not apply these updates.- Baseline/template native export also maps canonical `spec_lock.md` color roles into the PowerPoint color scheme and emits context-safe `schemeClr` tokens for exact matches in SVG fills/text/strokes, gradients/patterns/bullets, native tables, and native-chart accent series. Local colors, inverse white/black, and effects stay concrete. Preserve mode keeps the imported source color scheme; flat mode keeps fixed-color diagnostic output.- Preserve mode is legacy strict-only compatibility for existing projects that already carry `native_structure.json` + `source_template.pptx`. Current template creation does not emit the pair.- Native output uses content-hash media filenames, so identical images are reused and different images cannot overwrite each other by sharing a basename.- `[Content_Types].xml` is generated from the actual media extensions written into the PPTX. Unknown media extensions fail unless Python's `mimetypes` can identify them.- Native export writes to a temporary file first and publishes the requested PPTX only after conversion succeeds. A failed conversion does not replace the main output file.-- Before publishing template-mode native output, export reopens the temporary PPTX and validates the Slide → Layout → Master graph and registrations, Layout identity, placeholder identity, reusable bounds, and prompt/level-one sizes. A mismatch aborts publication; other structure modes skip this gate.+- Before publishing structured-baseline or template-mode native output, export reopens the temporary PPTX and validates the Slide → Layout → Master graph and registrations, Layout identity, placeholder identity, reusable bounds, and prompt/level-one sizes. A mismatch aborts publication; legacy baseline, preserve, and flat skip this gate.- SVG clip paths are still restricted for authored SVGs, but nested crop wrappers generated by PPTX import are mapped back to native picture crop / geometry when possible.- Speaker notes are embedded automatically unless `--no-notes` is used- Recorded narration is opt-in:diff --git a/skills/ppt-master/scripts/svg_quality_checker.py b/skills/ppt-master/scripts/svg_quality_checker.pyindex fff29a0a..31e45c3a 100644--- a/skills/ppt-master/scripts/svg_quality_checker.py+++ b/skills/ppt-master/scripts/svg_quality_checker.py@@ -177,6 +177,7 @@ try:load_native_structure_contract as _load_native_structure_contract,load_pptx_structure_lock as _load_pptx_structure_lock,native_structure_lock_errors as _native_structure_lock_errors,+ parse_optional_layout_slides as _parse_optional_layout_slides,parse_preserve_slides as _parse_preserve_structure_slides,parse_template_slides as _parse_template_structure_slides,template_lock_errors as _template_lock_errors,@@ -189,6 +190,7 @@ except ImportError:_load_native_structure_contract = None_load_pptx_structure_lock = None_native_structure_lock_errors = None+ _parse_optional_layout_slides = None_parse_preserve_structure_slides = None_parse_template_structure_slides = None_template_lock_errors = None@@ -2174,6 +2176,7 @@ class SVGQualityChecker:"""Validate project-level layout reuse and spec_lock mappings."""if (_load_pptx_structure_lock is None+ or _parse_optional_layout_slides is Noneor _parse_template_structure_slides is Noneor _template_lock_errors is Noneor _TemplateStructureError is None@@ -2242,7 +2245,20 @@ class SVGQualityChecker:breaklocked_mode = structure_lock.mode if structure_lock is not None else Nonestructure_locked = locked_mode in {'template', 'preserve'}- if not has_metadata and not structure_locked:+ standard_project = (+ not self.template_mode+ and (project_path / 'svg_output').is_dir()+ )+ baseline_mode = not self.template_mode and (+ locked_mode == 'baseline'+ or (locked_mode is None and standard_project)+ )+ baseline_layout_locked = bool(+ baseline_mode+ and structure_lock is not None+ and structure_lock.layouts+ )+ if not has_metadata and not structure_locked and not baseline_layout_locked:returntry:@@ -2250,11 +2266,37 @@ class SVGQualityChecker:if _parse_preserve_structure_slides is None:returnspecs = _parse_preserve_structure_slides(svg_files)+ elif baseline_mode:+ specs = _parse_optional_layout_slides(svg_files)+ if specs is None:+ if structure_lock is not None and structure_lock.layouts:+ self._pptx_structure_issues.append((+ 'error',+ 'spec_lock.md pptx_layouts requires every baseline SVG '+ 'root to declare data-pptx-layout and '+ 'data-pptx-layout-name',+ ))+ elif has_metadata:+ _parse_template_structure_slides(svg_files)+ returnelse:specs = _parse_template_structure_slides(svg_files)except _TemplateStructureError as exc:self._pptx_structure_issues.append(('error', str(exc)))return+ if baseline_mode:+ if structure_lock is None or not structure_lock.layouts:+ self._pptx_structure_issues.append((+ 'error',+ 'explicit baseline Layout metadata requires a complete '+ 'spec_lock.md pptx_layouts mapping',+ ))+ return+ self._pptx_structure_issues.extend(+ ('error', message)+ for message in _template_lock_errors(specs, structure_lock)+ )+ returnif not structure_locked:returnself._pptx_structure_issues.extend(diff --git a/skills/ppt-master/scripts/svg_to_pptx/drawingml/theme_fonts.py b/skills/ppt-master/scripts/svg_to_pptx/drawingml/theme_fonts.pyindex 559d6796..6ec97880 100644--- a/skills/ppt-master/scripts/svg_to_pptx/drawingml/theme_fonts.py+++ b/skills/ppt-master/scripts/svg_to_pptx/drawingml/theme_fonts.py@@ -125,17 +125,17 @@ def _font_size_hpt(raw: str, field: str) -> int:def load_master_text_style_spec(project_path: Path) -> MasterTextStyleSpec:- """Load required title/body defaults for template slide-master txStyles."""+ """Load required title/body defaults for explicit Layout master txStyles."""lock_path = project_path / "spec_lock.md"if not lock_path.is_file():raise ThemeFontError(- "template mode requires spec_lock.md typography title and body rows"+ "explicit Layout export requires spec_lock.md typography title and body rows")rows = _typography_rows(lock_path)missing = [field for field in ("title", "body") if field not in rows]if missing:raise ThemeFontError(- "template mode requires spec_lock.md typography rows: "+ "explicit Layout export requires spec_lock.md typography rows: "+ ", ".join(missing))return MasterTextStyleSpec(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 ee805592..508ba267 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@@ -155,7 +155,7 @@ class PptxStructureContext:@dataclassclass _TemplateRuntimeSlide:- """Parsed slide package state used by explicit template structure export."""+ """Parsed slide package state used by explicit Layout structure export."""spec: TemplateSlideSpecslide_path: Path@@ -1192,7 +1192,7 @@ def _template_runtime_slides("""Load slide XML state and join it with SVG-to-shape trace ids."""if not conversion_traces:raise TemplateStructureError(- "Template export requires native conversion traces for every slide"+ "Explicit Layout export requires native conversion traces for every slide")trace_by_slide = {int(trace.get("slide_num", 0)): trace@@ -1247,9 +1247,15 @@ def _template_shape_for_item():return Noneif not shape_ids:+ text_hint = (+ "; multiline text placeholders require the default paragraph merge "+ "and cannot use --no-merge"+ if item.placeholder and item.tag == "text"+ else ""+ )raise TemplateStructureError(f"{state.spec.svg_path.name}: metadata element {item.element_id!r} "- "did not produce one top-level native shape"+ f"did not produce one top-level native shape{text_hint}")raise TemplateStructureError(f"{state.spec.svg_path.name}: metadata element {item.element_id!r} "@@ -1402,7 +1408,7 @@ def _move_template_background(if c_sld is None or background is None:raise TemplateStructureError(f"{state.spec.svg_path.name}: explicit background disappeared "- "during template structure assembly"+ "during explicit Layout structure assembly")c_sld.remove(background)@@ -1488,7 +1494,7 @@ def _apply_template_slide_backgrounds(if c_sld is None or c_sld.find(f"{{{PML_NS}}}bg") is None:raise TemplateStructureError(f"{state.spec.svg_path.name}: slide background disappeared "- "during template structure assembly"+ "during explicit Layout structure assembly")applied += 1continue@@ -1934,7 +1940,7 @@ def _set_template_layout_header_footer(_write_xml_tree(layout_path, tree)-def _apply_template_structure(+def _apply_explicit_layout_structure(extract_dir: Path,structure: PptxStructureContext,specs: list[TemplateSlideSpec],@@ -2056,7 +2062,7 @@ def _apply_template_structure(if verbose:print(- " Template structure: "+ " Explicit Layout structure: "f"{len(specs_by_layout)} layout(s), "f"{len(master_items)} master element(s), "f"{layout_shape_count} layout element(s), "@@ -2565,7 +2571,7 @@ def _prune_unused_slide_layouts(master_path.write_text(master_xml, encoding="utf-8")if verbose and pruned:- print(f" Baseline layout prune: removed {pruned} unused base layout(s)")+ print(f" Layout prune: removed {pruned} unused base layout(s)")return pruned@@ -3365,6 +3371,8 @@ def create_pptx_with_native_svg(theme_font_spec: ThemeFontSpec | None = None,master_text_style_spec: MasterTextStyleSpec | None = None,theme_color_spec: ThemeColorSpec | None = None,+ structured_baseline: bool = False,+ baseline_layout_specs: list[TemplateSlideSpec] | None = None,) -> bool:"""Create a PPTX file with native DrawingML shapes.@@ -3414,10 +3422,18 @@ def create_pptx_with_native_svg(theme_font_spec: Locked project major/minor fonts for baseline/templatetheme inheritance. Preserve and flat modes ignore this value.master_text_style_spec: Required locked title/body sizes for template- slide-master text styles. Other structure modes ignore this value.+ and structured-baseline slide-master text styles. Other structure+ routes ignore this value.theme_color_spec: Locked project color scheme for context-awarebaseline/template theme inheritance. Preserve and flat modesignore this value.+ structured_baseline: Explicitly route a baseline/free-design deck+ through the reusable Layout compiler. This is an all-or-none+ route selected by the project contract, never inferred here from+ visual similarity or root metadata.+ baseline_layout_specs: Fully parsed explicit Layout contracts for a+ structured baseline deck. Required exactly when+ ``structured_baseline`` is true.Returns:Whether all slides were successfully created.@@ -3434,13 +3450,44 @@ def create_pptx_with_native_svg(use_compat_mode = Falseif pptx_structure not in {"baseline", "template", "preserve", "flat"}:raise ValueError(f"Unsupported pptx_structure: {pptx_structure}")- if pptx_structure == "template" and master_text_style_spec is None:+ if structured_baseline and pptx_structure != "baseline":+ raise ValueError(+ "structured_baseline is available only with pptx_structure='baseline'"+ )+ if structured_baseline:+ if not baseline_layout_specs:+ raise TemplateStructureError(+ "Structured baseline export requires explicit Layout specs for every slide"+ )+ expected_slide_nums = list(range(1, len(svg_files) + 1))+ actual_slide_nums = [spec.slide_num for spec in baseline_layout_specs]+ if actual_slide_nums != expected_slide_nums:+ raise TemplateStructureError(+ "Structured baseline Layout specs must cover every generated slide "+ "exactly once in slide order"+ )+ actual_paths = [spec.svg_path.resolve() for spec in baseline_layout_specs]+ expected_paths = [svg_path.resolve() for svg_path in svg_files]+ if actual_paths != expected_paths:+ raise TemplateStructureError(+ "Structured baseline Layout specs do not match the generated SVG files"+ )+ elif baseline_layout_specs is not None:+ raise ValueError(+ "baseline_layout_specs requires structured_baseline=True"+ )+ if (+ pptx_structure == "template" or structured_baseline+ ) and master_text_style_spec is None:+ context = "Structured baseline" if structured_baseline else "Template"raise ValueError(- "Template export requires locked typography title/body sizes "+ f"{context} export requires locked typography title/body sizes ""in master_text_style_spec")if use_native_shapes and pptx_structure == "template":template_specs = parse_template_slides(svg_files)+ elif use_native_shapes and structured_baseline:+ template_specs = baseline_layout_specselif use_native_shapes and pptx_structure == "preserve":if native_structure_contract is None:raise TemplateStructureError(@@ -3460,8 +3507,13 @@ def create_pptx_with_native_svg(})if native_placeholders:kinds = ", ".join(str(kind) for kind in native_placeholders)+ context = (+ "Structured baseline"+ if structured_baseline+ else pptx_structure.capitalize()+ )raise TemplateStructureError(- f"Template {kinds} placeholder(s) require --native-objects so each "+ f"{context} {kinds} placeholder(s) require --native-objects so each ""marker becomes one native PowerPoint object")@@ -3503,7 +3555,12 @@ def create_pptx_with_native_svg(" Native table/chart objects: "f"{'Enabled' if native_objects else 'Disabled'}")- print(f" PPTX structure: {pptx_structure}")+ structure_label = (+ "baseline (explicit layouts)"+ if structured_baseline+ else pptx_structure+ )+ print(f" PPTX structure: {structure_label}")if image_optimize:if image_sizing == 'display':image_mode = (@@ -3583,14 +3640,19 @@ def create_pptx_with_native_svg()if active_theme_color_spec is not None:apply_theme_color_spec(extract_dir, active_theme_color_spec)- if pptx_structure == "template":+ if pptx_structure == "template" or structured_baseline:master_count = apply_master_text_style_spec(extract_dir,master_text_style_spec,)if verbose:+ context = (+ "Structured baseline"+ if structured_baseline+ else "Template"+ )print(- " Template master text styles: "+ f" {context} master text styles: "f"{master_count} master(s), "f"title {master_text_style_spec.title_hpt / 100:g}pt, "f"body {master_text_style_spec.body_hpt / 100:g}pt"@@ -4078,33 +4140,52 @@ def create_pptx_with_native_svg(extract_dir,len(svg_files),conversion_trace if conversion_trace is not None else structure_trace,+ context=(+ "Structured baseline"+ if structured_baseline+ else "Baseline"+ ),verbose=verbose,)- _promote_common_slide_backgrounds_to_masters(- extract_dir,- structure,- len(svg_files),- verbose=verbose,- )- _promote_common_chrome_shapes_to_masters(- extract_dir,- structure,- len(svg_files),- conversion_trace if conversion_trace is not None else structure_trace,- verbose=verbose,- )- _extract_baseline_layout_families(- extract_dir,- structure,- svg_files,- verbose=verbose,- )- _promote_common_chrome_shapes_to_layouts(- extract_dir,- len(svg_files),- conversion_trace if conversion_trace is not None else structure_trace,- verbose=verbose,- )+ if structured_baseline:+ if template_specs is None:+ raise TemplateStructureError(+ "Structured baseline metadata was not parsed before export"+ )+ _apply_explicit_layout_structure(+ extract_dir,+ structure,+ template_specs,+ conversion_trace if conversion_trace is not None else structure_trace,+ active_theme_font_spec,+ verbose=verbose,+ )+ else:+ _promote_common_slide_backgrounds_to_masters(+ extract_dir,+ structure,+ len(svg_files),+ verbose=verbose,+ )+ _promote_common_chrome_shapes_to_masters(+ extract_dir,+ structure,+ len(svg_files),+ conversion_trace if conversion_trace is not None else structure_trace,+ verbose=verbose,+ )+ _extract_baseline_layout_families(+ extract_dir,+ structure,+ svg_files,+ verbose=verbose,+ )+ _promote_common_chrome_shapes_to_layouts(+ extract_dir,+ len(svg_files),+ conversion_trace if conversion_trace is not None else structure_trace,+ verbose=verbose,+ )_prune_unused_slide_layouts(extract_dir,structure,@@ -4128,7 +4209,7 @@ def create_pptx_with_native_svg(raise TemplateStructureError("Template structure metadata was not parsed before export")- _apply_template_structure(+ _apply_explicit_layout_structure(extract_dir,structure,template_specs,@@ -4258,18 +4339,23 @@ def create_pptx_with_native_svg(zf.write(file_path, arcname)if (use_native_shapes- and pptx_structure == "template"+ and (pptx_structure == "template" or structured_baseline)and success_count == len(svg_files)):if template_specs is None:raise TemplateStructureError(- "Template structure metadata was not parsed before validation"+ "Explicit Layout metadata was not parsed before validation")try:validate_pptx_template_package(temp_output_path, template_specs)except ValueError as exc:+ context = (+ "Structured baseline"+ if structured_baseline+ else "Template"+ )raise TemplateStructureError(- f"PPTX template package validation failed: {exc}"+ f"PPTX {context.lower()} package validation failed: {exc}") from exctry:validate_pptx_transition_package(diff --git a/skills/ppt-master/scripts/svg_to_pptx/pptx_package/cli.py b/skills/ppt-master/scripts/svg_to_pptx/pptx_package/cli.pyindex 844c084e..6a449cff 100644--- a/skills/ppt-master/scripts/svg_to_pptx/pptx_package/cli.py+++ b/skills/ppt-master/scripts/svg_to_pptx/pptx_package/cli.py@@ -51,6 +51,7 @@ from .template_structure import (load_native_structure_contract,load_pptx_structure_lock,native_structure_lock_errors,+ parse_optional_layout_slides,parse_preserve_slides,parse_template_slides,template_lock_errors,@@ -272,9 +273,10 @@ Recorded narration:help=('PPTX structure strategy for native export. When omitted, read ''spec_lock.md pptx_structure.mode, falling back to baseline. baseline '- 'promotes safe repeated background/chrome and extracts conservative '- 'semantic page-role layout families plus exact family-wide '- 'structurally marked chrome (legacy filenames/ids remain fallbacks); '+ 'compiles an all-page explicit Layout contract when pptx_layouts and '+ 'matching SVG metadata are present; otherwise it promotes safe repeated '+ 'background/chrome and extracts conservative semantic page-role layout '+ 'families (legacy filenames/ids remain fallbacks); ''template consumes explicit ''data-pptx-layout/layer/placeholder metadata to build reusable layouts; ''preserve is legacy compatibility for imported source packages; '@@ -366,19 +368,15 @@ Recorded narration:structure_lock = Nonenative_structure_contract = Nonepptx_structure = args.pptx_structure- if pptx_structure is None:+ if pptx_structure is None or pptx_structure == 'preserve':try:structure_lock = load_pptx_structure_lock(project_path)except TemplateStructureError as exc:print(f"Error: {exc}", file=sys.stderr)return 1+ if pptx_structure is None:pptx_structure = structure_lock.mode if structure_lock else 'baseline'elif pptx_structure == 'preserve':- try:- structure_lock = load_pptx_structure_lock(project_path)- except TemplateStructureError as exc:- print(f"Error: {exc}", file=sys.stderr)- return 1if structure_lock is None or structure_lock.mode != 'preserve':print("Error: --pptx-structure preserve requires a preserve-mode "@@ -438,6 +436,70 @@ Recorded narration:print("Error: No SVG files found")return 1+ structured_baseline = False+ baseline_layout_specs = None+ if pptx_structure == 'baseline':+ try:+ baseline_layout_specs = parse_optional_layout_slides(native_files)+ except TemplateStructureError as exc:+ print(f"Error: {exc}", file=sys.stderr)+ return 1++ if structure_lock is None:+ if baseline_layout_specs is not None:+ try:+ structure_lock = load_pptx_structure_lock(project_path)+ except TemplateStructureError as exc:+ print(f"Error: {exc}", file=sys.stderr)+ return 1+ elif args.pptx_structure == 'baseline':+ # A diagnostic baseline override may bypass a stale or damaged+ # template/preserve lock. A valid baseline lock remains+ # authoritative, so its pptx_layouts mapping cannot be silently+ # downgraded to the legacy page-role route.+ try:+ candidate_lock = load_pptx_structure_lock(project_path)+ except TemplateStructureError:+ candidate_lock = None+ if candidate_lock is not None and candidate_lock.mode == 'baseline':+ structure_lock = candidate_lock++ locked_layouts = structure_lock.layouts if structure_lock is not None else ()+ if baseline_layout_specs is None:+ if locked_layouts:+ print(+ "Error: spec_lock.md pptx_layouts requires every baseline SVG "+ "root to declare data-pptx-layout and data-pptx-layout-name",+ file=sys.stderr,+ )+ return 1+ else:+ if not locked_layouts or structure_lock is None:+ print(+ "Error: explicit baseline Layout metadata requires a complete "+ "spec_lock.md pptx_layouts mapping",+ file=sys.stderr,+ )+ return 1+ lock_errors = template_lock_errors(+ baseline_layout_specs,+ structure_lock,+ )+ if lock_errors:+ print(+ "Error: PPTX structure does not match spec_lock.md:",+ file=sys.stderr,+ )+ for message in lock_errors:+ print(f" {message}", file=sys.stderr)+ return 1+ structured_baseline = True+ try:+ master_text_style_spec = load_master_text_style_spec(project_path)+ except ThemeFontError as exc:+ print(f"Error: {exc}", file=sys.stderr)+ return 1+if (pptx_structure in {'template', 'preserve'}and structure_lock is not None@@ -835,6 +897,8 @@ Recorded narration:image_quality=args.image_quality,native_objects=args.native_objects,pptx_structure=pptx_structure,+ structured_baseline=structured_baseline,+ baseline_layout_specs=baseline_layout_specs,native_structure_contract=native_structure_contract,theme_font_spec=theme_font_spec,master_text_style_spec=master_text_style_spec,diff --git a/skills/ppt-master/scripts/svg_to_pptx/pptx_package/template_structure.py b/skills/ppt-master/scripts/svg_to_pptx/pptx_package/template_structure.pyindex f4b3f367..7f2e2cde 100644--- a/skills/ppt-master/scripts/svg_to_pptx/pptx_package/template_structure.py+++ b/skills/ppt-master/scripts/svg_to_pptx/pptx_package/template_structure.py@@ -404,7 +404,14 @@ def load_pptx_structure_lock(project_path: Path) -> PptxStructureLock | None:structure_rows = sections.get("pptx_structure", [])layout_rows = sections.get("pptx_layouts", [])- if not structure_rows and not layout_rows:+ structure_section_present = "pptx_structure" in sections+ layout_section_present = "pptx_layouts" in sections+ if (+ not structure_rows+ and not layout_rows+ and not structure_section_present+ and not layout_section_present+ ):return Nonemode_rows = [value.strip().lower() for key, value in structure_rows if key == "mode"]if len(mode_rows) != 1:@@ -509,10 +516,22 @@ def load_pptx_structure_lock(project_path: Path) -> PptxStructureLock | None:raise TemplateStructureError(f"spec_lock.md {mode} mode requires one pptx_layouts row per page")- if mode not in {"template", "preserve"} and references:+ if mode == "baseline" and layout_section_present and not references:raise TemplateStructureError(- "spec_lock.md pptx_layouts is allowed only when pptx_structure.mode "- "is template or preserve"+ "spec_lock.md baseline pptx_layouts section must contain one row per "+ "page; omit the whole section only for a legacy baseline project"+ )+ if mode == "baseline" and any(+ reference.layout_name is None for reference in references+ ):+ raise TemplateStructureError(+ "spec_lock.md baseline pptx_layouts rows require "+ "'<layout_key> | <PowerPoint layout name>'"+ )+ if mode == "flat" and layout_section_present:+ raise TemplateStructureError(+ "spec_lock.md pptx_layouts section is not allowed when "+ "pptx_structure.mode is flat")return PptxStructureLock(mode=mode,@@ -1042,6 +1061,72 @@ def parse_template_slides(svg_files: list[Path]) -> list[TemplateSlideSpec]:return specs+def parse_optional_layout_slides(+ svg_files: list[Path],+) -> list[TemplateSlideSpec] | None:+ """Parse an all-or-none explicit Layout contract, or return legacy absence."""+ roots: list[tuple[Path, ET.Element]] = []+ has_structure_metadata = False+ for svg_path in svg_files:+ try:+ root = ET.parse(svg_path).getroot()+ except (OSError, ET.ParseError) as exc:+ raise TemplateStructureError(+ f"{svg_path.name}: unable to inspect SVG Layout metadata: {exc}"+ ) from exc+ roots.append((svg_path, root))+ has_structure_metadata = has_structure_metadata or any(+ elem.get(attr) is not None+ for elem in root.iter()+ for attr in _STRUCTURE_ATTRS+ )++ if not has_structure_metadata:+ return None++ missing_keys = [+ svg_path.name+ for svg_path, root in roots+ if not (root.get("data-pptx-layout") or "").strip()+ ]+ missing_names = [+ svg_path.name+ for svg_path, root in roots+ if not (root.get("data-pptx-layout-name") or "").strip()+ ]+ if missing_keys or missing_names:+ missing_fields: list[str] = []+ if missing_keys:+ missing_fields.append(+ "data-pptx-layout: " + ", ".join(missing_keys)+ )+ if missing_names:+ missing_fields.append(+ "data-pptx-layout-name: " + ", ".join(missing_names)+ )+ raise TemplateStructureError(+ "Explicit Layout metadata is all-or-none: once any SVG uses PPTX "+ "structure metadata, every generated page root must declare "+ "data-pptx-layout and data-pptx-layout-name with non-empty values; "+ "missing "+ + "; ".join(missing_fields)+ )+ specs = parse_template_slides(svg_files)+ empty_layouts = sorted({+ spec.layout_key+ for spec in specs+ if not spec.layout_elements and not spec.placeholders+ })+ if empty_layouts:+ raise TemplateStructureError(+ "Explicit baseline Layout contracts must define at least one "+ "data-pptx-layer='layout' element or data-pptx-placeholder per "+ "layout key; empty: "+ + ", ".join(empty_layouts)+ )+ return specs++def parse_preserve_slides(svg_files: list[Path]) -> list[TemplateSlideSpec]:"""Parse preserve-mode slides before source master grouping is known."""specs = [@@ -1058,7 +1143,7 @@ def template_lock_errors(structure_lock: PptxStructureLock,) -> list[str]:"""Return mismatches between parsed SVG layouts and the project lock."""- if structure_lock.mode not in {"template", "preserve"}:+ if structure_lock.mode not in {"baseline", "template", "preserve"}:return []errors: list[str] = []references = {diff --git a/skills/ppt-master/templates/spec_lock_reference.md b/skills/ppt-master/templates/spec_lock_reference.mdindex ac064acf..02b83d43 100644--- a/skills/ppt-master/templates/spec_lock_reference.md+++ b/skills/ppt-master/templates/spec_lock_reference.md@@ -136,7 +136,7 @@> ```> Omit the row for free design and brand-only templates. Both values require one `page_layouts` and one `pptx_layouts` row per page. `strict` keeps the selected Layout contract; `adaptive` may create a new explicit Layout under the same template Master.>-> - `baseline` — default for free design and brand-only routes. Preserve conservative shared Master/background/chrome behavior, then assign Cover/Agenda/Section/Closing/Content from root `data-pptx-page-role`. It may also promote exact family-wide leading structurally marked chrome into a Layout. Marker-free legacy SVGs retain filename/id fallback. Actual content stays slide-local; no placeholders or visual-similarity inference are authored.+> - `baseline` — default for free design and brand-only routes. New projects pair this mode with a complete `pptx_layouts` section and explicit root Layout/layer/placeholder metadata while remaining `baseline`; no deck/layout template or `page_layouts` section is implied. A legacy baseline lock whose entire `pptx_layouts` section is absent retains root `data-pptx-page-role`, conservative shared chrome promotion, and filename/id compatibility fallback. Actual content stays Slide-local in both paths.> - `template` — required whenever Step 3 loaded a deck/layout template. Requires complete `page_layouts` and `pptx_layouts` sections plus explicit SVG structure metadata on every generated page.> - `preserve` — legacy strict-only compatibility for an existing project that already ships `native_structure.json` + `source_template.pptx`. Do not select it for newly created templates.> - `flat` — diagnostic escape hatch. Do not lock this in a normal project; pass it on the CLI when comparing slide-local output.@@ -151,7 +151,7 @@## pptx_layouts-> Emit this section only when `pptx_structure.mode` is `template` or legacy `preserve`. Include exactly one row per generated page. Value format: `<layout_key> | <PowerPoint layout name>`. Strict template use copies the selected SVG key/name; adaptive use may declare a new stable key/name. Preserve uses the legacy native contract.+> Emit this section for every new generated deck, including free-design and brand-only decks that remain `pptx_structure.mode: baseline`. Include exactly one row per generated page. Value format: `<layout_key> | <PowerPoint layout name>`. Baseline keys/names describe the authored output composition, strict template use copies the selected SVG key/name, adaptive template use may declare a new stable key/name, and preserve uses the legacy native contract. Only a legacy baseline project may omit the whole section and fall back to `data-pptx-page-role`.>> Example:> ```@@ -161,7 +161,7 @@> - P04: section | Section Header> ```>-> Reuse one key only when pages share the same static layout layer and placeholder contract. Do not generate one unique key per slide merely because every page has different content. A one-off cover/section layout is valid; content differences stay slide-local.+> Reuse one key only when pages share the same reusable static Layout layer and placeholder type/index/bounds contract. Give genuinely different reusable compositions different keys even when they share a page role. Do not generate one unique key per slide merely because its wording, data, or imagery differs. Choose keys from the authored page plan, never from visual clustering, filenames, or content similarity. Keep concrete content and complex grouped compositions Slide-local; do not move them into the Layout to manufacture reuse.## page_layouts- P01: 01_cover@@ -174,7 +174,7 @@>> **Hard rule**: Use both `page_layouts` and `page_charts` only with a compatible shell. Adaptive mode may start from a neutral content template and create a new explicit Layout; strict mode must choose an existing compatible Layout or revise the outline.>-> **Whole section omitted** → free design or brand-only route.+> **Whole section omitted** → free design or brand-only route. This omission applies only to `page_layouts`; every new route still emits complete `pptx_layouts` output mappings.>> **Strategist source**: copy the per-page SVG choices from `design_spec.md §VI Page Roster` (or §IX outline if Roster is absent). Names must match files in `templates/` exactly — typos cause silent fallback to free design.