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

feat(beautify): content-faithful PPT re-layout workflow + identity/inventory extractors

hugohe36b7d531aca80
diff --git a/AGENTS.md b/AGENTS.md
index 2eae10e4..c38f60ef 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -14,6 +14,8 @@ PPT Master is an AI-driven presentation generation system. Multi-role collaborat
>
> Template fill: when the user provides an existing `.pptx` template plus text materials or a topic and asks to reuse the original PPT design or fill content back into it (for example, "fill this deck with the new content", "fill this back into the template", or "reuse this deck's design"), run the standalone [`template-fill-pptx`](skills/ppt-master/workflows/template-fill-pptx.md) workflow. This route edits PPTX directly and must not enter the SVG generation pipeline.
>
+> Beautify / re-layout: when the user provides an existing `.pptx` and asks to beautify or re-layout it while keeping the content (for example, "把这份 PPT 美化一下", "重新排版,内容别动", or wants to paste the regenerated elements back into the original deck), run the standalone [`beautify-pptx`](skills/ppt-master/workflows/beautify-pptx.md) workflow. Mirror of template-fill: content is preserved verbatim, the source's palette/fonts are inherited as truth, only layout is redesigned. Unlike template-fill, it regenerates a native deck through the SVG pipeline (Strategist → Executor → export), one source slide to one page; it does not edit the source in place.
+>
> Phase B resumption (split-mode execution): when the user opens a fresh chat and says "继续生成 projects/<x>" or similar, run the standalone [`resume-execute`](skills/ppt-master/workflows/resume-execute.md) workflow to enter Phase B (SVG generation + export) without re-running Phase A.
>
> Spec refinement (opt-in): when the user explicitly asks to refine / review / revise the spec before generation (for example "refine the spec first", "review the spec before generating", "send me the spec to confirm first"), run the standalone [`refine-spec`](skills/ppt-master/workflows/refine-spec.md) workflow. Strategist produces the full `design_spec.md` + `spec_lock.md` first, then stops so the user can revise any part of it (outline, color, typography, layout, image strategy, …) before any image or SVG work; on approval the pipeline resumes at Step 5/6. Default is OFF — no request means the spec is written in one pass and the pipeline auto-proceeds. Surfaced as an opt-in line in the Eight Confirmations, same shape as the split-mode note; never enter it unprompted.
diff --git a/CLAUDE.md b/CLAUDE.md
index 7a465c0f..9e5f34e1 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -14,6 +14,8 @@ PPT Master is an AI-driven presentation generation system. Multi-role collaborat
>
> Template fill: when the user provides an existing `.pptx` template plus text materials or a topic and asks to reuse the original PPT design or fill content back into it (for example, "fill this deck with the new content", "fill this back into the template", or "reuse this deck's design"), run the standalone [`template-fill-pptx`](skills/ppt-master/workflows/template-fill-pptx.md) workflow. This route edits PPTX directly and must not enter the SVG generation pipeline.
>
+> Beautify / re-layout: when the user provides an existing `.pptx` and asks to beautify or re-layout it while keeping the content (for example, "把这份 PPT 美化一下", "重新排版,内容别动", or wants to paste the regenerated elements back into the original deck), run the standalone [`beautify-pptx`](skills/ppt-master/workflows/beautify-pptx.md) workflow. Mirror of template-fill: content is preserved verbatim, the source's palette/fonts are inherited as truth, only layout is redesigned. Unlike template-fill, it regenerates a native deck through the SVG pipeline (Strategist → Executor → export), one source slide to one page; it does not edit the source in place.
+>
> Phase B resumption (split-mode execution): when the user opens a fresh chat and says "继续生成 projects/<x>" or similar, run the standalone [`resume-execute`](skills/ppt-master/workflows/resume-execute.md) workflow to enter Phase B (SVG generation + export) without re-running Phase A.
>
> Spec refinement (opt-in): when the user explicitly asks to refine / review / revise the spec before generation (for example "refine the spec first", "review the spec before generating", "send me the spec to confirm first"), run the standalone [`refine-spec`](skills/ppt-master/workflows/refine-spec.md) workflow. Strategist produces the full `design_spec.md` + `spec_lock.md` first, then stops so the user can revise any part of it (outline, color, typography, layout, image strategy, …) before any image or SVG work; on approval the pipeline resumes at Step 5/6. Default is OFF — no request means the spec is written in one pass and the pipeline auto-proceeds. Surfaced as an opt-in line in the Eight Confirmations, same shape as the split-mode note; never enter it unprompted.
diff --git a/skills/ppt-master/SKILL.md b/skills/ppt-master/SKILL.md
index dcb78e9d..5321bf0f 100644
--- a/skills/ppt-master/SKILL.md
+++ b/skills/ppt-master/SKILL.md
@@ -79,6 +79,7 @@ For complete tool documentation, see `${SKILL_DIR}/scripts/README.md`.
|----------|------|---------|
| `topic-research` | `workflows/topic-research.md` | Pre-pipeline — gather web sources when the user supplies only a topic with no source files |
| `template-fill` | `workflows/template-fill-pptx.md` | Give a native PPTX template deck plus source material; select fitting pages (a page may be reused for several output slides) and fill text back without SVG conversion |
+| `beautify` | `workflows/beautify-pptx.md` | Re-layout an existing PPTX through the SVG pipeline — preserve its text verbatim, inherit its palette/fonts as truth, redo only layout; mirror of `template-fill` |
| `create-template` | `workflows/create-template.md` | Standalone layout template creation workflow |
| `create-brand` | `workflows/create-brand.md` | Standalone brand-only template creation (identity preset; no SVG page roster) |
| `resume-execute` | `workflows/resume-execute.md` | Phase B entry — resume execution in a fresh chat after Phase A (Step 1–5) completed in another session (split mode) |
diff --git a/skills/ppt-master/references/strategist.md b/skills/ppt-master/references/strategist.md
index 60d1f549..0c396786 100644
--- a/skills/ppt-master/references/strategist.md
+++ b/skills/ppt-master/references/strategist.md
@@ -56,6 +56,7 @@ The deck's **narrative + persuasion skeleton** — how the argument is organized
**Source**:
- User supplied their own outline / structure → it is authoritative. Transcribe it into `§IX` as given (page order + titles preserved); still lock a mode, but for register / voice and page-internal treatment, **not** to reshape — never reorder the user's pages or rewrite their given titles. Note in `design_spec.md` that the structure is user-authored. `briefing` imposes the least if no particular "讲法" is intended.
+- Beautify / re-layout workflow ([`beautify-pptx.md`](../workflows/beautify-pptx.md)) → the extracted source content is authoritative and **verbatim**, one step stricter than the user-outline case above. Each source slide becomes exactly one `§IX` page in source order; transcribe every content block word-for-word — never reshape / re-primary / condense / merge / split / reword. Lock `mode: briefing`; color (e) and typography (g) are the source identity the user confirmed in the beautify plan (theme or observed usage), locked as truth (skip both recommendation flows). Charts / tables / images are regenerated from their extracted data in the inherited style (route chart/table data to §VII, pictures to §VIII) — data values stay frozen, the rendering is the deck's own; never carried over verbatim. Layout, hierarchy, rhythm, and visual rendering are what gets redesigned.
- A bespoke direction the five don't give — a nameable cadence (dialectic 正反合, myth-vs-reality, countdown, Socratic), a multi-act fusion of modes, or the user's own feel (confrontational here, detached there). Either the user asks, **or you recommend it** when a fusion / bespoke direction genuinely serves the deck better than a single preset (a recommendation the user confirms, like every lock). The *kind* doesn't matter → `mode: custom` + a `mode_behavior:` paragraph that **crystallizes the intent** (act sequence or posture shifts, title voice, page rhythm, register) concretely enough for the Executor to follow per page; it reads only `spec_lock.md`, never the chat. One deck locks **one** value — a fusion is one `custom` describing the acts, never several modes. Avoid only the *dodge*: don't default to `custom` when a preset genuinely fits, and prefer a dominant mode + page-level variation when one mode leads.
- No user structure or cadence → recommend by the index's auto-selection table (content / audience signal → mode) plus the deck's stated purpose; the mode does the structural lifting. Present as a recommendation; the user may override.
diff --git a/skills/ppt-master/scripts/beautify_identity.py b/skills/ppt-master/scripts/beautify_identity.py
new file mode 100644
index 00000000..31332769
--- /dev/null
+++ b/skills/ppt-master/scripts/beautify_identity.py
@@ -0,0 +1,180 @@
+#!/usr/bin/env python3
+"""
+PPT Master - Beautify Identity Extractor
+
+Extract a source deck's visual identity as JSON for the beautify-pptx workflow:
+the declared `theme` (palette + major/minor fonts) plus `observed` usage
+(run-level fonts incl. CJK `ea`, and frequent explicit fill colors) sampled
+across slides — so the workflow can recommend theme vs actual-usage identity
+and let the user confirm. Pure read: reuses the pptx_to_svg resolver, writes
+no PPTX.
+
+Usage:
+ python3 scripts/beautify_identity.py <source.pptx> [-o identity.json]
+
+Examples:
+ python3 scripts/beautify_identity.py projects/x/sources/deck.pptx
+ python3 scripts/beautify_identity.py deck.pptx -o projects/x/analysis/identity.json
+
+Dependencies:
+ None beyond the standard library (reuses scripts/pptx_to_svg/).
+
+See workflows/beautify-pptx.md for how the emitted identity is consumed.
+"""
+
+from __future__ import annotations
+
+import argparse
+import json
+import sys
+from pathlib import Path
+from typing import Optional
+
+_SCRIPTS_DIR = Path(__file__).resolve().parent
+if str(_SCRIPTS_DIR) not in sys.path:
+ sys.path.insert(0, str(_SCRIPTS_DIR))
+
+from pptx_to_svg.color_resolver import ColorPalette # noqa: E402
+from pptx_to_svg.emu_units import NS # noqa: E402
+from pptx_to_svg.ooxml_loader import OoxmlPackage # noqa: E402
+
+
+def _font_pair(theme_root, font_tag: str) -> dict[str, str]:
+ """Read one <a:majorFont> / <a:minorFont> into {latin, ea} (skip empties)."""
+ out: dict[str, str] = {}
+ font = theme_root.find(f".//a:fontScheme/a:{font_tag}", NS)
+ if font is None:
+ return out
+ for slot, key in (("a:latin", "latin"), ("a:ea", "ea"), ("a:cs", "cs")):
+ elem = font.find(slot, NS)
+ if elem is not None:
+ face = (elem.attrib.get("typeface") or "").strip()
+ if face:
+ out[key] = face
+ return out
+
+
+def _rank(counter: dict[str, int], limit: int) -> list[dict]:
+ """Frequency-ranked [{value, count}, ...], most common first."""
+ ranked = sorted(counter.items(), key=lambda kv: (-kv[1], kv[0]))
+ return [{"value": v, "count": n} for v, n in ranked[:limit]]
+
+
+def _sample_observed(pkg: "OoxmlPackage") -> dict:
+ """Aggregate run-level fonts + explicit (non-theme) fill colors across slides.
+
+ Theme extraction reports the *declared* identity; a hand-edited deck often
+ overrides it per shape / run. This is a frequency sample of run-level usage
+ (not a full style resolution — it misses schemeClr + master/layout
+ inheritance, and counts chart/gradient fills), enough for the workflow to
+ recommend theme vs observed.
+ """
+ latin: dict[str, int] = {}
+ ea: dict[str, int] = {}
+ colors: dict[str, int] = {}
+ for slide in pkg.iter_slides():
+ root = slide.part.xml
+ for tag, bucket in (("a:latin", latin), ("a:ea", ea)):
+ for elem in root.iterfind(f".//{tag}", NS):
+ face = (elem.attrib.get("typeface") or "").strip()
+ if face and not face.startswith("+"): # skip +mj-*/+mn-* theme refs
+ bucket[face] = bucket.get(face, 0) + 1
+ for elem in root.iterfind(".//a:srgbClr", NS):
+ val = (elem.attrib.get("val") or "").strip().upper()
+ if val:
+ colors[f"#{val}"] = colors.get(f"#{val}", 0) + 1
+ return {
+ "fonts": {"latin": _rank(latin, 5), "ea": _rank(ea, 5)},
+ "colors": _rank(colors, 8),
+ }
+
+
+def extract_identity(pptx_path: Path) -> dict:
+ """Resolve the deck's theme + observed-usage identity, plus canvas."""
+ with OoxmlPackage(pptx_path) as pkg:
+ first = pkg.get_slide(1)
+ master = first.master if first else None
+ theme = pkg.resolve_theme(master)
+ palette_resolver = ColorPalette(master, theme)
+
+ # Presentation-level scheme names; ColorPalette applies clrMap + aliases.
+ scheme = {
+ "background": palette_resolver.resolve_scheme("bg1"),
+ "background_alt": palette_resolver.resolve_scheme("bg2"),
+ "text": palette_resolver.resolve_scheme("tx1"),
+ "text_alt": palette_resolver.resolve_scheme("tx2"),
+ "hyperlink": palette_resolver.resolve_scheme("hlink"),
+ }
+ accents = {
+ f"accent{i}": palette_resolver.resolve_scheme(f"accent{i}")
+ for i in range(1, 7)
+ }
+ palette = {
+ k: (f"#{v}" if v else None)
+ for k, v in {**scheme, **accents}.items()
+ }
+ # accent1 is the conventional primary.
+ palette["primary"] = palette.get("accent1")
+
+ fonts = {}
+ if theme is not None:
+ fonts = {
+ "title": _font_pair(theme.xml, "majorFont"),
+ "body": _font_pair(theme.xml, "minorFont"),
+ }
+
+ w, h = pkg.slide_size_px
+ canvas = {
+ "width_px": round(w),
+ "height_px": round(h),
+ "aspect": round(w / h, 4) if h else None,
+ }
+
+ return {
+ "source": str(pptx_path),
+ "slide_count": pkg.slide_count,
+ "canvas": canvas,
+ "theme": {"palette": palette, "fonts": fonts},
+ "observed": _sample_observed(pkg),
+ }
+
+
+def build_parser() -> argparse.ArgumentParser:
+ parser = argparse.ArgumentParser(
+ description="Extract a source deck's theme palette + fonts + canvas as JSON.",
+ formatter_class=argparse.RawDescriptionHelpFormatter,
+ )
+ parser.add_argument("source", help="Source .pptx file")
+ parser.add_argument(
+ "-o", "--output",
+ help="Write JSON here (default: stdout)",
+ )
+ return parser
+
+
+def main(argv: Optional[list[str]] = None) -> int:
+ args = build_parser().parse_args(argv)
+ src = Path(args.source)
+ if not src.is_file():
+ print(f"[ERROR] source not found: {src}", file=sys.stderr)
+ return 1
+
+ try:
+ identity = extract_identity(src)
+ except (RuntimeError, KeyError, ValueError) as exc:
+ print(f"[ERROR] failed to extract identity: {exc}", file=sys.stderr)
+ return 1
+
+ payload = json.dumps(identity, ensure_ascii=False, indent=2)
+ if args.output:
+ out = Path(args.output)
+ out.parent.mkdir(parents=True, exist_ok=True)
+ out.write_text(payload + "\n", encoding="utf-8")
+ print(f"[OK] identity written to: {out}", file=sys.stderr)
+ else:
+ print(payload)
+ return 0
+
+
+if __name__ == "__main__":
+ raise SystemExit(main())
diff --git a/skills/ppt-master/scripts/beautify_inventory.py b/skills/ppt-master/scripts/beautify_inventory.py
new file mode 100644
index 00000000..f6eeb4de
--- /dev/null
+++ b/skills/ppt-master/scripts/beautify_inventory.py
@@ -0,0 +1,164 @@
+#!/usr/bin/env python3
+"""
+PPT Master - Beautify Inventory Builder
+
+Mechanically merge a source deck's extracts into one per-slide ledger for the
+beautify-pptx workflow: text blocks + tables + charts (from a
+`template_fill_pptx.py analyze` slide_library.json) joined with the images
+bound to each slide (from a `ppt_to_md.py` image_manifest.json). The deterministic
+join only — `ignored` and `needs_confirmation` are emitted empty for the agent
+to fill with judgment (hidden shapes, combo charts, overcrowded pages, ...).
+
+Usage:
+ python3 scripts/beautify_inventory.py <slide_library.json> [--images <image_manifest.json>] [-o inventory.json]
+
+Examples:
+ python3 scripts/beautify_inventory.py projects/x/analysis/slide_library.json \
+ --images projects/x/images/image_manifest.json -o projects/x/analysis/beautify_inventory.json
+
+Dependencies:
+ None (standard library only).
+
+See workflows/beautify-pptx.md Step 4 for how the inventory is consumed.
+"""
+
+from __future__ import annotations
+
+import argparse
+import json
+import sys
+from pathlib import Path
+from typing import Optional
+
+
+def _images_by_slide(manifest: list) -> dict[int, list[dict]]:
+ """Map slide_index -> [image entries on that slide], from ppt_to_md occurrences."""
+ by_slide: dict[int, list[dict]] = {}
+ for entry in manifest:
+ filename = entry.get("filename")
+ for occ in entry.get("occurrences", []):
+ idx = occ.get("slide_index")
+ if idx is None:
+ continue
+ by_slide.setdefault(idx, []).append({
+ "filename": filename,
+ "shape_name": occ.get("shape_name"),
+ "pixel_width": entry.get("pixel_width"),
+ "pixel_height": entry.get("pixel_height"),
+ "display_ratio": occ.get("display_ratio"),
+ "display_left_emu": occ.get("display_left_emu"),
+ "display_top_emu": occ.get("display_top_emu"),
+ "display_width_emu": occ.get("display_width_emu"),
+ "display_height_emu": occ.get("display_height_emu"),
+ "usage_count": entry.get("usage_count"),
+ })
+ return by_slide
+
+
+def _table_cells(table: dict) -> list[list[str]]:
+ """Row-major 2D grid of cell text from a slide_library table."""
+ grid = []
+ for row in table.get("rows", []):
+ grid.append([c.get("text", "") for c in row.get("cells", [])])
+ return grid
+
+
+def build_inventory(slide_library: dict, images_by_slide: dict[int, list[dict]]) -> dict:
+ """Join slide_library slides with per-slide images into one ledger."""
+ slides_out = []
+ for slide in slide_library.get("slides", []):
+ idx = slide.get("slide_index")
+ text_blocks = [
+ {
+ "slot_id": s.get("slot_id"),
+ "role": s.get("role"),
+ "text": s.get("text", ""),
+ "paragraph_count": s.get("paragraph_count"),
+ "geometry": s.get("geometry"),
+ }
+ for s in slide.get("slots", [])
+ ]
+ tables = [
+ {
+ "table_id": t.get("table_id"),
+ "row_count": t.get("row_count"),
+ "column_count": t.get("column_count"),
+ "cells": _table_cells(t), # 2D text grid — convenient for diff
+ "rows": t.get("rows", []), # raw row/col cells — preserves merged / multi-header fidelity
+ }
+ for t in slide.get("tables", [])
+ ]
+ charts = [
+ {
+ "chart_id": c.get("chart_id"),
+ "chart_type": c.get("chart_type"),
+ "category_count": c.get("category_count"),
+ "series_count": c.get("series_count"),
+ "categories": c.get("categories", []), # frozen data
+ "series": c.get("series", []), # frozen data (name + values)
+ }
+ for c in slide.get("charts", [])
+ ]
+ slides_out.append({
+ "slide_index": idx,
+ "page_type": slide.get("page_type"),
+ "text_blocks": text_blocks,
+ "tables": tables,
+ "charts": charts,
+ "images": images_by_slide.get(idx, []),
+ "ignored": [], # agent fills: hidden shapes, master-only text, image crop/rotation
+ "needs_confirmation": [], # agent fills: combo/dual-axis charts, merged-cell tables, overcrowded pages
+ })
+
+ return {
+ "schema": "beautify_inventory.v1",
+ "source": slide_library.get("source_pptx"),
+ "slide_count": slide_library.get("slide_count", len(slides_out)),
+ "canvas_px": slide_library.get("canvas_px"),
+ "slides": slides_out,
+ }
+
+
+def build_parser() -> argparse.ArgumentParser:
+ parser = argparse.ArgumentParser(
+ description="Merge slide_library.json + image_manifest.json into a per-slide beautify inventory.",
+ formatter_class=argparse.RawDescriptionHelpFormatter,
+ )
+ parser.add_argument("slide_library", help="slide_library.json from `template_fill_pptx.py analyze`")
+ parser.add_argument("--images", help="image_manifest.json from `ppt_to_md.py` (optional)")
+ parser.add_argument("-o", "--output", help="Write JSON here (default: stdout)")
+ return parser
+
+
+def main(argv: Optional[list[str]] = None) -> int:
+ args = build_parser().parse_args(argv)
+
+ lib_path = Path(args.slide_library)
+ if not lib_path.is_file():
+ print(f"[ERROR] slide_library not found: {lib_path}", file=sys.stderr)
+ return 1
+ slide_library = json.loads(lib_path.read_text(encoding="utf-8"))
+
+ manifest: list = []
+ if args.images:
+ img_path = Path(args.images)
+ if not img_path.is_file():
+ print(f"[ERROR] image manifest not found: {img_path}", file=sys.stderr)
+ return 1
+ manifest = json.loads(img_path.read_text(encoding="utf-8"))
+
+ inventory = build_inventory(slide_library, _images_by_slide(manifest))
+
+ payload = json.dumps(inventory, ensure_ascii=False, indent=2)
+ if args.output:
+ out = Path(args.output)
+ out.parent.mkdir(parents=True, exist_ok=True)
+ out.write_text(payload + "\n", encoding="utf-8")
+ print(f"[OK] inventory written to: {out}", file=sys.stderr)
+ else:
+ print(payload)
+ return 0
+
+
+if __name__ == "__main__":
+ raise SystemExit(main())
diff --git a/skills/ppt-master/workflows/beautify-pptx.md b/skills/ppt-master/workflows/beautify-pptx.md
new file mode 100644
index 00000000..c0ff1d1c
--- /dev/null
+++ b/skills/ppt-master/workflows/beautify-pptx.md
@@ -0,0 +1,197 @@
+---
+description: Content-faithful PPT beautification — re-layout an existing deck while preserving its text verbatim and inheriting its visual identity, so regenerated elements share the original's palette/fonts and blend with it when pasted back.
+---
+
+# Beautify PPTX (Re-layout) Workflow
+
+> Mirror of [`template-fill-pptx.md`](./template-fill-pptx.md): template-fill reuses a deck's design and swaps in new content; beautify keeps a deck's content and redoes its layout.
+
+Re-lays-out an existing `.pptx`: the text is preserved **verbatim**, the source deck's visual identity (palette / fonts) is **inherited as truth**, and only layout, hierarchy, and whitespace are redesigned. Output is a brand-new native deck generated through the standard SVG pipeline — not a patch over the original.
+
+**Trigger**: the user supplies a `.pptx` and asks to beautify / re-layout / 重新排版 / 美化 while keeping the content. Explicit intent + a provided file only; never auto-infer.
+
+---
+
+## 1. When to Run
+
+| Pattern | Example |
+|---|---|
+| Existing `.pptx` + beautify intent | "把这份 PPT 美化一下" / "make this deck look better" |
+| Existing `.pptx` + re-layout intent | "重新排版这份 PPT,内容别动" / "re-layout this, keep the wording" |
+| Existing `.pptx` + paste-back intent | "重排后我要把元素贴回原来的模板" |
+
+**Hard rule — content is frozen**: every text string from the source is preserved exactly (no add / remove / reword / reorder). Beautification freedom lives only in layout, hierarchy, spacing, and visual rhythm.
+
+**Hard rule — not a patch, not a fill**: this regenerates a native deck through Strategist → Executor → export (SKILL.md Steps 4–7). It does **not** edit the source file in place, and it is **not** [`template-fill-pptx`](./template-fill-pptx.md) (which clones source slides and replaces text). It also does not parse an arbitrary third-party template for text-only substitution (the rejected #53 direction) — it builds every page from scratch.
+
+**Distinct from mirror templates**: `replication_mode: mirror` (executor §1.1) keeps layout + visuals verbatim and edits text. Beautify is the inverse — content verbatim, layout redone, identity inherited.
+
+---
+
+## 2. Inputs
+
+🚧 **GATE**: the user has provided:
+
+| Input | Required | Notes |
+|---|---:|---|
+| Source PPTX | Yes | The deck to re-lay-out |
+| Beautify scope | Optional | Density / emphasis preference — never content rewrites, and never page drops (v1 is strict 1:1) |
+
+---
+
+## 3. Create the Project Workspace
+
+Match the canvas to the source so 1:1 pages and paste-back align. Determine the source aspect first — before the project exists, run `beautify_identity.py <source.pptx>` to **stdout** and read `canvas.aspect` (the formal `analysis/identity.json` is written in Step 4, after `init`) — then `init` with the matching format:
+
+| Source aspect | Format |
+|---|---|
+| ≈1.778 (16:9) | `ppt169` |
+| ≈1.333 (4:3) | `ppt43` |
+| other | nearest format in [`canvas-formats.md`](../references/canvas-formats.md); record the source pixel size in the spec |
+
+```bash
+python3 ${SKILL_DIR}/scripts/project_manager.py init <project_name> --format <format>
+python3 ${SKILL_DIR}/scripts/project_manager.py import-sources <project_path> <source.pptx> --move
+```
+
+---
+
+## 4. Extract Identity and Data; Assemble Inventory
+
+Two reads off the source PPTX (text + images already exist from Step 3). Neither rewrites the deck.
+
+**Content + images — already produced by Step 3.** `import-sources` ran `ppt_to_md` on the deck, so the **frozen content contract** is `sources/<stem>.md` (one source slide per block, in order). If the source deck contains pictures, they are already propagated to `images/` with per-slide binding in `images/image_manifest.json` (`occurrences[].slide_index`). Do **not** re-run `ppt_to_md` — it would duplicate the conversion and write images to `analysis/<stem>_files/` instead of `images/`.
+
+**Visual identity (theme + observed sample + canvas)**:
+
+```bash
+python3 ${SKILL_DIR}/scripts/beautify_identity.py <project_path>/sources/<source.pptx> -o <project_path>/analysis/identity.json
+```
+
+| Field | Use |
+|---|---|
+| `theme.palette.background` / `text` / `primary` / `accent1..6` | the deck's *declared* colors |
+| `theme.fonts.title` / `body` (`ea` = CJK, `latin`) | the deck's *declared* fonts |
+| `observed.colors` / `observed.fonts` (`latin` / `ea`, frequency-ranked) | a usage **sample / frequency hint** — run-level fonts + explicit `srgbClr` fills across slides |
+| `canvas.aspect` | drives the Step 3 format choice |
+
+> Note: `theme` is what the deck declares; `observed` is a frequency sample of run-level overrides (not a complete style resolution — it misses `schemeClr` and master/layout inheritance, and counts chart/gradient fills). A hand-edited deck can diverge from `theme` — Step 5 recommends which to inherit and the user confirms.
+
+**Chart + table data (for regeneration)**: read the source's chart and table *data* so they can be redrawn natively in the inherited style:
+
+```bash
+python3 ${SKILL_DIR}/scripts/template_fill_pptx.py analyze <project_path>/sources/<source.pptx> -o <project_path>/analysis/slide_library.json
+```
+
+| `slide_library.json` field | Use |
+|---|---|
+| `slides[].charts[]` (`chart_type` / `categories` / `series[].values`) | regenerate as a native SVG chart via the `§VII` `templates/charts/` path |
+| `slides[].tables[]` (`row_count` / `column_count` / cell text) | regenerate as a native SVG table |
+
+**Hard rule — regenerate visuals, do not carry them over**: charts / tables / images are rebuilt from their data in the inherited style, never spliced in byte-for-byte. This keeps the deck style-consistent and natively editable. **Data values are frozen** (categories / series / cell text / numbers unchanged); only their rendering is the deck's own. Pictures (`ppt_to_md`-extracted files) are reused but re-laid-out — position / crop / size follow the new layout, not the source slot. A user who wants an original element verbatim copies it across themselves.
+
+**Assemble the inventory** — the deterministic join into one per-slide ledger, `analysis/beautify_inventory.json`, the contract Step 5 confirms and Step 7 verifies against:
+
+```bash
+python3 ${SKILL_DIR}/scripts/beautify_inventory.py <project_path>/analysis/slide_library.json \
+ --images <project_path>/images/image_manifest.json -o <project_path>/analysis/beautify_inventory.json
+```
+
+If `images/image_manifest.json` does not exist because the source deck has no extracted pictures, omit `--images`. The script joins per slide: `text_blocks` (slot text + geometry), `tables` (cell grid) / `charts` (categories + series values) — the **frozen data values inlined**, so the inventory is a self-contained contract, not a pointer back to `slide_library.json` — and `images` (bound via `image_manifest` `occurrences[].slide_index`, with geometry / `usage_count`). It emits `ignored` and `needs_confirmation` as **empty arrays** — fill them with judgment before Step 5:
+
+| Field | Fill with |
+|---|---|
+| `ignored` | hidden slides / shapes, master-only text, image crop / opacity / rotation / mask (not captured upstream) |
+| `needs_confirmation` | combo / dual-axis / waterfall charts (only the first plot type is captured), merged-cell or multi-header tables, overcrowded pages |
+
+```markdown
+## ✅ Extraction Complete
+
+- [x] `sources/<stem>.md` (from Step 3) holds every source slide's text, in order; extracted pictures, if any, are in `images/` + `images/image_manifest.json`
+- [x] `analysis/identity.json` has theme + observed identity + canvas aspect
+- [x] `analysis/slide_library.json` holds chart + table data for regeneration
+- [x] `analysis/beautify_inventory.json` ledgers per-slide text / images / data + ignored + needs-confirmation
+- [ ] **Next**: Step 5 — Beautify Plan (recommend & confirm)
+```
+
+---
+
+## 5. Beautify Plan — Recommend & Confirm
+
+⛔ **BLOCKING**: the scope is not hard-coded — same spirit as the Eight Confirmations. Recommend each item below from what the deck actually contains (the Step 4 inventory), present the plan, and **wait for the user to confirm or adjust** before writing any spec. Chat is the canonical channel.
+
+| Plan item | Recommend from | Default lean |
+|---|---|---|
+| Identity source | `identity.json` `theme` vs `observed` | theme when the deck is theme-driven; `observed` (or a merge) when slides override heavily (`observed` colors / fonts dominate). State which and why |
+| Preserve scope | inventory `text_blocks` / `images` / `charts` / `tables` | all text verbatim; data values frozen; pictures reused |
+| Ignored | inventory `ignored` | name them so the user sees what drops (hidden / master-only text / image crop / rotation) |
+| Needs confirmation | inventory `needs_confirmation` | flag complex charts + overcrowded pages explicitly; ask how to handle |
+| Verification level | deck size / risk | recommend the Step 7 per-page checks; user sets strictness |
+
+**Hard rule — content is frozen, not the scope decisions**: text strings and chart/table/table-cell data values are non-negotiable (verbatim). *Which* identity to inherit, what to ignore, and how to treat flagged items are recommend-then-confirm, never silently decided.
+
+**Recommend honestly — name the v1 ceiling**:
+
+| Item | What v1 delivers |
+|---|---|
+| Overcrowded source page | layout / hierarchy / whitespace improve **within the page as-is** — v1 does **not** relieve information overload (that needs re-pagination / rewrite, deferred). Flag such pages; the user may accept or note them for manual split |
+| Paste-back into the original | regenerated elements share the inherited palette + fonts, so they **blend visually** when pasted. v1 does **not** guarantee a seamless coordinate-level drop-in (slide coordinates, master placeholders, font availability are the original deck's, not ours) |
+| Complex charts / merged-cell tables | best-effort from the captured data; combo / dual-axis / waterfall lose the un-captured plots — flagged for the user |
+
+On confirmation, enter SKILL.md Step 4 as Strategist with the plan pre-resolved: lock `mode: briefing` + the content-faithful clause ([`strategist.md`](../references/strategist.md) §d Layer 1), canvas = Step 3 format, page count = source slide count (strict 1:1), color (e) + typography (g) = the confirmed identity (skip both recommendation flows), §VII = chart/table data → `templates/charts/`, §VIII = source pictures for re-layout.
+
+**Hard rule — §IX is verbatim and 1:1**: each source slide becomes exactly one page, in source order, its text transcribed word-for-word from `sources/<stem>.md`. Do not merge, split, drop, or rewrite. Write `design_spec.md` + `spec_lock.md` per `strategist.md` §6, then hand off to the Executor.
+
+---
+
+## 6. Executor + Export
+
+Run the standard pipeline (SKILL.md Steps 6–7). The Executor re-lays-out each page — hierarchy, spacing, alignment, page rhythm — using **only** the inherited palette + fonts from `spec_lock.md`, regenerates charts / tables as native SVG from the extracted data, and re-lays-out the source pictures.
+
+```bash
+python3 ${SKILL_DIR}/scripts/finalize_svg.py <project_path>
+python3 ${SKILL_DIR}/scripts/svg_to_pptx.py <project_path>
+```
+
+---
+
+## 7. Validate Output
+
+```bash
+python3 ${SKILL_DIR}/scripts/source_to_md/ppt_to_md.py <project_path>/exports/<output.pptx>
+```
+
+| Check | Expected |
+|---|---|
+| Text fidelity | every source text string appears in the output, unaltered |
+| Data fidelity | chart categories / series / table cells match the source exactly |
+| Page count | output slide count equals the source slide count |
+| Regenerated visuals | charts / tables are native SVG re-themed to the inherited palette |
+| Identity | generated text / shapes use only `identity.json` colors + fonts |
+| Paste-back | copying a beautified element into the original deck looks native |
+
+```markdown
+## ✅ Beautify Complete
+
+- [x] Content + data values verbatim (read-back Markdown matches the source)
+- [x] 1:1 page count preserved
+- [x] Source colors + fonts inherited as locked truth
+- [x] Charts / tables regenerated as native SVG in the inherited style
+- [x] Native PPTX exported to `exports/`
+```
+
+---
+
+## Current Boundary
+
+| Capability | Status |
+|---|---|
+| Re-layout with verbatim text | Supported |
+| Inherit source palette / fonts as truth | Supported |
+| Strict 1:1 page mapping | Supported |
+| Regenerate charts / tables as native SVG from extracted data | Supported |
+| Re-lay-out source pictures | Supported |
+| Re-pagination (split dense / merge sparse) | Not in v1 |
+| Carry source charts / tables / images over byte-for-byte | Out of scope — user copies originals manually if wanted |
+| Free visual-style application / cleanup deviating from source identity | Not in v1 |
+| Batch / multi-deck beautification | Not in v1 |