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
refactor(templates): restore images→images/ convention for applied templates
hugohe31d026b2189bd
diff --git a/docs/zh/templates-architecture.md b/docs/zh/templates-architecture.mdindex 6a00911f..6c0024ad 100644--- a/docs/zh/templates-architecture.md+++ b/docs/zh/templates-architecture.md@@ -262,10 +262,12 @@ AI: 你给了两个 brand,检测到段级冲突:| 用户路径指向 | Step 3 行为(按 kind 分支)||---|---|-| `kind: brand` | 复制 design_spec + logos + asset 子目录到 `<project>/templates/` |-| `kind: layout` | 复制 design_spec + SVG roster + assets 到 `<project>/templates/` |-| `kind: deck` | 复制 design_spec + SVG roster + logos + 全部 assets 到 `<project>/templates/` |-| 多路径 | 按上表合成单份 `design_spec.md` + 各源的 SVG/logo 合并复制 |+| `kind: brand` | design_spec + 非图片资产 → `<project>/templates/`;logo / 插画 / 图标**位图** → `<project>/images/` |+| `kind: layout` | design_spec + SVG roster → `<project>/templates/`;**位图**资产 → `<project>/images/` |+| `kind: deck` | design_spec + 模板 SVG → `<project>/templates/`;logo / 背景 / 其它**位图** → `<project>/images/` |+| 多路径 | 按上表合成单份 `design_spec.md`;SVG 进 `templates/`、位图进 `images/` 合并复制 |++> 位图统一进项目 `images/`(和 AI / 网络 / 用户图片同一个运行期图片池,SVG 里走 `../images/`);`templates/` 只放 spec 和模板 SVG 等供 Strategist/Executor 阅读、不被直接渲染的参考材料。| 同类多份 | 按上节"git 冲突解决"问答,得到合成结果 |### Strategist 八项确认在不同 kind 下的收窄diff --git a/skills/ppt-master/SKILL.md b/skills/ppt-master/SKILL.mdindex 3d48530b..c868f8a8 100644--- a/skills/ppt-master/SKILL.md+++ b/skills/ppt-master/SKILL.md@@ -197,16 +197,20 @@ The architecture has three independent reference bundles. Full schema in [`docs/| User path's `kind` | Step 3 action ||---|---|-| `kind: brand` | Copy `design_spec.md` + logo files + asset subdirs (`images/` / `illustrations/` / `icons/`) into `<project>/templates/`. Strategist locks identity segment as truth; structure stays free. |-| `kind: layout` | Copy `design_spec.md` + SVG roster + asset files into `<project>/templates/`. Strategist locks structure; identity decided in Eight Confirmations e–g. |-| `kind: deck` | Copy everything (`design_spec.md` + SVGs + logos + assets) into `<project>/templates/`. Strategist locks all segments; Eight Confirmations narrows to deck-content fields (audience / page count / outline / tone tweaks). |+| `kind: brand` | `design_spec.md` + non-image assets → `<project>/templates/`; logo / illustration / icon **bitmaps** → `<project>/images/`. Strategist locks identity segment as truth; structure stays free. |+| `kind: layout` | `design_spec.md` + SVG roster → `<project>/templates/`; any **bitmap** assets → `<project>/images/`. Strategist locks structure; identity decided in Eight Confirmations e–g. |+| `kind: deck` | `design_spec.md` + template SVGs → `<project>/templates/`; logos / backgrounds / other **bitmaps** → `<project>/images/`. Strategist locks all segments; Eight Confirmations narrows to deck-content fields (audience / page count / outline / tone tweaks). |```bashTEMPLATE_DIR=<user-supplied path>+# Bitmaps join the project's single runtime image pool (images/, referenced as+# ../images/); the spec + template SVGs + other non-image assets stay in+# templates/ as design reference the Strategist/Executor read but never render.cp -r ${TEMPLATE_DIR}/* <project_path>/templates/+find <project_path>/templates -type f \( -iname '*.png' -o -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.gif' -o -iname '*.webp' -o -iname '*.bmp' \) -exec mv {} <project_path>/images/ \;```-The single-line copy suffices for all three kinds — the spec's `kind` field tells Strategist how to read it; downstream code doesn't distinguish.+The same split applies to all three kinds — bitmaps always land in `images/`, the rest in `templates/`. The spec's `kind` field tells Strategist how to read the `templates/` side; downstream code doesn't distinguish. (Template SVGs in `templates/` are reference material only — the rendered pages live in `svg_output/` and reference images via `../images/`.)#### Multi-path fusiondiff --git a/skills/ppt-master/references/executor-base.md b/skills/ppt-master/references/executor-base.mdindex a7f9012b..c1d6e5ee 100644--- a/skills/ppt-master/references/executor-base.md+++ b/skills/ppt-master/references/executor-base.md@@ -323,6 +323,8 @@ Handle images by their status in the Design Spec's Image Resource List. Status e**Reference syntax**: see [`svg-image-embedding.md`](svg-image-embedding.md).+**Template-bundled images**: when a template (deck / layout / brand) is applied, its bitmaps are copied into the project's `images/` alongside every other runtime image (SKILL.md Step 3). Reference them the same way — `../images/<name>` — and do **not** reproduce a template SVG's bare sibling href (e.g. `href="cover_bg.png"`): the template SVG is reference material, the rendered page lives in `svg_output/` and must point at `../images/`. Mirror templates (§1.1) are the one exception — they copy hrefs verbatim, and the exporter resolves those bare hrefs against `images/`.+**Placeholder**: Dashed border `<rect stroke-dasharray="8,4" .../>` + description text**`no-crop` images**: when a `spec_lock.md images` entry ends with ` | no-crop`, size the container to the image's native ratio (from `analyze_images.py` or file dims) and use `preserveAspectRatio="xMidYMid meet"`. Untagged entries are croppable — default to `slice`.diff --git a/skills/ppt-master/references/template-designer.md b/skills/ppt-master/references/template-designer.mdindex 733af4df..d2c67222 100644--- a/skills/ppt-master/references/template-designer.md+++ b/skills/ppt-master/references/template-designer.md@@ -354,7 +354,7 @@ If the template is based on PPTX import output, briefly note:If suitable template resources already exist, use them directly instead of generating new ones:-1. **Copy template**: Copy template files to the project's `templates/` directory+1. **Copy template**: copy the spec + template SVGs into the project's `templates/`, and any bundled bitmaps into the project's `images/` (the runtime image pool, referenced as `../images/`)2. **Adjust colors**: Modify colors per the project design spec3. **Customize**: Make project-specific adjustmentsdiff --git a/skills/ppt-master/scripts/svg_editor/server.py b/skills/ppt-master/scripts/svg_editor/server.pyindex baac14b5..646faa25 100644--- a/skills/ppt-master/scripts/svg_editor/server.py+++ b/skills/ppt-master/scripts/svg_editor/server.py@@ -424,6 +424,28 @@ def create_app(return jsonify({'error': 'not found'}), 404return send_from_directory(str(assets_dir), filename)+ @app.route('/<path:filename>')+ def serve_bare_asset(filename: str):+ """Resolve a template SVG's bare image href (e.g. `href="cover_bg.png"`).++ Mirror templates copy hrefs verbatim, so a bare filename reaches the+ browser as `/<filename>` (no `../images/` prefix). Resolve it against the+ project's images/ then assets/. Every real route (`/api/*`, `/images/*`,+ `/assets/*`, `/static/*`, `/`) is more specific and matches first; this+ only catches the leftover bare references and 404s otherwise.+ """+ for base in (images_dir, assets_dir):+ if not base.exists():+ continue+ target = (base / filename).resolve()+ try:+ target.relative_to(base.resolve())+ except ValueError:+ continue+ if target.exists() and target.is_file():+ return send_from_directory(str(base), filename)+ return jsonify({'error': 'not found'}), 404+@app.route('/api/slides')def get_slides():svg_dir = app.config['SVG_DIR']diff --git a/skills/ppt-master/scripts/svg_to_pptx/drawingml_elements.py b/skills/ppt-master/scripts/svg_to_pptx/drawingml_elements.pyindex 9f78219e..31490e24 100644--- a/skills/ppt-master/scripts/svg_to_pptx/drawingml_elements.py+++ b/skills/ppt-master/scripts/svg_to_pptx/drawingml_elements.py@@ -6,6 +6,7 @@ import ioimport mathimport reimport base64+from pathlib import Pathfrom typing import Anyfrom xml.etree import ElementTree as ET@@ -30,6 +31,26 @@ from .drawingml_paths import ()+def _resolve_external_image(svg_dir: Path, href: str) -> Path:+ """Resolve a non-data-URI image href to a file on disk.++ Search order: next to the SVG (``svg_output/``), the project root, the+ project's ``images/`` (the single runtime image pool — template-bundled+ bitmaps plus AI / web / user images all live here), then ``templates/``+ (legacy flat-copied template assets). Raises ``FileNotFoundError`` if none+ of these exist.+ """+ for candidate in (+ svg_dir / href,+ svg_dir.parent / href,+ svg_dir.parent / 'images' / href,+ svg_dir.parent / 'templates' / href,+ ):+ if candidate.exists():+ return candidate+ raise FileNotFoundError(f'External image not found: {href}')++def _wrap_shape(shape_id: int, name: str,off_x: int, off_y: int,@@ -1686,13 +1707,7 @@ def convert_image(elem: ET.Element, ctx: ConvertContext) -> ShapeResult | None:else:if ctx.svg_dir is None:return None- img_path = ctx.svg_dir / href- if not img_path.exists():- img_path = ctx.svg_dir.parent / href- if not img_path.exists():- img_path = ctx.svg_dir.parent / 'templates' / href- if not img_path.exists():- raise FileNotFoundError(f'External image not found: {href}')+ img_path = _resolve_external_image(ctx.svg_dir, href)img_format = img_path.suffix.lstrip('.').lower()if img_format == 'jpeg':img_format = 'jpg'@@ -1889,13 +1904,7 @@ def convert_nested_svg(elem: ET.Element, ctx: ConvertContext) -> ShapeResult | Nelse:if ctx.svg_dir is None:return None- img_path = ctx.svg_dir / href- if not img_path.exists():- img_path = ctx.svg_dir.parent / href- if not img_path.exists():- img_path = ctx.svg_dir.parent / 'templates' / href- if not img_path.exists():- raise FileNotFoundError(f'External image not found: {href}')+ img_path = _resolve_external_image(ctx.svg_dir, href)img_format = img_path.suffix.lstrip('.').lower()if img_format == 'jpeg':img_format = 'jpg'