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
feat(svg-assets): standardize imported vector namespace
hugohe3a677d77c2fe5
diff --git a/docs/powerpoint-svg-mapping.md b/docs/powerpoint-svg-mapping.mdindex c825199c..ab15fd26 100644--- a/docs/powerpoint-svg-mapping.md+++ b/docs/powerpoint-svg-mapping.md@@ -99,7 +99,7 @@ Internal identifiers and PowerPoint display names are separate concerns: Master| Action button shape | Compact authored `actionButton*` preset group | Visual preset geometry only | Shape geometry can round-trip | No click action, navigation target, or hyperlink is created || Group | `<g>` | `p:grpSp`, or a documented flatten/collapse for a special carrier | Grouped content can reconstruct as `<g>` | Structural atoms and placeholder contracts override ordinary grouping || Reused local symbol | Registered same-document `<use>` contract or project icon placeholder | Expanded editable shapes in the generated slide | Original symbol graph is not promised on import | External use, unsupported symbol features, and structural metadata reuse are rejected |-| Icon | `<use data-icon="library/name">` resolved by the project icon pipeline | Editable vector primitives/group after expansion | Reconstructed geometry, not the original library reference | Icon identifiers are case-sensitive and must exist in the synchronized library |+| Icon / imported vector | `<use data-icon="library/name">` resolved by the project icon pipeline; create-template imports use `imported/<name>` | Editable vector primitives/group after expansion | Reconstructed geometry, not the original library reference | Identifiers are case-sensitive; imported assets exist once at workspace-root `icons/imported/<name>.svg` || SmartArt / DiagramML | No main SVG object mapping | Main redesign route may rebuild the meaning with ordinary shapes | `Direct preservation` in native/template routes; otherwise a preview or explicit fallback | Do not label a decorative group as native SmartArt |Project-authored presets deliberately use a compact representation, while PPTXdiff --git a/docs/technical-design.md b/docs/technical-design.mdindex 92f4cd92..ddf02f67 100644--- a/docs/technical-design.md+++ b/docs/technical-design.md@@ -294,9 +294,10 @@ All current Brand/Layout/Deck packages use one workspace routing contract. Brand```text<template_workspace>/-├── templates/ # design_spec.md, SVG prototypes, templates/icons/ when used+├── templates/ # design_spec.md and SVG prototypes├── images/ # optional; bitmap assets referenced as ../images/<name>-├── icons/ # optional; runtime copy of extracted vector assets+├── icons/+│ └── imported/ # optional; canonical imported vector assets└── exports/ # optional, on-demand review files; Git-ignored in the library```diff --git a/docs/templates-architecture.md b/docs/templates-architecture.mdindex 28b0e3e0..9257b909 100644--- a/docs/templates-architecture.md+++ b/docs/templates-architecture.md@@ -55,16 +55,20 @@ Both roots have the same core shape:<template_workspace>/├── templates/│ ├── design_spec.md-│ ├── *.svg-│ └── icons/ # package/validation copy when used+│ └── *.svg├── images/ # optional; SVG href uses ../images/<name>-├── icons/ # optional; runtime vector assets+├── icons/+│ └── imported/ # optional; canonical imported vector assets└── exports/ # optional; created only for on-demand review└── <id>_template_preview.pptx```Empty optional directories are omitted; do not add placeholder files. An on-demand preview PPTX is derived review evidence, not a source template asset. Step 3 reads the workspace root and consumes `templates/` plus any existing `images/` and `icons/`; it ignores `exports/`. Library `exports/` directories are Git-ignored.+Imported vectors use `data-icon="imported/<name>"` and have one canonical file+at `icons/imported/<name>.svg`. Workspace-aware validation and export resolve+that root path directly; `templates/icons/` is not part of the package shape.+PPTX import uses a two-level metadata model. The temporary lossless SVG keeps native-shape metadata, hidden carriers, and preview evidence; `svg_authoring_view.py` creates a lightweight model-facing projection without opaque payload or duplicate hidden carriers. The projection is never an export source. Authored modes use project-canonical SVG and compact authored-preset groups only for exact registered preset matches. Mirror may reuse converter-supported metadata on unchanged Slide-local/slot objects; fixed structural layers remain direct atoms, and unsupported or edited objects keep their SVG fallback. Export compiles only the declared SVG structure and never infers ownership.Both scopes retain `kind: layout` or `kind: deck` in portable frontmatter. `output_scope` and `target_project` stay in the workflow brief and are not persisted into `design_spec.md`.diff --git a/docs/templates-guide.md b/docs/templates-guide.mdindex b4037568..13b9b5e2 100644--- a/docs/templates-guide.md+++ b/docs/templates-guide.md@@ -152,7 +152,7 @@ The workflow does not silently infer values — before generation it lists theseAfter confirmation the workflow echoes the finalized brief and emits the marker `[TEMPLATE_BRIEF_CONFIRMED]`. Subsequent steps only run after that marker. **This is a hard gate — no brief, no generation.**-Before either scope writes final files, one hard preflight resolves the required `templates/` destination and any optional asset destinations, requires an empty `templates/` root, and rejects bitmap or icon filename collisions in `images/`, `icons/`, and `templates/icons/`. It checks `exports/` only when a review PPTX was requested. Project scope additionally requires an initialized target project. A failed check stops before partial output; the workflow does not merge or overwrite.+Before either scope writes final files, one hard preflight resolves the required `templates/` destination and any optional asset destinations, requires an empty `templates/` root, and rejects bitmap or imported-vector filename collisions in `images/` and `icons/imported/`. It checks `exports/` only when a review PPTX was requested. Project scope additionally requires an initialized target project. A failed check stops before partial output; the workflow does not merge or overwrite.> Why so strict? A template is a structural contract, whether it is reused globally or only inside the current project. Confirming ownership and geometry first avoids partial or misplaced output.@@ -207,12 +207,12 @@ Library and project scopes use the same core structure; substitute either `skill│ ├── 03_chapter.svg│ ├── 04_content.svg│ ├── 04a_content_two_col.svg # fidelity variant-│ ├── 05_ending.svg-│ └── icons/ # package/validation copy when used+│ └── 05_ending.svg├── images/ # optional│ └── *.png / *.jpg # SVG references use ../images/<name>├── icons/ # optional-│ └── *.svg # runtime copy of extracted vectors+│ └── imported/+│ └── *.svg # one canonical copy of imported vectors└── exports/ # optional; on-demand review output└── <id>_template_preview.pptx```@@ -221,6 +221,11 @@ Library and project scopes use the same core structure; substitute either `skillA `mirror` workspace uses the same tree but places its source-ordered `001_cover.svg`, `002_toc.svg`, … files under `templates/`. It may keep literal example text instead of `{{...}}` markers, while imported native slots still carry semantic metadata.+Imported vector placeholders use `data-icon="imported/<name>"`. Validation,+preview export, and final export all resolve the same workspace-root asset at+`icons/imported/<name>.svg`; a second `templates/icons/` copy is neither needed+nor allowed.+### Library registration vs project placement- **Library scope (`library`, default)** writes the workspace under `skills/ppt-master/templates/<kind>/<id>/` and registers it globally.diff --git a/docs/zh/powerpoint-svg-mapping.md b/docs/zh/powerpoint-svg-mapping.mdindex 7df53913..be36fea6 100644--- a/docs/zh/powerpoint-svg-mapping.md+++ b/docs/zh/powerpoint-svg-mapping.md@@ -99,7 +99,7 @@ PowerPoint 意图| 动作按钮形状 | compact authored `actionButton*` preset 组 | 仅生成可见 preset 几何 | 形状几何可往返 | 不创建单击动作、导航目标或超链接 || 组 | `<g>` | `p:grpSp`,或对特殊 carrier 执行文档化的 flatten/collapse | 分组内容可重建为 `<g>` | 结构 atom 与 placeholder 合同优先于普通分组 || 复用本地 symbol | 已登记的同文档 `<use>` 合同或项目 icon placeholder | 在生成 Slide 中展开为可编辑 shape | 回导不承诺恢复原 symbol 图 | 拒绝外部 use、不受支持的 symbol 能力和结构 metadata 复用 |-| 图标 | 由项目图标管线解析的 `<use data-icon="library/name">` | 展开后的可编辑矢量原语/组 | 重建几何,不恢复原图标库引用 | 图标标识区分大小写,必须存在于已同步图标库 |+| 图标 / 导入向量 | 由项目图标管线解析的 `<use data-icon="library/name">`;create-template 导入统一使用 `imported/<name>` | 展开后的可编辑矢量原语/组 | 重建几何,不恢复原图标库引用 | 标识区分大小写;导入素材仅在工作区根目录 `icons/imported/<name>.svg` 保留一份 || SmartArt / DiagramML | 无主 SVG 对象映射 | 主重设计路线可以用普通 shape 重建语义 | 原生/模板路线中为 `Direct preservation`,否则为 preview 或显式 fallback | 不得将装饰性组标记为原生 SmartArt |项目创作 preset 有意采用 compact 表达,而 PPTX 导入继续保留无损往返裁决所需的 expanded 证据。精确机器合同仍属于 [`shared-standards.md`](../../skills/ppt-master/references/shared-standards.md),preset 选择与创作行为见 [`native-shape-authoring.md`](../../skills/ppt-master/references/native-shape-authoring.md)。diff --git a/docs/zh/technical-design.md b/docs/zh/technical-design.mdindex db164055..d103e534 100644--- a/docs/zh/technical-design.md+++ b/docs/zh/technical-design.md@@ -296,9 +296,10 @@ PPT Master 不只服务 PPT——同一套 SVG → DrawingML 流水线还能产```text<template_workspace>/-├── templates/ # design_spec.md、SVG 原型,以及使用时的 templates/icons/+├── templates/ # design_spec.md 与 SVG 原型├── images/ # 可选;位图素材,SVG 统一引用 ../images/<name>-├── icons/ # 可选;提取向量素材的运行期副本+├── icons/+│ └── imported/ # 可选;导入向量素材的唯一规范副本└── exports/ # 可选、按需生成的审阅文件;全局库下由 Git 忽略```diff --git a/docs/zh/templates-architecture.md b/docs/zh/templates-architecture.mdindex 1b60f145..41b69453 100644--- a/docs/zh/templates-architecture.md+++ b/docs/zh/templates-architecture.md@@ -57,16 +57,18 @@ native_structure_mode: structured<template_workspace>/├── templates/│ ├── design_spec.md-│ ├── *.svg-│ └── icons/ # 使用时保留 package / 校验副本+│ └── *.svg├── images/ # 可选;SVG 统一引用 ../images/<name>-├── icons/ # 可选;提取向量素材的运行期副本+├── icons/+│ └── imported/ # 可选;导入向量素材的唯一规范副本└── exports/ # 可选;仅在按需生成审阅文件时创建└── <id>_template_preview.pptx```空的可选目录直接省略,不添加占位文件。按需生成的预览 PPTX 是派生审阅证据,不是模板源资产。Step 3 读取工作区根目录,只消费 `templates/` 及实际存在的 `images/`、`icons/`,不会复制或使用 `exports/`;全局库下的 `exports/` 统一由 Git 忽略。+导入向量统一使用 `data-icon="imported/<name>"`,唯一规范文件位于 `icons/imported/<name>.svg`。具备工作区感知的校验与导出会直接解析这个根目录路径;`templates/icons/` 不属于模板包结构。+原生形状 metadata 采用两级模型。完整导入 SVG 保存 native metadata、隐藏 carrier 和预览证据;轻量 authoring projection 移除大体积载荷与重复 carrier,只供模型检查,永远不是导出源。创作模式使用项目规范化 SVG,只有精确匹配已登记 preset 时才使用 compact authored-preset 组。Mirror 可在未改的 Slide-local/slot 对象上复用转换器已经支持的 metadata;固定结构层保持直接原子,不支持或已修改的对象保留 SVG fallback。导出只编译声明的结构,不推断归属。两种范围都在可移植 frontmatter 中保留 `kind: layout` 或 `kind: deck`。`output_scope` 与 `target_project` 只属于工作流简报,不写入 `design_spec.md`。diff --git a/docs/zh/templates-guide.md b/docs/zh/templates-guide.mdindex eaa98bc5..676ec93c 100644--- a/docs/zh/templates-guide.md+++ b/docs/zh/templates-guide.md@@ -152,7 +152,7 @@ PPT Master 的“模板”是一份**结构 + 风格**的预设包:每张 SVG确认后,工作流会回显一份完整简报并写入标记 `[TEMPLATE_BRIEF_CONFIRMED]`,从这一刻起后续步骤才会启动。**这是一个硬门——简报没确认,不会开始生成**。-无论选择哪种范围,第一次写最终文件前都会做一次完整预检:解析必需的 `templates/` 和实际需要的可选素材目录,要求 `templates/` 为空,并检查 `images/`、`icons/` 与 `templates/icons/` 中计划写入的位图和图标文件名没有冲突;只有明确要求审阅 PPTX 时才检查 `exports/`。项目范围还要求目标项目已经初始化。任一检查失败都会在写入前停止,不合并、不覆盖,也不会留下半套输出。+无论选择哪种范围,第一次写最终文件前都会做一次完整预检:解析必需的 `templates/` 和实际需要的可选素材目录,要求 `templates/` 为空,并检查 `images/` 与 `icons/imported/` 中计划写入的位图和导入向量文件名没有冲突;只有明确要求审阅 PPTX 时才检查 `exports/`。项目范围还要求目标项目已经初始化。任一检查失败都会在写入前停止,不合并、不覆盖,也不会留下半套输出。> 为什么这么严?无论模板进入全局库,还是只服务当前项目,它都是结构契约。先确认归属和几何,可避免半成品或资产落错目录。@@ -207,12 +207,12 @@ PPT Master 的“模板”是一份**结构 + 风格**的预设包:每张 SVG│ ├── 03_chapter.svg│ ├── 04_content.svg│ ├── 04a_content_two_col.svg # fidelity 变体-│ ├── 05_ending.svg-│ └── icons/ # 使用时的 package / 校验副本+│ └── 05_ending.svg├── images/ # 可选│ └── *.png / *.jpg # SVG 统一引用 ../images/<name>├── icons/ # 可选-│ └── *.svg # 提取向量素材的运行期副本+│ └── imported/+│ └── *.svg # 导入向量素材的唯一规范副本└── exports/ # 可选;按需生成审阅文件└── <id>_template_preview.pptx```@@ -221,6 +221,8 @@ PPT Master 的“模板”是一份**结构 + 风格**的预设包:每张 SVG`mirror` 工作区使用同一棵目录树,只是把按源页排序的 `001_cover.svg`、`002_toc.svg` 等文件放进 `templates/`。它可以保留原示例文字而不写 `{{...}}`,但导入识别出的原生内容槽仍带语义 metadata。+导入向量占位符统一写成 `data-icon="imported/<name>"`。校验、预览导出与最终导出都解析工作区根目录下同一份 `icons/imported/<name>.svg`;不需要、也不允许再创建 `templates/icons/` 副本。+### 全局注册与项目放置- **全局库范围(`library`,默认)**把工作区写入 `skills/ppt-master/templates/<kind>/<id>/`,并完成全局注册。diff --git a/skills/ppt-master/SKILL.md b/skills/ppt-master/SKILL.mdindex 552aed7b..c3015c00 100644--- a/skills/ppt-master/SKILL.md+++ b/skills/ppt-master/SKILL.md@@ -300,7 +300,7 @@ Normalize every explicit path before any write:Never infer that a flat directory has legacy Master/Layout semantics solely from packaging.-The same current-workspace routing applies to all three kinds: source/spec in `templates/`, visual assets in `images/`, runtime icons in `icons/`, and on-demand review artifacts in `exports/`. Empty optional roots are omitted rather than retained with placeholder files, so a normal workspace has no `exports/` until a review file is explicitly generated. The spec's `kind` tells Strategist how to read the installed source. Template SVGs are not export-time overlays: visible output still lives completely in `svg_output/`. Their complete visuals and explicit Master/Layout/placeholder metadata are nevertheless the authoring prototypes selected by `page_layouts`.+The same current-workspace routing applies to all three kinds: source/spec in `templates/`, visual assets in `images/`, imported vectors once in `icons/imported/`, other explicitly adopted icon-library namespaces under `icons/`, and on-demand review artifacts in `exports/`. Empty optional roots are omitted rather than retained with placeholder files, so a normal workspace has no `exports/` until a review file is explicitly generated. The spec's `kind` tells Strategist how to read the installed source. Template SVGs are not export-time overlays: visible output still lives completely in `svg_output/`. Their complete visuals and explicit Master/Layout/placeholder metadata are nevertheless the authoring prototypes selected by `page_layouts`.When `create-template` used project output scope, its workspace root is the target project itself and all core directories are already final. Resolve both roots before copying: equality means **in-place consumption**, so skip the installation. An in-place workspace cannot participate in multi-path fusion; use external workspaces for fusion. Never place the local source under a nested `templates/local_master/` directory because the confirmation and quality gates read the project `templates/` root.diff --git a/skills/ppt-master/references/template-designer.md b/skills/ppt-master/references/template-designer.mdindex e4d82761..d34fbed2 100644--- a/skills/ppt-master/references/template-designer.md+++ b/skills/ppt-master/references/template-designer.md@@ -17,7 +17,7 @@ Generate reusable page templates inside the complete workspace selected by `crea**Hard rule — scope is execution metadata**: Use `output_scope` and `target_project` to route files, but do not write either field into portable `design_spec.md` frontmatter. Do not create a new PPTX structure mode; deck/layout output declares `native_structure_mode: structured`.-**Workspace precondition**: The workflow has already resolved the selected root, confirmed an empty `<template_workspace>/templates/`, and checked collision-free destination filenames in `images/`, `icons/`, and `templates/icons/`. Check `exports/` only when an on-demand review PPTX was requested. Optional directories may be absent until their first real file is written. Project scope additionally requires an initialized target project. Do not begin final writes before that all-at-once preflight passes.+**Workspace precondition**: The workflow has already resolved the selected root, confirmed an empty `<template_workspace>/templates/`, and checked collision-free destination filenames in `images/` and `icons/imported/`. Check `exports/` only when an on-demand review PPTX was requested. Optional directories may be absent until their first real file is written. Project scope additionally requires an initialized target project. Do not begin final writes before that all-at-once preflight passes.When the workflow provides a PPTX reference source, the effective input package comes from the unified `pptx_template_import.py` preparation workspace and becomes:@@ -437,12 +437,12 @@ Standard mode (default):│ ├── 02_toc.svg # Optional; without it: 02_chapter, 03_content, 04_ending│ ├── 03_chapter.svg│ ├── 04_content.svg-│ ├── 05_ending.svg-│ └── icons/ # Package/validation copy, when used+│ └── 05_ending.svg├── images/ # Optional; omit when unused│ └── *.png / *.jpg # SVG href is ../images/<name>├── icons/ # Optional; omit when unused-│ └── *.svg # Runtime copy, when used+│ └── imported/+│ └── *.svg # Canonical imported vectors, when used└── exports/ # Optional; created only for on-demand review└── <template_id>_template_preview.pptx```@@ -481,7 +481,7 @@ Mirror mode emits one SVG per source slide, named by source order:Filenames preserve the source slide order via the 3-digit prefix; `<page_type>` is derived from `manifest.json` `pageTypeCandidates`. Literal source text and the source native structure are restored; the lightweight projection is not copied into the output.-**Hard rule — common routing**: Keep `design_spec.md`, template SVGs, and non-bitmap template-source assets in `templates/`; place every bitmap in `images/`; duplicate each extracted icon into `templates/icons/` and runtime `icons/`. Write a review deck to `exports/` only when explicitly requested. Create optional directories only when they contain real files; never add placeholders for empty directories. Do not branch asset placement by output scope.+**Hard rule — common routing**: Keep `design_spec.md`, template SVGs, and non-bitmap template-source assets in `templates/`; place every bitmap in `images/`; place each imported vector exactly once in `icons/imported/` and reference it as `data-icon="imported/<name>"`. Never create `templates/icons/`. Write a review deck to `exports/` only when explicitly requested. Create optional directories only when they contain real files; never add placeholders for empty directories. Do not branch asset placement by output scope.### Template Preview@@ -539,6 +539,6 @@ templates/- [x] Every SVG is a complete preview with explicit root Master/Layout identity and `native_structure_mode: structured`; authored modes use canonical fixed layers/slots, while mirror preserves source ownership and mechanically expands fixed-layer groups into direct atoms- [x] Authored `standard` / `fidelity` Layout keys are non-duplicative; mirror keeps distinct source Layout identities even when their current visible contracts are equivalent- [x] Model context used lightweight projections; lossless expanded imports remained authoritative for mirror restoration, while `standard` / `fidelity` used helper-generated compact canonical preset groups and `design_spec.md` paint-- [x] Both scopes route bitmaps to `images/` and copy extracted icons to both `templates/icons/` and runtime `icons/`+- [x] Both scopes route bitmaps to `images/` and keep one canonical copy of every imported vector under `icons/imported/`- [ ] **Next step**: Validate assets, optionally export a review PPTX, then register only library scope```diff --git a/skills/ppt-master/scripts/README.md b/skills/ppt-master/scripts/README.mdindex d277cdf5..a64cd4b4 100644--- a/skills/ppt-master/scripts/README.md+++ b/skills/ppt-master/scripts/README.md@@ -149,8 +149,8 @@ for selection and authoring guidance.Create-template/source normalization (optional; never part of automatic export):```bash-python3 scripts/extract_svg_assets.py <layered_svg_dir> --icons-dir <icons_dir> --inplace --id-prefix layered-python3 scripts/extract_svg_assets.py <flat_svg_dir> --icons-dir <icons_dir> --reuse-inventory <layered_inventory.json> --inplace --id-prefix flat+python3 scripts/extract_svg_assets.py <layered_svg_dir> --icons-dir <icons_dir> --icon-namespace imported --inplace --id-prefix layered+python3 scripts/extract_svg_assets.py <flat_svg_dir> --icons-dir <icons_dir> --icon-namespace imported --reuse-inventory <layered_inventory.json> --inplace --id-prefix flatpython3 scripts/extract_svg_pictures.py "<svg_file>" --select "<group_id>" --resource-root "<workspace>" --images-dir "<picture_assets_dir>" --inplace # optional create-template normalization: one selected group -> one SVG picture```@@ -158,7 +158,10 @@ python3 scripts/extract_svg_pictures.py "<svg_file>" --select "<group_id>" --resnamespacing. Process the layered authoring view first, then pass its inventory tothe flat view with `--reuse-inventory`; matching flat subtrees reference theexisting layered asset instead of creating a duplicate file. Only unmatched-flat-only vectors create new assets.+flat-only vectors create new assets. Create-template stores these assets once in+`<workspace>/icons/imported/` and writes `data-icon="imported/<name>"` references.+Rerunning a namespaced pass against an already rewritten projection inventories+the existing references without progressively wrapping more parent geometry.Post-processing and export:diff --git a/skills/ppt-master/scripts/docs/svg-pipeline.md b/skills/ppt-master/scripts/docs/svg-pipeline.mdindex 2cded6a8..6bb88fe3 100644--- a/skills/ppt-master/scripts/docs/svg-pipeline.md+++ b/skills/ppt-master/scripts/docs/svg-pipeline.md@@ -55,9 +55,11 @@ replace them with compact `<use data-icon>` references:```bashpython3 scripts/extract_svg_assets.py <layered_svg_dir> \- --icons-dir <icons_dir> --inplace --id-prefix layered+ --icons-dir <icons_dir> --icon-namespace imported \+ --inplace --id-prefix layeredpython3 scripts/extract_svg_assets.py <flat_svg_dir> \- --icons-dir <icons_dir> --reuse-inventory <layered_inventory.json> \+ --icons-dir <icons_dir> --icon-namespace imported \+ --reuse-inventory <layered_inventory.json> \--inplace --id-prefix flat```@@ -65,7 +67,11 @@ The first pass records a source fingerprint before namespacing each extractedasset's internal ids. The second pass reuses a fingerprint-matched asset andwrites no duplicate SVG file. Unmatched flat-only subtrees still extractnormally. Use `--clean-stale` on both import-workspace passes to remove stale-generated files for their respective prefixes.+generated files for their respective prefixes. In create-template workspaces,+`imported` is the fixed namespace: assets live once under `icons/imported/`, and+the working SVGs reference them as `data-icon="imported/<name>"`. A rerun on an+already rewritten namespaced projection inventories those references and does+not progressively extract their remaining parent or sibling geometry.## `extract_svg_pictures.py`diff --git a/skills/ppt-master/scripts/extract_svg_assets.py b/skills/ppt-master/scripts/extract_svg_assets.pyindex d2fff9da..35a36125 100644--- a/skills/ppt-master/scripts/extract_svg_assets.py+++ b/skills/ppt-master/scripts/extract_svg_assets.py@@ -3,7 +3,7 @@PPT Master - Large Vector Asset ExtractorFactor large inline vector groups (complex illustrations) out of working SVGs-into project icon assets, leaving a one-line `<use data-icon="id"/>`+into project icon assets, leaving a one-line `<use data-icon="namespace/id"/>`placeholder behind — so the working SVG stays readable (structure, not a wall of`<path>`). Visually lossless and reversible: the existing icon embedding pathre-inlines each asset before export, so the exported PPTX remains native shapes,@@ -18,9 +18,10 @@ Usage:Examples:python3 scripts/extract_svg_assets.py import_ws/svg \- --icons-dir import_ws/icons --inplace --id-prefix layered --clean-stale+ --icons-dir import_ws/icons --icon-namespace imported \+ --inplace --id-prefix layered --clean-stalepython3 scripts/extract_svg_assets.py import_ws/svg-flat \- --icons-dir import_ws/icons \+ --icons-dir import_ws/icons --icon-namespace imported \--reuse-inventory import_ws/svg_vector_asset_inventory.json \--inplace --id-prefix flat --clean-stalepython3 scripts/extract_svg_assets.py project/svg_output --inplace --min-drawables 40@@ -53,6 +54,7 @@ SEMANTIC_CONTENT = {"text", "tspan", "foreignObject"}DEFAULT_MIN_DRAWABLES = 20DEFAULT_MIN_BYTES = 3000DEFAULT_MIN_DECORATION_BYTES = 3000+ICON_NAMESPACE_RE = re.compile(r"^[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?$")URL_REF_RE = re.compile(r"url\(\s*(['\"]?)#([^)'\"]\S*?)\1\s*\)")@@ -81,9 +83,13 @@ def _is_existing_placeholder(elem: ET.Element) -> bool:return _local(elem.tag) == "use" and elem.get("data-icon") is not None+def _has_icon_placeholder(elem: ET.Element) -> bool:+ return any(_is_existing_placeholder(item) for item in elem.iter())++def _is_extractable_subtree(elem: ET.Element) -> bool:"""Pure vector subtrees can be moved; semantic content must stay inline."""- if _is_existing_placeholder(elem) or _is_chart_group(elem) or _has_semantic_content(elem):+ if _has_icon_placeholder(elem) or _is_chart_group(elem) or _has_semantic_content(elem):return Falsereturn _drawable_count(elem) > 0@@ -195,7 +201,7 @@ def _find_extractable(root: ET.Element, min_drawables: int, min_bytes: int) -> lif (not _is_chart_group(child)and not _has_semantic_content(child)- and child.get("data-icon") is None+ and not _has_icon_placeholder(child)and _large_enough(child, min_drawables, min_bytes)):found.append(child) # outermost qualifying — do not descend@@ -298,6 +304,40 @@ def _asset_id(svg_path: Path, index: int, id_prefix: str) -> str:return f"{prefix}{svg_path.stem}_ill{index:02d}"+def _icon_reference(icon_namespace: str, asset_id: str) -> str:+ return f"{icon_namespace}/{asset_id}" if icon_namespace else asset_id+++def _asset_relative_path(icon_namespace: str, asset_id: str) -> str:+ return f"{_icon_reference(icon_namespace, asset_id)}.svg"+++def _icon_asset_for_namespace(icon_name: str, icon_namespace: str) -> str | None:+ """Map one local placeholder to its asset path, excluding other libraries."""+ if icon_namespace:+ prefix = f"{icon_namespace}/"+ if not icon_name.startswith(prefix):+ return None+ asset_id = icon_name[len(prefix):]+ if not asset_id or "/" in asset_id:+ return None+ return f"{icon_name}.svg"+ if "/" in icon_name:+ return None+ return f"{icon_name}.svg"+++def _has_namespace_placeholder(root: ET.Element, icon_namespace: str) -> bool:+ if not icon_namespace:+ return False+ return any(+ _local(elem.tag) == "use"+ and (icon_name := elem.get("data-icon")) is not None+ and _icon_asset_for_namespace(icon_name, icon_namespace) is not None+ for elem in root.iter()+ )++def _generated_asset_re(svg_stems: list[str], id_prefix: str) -> re.Pattern[str] | None:if not svg_stems:return None@@ -306,21 +346,29 @@ def _generated_asset_re(svg_stems: list[str], id_prefix: str) -> re.Pattern[str]return re.compile(rf"^{prefix}(?:{stems})_ill\d+\.svg$")-def _clean_stale_assets(icons_dir: Path, svg_paths: list[Path], id_prefix: str, keep_assets: set[str]) -> list[str]:+def _clean_stale_assets(+ icons_dir: Path,+ icon_namespace: str,+ svg_paths: list[Path],+ id_prefix: str,+ keep_assets: set[str],+) -> list[str]:pattern = _generated_asset_re([path.stem for path in svg_paths], id_prefix)if pattern is None:return []removed: list[str] = []- for asset_path in sorted(icons_dir.glob("*.svg")):- if asset_path.name in keep_assets or not pattern.match(asset_path.name):+ asset_dir = icons_dir / icon_namespace if icon_namespace else icons_dir+ for asset_path in sorted(asset_dir.glob("*.svg")):+ relative_asset = asset_path.relative_to(icons_dir).as_posix()+ if relative_asset in keep_assets or not pattern.match(asset_path.name):continueasset_path.unlink()- removed.append(asset_path.name)+ removed.append(relative_asset)return removed-def _referenced_icon_assets(svg_paths: list[Path]) -> set[str]:+def _referenced_icon_assets(svg_paths: list[Path], icon_namespace: str) -> set[str]:assets: set[str] = set()for svg_path in svg_paths:try:@@ -331,14 +379,15 @@ def _referenced_icon_assets(svg_paths: list[Path]) -> set[str]:if _local(elem.tag) != "use":continueicon_name = elem.get("data-icon")- if icon_name and "/" not in icon_name:- assets.add(f"{icon_name}.svg")+ if icon_name and (asset := _icon_asset_for_namespace(icon_name, icon_namespace)):+ assets.add(asset)return assetsdef _existing_placeholder_entries(svg_paths: list[Path],icons_dir: Path,+ icon_namespace: str,known_assets: set[str],) -> list[dict]:by_asset: dict[str, dict] = {}@@ -352,10 +401,12 @@ def _existing_placeholder_entries(if _local(elem.tag) != "use":continueicon_name = elem.get("data-icon")- if not icon_name or "/" in icon_name:+ if not icon_name:continue- asset = f"{icon_name}.svg"+ asset = _icon_asset_for_namespace(icon_name, icon_namespace)+ if asset is None:+ continueif asset in known_assets:continue@@ -459,6 +510,7 @@ def _rewritten_path(svg_path: Path, rewritten_dir: Path | None, inplace: bool) -def extract_file(svg_path: Path,icons_dir: Path,+ icon_namespace: str,min_drawables: int,min_bytes: int,min_decoration_bytes: int,@@ -475,6 +527,16 @@ def extract_file(width = root.get("width")height = root.get("height")+ # A namespaced projection is an all-at-once readability pass. Once it owns+ # an asset reference, reruns inventory the existing placeholders instead of+ # progressively factoring their remaining parent/sibling geometry.+ if _has_namespace_placeholder(root, icon_namespace):+ if not inplace:+ rewritten = _rewritten_path(svg_path, rewritten_dir, inplace)+ rewritten.parent.mkdir(parents=True, exist_ok=True)+ tree.write(rewritten, encoding="utf-8", xml_declaration=True)+ return []+targets: list[tuple[ET.Element, list[ET.Element]]] = []parents = {child: parent for parent in root.iter() for child in parent}group_targets = _find_extractable(root, min_drawables, min_bytes)@@ -509,13 +571,16 @@ def extract_file(tree.write(rewritten, encoding="utf-8", xml_declaration=True)return []- icons_dir.mkdir(parents=True, exist_ok=True)+ asset_dir = icons_dir / icon_namespace if icon_namespace else icons_dir+ asset_dir.mkdir(parents=True, exist_ok=True)entries = []for index, (parent, nodes) in enumerate(targets, start=1):if not nodes or not all(node in parent for node in nodes):continueasset_id = _asset_id(svg_path, index, id_prefix)+ icon_reference = _icon_reference(icon_namespace, asset_id)+ asset = _asset_relative_path(icon_namespace, asset_id)pos = list(parent).index(nodes[0])group = nodes[0] if len(nodes) == 1 and _local(nodes[0].tag) == "g" else _asset_group(nodes)@@ -560,10 +625,10 @@ def extract_file(# Asset keeps the group in original page coordinates and carries its defs.asset_bytes = _asset_svg(group, dependencies, view_box, width, height)- (icons_dir / f"{asset_id}.svg").write_bytes(asset_bytes)+ (icons_dir / asset).write_bytes(asset_bytes)placeholder = ET.Element(f"{{{SVG_NS}}}use")- placeholder.set("data-icon", asset_id)+ placeholder.set("data-icon", icon_reference)for node in nodes:if node in parent:parent.remove(node)@@ -571,9 +636,9 @@ def extract_file(entries.append({"svg": svg_path.name,- "id": asset_id,- "icon": asset_id,- "asset": f"{asset_id}.svg",+ "id": icon_reference,+ "icon": icon_reference,+ "asset": asset,"source": "extracted","source_sha256": source_sha256,"asset_sha256": hashlib.sha256(asset_bytes).hexdigest(),@@ -597,6 +662,14 @@ def build_parser() -> argparse.ArgumentParser:parser.add_argument("svg_dir", help="Directory of working SVGs (e.g. import_ws/svg or project/svg_output)")parser.add_argument("-o", "--output", dest="icons_dir", help="Project icon dir (default: <svg_dir>/../icons)")parser.add_argument("--icons-dir", dest="icons_dir", help="Project icon dir (default: <svg_dir>/../icons)")+ parser.add_argument(+ "--icon-namespace",+ default="",+ help=(+ "Optional lower-case subdirectory and data-icon prefix for extracted "+ "assets (create-template uses: imported)"+ ),+ )parser.add_argument("--rewritten-dir",help="Directory for rewritten SVGs when not using --inplace (default: <svg_dir>/../<svg_dir-name>-rewritten)",@@ -659,6 +732,14 @@ def main(argv: Optional[list[str]] = None) -> int:icons_dir = Path(args.icons_dir) if args.icons_dir else svg_dir.parent / "icons"icons_dir.mkdir(parents=True, exist_ok=True)+ icon_namespace = args.icon_namespace.strip()+ if icon_namespace and not ICON_NAMESPACE_RE.fullmatch(icon_namespace):+ print(+ "[ERROR] --icon-namespace must be one lower-case ASCII directory name "+ "using only letters, digits, '_' or '-'",+ file=sys.stderr,+ )+ return 1reusable_assets: dict[str, dict] = {}reuse_inventory_path = Path(args.reuse_inventory) if args.reuse_inventory else Noneif reuse_inventory_path is not None:@@ -682,6 +763,7 @@ def main(argv: Optional[list[str]] = None) -> int:extract_file(svg_path,icons_dir,+ icon_namespace,args.min_drawables,args.min_bytes,args.min_decoration_bytes,@@ -697,14 +779,22 @@ def main(argv: Optional[list[str]] = None) -> int:extracted_count = sum(entry.get("source") == "extracted" for entry in inventory)reused_count = sum(entry.get("source") == "reused-inventory" for entry in inventory)known_assets = {str(entry["asset"]) for entry in inventory}- inventory.extend(_existing_placeholder_entries(svg_paths, icons_dir, known_assets))+ inventory.extend(+ _existing_placeholder_entries(+ svg_paths,+ icons_dir,+ icon_namespace,+ known_assets,+ )+ )stale_removed: list[str] = []if args.clean_stale:keep_assets = {str(entry["asset"]) for entry in inventory}- keep_assets.update(_referenced_icon_assets(svg_paths))+ keep_assets.update(_referenced_icon_assets(svg_paths, icon_namespace))stale_removed = _clean_stale_assets(icons_dir,+ icon_namespace,svg_paths,args.id_prefix,keep_assets,@@ -714,6 +804,7 @@ def main(argv: Optional[list[str]] = None) -> int:"schema": "vector_asset_inventory.v1","svg_dir": str(svg_dir),"icons_dir": str(icons_dir),+ "icon_namespace": icon_namespace or None,"rewritten_dir": (Noneif args.inplace@@ -733,7 +824,8 @@ def main(argv: Optional[list[str]] = None) -> int:inventory_path.write_text(json.dumps(manifest, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")print(f"[OK] extracted {extracted_count} new asset(s), reused {reused_count} asset(s), "- f"inventoried {len(inventory)} asset reference(s) -> {icons_dir}",+ f"inventoried {len(inventory)} asset reference(s) -> "+ f"{icons_dir / icon_namespace if icon_namespace else icons_dir}",file=sys.stderr,)if stale_removed:diff --git a/skills/ppt-master/scripts/resource_paths.py b/skills/ppt-master/scripts/resource_paths.pyindex 3f671c0e..52061ddd 100644--- a/skills/ppt-master/scripts/resource_paths.py+++ b/skills/ppt-master/scripts/resource_paths.py@@ -22,6 +22,8 @@ from urllib.parse import unquote, urlsplitSVG_WORK_DIR_NAMES = frozenset({'svg_output', 'svg_final', 'svg-flat', 'svg_flat'})+TEMPLATE_SOURCE_DIR_NAME = 'templates'+TEMPLATE_SPEC_FILENAME = 'design_spec.md'def project_root_for_svg_path(svg_path: Path) -> Path:@@ -30,6 +32,11 @@ def project_root_for_svg_path(svg_path: Path) -> Path:base = path if path.is_dir() else path.parentif base.name in SVG_WORK_DIR_NAMES:return base.parent+ if (+ base.name == TEMPLATE_SOURCE_DIR_NAME+ and (base / TEMPLATE_SPEC_FILENAME).is_file()+ ):+ return base.parentreturn basediff --git a/skills/ppt-master/scripts/svg_finalize/embed_icons.py b/skills/ppt-master/scripts/svg_finalize/embed_icons.pyindex f747840b..0b4638dd 100644--- a/skills/ppt-master/scripts/svg_finalize/embed_icons.py+++ b/skills/ppt-master/scripts/svg_finalize/embed_icons.py@@ -9,7 +9,7 @@ Placeholder syntax (new SVGs must include a library prefix):<use data-icon="tabler-filled/home" x="100" y="200" width="48" height="48" fill="#0076A8"/><use data-icon="tabler-outline/home" x="100" y="200" width="48" height="48" fill="#0076A8"/><use data-icon="tabler-outline/home" x="100" y="200" width="48" height="48" fill="#0076A8" stroke-width="3"/>- <use data-icon="layered_slide_06_ill01"/>+ <use data-icon="imported/layered_slide_06_ill01"/>Legacy compatibility accepted by the resolver:<use data-icon="rocket" .../> -> chunk-filled/rocket@@ -30,7 +30,7 @@ Icon libraries (subdirectories of templates/icons/):tabler-outline/ - 5000+ stroke icons, 24x24 viewBox (use prefix: tabler-outline/name)phosphor-duotone/ - 1200+ duotone icons, 256x256 viewBox (single color + 0.2-opacity backplate)simple-icons/ - 3400+ brand logos, 24x24 viewBox (brand-inset library — used alongside the chosen primary library, NOT as a standalone library for generic icons)- <asset_id>.svg - project-local extracted vector illustrations with data-icon-style="preserve-color"; preserve source colors and natural viewBox aspect ratio+ imported/ - project-local extracted vector illustrations with data-icon-style="preserve-color"; preserve source colors and natural viewBox aspect ratioUsage:python3 scripts/svg_finalize/embed_icons.py <svg_file> [svg_file2] ...diff --git a/skills/ppt-master/templates/README.md b/skills/ppt-master/templates/README.mdindex e6f91d9f..40fd315a 100644--- a/skills/ppt-master/templates/README.md+++ b/skills/ppt-master/templates/README.md@@ -21,7 +21,7 @@ The `layouts/` directory contains pre-built page layout templates organized by d- **Human browsing**: [layouts/README.md](./layouts/README.md)- **Slim lookup (discovery only)**: [layouts/layouts_index.json](./layouts/layouts_index.json) — used to answer "what templates exist?". Step 3 triggers on an explicit directory path supplied by the user, not on names from this index.-Every brand/layout/deck package uses one workspace routing contract. Whether created under this library or under `projects/`, source files live in `templates/`, bitmaps in `images/`, runtime icons in `icons/`, and on-demand review files in `exports/`. Empty optional directories are omitted, so a normal checked-in workspace has no `exports/`. Library `exports/` directories are Git-ignored, and Step 3 never copies them. Existing flat packages remain readable; flat placement alone does not imply legacy Master/Layout metadata.+Every brand/layout/deck package uses one workspace routing contract. Whether created under this library or under `projects/`, source files live in `templates/`, bitmaps in `images/`, imported vectors live once in `icons/imported/`, and on-demand review files live in `exports/`. Other icon-library namespaces remain under `icons/` only when explicitly adopted. Empty optional directories are omitted, so a normal checked-in workspace has no `exports/`. Library `exports/` directories are Git-ignored, and Step 3 never copies them. Existing flat packages remain readable; flat placement alone does not imply legacy Master/Layout metadata.## Brand Identity Presetsdiff --git a/skills/ppt-master/templates/decks/README.md b/skills/ppt-master/templates/decks/README.mdindex 076f90a0..f44fb20c 100644--- a/skills/ppt-master/templates/decks/README.md+++ b/skills/ppt-master/templates/decks/README.md@@ -69,6 +69,7 @@ New deck creation uses the same portable workspace routing in both output scopes│ └── 05_ending.svg├── images/ # Optional; omit when unused├── icons/ # Optional; omit when unused+│ └── imported/ # Canonical imported vectors└── exports/ # Optional, on-demand review output; Git-ignored└── <deck_id>_template_preview.pptx```@@ -78,7 +79,7 @@ New deck creation uses the same portable workspace routing in both output scopes| Library | `skills/ppt-master/templates/decks/<deck_id>/` | Register in `decks_index.json` || Project | `projects/<project_name>/` | Do not register globally |-Bitmaps belong in `images/`; extracted runtime icons belong in `icons/`; template sources and any validation icon copy belong in `templates/`. Omit empty optional directories instead of adding placeholder files. Generate a preview PPTX only when local PowerPoint review is requested; it is derived output, library `exports/` is Git-ignored, and template application never copies it.+Bitmaps belong in `images/`; imported vectors have one canonical copy in `icons/imported/` and use `data-icon="imported/<name>"`; template sources belong in `templates/`, which never contains an icon duplicate. Omit empty optional directories instead of adding placeholder files. Generate a preview PPTX only when local PowerPoint review is requested; it is derived output, library `exports/` is Git-ignored, and template application never copies it.`standard` and `fidelity` author new SVG documents and a new Master/Layout/slot contract. `mirror` restores the source roster, Master/Layout identities and parentage, placeholder facts, and supported visuals without semantic synthesis. Fixed Master/Layout group wrappers are mechanically expanded into direct atoms because structural layers cannot be `<g>`; this normalization must preserve ownership, paint order, and appearance.diff --git a/skills/ppt-master/templates/icons/README.md b/skills/ppt-master/templates/icons/README.mdindex e61e524d..436c5afe 100644--- a/skills/ppt-master/templates/icons/README.md+++ b/skills/ppt-master/templates/icons/README.md@@ -26,6 +26,12 @@ A name the library does not have is reported and the command exits non-zero —**Custom icons**: drop your own `.svg` into `<project>/icons/<lib>/` (any `<lib>`, e.g. `custom/`) and reference it as `data-icon="<lib>/<name>"` — it embeds like any library icon.+**Imported vectors**: `create-template` reserves the project-local `imported/`+namespace. Each extracted vector lives once at+`<workspace>/icons/imported/<name>.svg` and is referenced as+`data-icon="imported/<name>"`; do not duplicate it under `templates/` or use+`imported/` as a hand-curated style library.+## UsageUse placeholder syntax **during SVG generation**:diff --git a/skills/ppt-master/templates/layouts/README.md b/skills/ppt-master/templates/layouts/README.mdindex d490dde6..e86335ae 100644--- a/skills/ppt-master/templates/layouts/README.md+++ b/skills/ppt-master/templates/layouts/README.md@@ -57,6 +57,7 @@ New layout creation uses the same portable workspace routing in both output scop│ └── 04_ending.svg├── images/ # Optional; omit when unused├── icons/ # Optional; omit when unused+│ └── imported/ # Canonical imported vectors└── exports/ # Optional, on-demand review output; Git-ignored└── <layout_id>_template_preview.pptx```@@ -66,7 +67,7 @@ New layout creation uses the same portable workspace routing in both output scop| Library | `skills/ppt-master/templates/layouts/<layout_id>/` | Register in `layouts_index.json` || Project | `projects/<project_name>/` | Do not register globally |-`02_toc.svg` and other roster variants remain optional; including the TOC shifts the later types to `03_chapter.svg` / `04_content.svg` / `05_ending.svg`, keeping numbering equal to the template's own presentation order. All SVGs use `viewBox="0 0 1280 720"` for ppt169. Bitmaps belong in `images/`; extracted runtime icons belong in `icons/`; template sources and any validation icon copy belong in `templates/`.+`02_toc.svg` and other roster variants remain optional; including the TOC shifts the later types to `03_chapter.svg` / `04_content.svg` / `05_ending.svg`, keeping numbering equal to the template's own presentation order. All SVGs use `viewBox="0 0 1280 720"` for ppt169. Bitmaps belong in `images/`; imported vectors have one canonical copy in `icons/imported/` and use `data-icon="imported/<name>"`; template sources belong in `templates/`, which never contains an icon duplicate.Omit empty optional directories instead of adding placeholder files. Generate a preview PPTX only when local PowerPoint review is requested; it is derived output, library `exports/` is Git-ignored, and template application never copies it.diff --git a/skills/ppt-master/workflows/beautify-pptx.md b/skills/ppt-master/workflows/beautify-pptx.mdindex e5abb8f8..0b504db4 100644--- a/skills/ppt-master/workflows/beautify-pptx.md+++ b/skills/ppt-master/workflows/beautify-pptx.md@@ -98,14 +98,15 @@ python3 ${SKILL_DIR}/scripts/pptx_intake.py <project_path>/sources/<source.pptx>python3 ${SKILL_DIR}/scripts/pptx_to_svg.py <project_path>/sources/<source.pptx> -o <project_path>/analysis/source_svg_importpython3 ${SKILL_DIR}/scripts/extract_svg_assets.py <project_path>/analysis/source_svg_import/svg-flat \--icons-dir <project_path>/analysis/source_svg_import/icons \+ --icon-namespace imported \--inplace --id-prefix source_flat --min-decoration-bytes 3000 --clean-stale```-Use the cleaned `analysis/source_svg_import/svg-flat/slide_*.svg` files plus `analysis/source_svg_import/svg-flat_vector_asset_inventory.json` in Step 5/Strategist. Extraction is required for inspection when complex vectors exist: it creates a candidate pool the AI can index, compare, and judge for possible reuse without reading every heavy vector body. Read an individual `analysis/source_svg_import/icons/*.svg` only when the cleaned page and inventory indicate that candidate may be promoted or materially affects the style decision. These candidates are analysis artifacts first, not automatic output assets.+Use the cleaned `analysis/source_svg_import/svg-flat/slide_*.svg` files plus `analysis/source_svg_import/svg-flat_vector_asset_inventory.json` in Step 5/Strategist. Extraction is required for inspection when complex vectors exist: it creates a candidate pool the AI can index, compare, and judge for possible reuse without reading every heavy vector body. Read an individual `analysis/source_svg_import/icons/imported/*.svg` only when the cleaned page and inventory indicate that candidate may be promoted or materially affects the style decision. These candidates are analysis artifacts first, not automatic output assets.Default: do **not** copy these candidates into the project `icons/`, do **not** list them as reusable output assets, and do **not** preserve original vector decorations byte-for-byte in the beautified deck. The Executor still regenerates fresh native shapes from the confirmed plan.-Optional reuse gate: if a candidate is a non-text brand/logo/motif/decorative asset that should survive the beautification, list it in the Step 5 plan with source slide, candidate filename, intended reuse, and dependency notes from the inventory. Wait for user confirmation. Only confirmed candidates may be promoted into `<project_path>/icons/` and referenced from generated SVGs with `<use data-icon="..."/>`; `finalize_svg.py` then re-inlines them as native shapes. Never promote text-bearing groups, charts/tables, source page layouts, or dense slide composites as reusable assets.+Optional reuse gate: if a candidate is a non-text brand/logo/motif/decorative asset that should survive the beautification, list it in the Step 5 plan with source slide, candidate filename, intended reuse, and dependency notes from the inventory. Wait for user confirmation. Only confirmed candidates may be promoted into `<project_path>/icons/imported/` and referenced from generated SVGs with `<use data-icon="imported/<name>"/>`; `finalize_svg.py` then re-inlines them as native shapes. Never promote text-bearing groups, charts/tables, source page layouts, or dense slide composites as reusable assets.**Assemble the inventory** — the deterministic join into one per-slide ledger, `analysis/beautify_inventory.json`, the contract Step 5 confirms and Step 7 verifies against:diff --git a/skills/ppt-master/workflows/create-template.md b/skills/ppt-master/workflows/create-template.mdindex c64ad3f0..1b08f88e 100644--- a/skills/ppt-master/workflows/create-template.md+++ b/skills/ppt-master/workflows/create-template.md@@ -42,9 +42,10 @@ Both scopes write this contract:```text<template_workspace>/-├── templates/ # design_spec.md, template SVGs, templates/icons/ when used+├── templates/ # design_spec.md and template SVGs├── images/ # optional; every bitmap; SVG href is ../images/<name>-├── icons/ # optional; runtime copy of extracted vector assets+├── icons/+│ └── imported/ # optional; one canonical copy of imported vector assets└── exports/ # conditional; required package evidence for multi-Master templates```@@ -54,7 +55,7 @@ For `project`, `target_project` is required and must be an existing project init1. Resolve `<template_workspace>` from the confirmed scope and confirm its required `templates/` destination plus any needed `images/` / `icons/` destinations.2. Confirm `<template_workspace>/templates/` is empty.-3. Resolve every final bitmap and extracted-icon filename, then confirm none would overwrite an existing file in `images/`, `icons/`, or `templates/icons/`. Check the review-PPTX destination when preview export was requested or a multi-Master template was confirmed.+3. Resolve every final bitmap and extracted-vector filename, then confirm none would overwrite an existing file in `images/` or `icons/imported/`. Check the review-PPTX destination when preview export was requested or a multi-Master template was confirmed.Any failed check aborts before writing `design_spec.md`, SVGs, images, icons, or the review PPTX. Do not merge into a non-empty template source and do not overwrite a name conflict. Temporary Step 1 analysis workspaces remain allowed because they are not final outputs.@@ -143,13 +144,13 @@ Factor large decorative vector groups out of the lightweight projections so the```bash# layered view — primary read surface and canonical extracted-vector inventory-python3 skills/ppt-master/scripts/extract_svg_assets.py "<import_workspace>/authoring-svg" --icons-dir "<import_workspace>/icons" --inplace --id-prefix layered --min-decoration-bytes 3000 --clean-stale+python3 skills/ppt-master/scripts/extract_svg_assets.py "<import_workspace>/authoring-svg" --icons-dir "<import_workspace>/icons" --icon-namespace imported --inplace --id-prefix layered --min-decoration-bytes 3000 --clean-stale# flat view — reuse matching layered assets; only genuinely flat-only vectors create new assets-python3 skills/ppt-master/scripts/extract_svg_assets.py "<import_workspace>/authoring-svg-flat" --icons-dir "<import_workspace>/icons" --reuse-inventory "<import_workspace>/authoring-svg_vector_asset_inventory.json" --inplace --id-prefix flat --min-decoration-bytes 3000 --clean-stale+python3 skills/ppt-master/scripts/extract_svg_assets.py "<import_workspace>/authoring-svg-flat" --icons-dir "<import_workspace>/icons" --icon-namespace imported --reuse-inventory "<import_workspace>/authoring-svg_vector_asset_inventory.json" --inplace --id-prefix flat --min-decoration-bytes 3000 --clean-stale```-The projected SVGs in `<import_workspace>/authoring-svg/` / `<import_workspace>/authoring-svg-flat/` are rewritten in place with compact `<use data-icon="..."/>` placeholders. Extracted assets live directly under `<import_workspace>/icons/`; `icons/` must contain only icon/vector assets, not rewritten page SVGs or inventories. The inventory is written beside the processed projection directory. The existing icon embedding path re-inlines the extracted assets before final export, preserving multi-color artwork and non-square viewBox geometry as native SVG shapes. Text-bearing groups are never extracted; text must stay readable/editable in the working SVG. Extraction triggers on either many drawable elements or a large pure-vector XML block, so long single-path illustrations are factored out too. Pure-vector decoration runs inside text-bearing groups use a lower size threshold, allowing card borders and decorative paths to be extracted without hiding text. Referenced defs (`gradient` / `pattern` / `filter` / `clipPath` / `marker`) are copied into each asset and namespaced so the asset is self-contained after re-inline. If both layered and flat views are processed into the same icon directory, keep distinct `--id-prefix` values to avoid asset ID collisions. `--clean-stale` removes only stale generated assets for the current SVG filenames and prefix; it is safe in this import workspace but should not be used against a shared hand-curated icon directory without a specific prefix.+The projected SVGs in `<import_workspace>/authoring-svg/` / `<import_workspace>/authoring-svg-flat/` are rewritten in place with compact `<use data-icon="imported/..."/>` placeholders. Extracted assets have one canonical copy under `<import_workspace>/icons/imported/`; never duplicate them under `templates/icons/`. The root `icons/` directory remains a namespace container and must not contain rewritten page SVGs or inventories. The inventory is written beside the processed projection directory. The existing icon embedding path re-inlines the extracted assets before final export, preserving multi-color artwork and non-square viewBox geometry as native SVG shapes. Text-bearing groups are never extracted; text must stay readable/editable in the working SVG. Extraction triggers on either many drawable elements or a large pure-vector XML block, so long single-path illustrations are factored out too. Pure-vector decoration runs inside text-bearing groups use a lower size threshold, allowing card borders and decorative paths to be extracted without hiding text. Referenced defs (`gradient` / `pattern` / `filter` / `clipPath` / `marker`) are copied into each asset and namespaced so the asset is self-contained after re-inline. If both layered and flat views are processed into the same icon namespace, keep distinct `--id-prefix` values to avoid asset ID collisions. `--clean-stale` removes only stale generated assets for the current SVG filenames and prefix inside the selected namespace; it is safe in this import workspace but should not be used against a shared hand-curated icon directory without a specific prefix.The layered pass owns the canonical extracted-vector pool. Each new asset records a source fingerprint before generated ID namespacing. The flat pass MUST consume the layered inventory through `--reuse-inventory`: an exact fingerprint match writes only a `<use>` reference to the existing layered asset, while an unmatched flat-only subtree may create one new asset under the `flat` prefix. Do not independently extract the two views into parallel asset sets. With `--clean-stale`, a rerun also removes obsolete generated `flat_*` duplicates while retaining every reused layered reference.@@ -207,7 +208,7 @@ Interpretation rule (carries forward into Steps 2 and 4):- `native_structure.json` is the source of truth for source PowerPoint identity: stable layout keys, picker names, parent masters, placeholder types/indices, and the source-package hash. Mirror preserves those facts one-to-one. `standard` / `fidelity` do not mine them into the new structure.- `summary.md` is a quick scan; never treat it as the canonical fact source — go back to `manifest.json` if anything is unclear- exported `assets/` are the canonical reusable image pool — `<image>` references in `svg/` already point at these files directly-- exported `icons/*.svg` are the canonical reusable vector illustration pool, but they are **not** part of the default read set. Read the cleaned SVGs and `*_vector_asset_inventory.json` first; open a specific icon SVG only when the cleaned page or inventory shows that the extracted asset is relevant to the current design decision. This is what makes the SVG work surface smaller.+- exported `icons/imported/*.svg` files are the canonical reusable vector illustration pool, but they are **not** part of the default read set. Read the cleaned SVGs and `*_vector_asset_inventory.json` first; open a specific imported SVG only when the cleaned page or inventory shows that the extracted asset is relevant to the current design decision. This is what makes the SVG work surface smaller.- cleaned layered projections are mirror verification views; they expose source ownership without requiring the model to read opaque payload. Do not use them to promote, demote, merge, or split source structure.- cleaned complete-page projections are optional composition spot checks for authored modes and verification views for mirror. They are never the lossless restoration source.- screenshots remain useful for judging composition and style, but should not override extracted factual metadata unless the import result is clearly incomplete@@ -252,7 +253,7 @@ First resolve the Type B source directory using the rule above. Create a non-des```bashpython3 skills/ppt-master/scripts/svg_authoring_view.py "<normalized_svg_source>" -o "<svg_analysis_workspace>/authoring-svg"-python3 skills/ppt-master/scripts/extract_svg_assets.py "<svg_analysis_workspace>/authoring-svg" --icons-dir "<svg_analysis_workspace>/icons" --inplace --id-prefix source --min-decoration-bytes 3000 --clean-stale+python3 skills/ppt-master/scripts/extract_svg_assets.py "<svg_analysis_workspace>/authoring-svg" --icons-dir "<svg_analysis_workspace>/icons" --icon-namespace imported --inplace --id-prefix source --min-decoration-bytes 3000 --clean-stale```If the source contains one deliberately selected complex subtree that should@@ -270,7 +271,7 @@ Then `ls` the analysis workspace and `Read` every cleaned `authoring-svg/*.svg`- placeholder usage (existing `{{...}}` strings, if any)- structural decoration (recurring `<rect>` bars, `<path>` motifs, embedded `<image>` references)-Read the generated `*_vector_asset_inventory.json` before opening individual `<svg_analysis_workspace>/icons/*.svg`; do not bulk-read extracted icons unless a specific asset affects a design decision or is selected for mirror preservation.+Read the generated `*_vector_asset_inventory.json` before opening individual `<svg_analysis_workspace>/icons/imported/*.svg`; do not bulk-read extracted vectors unless a specific asset affects a design decision or is selected for mirror preservation.If a `design_spec.md` or `spec_lock.md` accompanies the SVGs, read it too. In mirror it is part of the source contract and must agree with the SVG identities; in `standard` / `fidelity` it is visual/contextual reference only. Record the equivalent of a `manifest.json`'s factual fields in analysis notes so Step 2 can label them `[fact]`.@@ -414,12 +415,12 @@ If the input source is type A, pass the following internal package to the role:- `native_structure.json` and `source_template.pptx`- `summary.md` (orientation only)- exported `assets/`-- `*_vector_asset_inventory.json`, when the vector readability pass extracted assets; do not bulk-read `icons/*.svg`+- `*_vector_asset_inventory.json`, when the vector readability pass extracted assets; do not bulk-read `icons/imported/*.svg`- lightweight references from `authoring-svg/` and `authoring-svg-flat/`- for `mirror` only, matching lossless `svg/`, `svg-flat/`, and `svg/inheritance.json` restoration sources- optional screenshots, if available-For type B, pass the cleaned SVG file list from the analysis workspace, `*_vector_asset_inventory.json` if extraction ran, any companion `design_spec.md` / `spec_lock.md`, and the analysis notes. Do not bulk-read extracted icons; open individual `icons/*.svg` only when needed.+For type B, pass the cleaned SVG file list from the analysis workspace, `*_vector_asset_inventory.json` if extraction ran, any companion `design_spec.md` / `spec_lock.md`, and the analysis notes. Do not bulk-read extracted vectors; open individual `icons/imported/*.svg` files only when needed.For type C, pass the image file list and the visual analysis notes.For type D, pass only the finalized brief.@@ -491,7 +492,7 @@ Downstream, both template-adherence choices use `pptx_structure.mode: structured- Type A: assets come from `<import_workspace>/assets/`- Type B: resolve relative paths in source `<image href="...">` against the source SVG location and copy each unique asset; if the source already follows PPT Master conventions (assets co-located with SVGs in the same directory), copy the whole asset set and then rewrite paths- Both scopes: write bitmaps to `<template_workspace>/images/`, point SVG references at `../images/<name>`, and keep non-bitmap template-source assets under `<template_workspace>/templates/`.-4. **Copies `icons/` when present** and preserves every adopted `<use data-icon="..."/>` reference. Both scopes write the package/validation copy to `<template_workspace>/templates/icons/` and an identical runtime copy to `<template_workspace>/icons/`. Do not inline these assets manually in the template working SVGs; the shared icon embedding path owns re-inlining before export.+4. **Copies imported vector assets once** to `<template_workspace>/icons/imported/` and rewrites their placeholders to `<use data-icon="imported/<name>"/>`. Never place a second copy under `templates/icons/`. Other explicitly adopted icon-library references keep their existing library namespace. Do not inline these assets manually in the template working SVGs; template validation, preview, and final export all resolve icons from the workspace-root `icons/` directory.5. Writes `design_spec.md` per [template-designer.md](../references/template-designer.md) §1. The §V Page Roster remains the content-fit index; explicit SVG metadata is the native Master/Layout contract. Mirror is only the template-creation replication mode; downstream generation still treats the finished package as a selectable / reusable roster, not as a forced 1:1 slide sequence.Mirror mode does not simplify the visual target or synthesize layer ownership. The sprite-sheet preservation rule applies because crop wrappers carry visible geometry; preserve those wrappers and their source scope faithfully.@@ -502,7 +503,7 @@ Mirror mode does not simplify the visual target or synthesize layer ownership. T2. Page roster — see [Page Roster](../references/template-designer.md#page-roster) for `standard` / `fidelity` / `mirror` mode rosters, variant naming, and TOC handling3. Placeholder vocabulary — pages should adopt the conventional names (`{{TITLE}}`, `{{CONTENT_AREA}}`, ...) when they fit. Full reference: [Placeholder Reference](../references/template-designer.md#4-placeholder-reference-canonical-convention-overridable-per-template). When a template style legitimately needs different vocabulary (consulting → `{{KEY_MESSAGE}}`, branded cover → `{{BRAND_LOGO}}`), declare a `placeholders:` block in `design_spec.md` frontmatter so the registrar and quality checker treat it as the template's authoritative contract. **Avoid** one-off indexed families such as `{{CHAPTER_01_TITLE}}` — use the indexed TOC pattern instead.- `{{...}}` placeholders are the authoring vocabulary used to generate final slide content. Each emitted SVG also carries the native reconstruction contract: root Master/Layout key/name, direct atomic Master/Layout elements, and direct slot `<g>` elements with explicit design-zone bounds plus exactly one compatible carrier. A validated compact canonical authored-preset `<g>` counts as one semantic atom or one `object` carrier; ordinary groups do not. Composite regions use only the explicit `object` + `proxy` downgrade. Minimal structural `data-pptx-role` hints are added only when specialized metadata cannot express required behavior. Both strict and adaptive downstream set `mode: structured` and require complete `page_layouts`, `page_pptx_layouts`, `pptx_masters`, and `pptx_layouts` from planning onward.-4. Template assets (optional) — both scopes apply the same `templates/` / `images/` / dual-icon routing defined above+4. Template assets (optional) — both scopes apply the same `templates/` / `images/` / root `icons/imported/` routing defined above**Hard rule — placeholder examples are executable defaults**: In authored`standard` / `fidelity` templates, a carrier is not a floating review label. It@@ -567,7 +568,7 @@ This checker validates the authoring contract, not the compiled OOXML package. T- [ ] Mirror preflight covered the complete source graph; each unused Layout has one `layout_<layout_key>.svg` definition prototype and each otherwise-unused Master is retained through at least one such Layout- [ ] For `standard` / `fidelity`, no duplicate-Layout-contract warning remains; mirror may keep equivalent source Layout identities when the restoration map explains them- [ ] Lightweight projections were used only for inspection. Mirror materialized from lossless sources, reused only converter-supported metadata on unchanged Slide-local/slot objects, and kept fixed Master/Layout visuals as direct atoms-- [ ] If any SVG references an extracted vector `data-icon`, the corresponding SVG asset exists under `<template_workspace>/templates/icons/` and the identical runtime copy exists under `<template_workspace>/icons/`; do not add a separate illustration embedding script+- [ ] If any SVG references an extracted vector, it uses `data-icon="imported/<name>"` and the sole SVG asset exists at `<template_workspace>/icons/imported/<name>.svg`; `templates/icons/` does not exist and no separate illustration embedding script was added- [ ] For `fidelity` mode: every sprite-sheet asset retains its nested `<svg viewBox=...>` crop wrapper; no image whose file aspect differs from its on-page aspect was flattened to a bare `<image>`- [ ] For `mirror` mode: source-page SVG count equals source page count, while additional files are exactly the required `layout_<layout_key>.svg` definitions for unused source Layouts; source-page filenames follow the `<NNN>_<page_type>.svg` convention; **no new `{{...}}` authoring placeholders were inserted into restored source-page SVGs**; §V Page Roster lists every emitted file and marks definition-only prototypes explicitly@@ -704,7 +705,7 @@ Produce one scope-aware, evidence-driven completion card for either location:**Workspace Path**: `<template_workspace>/`**Template Source**: `<template_workspace>/templates/`**Bitmap Path**: `<template_workspace>/images/` ← omit when absent-**Runtime Icon Path**: `<template_workspace>/icons/` ← omit when absent+**Imported Vector Path**: `<template_workspace>/icons/imported/` ← omit when absent**Review PPTX**: `<template_workspace>/exports/<template_id>_template_preview.pptx` ← omit only when a one-Master template was not requested for review**Primary Color**: <hex> ← deck only; omit for layout**Index Registration**: Done | Not registered (project workspace)