Skip to content

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

docs(create-template): unify template workspace contracts

hugohe366937736c010
diff --git a/AGENTS.md b/AGENTS.md
index 286908ca..20a5d7a4 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -14,7 +14,7 @@ PPT Master is an AI-driven presentation generation system. Multi-role collaborat
- Topic-only requests run [`topic-research`](skills/ppt-master/workflows/topic-research.md) before SKILL.md Step 1.
- Raw PPTX template plus new material/topic routes to [`template-fill-pptx`](skills/ppt-master/workflows/template-fill-pptx.md), not the SVG pipeline.
-- Raw PPTX cannot be consumed as a Step 3 SVG template; run [`create-template`](skills/ppt-master/workflows/create-template.md) first and return with the generated template directory path.
+- Raw PPTX cannot be consumed as a Step 3 SVG template; run [`create-template`](skills/ppt-master/workflows/create-template.md) first and return with the generated template workspace root.
- PPTX beautify is strictly 1:1 page count/order and verbatim wording via [`beautify-pptx`](skills/ppt-master/workflows/beautify-pptx.md); any split/merge/drop/reorder routes to the main pipeline.
- Finished PPTX native enhancement uses [`native-enhance-pptx`](skills/ppt-master/workflows/native-enhance-pptx.md) and must not enter SVG regeneration.
- [`visual-review`](skills/ppt-master/workflows/visual-review.md), [`customize-animations`](skills/ppt-master/workflows/customize-animations.md), and [`generate-audio`](skills/ppt-master/workflows/generate-audio.md) are explicit-request workflows.
@@ -71,6 +71,8 @@ python3 skills/ppt-master/scripts/image_gen.py "prompt" --aspect_ratio 16:9 --im
python3 skills/ppt-master/scripts/slice_images.py <project_path>/images/<sheet>.png --grid RxC --names a,b,c --trim --alpha
python3 skills/ppt-master/scripts/svg_editor/server.py <project_path> --live --daemon
python3 skills/ppt-master/scripts/svg_quality_checker.py <project_path>
+# create-template review deck (workspace root may be global or project-scoped)
+python3 skills/ppt-master/scripts/template_preview_pptx.py <template_workspace>
python3 skills/ppt-master/scripts/animation_config.py scaffold <project_path> # optional, only for custom object-level animation
python3 skills/ppt-master/scripts/animation_config.py validate <project_path> # optional, before re-export
diff --git a/docs/audio-narration.md b/docs/audio-narration.md
index b23bb60f..a40fb8ce 100644
--- a/docs/audio-narration.md
+++ b/docs/audio-narration.md
@@ -11,7 +11,7 @@ PPT Master can turn the speaker notes into per-slide narration via [`edge-tts`](
## How it works
1. **Speaker notes are written as pure spoken narration.** PPT Master's notes spec deliberately produces TTS-friendly prose — no bracketed stage markers, no `Key points:` / `Duration:` meta-lines — so what is read aloud is exactly what's on the page.
-2. **AI picks the voice for you.** When you ask for narration, the AI checks the deck's primary language (`zh-CN` / `en-US` / `ja-JP` / `ko-KR` / …), pulls the selected provider's voice catalog, and recommends 3–6 candidates with a one-line tone description for each (e.g. "稳重男声,适合财报"). It also recommends a speaking rate or provider defaults based on notes density.
+2. **AI picks the voice for you.** When you ask for narration, the AI checks the deck's primary language (`zh-CN` / `en-US` / `ja-JP` / `ko-KR` / …), pulls the selected provider's voice catalog, and recommends 3–6 candidates with a one-line tone description for each (e.g. "steady male voice for financial reporting"). It also recommends a speaking rate or provider defaults based on notes density.
3. **One question, one answer.** You are asked once — voice, rate, and "embed audio back into PPTX (yes/no)" — all with a recommended default. Reply "ok" to accept everything, or just call out the part you want to change.
4. **Generation runs.** The script writes page-level audio to `audio/`, then (if you kept embedding) re-exports the deck with audio attached. Long-audio import and automatic long-audio splitting are not supported.
@@ -29,7 +29,7 @@ The full step-by-step is in [`workflows/generate-audio.md`](../skills/ppt-master
Just say so in chat after the deck has been exported:
```
-You: 给这个 PPT 生成音频
+You: Generate narration audio for this deck
You: Generate narration for this deck and re-export with audio embedded.
You: Add Japanese voice narration; pick a calm female voice.
```
@@ -111,14 +111,14 @@ Four cloud providers — **ElevenLabs**, **MiniMax**, **Qwen**, **CosyVoice**
| Provider | Where to clone | Sample length |
|---|---|---|
| ElevenLabs | [elevenlabs.io](https://elevenlabs.io) → Voices → Add Voice → Instant / Professional Voice Cloning | 1 min (Instant) / 30 min+ (Professional) |
-| MiniMax | [platform.minimaxi.com](https://platform.minimaxi.com) → 语音克隆 (Voice Clone) | ~10 s – 5 min |
-| Qwen TTS | [DashScope console](https://dashscope.console.aliyun.com) → 语音合成 → 声音复刻 | ~10 s – 5 min |
-| CosyVoice | [DashScope console](https://dashscope.console.aliyun.com) → 语音合成 → 音色复刻 | ~10 s – 5 min |
+| MiniMax | [platform.minimaxi.com](https://platform.minimaxi.com) → Voice Clone | ~10 s – 5 min |
+| Qwen TTS | [DashScope console](https://dashscope.console.aliyun.com) → Speech Synthesis → Voice Replica | ~10 s – 5 min |
+| CosyVoice | [DashScope console](https://dashscope.console.aliyun.com) → Speech Synthesis → Voice Replica | ~10 s – 5 min |
**How to use it after cloning** — in chat, just say so. The AI will skip the voice-recommendation step and use your `voice_id` directly:
```
-You: 用 MiniMax 我克隆的音色生成旁白,voice_id 是 xxxxxxx
+You: Generate narration with my cloned MiniMax voice; voice_id is xxxxxxx
You: Generate the narration with my cloned ElevenLabs voice id abc123
```
diff --git a/docs/faq.md b/docs/faq.md
index 296b509b..247d8a92 100644
--- a/docs/faq.md
+++ b/docs/faq.md
@@ -1,6 +1,6 @@
# FAQ
-[English](./faq.md) | [中文](./zh/faq.md)
+[English](./faq.md) | [Chinese](./zh/faq.md)
---
@@ -193,7 +193,7 @@ If generation feels slow, check your model's token throughput. The bottleneck is
Default recommendation: **continuous one-shot generation**. 10–15 page decks fit comfortably in a 200K window, and cross-page visual consistency is best when the Executor can see prior pages in the same session (it actively aligns style, font sizes, and rhythm).
-Only when signals are heavy (≥ 18 pages, thick source material, or `topic-research` ran with substantial web-fetch accumulation) does the AI surface an optional **split mode** hint at the Strategist phase: the planning session (Strategist confirmation stage + image acquisition) ends in the current chat; you open a fresh chat window and type `继续生成 projects/<project_name>` (or "resume execution projects/<project_name>") to enter the execution session (SVG generation + export). The new session reloads `design_spec` / `spec_lock` / `sources` / `images` from disk and continues from there.
+Only when signals are heavy (≥ 18 pages, thick source material, or `topic-research` ran with substantial web-fetch accumulation) does the AI surface an optional **split mode** hint at the Strategist phase: the planning session (Strategist confirmation stage + image acquisition) ends in the current chat; you open a fresh chat window and type `resume execution projects/<project_name>` to enter the execution session (SVG generation + export). The new session reloads `design_spec` / `spec_lock` / `sources` / `images` from disk and continues from there.
Split mode is a **compromise** — it pays ~6K tokens (re-reading SKILL.md) to drop 60–200K of planning-session noise, then reuses the freed budget in the execution session to re-read `sources/` for richer slide content. **Not needed when signals are normal**; the hint won't appear, and you can always ignore it and stay in continuous mode.
@@ -252,13 +252,13 @@ Use an AI coding agent (Claude Code, Codex, etc.) and ask it to use the **PPT Ma
- Desired tone and color palette (e.g., "modern and restrained, dark blue primary")
- Category preference (`brand` / `general` / `scenario` / `government` / `special`)
- Canvas format, if not the default 16:9
-- Output scope: indexed `library` (default) or one already initialized `project`
+- Output scope: indexed `library` (default) or one already initialized `project`; both use the same complete workspace shape
You don't need to supply every detail upfront — the AI agent will ask follow-up questions to fill in anything missing (output scope, template ID, theme mode, etc.).
**Step 3 — Wait for the Result**
-The AI agent will handle the rest — analyzing your screenshots, building the layout definitions, and validating the template. Library scope registers it so it appears in global discovery. Project scope writes the thin bundle directly into that project's `templates/` root and deliberately skips global registration.
+The AI agent will handle the rest — analyzing your screenshots, building the layout definitions, validating the template, and exporting `exports/<id>_template_preview.pptx` for visual review in PowerPoint. Both scopes contain the same `templates/`, `images/`, `icons/`, and `exports/` core: library scope writes `skills/ppt-master/templates/<kind>/<id>/` and registers it; project scope writes `projects/<name>/` and skips registration. Give that workspace root to Step 3. Older flat packages with `design_spec.md` at the root remain compatible, and flat placement alone is not a reason to run structure restoration. Because the new workspace shapes match, a complete result can be migrated or reused between the two locations without restructuring it.
> **Tip**: The more specific you are about the style and use case, the better the generated template will match your expectations.
diff --git a/docs/getting-started.md b/docs/getting-started.md
index ef6d2d0c..51f64603 100644
--- a/docs/getting-started.md
+++ b/docs/getting-started.md
@@ -31,18 +31,18 @@ For the first, give the AI your `.pptx` plus your material (or a topic) and ask
You: Replicate this as a template via /create-template: projects/brand/our_deck.pptx
```
-That runs `pptx_template_import.py` and rebuilds the file into a reusable bundle — layout SVGs + `design_spec.md` + extracted theme colors, fonts, and images. That bundle is what you point to at generation time.
+That runs `pptx_template_import.py` and rebuilds the file into a reusable workspace — layout SVGs + `design_spec.md` + extracted theme colors, fonts, and images. It also exports `exports/<id>_template_preview.pptx`, so you can open the reconstructed template in PowerPoint and judge it before generation. The workspace root is what you point to at generation time.
-During the create-template brief, choose `library` (the existing default) or `project`. Project scope requires an initialized target project, verifies the project template root and asset names before writing, then installs the bundle directly into that project without global registration.
+During the create-template brief, choose `library` (the existing default) or `project`. Both create the same complete `templates/`, `images/`, `icons/`, and `exports/` workspace. Project scope requires an initialized target project; library scope alone adds global registration.
A created template lives in one of two places:
| Location | Path | Notes |
|---|---|---|
-| **Registered in the skill library** | `skills/ppt-master/templates/layouts/<id>/` | Global, reusable across every project; run `register_template.py` so it shows up when you ask "what templates are available?" |
-| **Inside a project** | `projects/<project>/templates/` | Private to that owning project; consumed in place, no registration needed |
+| **Registered in the skill library** | `skills/ppt-master/templates/<kind>/<id>/` | Complete workspace plus global registration, so it appears when you ask "what templates are available?" |
+| **Under projects** | `projects/<name>/` | The same complete workspace without global registration |
-For a library package, invoke it during generation by giving its **directory path** in chat. A project-scoped create-template run may hand its exact validated path directly to Step 3 in the same conversation. Both cases stay path-based; a bare template name never triggers. To reuse a project-scoped design in another project, recreate it with `library` scope because its image/icon pools live beside the owning project's template root.
+Invoke either result by giving its **workspace-root path** in chat. Step 3 resolves `templates/design_spec.md`; for compatibility it also accepts older flat packages whose `design_spec.md` is directly at the supplied root. A create-template run may hand its exact validated workspace root directly to Step 3 in the same conversation. Both cases stay path-based; a bare template name never triggers. The complete workspace can be copied or migrated between the library and `projects/` without restructuring it; only library registration changes.
```
You: Make a deck from sources/report.pdf with template skills/ppt-master/templates/layouts/academic_defense/
@@ -60,7 +60,7 @@ The whole loop is three steps. Install first — you only need Python; see [Quic
2. **Tell the AI in chat** what to turn into a deck (add a template path if you set one up above; otherwise it's free design):
```
You: Make a deck from projects/q3-report/sources/report.pdf
- You: 把这份内容做成 PPT:<paste your text>
+ You: Turn this text into a deck: <paste your text>
```
3. **Get an editable `.pptx`** at `exports/<name>_<timestamp>.pptx` — real DrawingML shapes, text boxes, and charts you can click and edit in PowerPoint, Keynote, WPS, or LibreOffice.
@@ -98,7 +98,7 @@ Turn the speaker notes into per-slide voice narration, embed the audio back into
```
You: Generate narration for this deck and re-export with audio embedded.
-You: 给这个 PPT 生成音频
+You: Generate narration audio for this deck
```
Narration defaults to `edge-tts` (about 90 locales); optional cloud providers cover higher-quality voices. The AI recommends a voice for the deck's language and asks once before generating.
diff --git a/docs/roadmap.md b/docs/roadmap.md
index fe5c3b5a..450d9183 100644
--- a/docs/roadmap.md
+++ b/docs/roadmap.md
@@ -1,6 +1,6 @@
# Roadmap
-[English](./roadmap.md) | [中文](./zh/roadmap.md)
+[English](./roadmap.md) | [Chinese](./zh/roadmap.md)
---
@@ -49,7 +49,7 @@ The past two months' structural capability growth. Single flags / incremental po
- **Replicate any PPTX's design → refill content route** ([`workflows/template-fill-pptx.md`](../skills/ppt-master/workflows/template-fill-pptx.md)) — when a user supplies an existing `.pptx` plus new material / a topic and asks to "reuse this deck's design / fill the content back in", this standalone workflow edits the PPTX directly and never enters the SVG generation pipeline. Output stays natively editable (it reuses the original slides' shapes / layouts, not a screenshot refill); it isolates private parts on reuse, exposes chart data, and runs capacity checks. Trigger follows the template rule — only on an explicit ask to reuse an existing deck — and it deliberately does not reflow / add pages / swap images (that's the from-scratch main route). Distinguished from Non-goals #53 below
- **Three executors retired → mode + visual-style dual catalogs** ([`references/modes/`](../skills/ppt-master/references/modes/) + [`references/visual-styles/`](../skills/ppt-master/references/visual-styles/)) — the old three `executor-*.md` (general / consultant / consultant-top) entangled domain · audience · persuasion · narrative on one axis; split into two orthogonal catalogs (following the `image-renderings` pattern: flat dir + `_index` + on-demand read + Strategist locks one). **mode** = narrative skeleton (`pyramid` / `narrative` / `instructional` / `showcase`; consultant + top merge into pyramid since their narrative core is identical); **visual-style** = SVG layout aesthetic (`swiss-minimal` / `editorial` / `soft-rounded` / `dark-tech`, each paired with an image-rendering, **zero HEX** — color truth stays in confirmation e + image-palettes). Strategist `§d` locks `mode` + `visual_style` independently into `spec_lock`; Executor loads the two locked files; any mode × any style. Render coordinates stay in `templates/charts/`
- **Prompt constraint-strength decoupling** ([`docs/rules/prompt-style.md`](rules/prompt-style.md) §4) — three explicit strength tiers — rule (`Hard rule` / `Forbidden`) / default (`Default — … may override`) / reference (`Reference — not a constraint`) — plus an "objective failure vs taste" test and a checker boundary, so the model can tell "must keep vs may deviate" at a glance; the visual-style catalog is Reference-strength throughout
-- **visual-style catalog grows to 18, aligned with image-renderings + examples reclaimed** — first four distilled from the [examples library](../examples/) (`brutalist` / `blueprint` / `memphis` / `zine`), then six filling in the hand-drawn / textured renderings that have a layout twin (`sketch-notes` / `ink-notes` / `chalkboard` / `paper-cut` / `vintage-poster` / `pixel-art`), then four more reclaimed from still-uncovered example aesthetics: `ink-wash` (rice-paper whitespace, from 藏拙 / 李子柒) · `glassmorphism` (dark frosted-glass + gradient light, from glassmorphism_demo, split out of soft-rounded) · `photo-editorial` (full-bleed photography dominates, text captions, from Pritzker / fashion_weekly) · `data-journalism` (Bloomberg/Economist multi-column micro-charts + sidebars, from global_ai_capital). The catalog is regrouped into five families (corporate-product / editorial-publication / expressive-print / hand-drawn-brush / specialty). **The test**: a rendering earns a visual-style twin only when it defines a whole-page layout language, not merely how an inserted image looks — so photo-*led composition* gets `photo-editorial` (paired with corporate-photo), while purely atmospheric renderings (nature / warm-scene / fantasy-animation) stay imagery-only and just pair with a layout style. Zero HEX, Reference strength throughout
+- **visual-style catalog grows to 18, aligned with image-renderings + examples reclaimed** — first four distilled from the [examples library](../examples/) (`brutalist` / `blueprint` / `memphis` / `zine`), then six filling in the hand-drawn / textured renderings that have a layout twin (`sketch-notes` / `ink-notes` / `chalkboard` / `paper-cut` / `vintage-poster` / `pixel-art`), then four more reclaimed from still-uncovered example aesthetics: `ink-wash` (rice-paper whitespace, from Cangzhuo / Li Ziqi) · `glassmorphism` (dark frosted-glass + gradient light, from glassmorphism_demo, split out of soft-rounded) · `photo-editorial` (full-bleed photography dominates, text captions, from Pritzker / fashion_weekly) · `data-journalism` (Bloomberg/Economist multi-column micro-charts + sidebars, from global_ai_capital). The catalog is regrouped into five families (corporate-product / editorial-publication / expressive-print / hand-drawn-brush / specialty). **The test**: a rendering earns a visual-style twin only when it defines a whole-page layout language, not merely how an inserted image looks — so photo-*led composition* gets `photo-editorial` (paired with corporate-photo), while purely atmospheric renderings (nature / warm-scene / fantasy-animation) stay imagery-only and just pair with a layout style. Zero HEX, Reference strength throughout
- **mode catalog grows to 5: add `briefing`** — fills the "neutral information delivery" cell: no thesis, no story, no teaching, no spectacle — topic titles, even weight, complete and scannable, for status updates / reference decks / catalogs / meeting packs / FAQs that inform without arguing. The five now partition presentation *intent* more nearly MECE: persuade (pyramid) · tell a story (narrative) · teach (instructional) · impress (showcase) · simply inform (briefing). `_index` gains a `briefing` vs `pyramid` tie-breaker ("if you'd have to invent a thesis to fit pyramid, it's briefing"). Five presets plus a `custom` escape hatch for a bespoke direction none of them captures (a special cadence, a multi-mode fusion, a particular posture) — either user-requested or Strategist-recommended, confirmed like every lock; a deck always locks one value, and a fusion is one `custom` describing the acts. The only thing to avoid is defaulting to `custom` when a preset genuinely fits. Mirrors the truth-precedence rule that a user-authored outline or direction overrides the mode
- **mode / visual-style system validated on real decks + four calibration tightenings landed** — the 5 modes + 18 visual-styles + the `custom` escape hatch were exercised on five covering decks (briefing×data-journalism / narrative×photo-editorial / instructional×chalkboard / showcase×glassmorphism / custom×zine, with the narrative deck going through the AI-image branch): **zero selection misses** (all four Close-calls tie-breakers fired and held against the real grey-zone pulls), **discipline fully honored** (zero HEX / Reference strength / whole-page layout language), **the `custom` mechanism works** (a `mode_behavior` prose paragraph carried a 10-page generation and reads as plain language at confirmation, not a bare token), **mode ⟂ visual_style holds** (any combination without bleed, including a positive check of the "keynote/launch = mode not style" route), export 5/5 decks × every page with 0 failures. Tightened four spots from the real signal: `strategist §e` now locks the full neutral tier set the visual_style implies up front (killing the mid-deck color top-ups seen in three consecutive decks), `executor-base §1` re-skins chart/layout template gradients-shadows-fills to the deck's visual_style (templates supply structure, not skin; mirror templates stay verbatim per §1.1), `briefing §1` makes `core_message` state coverage rather than a claim (briefing-only; global §IX assertion semantics stay for narrative/instructional/pyramid), and `svg_quality_checker` fixes font-family drift false positives (delimiter-matched capture + stack normalization) and drops the font-size ceiling for showcase mode and poster visual-styles
- **Optional spec-review checkpoint shipped** ([`workflows/refine-spec.md`](../skills/ppt-master/workflows/refine-spec.md)) — an opt-in pause after the Strategist confirmation stage: when the user explicitly asks (default OFF), the Strategist produces the full `design_spec.md` + `spec_lock.md`, then stops so the user can revise any part of the spec (outline / color / typography / layout / image strategy / page rhythm) before generation, keeping both files in sync. Same shape as the split-mode note — it never fires on its own, the default pipeline is unchanged, and it surfaces as one opt-in line inside the Strategist confirmation stage. Review lenses (logical clarity / information density / focus / register / emotional resonance / chapter balance + the design dimensions) give a direction only, never a numeric threshold (`Reference` strength). Prompted by [@cuberoocp](https://github.com/cuberoocp) in [issue #173](https://github.com/hugohe3/ppt-master/issues/173)
@@ -72,7 +72,7 @@ The past two months' structural capability growth. Single flags / incremental po
- **Web image sourcing → best-match + reviewable + manual replace** — web rows no longer silently download a candidate pool; the default downloads **only the best match**, with the pool demoted to an opt-in `--save-candidates` escalation (default 4). Every download writes a ≤1024px review copy under `images/.review/` (placed / promoted asset stays full-resolution). Suitability review is **model-agnostic**: a multimodal model reads the review copy, a non-multimodal one hands the `source_page_url` to a human — no assumption of vision. New `image_search.py --from-url <url>` downloads any human-chosen image URL into the target (recorded `license_tier: manual`, inheriting page context) as the universal manual-replacement path; `--promote` now recomputes the credit from the chosen candidate (never the replaced image's). It all runs inside Step 5 and never halts the pipeline (a poor fit becomes `Needs-Manual` + placeholder). Web search is positioned as a placeholder-grade fallback that does **not** guarantee quality — high quality comes from AI generation or picking an image by hand and swapping it in
-- **Web image entity-safety gate (exact subjects no longer lose to a "hi-res wrong image")** — building on the row above: web candidates now pass a `required_terms` entity gate that blocks metadata-relevant-but-wrong-subject images (a polished Rome monument winning a "Chongqing landmark" row). Groups are ANDed, `A|B` gives intra-group aliases (cross-language `Chongqing|重庆`), and matching is lowercased / separator-normalized / space-compacted so multi-word and CJK names match; an entity hit counts as the relevance signal (a zero query-token overlap no longer rejects, so a CJK-titled landmark passes under an English query — the old reject still applies when no `required_terms` are set). Pixel area drops from a dominant score (cap 5000) to a tie-breaker (cap 1500) plus a title-hit boost, so entity accuracy and relevance outrank raw resolution. CLI `--require-terms` (repeatable, comma / `|`), batch `required_terms`, and `--from-url` all inherit it, recorded in `image_sources.json` for audit; a toothless gate (weak `required_terms`) emits a warning. It is a **metadata gate** paired with the `.review` visual check, not a visual classifier
+- **Web image entity-safety gate (exact subjects no longer lose to a "hi-res wrong image")** — building on the row above: web candidates now pass a `required_terms` entity gate that blocks metadata-relevant-but-wrong-subject images (a polished Rome monument winning a "Chongqing landmark" row). Groups are ANDed, `A|B` gives intra-group aliases (for example `Chongqing|Chungking`), and matching is lowercased / separator-normalized / space-compacted so multi-word and CJK names match; an entity hit counts as the relevance signal (a zero query-token overlap no longer rejects, so a CJK-titled landmark passes under an English query — the old reject still applies when no `required_terms` are set). Pixel area drops from a dominant score (cap 5000) to a tie-breaker (cap 1500) plus a title-hit boost, so entity accuracy and relevance outrank raw resolution. CLI `--require-terms` (repeatable, comma / `|`), batch `required_terms`, and `--from-url` all inherit it, recorded in `image_sources.json` for audit; a toothless gate (weak `required_terms`) emits a warning. It is a **metadata gate** paired with the `.review` visual check, not a visual classifier
- **Native PPTX export caps image media size** — keep generated decks editable without embedding huge source images: new native image sizing modes — `cap` (default) limits only oversized source images to a max dimension, while `display` sizes from the rendered SVG box for more aggressive compression; native export preserves full embedded pixels while SVG/PPT display cropping stays as editable picture-crop metadata; `finalize_svg` keeps its existing slice/meet behavior and adds default rendered-size downsampling for compact SVG snapshots. Docs land the `cap` / `display` modes and the `--no-image-optimize` escape hatch
@@ -84,7 +84,7 @@ The past two months' structural capability growth. Single flags / incremental po
- **`--native-objects` hardened from dormant marker to usable opt-in** — the narrow native-object exception (see Non-goals below) now emits charts and pure-text tables that keep the deck's own design instead of snapping to PowerPoint's white default theme. Classic native charts write explicit chart-area / plot-area / axis-line / gridline / label-text colors — inferred from the visible SVG fallback (largest panel `<rect>` → background, fallback text → labels, fallback strokes → axis/grid) or overridden per `style` (`chart_area_fill` / `plot_area_fill` / `text_color` / `axis_color` / `grid_color`, `"none"` for transparent); the color parser normalizes named CSS colors, `#RGB` shorthand, and `rgb()` / `rgba()` to OOXML hex; bar/column series disable negative-value fill inversion so negative bars keep their series color. The activated export is named `<name>_<ts>_native_charts.pptx` to tell it apart from the default flattened-shape export. **The default route is unchanged** — charts/tables still export as SVG-derived DrawingML shapes for cross-renderer fidelity; native objects stay the deliberate opt-in trade documented under Non-goals below
-- **Native package structure + conservative PPTX object round-trip** — every new SVG page declares its final Master/Layout identity while it is authored. Fixed Master/Layout visuals are root-level atoms, reusable slots are bounded top-level groups with real carriers or an explicit composite proxy, and zero-slot Layouts remain valid. Export deterministically compiles only that contract, writes locked title/body sizes into Master `p:txStyles`, and performs final package read-back; it never promotes repeated chrome or infers placeholders. `create-template` restores the source Master/Layout topology into the same explicit SVG model; strict keeps a selected Layout, while adaptive may add a new Layout under the same Master. Legacy baseline/template/preserve SVG packages first run `restore-pptx-structure`. Raw one-off PPTX filling remains `template-fill-pptx`.
+- **Native package structure + conservative PPTX object round-trip** — every new SVG page declares its final Master/Layout identity while it is authored. Fixed Master/Layout visuals are root-level atoms, reusable slots are bounded top-level groups with real carriers or an explicit composite proxy, and zero-slot Layouts remain valid. Export deterministically compiles only that contract, writes locked title/body sizes into Master `p:txStyles`, and performs final package read-back; it never promotes repeated chrome or infers placeholders. `create-template` restores the source Master/Layout topology into the same explicit SVG model; strict keeps a selected Layout, while adaptive may add a new Layout under the same Master. Library and project outputs now share one complete `templates/` + `images/` + `icons/` + `exports/<id>_template_preview.pptx` workspace shape; only library registration differs. Legacy baseline/template/preserve SVG packages first run `restore-pptx-structure`. Raw one-off PPTX filling remains `template-fill-pptx`.
---
diff --git a/docs/rules/prompt-style.md b/docs/rules/prompt-style.md
index a9f6960c..74de324f 100644
--- a/docs/rules/prompt-style.md
+++ b/docs/rules/prompt-style.md
@@ -184,7 +184,7 @@ Items are evidence-driven (`file exists at path X`, `status N is Generated`), no
## 11. Forbidden Patterns Across the Whole Layer
-- `> 重要:` / `> 注意:` Chinese exclamations (use `> Note` or omit)
+- Localized warning/exclamation blockquotes (use `> Note` or omit)
- Emoji as decoration in headings (✅ in checkpoint headings is the only sanctioned use)
- Smiley face / sparkle / fire emoji
- Footnotes (`[^1]`)
diff --git a/docs/technical-design.md b/docs/technical-design.md
index 079eb496..4466d3ee 100644
--- a/docs/technical-design.md
+++ b/docs/technical-design.md
@@ -1,6 +1,6 @@
# Technical Design
-[English](./technical-design.md) | [中文](./zh/technical-design.md)
+[English](./technical-design.md) | [Chinese](./zh/technical-design.md)
---
@@ -24,7 +24,7 @@ User Input (PDF/DOCX/XLSX/PPTX/URL/Markdown/topic text)
[Create Project] → project_manager.py init <project_name> --format <format>
↓
[Template / Brand / Layout (optional)] — default: skip, proceed with free design
- Trigger only on an explicit template directory path containing design_spec.md kind: brand/layout/deck
+ Trigger only on an explicit Layout/Deck workspace root or direct Brand/legacy package path
Raw PPTX template requests route to template-fill; reusable SVG templates are created by create-template first
↓
[Strategist] - three-stage Strategist confirmation stage & Design Specifications → design_spec.md + spec_lock.md
@@ -97,8 +97,8 @@ Use this table before reasoning about implementation details. Most failed runs s
| Raw PPTX template plus new material/topic | `template-fill-pptx` | clone/fill native slides; no SVG generation |
| Existing PPTX, preserve page count/order/wording 1:1, improve layout | `beautify-pptx` | regenerate through SVG; content and pagination are locked |
| Finished PPTX, keep content/layout stable, add notes/audio/timings/transitions | `native-enhance-pptx` | direct OOXML patch; no design regeneration |
-| User wants a reusable template package from a PPTX or design reference | `create-template` or `create-brand` | outputs a directory that later triggers Step 3 |
-| User supplies an explicit `templates/.../<id>/` directory with `kind: brand/layout/deck` | main SVG pipeline Step 3 | deck/layout SVGs must satisfy the current structured contract; legacy packages first run `restore-pptx-structure` |
+| User wants a reusable template workspace from a PPTX or design reference | `create-template` or `create-brand` | outputs a workspace root that later triggers Step 3; create-template also exports a review PPTX |
+| User supplies an explicit template path | main SVG pipeline Step 3 | current Layout/Deck workspaces resolve `templates/design_spec.md`; Brand packages and legacy-flat roots resolve direct `design_spec.md`; restore only legacy SVG semantics |
| User asks to tune object-level animation order/effect/timing | `customize-animations` | optional export policy via `animations.json` |
| User asks to preview, select, annotate, or re-export browser edits | `live-preview` | browser workflow; annotations apply only at defined handoff points |
@@ -263,7 +263,19 @@ Templates are **opt-in, not default**. The default Strategist flow is free desig
**Why default to free design.** Templates are floors that easily become ceilings: they lock the deck into the template's visual idioms regardless of how the content actually wants to be presented. Free-design layouts derive structure from the source content rather than imposing it from a fixed grammar, so the visual rhythm tracks the content rather than fighting it. Constrained mode is genuinely better in narrow cases (brand-locked decks, strongly-typed scenarios like academic defense or government report), so it stays available — but the AI doesn't proactively reach for it; the user does.
-**Mechanical trigger, not semantic matching.** A bare name like `academic_defense`, a brand mention, or a style phrase such as "McKinsey style" does not trigger Step 3 even if a matching library directory exists. Step 3 only consumes a path that resolves to a directory whose `design_spec.md` declares `kind: brand`, `kind: layout`, or `kind: deck`. Discoverability is handled by template indexes and explicit Q&A ("what templates are available?"), not by runtime fuzzy matching.
+**Mechanical trigger, not semantic matching.** A bare name like `academic_defense`, a brand mention, or a style phrase such as "McKinsey style" does not trigger Step 3 even if a matching library directory exists. Step 3 consumes an explicit path. Current Layout/Deck workspaces resolve `templates/design_spec.md`; Brand packages keep their direct root `design_spec.md`, as do compatible legacy-flat Layout/Deck packages. Flat placement is not a reason to restore structure; only legacy Master/Layout/placeholder semantics trigger `restore-pptx-structure`. Discoverability is handled by template indexes and explicit Q&A ("what templates are available?"), not by runtime fuzzy matching.
+
+New `create-template` Layout/Deck outputs use one physical contract in both locations:
+
+```text
+<template_workspace>/
+├── templates/ # design_spec.md, SVG prototypes, templates/icons/ when used
+├── images/ # bitmap assets referenced as ../images/<name>
+├── icons/ # runtime copy of extracted vector assets
+└── exports/ # <id>_template_preview.pptx
+```
+
+`<template_workspace>` is either `skills/ppt-master/templates/<kind>/<id>/` or `projects/<name>/`. Step 3 receives that root. The workspace is portable between locations without reshaping; global index registration is the only scope-specific behavior, and `exports/` is review evidence rather than a template input.
The three template kinds own different segments of the design contract:
@@ -275,7 +287,7 @@ The three template kinds own different segments of the design contract:
When several paths are supplied, fusion is segment-level, not field-level. A brand overrides the identity segment, a layout overrides the structure segment, and a deck supplies the middle/template-overview segment. Same-kind conflicts are surfaced as conflicts rather than resolved by implicit ordering. This keeps template composition debuggable: a fused spec can say exactly which bundle owns each segment.
-**Raw PPTX templates are outside Step 3.** A `.pptx` may be source material, and PPTX intake can extract its identity and geometry. But a raw PPTX template plus a request to generate a new PPTX routes to `template-fill`, because the user's expectation is native slide cloning and text/table/chart replacement. The SVG route can consume only a reusable template package; to use a PPTX's design language in the SVG route, the PPTX must first pass through `create-template`, then the resulting template directory path can be supplied to Step 3.
+**Raw PPTX templates are outside Step 3.** A `.pptx` may be source material, and PPTX intake can extract its identity and geometry. But a raw PPTX template plus a request to generate a new PPTX routes to `template-fill`, because the user's expectation is native slide cloning and text/table/chart replacement. The SVG route can consume only a reusable template workspace; to use a PPTX's design language in the SVG route, the PPTX must first pass through `create-template`, then the resulting workspace-root path can be supplied to Step 3.
**Layouts are opt-in; charts and icons are not.** The asymmetry isn't an inconsistency — *layout* is what locks visual idiom (the floor/ceiling problem above), while charts and icons are reusable primitives that don't impose deck-wide style. Same `templates/` directory, different role in the visual contract.
@@ -450,7 +462,7 @@ These direct routes share some analysis primitives with the main pipeline, espec
**Why per-element dispatch, not whole-file translation.** SVG's hierarchical model maps cleanly onto DrawingML's group / shape / picture types — there's no need for a holistic optimizer that re-plans the slide. Each shape kind gets its own narrow translator, which keeps each translator simple enough to debug and unit-test in isolation. The output quality of a slide is the sum of independent local conversions; that property is fragile under whole-file translation but robust under element dispatch.
-**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 there is only one PPTX compiler route.** Native export reads authored SVGs and translates supported SVG elements into DrawingML shapes. The normal deck path reads `svg_output/`; create-template invokes the same structured compiler on validated template prototypes to produce `exports/<id>_template_preview.pptx` as review evidence. 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 deck 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 structure is authored before visual generation.** Master and Layout are not post-processing discoveries. Strategist writes the Master roster and complete page mapping before SVG generation; Executor writes those identities, fixed atoms, and slots while composing each page. This keeps free design unconstrained at the visual level while making PowerPoint ownership explicit. Export only compiles declared structure. Legacy or unmapped projects enter `restore-pptx-structure`; they never trigger an exporter heuristic.
@@ -468,7 +480,7 @@ These direct routes share some analysis primitives with the main pipeline, espec
**Why reusable templates reconstruct the source topology.** `pptx_template_import.py` emits layered Master/Layout/Slide references plus native structure facts. `create-template` reconstructs every source Master and Layout, including unused Layouts, as complete annotated SVG prototypes. Source Master/Layout groups are flattened into atoms; parent relationships, picker names, placeholder identities, and bounds remain auditable in the template specification. The original PPTX remains an analysis input, not a packaged export dependency.
-**Why project-scoped thin templates are an output policy, not another structure mode.** `create-template` keeps `library` as its default indexed output and may instead write the same validated contract directly into an initialized project's `templates/` root. Project bitmaps go to `images/`, extracted icons keep a package copy plus a runtime copy, and no global index is touched. Both scopes use the same `structured` contract.
+**Why create-template uses one workspace shape in both scopes.** `create-template` keeps `library` as its default indexed output and may instead write under an initialized project. Both roots contain the same `templates/`, `images/`, `icons/`, and `exports/` core, including `<id>_template_preview.pptx`; SVG asset references are identical. This makes the complete workspace migratable and reusable without a library-only package branch or a reduced project branch. The sole scope difference is global index registration, and both use the same `structured` contract.
**Why each template SVG stays complete while still compiling to native structure.** A template SVG repeats the inherited Master/Layout visuals together with sample Slide content so it opens as a complete standalone page. During generation, `page_layouts` selects that prototype and the output SVG remains complete. Export removes repeated inherited atoms, emits real Master/Layout parts, and leaves actual slot carriers and Slide-local content on the Slide.
@@ -527,7 +539,7 @@ Standalone workflows are route definitions, not optional decorations. They exist
| `topic-research` | user provides only a topic and no source material | gather web materials before Step 1 |
| `template-fill-pptx` | raw PPTX template + new material/topic | direct native slide clone/fill; no SVG pipeline |
| `beautify-pptx` | existing PPTX, preserve page count/order/wording 1:1, improve layout | regenerate through SVG pipeline with source identity/content locked |
-| `create-template` | build a reusable layout/deck template package | output a directory Step 3 can consume later |
+| `create-template` | build a reusable layout/deck template workspace | output a portable workspace root plus `exports/<id>_template_preview.pptx`; only library scope registers it |
| `create-brand` | extract or define a reusable brand identity | output `templates/brands/<id>/` |
| `resume-execute` | fresh chat after the planning session; user says to continue a project | enter the execution session without rerunning Strategist |
| `refine-spec` | user explicitly wants to review/refine the spec before generation | stop after full spec/lock for revision, then resume |
diff --git a/docs/templates-architecture.md b/docs/templates-architecture.md
index 75404c2d..f1bed606 100644
--- a/docs/templates-architecture.md
+++ b/docs/templates-architecture.md
@@ -8,13 +8,13 @@
## 1. The three kinds
-| Kind | Library-scope dir | What it writes | What it does NOT write | Originating workflow |
+| Kind | Library workspace root | What it writes | What it does NOT write | Originating workflow |
|---|---|---|---|---|
| **Brand** | `templates/brands/<id>/` | Identity segment only: color / typography / logo / voice / icon style | No canvas, page structure, SVG roster | `workflows/create-brand.md` |
| **Layout** | `templates/layouts/<id>/` | Structure segment only: canvas / page structure / page types / SVG roster | No brand identity (no logo, no locked brand color) | `workflows/create-template.md` (layout branch) |
| **Deck** | `templates/decks/<id>/` | All segments: identity + structure + middle (template overview) | — | `workflows/create-template.md` (deck branch, default) |
-Every newly created or restored Layout/Deck SVG is a complete preview with root Master/Layout key and picker names, direct atomic Master/Layout elements, and top-level semantic slot groups. A normal slot has positive design-zone bounds and exactly one compatible carrier; composite `object` regions use explicit proxy binding, and zero-slot Layouts are valid. These specialized markers are authoritative; minimal `data-pptx-role` hints are added only for structural page-frame behavior they cannot express. PPTX-import artifacts are analysis inputs only and are not packaged into new templates. Strict keeps the selected Layout contract; adaptive retains the Master and may create a new Layout identity while authoring. Both export through `pptx_structure.mode: structured`. Legacy packages first run `restore-pptx-structure`.
+Every newly created or restored Layout/Deck SVG is a complete preview with root Master/Layout key and picker names, direct atomic Master/Layout elements, and top-level semantic slot groups. A normal slot has positive design-zone bounds and exactly one compatible carrier; composite `object` regions use explicit proxy binding, and zero-slot Layouts are valid. These specialized markers are authoritative; minimal `data-pptx-role` hints are added only for structural page-frame behavior they cannot express. PPTX-import artifacts are analysis inputs only and are not packaged into new templates. Strict keeps the selected Layout contract; adaptive retains the Master and may create a new Layout identity while authoring. Both export through `pptx_structure.mode: structured`. Packages with legacy Master/Layout semantics first run `restore-pptx-structure`; a legacy flat directory with `design_spec.md` at its root remains a supported compatibility shape and flat placement alone does not trigger restoration.
The three are **parallel reference bundles**. In library scope, the physical directory and the frontmatter `kind` field correspond one-to-one:
@@ -25,14 +25,14 @@ kind: brand
...
---
-# templates/layouts/academic_defense/design_spec.md
+# templates/layouts/academic_defense/templates/design_spec.md
---
kind: layout
native_structure_mode: structured
...
---
-# templates/decks/招商银行/design_spec.md
+# templates/decks/china_merchants_bank/templates/design_spec.md
---
kind: deck
native_structure_mode: structured
@@ -42,16 +42,32 @@ native_structure_mode: structured
### Output scope is separate from kind
-`create-template` confirms where a layout/deck contract is owned. This execution choice does not add a fourth kind and does not add a PPTX structure mode:
+`create-template` confirms where a Layout/Deck workspace is placed. This execution choice does not add a fourth kind and does not add a PPTX structure mode:
-| Scope | Final location | Asset routing | Discovery |
+| Scope | Workspace root | Core workspace | Discovery |
|---|---|---|---|
-| `library` (default) | `skills/ppt-master/templates/<kind>/<id>/` | Self-contained package, including package-local bitmaps and `icons/` | Register in the matching global index |
-| `project` | Direct `<target_project>/templates/` root, never `<target_project>/templates/<id>/` | Spec/SVG/non-bitmap package assets in `templates/`; bitmaps in `images/` with `../images/<name>` references; extracted icons copied to both `templates/icons/` and runtime `icons/` | No global index or library README update |
+| `library` (default) | `skills/ppt-master/templates/<kind>/<id>/` | `templates/` + `images/` + `icons/` + `exports/` | Register in the matching global index |
+| `project` | `projects/<name>/` | The same `templates/` + `images/` + `icons/` + `exports/` contract | No global index update |
+
+Both roots have the same core shape:
+
+```text
+<template_workspace>/
+├── templates/
+│ ├── design_spec.md
+│ ├── *.svg
+│ └── icons/ # package/validation copy when used
+├── images/ # every bitmap; SVG href uses ../images/<name>
+├── icons/ # runtime copy of extracted vector assets
+└── exports/
+ └── <id>_template_preview.pptx
+```
+
+The preview PPTX is derived review evidence, not a source template asset. Step 3 reads the workspace root and consumes `templates/`, `images/`, and `icons/`; it ignores `exports/`.
-Project scope retains `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`.
+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`.
-Before any project-scoped final write, validate the initialized target, require an empty `templates/` root, and check all planned image/icon destination filenames for conflicts. Fail before writing anything; never merge or overwrite.
+Before any final write, resolve the selected workspace root, require an empty `templates/` root, and check all planned image, icon, and preview-PPTX destination filenames for conflicts. Project scope additionally requires an initialized target project. Fail before writing anything; never merge or overwrite.
### Segment partition
@@ -168,7 +184,7 @@ primary_color: "<HEX>"
Each index maps one-to-one with its physical directory; fields are trimmed to what Strategist actually needs to pick (following the "meta + summary" pattern from `charts_index.json`, but preserving structured metadata that helps selection).
-These indexes cover library scope only. Project-scoped template output is intentionally absent from all three indexes and remains usable through its explicit `<project>/templates/` path.
+These indexes cover library scope only. A project-root workspace is intentionally absent from all three indexes and remains usable through its explicit `projects/<name>/` path. Because both scopes use the same workspace shape, moving or copying the complete core workspace between them does not require asset-path rewriting; only library registration changes.
### `templates/brands/brands_index.json`
@@ -269,7 +285,7 @@ When fusion happens (any multi-path case), the resulting `<project>/templates/de
```markdown
> **Fused from:**
-> - deck: `templates/decks/招商银行/` (base)
+> - deck: `templates/decks/china_merchants_bank/` (base)
> - brand: `templates/brands/anthropic/` (identity override)
> - layout: `templates/layouts/academic_defense/` (structure override)
> - conflicts resolved: Color Scheme from anthropic (user picked a)
@@ -281,7 +297,7 @@ This lets both AI and humans trace which segment came from where.
## 5. Relationship with SKILL.md Step 3
-**Trigger rule stays path-based** — an explicit directory path is still required (see [[feedback-template-explicit-path-only]]), and bare names never trigger. Before copying a Layout/Deck package, Step 3 validates the current structured contract; an old `native_structure_mode: template`, missing Master identity, direct atomic placeholder, or distillation-era package first runs `restore-pptx-structure`. The only narrow handoff exception is a project-scoped `create-template` run in the current conversation: after validation, it may pass its exact `<project>/templates/` output directly into Step 3. The `kind` field decides **how AI handles the path after triggering**:
+**Trigger rule stays path-based** — an explicit workspace-root path is still required (see [[feedback-template-explicit-path-only]]), and bare names never trigger. Step 3 first resolves `<workspace>/templates/design_spec.md`; for compatibility, it also accepts a legacy flat root containing `<workspace>/design_spec.md`. Flat placement is only a directory-shape compatibility case. It does not trigger `restore-pptx-structure`; restoration is required only when the SVG contract has legacy semantics such as `native_structure_mode: template`, missing Master identity, direct atomic placeholders, or distillation-era markers. The only narrow handoff exception is a `create-template` run in the current conversation: after validation, it may pass its exact workspace root directly into Step 3. The `kind` field decides **how AI handles the path after triggering**:
| User path's `kind` | Step 3 action (per-kind branch) |
|---|---|
@@ -291,7 +307,7 @@ This lets both AI and humans trace which segment came from where.
| Multi-path | Fuse one `design_spec.md` per the table above; merge SVG/non-bitmap assets into `templates/` and bitmaps into `images/` |
| Same-kind multiple | Run the "git-style conflict resolution" prompt above to determine the merge |
-Bitmaps share the project's runtime `images/` pool and template SVGs reference them through `../images/`. If the explicit input path is already that same project's `<project>/templates/` root (the `create-template` project-scope output), Step 3 consumes the bundle in place: do not copy it onto itself and do not move its images again. That in-place directory is one complete bundle and cannot participate in multi-path fusion. It is private to its owning project because its image/icon pools are siblings of `templates/`; cross-project reuse requires a self-contained library-scope package.
+Bitmaps share the workspace `images/` pool and template SVGs reference them through `../images/`. If the explicit input root is already the target project's root, Step 3 consumes the workspace in place: do not copy it onto itself and do not move its assets again. Otherwise, the complete core workspace is portable: it may be copied from a project root to a library root, from the library to a project, or reused from another workspace without changing its internal structure. Registration is the only scope-specific step.
### Strategist confirmation stage narrowing per kind
@@ -304,9 +320,9 @@ When a deck path is supplied, the user already has a complete solution; the Stra
| Workflow | Produces |
|---|---|
| `workflows/create-brand.md` | brand directory (identity-only), reverse-engineered from brand assets |
-| `workflows/create-template.md` | layout or deck contract. Output scope is `library` by default (`templates/<kind>/<id>/` + registration) or `project` when confirmed (direct `<project>/templates/`, project asset routing, no registration). The internal kind branch still defaults to deck; explicit "structure only / drop the brand color" selects layout |
+| `workflows/create-template.md` | complete layout or deck workspace. Output scope is `library` by default (`templates/<kind>/<id>/` + registration) or `project` when confirmed (`projects/<name>/`, no registration). Both contain the same core directories and preview PPTX. The internal kind branch still defaults to deck; explicit "structure only / drop the brand color" selects layout |
-In library scope, the frontmatter `kind` field determines whether the file lands under `templates/brands/` / `templates/layouts/` / `templates/decks/`. Project scope keeps the same kind semantics while writing layout/deck output directly to the project's template root.
+In library scope, the frontmatter `kind` field determines which workspace parent is used under `templates/brands/` / `templates/layouts/` / `templates/decks/`. Project scope keeps the same kind semantics at the project workspace root. A complete workspace may migrate between scopes without reshaping; add or remove only the library index registration.
---
diff --git a/docs/templates-guide.md b/docs/templates-guide.md
index 1e6310ef..6423d1c3 100644
--- a/docs/templates-guide.md
+++ b/docs/templates-guide.md
@@ -18,21 +18,21 @@ The workflow **defaults to free design** — it will not ask whether you want a
### How to enter the template flow
-Send a path to a template directory in your initial message. Anywhere in the sentence is fine; the path just has to be unambiguous:
+Send the Layout/Deck workspace root or direct Brand package path in your initial message. Anywhere in the sentence is fine; the path just has to be unambiguous:
> "use this template: `skills/ppt-master/templates/layouts/academic_defense/`" ✅
-> "用这个模板做汇报:`projects/last_deck/templates/`" ✅
-> "做一份产品介绍,模板用 `/Users/me/Desktop/our_brand_v3/`" ✅
+> "use last deck's template: `projects/last_deck/`" ✅
+> "make a product introduction with `/Users/me/Desktop/our_brand_v3/`" ✅
-The AI first validates that directory's structured SVG contract, then installs its SVGs, `design_spec.md`, and assets into your project and proceeds to Strategist. The path may point to the built-in library under `skills/ppt-master/templates/layouts/` or another self-contained template directory. When the path already is the current project's own `<project>/templates/` root, the workflow consumes it in place instead of copying it onto itself. A project-scoped create-template run may hand this exact validated path directly to Step 3 in the same conversation; this is the only exception to the initial-message rule. Do not use a different project's `templates/` root as an external package: its `../images/` and runtime icon references are owner-local. Promote that design through library scope first.
+For a current Layout/Deck, the path is the **template workspace root**. Step 3 resolves `templates/design_spec.md`, validates the structured SVG contract, then installs `templates/`, `images/`, and `icons/` into the target project or consumes them in place when the workspace is already that project. The path may point to a built-in library workspace under `skills/ppt-master/templates/<kind>/<id>/`, a project workspace under `projects/<name>/`, or another workspace with the same shape. Brand packages keep their direct root `design_spec.md` contract. A create-template run may hand its exact validated workspace root directly to Step 3 in the same conversation; this is the only exception to the initial-message rule.
-> **Legacy package preflight:** existing built-in or external SVG packages may still use the former atomic-placeholder/unmapped contract. Before first use, run [`restore-pptx-structure`](../skills/ppt-master/workflows/restore-pptx-structure.md). Step 3 does not copy a legacy package and defer migration.
+> **Compatibility preflight:** Step 3 also accepts an older flat package with `design_spec.md` and SVGs directly at the supplied root. Flat placement by itself does not require restoration. Run [`restore-pptx-structure`](../skills/ppt-master/workflows/restore-pptx-structure.md) only when the SVGs use the former atomic-placeholder/unmapped Master/Layout semantics; Step 3 does not copy such a semantic-legacy package and defer migration.
### What does NOT trigger the template flow
-- **A bare template name without a path**: "use the academic_defense template" / "用 招商银行 模板" / "做一份 pixel_retro 模板的答辩" → free design. The AI does not look the name up. You must give a path.
-- **Style descriptions**: "McKinsey style" / "Google style" / "麦肯锡那种" / "极简风" / "Keynote 风" → free design. The descriptive words flow into Strategist as a style brief, but no template is copied.
-- **Vague intent**: "想用个模板" / "I want a template" with no path → free design.
+- **A bare template name without a path**: "use the academic_defense template" / "use the China Merchants Bank template" / "make a pixel_retro defense deck" → free design. The AI does not look the name up. You must give a path.
+- **Style descriptions**: "McKinsey style" / "Google style" / "minimalist" / "Keynote style" → free design. The descriptive words flow into Strategist as a style brief, but no template is copied.
+- **Vague intent**: "I want a template" with no path → free design.
This is intentional — the AI never makes a fuzzy / interpretive judgment about whether your wording maps to a template, and never resolves a name to a path on your behalf. If you want a template, give the path.
@@ -44,7 +44,7 @@ Templates are organized into three kinds, each in its own directory:
- [`templates/brands/README.md`](../skills/ppt-master/templates/brands/README.md) — identity-only presets (color / typography / logo / voice / icon style), no SVG pages; Anthropic, Google
- [`templates/layouts/README.md`](../skills/ppt-master/templates/layouts/README.md) — structure-only patterns (canvas / page structure / page types / SVG roster), no identity; academic_defense, government_blue/red, ai_ops, medical_university, pixel_retro, psychology_attachment
-- [`templates/decks/README.md`](../skills/ppt-master/templates/decks/README.md) — full-PPT replicas (identity + structure + middle segments); 招商银行, 中国电建_*, 中汽研_*, 重庆大学, 中国电信
+- [`templates/decks/README.md`](../skills/ppt-master/templates/decks/README.md) — full-PPT replicas (identity + structure + middle segments); China Merchants Bank, Power Construction Corporation of China, Chongqing University, China Telecom
Full data model + fusion / conflict-resolution rules: [`docs/zh/templates-architecture.md`](./zh/templates-architecture.md) (Chinese only for now).
@@ -56,7 +56,7 @@ Free design is **not** "no structure" or "no style" — the AI plans a fresh Mas
### Styles are not templates
-A **style** is a description ("minimalist" / "Keynote-style" / "magazine 风") — a few words you type in chat. A **template** is a copy-and-paste asset bundle (SVGs + design_spec + assets) the workflow installs into your project when you give it an explicit directory path.
+A **style** is a description ("minimalist" / "Keynote-style" / "editorial") — a few words you type in chat. A **template** is a copy-and-paste asset bundle (SVGs + design_spec + assets) the workflow installs into your project when you give it an explicit directory path.
| | Template | Style |
|---|---|---|
@@ -75,11 +75,11 @@ Three axes, freely combinable ("dark tech + minimalist" or "magazine + neo-Chine
| Style | One-line characterization |
|---|---|
-| **Minimalist / 极简风** | High whitespace, 2-3 colors, single focal point per page |
-| **Information-dense / 信息密集** | McKinsey-style structured tables, high density, conclusion-first |
+| **Minimalist** | High whitespace, 2-3 colors, single focal point per page |
+| **Information-dense** | McKinsey-style structured tables, high density, conclusion-first |
| **Keynote-style** | Single-page hero text, premium whitespace, Apple-feel |
-| **Editorial / 杂志风** | Large hero images, asymmetric layouts, strong typography contrast |
-| **Editorial illustration / 文艺手绘** | Warm tones, hand-drawn feel, zine-like |
+| **Editorial** | Large hero images, asymmetric layouts, strong typography contrast |
+| **Editorial illustration** | Warm tones, hand-drawn feel, zine-like |
**Scenario / Industry**
@@ -96,10 +96,10 @@ Three axes, freely combinable ("dark tech + minimalist" or "magazine + neo-Chine
| Style | One-line characterization |
|---|---|
-| **Dark tech / 暗色科技** | Dark backgrounds, neon accents, futuristic |
+| **Dark tech** | Dark backgrounds, neon accents, futuristic |
| **Pixel retro** | 8-bit, scanlines, gaming aesthetic |
-| **Neo-Chinese / 新中式** | Restrained traditional motifs, ink / vermilion |
-| **Scandinavian / 北欧极简** | Light, natural, restrained |
+| **Neo-Chinese** | Restrained traditional motifs, ink / vermilion |
+| **Scandinavian** | Light, natural, restrained |
| **Memphis / pop** | High-saturation blocks, geometric, 80s |
| **Cyberpunk / vaporwave** | Neon purple-pink, grids, dreamlike |
@@ -135,7 +135,7 @@ The workflow does not silently infer values — before generation it lists these
| Field | Notes |
|-------|-------|
-| **Output scope** | `library` (default; reusable by every project and registered globally) or `project` (thin bundle written directly into one initialized project's template root) |
+| **Output scope** | `library` (default) or `project`; both write the same complete workspace, while only library scope registers it globally |
| **Target project** | Required only for `project`; give the exact initialized project path |
| **Template ID** | Portable template identity; in library scope it is also the directory / index key. Prefer ASCII slug like `acme_consulting`; non-ASCII names work but must be filesystem-safe |
| **Display name** | Human-readable name for documentation |
@@ -152,7 +152,7 @@ The workflow does not silently infer values — before generation it lists these
After 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.**
-For project scope, one more hard preflight runs before any final file is written: the target must already be initialized, its `templates/` root must be empty, and the planned bitmap/icon filenames must not collide with anything already in `images/` or `icons/`. A failed check stops before partial output; the workflow does not merge or overwrite.
+Before either scope writes final files, one hard preflight resolves all four destinations, requires an empty `templates/` root, and rejects bitmap, icon, or preview-PPTX filename collisions in `images/`, `icons/`, `templates/icons/`, and `exports/`. 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.
@@ -174,81 +174,55 @@ This is the most easily confused decision when deriving a template.
**How mirror is consumed**: the Strategist picks one mirror page per project page, and the Executor copies that complete SVG and edits visible text in place while preserving decoration, sprite crops, geometry, and the normalized structured declarations. Mirror preserves supported appearance, not the source PPTX group-editing hierarchy.
-### Step 4 — Validation, registration, and discovery
+### Step 4 — Validation, review export, registration, and discovery
-After generation, both scopes run [`svg_quality_checker.py`](../skills/ppt-master/scripts/svg_quality_checker.py) as a hard gate. What happens next depends on the confirmed output scope:
+After generation, both scopes run [`svg_quality_checker.py`](../skills/ppt-master/scripts/svg_quality_checker.py) as a hard gate and export `exports/<id>_template_preview.pptx`. Open that PPTX to inspect every template page as PowerPoint will present it before relying on the workspace downstream. The only scope-specific action is library registration:
-| Scope | Output | Discovery behavior |
-|---|---|---|
-| `library` (default) | `skills/ppt-master/templates/<kind>/<id>/` | Register in the matching `layouts_index.json` or `decks_index.json` after validation |
-| `project` | Direct `<project>/templates/` bundle; bitmaps in `<project>/images/`; extracted icons in both `<project>/templates/icons/` and `<project>/icons/` | Skip every global index and library README update |
+| Scope | Workspace root | Preview | Discovery behavior |
+|---|---|---|---|
+| `library` (default) | `skills/ppt-master/templates/<kind>/<id>/` | `exports/<id>_template_preview.pptx` | Register in the matching `layouts_index.json` or `decks_index.json` after validation and preview export |
+| `project` | `projects/<name>/` | `exports/<id>_template_preview.pptx` | Skip global index registration |
-Library registration makes the template **discoverable** — when someone asks "what templates are available?", the AI lists it from the index. To use it in a new project, follow the SKILL.md Step 3 rule: name its directory path in your first message, e.g. `use this template: skills/ppt-master/templates/layouts/<your_template_id>/`. A project-scoped template is intentionally private to that project and is consumed in place through the explicit `<project>/templates/` path.
+Library registration makes the template **discoverable** — when someone asks "what templates are available?", the AI lists it from the index. To use either scope, follow the SKILL.md Step 3 rule: name the workspace root in your first message, for example `use this template: skills/ppt-master/templates/layouts/<your_template_id>/` or `use this template: projects/<name>/`. A project workspace can also be migrated or reused elsewhere because its core shape is identical; register it only if it is placed in the library and should appear in discovery.
When a deck/layout template is selected, the Strategist confirmation stage asks how it should be used:
- **adaptive** — choose one template SVG per page; keep its Master and assign a new explicit Layout key during authoring when fixed Layout atoms or slot topology/bounds must change
- **strict** — choose one template SVG per page and keep its Master/Layout/slot contract unchanged
-### What a derived template looks like
-
-Library scope (the default) remains a self-contained package:
-
-```
-skills/ppt-master/templates/layouts/<your_template_id>/
-├── design_spec.md # design spec; §VI lists every page
-├── 01_cover.svg
-├── 02_chapter.svg
-├── 02_toc.svg # optional
-├── 03_content.svg
-├── 03a_content_two_col.svg # variant in fidelity mode
-├── 04_ending.svg
-├── logo.png # brand asset
-└── bg_pattern.jpg
-```
-
-`standard` and `fidelity` SVGs use a unified authoring-placeholder vocabulary (`{{TITLE}}`, `{{CHAPTER_TITLE}}`, `{{PAGE_TITLE}}`, `{{CONTENT_AREA}}`, ...). Each native slot is a top-level `<g>` with semantic type and positive bounds; a normal slot contains exactly one carrier. Fixed Master/Layout visuals are direct root atoms and never layer `<g>` elements. A Layout may intentionally expose zero slots.
+### What a derived template workspace looks like
-A `mirror` template emits one SVG per source slide, named by source order. It may keep literal example text instead of `{{...}}` markers, but imported native slots still carry semantic metadata:
+Library and project scopes use the same core structure; substitute either `skills/ppt-master/templates/<kind>/<id>/` or `projects/<name>/` for `<template_workspace>`:
```
-skills/ppt-master/templates/layouts/<your_template_id>/
-├── design_spec.md # frontmatter sets replication_mode: mirror; §V Page Roster describes every page in detail
-├── 001_cover.svg
-├── 002_toc.svg
-├── 003_content.svg
-├── 004_content.svg
-├── ...
-├── 049_content.svg
-├── 050_ending.svg
-└── *.png / *.jpg
-```
-
-Project scope writes a thin bundle directly into the initialized project's existing roots. It does not create `<project>/templates/<template_id>/`:
-
-```
-projects/<project>/
+<template_workspace>/
├── templates/
│ ├── design_spec.md
│ ├── 01_cover.svg
│ ├── 02_chapter.svg
+│ ├── 02_toc.svg # optional
│ ├── 03_content.svg
+│ ├── 03a_content_two_col.svg # fidelity variant
│ ├── 04_ending.svg
-│ └── icons/ # package/validation copy
+│ └── icons/ # package/validation copy when used
├── images/
-│ └── *.png / *.jpg # SVG references use ../images/<name>
-└── icons/
- └── *.svg # runtime copy of extracted icons
+│ └── *.png / *.jpg # SVG references use ../images/<name>
+├── icons/
+│ └── *.svg # runtime copy of extracted vectors
+└── exports/
+ └── <id>_template_preview.pptx
```
-### Project-level customization vs global template
+`standard` and `fidelity` SVGs use a unified authoring-placeholder vocabulary (`{{TITLE}}`, `{{CHAPTER_TITLE}}`, `{{PAGE_TITLE}}`, `{{CONTENT_AREA}}`, ...). Each native slot is a top-level `<g>` with semantic type and positive bounds; a normal slot contains exactly one carrier. Fixed Master/Layout visuals are direct root atoms and never layer `<g>` elements. A Layout may intentionally expose zero slots.
+
+A `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.
-Choose the output scope according to ownership:
+### Library registration vs project placement
-- **Library scope (`library`, default)** = enter `skills/ppt-master/templates/<kind>/<id>/`, register globally, and make the package available to future projects
-- **Project scope (`project`)** = create the same validated template contract directly under `projects/<project>/templates/`, keep its runtime images/icons beside that project, and skip global registration
+- **Library scope (`library`, default)** writes the workspace under `skills/ppt-master/templates/<kind>/<id>/` and registers it globally.
+- **Project scope (`project`)** writes the same complete workspace at `projects/<name>/` and skips registration.
-`/create-template` supports both. Project scope is the safe route when the template exists only to drive the current deck; it still gets the normal brief, explicit Master/Layout metadata, and template validation without polluting the global library. Choose library scope when another project must consume the result.
+The result is not a private or reduced project-only format. You can point Step 3 at either workspace root, copy the complete core workspace between roots, or migrate a project result into the library without restructuring it. If it moves into the library, run registration so discovery reflects its new location.
---
diff --git a/docs/why-ppt-master.md b/docs/why-ppt-master.md
index c7aa49cb..b2a22753 100644
--- a/docs/why-ppt-master.md
+++ b/docs/why-ppt-master.md
@@ -1,6 +1,6 @@
# Why PPT Master
-[English](./why-ppt-master.md) | [中文](./zh/why-ppt-master.md)
+[English](./why-ppt-master.md) | [Chinese](./zh/why-ppt-master.md)
---
diff --git a/docs/zh/faq.md b/docs/zh/faq.md
index 59e3458f..4f82408d 100644
--- a/docs/zh/faq.md
+++ b/docs/zh/faq.md
@@ -256,13 +256,13 @@ beautify 和主管线的一句话判别:**原来的分页是要保留的信息
- 期望的风格基调和配色(如"现代克制、深蓝主色调")
- 类别偏好(`brand` 品牌 / `general` 通用 / `scenario` 场景 / `government` 政务 / `special` 特殊)
- 画布格式(默认 16:9,如需其他格式请注明)
-- 输出范围:进入索引的 `library`(默认)或一个已经初始化的 `project`
+- 输出范围:进入索引的 `library`(默认)或一个已经初始化的 `project`;两者使用相同的完整工作区结构
不需要一次提供所有细节——AI 代理会通过对话追问补齐缺失信息(输出范围、模板 ID、主题模式等)。
**第三步 — 等待完成**
-AI 代理会自动完成后续工作——分析截图、构建布局定义并验证模板。`library` 范围会完成全局注册,使其进入模板发现;`project` 范围则把薄模板直接写入该项目的 `templates/` 根目录,并明确跳过全局注册。
+AI 代理会自动完成后续工作——分析截图、构建布局定义、验证模板,并导出 `exports/<id>_template_preview.pptx`,方便在 PowerPoint 中直观看模板效果。两种范围都包含相同的 `templates/`、`images/`、`icons/` 与 `exports/` 核心结构:`library` 写入 `skills/ppt-master/templates/<kind>/<id>/` 并完成全局注册;`project` 写入 `projects/<name>/` 并跳过注册。把这个工作区根目录交给 Step 3 即可。旧式平铺包仍可把 `design_spec.md` 放在根目录,目录平铺本身不要求恢复结构。由于新工作区形态一致,完整结果可在两个位置之间迁移或复用,无需重新组织目录。
> **提示**:对风格和使用场景描述得越具体,生成的模板就越符合你的预期。
diff --git a/docs/zh/getting-started.md b/docs/zh/getting-started.md
index eb64eabb..cd7de47a 100644
--- a/docs/zh/getting-started.md
+++ b/docs/zh/getting-started.md
@@ -31,18 +31,18 @@
你:用 /create-template 把这个复刻成模板:projects/brand/our_deck.pptx
```
-这会跑 `pptx_template_import.py`,把文件重建成可复用的资产包——版式 SVG + `design_spec.md` + 抽取出的主题色、字体、图片。生成时引用的就是这个资产包。
+这会跑 `pptx_template_import.py`,把文件重建成可复用工作区——版式 SVG + `design_spec.md` + 抽取出的主题色、字体、图片。它还会导出 `exports/<id>_template_preview.pptx`,方便先在 PowerPoint 里判断模板还原效果。生成时引用的是工作区根目录。
-在 create-template brief 中选择 `library`(沿用原默认)或 `project`。项目范围要求给出已初始化的目标项目;写入前统一检查模板根目录和素材文件名,再把 bundle 直接安装到该项目,不做全局注册。
+在 create-template 简报中选择 `library`(沿用原默认)或 `project`。两种范围都会创建完整且相同的 `templates/`、`images/`、`icons/` 与 `exports/` 工作区。项目范围要求给出已初始化的目标项目;只有全局库范围会执行注册。
复刻出的模板可以放在两个位置之一:
| 位置 | 路径 | 说明 |
|---|---|---|
-| **注册进 skill 库** | `skills/ppt-master/templates/layouts/<id>/` | 全局,所有项目可复用;跑 `register_template.py` 后,问"有哪些模板"时会被列出来 |
-| **放进项目里** | `projects/<project>/templates/` | 只归属该项目;原地消费,无需注册 |
+| **注册进 skill 库** | `skills/ppt-master/templates/<kind>/<id>/` | 完整工作区并执行全局注册;问“有哪些模板”时会被列出来 |
+| **放在 projects 下** | `projects/<name>/` | 相同的完整工作区,不执行全局注册 |
-全局库 package 在生成时靠对话里给出**目录路径**来引用;项目范围 create-template 可在同一对话里把已验证的精确路径直接交给 Step 3。两种情况都以路径为准,绝不认裸模板名。若要把项目范围设计复用于另一个项目,应重新以 `library` 范围创建,因为图片/图标池位于原项目模板根目录的同级位置。
+两种结果都通过对话里给出**工作区根目录路径**来引用。Step 3 会解析 `templates/design_spec.md`;为兼容旧包,也接受 `design_spec.md` 直接位于所给根目录的平铺形态。create-template 可在同一对话里把已验证的精确工作区根目录直接交给 Step 3。两种情况都以路径为准,绝不认裸模板名。完整工作区可以在全局库与 `projects/` 之间复制或迁移,无需调整目录结构;只有全局库注册不同。
```
你:用 sources/report.pdf 做 deck,模板用 skills/ppt-master/templates/layouts/academic_defense/
diff --git a/docs/zh/roadmap.md b/docs/zh/roadmap.md
index 624a31ea..4f9b6d7e 100644
--- a/docs/zh/roadmap.md
+++ b/docs/zh/roadmap.md
@@ -84,7 +84,7 @@
- **`--native-objects` 从休眠 marker 硬化为可用级 opt-in** — 那条窄「原生对象」例外(见下文 Non-goals)现在导出的图表与纯文本表格会**保留 deck 自己的设计**,不再塌回 PowerPoint 的白底默认主题。classic 原生图表显式写入 chart-area / plot-area / 轴线 / 网格线 / 标签文字颜色——从可见的 SVG fallback 推断(最大面板型 `<rect>` → 背景、fallback 文字 → 标签、fallback 描边 → 轴线/网格),或用 `style` 显式覆盖(`chart_area_fill` / `plot_area_fill` / `text_color` / `axis_color` / `grid_color`,`"none"` 表透明);颜色解析把命名色、`#RGB` 简写、`rgb()` / `rgba()` 归一为 OOXML hex;bar/column 系列关掉负值反色,负值柱保持系列色。激活导出命名为 `<name>_<ts>_native_charts.pptx` 以与默认压平形状导出区分。**默认路线不变**——图表/表格仍以 SVG 派生的 DrawingML 形状导出以保跨渲染器保真;原生对象仍是下文 Non-goals 里那条刻意的 opt-in 取舍
-- **原生 package 结构 + 保守 PPTX 对象回转** — 自由设计的 baseline 只提升安全共享背景/chrome,分配文件名页型 Layout,并可进一步提升家族内完全一致的前置 chrome,不推断 placeholder。模板路线确定性编译完整 SVG 中显式声明的 Master/Layout/placeholder,并把锁定 title/body 字号写入母版 `p:txStyles`,不改变页面直接 run 字号。`create-template` 只把源结构当分析输入并统一重建显式 SVG;`strict` 保持所选 Layout,`adaptive` 可在同一 Master 下新建 Layout。默认 `library` 输出继续进入全局索引,`project` 输出则把同一薄模板合同直接安装到一个已初始化项目的模板根目录,不做全局注册。旧 `preserve` 仅保留兼容读取;原始 PPTX 的一次性回填仍走 `template-fill-pptx`。
+- **原生 package 结构 + 保守 PPTX 对象回转** — 每个新 SVG 页面在创作时就声明最终 Master/Layout 身份。固定 Master/Layout 视觉是根级原子,可复用槽位是带真实 carrier 或显式 composite proxy 的有界顶层 group,零槽位 Layout 也合法。导出只确定性编译该合同,把锁定 title/body 字号写入母版 `p:txStyles`,并执行最终 package 回读;不提升重复 chrome,也不推断 placeholder。`create-template` 只把源结构当分析输入并统一重建显式 SVG;`strict` 保持所选 Layout,`adaptive` 可在同一 Master 下新建 Layout。`library` 与 `project` 输出统一采用完整的 `templates/` + `images/` + `icons/` + `exports/<id>_template_preview.pptx` 工作区结构,仅全局注册不同。旧 baseline/template/preserve SVG 包先运行 `restore-pptx-structure`;原始 PPTX 的一次性回填仍走 `template-fill-pptx`。
---
diff --git a/docs/zh/technical-design.md b/docs/zh/technical-design.md
index 7366d385..77f93640 100644
--- a/docs/zh/technical-design.md
+++ b/docs/zh/technical-design.md
@@ -24,7 +24,7 @@
[创建项目] → project_manager.py init <项目名> --format <格式>
↓
[模板 / 品牌 / 布局(可选)] — 默认跳过,直接自由设计
- 仅在用户提供明确模板目录路径且其中 design_spec.md 声明 kind: brand/layout/deck 时触发
+ 仅在用户提供明确的 Layout/Deck 工作区根目录或直接 Brand/旧包路径时触发
原生 PPTX 模板请求进入 template-fill;可复用 SVG 模板需先通过 create-template 创建
↓
[Strategist] 策略师 - 三阶段策略师确认与设计规范 → design_spec.md + spec_lock.md
@@ -98,8 +98,8 @@
| 原生 PPTX 模板 + 新材料 / 新主题 | `template-fill-pptx` | 克隆并填充原生页面;不生成 SVG |
| 现有 PPTX,页数 / 页序 / 措辞 1:1 保留,只改善排版 | `beautify-pptx` | 通过 SVG 重新生成;内容和分页锁定 |
| 已完成 PPTX,保持内容 / 布局稳定,只加讲稿、音频、计时、转场 | `native-enhance-pptx` | 直接 OOXML patch;不重新设计 |
-| 用户想从 PPTX 或设计参考构建可复用模板包 | `create-template` 或 `create-brand` | 输出后续能触发 Step 3 的目录 |
-| 用户提供明确的 `templates/.../<id>/` 目录且声明 `kind: brand/layout/deck` | 主 SVG 流水线 Step 3 | Deck/Layout SVG 必须满足当前 structured 合同;旧包先运行 `restore-pptx-structure` |
+| 用户想从 PPTX 或设计参考构建可复用模板工作区 | `create-template` 或 `create-brand` | 输出后续能触发 Step 3 的工作区根目录;create-template 还会导出审阅 PPTX |
+| 用户提供明确模板路径 | 主 SVG 流水线 Step 3 | 当前 Layout/Deck 工作区解析 `templates/design_spec.md`;Brand 与旧式平铺包解析根目录 `design_spec.md`;只有旧 SVG 语义才恢复结构 |
| 用户要求调整对象级动画顺序 / 效果 / 计时 | `customize-animations` | 通过 `animations.json` 控制可选导出策略 |
| 用户要求预览、选择、注解或重导出浏览器编辑 | `live-preview` | 浏览器工作流;注解只在规定交接点应用 |
@@ -263,7 +263,19 @@ PPT Master 不只服务 PPT——同一套 SVG → DrawingML 流水线还能产
**为什么默认自由设计。** 模板是地板,但很容易变成天花板:它会把整个 deck 锁进模板自有的视觉惯用语,无视内容本身想要怎样被呈现。自由设计的布局从源内容的结构推导而来,而不是从一套固定语法套上去——视觉节奏跟着内容走,而不是跟内容打架。约束模式在窄场景里确实更好(品牌锁定的 deck、强类型场景如学术答辩或政府报告),所以它一直在;但 AI 不主动去抓,是用户去抓。
-**机械触发,不做语义匹配。** 像 `academic_defense` 这样的裸名字、品牌提及,或“麦肯锡风格”这类风格短语,即使库里存在相似目录,也不会触发 Step 3。Step 3 只消费一个能解析为目录的路径,并且该目录的 `design_spec.md` 必须声明 `kind: brand`、`kind: layout` 或 `kind: deck`。发现性交给模板索引和显式问答(“有哪些模板可以用?”),不交给运行时 fuzzy matching。
+**机械触发,不做语义匹配。** 像 `academic_defense` 这样的裸名字、品牌提及,或“麦肯锡风格”这类风格短语,即使库里存在相似目录,也不会触发 Step 3。Step 3 只消费显式路径。当前 Layout/Deck 工作区解析 `templates/design_spec.md`;Brand 包维持根目录 `design_spec.md` 合同,兼容的旧式平铺 Layout/Deck 包也从根目录读取。目录平铺本身不是恢复理由;只有旧 Master/Layout/placeholder 语义才触发 `restore-pptx-structure`。发现性交给模板索引和显式问答(“有哪些模板可以用?”),不交给运行时 fuzzy matching。
+
+新建 Layout/Deck 在两种位置都采用同一物理合同:
+
+```text
+<template_workspace>/
+├── templates/ # design_spec.md、SVG 原型,以及使用时的 templates/icons/
+├── images/ # 位图素材,SVG 统一引用 ../images/<name>
+├── icons/ # 提取向量素材的运行期副本
+└── exports/ # <id>_template_preview.pptx
+```
+
+`<template_workspace>` 可以是 `skills/ppt-master/templates/<kind>/<id>/`,也可以是 `projects/<name>/`。Step 3 接收这个根目录。工作区可在两个位置之间迁移而不改形;唯一的范围差异是全局索引注册,`exports/` 只作为审阅证据,不参与模板输入。
三类模板拥有不同的设计契约片段:
@@ -275,7 +287,7 @@ PPT Master 不只服务 PPT——同一套 SVG → DrawingML 流水线还能产
当用户提供多个路径时,融合是**片段级**而不是字段级:brand 覆盖身份片段,layout 覆盖结构片段,deck 提供中间的 template overview 片段。同类冲突会被显式列为冲突,而不是按输入顺序默默决定。这样融合后的 spec 能明确说明每个片段来自哪里,便于审计和复现。
-**原生 PPTX 模板不属于 Step 3。** `.pptx` 可以作为源材料进入流水线,PPTX intake 也能抽取其身份和几何信息。但“给一个原生 PPTX 模板并生成新 PPTX”的请求会进入 `template-fill`,因为用户期望的是克隆 PowerPoint 页面壳并替换文本 / 表格 / 图表。SVG 路线只能消费可复用模板包;如果要把某个 PPTX 的设计语言用于 SVG 路线,必须先通过 `create-template` 生成模板目录,再把该目录路径提供给 Step 3。
+**原生 PPTX 模板不属于 Step 3。** `.pptx` 可以作为源材料进入流水线,PPTX intake 也能抽取其身份和几何信息。但“给一个原生 PPTX 模板并生成新 PPTX”的请求会进入 `template-fill`,因为用户期望的是克隆 PowerPoint 页面壳并替换文本 / 表格 / 图表。SVG 路线只能消费可复用模板工作区;如果要把某个 PPTX 的设计语言用于 SVG 路线,必须先通过 `create-template` 生成工作区,再把工作区根目录路径提供给 Step 3。
**布局是 opt-in,图表和图标不是。** 这种不对称不是矛盾——*布局*正是锁定视觉惯用语的那一层(地板/天花板问题),而图表和图标是不会施加 deck 级风格约束的复用原语。同一个 `templates/` 目录,但在视觉契约里扮演的角色不同。
@@ -450,7 +462,7 @@ PowerPoint 的 DrawingML 是 SVG 表达力的严格子集。在转换器已实
**为什么是逐元素派发而不是整体翻译。** SVG 的层级模型干净地映射到 DrawingML 的 group / shape / picture 类型——不需要一个全局优化器去重新规划幻灯片。每种形状都有自己窄的翻译器,简单到能单独调试和单元测试。一张幻灯片的最终质量等于这些独立局部转换之和;这个性质在整体翻译下脆弱,在元素派发下稳健。
-**为什么只有项目转换器产出的 native PPTX。** Native 导出把 `svg_output/` 中受支持的 SVG 元素逐个翻译成 DrawingML 形状;这是唯一受支持的 SVG→PPTX 路线。`svg_final/` 仍由强制后处理生成,但只承担自包含视觉预览和 SVG 图片插入,不会再被封装成另一份 PPTX,也不为 PowerPoint 手工“转换为形状”提供兼容兜底。
+**为什么只有一条 PPTX 编译路线。** Native 导出把作者 SVG 中受支持的元素逐个翻译成 DrawingML 形状。常规 deck 路线读取 `svg_output/`;create-template 对通过校验的模板原型调用同一 structured 编译器,生成 `exports/<id>_template_preview.pptx` 作为审阅证据。项目不会把整页 SVG 媒体或另一套位图渲染打包成第二类 PPTX。`svg_final/` 仍由常规 deck 的强制后处理生成,但只承担自包含视觉预览和 SVG 图片插入,不为 PowerPoint 手工“转换为形状”提供兼容兜底。
**为什么结构必须在视觉生成前确定。** Master 和 Layout 不是后处理阶段才发现的结果。Strategist 在 SVG 生成前写出 Master roster 和完整页面 mapping;Executor 在构图时同步写入这些身份、固定原子元素和槽位。这样,自由设计在视觉层面仍然开放,PowerPoint 归属却从一开始就是显式合同。导出器只编译声明;旧项目或 unmapped 项目进入 `restore-pptx-structure`,不会触发导出期启发式推断。
@@ -468,7 +480,7 @@ PowerPoint 的 DrawingML 是 SVG 表达力的严格子集。在转换器已实
**为什么可复用模板要重建来源拓扑。** `pptx_template_import.py` 输出分层 Master/Layout/Slide 参考和 native 结构事实;`create-template` 重建每一个来源 Master 和 Layout,包括未使用 Layout,并生成完整注释 SVG 原型。来源 Master/Layout group 被原子化;父子关系、选择器名称、placeholder 身份和 bounds 在模板规格中保持可审计。原 PPTX 只是分析输入,不再成为打包依赖。
-**为什么项目本地薄模板只是输出政策,不是另一种结构模式。** `create-template` 仍以写入索引的 `library` 为默认,也可把同一份已校验合同直接写入已初始化项目的 `templates/` 根目录。项目位图进入 `images/`,抽取图标保留 package 副本与运行时副本,且不修改全局索引。两种范围都使用同一 `structured` 合同。
+**为什么 create-template 在两种范围都使用同一工作区形态。** `create-template` 仍以写入索引的 `library` 为默认,也可写入已初始化项目。两种根目录都包含相同的 `templates/`、`images/`、`icons/` 与 `exports/` 核心结构,包括 `<id>_template_preview.pptx`;SVG 素材引用也完全一致。因此完整工作区可直接迁移和复用,不需要全局库专用 package 分支或缩减的项目分支。唯一范围差异是全局索引注册,两种范围都使用同一 `structured` 合同。
**为什么模板 SVG 保持完整却仍能编译成原生结构。** 模板 SVG 会重复携带继承的 Master/Layout 视觉和示例 Slide 内容,因此可独立打开。生成时由 `page_layouts` 选择该原型,输出 SVG 仍保持视觉闭包。导出器移除重复继承原子、生成真实 Master/Layout part,并把槽位 carrier 与 Slide-local 内容留在 Slide。
@@ -527,7 +539,7 @@ ChartEx 导入被有意限制为 7 个已验证数据模型:`treemap`、`sunbu
| `topic-research` | 用户只有主题、没有源材料 | 在 Step 1 前收集网络材料 |
| `template-fill-pptx` | 原生 PPTX 模板 + 新材料 / 新主题 | 直接克隆并填充原生页面;不进入 SVG 流水线 |
| `beautify-pptx` | 现有 PPTX,页数/页序/措辞必须 1:1 保留,只改善排版 | 锁定源身份与内容后,通过 SVG 流水线重新生成 |
-| `create-template` | 构建可复用 layout/deck 模板包 | 输出后续 Step 3 可消费的目录 |
+| `create-template` | 构建可复用 layout/deck 模板工作区 | 输出可移植工作区根目录与 `exports/<id>_template_preview.pptx`;只有全局库范围执行注册 |
| `create-brand` | 提取或定义可复用品牌身份 | 输出 `templates/brands/<id>/` |
| `resume-execute` | 规划会话后新开聊天,用户要求继续某项目 | 不重跑 Strategist,直接进入执行会话 |
| `refine-spec` | 用户明确要求生成前先审阅 / 修改 spec | 写出完整 spec/lock 后停下,用户修改后再恢复 |
diff --git a/docs/zh/templates-architecture.md b/docs/zh/templates-architecture.md
index 60b53869..b24c97df 100644
--- a/docs/zh/templates-architecture.md
+++ b/docs/zh/templates-architecture.md
@@ -8,13 +8,13 @@
## 一、三分类
-| 分类 | 全局库范围目录 | 写什么 | 不写什么 | 出处工作流 |
+| 分类 | 全局库工作区根目录 | 写什么 | 不写什么 | 出处工作流 |
|---|---|---|---|---|
| **Brand** | `templates/brands/<id>/` | 仅身份段:color / typography / logo / voice / icon style | 不写 canvas、page structure、SVG roster | `workflows/create-brand.md` |
| **Layout** | `templates/layouts/<id>/` | 仅结构段:canvas / page structure / page types / SVG roster | 不写品牌身份(无 logo、无品牌色硬约束) | `workflows/create-template.md`(layout 分支)|
| **Deck** | `templates/decks/<id>/` | 全段:身份段 + 结构段 + 中间段(template overview) | —— | `workflows/create-template.md`(deck 分支,默认)|
-每张新建或已恢复的 Layout/Deck SVG 都是完整预览,并在根节点声明 Master/Layout key 与选择器名称;固定 Master/Layout 视觉是直接原子元素;语义槽位是顶层 group。普通槽位必须有正数设计区域 bounds 和恰好一个兼容 carrier;复合 `object` 区域走显式 proxy 绑定,零槽 Layout 也合法。这些专用标记具有最高优先级;最小 `data-pptx-role` 只补充它们无法表达的页面框架行为。PPTX 导入产物只用于分析,不进入新模板包。下游 `strict` 保持所选 Layout 契约,`adaptive` 保持 Master 并可在创作时建立新 Layout 身份;两者都使用 `pptx_structure.mode: structured`。旧包必须先运行 `restore-pptx-structure`。
+每张新建或已恢复的 Layout/Deck SVG 都是完整预览,并在根节点声明 Master/Layout key 与选择器名称;固定 Master/Layout 视觉是直接原子元素;语义槽位是顶层 group。普通槽位必须有正数设计区域 bounds 和恰好一个兼容 carrier;复合 `object` 区域走显式 proxy 绑定,零槽 Layout 也合法。这些专用标记具有最高优先级;最小 `data-pptx-role` 只补充它们无法表达的页面框架行为。PPTX 导入产物只用于分析,不进入新模板包。下游 `strict` 保持所选 Layout 契约,`adaptive` 保持 Master 并可在创作时建立新 Layout 身份;两者都使用 `pptx_structure.mode: structured`。只有使用旧 Master/Layout 语义的包才必须先运行 `restore-pptx-structure`;旧包把 `design_spec.md` 平铺在根目录仍属于受支持的兼容目录形态,目录平铺本身不触发恢复。
三者是**三种并列的 reference bundle**。在全局库范围内,物理目录与 frontmatter `kind` 字段双向对齐:
@@ -27,14 +27,14 @@ kind: brand
...
---
-# templates/layouts/academic_defense/design_spec.md
+# templates/layouts/academic_defense/templates/design_spec.md
---
kind: layout
native_structure_mode: structured
...
---
-# templates/decks/招商银行/design_spec.md
+# templates/decks/招商银行/templates/design_spec.md
---
kind: deck
native_structure_mode: structured
@@ -44,16 +44,32 @@ native_structure_mode: structured
### 输出范围与 kind 相互独立
-`create-template` 会确认 Layout/Deck 契约归属于哪里。这个执行选择不会增加第四种 kind,也不会增加新的 PPTX 结构模式:
+`create-template` 会确认 Layout/Deck 工作区放在哪里。这个执行选择不会增加第四种 kind,也不会增加新的 PPTX 结构模式:
-| 范围 | 最终位置 | 素材分流 | 发现行为 |
+| 范围 | 工作区根目录 | 核心结构 | 发现行为 |
|---|---|---|---|
-| `library`(默认) | `skills/ppt-master/templates/<kind>/<id>/` | 自包含 package,包括 package 内位图和 `icons/` | 写入对应全局索引 |
-| `project` | 直接写 `<target_project>/templates/` 根目录,禁止再套 `<id>/` | spec / SVG / 非位图 package 资产在 `templates/`;位图在 `images/`,SVG 用 `../images/<name>`;提取图标同时复制到 `templates/icons/` 与运行期 `icons/` | 不更新全局索引与库 README |
+| `library`(默认) | `skills/ppt-master/templates/<kind>/<id>/` | `templates/` + `images/` + `icons/` + `exports/` | 写入对应全局索引 |
+| `project` | `projects/<name>/` | 完全相同的 `templates/` + `images/` + `icons/` + `exports/` 契约 | 不更新全局索引 |
+
+两种根目录都保持相同的核心形态:
+
+```text
+<template_workspace>/
+├── templates/
+│ ├── design_spec.md
+│ ├── *.svg
+│ └── icons/ # 使用时保留 package / 校验副本
+├── images/ # 所有位图;SVG 统一引用 ../images/<name>
+├── icons/ # 提取向量素材的运行期副本
+└── exports/
+ └── <id>_template_preview.pptx
+```
+
+预览 PPTX 是派生的审阅证据,不是模板源资产。Step 3 读取工作区根目录,只消费 `templates/`、`images/` 与 `icons/`,不会复制或使用 `exports/`。
-项目范围仍在可移植 frontmatter 中保留 `kind: layout` 或 `kind: deck`。`output_scope` 与 `target_project` 只属于工作流简报,不写入 `design_spec.md`。
+两种范围都在可移植 frontmatter 中保留 `kind: layout` 或 `kind: deck`。`output_scope` 与 `target_project` 只属于工作流简报,不写入 `design_spec.md`。
-项目范围第一次写最终文件前,必须一次性确认目标项目已初始化、`templates/` 根目录为空,并检查全部计划写入的图片/图标文件名无冲突。任一失败都在写入前停止,不合并、不覆盖。
+任何范围第一次写最终文件前,都必须解析工作区根目录、确认 `templates/` 为空,并检查全部计划写入的图片、图标与预览 PPTX 文件名无冲突。项目范围还必须确认目标项目已初始化。任一失败都在写入前停止,不合并、不覆盖。
### 三段的字段切分
@@ -170,7 +186,7 @@ primary_color: "<HEX>"
每个 index 跟物理目录一一对应,字段按需精简(参照 [[project-charts-index-full-read-intentional]] 的"meta + summary"模式,但保留对 Strategist 选型有用的结构化元数据)。
-三套索引只覆盖全局库范围。项目范围模板有意不进入任何索引,仍可通过显式 `<project>/templates/` 路径使用。
+三套索引只覆盖全局库范围。项目根工作区有意不进入任何索引,仍可通过显式 `projects/<name>/` 路径使用。因为两种范围采用相同工作区形态,完整核心工作区可在两者之间移动或复制,不需要重写素材路径;只有全局库注册不同。
### `templates/brands/brands_index.json`
@@ -281,7 +297,7 @@ AI: 你给了两个 brand,检测到段级冲突:
## 五、与 SKILL.md Step 3 的关系
-**触发规则仍以路径为准**——仍需显式目录路径(见 [[feedback-template-explicit-path-only]]),裸名称绝不触发。复制 Layout/Deck 包之前,Step 3 会验证当前 structured 合同;旧 `native_structure_mode: template`、缺 Master 身份、原子 placeholder 或蒸馏时代的包必须先运行 `restore-pptx-structure`。唯一的窄例外是当前对话刚完成项目范围 `create-template`:验证通过后可把精确的 `<project>/templates/` 输出直接交给 Step 3。`kind` 字段决定**触发后 AI 怎么处理**:
+**触发规则仍以路径为准**——仍需显式工作区根目录路径(见 [[feedback-template-explicit-path-only]]),裸名称绝不触发。Step 3 先解析 `<workspace>/templates/design_spec.md`;为兼容旧包,也接受根目录直接包含 `<workspace>/design_spec.md` 的平铺形态。平铺只是目录兼容,不会触发 `restore-pptx-structure`;只有 SVG 合同仍使用 `native_structure_mode: template`、缺 Master 身份、原子 placeholder 或蒸馏时代标记时才需要恢复。唯一的窄例外是当前对话刚完成 `create-template`:验证通过后可把精确的工作区根目录直接交给 Step 3。`kind` 字段决定**触发后 AI 怎么处理**:
| 用户路径指向 | Step 3 行为(按 kind 分支)|
|---|---|
@@ -291,7 +307,7 @@ AI: 你给了两个 brand,检测到段级冲突:
| 多路径 | 按上表合成单份 `design_spec.md`;SVG 进 `templates/`、位图进 `images/` 合并复制 |
| 同类多份 | 按上节"git 冲突解决"问答,得到合成结果 |
-位图统一进项目 `images/`(和 AI / 网络 / 用户图片同一个运行期图片池,SVG 里走 `../images/`);`templates/` 只放 spec、模板 SVG 与非位图 package 资产。如果显式输入路径本来就是同一项目的 `<project>/templates/` 根目录(即 `create-template` 的项目范围产物),Step 3 原地消费:不得复制到自身,也不得再次移动 `images/` 中的素材。该原地目录是一份完整 bundle,不参与多路径融合。由于图片/图标池位于 `templates/` 的同级目录,它只归属当前项目;跨项目复用必须改用自包含的全局库范围 package。
+位图统一进入工作区 `images/`,模板 SVG 通过 `../images/` 引用。如果显式输入根目录本来就是目标项目根目录,Step 3 原地消费:不得复制到自身,也不得再次移动素材。除此之外,完整核心工作区是可移植的:可以从项目根复制到全局库根、从全局库复制到项目,或从另一个工作区直接复用,而不改变内部结构。注册是唯一与范围相关的步骤。
### 策略师确认阶段在不同 kind 下的收窄
@@ -304,9 +320,9 @@ Deck 路径下用户已经拿到完整方案,策略师确认阶段收窄到"
| 工作流 | 产出 |
|---|---|
| `workflows/create-brand.md` | brand 目录(identity-only),从品牌资产逆向提取 |
-| `workflows/create-template.md` | layout 或 deck 契约。输出范围默认 `library`(`templates/<kind>/<id>/` + 注册),确认 `project` 时直接写 `<project>/templates/`,按项目素材规则分流且不注册。内部 kind 分支仍默认 deck;用户明说"只要结构 / 丢掉品牌色"时走 layout |
+| `workflows/create-template.md` | 完整 layout 或 deck 工作区。输出范围默认 `library`(`templates/<kind>/<id>/` + 注册),确认 `project` 时写 `projects/<name>/`(不注册)。两者具有相同核心目录与预览 PPTX。内部 kind 分支仍默认 deck;用户明说"只要结构 / 丢掉品牌色"时走 layout |
-在全局库范围,frontmatter `kind` 字段决定文件落到 `templates/brands/` / `templates/layouts/` / `templates/decks/`。项目范围保留同一 kind 语义,但 Layout/Deck 直接落在项目模板根目录。
+在全局库范围,frontmatter `kind` 字段决定工作区父目录位于 `templates/brands/` / `templates/layouts/` / `templates/decks/`。项目范围在项目工作区根目录保留同一 kind 语义。完整工作区可在两种范围之间迁移而不改形,只需增加或移除全局索引注册。
---
diff --git a/docs/zh/templates-guide.md b/docs/zh/templates-guide.md
index 046dc3ba..95fb6aac 100644
--- a/docs/zh/templates-guide.md
+++ b/docs/zh/templates-guide.md
@@ -18,13 +18,15 @@ PPT Master 的“模板”是一份**结构 + 风格**的预设包:每张 SVG
### 怎么触发模板流程
-在对话里把模板目录的路径写进去(位置不重要,只要明确即可):
+在对话里写出 Layout/Deck 工作区根目录,或直接 Brand 包路径(位置不重要,只要明确即可):
> "用这个模板做:`skills/ppt-master/templates/layouts/academic_defense/`" ✅
-> "用上次那个模板:`projects/last_deck/templates/`" ✅
+> "用上次那个模板:`projects/last_deck/`" ✅
> "做一份产品介绍,模板用 `/Users/me/Desktop/our_brand_v3/`" ✅
-AI 会把这个目录里的 SVG、`design_spec.md` 和素材安装到项目目录,然后进入 Strategist 阶段。路径可以指向内置库 `skills/ppt-master/templates/layouts/` 下的 package,或其他自包含模板目录。如果该路径本来就是当前项目自己的 `<project>/templates/` 根目录,流程会原地消费,不会再复制到自身。项目范围 create-template 可在同一对话里把这个已验证的精确路径直接交给 Step 3;这是“首条消息显式路径”规则的唯一例外。不要把另一个项目的 `templates/` 根目录当外部 package 使用:其中 `../images/` 与运行期图标引用只归属原项目;应先通过 library 范围提升为自包含 package。
+对于当前 Layout/Deck,这里给的是**模板工作区根目录**。Step 3 会解析其中的 `templates/design_spec.md`,校验 structured SVG 合同,然后把 `templates/`、`images/` 与 `icons/` 安装进目标项目;如果工作区本来就是该项目根目录,则原地消费。路径可以指向 `skills/ppt-master/templates/<kind>/<id>/` 下的内置库工作区、`projects/<name>/` 下的项目工作区,或其他保持同样结构的工作区。Brand 包继续使用根目录 `design_spec.md` 合同。当前对话刚完成 create-template 时,可把精确的已验证工作区根目录直接交给 Step 3;这是“首条消息显式路径”规则的唯一例外。
+
+> **兼容性预检:** Step 3 也接受旧式平铺包,即 `design_spec.md` 与 SVG 直接位于所给根目录。目录平铺本身不需要恢复;只有 SVG 仍使用旧的原子 placeholder / 未映射 Master/Layout 语义时,才先运行 [`restore-pptx-structure`](../../skills/ppt-master/workflows/restore-pptx-structure.md)。Step 3 不会先复制语义旧包、再延后恢复。
### 什么**不会**触发模板流程
@@ -133,7 +135,7 @@ AI 会把这个目录里的 SVG、`design_spec.md` 和素材安装到项目目
| 字段 | 说明 |
|------|------|
-| **输出范围** | `library`(默认;所有项目可复用并进入全局索引)或 `project`(直接写入一个已初始化项目的模板根目录) |
+| **输出范围** | `library`(默认)或 `project`;两者都写完整且相同的工作区,只有 library 会进入全局索引 |
| **目标项目** | 仅 `project` 必填;必须给出已初始化项目的精确路径 |
| **模板 ID** | 模板的可移植身份;在 `library` 下同时也是目录名 / 索引键。优先 ASCII slug,如 `acme_consulting`;中文品牌名也行,但要文件系统安全 |
| **显示名称** | 文档中的人类可读名 |
@@ -150,7 +152,7 @@ AI 会把这个目录里的 SVG、`design_spec.md` 和素材安装到项目目
确认后,工作流会回显一份完整简报并写入标记 `[TEMPLATE_BRIEF_CONFIRMED]`,从这一刻起后续步骤才会启动。**这是一个硬门——简报没确认,不会开始生成**。
-如果选择 `project`,第一次写最终文件前还会做一次完整预检:目标必须已初始化、`templates/` 根目录必须为空、计划写入的位图与图标文件名不得和现有 `images/` / `icons/` 冲突。任一检查失败都会在写入前停止,不合并、不覆盖,也不会留下半套输出。
+无论选择哪种范围,第一次写最终文件前都会做一次完整预检:解析四个目标目录,要求 `templates/` 为空,并检查 `images/`、`icons/`、`templates/icons/` 与 `exports/` 中计划写入的位图、图标和预览 PPTX 文件名没有冲突。项目范围还要求目标项目已经初始化。任一检查失败都会在写入前停止,不合并、不覆盖,也不会留下半套输出。
> 为什么这么严?无论模板进入全局库,还是只服务当前项目,它都是结构契约。先确认归属和几何,可避免半成品或资产落错目录。
@@ -172,81 +174,55 @@ AI 会把这个目录里的 SVG、`design_spec.md` 和素材安装到项目目
**`mirror` 模板怎么消费**:Strategist 为每个项目页选择一张 mirror 参考,Executor 复制完整 SVG 并原位修改可见文字,同时保留装饰、精灵图裁剪、几何坐标和全部 `data-pptx-*` 结构声明。
-### 第四步:验证、注册与发现
+### 第四步:验证、预览导出、注册与发现
-模板生成完,两种范围都会先跑 [`svg_quality_checker.py`](../../skills/ppt-master/scripts/svg_quality_checker.py) 作为硬门。之后按确认的输出范围分流:
+模板生成完,两种范围都会先跑 [`svg_quality_checker.py`](../../skills/ppt-master/scripts/svg_quality_checker.py) 作为硬门,并导出 `exports/<id>_template_preview.pptx`。先打开这份 PPTX,逐页判断模板在 PowerPoint 中的实际样子,再交给后续生成。唯一按范围分流的动作是全局注册:
-| 范围 | 产物 | 发现行为 |
-|---|---|---|
-| `library`(默认) | `skills/ppt-master/templates/<kind>/<id>/` | 验证通过后注册到对应 `layouts_index.json` 或 `decks_index.json` |
-| `project` | 直接写 `<project>/templates/`;位图在 `<project>/images/`;提取图标同时保留在 `<project>/templates/icons/` 与 `<project>/icons/` | 跳过全部全局索引和库 README 更新 |
+| 范围 | 工作区根目录 | 预览 | 发现行为 |
+|---|---|---|---|
+| `library`(默认) | `skills/ppt-master/templates/<kind>/<id>/` | `exports/<id>_template_preview.pptx` | 校验与预览导出后注册到对应 `layouts_index.json` 或 `decks_index.json` |
+| `project` | `projects/<name>/` | `exports/<id>_template_preview.pptx` | 跳过全局索引注册 |
-全局注册让模板**可被发现**——下次有人问"有哪些模板可用?"时,AI 会从索引里把它列出来。要在新项目里用它,仍然按 SKILL.md Step 3 的规则:在第一条消息里把目录路径写出来,例如 `用这个模板:skills/ppt-master/templates/layouts/<your_template_id>/`。项目范围模板有意保持项目私有,直接通过显式 `<project>/templates/` 路径原地消费。
+全局注册让模板**可被发现**——下次有人问“有哪些模板可用?”时,AI 会从索引里把它列出来。两种范围的用法相同:按 SKILL.md Step 3 的规则,在第一条消息里给出工作区根目录,例如 `用这个模板:skills/ppt-master/templates/layouts/<your_template_id>/` 或 `用这个模板:projects/<name>/`。项目工作区也可以迁移或被其他工作区复用,因为核心结构完全一致;只有放进全局库并需要被发现时才执行注册。
选择 Deck/Layout 模板后,Strategist 确认阶段会进一步询问模板的使用方式:
- **适应性使用(adaptive)**——每页都选择一张模板 SVG;没有合适 Layout 时沿用同一 Master 创建新的显式 Layout
- **严格套用(strict)**——每页都选择一张模板 SVG,并保持其 Master/Layout/Placeholder 契约不变
-### 派生后的目录长什么样
+### 派生后的模板工作区长什么样
-全局库范围(默认)保持原有的自包含 package:
+全局库与项目范围使用相同的核心结构。把下面的 `<template_workspace>` 替换为 `skills/ppt-master/templates/<kind>/<id>/` 或 `projects/<name>/` 即可:
```
-skills/ppt-master/templates/layouts/<your_template_id>/
-├── design_spec.md # 设计规范,§VI 列出全部页面
-├── 01_cover.svg
-├── 02_chapter.svg
-├── 02_toc.svg # 可选
-├── 03_content.svg
-├── 03a_content_two_col.svg # fidelity 模式下的变体
-├── 04_ending.svg
-├── logo.png # 品牌素材
-└── bg_pattern.jpg
-```
-
-`standard` 和 `fidelity` 模式下的页面 SVG 里使用统一的占位符约定(`{{TITLE}}`、`{{CHAPTER_TITLE}}`、`{{PAGE_TITLE}}`、`{{CONTENT_AREA}}` 等),策略师阶段会按内容填充。
-
-`mirror` 模板按源页序号每页一张 SVG。它可以保留原示例文字而不写 `{{...}}`,但导入识别出的原生内容槽仍带语义 metadata:
-
-```
-skills/ppt-master/templates/layouts/<your_template_id>/
-├── design_spec.md # frontmatter 设 replication_mode: mirror;§V Page Roster 逐页描述
-├── 001_cover.svg
-├── 002_toc.svg
-├── 003_content.svg
-├── 004_content.svg
-├── ...
-├── 049_content.svg
-├── 050_ending.svg
-└── *.png / *.jpg
-```
-
-项目范围会把薄模板直接写入已初始化项目的现有根目录,不会创建 `<project>/templates/<template_id>/`:
-
-```
-projects/<project>/
+<template_workspace>/
├── templates/
│ ├── design_spec.md
│ ├── 01_cover.svg
│ ├── 02_chapter.svg
+│ ├── 02_toc.svg # 可选
│ ├── 03_content.svg
+│ ├── 03a_content_two_col.svg # fidelity 变体
│ ├── 04_ending.svg
-│ └── icons/ # package / 验证副本
+│ └── icons/ # 使用时的 package / 校验副本
├── images/
-│ └── *.png / *.jpg # SVG 统一引用 ../images/<name>
-└── icons/
- └── *.svg # 提取图标的运行期副本
+│ └── *.png / *.jpg # SVG 统一引用 ../images/<name>
+├── icons/
+│ └── *.svg # 提取向量素材的运行期副本
+└── exports/
+ └── <id>_template_preview.pptx
```
-### 项目级一次性定制 vs 全局模板
+`standard` 和 `fidelity` 模式下的页面 SVG 使用统一的占位符约定(`{{TITLE}}`、`{{CHAPTER_TITLE}}`、`{{PAGE_TITLE}}`、`{{CONTENT_AREA}}` 等)。每个原生槽位都是带语义类型与正数 bounds 的顶层 `<g>`,普通槽位恰好包含一个 carrier;固定 Master/Layout 视觉是根级直接原子元素,绝不使用层级 `<g>`。Layout 可以有意保持零槽位。
+
+`mirror` 工作区使用同一棵目录树,只是把按源页排序的 `001_cover.svg`、`002_toc.svg` 等文件放进 `templates/`。它可以保留原示例文字而不写 `{{...}}`,但导入识别出的原生内容槽仍带语义 metadata。
-按资产归属选择输出范围:
+### 全局注册与项目放置
-- **全局库范围(`library`,默认)** = 进入 `skills/ppt-master/templates/<kind>/<id>/`,写入全局索引,供未来项目复用
-- **项目范围(`project`)** = 把同一份经过验证的模板契约直接写进 `projects/<project>/templates/`,运行期图片/图标留在该项目内,不做全局注册
+- **全局库范围(`library`,默认)**把工作区写入 `skills/ppt-master/templates/<kind>/<id>/`,并完成全局注册。
+- **项目范围(`project`)**把同一份完整工作区写入 `projects/<name>/`,并跳过注册。
-`/create-template` 两种范围都支持。模板只服务当前 deck 时用 `project`:仍然经过完整简报、显式 Master/Layout metadata 与模板校验,但不会污染全局库。另一个项目也要使用时,应选择 `library`。
+项目范围不是私有或缩减格式。Step 3 可以直接接收任一工作区根目录;完整核心工作区也可以在两类根目录之间复制或迁移,无需改形。如果迁入全局库,再执行注册,让发现索引反映新位置。
---
diff --git a/skills/ppt-master/SKILL.md b/skills/ppt-master/SKILL.md
index 1a39c1d6..eb253165 100644
--- a/skills/ppt-master/SKILL.md
+++ b/skills/ppt-master/SKILL.md
@@ -125,10 +125,10 @@ For complete tool documentation, see `${SKILL_DIR}/scripts/README.md`.
| Raw PPTX template plus new material/topic, generate a PPTX | [`template-fill-pptx`](workflows/template-fill-pptx.md) |
| Existing PPTX, preserve page count/order and slide wording 1:1, improve layout | [`beautify-pptx`](workflows/beautify-pptx.md) |
| Existing PPTX as source material, rethink outline or change page count/order | Main pipeline via `source_to_md.py` plus PPTX intake |
-| Build a reusable template package from a PPTX/design reference | [`create-template`](workflows/create-template.md), then return with the generated template directory path |
+| Build a reusable template package from a PPTX/design reference | [`create-template`](workflows/create-template.md), then return with the generated template workspace path |
| Finished PPTX, keep content/layout stable and add notes/audio/timing/transitions | [`native-enhance-pptx`](workflows/native-enhance-pptx.md) |
-**MUST**: Raw `.pptx` template plus "generate PPTX" routes to `template-fill-pptx` by default. The SVG generation route consumes only an explicit template directory path that already contains a valid template `design_spec.md`.
+**MUST**: Raw `.pptx` template plus "generate PPTX" routes to `template-fill-pptx` by default. The SVG generation route consumes only an explicit template workspace path with a valid `templates/design_spec.md`, or a supported direct/legacy package root with `design_spec.md`.
**MUST**: Beautify is strictly 1:1. Any split, merge, drop, reorder, or page-count change routes to the main pipeline.
@@ -219,21 +219,21 @@ Multi-deck: several PPTX files may be imported into one main-pipeline project
**Default — free design.** Proceed directly to Step 4. Do NOT query any `*_index.json` unless triggered. Do NOT ask the user. Do NOT proactively suggest, hint at, or fuzzy-match any template based on content, slug-like words, or vague style descriptions.
-**Hard boundary — raw PPTX template references are not Step 3 templates.** PPTX-as-source remains valid in Step 1 / Step 2, and raw PPTX template + generated PPTX routes to `template-fill`. But if the user wants the SVG/template-based generation route from that PPTX, stop before Step 3. The user must first run [`workflows/create-template.md`](workflows/create-template.md), then return with the generated template directory path. Step 3 only consumes an explicit template directory that already contains `design_spec.md` with `kind: brand` / `kind: layout` / `kind: deck`.
+**Hard boundary — raw PPTX template references are not Step 3 templates.** PPTX-as-source remains valid in Step 1 / Step 2, and raw PPTX template + generated PPTX routes to `template-fill`. But if the user wants the SVG/template-based generation route from that PPTX, stop before Step 3. The user must first run [`workflows/create-template.md`](workflows/create-template.md), then return with the generated template workspace path. Step 3 consumes an explicit workspace whose `templates/design_spec.md` declares `kind: layout` / `kind: deck`, a direct brand package, or a legacy flat package whose root `design_spec.md` declares one of those kinds.
Do **not** reinterpret this boundary as 1:1 redesign or free SVG generation. Use `template-fill` for raw PPTX template + generated PPTX requests; use `beautify` only when the source deck's page count, order, and wording are preserved.
-**Template flow triggers ONLY on explicit directory paths** supplied by the user in their initial message, plus one narrow workflow handoff: a project-scoped `create-template` run in the current conversation may pass its exact validated `<project>/templates/` output directly into this Step. The trigger rule is mechanical, not interpretive:
+**Template flow triggers ONLY on explicit directory paths** supplied by the user in their initial message, plus one narrow workflow handoff: a project-scoped `create-template` run in the current conversation may pass its exact validated project workspace root directly into this Step. The trigger rule is mechanical, not interpretive:
| User input contains | Step 3 action |
|---|---|
-| One or more explicit template directory paths (each resolves to a directory containing `design_spec.md` with `kind: brand` / `kind: layout` / `kind: deck` in its YAML frontmatter) | Read each spec's `kind`, dispatch per the kind matrix below, fuse if multiple |
-| Current `create-template` workflow just completed project scope and validated its exact `<project>/templates/` output | Consume that single directory in place; it cannot join multi-path fusion |
+| One or more explicit template workspace paths (each resolves to `templates/design_spec.md`, or to a legacy/direct root `design_spec.md`, with `kind: brand` / `kind: layout` / `kind: deck` in YAML frontmatter) | Normalize each source directory, read its `kind`, dispatch per the kind matrix below, fuse if multiple |
+| Current `create-template` workflow just completed project scope and validated its exact `<project>/` workspace | Consume that single workspace in place; it cannot join multi-path fusion |
| Anything else — bare template names ("用 academic_defense"), style descriptions ("麦肯锡风格"), brand mentions ("招商银行风格"), vague intent ("想用个模板"), or silence | Skip Step 3, free design |
There is no slug matching, no name lookup, no fuzzy resolution. A name without a path does not trigger — the user must give a path the AI can `cd` into.
-**Structured-template preflight (before copy)**: For every deck/layout path, inspect all template SVG roots and slots. Every page must declare root Master/Layout key and picker names; Master/Layout visuals must be direct atoms rather than `<g>`; every slot must be a top-level `<g>` with positive bounds and exactly one compatible carrier, or an explicit composite `object` proxy. A zero-slot Layout is valid. If the package uses a legacy contract, run [`restore-pptx-structure`](workflows/restore-pptx-structure.md) first and return to Step 3 with the migrated directory. Do not copy a legacy package into the project and defer migration.
+**Structured-template preflight (before copy)**: For every deck/layout workspace, inspect all SVG roots and slots under its normalized template source. Every page must declare root Master/Layout key and picker names; Master/Layout visuals must be direct atoms rather than `<g>`; every slot must be a top-level `<g>` with positive bounds and exactly one compatible carrier, or an explicit composite `object` proxy. A zero-slot Layout is valid. If the SVG package uses a legacy semantic contract, run [`restore-pptx-structure`](workflows/restore-pptx-structure.md) first and return to Step 3 with the migrated workspace. A legacy flat directory shape alone is read compatibility and does not trigger restoration.
> Style descriptions ("麦肯锡风格" / "Keynote 风" / "极简风" / etc.) never trigger Step 3. They flow into the Strategist confirmation stage as a style brief (color / typography / tone in fields e–g).
@@ -249,9 +249,9 @@ The architecture has three independent reference bundles. Full schema in [`docs/
| Kind | Physical dir | Contains | Frontmatter |
|---|---|---|---|
-| **brand** | `templates/brands/<id>/` | identity-only segment: color / typography / logo / voice / icon style | `kind: brand` |
-| **layout** | `templates/layouts/<id>/` | structure-only segment: canvas / page structure / page types / SVG roster | `kind: layout` |
-| **deck** | `templates/decks/<id>/` | full replica: identity + structure + middle (template overview) segments | `kind: deck` |
+| **brand** | `templates/brands/<id>/` (direct package; `create-brand` contract) | identity-only segment: color / typography / logo / voice / icon style | `kind: brand` |
+| **layout** | `templates/layouts/<id>/templates/` inside a complete workspace | structure-only segment: canvas / page structure / page types / SVG roster | `kind: layout` |
+| **deck** | `templates/decks/<id>/templates/` inside a complete workspace | full replica: identity + structure + middle (template overview) segments | `kind: deck` |
**Segment ownership** (governs fusion override priority):
@@ -265,46 +265,29 @@ The architecture has three independent reference bundles. Full schema in [`docs/
| User path's `kind` | Step 3 action |
|---|---|
-| `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 Strategist confirmation stage e–g. |
-| `kind: deck` | `design_spec.md` + template SVGs → `<project>/templates/`; logos / backgrounds / other **bitmaps** → `<project>/images/`. Strategist locks all segments; Strategist confirmation stage narrows to deck-content fields (audience / page count / outline / tone tweaks). |
+| `kind: brand` | Install the direct package's spec/non-image assets in `<project>/templates/` and bitmaps in `<project>/images/`. Strategist locks identity; structure stays free. |
+| `kind: layout` | Install the workspace's `templates/`, `images/`, and `icons/` into the matching project roots; ignore `exports/`. Strategist locks structure; identity is decided in confirmation fields e–g. |
+| `kind: deck` | Install the workspace's `templates/`, `images/`, and `icons/` into the matching project roots; ignore `exports/`. Strategist locks all segments; confirmation narrows to deck-content fields. |
-```bash
-TEMPLATE_DIR="<user-supplied path>"
-PROJECT_TEMPLATES="<project_path>/templates"
-resolve_path() {
- python3 -c 'from pathlib import Path; import sys; print(Path(sys.argv[1]).resolve())' "$1"
-}
-# 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.
-if [ "$(resolve_path "${TEMPLATE_DIR}")" = "$(resolve_path "${PROJECT_TEMPLATES}")" ]; then
- # Project-scoped create-template output is already staged in place.
- true
-else
- cp -r "${TEMPLATE_DIR}"/. "${PROJECT_TEMPLATES}/"
- find "${PROJECT_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/" \;
-fi
-```
+Normalize every explicit path before any write:
+
+| Input shape | Spec / SVG source | Asset source | Install rule |
+|---|---|---|---|
+| Current Layout/Deck workspace: `<root>/templates/design_spec.md` | `<root>/templates/` | `<root>/images/`, `<root>/icons/` | Map those three roots to the target project's matching roots; ignore `<root>/exports/` |
+| Direct Brand package: `<root>/design_spec.md`, `kind: brand` | `<root>/` | Package-local files | Spec/non-bitmap assets → project `templates/`; bitmaps → project `images/` |
+| Compatible legacy-flat Layout/Deck: `<root>/design_spec.md` | `<root>/` | Package-local files | Preserve the existing flat-package routing: SVG/spec/non-bitmaps → project `templates/`; bitmaps → project `images/`; route declared icons to project `icons/` |
+
+**Atomic install preflight (mandatory)**: Resolve source and destination paths, enumerate the complete file mapping, and reject every destination collision before copying any file. Equality between a current project workspace root and the target project root means in-place consumption and no copy. For an external single path, a collision stops Step 3 rather than overwriting. For multi-path fusion, do not copy packages sequentially: resolve segment conflicts and asset-name conflicts first, construct one final mapping, then write it once. Never use recursive copy as an implicit conflict policy.
+
+Never infer that a flat directory has legacy Master/Layout semantics solely from packaging.
-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 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 split applies to layout and deck: source/spec in `templates/`, bitmaps in `images/`, runtime vectors in `icons/`, review artifacts in `exports/`. 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 directory is already the
-target project's `templates/` root and its bitmap/icon runtime copies are already
-in their final project pools. Resolve both paths before copying: equality means
-**in-place consumption**, so skip both the copy and bitmap move. An in-place
-directory is one complete bundle and cannot participate in multi-path fusion;
-use external library bundles for fusion. Never place the local bundle under a
-nested `templates/local_master/` directory because the confirmation and quality
-gates read the project `templates/` root.
+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.
-A project-scoped bundle belongs only to its target project: its SVGs may refer
-to sibling `../images/` and runtime `../icons/` pools that are outside the
-template root. Do not copy another project's `templates/` root as an external
-bundle. For cross-project reuse, recreate/promote the design with
-`create-template` library scope so the package is self-contained.
+A project-scoped workspace has the same portable core structure as a library workspace. It may be copied or promoted across roots as one unit (`templates/`, `images/`, `icons/`); `exports/` stays review-only. Do not pass only another project's `templates/` subdirectory because that would omit sibling assets.
-Legacy template packages may ship `native_structure.json` + `source_template.pptx`, omit root Master identity, use direct atomic placeholders, or carry old baseline/distillation metadata. Do not copy or consume them through Step 3. Run [`restore-pptx-structure`](workflows/restore-pptx-structure.md) on the package first, then return with the migrated directory path. This applies to the repository's existing built-in legacy SVG packages until their assets are explicitly migrated.
+Legacy template packages may ship `native_structure.json` + `source_template.pptx`, omit root Master identity, use direct atomic placeholders, or carry old baseline/distillation metadata. Do not copy or consume those semantic contracts through Step 3. Run [`restore-pptx-structure`](workflows/restore-pptx-structure.md) on the package first, then return with the migrated workspace path. Old flat packaging remains readable when its SVG structure is already current.
The Strategist confirmation stage decides whether the selected template is used `strict` or `adaptive`. New projects use `pptx_structure.mode: structured`, map every page to one input SVG in `page_layouts`, and write complete `pptx_masters` / `pptx_layouts` output mappings before SVG generation. Strict preserves the referenced Master/Layout/slot contract. Adaptive keeps the template Master and may assign a new Layout key during authoring when the composition genuinely changes. Non-mirror paint and typography follow the project skin rules.
diff --git a/skills/ppt-master/references/template-designer.md b/skills/ppt-master/references/template-designer.md
index cb5445b1..81a1ab18 100644
--- a/skills/ppt-master/references/template-designer.md
+++ b/skills/ppt-master/references/template-designer.md
@@ -4,19 +4,20 @@
## Core Mission
-Generate reusable page templates at the output scope confirmed by `create-template`, and write a concise `design_spec.md` that captures the source-derived basic norms that make the template reusable.
+Generate reusable page templates inside the complete workspace selected by `create-template`, and write a concise `design_spec.md` that captures the source-derived basic norms that make the template reusable.
-> This is a standalone role: only triggered via the `/create-template` workflow. It may write a global library package or a project-local thin bundle; it is not the template selection step in the main PPT generation pipeline.
+> This is a standalone role: only triggered via the `/create-template` workflow. Library and project outputs use one workspace shape; it is not the template selection step in the main PPT generation pipeline.
## Usage
- **Trigger**: `/create-template` workflow
-- **Output location**: `library` (default) → `skills/ppt-master/templates/<kind_dir>/<template_name>/`; `project` → the confirmed `<target_project>/templates/` root with no nested template-ID directory
+- **Workspace root**: `library` (default) → `skills/ppt-master/templates/<kind_dir>/<template_name>/`; `project` → the confirmed `<target_project>/`
+- **Template source**: `<template_workspace>/templates/` in both scopes
- **Input**: finalized template brief (output scope, target project when project-scoped, template ID, display name, kind, applicable scenarios, tone, theme mode, canvas format, optional reference assets, accepted basic template norms)
**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`.
-**Project-scope precondition**: The workflow has already confirmed an initialized target project, an empty `<target_project>/templates/`, and collision-free destination filenames in `images/` and `icons/`. 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/`, `icons/`, `templates/icons/`, and `exports/`. 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:
@@ -100,7 +101,7 @@ Extension page types beyond the canonical four (transition / appendix / disclaim
- Cluster slides from `manifest.json` by `pageType` + visual structure (column count, hero-image vs. icon-grid vs. quote, etc.)
- One SVG per cluster — do **not** emit a variant for a cluster represented by a single source slide unless that slide is structurally distinct from existing variants
- One variant per visually distinct cluster — let the source's structural diversity drive the count. Collapse only **near-duplicates** (same column count, same hero element, same content density); do not collapse genuine structural differences just to keep the variant count down. If you find yourself wanting one variant per source slide, that is the signal the user should be in `mirror` mode, not `fidelity`
-- Record every emitted page in `design_spec.md §V Page Roster`; in library scope, `register_template.py` generates the corresponding index entry from the directory's actual SVG files. Project scope skips registration
+- Record every emitted page in `design_spec.md §V Page Roster`; in library scope, `register_template.py` generates the corresponding index entry from `<template_workspace>/templates/*.svg`. Project scope skips registration
> Variants reuse the parent type's placeholder set — see §4 (Placeholder Reference) below.
@@ -109,7 +110,7 @@ Extension page types beyond the canonical four (transition / appendix / disclaim
When the brief sets `Replication mode: mirror`, preserve literal page appearance while reconstructing layer ownership:
- Visual source: `<import_workspace>/svg-flat/slide_NN.svg` (the self-contained "what PowerPoint shows" view). Structural source: `svg/master_*.svg`, `svg/layout_*.svg`, and `svg/inheritance.json`.
-- Output: `<template_target>/<NNN>_<page_type>.svg`, where `<template_target>` is the library package directory or the project `templates/` root. `<NNN>` is the zero-padded source slide index (3 digits) and `<page_type>` is derived from `manifest.json` `pageTypeCandidates` — `cover` / `toc` / `chapter` / `content` / `ending`. When the page-type heuristic is ambiguous, fall back to `content`. Preserve source slide order via the numeric prefix.
+- Output: `<template_workspace>/templates/<NNN>_<page_type>.svg` in both scopes. `<NNN>` is the zero-padded source slide index (3 digits) and `<page_type>` is derived from `manifest.json` `pageTypeCandidates` — `cover` / `toc` / `chapter` / `content` / `ending`. When the page-type heuristic is ambiguous, fall back to `content`. Preserve source slide order via the numeric prefix.
- Required metadata rewrite: declare the output Master/Layout key and picker names on the root, mark inherited Master/Layout visuals as direct atomic elements, and map source content slots to top-level semantic slot groups where the imported contract exposes them. Add `data-pptx-role` only to structural page-frame objects whose behavior is not already expressed by specialized markers.
- Other allowed modifications: rewrite `<image href="...">` paths to local assets and rename assets semantically. Keep geometry, decoration, sprite-sheet wrappers, original example text, chart previews, and fonts visually unchanged.
- Forbidden: simplifying decorative complexity, merging similar slides, or dropping inherited preview chrome.
@@ -358,24 +359,37 @@ When rebuilding from imported PPTX references, placeholder insertion takes prior
### File Save Location
-Library scope keeps the existing self-contained package. Standard mode (default):
+Both scopes use one complete workspace shape. Only the workspace root differs:
+
+| Scope | `<template_workspace>` |
+|---|---|
+| `library` | `skills/ppt-master/templates/<kind_dir>/<template_name>/` |
+| `project` | `<target_project>/` |
+
+Standard mode (default):
```
-templates/<kind_dir>/<template_name>/
-├── design_spec.md # Design specification (required)
-├── 01_cover.svg
-├── 02_chapter.svg
-├── 02_toc.svg # Optional
-├── 03_content.svg
-├── 04_ending.svg
-├── icons/ # Extracted vector assets (if any)
-└── *.png / *.jpg # Bitmap assets (if any)
+<template_workspace>/
+├── templates/
+│ ├── design_spec.md
+│ ├── 01_cover.svg
+│ ├── 02_chapter.svg
+│ ├── 02_toc.svg # Optional
+│ ├── 03_content.svg
+│ ├── 04_ending.svg
+│ └── icons/ # Package/validation copy, when used
+├── images/
+│ └── *.png / *.jpg # SVG href is ../images/<name>
+├── icons/
+│ └── *.svg # Runtime copy, when used
+└── exports/
+ └── <template_id>_template_preview.pptx
```
-Fidelity mode adds variants and extension pages in the same package, e.g.:
+Fidelity mode changes only the roster under `templates/`, e.g.:
```
-templates/<kind_dir>/<template_name>/
+<template_workspace>/templates/
├── design_spec.md
├── 01_cover.svg
├── 02a_chapter_full.svg
@@ -385,14 +399,13 @@ templates/<kind_dir>/<template_name>/
├── 03b_content_data_card.svg
├── 03c_content_quote.svg
├── 04_ending.svg
-├── 05_section_break.svg
-└── *.png / *.jpg
+└── 05_section_break.svg
```
Mirror mode emits one SVG per source slide, named by source order:
```
-templates/<kind_dir>/<template_name>/
+<template_workspace>/templates/
├── design_spec.md
├── 001_cover.svg
├── 002_toc.svg
@@ -402,35 +415,18 @@ templates/<kind_dir>/<template_name>/
├── 006_content.svg
├── ...
├── 049_content.svg
-├── 050_ending.svg
-└── *.png / *.jpg
+└── 050_ending.svg
```
Filenames preserve the source slide order via the 3-digit prefix; `<page_type>` is derived from `manifest.json` `pageTypeCandidates`. Literal source text may remain, but every page still carries explicit native structure metadata.
-Project scope writes directly into an initialized project's existing roots. The roster names still follow the selected replication mode, but the package is not nested under `<template_name>`:
-
-```
-<target_project>/
-├── templates/
-│ ├── design_spec.md
-│ ├── 01_cover.svg
-│ ├── 02_chapter.svg
-│ ├── 03_content.svg
-│ ├── 04_ending.svg
-│ ├── ... # Fidelity variants or mirror pages
-│ └── icons/ # Package/validation copy
-├── images/
-│ └── *.png / *.jpg # Bitmap assets; template SVG href is ../images/<name>
-└── icons/
- └── *.svg # Identical runtime copy of extracted icons
-```
-
-**Hard rule — project routing**: Keep `design_spec.md`, template SVGs, and non-bitmap package assets in `templates/`; place every bitmap in `images/`; duplicate each extracted icon into `templates/icons/` and runtime `icons/`. Do not write bitmaps into the project template root and do not create `<target_project>/templates/<template_name>/`. This output belongs only to the target project; use library scope for a self-contained cross-project package.
+**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 the review deck to `exports/`. Do not branch asset placement by output scope.
### Template Preview
-After each template is generated, provide a brief summary table listing each template's status.
+After SVG validation, run `template_preview_pptx.py <template_workspace>`. The template is incomplete until `exports/<template_id>_template_preview.pptx` reopens with one slide per SVG prototype and the expected Master/Layout counts. The first export refuses a collision; an intentional post-fix replacement uses `--force`. The review PPTX is derived evidence and never a template-application input.
+
+Provide a brief summary table listing each template's status and the review PPTX path.
If the template is based on PPTX import output, briefly note:
- which extracted assets were reused directly
@@ -444,11 +440,11 @@ 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 the spec + explicitly layered template SVGs into the project's `templates/`, and any bundled bitmaps into the project's `images/` (the runtime image pool, referenced as `../images/`).
+1. **Copy template workspace**: copy or stage `templates/`, `images/`, and `icons/` together; exclude `exports/` from template application.
2. **Adjust colors**: Modify colors per the project design spec
3. **Customize**: Make project-specific adjustments
-This section describes downstream reuse of an existing library package. The `Template_Designer` role may instead create the same contract directly in project scope when `create-template` selected that output.
+This section describes downstream reuse of an existing workspace. Library and project scopes carry the same portable template contract.
**Example library structure** (query the appropriate kind's index — `templates/layouts/layouts_index.json` for structure-only templates, `templates/decks/decks_index.json` for full-PPT replicas, `templates/brands/brands_index.json` for identity-only presets):
@@ -473,13 +469,13 @@ templates/
## Template_Designer Phase Complete
- [x] Read `references/template-designer.md`
-- [x] Output scope confirmed: `library` | `project`; project-scope preflight passed before final writes
+- [x] Output scope confirmed: `library` | `project`; the common workspace preflight passed before final writes
- [x] Replication mode confirmed: `standard` | `fidelity` | `mirror`
-- [x] Every page listed in `design_spec.md §V Page Roster` saved to the selected template target (library package directory or project `templates/` root)
+- [x] Every page listed in `design_spec.md §V Page Roster` saved to `<template_workspace>/templates/`
- [x] Naming convention applied (standard / fidelity: letter-suffix variants; mirror: `<NNN>_<page_type>.svg`)
- [x] Templates follow design spec (colors, fonts, layout)
- [x] Placeholder markers are clear and standardized; every slot has explicit design-zone bounds; mirror may keep literal text but still maps imported semantic slots
- [x] Every SVG is a complete preview with explicit root Master/Layout identity, atomic Master/Layout elements, grouped slot/carrier metadata, and `native_structure_mode: structured`; source Layouts are materialized, or mirror reports unsupported Layouts explicitly
-- [x] Project scope, when selected: bitmaps routed to `images/`; extracted icons copied to both `templates/icons/` and runtime `icons/`
-- [ ] **Next step**: Validate assets; register only library scope, otherwise hand the in-place project bundle to main Step 3
+- [x] Both scopes route bitmaps to `images/` and copy extracted icons to both `templates/icons/` and runtime `icons/`
+- [ ] **Next step**: Validate assets, export and verify `exports/<template_id>_template_preview.pptx`, then register only library scope
```
diff --git a/skills/ppt-master/scripts/README.md b/skills/ppt-master/scripts/README.md
index 22cd0dd2..865e0c59 100644
--- a/skills/ppt-master/scripts/README.md
+++ b/skills/ppt-master/scripts/README.md
@@ -45,7 +45,7 @@ python3 scripts/update_repo.py
|------|-----------------|---------------|
| Conversion | `source_to_md.py`, `source_to_md/pdf_to_md.py`, `source_to_md/doc_to_md.py`, `source_to_md/excel_to_md.py`, `source_to_md/ppt_to_md.py`, `source_to_md/web_to_md.py`, `pptx_intake.py`, `pptx_to_svg.py` | [docs/conversion.md](./docs/conversion.md) |
| Project management | `project_manager.py`, `batch_validate.py`, `generate_examples_index.py`, `error_helper.py`, `pptx_template_import.py`, `template_fill_pptx.py`, `native_enhance_pptx.py` | [docs/project.md](./docs/project.md) |
-| SVG pipeline | `preset_shape_svg.py`, `finalize_svg.py`, `svg_to_pptx.py`, `total_md_split.py`, `svg_quality_checker.py`, `extract_svg_assets.py`, `animation_config.py`, `notes_to_audio.py` | [docs/svg-pipeline.md](./docs/svg-pipeline.md); [native preset authoring](../references/native-shape-authoring.md) |
+| SVG pipeline | `preset_shape_svg.py`, `finalize_svg.py`, `svg_to_pptx.py`, `template_preview_pptx.py`, `total_md_split.py`, `svg_quality_checker.py`, `extract_svg_assets.py`, `animation_config.py`, `notes_to_audio.py` | [docs/svg-pipeline.md](./docs/svg-pipeline.md); [native preset authoring](../references/native-shape-authoring.md) |
| PPTX transitions | `pptx_transitions.py` | [docs/pptx-transitions.md](./docs/pptx-transitions.md) |
| PPTX animations | `pptx_animations.py`, `animation_config.py` | [docs/pptx-animations.md](./docs/pptx-animations.md) |
| Spec maintenance | `update_spec.py` | [docs/update_spec.md](./docs/update_spec.md) |
@@ -81,8 +81,11 @@ Template source import:
python3 scripts/pptx_template_import.py <template.pptx>
python3 scripts/pptx_template_import.py <template.pptx> --manifest-only
python3 scripts/pptx_template_import.py <template.pptx> --inheritance-mode both
+python3 scripts/template_preview_pptx.py <template_workspace>
```
+`template_preview_pptx.py` reads a complete create-template workspace (`templates/`, `images/`, `icons/`, `exports/`), exports every `templates/*.svg` prototype as one structured review slide, and verifies the resulting Master/Layout package. Its default output is `exports/<template_id>_template_preview.pptx`. It refuses an existing output unless an intentional re-export passes `--force`. Legacy flat template packages remain readable; new template creation uses the workspace structure.
+
Template fill (direct PPTX, no SVG conversion):
```bash
diff --git a/skills/ppt-master/templates/README.md b/skills/ppt-master/templates/README.md
index e68d32cb..0f6eabaf 100644
--- a/skills/ppt-master/templates/README.md
+++ b/skills/ppt-master/templates/README.md
@@ -21,6 +21,8 @@ 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.
+New layout/deck packages are complete workspaces. Whether created under this library or under `projects/`, they use the same `templates/`, `images/`, `icons/`, and `exports/<id>_template_preview.pptx` structure. Step 3 receives the workspace root. Existing flat library packages remain readable; flat placement alone does not imply legacy Master/Layout metadata.
+
## Brand Identity Presets
The `brands/` directory holds brand-only templates: identity bundles (color / typography / logo / voice / icon style) without an SVG page roster. Brands follow the **same explicit-path trigger rule as layout templates** — at SKILL.md Step 3 the user supplies the brand directory path to apply it; bare brand names never trigger. Both layout and brand inputs land in the same project directory (`<project_path>/templates/`). When supplied together, Step 3 fuses them into a single `design_spec.md` (brand wins on identity tokens, layout wins on page structure) — see `SKILL.md` Step 3 for the precedence table.
diff --git a/skills/ppt-master/templates/decks/README.md b/skills/ppt-master/templates/decks/README.md
index 7c1b4ee8..0bf2043c 100644
--- a/skills/ppt-master/templates/decks/README.md
+++ b/skills/ppt-master/templates/decks/README.md
@@ -10,7 +10,7 @@ Full data model: [`docs/zh/templates-architecture.md`](../../../../docs/zh/templ
## Trigger rule
-Deck selection is **opt-in by explicit path**. The main workflow defaults to free design. A deck is only used when the user gives an explicit directory path in their initial message (e.g. `skills/ppt-master/templates/decks/招商银行/`). Bare names do not trigger. See [`SKILL.md`](../../SKILL.md) Step 3.
+Deck selection is **opt-in by explicit path**. The main workflow defaults to free design. For a current package, the user supplies the explicit workspace root (for example, `skills/ppt-master/templates/decks/<deck_id>/`), not its inner `templates/` directory. A legacy-flat deck root containing `design_spec.md` remains a compatible input. Bare names do not trigger. See [`SKILL.md`](../../SKILL.md) Step 3.
`decks_index.json` is a **discovery aid**, not a trigger — it lets the AI answer "what decks exist?" by listing ids and paths. Listing alone never advances the pipeline.
@@ -54,12 +54,42 @@ When the user gives a deck path **with** a brand path or layout path, identity /
---
+## Standard workspace contract
+
+New deck creation uses the same complete workspace shape in both output scopes:
+
+```text
+<template_workspace>/
+├── templates/
+│ ├── design_spec.md
+│ ├── 01_cover.svg
+│ ├── 02_chapter.svg
+│ ├── 03_content.svg
+│ └── 04_ending.svg
+├── images/
+├── icons/
+└── exports/
+ └── <deck_id>_template_preview.pptx
+```
+
+| Scope | `<template_workspace>` | Difference |
+|---|---|---|
+| 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/`. The preview PPTX is a required review artifact, not a template input. Template application consumes `templates/`, `images/`, and `icons/` from the explicit workspace root and does not copy `exports/`.
+
+**Legacy compatibility**: Existing flat packages with `design_spec.md` and SVGs at their root remain readable. Flat placement alone does not trigger [`restore-pptx-structure`](../../workflows/restore-pptx-structure.md); restoration is required only when SVG Master/Layout/slot metadata is absent or legacy. New `create-template` outputs always use the workspace contract above.
+
+---
+
## Creating a new deck
1. Run [`workflows/create-template.md`](../../workflows/create-template.md) (default kind is `deck`)
-2. Resulting directory lands under `templates/decks/<id>/`
-3. Validate: `python3 skills/ppt-master/scripts/svg_quality_checker.py templates/decks/<id> --template-mode --format ppt169`
-4. Register: `python3 skills/ppt-master/scripts/register_template.py <id> --kind deck`
+2. Choose the workspace root: library `skills/ppt-master/templates/decks/<id>/` or project `projects/<name>/`
+3. Validate: `python3 skills/ppt-master/scripts/svg_quality_checker.py "<template_workspace>/templates" --template-mode --format ppt169`
+4. Export the review deck: `python3 skills/ppt-master/scripts/template_preview_pptx.py "<template_workspace>"`
+5. For library scope only, register: `python3 skills/ppt-master/scripts/register_template.py <id> --kind deck`
The register step updates [`decks_index.json`](./decks_index.json) — the single source of truth for deck discovery.
diff --git a/skills/ppt-master/templates/layouts/README.md b/skills/ppt-master/templates/layouts/README.md
index 39344659..7681f6b9 100644
--- a/skills/ppt-master/templates/layouts/README.md
+++ b/skills/ppt-master/templates/layouts/README.md
@@ -10,7 +10,7 @@ Full data model: [`docs/zh/templates-architecture.md`](../../../../docs/zh/templ
## Trigger rule
-Layout selection is **opt-in by explicit path**. The main workflow defaults to free design. A layout is only used when the user gives an explicit directory path in their initial message (e.g. `skills/ppt-master/templates/layouts/academic_defense/`). Bare names do not trigger. See [`SKILL.md`](../../SKILL.md) Step 3.
+Layout selection is **opt-in by explicit path**. The main workflow defaults to free design. For a current package, the user supplies the explicit workspace root (for example, `skills/ppt-master/templates/layouts/<layout_id>/`), not its inner `templates/` directory. A legacy-flat layout root containing `design_spec.md` remains a compatible input. Bare names do not trigger. See [`SKILL.md`](../../SKILL.md) Step 3.
`layouts_index.json` is a **discovery aid**, not a trigger — it lets the AI answer "what layouts exist?" by listing ids and paths. Listing alone never advances the pipeline.
@@ -43,18 +43,34 @@ Layouts may include additional supporting sections (Layout Patterns, Spacing Gui
---
-## Standard file set per layout directory
+## Standard workspace contract
+
+New layout creation uses the same complete workspace shape in both output scopes:
+
+```text
+<template_workspace>/
+├── templates/
+│ ├── design_spec.md
+│ ├── 01_cover.svg
+│ ├── 02_chapter.svg
+│ ├── 03_content.svg
+│ └── 04_ending.svg
+├── images/
+├── icons/
+└── exports/
+ └── <layout_id>_template_preview.pptx
+```
+
+| Scope | `<template_workspace>` | Difference |
+|---|---|---|
+| 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. 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/`.
-| Filename | Required | Purpose |
-|----------|----------|---------|
-| `design_spec.md` | Yes | Layout schema spec (frontmatter + structure sections) |
-| `01_cover.svg` | Yes | Cover page |
-| `02_toc.svg` | Optional | Table of contents |
-| `02_chapter.svg` | Yes | Chapter page |
-| `03_content.svg` | Yes | Content page |
-| `04_ending.svg` | Yes | Ending page |
+The preview PPTX is a required review artifact and is not a template input. Template application consumes the workspace root's `templates/`, `images/`, and `icons/`; it does not copy `exports/`.
-All SVGs use `viewBox="0 0 1280 720"` for ppt169.
+**Legacy compatibility**: Existing flat packages with `design_spec.md` and SVGs at their root remain readable. Flat placement alone does not trigger [`restore-pptx-structure`](../../workflows/restore-pptx-structure.md); restoration is required only when SVG Master/Layout/slot metadata is absent or legacy. New `create-template` outputs always use the workspace contract above.
---
@@ -67,9 +83,10 @@ Templates use `{{PLACEHOLDER}}` to mark replaceable content. New layouts should
## Creating a new layout
1. Run [`workflows/create-template.md`](../../workflows/create-template.md) (default produces a deck; explicit "structure only / no identity" option produces a layout)
-2. Resulting directory lands under `templates/layouts/<id>/`
-3. Validate: `python3 skills/ppt-master/scripts/svg_quality_checker.py templates/layouts/<id> --template-mode --format ppt169`
-4. Register: `python3 skills/ppt-master/scripts/register_template.py <id> --kind layout`
+2. Choose the workspace root: library `skills/ppt-master/templates/layouts/<id>/` or project `projects/<name>/`
+3. Validate: `python3 skills/ppt-master/scripts/svg_quality_checker.py "<template_workspace>/templates" --template-mode --format ppt169`
+4. Export the review deck: `python3 skills/ppt-master/scripts/template_preview_pptx.py "<template_workspace>"`
+5. For library scope only, register: `python3 skills/ppt-master/scripts/register_template.py <id> --kind layout`
The register step updates [`layouts_index.json`](./layouts_index.json) — the single source of truth for layout discovery.
diff --git a/skills/ppt-master/workflows/create-template.md b/skills/ppt-master/workflows/create-template.md
index b88f1088..1437eeda 100644
--- a/skills/ppt-master/workflows/create-template.md
+++ b/skills/ppt-master/workflows/create-template.md
@@ -6,13 +6,15 @@ description: Generate a new layout or deck template based on existing project fi
> **Role invoked**: [Template_Designer](../references/template-designer.md)
-Generate a complete layout/deck template package for either the **global template library** or one initialized project.
+Generate one complete layout/deck template workspace under either the **global template library** or `projects/`.
-**Default — library scope**: Preserve the existing reusable-library behavior. Write `skills/ppt-master/templates/<kind>/<id>/` and register it in the matching discovery index.
+**Default — library scope**: Write `skills/ppt-master/templates/<kind>/<id>/` and register it in the matching discovery index.
-**Project scope**: Write a thin template bundle directly into `<project>/templates/` for the named project. Do not add a nested template-ID directory and do not register any global index.
+**Project scope**: Write the same complete workspace contract at `<project>/` and do not register any global index.
-> **Boundary against template-fill**: this workflow does not fill content into a PPTX and does not directly output the user's final generated deck. It creates a reusable template contract at the selected scope. To generate a deck from a library package, return its directory path to the main SKILL.md pipeline. A project-scoped package is already installed at that project's Step 3 path and is consumed in place.
+**Hard rule — one workspace shape**: Output scope changes only the workspace parent and index registration. Both scopes use the same `templates/`, `images/`, `icons/`, and `exports/` placement, the same relative asset references, the same validation command, and the same preview-export command. Do not maintain a library-only self-contained-flat package branch or a project-only thin-bundle branch.
+
+> **Boundary against template-fill**: this workflow does not fill content into a PPTX and does not directly output the user's final generated deck. It creates a reusable template contract plus a review-only PPTX at the selected scope. To generate a deck from the workspace, return its root path to the main SKILL.md pipeline. A project-scoped workspace is already installed at that project's Step 3 path and is consumed in place.
> **Companion workflow**: identity-only locking (colors / typography / logo / voice without SVG pages) is handled by [`create-brand.md`](./create-brand.md). Use that when the user wants brand identity but free page layout; use this when fixed page structures are required.
@@ -22,8 +24,8 @@ This workflow produces one of two kinds of templates depending on whether the so
| Kind | When | Library-scope output dir | What `design_spec.md` writes |
|---|---|---|---|
-| **deck** (default) | Source is a specific organization's branded PPT (e.g. company report, university defense template); the visual identity is part of the replica | `templates/decks/<id>/` | Full segments: identity + structure + middle |
-| **layout** | Source is a generic stylistic template (no specific brand); only the structural skeleton should be reusable; color / typography decided per-deck downstream | `templates/layouts/<id>/` | Structure segments only (canvas / page structure / page types / SVG roster); identity segment omitted |
+| **deck** (default) | Source is a specific organization's branded PPT (e.g. company report, university defense template); the visual identity is part of the replica | `templates/decks/<id>/templates/` | Full segments: identity + structure + middle |
+| **layout** | Source is a generic stylistic template (no specific brand); only the structural skeleton should be reusable; color / typography decided per-deck downstream | `templates/layouts/<id>/templates/` | Structure segments only (canvas / page structure / page types / SVG roster); identity segment omitted |
Default to **deck** unless the user explicitly says "structure only" / "layout only" / "no brand identity". When in doubt, lean deck — losing identity later is easy; reconstructing it from a layout-mode strip is not. See [`docs/zh/templates-architecture.md`](../../../docs/zh/templates-architecture.md) for the full kind / schema / fusion model.
@@ -31,23 +33,35 @@ Default to **deck** unless the user explicitly says "structure only" / "layout o
Output scope is a workflow execution choice, not a new template kind or PPTX structure mode. Surface it in the Step 2 brief; do not invent a CLI flag or persist `output_scope` / `target_project` into portable `design_spec.md` frontmatter.
-| Scope | Final output | Asset routing | Registration |
+| Scope | `<template_workspace>` | Template source | Registration |
|---|---|---|---|
-| `library` (default) | `skills/ppt-master/templates/<kind_dir>/<template_id>/` | Keep the existing self-contained package: SVG/spec/assets under the package, including `icons/` when present | Run `register_template.py` against the matching global index |
-| `project` | `<target_project>/templates/` **root** | `design_spec.md`, template SVGs, and non-bitmap package assets → `templates/`; bitmaps → `images/` and SVG references → `../images/<name>`; extracted icon assets → both `templates/icons/` (package/validation copy) and `icons/` (runtime copy) | Do not update any global index; bundle belongs only to this target project |
+| `library` (default) | `skills/ppt-master/templates/<kind_dir>/<template_id>/` | `<template_workspace>/templates/` | Run `register_template.py` against the matching global index |
+| `project` | `<target_project>/` | `<template_workspace>/templates/` | Do not update any global index |
+
+Both scopes write this contract:
+
+```text
+<template_workspace>/
+├── templates/ # design_spec.md, template SVGs, templates/icons/ when used
+├── images/ # every bitmap; SVG href is always ../images/<name>
+├── icons/ # runtime copy of extracted vector assets
+└── exports/ # <template_id>_template_preview.pptx
+```
+
+The review PPTX is derived evidence, not a source template asset. Template application reads `templates/`, `images/`, and `icons/`; it never copies or consumes `exports/`.
-For `project`, `target_project` is required and must be an existing project initialized by `project_manager.py init`. Before the first final-output write, run one complete preflight:
+For `project`, `target_project` is required and must be an existing project initialized by `project_manager.py init`. Before the first final-output write, run one complete preflight. Apply the same collision checks to a library workspace; the only difference is that its root is under the global kind directory:
-1. Confirm the target project and its `templates/`, `images/`, and `icons/` directories exist.
-2. Confirm `<target_project>/templates/` is empty.
-3. Resolve every final bitmap and extracted-icon filename, then confirm none would overwrite an existing file in `<target_project>/images/` or `<target_project>/icons/`.
+1. Resolve `<template_workspace>` from the confirmed scope and confirm its `templates/`, `images/`, `icons/`, and `exports/` destinations.
+2. Confirm `<template_workspace>/templates/` is empty.
+3. Resolve every final bitmap, extracted-icon, and review-PPTX filename, then confirm none would overwrite an existing file in `images/`, `icons/`, `templates/icons/`, or `exports/`.
-Any failed check aborts before writing `design_spec.md`, SVGs, images, or icons. Do not merge into a non-empty template root and do not overwrite a name conflict. Temporary Step 1 analysis workspaces remain allowed because they are not final project outputs.
+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.
## Process Overview
```
-Reference Intake & Analysis -> Basic Norm Extraction -> Fact-Based Brief Proposal -> User Confirmation Gate -> Preflight + Invoke Template_Designer -> Validate Assets -> [Register Library Index] -> Output
+Reference Intake & Analysis -> Basic Norm Extraction -> Fact-Based Brief Proposal -> User Confirmation Gate -> Preflight + Invoke Template_Designer -> Validate Assets -> Export Review PPTX -> [Register Library Index] -> Output
```
The first three steps derive the brief from facts, not guesses. **No final template directory may be created and no template SVG / `design_spec.md` may be written until `[TEMPLATE_BRIEF_CONFIRMED]` is emitted in Step 3.** Reference-analysis intermediates produced by `pptx_template_import.py` (typically under `/tmp/pptx_template_import/`) are explicitly **not** subject to this gate — they are temporary workspaces feeding Step 2.
@@ -63,13 +77,17 @@ Branch by the type of reference source the user supplied. This step produces ana
| Type | What the user supplied | Tool / read path | Replication modes available |
|------|-------------------------|------------------|------------------------------|
| **A** `.pptx` reference | A `.pptx` file path | `pptx_template_import.py` → `manifest.json` + `native_structure.json` + `source_template.pptx` + layered/flat SVGs + `assets/` | `standard` / `fidelity` / `mirror` |
-| **B** Existing SVG assets | `projects/<x>/svg_output/`, `templates/layouts/<existing>`, or a loose `.svg` folder | `ls` + `Read` each `*.svg`; plus `design_spec.md` / `spec_lock.md` if present | `standard` / `fidelity` (explicit structure first; visual clustering only when unstructured) / `mirror` (direct 1:1 copy) |
+| **B** Existing SVG assets | `projects/<x>/svg_output/`, a current template workspace root, a legacy flat template root, or a loose `.svg` folder | Normalize the SVG source directory, then `ls` + `Read` each `*.svg`; also read companion `design_spec.md` / `spec_lock.md` when present | `standard` / `fidelity` (explicit structure first; visual clustering only when unstructured) / `mirror` (direct 1:1 copy) |
| **C** Image / visual references | Screenshot folder, single image, PDF pages | `ls` + `Read` each file (multimodal visual recognition) | `standard` only |
| **D** No reference source | Verbal description only ("McKinsey style", "tech blue", "dark minimal") | — | `standard` only |
-`fidelity` and `mirror` are not available for type C / D — visual references and verbal-only briefs cannot drive page-by-page replication. Type A is the canonical path: `manifest.json` page-type candidates and the layered `svg/` workspace anchor cluster detection (fidelity) and verbatim copy (mirror) with factual data. Type B is supported with caveats:
+`fidelity` and `mirror` are not available for type C / D — visual references and verbal-only briefs cannot drive page-by-page replication. Type A is the canonical path: `manifest.json` page-type candidates and the layered `svg/` workspace anchor cluster detection (fidelity) and verbatim copy (mirror) with factual data.
-- **mirror on type B** — direct 1:1 copy. B's SVGs are already self-contained (one file per page, equivalent to `svg-flat/slide_*.svg`). Page-type for the `<NNN>_<page_type>.svg` filename is read from the source filename when it follows the PPT Master naming convention (`01_cover.svg` → `cover`, `03a_content_two_col.svg` → `content`); fall back to `content` otherwise. Particularly natural when the source is `templates/layouts/<existing>` and the user wants to fork an existing template.
+**Type B source normalization**: when the supplied root contains `templates/design_spec.md`, use `<input>/templates/` as the SVG/spec source and resolve its workspace assets from sibling `<input>/images/` and `<input>/icons/`. Otherwise, use the supplied directory itself as the legacy-flat/loose SVG source. Directory flatness is not a semantic-structure signal.
+
+Type B is supported with caveats:
+
+- **mirror on type B** — direct 1:1 copy. B's SVGs are already self-contained (one file per page, equivalent to `svg-flat/slide_*.svg`). Page-type for the `<NNN>_<page_type>.svg` filename is read from the source filename when it follows the PPT Master naming convention (`01_cover.svg` → `cover`, `03a_content_two_col.svg` → `content`); fall back to `content` otherwise. Particularly natural when the source is a current or legacy template workspace and the user wants to fork it.
- **fidelity on type B** — inspect root Master/Layout identities, direct atomic Master/Layout elements, top-level slot groups, and companion `spec_lock.md` first. When a complete current contract exists, its Master roster and `pptx_layouts` families are authoritative; preserve them instead of visual re-clustering. If the input is an existing template, use its metadata and variant filenames.
- **legacy or unstructured type B** — old `baseline` / `preserve` / `layout_strategy: distill` / `data-pptx-layout-kind` / direct-atomic-placeholder inputs, and SVGs with no root Master identity, first run [`restore-pptx-structure`](./restore-pptx-structure.md). The restored contract is then the Type B input. Do not keep a second compatibility branch inside template creation.
- **selected free-design subset on type B** — restore the named source pages into the current structured contract, then ingest only that explicit subset. Do not scan or copy the whole `svg_output/` directory and silently turn unselected pages into template variants.
@@ -174,7 +192,7 @@ Do **not** treat the imported PPTX or exported slide SVGs as direct final templa
### 1B. Existing SVG assets
-If the source SVG directory contains complex vector blobs, first copy the SVG files into a throwaway analysis workspace and run the same readability pass there. Do **not** rewrite the user's original source directory in place.
+First resolve the Type B source directory using the rule above. If that normalized SVG directory contains complex vector blobs, copy the SVG files into a throwaway analysis workspace and run the same readability pass there. Do **not** rewrite the user's original source directory in place.
```bash
python3 skills/ppt-master/scripts/extract_svg_assets.py "<svg_analysis_workspace>/svg" --icons-dir "<svg_analysis_workspace>/icons" --inplace --id-prefix source --min-decoration-bytes 3000 --clean-stale
@@ -223,8 +241,8 @@ Compose a single message that surfaces every Required brief item to the user, **
| Field | Must show |
|---|---|
-| Output scope | Recommended `library` (existing default) plus `project`; explain that `project` writes directly into one initialized project's template root and skips global registration |
-| Target project | Required only for `project`; show the exact initialized project directory path, not a project nickname |
+| Output scope | Recommended `library` (default) plus `project`; explain that both create the same complete workspace and only the parent path / global registration differ |
+| Target project | Required only for `project`; show the exact initialized project workspace path, not a project nickname |
| Template kind | Recommended localized label with English ID, plus both options and the rule for choosing |
| Category | Recommended localized category with English ID, plus `brand` / `general` / `scenario` / `government` / `special` with localized explanations |
| Theme mode | Recommended localized mode with English ID, plus available modes such as `light` / `dark` / `mixed` with localized explanations |
@@ -238,8 +256,8 @@ Items to surface:
| Item | Required | Provenance by input type |
|------|----------|--------------------------|
-| Output scope | Yes | `[decision]` — `library` (default, globally reusable and indexed) or `project` (direct thin bundle for one initialized project) |
-| Target project | Yes for `project`; N/A for `library` | `[decision]` — explicit path to the initialized target project; validate it during the Step 4 preflight |
+| Output scope | Yes | `[decision]` — `library` (default, globally reusable and indexed) or `project` (same complete workspace under one initialized project) |
+| Target project | Yes for `project`; N/A for `library` | `[decision]` — explicit path to the initialized target workspace; validate it during the Step 4 preflight |
| New template ID | Yes | `[decision]` — user chooses ASCII slug; if Chinese brand name, it must be filesystem-safe. In library scope it also becomes the matching index key |
| Template display name | Yes | `[decision]` (often the source deck title — `[suggested]` from `summary.md` for type A) |
| Category | Yes | `[decision]` — one of `brand` / `general` / `scenario` / `government` / `special` |
@@ -266,7 +284,7 @@ For type A, also include in this message:
The user replies with corrections, additions, or "all good".
-> **Persist the portable brief into `design_spec.md`**. When the Template_Designer writes `design_spec.md` in Step 4, declare a YAML frontmatter block at the top with the confirmed portable fields (`template_id`, `category`, `summary`, `keywords`, `primary_color`, `canvas_format`, `canvas_width`, `canvas_height`, `canvas_viewbox`, `source_viewbox`, `replication_mode`, `native_structure_mode`, etc.). Do not persist the execution-only `output_scope` or `target_project` fields. In library scope, `register_template.py` reads this frontmatter in Step 6 so the brief flows directly into the index without the AI re-deriving it from prose.
+> **Persist the portable brief into `design_spec.md`**. When the Template_Designer writes `design_spec.md` in Step 4, declare a YAML frontmatter block at the top with the confirmed portable fields (`template_id`, `category`, `summary`, `keywords`, `primary_color`, `canvas_format`, `canvas_width`, `canvas_height`, `canvas_viewbox`, `source_viewbox`, `replication_mode`, `native_structure_mode`, etc.). Do not persist the execution-only `output_scope` or `target_project` fields. In library scope, `register_template.py` reads this frontmatter in Step 7 so the brief flows directly into the index without the AI re-deriving it from prose.
---
@@ -285,11 +303,11 @@ Skipping this gate — including silently inferring values from the reference so
- [ ] Every finite-option field has shown a recommended value, other available options, and unavailable options with reasons when applicable
- [ ] User-facing labels and option explanations match the user's language; English enum IDs appear only as precision aids
- [ ] User has replied with values or explicit acceptance of suggested defaults
-- [ ] Output scope is confirmed; `library` remains the default, while `project` includes an explicit initialized target-project path
+- [ ] Output scope is confirmed; both scopes use the same workspace shape, while `project` includes an explicit initialized target-project path
- [ ] The canvas format is fixed before SVG generation
- [ ] Replication mode is consistent with the input type (`fidelity` / `mirror` allowed for A and B with B's caveats noted; forbidden for C / D)
- [ ] Basic template norms from prior content have been surfaced and accepted, or explicitly marked N/A when no reference exists
-- [ ] For `library`, metadata is complete enough to register into the relevant index; for `project`, the portable template metadata is complete and no global registration is planned
+- [ ] For `library`, metadata is complete enough to register into the relevant index; for `project`, the same portable template metadata is complete and no global registration is planned
- [ ] Marker `[TEMPLATE_BRIEF_CONFIRMED]` emitted on its own line after the echoed brief
Step 4 MUST NOT run until `[TEMPLATE_BRIEF_CONFIRMED]` has been emitted in the current conversation.
@@ -304,19 +322,22 @@ Select the final target from the confirmed output scope:
```bash
# library scope (default)
-mkdir -p "skills/ppt-master/templates/<kind_dir>/<template_id>"
+template_workspace="skills/ppt-master/templates/<kind_dir>/<template_id>"
# project scope
-# Do not create a nested template-ID directory. The initialized project already
-# owns <target_project>/templates/, images/, and icons/.
+template_workspace="<target_project>"
+
+# identical in both scopes
+mkdir -p "$template_workspace/templates" "$template_workspace/images"
+mkdir -p "$template_workspace/icons" "$template_workspace/exports"
```
-| Scope | Template target | Required action before generation |
+| Scope | Workspace target | Required action before generation |
|---|---|---|
-| `library` | `skills/ppt-master/templates/<kind_dir>/<template_id>/` | Preserve the existing directory creation behavior; the generated directory name matches the final template ID used in the relevant index |
-| `project` | `<target_project>/templates/` | Run the full project preflight from "Output scope" above before any final-output write; stop on a non-empty template root or image/icon filename conflict |
+| `library` | `skills/ppt-master/templates/<kind_dir>/<template_id>/` | Run the common workspace preflight; the directory name matches the final template ID used in the relevant index |
+| `project` | `<target_project>/` | Run the same workspace preflight against the initialized project root |
-The project preflight is atomic at workflow level: discover and settle every output filename first, check all destinations together, then begin generation. Do not partially write a project bundle and discover a later collision.
+The preflight is atomic at workflow level: discover and settle every output filename first, check all destinations together, then begin generation. Do not partially write a workspace and discover a later collision.
**Switch to the Template_Designer role** and generate per role definition. The role input is the finalized brief from Step 3 plus the analysis bundle from Step 1, including the accepted basic template norms.
@@ -337,7 +358,7 @@ For type D, pass only the finalized brief.
The role uses the analysis bundle to anchor objective facts such as theme colors, fonts, reusable backgrounds, common branding assets, layout grammar, image-placement rules, density rhythm, and page-slot semantics, then rebuilds the final SVG templates in a simplified, maintainable form.
-**Native structure reconstruction**: Do not copy `native_structure.json` or `source_template.pptx` into the final template directory. Use their Master/Layout/placeholder facts to reconstruct the full source topology through the current SVG contract. Preserve every source Master, every retained Layout and its parent Master, picker name, placeholder type/index/bounds, and unused Layout roster. Same-named Layouts under different Masters receive globally unique keys. Recursively flatten source Master/Layout groups: push supported transforms, styles, opacity, and paint order into direct atomic elements; do not emit a Master/Layout `<g>`. Materialize at least one complete template page for every retained source Layout, including unused Layouts. Immediately below `design_spec.md §V Page Roster`, write a `Source Structure Reconstruction` table with one row per source Master/Layout and its output key/page or explicit unsupported reason. Never silently drop, merge, or re-parent source structure. Mirror keeps its exact source-slide count, so report any unused source Layout that cannot be materialized and use fidelity instead when the full Layout picker roster is required. Every emitted SVG repeats the identical atomic Master contract, selected atomic Layout contract, and top-level semantic slot groups so it remains a complete standalone preview.
+**Native structure reconstruction**: Do not copy `native_structure.json` or `source_template.pptx` into `<template_workspace>/templates/`. Use their Master/Layout/placeholder facts to reconstruct the full source topology through the current SVG contract. Preserve every source Master, every retained Layout and its parent Master, picker name, placeholder type/index/bounds, and unused Layout roster. Same-named Layouts under different Masters receive globally unique keys. Recursively flatten source Master/Layout groups: push supported transforms, styles, opacity, and paint order into direct atomic elements; do not emit a Master/Layout `<g>`. Materialize at least one complete template page for every retained source Layout, including unused Layouts. Immediately below `design_spec.md §V Page Roster`, write a `Source Structure Reconstruction` table with one row per source Master/Layout and its output key/page or explicit unsupported reason. Never silently drop, merge, or re-parent source structure. Mirror keeps its exact source-slide count, so report any unused source Layout that cannot be materialized and use fidelity instead when the full Layout picker roster is required. Every emitted SVG repeats the identical atomic Master contract, selected atomic Layout contract, and top-level semantic slot groups so it remains a complete standalone preview.
Downstream, both template-adherence choices use `pptx_structure.mode: structured`. `page_layouts` selects one complete input prototype per page, while `pptx_masters` and `pptx_layouts` declare the output mapping before the first SVG. Strict preserves the prototype contract. Adaptive keeps the prototype Master and may explicitly create a new Layout key/name while authoring the page that needs it. For mirror packages, reused Master/Layout identities retain literal visual styling in addition to structure; only visible text content may change.
@@ -347,18 +368,17 @@ Downstream, both template-adherence choices use `pptx_structure.mode: structured
**Mirror-mode override** (type A or B): when `Replication mode: mirror`, this step is a **verbatim copy** rather than a reconstruction. The Template_Designer role:
-1. **Copies the cleaned source pages** into the template directory with literal visual fidelity — no content rewriting or decorative simplification. Then annotate the complete page with root Master/Layout identity, direct atomic Master/Layout elements, and top-level slot groups derived from the layered source. Recursively flatten source Master/Layout groups while preserving supported appearance and paint order. The SVG remains visually identical when opened alone, while export can deterministically reconstruct native structure.
+1. **Copies the cleaned source pages** into `<template_workspace>/templates/` with literal visual fidelity — no content rewriting or decorative simplification. Then annotate the complete page with root Master/Layout identity, direct atomic Master/Layout elements, and top-level slot groups derived from the layered source. Recursively flatten source Master/Layout groups while preserving supported appearance and paint order. The SVG remains visually identical when opened alone, while export can deterministically reconstruct native structure.
- Type A: source is the cleaned flat `<import_workspace>/svg-flat/slide_NN.svg`
- - Type B: source is each cleaned `*.svg` in the analysis workspace when extraction ran; otherwise each `*.svg` in the input directory (already self-contained)
+ - Type B: source is each cleaned `*.svg` in the analysis workspace when extraction ran; otherwise each `*.svg` in the normalized Type B source directory (already self-contained)
2. **Renames each file** using the source-order-first convention `<NNN>_<page_type>.svg`, where `<NNN>` is the source-order index zero-padded to 3 digits and `<page_type>` is typically `cover` / `toc` / `chapter` / `content` / `ending` (fall back to `content` when the type cannot be confidently classified). Examples: `001_cover.svg`, `002_toc.svg`, `003_content.svg`, ..., `050_ending.svg`.
- Type A: derive `<page_type>` from `manifest.json.pageTypeCandidates`
- Type B: derive `<page_type>` from the source filename when it follows the PPT Master convention (`01_cover.svg` → `cover`, `03a_content_two_col.svg` → `content`); otherwise infer from page content or fall back to `content`
-3. **Routes bundled assets** according to the selected scope and rewrites every `<image href="...">` consistently. Asset filenames may be renamed to semantic names (`brand_emblem.png` instead of `image3.png`) when it improves readability.
+3. **Routes bundled assets through the common workspace contract** and rewrites every `<image href="...">` consistently. Asset filenames may be renamed to semantic names (`brand_emblem.png` instead of `image3.png`) when it improves readability.
- 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
- - Library scope: keep bundled assets inside the template package and point SVG references at those package-local files.
- - Project scope: write bitmap assets to `<target_project>/images/`, point SVG references at `../images/<name>`, and keep other package assets under `<target_project>/templates/`.
-4. **Copies `icons/` when present** and preserves every extracted `<use data-icon="..."/>` reference. Library scope keeps one package copy under the template directory. Project scope writes the package/validation copy to `<target_project>/templates/icons/` and an identical runtime copy to `<target_project>/icons/`. Do not inline these assets manually in the template working SVGs; the shared icon embedding path owns re-inlining before export.
+ - 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 extracted `<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.
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 page, but it still reconstructs layer ownership. The sprite-sheet preservation rule applies because flat SVGs already contain the original crop wrappers; do not flatten them when annotating the page.
@@ -369,27 +389,23 @@ Mirror mode does not simplify the visual page, but it still reconstructs layer o
2. Page roster — see [Page Roster](../references/template-designer.md#page-roster) for `standard` / `fidelity` / `mirror` mode rosters, variant naming, and TOC handling
3. 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. 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`, `pptx_masters`, and `pptx_layouts` from planning onward.
-4. Template assets (optional) — library scope bundles Logos / PNG / JPG / reference SVG inside the package; project scope applies the `templates/` / `images/` / dual-icon routing defined above
+4. Template assets (optional) — both scopes apply the same `templates/` / `images/` / dual-icon routing defined above
---
## Step 5: Validate Template Assets
-Set `<template_target>` to the selected output directory:
-
-| Scope | `<template_target>` |
-|---|---|
-| `library` | `skills/ppt-master/templates/<kind_dir>/<template_id>` |
-| `project` | `<target_project>/templates` |
+Set `<template_source>` to `<template_workspace>/templates/` in both scopes.
```bash
-ls -la "<template_target>"
+ls -la "<template_workspace>/templates"
+ls -la "<template_workspace>/images" "<template_workspace>/icons"
```
Run SVG validation on the template directory:
```bash
-python3 skills/ppt-master/scripts/svg_quality_checker.py "<template_target>" --template-mode --format <canvas_format>
+python3 skills/ppt-master/scripts/svg_quality_checker.py "<template_workspace>/templates" --template-mode --format <canvas_format>
```
`--template-mode` makes the checker:
@@ -411,29 +427,56 @@ python3 skills/ppt-master/scripts/svg_quality_checker.py "<template_target>" --t
- [ ] `design_spec.md` frontmatter declares `canvas_format`, `canvas_width`, `canvas_height`, and `canvas_viewbox`; PPTX/SVG-backed templates also declare `source_canvas_width`, `source_canvas_height`, and `source_viewbox`
- [ ] SVG `viewBox` matches the declared canvas dimensions, not just the aspect ratio (for `ppt169`: `0 0 1280 720`; for `banner`: `0 0 1920 1080`); `width` / `height`, if written, equal it
- [ ] Placeholder names follow the canonical convention where applicable; templates with intentionally different vocabularies (e.g. `{{KEY_MESSAGE}}` instead of `{{PAGE_TITLE}}`) should declare a `placeholders:` frontmatter block to silence advisory warnings
-- [ ] Asset files referenced by SVGs exist at their resolved paths. In project scope, bitmap references resolve through `../images/`; no bitmap remains accidentally stranded in `templates/`
+- [ ] Asset files referenced by SVGs exist at their resolved paths. In both scopes, bitmap references resolve through `../images/`; no bitmap remains accidentally stranded in `templates/`
- [ ] `design_spec.md` frontmatter declares `native_structure_mode: structured`; no `native_structure.json` or `source_template.pptx` is packaged
- [ ] Every SVG root declares Master/Layout key and picker names; Master/Layout visuals are direct atoms, never `<g>`, and obey the explicit paint-order contract. Structural `data-pptx-role` is used only when specialized metadata cannot express required package/page-number/animation behavior
- [ ] Every slot is a direct `<g id>` with explicit design-zone bounds and exactly one compatible direct carrier, or an explicit composite `object` proxy; zero-slot Layouts remain valid
- [ ] Every source Layout is represented by a complete template page, or `design_spec.md` records an explicit unsupported reason in `Source Structure Reconstruction`; no silent merge, drop, or re-parenting
-- [ ] If any SVG references an extracted vector `data-icon`, the corresponding SVG asset exists under the package's `icons/` directory. Project scope also has the identical runtime copy under `<target_project>/icons/`; do not add a separate illustration embedding script
+- [ ] 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
- [ ] 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: file count equals source page count (type A: `<template_target>/*_*.svg` matches the cleaned flat `<import_workspace>/svg-flat/slide_*.svg` count; type B: matches the source SVG count); filenames follow the `<NNN>_<page_type>.svg` convention; **no `{{...}}` placeholder strings appear in any copied SVG** (`grep -l "{{" "<template_target>"/*.svg` should return nothing — if the type B source itself contains placeholders, the user should be in `standard` mode, not `mirror`); §V Page Roster in `design_spec.md` lists every emitted file with a one-line description of what the page contains and what content slot it suits
+- [ ] For `mirror` mode: file count equals source page count (type A: `<template_source>/*_*.svg` matches the cleaned flat `<import_workspace>/svg-flat/slide_*.svg` count; type B: matches the source SVG count); filenames follow the `<NNN>_<page_type>.svg` convention; **no `{{...}}` placeholder strings appear in any copied SVG** (`grep -l "{{" "<template_source>"/*.svg` should return nothing — if the type B source itself contains placeholders, the user should be in `standard` mode, not `mirror`); §V Page Roster in `design_spec.md` lists every emitted file with a one-line description of what the page contains and what content slot it suits
-This step is a **hard gate**. In library scope, do not register until validation passes. In project scope, do not hand the in-place bundle to the main pipeline until validation passes.
+This step is a **hard gate**. Do not export the review PPTX, register, or hand the workspace to the main pipeline until validation passes.
---
-## Step 6: Register Template in Library Index (Library Scope Only)
+## Step 6: Export and Verify the Template Review PPTX
+
+Export the complete SVG roster, one prototype per slide, from the workspace root:
+
+```bash
+python3 skills/ppt-master/scripts/template_preview_pptx.py "<template_workspace>"
+```
+
+The default output is `<template_workspace>/exports/<template_id>_template_preview.pptx`. The script consumes `templates/*.svg` directly, compiles the declared structured Master/Layout contract, and reopens the result. It does not require a project `spec_lock.md`, does not create an intermediate project, and does not infer or distill structure.
+
+The first export refuses an existing output. After intentionally fixing the template and replacing its prior review deck, rerun with `--force`; never rely on a silent overwrite:
+
+```bash
+python3 skills/ppt-master/scripts/template_preview_pptx.py "<template_workspace>" --force
+```
+
+**Validation**:
+
+- [ ] Review PPTX exists under `<template_workspace>/exports/`
+- [ ] PPTX slide count equals the template SVG roster count
+- [ ] Package read-back reports the expected Master and Layout counts
+- [ ] The user can open one file and review every template page in deterministic filename order
+
+This step is a **hard gate**. A template that cannot produce its review PPTX is incomplete; fix the owning SVG/spec/asset and rerun Steps 5–6 before registration or handoff.
+
+---
+
+## Step 7: Register Template in Library Index (Library Scope Only)
Branch on the confirmed output scope:
| Scope | Action |
|---|---|
-| `library` | Run the registrar below after Step 5 passes |
-| `project` | Skip the registrar entirely. Do not edit `decks_index.json`, `layouts_index.json`, or any library README; continue to Step 7 with index status `Not registered (project-local)` |
+| `library` | Run the registrar below after Steps 5–6 pass |
+| `project` | Skip the registrar entirely. Do not edit `decks_index.json`, `layouts_index.json`, or any library README; continue to Step 8 with index status `Not registered (project workspace)` |
-Run the unified registrar with the kind flag; it derives the corresponding index entry from `design_spec.md` (frontmatter when present, prose fallback otherwise) plus the actual SVG file list:
+Run the unified registrar with the kind flag; it derives the corresponding index entry from `templates/design_spec.md` (frontmatter when present, prose fallback otherwise) plus the actual `templates/*.svg` file list. The registrar retains read compatibility with old flat library packages; new creation never writes that shape:
```bash
# For deck (default)
@@ -451,9 +494,9 @@ Outputs by kind (the JSON index is the single source of truth — READMEs descri
| `layout` | `templates/layouts/layouts_index.json` |
| `brand` | `templates/brands/brands_index.json` |
-The completion card's file roster is collected by globbing `*.svg` in the template directory.
+The completion card's file roster is collected by globbing `templates/*.svg` in the workspace. Legacy flat packages still use their root `*.svg` roster.
-The index file is a **discovery index** — it lets the AI answer "what templates are available?" by listing names and paths. It is **not** consulted to trigger Step 3 (SKILL.md). Step 3 triggers on an explicit directory path supplied by the user, regardless of whether that path is registered. A template directory that has not been run through `register_template.py` still works fine when the user gives its path; it just won't appear in discovery listings.
+The index file is a **discovery index** — it lets the AI answer "what templates are available?" by listing names and workspace-root paths. It is **not** consulted to trigger Step 3 (SKILL.md). Step 3 triggers on an explicit workspace-root path supplied by the user, regardless of whether that path is registered. An unregistered workspace still works when the user gives its path; it just will not appear in discovery listings.
> **Recommended for new templates**: declare a YAML frontmatter block at the top of `design_spec.md`. The registrar prefers it over prose extraction:
>
@@ -505,54 +548,37 @@ README files describe each kind in prose only — they do not list templates. Di
---
-## Step 7: Output Confirmation
+## Step 8: Output Confirmation
-For `library`, `register_template.py` already printed a "Template Creation Complete" card during Step 6 — copy it verbatim into the conversation. The card includes the template name, path, category, primary color, index status, and the full SVG file roster (auto-collected from disk, so `fidelity`-mode variant pages and TOC pages are listed correctly without manual editing).
-
-For a standard-mode template the card looks like:
+Produce one scope-aware, evidence-driven completion card for either location:
```markdown
## Template Creation Complete
**Template Name**: <template_id> (<display_name>)
**Kind**: deck | layout
-**Template Path**: `templates/<kind_dir>/<template_id>/`
+**Output Scope**: library | project
+**Workspace Path**: `<template_workspace>/`
+**Template Source**: `<template_workspace>/templates/`
+**Bitmap Path**: `<template_workspace>/images/`
+**Runtime Icon Path**: `<template_workspace>/icons/`
+**Review PPTX**: `<template_workspace>/exports/<template_id>_template_preview.pptx`
**Primary Color**: <hex> ← deck only; omit for layout
-**Index Registration**: Done
-
-### Files Included
-
-| File | Status |
-|------|--------|
-| `01_cover.svg` | Done |
-| `02_chapter.svg` | Done |
-| `02_toc.svg` | Done |
-| `03_content.svg` | Done |
-| `04_ending.svg` | Done |
-```
-
-For `project`, produce the same evidence-driven file roster from `<target_project>/templates/*.svg`, but use this scope-aware card:
-
-```markdown
-## Template Creation Complete
-
-**Template Name**: <template_id> (<display_name>)
-**Kind**: deck | layout
-**Output Scope**: project
-**Template Path**: `<target_project>/templates/`
-**Bitmap Path**: `<target_project>/images/`
-**Runtime Icon Path**: `<target_project>/icons/`
-**Index Registration**: Not registered (project-local)
+**Index Registration**: Done | Not registered (project workspace)
### Files Included
| File | Status |
|------|--------|
-| `design_spec.md` | Done |
-| `<actual-template>.svg` | Done |
+| `templates/01_cover.svg` | Done |
+| `templates/02_chapter.svg` | Done |
+| `templates/02_toc.svg` | Done |
+| `templates/03_content.svg` | Done |
+| `templates/04_ending.svg` | Done |
+| `exports/<template_id>_template_preview.pptx` | Verified |
```
-The next main-pipeline Step 3 input is the exact `<target_project>/templates/` path. It is an in-place bundle: do not copy it onto itself and do not move its `../images/` assets again. Do not reuse this root from another project; choose library scope when cross-project portability is required.
+The next main-pipeline Step 3 input is the exact `<template_workspace>/` root in either scope. Step 3 resolves its `templates/design_spec.md`, ignores `exports/`, and copies or consumes `templates/`, `images/`, and `icons/` as one unit. A legacy flat package root remains readable, but directory flatness alone is not a legacy Master/Layout condition and does not trigger `restore-pptx-structure`.
---
@@ -572,6 +598,7 @@ The next main-pipeline Step 3 input is the exact `<target_project>/templates/` p
1. **SVG technical constraints**: See [shared-standards.md](../references/shared-standards.md) — do not restate them in the template's `design_spec.md`
2. **Color consistency**: All SVG files must use the same color scheme as `design_spec.md §II Color Scheme`
3. **Placeholder convention**: `{{}}` format only; default names listed in [Placeholder Reference](../references/template-designer.md#4-placeholder-reference-canonical-convention-overridable-per-template). Override per template via `placeholders:` frontmatter when needed.
-4. **Discovery requirement**: A library template is discoverable only after `register_template.py` has been run against it (Step 6). A project-scoped template intentionally stays out of global discovery and is consumed by its explicit `<project>/templates/` path.
+4. **Discovery requirement**: A library template is discoverable only after `register_template.py` has been run against it (Step 7). A project-scoped workspace intentionally stays out of global discovery and is consumed by its explicit workspace-root path.
+5. **Review requirement**: Every completed deck/layout template has a verified `exports/<template_id>_template_preview.pptx`; it is never a source input during template application.
> **Full role specification**: [template-designer.md](../references/template-designer.md)
diff --git a/skills/ppt-master/workflows/index.md b/skills/ppt-master/workflows/index.md
index 3989e47c..34c0e90b 100644
--- a/skills/ppt-master/workflows/index.md
+++ b/skills/ppt-master/workflows/index.md
@@ -17,11 +17,11 @@ Registry for standalone workflows referenced by `SKILL.md` and [`routing.md`](./
| `topic-research` | [`topic-research.md`](./topic-research.md) | Topic-only request with no substantive source material | Topic or requirements exist | Do not invent facts in the main pipeline | Before `SKILL.md` Step 1 | Source material suitable for Step 1 | Stops if usable source facts cannot be gathered |
| `template-fill-pptx` | [`template-fill-pptx.md`](./template-fill-pptx.md) | Raw PPTX template plus new material/topic; clone/fill native slides | Source PPTX plus content material or topic brief | No SVG generation; no `create-template` unless reusable package is requested | Workflow Step 1 | Native PPTX in project `exports/` | Stops if no PPTX or no fill material |
| `beautify-pptx` | [`beautify-pptx.md`](./beautify-pptx.md) | Existing PPTX should be re-laid out while preserving slide count/order and wording 1:1 | Single source PPTX | Not for merge/split/drop/reorder or re-outline | Workflow Step 1 | Regenerated 1:1 deck through SVG pipeline | Blocks on source-slide mapping and final confirmation gates defined in the workflow |
-| `create-template` | [`create-template.md`](./create-template.md) | Build a reusable layout/deck template from a PPTX or design reference, globally or for one initialized project | Design source or explicit template-creation request; project scope also requires an initialized target project | Does not fill final content or emit the generated deck | Workflow Step 1 | Library scope (default): indexed `templates/<kind>/<id>/`; project scope: in-place `<project>/templates/` bundle with bitmaps in `images/` and no global registration | Library scope stops until the user supplies the directory path to main Step 3; project scope may continue with its in-place path after validation |
+| `create-template` | [`create-template.md`](./create-template.md) | Build a reusable layout/deck template from a PPTX or design reference, globally or for one initialized project | Design source or explicit template-creation request; project scope also requires an initialized target project | Does not fill final content; its PPTX is a review of the template roster, not a generated content deck | Workflow Step 1 | Both scopes produce a complete workspace containing `templates/`, `images/`, `icons/`, and `exports/<id>_template_preview.pptx`; library root is `skills/ppt-master/templates/<kind>/<id>/`, project root is `projects/<name>/`; only library scope is registered | Return the exact workspace root to main Step 3; the target project's own root may continue in place after validation and preview export |
| `create-brand` | [`create-brand.md`](./create-brand.md) | Build/extract a reusable brand identity preset | Logo/site/branded deck/PDF or explicit brand setup request | Not a layout/deck template roster | Workflow Step 1 | Brand directory under `templates/brands/<id>/` | Blocks on brand evidence and validation defined in the workflow |
| `resume-execute` | [`resume-execute.md`](./resume-execute.md) | Continue an existing split-mode project | Planning-session artifacts exist | Do not re-run planning | Execution-session entry | SVG generation, post-processing, export | Stops if `design_spec.md` or `spec_lock.md` is missing |
| `refine-spec` | [`refine-spec.md`](./refine-spec.md) | User explicitly opts into spec refinement before generation | Strategist confirmation stage completed | Do not enter by default | After Step 4, before Step 5/6 | Revised `design_spec.md` and `spec_lock.md` | Blocks for user review/approval before generation |
-| `restore-pptx-structure` | [`restore-pptx-structure.md`](./restore-pptx-structure.md) | Existing project or template uses a legacy/unmapped PowerPoint structure contract | Legacy SVG project/package exists; original PPTX/native facts are preferred when available | Not part of normal new-project generation; exporter never migrates implicitly | Before Step 3 template use, SVG generation, or export | Current structured SVGs plus complete Master/Layout lock mapping | Blocks only when restoration requires an unresolved design decision |
+| `restore-pptx-structure` | [`restore-pptx-structure.md`](./restore-pptx-structure.md) | Existing project or template uses a legacy/unmapped PowerPoint structure contract | Legacy SVG project/package exists; original PPTX/native facts are preferred when available; legacy-flat packaging alone is not a trigger | Not part of normal new-project generation; exporter never migrates implicitly | Before Step 3 template use, SVG generation, or export | Current structured SVGs plus complete Master/Layout lock mapping | Blocks only when restoration requires an unresolved design decision |
| `verify-charts` | [`verify-charts.md`](./verify-charts.md) | Deck contains data charts that require coordinate calibration | SVG pages exist | Not needed for decks without data charts | Between Step 6 and Step 7 | Verified/fixed chart geometry | Blocks on chart coordinate errors |
| `customize-animations` | [`customize-animations.md`](./customize-animations.md) | User asks for object-level animation order/effect/timing | Target deck/SVG groups exist | Do not add per-element builds by default | Before or during export configuration | `animations.json` or equivalent validated config | Blocks if target objects cannot be identified |
| `native-enhance-pptx` | [`native-enhance-pptx.md`](./native-enhance-pptx.md) | Finished PPTX should keep content/layout stable while adding notes/audio/timing/transitions | Source PPTX exists | No SVG regeneration | Workflow Step 1 | Patched PPTX through OOXML | Blocks on source archive/validation failures |
diff --git a/skills/ppt-master/workflows/restore-pptx-structure.md b/skills/ppt-master/workflows/restore-pptx-structure.md
index de7fd7fa..b04fc94f 100644
--- a/skills/ppt-master/workflows/restore-pptx-structure.md
+++ b/skills/ppt-master/workflows/restore-pptx-structure.md
@@ -4,10 +4,12 @@ description: Restore legacy SVG projects to the explicit structured Master/Layou
# Restore PPTX Structure Workflow
-Restore an existing SVG-authored project before quality checking or release export when its Master/Layout contract is absent or legacy.
+Restore an existing SVG-authored project or template before quality checking or release export when its Master/Layout contract is absent or legacy.
**Trigger**: Run when `svg_quality_checker.py` or `svg_to_pptx.py` reports a missing or legacy `pptx_structure.mode`, or when the user explicitly asks to migrate an older SVG project.
+**Hard rule — structure, not packaging**: Directory shape is not PowerPoint structure evidence. A current template workspace uses `templates/design_spec.md`; a compatible legacy-flat package uses `design_spec.md` at its root. Do not run this workflow merely to move a flat package into the current workspace shape.
+
---
## 1. Route Boundary
@@ -18,13 +20,15 @@ Restore an existing SVG-authored project before quality checking or release expo
| Legacy `template`, `layout_strategy: distill`, `data-pptx-layout-kind`, or `utility` | Replace the distillation contract with one explicit structured contract |
| Legacy `preserve` plus `native_structure.json` / `source_template.pptx` | Use the native facts as restoration evidence; rebuild the SVG contract instead of preserving package parts |
| Existing `mode: structured` project | Validate and repair only the reported mismatch; do not re-infer the deck |
+| Legacy-flat template package whose SVG roots and slots already satisfy the current structured contract | Consume it through the compatibility reader; do not restore or relocate it solely because `design_spec.md` and SVGs are flat |
+| Current template workspace with `templates/`, `images/`, `icons/`, and `exports/` | Inspect SVG metadata to decide whether restoration is needed; the workspace folders themselves do not prove or disprove structure |
| Raw PPTX intended as a reusable template | Run [`create-template`](./create-template.md), not this workflow |
| Existing PPTX receiving notes/audio/timing/transitions | Keep the direct [`native-enhance-pptx`](./native-enhance-pptx.md) route; do not create SVGs |
| Raw PPTX template receiving new content | Keep the direct [`template-fill-pptx`](./template-fill-pptx.md) route |
**Hard rule**: Keep restoration in the main agent and inspect the complete page roster. Do not delegate page classification, cluster by visual similarity, or write a batch SVG generator.
-🚧 **GATE**: Read `spec_lock.md`, every file in `svg_output/`, every template SVG named by `page_layouts`, and any original PPTX/native structure facts that belong to this project.
+🚧 **GATE**: Take the explicit project/template workspace root as input. For a project, read `spec_lock.md`, every file in `svg_output/`, and every template SVG named by `page_layouts`. For a template, resolve `templates/design_spec.md` first and fall back to legacy root `design_spec.md`, then read every sibling template SVG. In either case, read any original PPTX/native structure facts that belong to the workspace.
---
@@ -40,6 +44,8 @@ Record the source evidence used for restoration in a short `README.md` inside th
**Hard rule**: Never delete the legacy sources during restoration. If the requested migration would rewrite several existing files and the user has not already authorized that operation, obtain the repository-required bulk-modification confirmation first.
+**Hard rule — no packaging migration**: Keep the input workspace/package placement unchanged. This workflow edits the semantic SVG/lock contract only; it does not normalize a legacy-flat package into `templates/`, `images/`, `icons/`, and `exports/`.
+
---
## 3. Determine the Structure
@@ -52,6 +58,8 @@ Use this evidence priority:
| 2 | Legacy template SVGs or explicit legacy structure metadata | Preserve stable identities and reusable geometry after removing legacy-only fields |
| 3 | Completed SVG pages only | Classify deliberately across the full deck; do not let the exporter infer structure |
+**Hard rule**: Decide from SVG/lock semantics, never from whether `design_spec.md` is at the workspace root or under `templates/`.
+
Classify each visible object:
| Classification | SVG representation |
diff --git a/skills/ppt-master/workflows/routing.md b/skills/ppt-master/workflows/routing.md
index 8c3aa87f..4acd4609 100644
--- a/skills/ppt-master/workflows/routing.md
+++ b/skills/ppt-master/workflows/routing.md
@@ -27,7 +27,7 @@ Route selection authority for PPT Master. Use this file before entering the main
| Route family | SVG contract |
|---|---|
| Main SVG pipeline and `beautify-pptx` | Every visible output-page object is authored in the completed page SVG; templates and locks guide authoring but are not export-time visual overlays. |
-| `create-template` | Each reusable template SVG is a complete visual reference plus explicit PowerPoint structure metadata. |
+| `create-template` | Each reusable template SVG is a complete visual reference plus explicit PowerPoint structure metadata. Library and project outputs use the same complete workspace shape: `templates/`, `images/`, `icons/`, and `exports/<id>_template_preview.pptx`. |
| `template-fill-pptx` and `native-enhance-pptx` | Native PPTX editing routes. They retain their OOXML contracts and are not forced through SVG. |
| Animation, transition, speaker-note, and narration workflows | Presentation behavior/content outside the visible page-design layer; keep their dedicated sidecars and package post-processing. |
@@ -42,7 +42,7 @@ Route selection authority for PPT Master. Use this file before entering the main
| Topic only, no source facts | User supplies only a topic name or requirement and no substantive source material | [`topic-research`](./topic-research.md), then main `SKILL.md` pipeline | Direct main pipeline with invented facts | Web/source gathering is allowed or user supplies facts | Research material becomes source input for Step 1 | Stop if facts cannot be gathered and the user supplies no source |
| Source material can be reworked into a new story | PDF/DOCX/URL/Markdown/text/conversation content, or PPTX treated as content | Main `SKILL.md` pipeline | Direct PPTX edit workflows | Source content exists or is available in conversation | `design_spec.md`, `spec_lock.md`, `svg_output/`, exported PPTX | Stop at Step gates when required artifacts are missing |
| PPTX as re-architectable source | User allows page count/order/outline to change, or asks to split/merge/drop/reorder slides | Main `SKILL.md` pipeline with `ppt_to_md.py` plus PPTX intake | [`beautify-pptx`](./beautify-pptx.md) | PPTX source exists | Markdown content plus `analysis/source_profile.json`; Strategist may re-outline | Stop if user requires exact 1:1 page preservation |
-| Explicit template directory path | User provides a directory containing `design_spec.md` with `kind: brand`, `kind: layout`, or `kind: deck` | Main `SKILL.md` Step 3 | Fuzzy template lookup by bare name | Path resolves, frontmatter kind is valid, and every deck/layout SVG satisfies the current structured Master/Layout/slot contract | External assets are copied/fused into `<project>/templates/`; the same project's own `templates/` path is consumed in place | Route a legacy package to [`restore-pptx-structure`](./restore-pptx-structure.md) before Step 3; stop if the path does not exist or lacks valid `design_spec.md` |
+| Explicit template workspace path | User provides a current layout/deck workspace root containing `templates/design_spec.md`, a compatible legacy-flat layout/deck root containing `design_spec.md`, or an existing brand directory under its unchanged direct-spec contract | Main `SKILL.md` Step 3 | Fuzzy template lookup by bare name; passing a current workspace's inner `templates/` directory instead of its root | Path resolves, frontmatter kind is valid, and every deck/layout SVG satisfies the current structured Master/Layout/slot contract | Stage `templates/`, `images/`, and `icons/` from the explicit workspace root into the target project peers; consume the target project's own root in place; never consume the review-only `exports/` directory | Route only a structurally legacy SVG contract to [`restore-pptx-structure`](./restore-pptx-structure.md) before Step 3; a legacy-flat directory shape alone remains compatible and does not trigger restoration |
---
@@ -53,7 +53,7 @@ Route selection authority for PPT Master. Use this file before entering the main
| Raw PPTX template plus new material/topic | "Use this PPT template to generate a PPTX", "fill this deck", "replace copy", native slide shell reuse | [`template-fill-pptx`](./template-fill-pptx.md) | Main SVG pipeline directly from raw PPTX template | Source PPTX plus content material or topic brief | New native PPTX in `exports/`, cloned/patched by OOXML | Stop if user instead wants a reusable template package |
| Existing PPTX, preserve page split and wording | "Beautify", "re-layout", "make more professional" with same slide count/order and verbatim text | [`beautify-pptx`](./beautify-pptx.md) | Main pipeline if page count/order changes | Single source PPTX | Regenerated deck through SVG pipeline, one source slide to one output slide | Stop if user asks to split/merge/drop/reorder |
| Finished PPTX, native enhancement only | Add notes, recorded narration, auto-advance, transitions, or stable-layout metadata | [`native-enhance-pptx`](./native-enhance-pptx.md) | SVG regeneration | Finished PPTX exists; content/layout should stay stable | Patched PPTX through direct OOXML | Stop if user asks for visual redesign |
-| PPTX/reference design should become a reusable template | "Create a template", "make reusable", "build template from this deck/design", including a template for one named initialized project | [`create-template`](./create-template.md) | `template-fill-pptx` one-off fill | PPTX/design reference exists, or the user gives an explicit template-creation brief; project output additionally requires an initialized target project | Library scope (default): `templates/<kind>/<id>/` plus index registration; project scope: direct `<project>/templates/` thin bundle with no global registration | Stop after library creation until the user supplies its directory path; project scope may resume main Step 3 with the in-place `<project>/templates/` path |
+| PPTX/reference design should become a reusable template | "Create a template", "make reusable", "build template from this deck/design", including a template for one named initialized project | [`create-template`](./create-template.md) | `template-fill-pptx` one-off fill | PPTX/design reference exists, or the user gives an explicit template-creation brief; project output additionally requires an initialized target project | Both scopes produce one complete workspace with `templates/`, `images/`, `icons/`, and `exports/<id>_template_preview.pptx`; library root is `skills/ppt-master/templates/<kind>/<id>/`, project root is `projects/<name>/`; only library scope is registered | Return the exact workspace root for main Step 3; the target project's own root may resume in place after validation and preview export |
**Hard rule**: Raw PPTX template plus "generate PPTX" routes to `template-fill-pptx` by default. A raw PPTX is not a Step 3 template until `create-template` has produced a reusable template directory.
@@ -68,7 +68,7 @@ Route selection authority for PPT Master. Use this file before entering the main
| Brand identity setup | Brand asset, brand site URL, branded PPTX/PDF, or explicit brand setup request | [`create-brand`](./create-brand.md) | Brand source exists or can be inspected | Brand preset under `templates/brands/<id>/` | Stop if no brand source or brand intent exists |
| Continue a split-mode project | "Continue generating `projects/<name>`" after the planning session | [`resume-execute`](./resume-execute.md) | Project has planning-session artifacts | Execution-session SVG generation and export | Stop if required planning artifacts are missing |
| Refine spec before generation | User explicitly asks to refine/review/revise the spec before SVG work, or confirms `refine_spec: true` | [`refine-spec`](./refine-spec.md) | Strategist confirmation stage completed | Revised `design_spec.md` and `spec_lock.md` before Step 5/6 | Stop until user approves the refined spec |
-| Restore legacy PowerPoint structure | Existing project/template SVGs use unmapped `baseline`, `preserve`, `layout_strategy: distill`, `data-pptx-layout-kind`, `distilled`/`utility`, direct atomic placeholders, or lack root Master identity | [`restore-pptx-structure`](./restore-pptx-structure.md) before generation/export or before Step 3 template consumption | Legacy SVG project/package exists; original PPTX/native facts are used when available | Current structured SVG contract plus complete `pptx_masters`/`pptx_layouts` mapping | Stop if structure cannot be restored without an explicit design decision |
+| Restore legacy PowerPoint structure | Existing project/template SVGs use unmapped `baseline`, `preserve`, `layout_strategy: distill`, `data-pptx-layout-kind`, `distilled`/`utility`, direct atomic placeholders, or lack root Master identity | [`restore-pptx-structure`](./restore-pptx-structure.md) before generation/export or before Step 3 template consumption | Legacy SVG project/package exists; original PPTX/native facts are used when available; a flat package directory by itself is not a trigger | Current structured SVG contract plus complete `pptx_masters`/`pptx_layouts` mapping | Stop if structure cannot be restored without an explicit design decision |
| Data chart calibration | Generated deck contains data charts | [`verify-charts`](./verify-charts.md) between Step 6 and Step 7 | SVG pages exist | Calibrated chart coordinates before export | Stop on chart geometry errors until fixed |
| Object-level animation tuning | User asks for animation order, timing, effects, or object reveal behavior | [`customize-animations`](./customize-animations.md) | SVG groups / exported context exist | `animations.json` or validated animation config | Stop if requested target objects cannot be identified |
| Live preview / element selection / annotations | User mentions live preview, preview, visual check in browser, clicking/selecting an element, or applying browser annotations | [`live-preview`](./live-preview.md) | Project exists; for annotation apply, generated SVGs exist | Running preview service or applied annotations plus re-export | Stop only if project path or SVGs are missing |
@@ -81,9 +81,11 @@ Route selection authority for PPT Master. Use this file before entering the main
| User input | Route behavior |
|---|---|
-| Explicit directory path containing a valid template `design_spec.md` | Enter main Step 3 template option |
+| Explicit current layout/deck workspace root containing `templates/design_spec.md` | Enter main Step 3 template option; use the workspace root, not its inner `templates/` directory |
+| Explicit legacy-flat layout/deck root containing `design_spec.md` | Enter main Step 3 through the compatibility reader; flat packaging alone does not require structure restoration |
+| Explicit brand directory containing `design_spec.md` | Enter main Step 3 under the existing `create-brand` contract; brand packaging is unchanged by `create-template` workspace rules |
| Bare template name, brand name, style label, or vague "use a template" | Do not trigger Step 3; treat as style input for Strategist confirmation stage |
| User asks "what templates exist?" | Answer as Q&A by listing indexed paths; do not advance the pipeline |
| Raw `.pptx` called a template | Route by §3, usually `template-fill-pptx`; never treat it as a Step 3 template path |
-**Forbidden - fuzzy resolution**: Do not resolve bare names to local template directories on the user's behalf. The user must provide the path that enters Step 3.
+**Forbidden - fuzzy resolution**: Do not resolve bare names to local template directories on the user's behalf. The user must provide the path that enters Step 3. For a current layout/deck package, that path is the workspace root.