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(typography): pt confirmation layer, delivery-purpose axis, per-role sizes
hugohe3ab2f70bf311a
diff --git a/skills/ppt-master/SKILL.md b/skills/ppt-master/SKILL.mdindex 032a97bd..851f0c66 100644--- a/skills/ppt-master/SKILL.md+++ b/skills/ppt-master/SKILL.md@@ -327,14 +327,14 @@ Read references/strategist.md**Confirm UI Auto-Launch (Mandatory — default visual confirmation surface)**: by default the Eight Confirmations are presented through an interactive local page (color swatches, live font previews, candidate picks); the chat path is the always-valid fallback. Steps:-1. Write the recommendations to `<project_path>/confirm_ui/recommendations.json` (full schema + field mapping: [`scripts/docs/confirm_ui.md`](scripts/docs/confirm_ui.md)). Two kinds of field: **enumerable** (canvas / mode / visual_style / icons / formula policy / generation mode; plus image usage with a Custom path; plus AI source only when image usage may include `ai`) — the page lists common options from `confirm_ui/static/catalogs.json`, so you only name the recommended canonical `id` in a `recommend` block (canvas may be a catalog id like `ppt169` or a custom size/prose; style = `mode` + `visual_style`, two independent picks; icon ids are real libraries such as `tabler-outline`, or `emoji` for system emoji; image usage uses `ai` / `web` / `provided` / `placeholder` / `none`, or a custom prose plan when several sources must be combined; never write bare `"custom"` for image usage — write the actual mixed plan, e.g. "AI cover + user product assets + web industry images"; write `image_ai_path` only when recommending `image_usage: "ai"` or a custom plan that includes AI); **generative** (color, typography, generated-image style) — author **≥3 candidates** each (creative recommendations always offer real choice, never a single silent option — same rule as strategist h.5; fewer than 3 only on the honest-shortfall exception, with a stated reason) (color: user-facing core `palette` with background/secondary_bg/primary/accent/secondary_accent/body_text; typography: CJK + Latin for `heading` and `body` with `css` preview stacks, plus `body_size` as the body baseline px; when recommending generated images, `image_strategy.candidates` with rendering × palette combinations from strategist h.5). `page_count` / `audience` / `content_divergence` are plain values (free text). Only open fields show a Custom box: `canvas`, `mode`, `visual_style`, `icons`, `image_usage`, and typography custom text. Closed fields (`image_ai_path`, `formula_policy`, `generation_mode`, `refine_spec`) stay finite. `content_divergence` is a **free-text** field shown under audience in §c — the user states in their own words how closely to follow the source vs how freely to reshape it (blank = balanced; facts stay sourced at every level). Write it as `content_divergence: { "value": "<prose or empty>" }`. It is consumed by Strategist when authoring `§IX`, recorded in `design_spec.md §I`, carries no page-count coupling, and is **not** written to `spec_lock.md`. Set `lang` to the page language; visible candidate text should match `lang`, or provide bilingual `name_zh` / `name_en` and `note_zh` / `note_en` fields. Reuse the same candidate thinking as strategist h.5.+1. Write the recommendations to `<project_path>/confirm_ui/recommendations.json` (full schema + field mapping: [`scripts/docs/confirm_ui.md`](scripts/docs/confirm_ui.md)). Two kinds of field: **enumerable** (canvas / mode / visual_style / icons / formula policy / generation mode / delivery purpose; plus image usage with a Custom path; plus AI source only when image usage may include `ai`) — the page lists common options from `confirm_ui/static/catalogs.json`, so you only name the recommended canonical `id` in a `recommend` block (canvas may be a catalog id like `ppt169` or a custom size/prose; style = `mode` + `visual_style`, two independent picks; icon ids are real libraries such as `tabler-outline`, or `emoji` for system emoji; image usage uses `ai` / `web` / `provided` / `placeholder` / `none`, or a custom prose plan when several image sources are mixed; never write bare `"custom"` for image usage — write the actual mixed plan, e.g. "AI cover + user product assets + web industry images"; write `image_ai_path` only when recommending `image_usage: "ai"` or a custom plan that includes AI); **generative** (color, typography, generated-image style) — author **≥3 candidates** each (creative recommendations always offer real choice, never a single silent option — same rule as strategist h.5; fewer than 3 only on the honest-shortfall exception, with a stated reason) (color: user-facing core `palette` with background/secondary_bg/primary/accent/secondary_accent/body_text; typography: CJK + Latin for `heading` and `body` with `css` preview stacks, plus `body_size` as the body baseline shown to the user (**pt** for PPT canvases, px for non-PPT) and `delivery_purpose` (PPT only: `text` / `balanced` / `presentation`, seeds the pt default); when recommending generated images, `image_strategy.candidates` with rendering × palette combinations from strategist h.5). `page_count` / `audience` / `content_divergence` are plain values (free text). Only open fields show a Custom box: `canvas`, `mode`, `visual_style`, `icons`, `image_usage`, and typography custom text. Closed fields (`image_ai_path`, `formula_policy`, `generation_mode`, `refine_spec`, `delivery_purpose`) stay finite. `content_divergence` is a **free-text** field shown under audience in §c — the user states in their own words how closely to follow the source vs how freely to reshape it (blank = balanced; facts stay sourced at every level). Write it as `content_divergence: { "value": "<prose or empty>" }`. It is consumed by Strategist when authoring `§IX`, recorded in `design_spec.md §I`, carries no page-count coupling, and is **not** written to `spec_lock.md`. Set `lang` to the page language; visible candidate text should match `lang`, or provide bilingual `name_zh` / `name_en` and `note_zh` / `note_en` fields. Reuse the same candidate thinking as strategist h.5.2. Launch the page **in the background and wait for the browser confirmation** (the child server runs detached; the parent command returns after `result.json` is freshly written). **Run this command with a long tool timeout — 600000 ms** — so the `--wait` (≈590 s budget) can complete:```bashpython3 ${SKILL_DIR}/scripts/confirm_ui/server.py <project_path> --daemon --wait```Page opens at `http://localhost:5050` — the **same port as the Step 6 live preview** (they never run at once: this page shuts down at the end of Step 4, freeing the port). If another project already holds 5050, the launcher **auto-advances to the next free port** (5051, …) and serves this project there — read the actual URL from the launch log and report that. When the user clicks **Confirm**, the command exits 0 and Step 4 reads `result.json` immediately; do not require a second chat confirmation. **Launch or wait failure is non-fatal**: if it fails or times out (flask missing, port blocked, no GUI / remote / web host, browser never confirms in time), do **NOT** troubleshoot. The detached page stays open, so a slow user may confirm after the wait returns — therefore **on any non-zero exit, re-check `<project_path>/confirm_ui/result.json` once (a fresh `status: confirmed`) before** dropping to the chat-summary fallback below.3. **Always also print the eight recommendations as a short summary in chat, with the URL.** This keeps the chat fallback valid whether or not the browser opened. If the page never appears, the user simply confirms or edits in chat as before.-4. This is the ⛔ BLOCKING wait. Preferred page path: the `--wait` command returns after the page writes a fresh `<project_path>/confirm_ui/result.json`; immediately read that file and use its values. On a non-zero exit, re-check `result.json` once (per step 2) — a fresh `status: confirmed` still wins. Chat fallback path: only if no fresh result exists (page didn't open, wait timed out with no confirmation, or the user replies in chat with edits) take the chat values directly. Either path converges. A confirmed `result.json` is an explicit user choice: `generation_mode: "split"` means split mode was chosen; `refine_spec: true` means the refine-spec workflow was chosen.+4. This is the ⛔ BLOCKING wait. Preferred page path: the `--wait` command returns after the page writes a fresh `<project_path>/confirm_ui/result.json`; immediately read that file and use its values. On a non-zero exit, re-check `result.json` once (per step 2) — a fresh `status: confirmed` still wins. Chat fallback path: only if no fresh result exists (page didn't open, wait timed out with no confirmation, or the user replies in chat with edits) take the chat values directly. Either path converges. **Typography normalization is mandatory before any spec writing**: for PPT canvases, chat-confirmed `pt` values must be converted immediately to unitless px (`px = pt × 4/3`) so `design_spec.md`, `spec_lock.md`, and SVG all see px only; keep the original pt only as provenance (`body_size_pt` / `sizes_pt`) if useful. A confirmed `result.json` is an explicit user choice: `generation_mode: "split"` means split mode was chosen; `refine_spec: true` means the refine-spec workflow was chosen.5. **Close the confirm page (Mandatory cleanup — every path).** Once you have the confirmed values (page **or** chat), shut the confirm server down before leaving Step 4 so it cannot keep holding port 5050 (which Step 6 live preview reuses):```bashpython3 ${SKILL_DIR}/scripts/confirm_ui/server.py <project_path> --shutdowndiff --git a/skills/ppt-master/references/canvas-formats.md b/skills/ppt-master/references/canvas-formats.mdindex 5e7fecd6..00113a4a 100644--- a/skills/ppt-master/references/canvas-formats.md+++ b/skills/ppt-master/references/canvas-formats.md@@ -62,7 +62,7 @@ Content purpose?| Story | — | Middle 1500px | Top safe zone 120px, bottom 180px || WeChat Article Header | Center/left-aligned 48-72px | — | Image on right or as background |-> **Body font baseline scales with canvas height** — a baseline tuned for 16:9 (18–24px) is far too small on tall canvases (Xiaohongshu / Story / A4). Pick the baseline from the confirmed canvas, not the recommended one; see the per-canvas anchors in [`strategist.md`](strategist.md) §g "Font Size Ramp".+> **Body font baseline scales with canvas and delivery purpose** — a PPT 16:9 baseline confirmed for read-close / business / projection cannot be carried onto tall canvases (Xiaohongshu / Story / A4). Pick the baseline from the confirmed canvas, not the recommended one; see the per-canvas anchors and PPT pt→px normalization in [`strategist.md`](strategist.md) §g "Font Size Ramp".## ViewBox Examplesdiff --git a/skills/ppt-master/references/executor-base.md b/skills/ppt-master/references/executor-base.mdindex 57278240..00edca25 100644--- a/skills/ppt-master/references/executor-base.md+++ b/skills/ppt-master/references/executor-base.md@@ -107,6 +107,7 @@ Before the first SVG page, output a confirmation listing: canvas dimensions, bod- Icons MUST come from `icons.inventory`; library MUST equal `icons.library`- Font family from `typography`: use role override (`title_family` / `body_family` / `emphasis_family` / `code_family`) if declared, else fall back to `font_family`- Font sizes follow a **ramp anchored on `typography.body`**, not a closed menu. Use the declared slots when they fit. Intermediate sizes (e.g., 40px hero number, 13px annotation) are allowed if the ratio to `body` falls within the role's band (see `design_spec.md §IV ramp table`). Sizes outside every band require extending the lock first.+- **Write `font-size` to at most 2 decimals** — prefer a whole number; keep the 2-decimal form only for a slot that carries it from `spec_lock` (e.g. `body: 26.67`). Never emit long tails like `20.8026`: the exporter snaps the final size to the nearest 0.5pt, so extra px precision is wasted noise.- Images MUST reference files listed under `images`; no invented filenames- Formula PNGs are images with `Acquire Via: formula` / `Status: Rendered`; place them only from the listed file path and never recreate the formula as text.diff --git a/skills/ppt-master/references/strategist.md b/skills/ppt-master/references/strategist.mdindex 6d93791e..46a9485e 100644--- a/skills/ppt-master/references/strategist.md+++ b/skills/ppt-master/references/strategist.md@@ -36,7 +36,7 @@ Recommend format based on scenario (see [`canvas-formats.md`](canvas-formats.md)### b. Page Count Confirmation-Provide specific page count recommendation based on source document content volume.+Provide specific page count recommendation based on source document content volume **and the deck's delivery purpose** (文字型 packs denser → the same source fits in fewer pages; 展示型 is one-idea-per-page → the same source may need more) — see §6.1 Content Planning Strategy. The user's confirmed count still wins; delivery purpose governs density and per-page treatment within it.### c. Key Information Confirmation@@ -219,39 +219,56 @@ See [`../templates/icons/README.md`](../templates/icons/README.md) for the curre> - **Calligraphic display** — 隶书 LiSu / 华文行楷 STXingkai / 华文新魏 STXinwei (closest safe substitute: `KaiTi` / `FangSong`); cover / section / hero titles only, never body> - **Brand-specific** — McKinsey Bower, corporate VI typefaces-#### Font Size Ramp (all sizes in px)+#### Font Size Ramp (confirmation layer in pt → spec layer in px)-> **Ramp, not a fixed menu.** All sizes derive from the `body` baseline as a ratio. `spec_lock.md typography` declares `body` plus the slots this deck uses (`title` / `subtitle` / `annotation` by default; add `cover_title` / `hero_number` / `chart_annotation` as needed). Executor may pick any intermediate px within a role's ratio band.+> **Ramp, not a fixed menu.** All sizes derive from the `body` baseline as a ratio. `spec_lock.md typography` declares `body` plus the slots this deck uses (`title` / `subtitle` / `annotation` by default; add `cover_title` / `hero_number` / `chart_annotation` as needed). Executor may pick any intermediate size within a role's ratio band.-Baseline scales with **canvas height first, then content density** — the `18`/`24px` figures below anchor to a 720-tall 16:9 canvas (≈2.5–3.3% of height); hold that proportion on taller canvases, never carrying a 16:9 number onto a larger one. Within a canvas, density picks the point in its band (chart-heavy low · medium mid · relaxed / poster / cover high), relative to that canvas's anchor, not a fixed 16:9 px.+> **Unit boundary (HARD rule).** PPT canvases may use **pt only in the confirmation layer** (`recommendations.json`, the Confirm UI, or chat fallback). Before writing `design_spec.md`, normalize the confirmed font sizes to **unitless px** (`px = pt × 4/3`) and keep px as the only design/execution value in `design_spec.md`, `spec_lock.md`, and SVG. Keep original pt only as provenance (`body_size_pt` / `sizes_pt`) when useful. Non-PPT canvases use px everywhere. Never write `pt` / `px` / `em` units into `spec_lock.md` or SVG; those layers carry unitless px numbers only. Geometry — margins, gaps, card sizes — is px everywhere.-| Canvas | Height | Body baseline (dense–relaxed) |-|---|---|---|-| PPT 16:9 / 4:3 | 720 / 768 | 18–24 |-| Xiaohongshu | 1242×1660 | 40–55 |-| WeChat / IG 1:1 | 1080×1080 | 27–36 |-| Story / Portrait | 1080×1920 | 48–64 |-| A4 | 1240×1754 | 44–58 |+**Baseline — pick by delivery purpose first, then density.** Delivery purpose is one of the Eight Confirmations (item 7 typography); it is the primary driver because the same canvas reads very differently when read close vs. projected. It is a **deck-wide** axis — beyond the body baseline it also drives page density / count / rhythm; see §6.1 for that side. Here it sets the body baseline:-> **Canvas drives the baseline — re-derive on change, never carry.** The body baseline is a function of the *confirmed* canvas (item a), not the recommended one. If the user overrides the recommended canvas in confirmation, recompute the baseline (and therefore the whole ramp) for the new canvas before writing `spec_lock.md`: the `body_size` in `recommendations.json` was sized for the recommended canvas and is stale the moment the canvas changes.+| Delivery purpose (PPT 16:9) | Body (pt) | Default | Reads as |+|---|---|---:|---|+| 文字型 · read-close (report, data-dense brief, leave-behind file) | 14–18 | 16pt | screen / handout reading at arm's length |+| 均衡 · business (presented **and** read; roadshow, review) — **default** | 18–22 | 20pt | mixed projection + reading |+| 展示型 · presentation (projected, sparse; keynote, launch, classroom) | 22–28 | 24pt | room projection, glance from the back |-| Common recommendation | Points per Page | Body Baseline | Suitable Scenarios |-|----------------|----------------|---------------|-------------------|-| Relaxed | 3-5 items | 24px | Keynote-style, training materials |-| Dense | 6+ items | 18px | Data reports, consulting analysis |+Within the chosen purpose band, **density** picks the point (chart-heavy / 6+ items → low end · medium → mid · sparse / poster / cover → high end), and **visual style** nudges it (technical / data toward low, corporate / instructional toward mid, editorial / narrative / showcase toward high).-| Level | Ratio to body | 24px baseline | 18px baseline |-|-------|---------------|---------------|---------------|-| Cover title (hero headline) | 2.5-5x | 60-120px | 45-90px |-| Chapter / section opener | 2-2.5x | 48-60px | 36-45px |-| Page title | 1.5-2x | 36-48px | 27-36px |-| Hero number (consulting KPIs) | 1.5-2x | 36-48px | 27-36px |-| Subtitle | 1.2-1.5x | 29-36px | 22-27px |-| **Body** | **1x** | **24px** | **18px** |-| Annotation / caption | 0.7-0.85x | 17-20px | 13-15px |-| Page number / footnote | 0.5-0.65x | 12-16px | 9-12px |+| Canvas | Height | Body baseline | Unit |+|---|---|---|---|+| PPT 16:9 / 4:3 | 720 / 768 | 14–28 (by delivery purpose above) | **pt** |+| Xiaohongshu | 1242×1660 | 40–55 | px |+| WeChat / IG 1:1 | 1080×1080 | 27–36 | px |+| Story / Portrait | 1080×1920 | 48–64 | px |+| A4 | 1240×1754 | 44–58 | px |-> Two baseline columns are illustrative only — for any other baseline (16/20/22/28/32…), multiply the row's ratio. Checker reads live `body` from `spec_lock.md`. Executor may pick any px within a role's band without pre-declaring; values outside **every** band require lock extension first.+> **PPT confirms in pt, specs carry px.** Only the PPT canvases (16:9 / 4:3) expose pt in the confirmation layer because they export to a real PowerPoint slide where pt is meaningful. Social / print canvases (Xiaohongshu / Story / A4, viewed close on phone or in print) have no PPT pt semantics, so author their body baseline directly in px and skip the conversion step.++> **Confirmed values win — never recompute over them.** The user's confirmed sizes are authoritative. **Confirm UI path**: take `result.json` `typography.body_size` / `sizes` (already px) **verbatim** — do **not** re-derive from the canvas even if the user changed it. The page deliberately does not auto-rescale font sizes when the canvas changes (it only updates the suggested-range hint), so `result.json` already reflects the user's intent; recomputing here would silently override their choice. **Chat-fallback path** (no `result.json`): size from the confirmed canvas + delivery purpose (convert via `pt_to_px.py` for PPT). The `body_size` in `recommendations.json` is only a stale hint once the canvas changes — use the confirmed value, not the recommendation.++| Level | Ratio to body | 32px baseline (24pt UI) | 24px baseline (18pt UI) |+|-------|---------------|---------------|---------------|+| Cover title (hero headline) | 2.5-5x | 80-160px | 60-120px |+| Chapter / section opener | 2-2.5x | 64-80px | 48-60px |+| Page title | 1.5-2x | 48-64px | 36-48px |+| Hero number (consulting KPIs) | 1.5-2x | 48-64px | 36-48px |+| Subtitle | 1.2-1.5x | 38-48px | 29-36px |+| **Body** | **1x** | **32px** | **24px** |+| Annotation / caption | 0.7-0.85x | 22-27px | 17-20px |+| Page number / footnote | 0.5-0.65x | 16-21px | 12-16px |++> Two baseline columns are illustrative only — for any other normalized `body` px value (21.33 / 26.67 / 29.33 / 32 / ...), multiply the row's ratio. Executor may pick any size within a role's band without pre-declaring; values outside **every** band require lock extension first.++> **pt → px: where it happens (Mandatory).** PPT canvases confirm in pt; `design_spec.md` / `spec_lock.md` / SVG carry **unitless px only**. The conversion `px = pt × 4 ⁄ 3` happens **once**, by path. (At export the px is converted back with `× 0.75` and **snapped to the nearest 0.5pt** so PowerPoint always shows a clean integer-or-half-point size; a confirmed integer pt round-trips exactly — e.g. 20pt → 26.67px → 20.0pt.)+> - **Confirm UI path** — already done at submit. `result.json` `typography.body_size` / `sizes` are **already px** (`body_size_pt` / `sizes_pt` are kept only as provenance). Use the px directly; do **not** re-convert.+> - **Chat-fallback path** — no `result.json` exists, so you convert, via the deterministic helper (never mental math):+> ```bash+> python3 skills/ppt-master/scripts/pt_to_px.py <body_pt> [<title_pt> <subtitle_pt> <annotation_pt>] # e.g. 20 → 26.67+> ```+> Write its printed px into `design_spec.md §IV` + `spec_lock.md typography`. Honor any per-role size the user pinned as that slot's locked value; derive the rest from the ramp.+>+> **Validation** — before leaving the Strategist: every font-size in `design_spec.md` / `spec_lock.md` is the **px** value (e.g. `26.67`), never the confirmed pt number (`20`) written raw. Copying a pt number in unconverted is the one silent error the unit guard cannot catch — `20` is a valid bare number that renders at 15pt. Convert (via the page or `pt_to_px.py`), don't copy.> **Hero in single-focus / breathing pages**: when one element *is* the entire page — a large number, a headline, a key phrase — it is the visual subject, not body content. Such heroes may borrow the cover-title band (2.5–5×); for greater emphasis, declare a hero slot in `spec_lock.md` (e.g., `hero_number` / `hero_headline`) — checker exempts declared slots with no fixed upper limit. The row above "Hero number (consulting KPIs) 1.5–2×" applies only to numeric KPIs in dashboard/data layouts, not to full-page focal elements.@@ -734,6 +751,16 @@ Templates are starting points. The Strategist may adjust based on content and auContent-outline and speaker-notes strategy follow the deck's locked **mode** — see [`modes/_index.md`](./modes/_index.md) and the locked mode's file. The guidance below applies within any mode:+**Delivery purpose drives the whole plan, not just type size.** `result.json delivery_purpose` — 文字型 (read-close) / 均衡 (business, default) / 展示型 (presentation), confirmed in item 7 — is a **deck-wide consumption mode**. It seeds the normalized body baseline (§g) **and** governs how content is distributed:++| Delivery purpose | Per-page density & treatment | §IX content per page | page_rhythm lean |+|---|---|---|---|+| 文字型 · read-close | dense — pack more per page, fuller layouts | prose paragraphs, more blocks, tables / fine detail; complete sentences | leans `dense` |+| 均衡 · business (default) | balanced | one primary + supporting points; moderate text | mixed |+| 展示型 · presentation | sparse — one idea per page, generous whitespace | keywords / short phrases, a single core message, large visual; never paragraph dumps | leans `anchor` / `breathing` |++This is what makes the axis meaningful: a 展示型 deck and a 文字型 deck built from the **same source** must differ in per-page text volume, layout density, and rhythm — **not only in font size**. Page count (item b) stays the user's call; delivery purpose governs the **density and treatment within it**, and informs the page-count recommendation when the user has not fixed one. Record the chosen purpose in `design_spec.md §I`. The `page_rhythm` leans are a bias, not a quota — the filler-page ban and "rhythm follows narrative" rule still hold. (Preservation paths — beautify / template-fill — keep source structure verbatim: honor purpose only in styling, never to re-paginate.)+**Per-block expression**: phrase each §IX content block in the mode that fits it — prose, bullet, keyword, or any phrasing the content calls for — not a default bullet. Take the cue from the source's texture: a narrative source (article / transcript / talk) leans prose — resist compressing its argument pages into fragments; a data sheet leans bullet/keyword. Write the real sentence into §IX itself, not a skeleton point to expand later. One page mixes modes; let layout pull each (narrative → prose, structural/chart → bullets/keywords).> Note: §IX is the only content copy the Executor re-reads after context compression — what you write there is what survives.@@ -742,7 +769,7 @@ Content-outline and speaker-notes strategy follow the deck's locked **mode** —| Chapter | Content Requirements ||---------|---------------------|-| I. Project Information | Project name, canvas format, page count, style, audience, scenario, date |+| I. Project Information | Project name, canvas format, page count, style, audience, scenario, delivery purpose, date || II. Canvas Specification | Format, dimensions, viewBox, margins, content area || III. Visual Theme | Style description, light/dark theme, tone, color scheme (with HEX table), gradient scheme || IV. Typography System | Font plan (per-role families — title / body / emphasis / code), font size hierarchy |@@ -760,7 +787,7 @@ Content-outline and speaker-notes strategy follow the deck's locked **mode** —3. Save to: `projects/<project_name>.../design_spec.md`4. **Generate execution lock**: read `templates/spec_lock_reference.md` and produce `projects/<project_name>.../spec_lock.md` — a distilled, machine-readable short form of the color / typography / icon / image / **page_rhythm** / **page_layouts** / **page_charts** decisions above. This file is what the Executor re-reads before every page (see [executor-base.md](executor-base.md) §2.1). The values in `spec_lock.md` MUST exactly match the decisions recorded in `design_spec.md`; if they ever diverge, `spec_lock.md` wins and `design_spec.md` should be treated as historical narrative.- **page_rhythm is mandatory**: Based on the page list in §IX Content Outline, assign each page one of `anchor` / `dense` / `breathing` (see `spec_lock_reference.md` for the full vocabulary). This is what breaks the uniform "every page is a card grid" feel — without it the Executor defaults all pages to `dense`.- - **Rhythm follows narrative, not quota**: `breathing` pages mark natural pauses — chapter transitions, standalone emphasis (hero quote / big number), SCQA bridges. Dense decks may legitimately be all `dense`. **Do NOT invent filler pages** ("Thank you", empty dividers) to pad rhythm — every `breathing` page must say something independent.+ - **Rhythm follows narrative, not quota**: `breathing` pages mark natural pauses — chapter transitions, standalone emphasis (hero quote / big number), SCQA bridges. Dense decks may legitimately be all `dense`. **Do NOT invent filler pages** ("Thank you", empty dividers) to pad rhythm — every `breathing` page must say something independent. Delivery purpose biases the overall lean (展示型 toward more `anchor` / `breathing`, 文字型 toward `dense`; see §6.1) — a bias, never a quota.- **Cover impact is mandatory**: Page `P01` is the deck's first visual contract, not a generic title slide. In `design_spec.md §IX`, add a `Cover impact` line for `P01` that names one concrete hook and one concrete composition strategy. Use the source's strongest available signal: a provocative core claim, object / scene metaphor, hero number, founder / product / audience moment, or a distilled conflict. Pair it with one concrete composition strategy — such as `full-bleed image + floating title`, `typographic poster`, `hero object`, `data hook`, `editorial scene`, `high-contrast abstract geometry`, or a fresh composition the deck's subject suggests (these are starting points, not the allowed set). If no external or AI image is available, still specify a native-SVG visual hook; do not fall back to "title + subtitle + decorative background". (Beautify / template-fill keep the source cover verbatim — this rule does not apply on those preservation paths.)- **Cover rhythm lock**: `P01` remains `anchor` in `spec_lock.md page_rhythm`, but its §IX `Cover impact` must prevent content-page patterns. Do not plan multi-card grids, agenda-like bullets, or equal-weight columns on the cover unless a template explicitly requires that structure, or a preservation path (beautify / template-fill) is transcribing the source cover verbatim.- **Closing impact (only when the deck closes)**: the deck's last page is its final visual contract — the strongest impression after the cover. When the deck genuinely lands on a conclusion / call-to-action / final-takeaway page, give it a `Closing impact` line in §IX: name the one thing the audience should leave with (a distilled takeaway, a forward call, a memorable restatement of the core claim) + one composition that delivers it — never a generic "Thank you" / contact-only slide or a centered-title reprise of the cover. **Do NOT invent a closing page to satisfy this** — the filler-page ban above still holds; apply it only to the page where the deck actually resolves. Same exemptions as the cover: skip on template / beautify / template-fill preservation paths.diff --git a/skills/ppt-master/scripts/confirm_ui/static/app.js b/skills/ppt-master/scripts/confirm_ui/static/app.jsindex f0674036..b4eb0563 100644--- a/skills/ppt-master/scripts/confirm_ui/static/app.js+++ b/skills/ppt-master/scripts/confirm_ui/static/app.js@@ -55,6 +55,14 @@font_body_size: "Body baseline size",font_body_size_hint: "All type sizes derive from this body baseline.",body_size_hint_canvas: "This canvas suggests ~{lo}–{hi}px (scales with canvas height).",+ body_size_hint_pt: "PPT body is confirmed in pt — this purpose suggests ~{lo}–{hi}pt (default {def}pt). Saved as px after confirmation.",+ body_size_hint_oor: "(Current value is outside this range — it is not auto-converted across canvases; check it fits.)",+ delivery_purpose: "Delivery purpose",+ delivery_purpose_hint: "Read-close decks can run smaller; projected decks need larger type.",+ size_override: "Per-role size override:",+ size_role_title: "title",+ size_role_subtitle: "subtitle",+ size_role_annotation: "annotation",custom_typography: "Custom typography",custom_typography_placeholder: "Type your font plan, e.g. Heading: Georgia + KaiTi; Body: Microsoft YaHei + Arial…",custom_color: "Custom color",@@ -125,6 +133,14 @@font_body_size: "正文基准字号",font_body_size_hint: "所有字号按这个正文基准推导。",body_size_hint_canvas: "当前画布建议 ~{lo}–{hi}px(随画布高度缩放)。",+ body_size_hint_pt: "PPT 正文确认时用 pt — 该交付目的建议 ~{lo}–{hi}pt(默认 {def}pt),确认后保存为 px。",+ body_size_hint_oor: "(当前数值不在此区间——换画布不会自动换算,请确认是否合适。)",+ delivery_purpose: "交付目的",+ delivery_purpose_hint: "近读型可以小一点;投影型需要更大的字。",+ size_override: "逐角色字号覆盖:",+ size_role_title: "标题",+ size_role_subtitle: "副标题",+ size_role_annotation: "注释",custom_typography: "自定义字体方案",custom_typography_placeholder: "输入字体方案,如:标题用楷体;正文用微软雅黑…",custom_color: "自定义配色",@@ -497,7 +513,17 @@var sec = section(1, "sec_canvas");enumField(sec, CAT.canvas, recOrFirst("canvas", CAT.canvas),function () { return STATE.canvas; },- function (v) { STATE.canvas = v; refreshBodySizeHint(); }, { allowCustom: true });+ function (v) {+ STATE.canvas = v;+ if (!STATE.typography) STATE.typography = { name: "", heading: {}, body: {} };+ // Canvas changes dimensions only — never silently rewrite font sizes+ // the user can see / edit. The size hint re-renders with the new+ // canvas; a default body is filled only when none is set yet.+ if (!STATE.typography.body_size) {+ STATE.typography.body_size = defaultBodySizeForCanvas(v, STATE.delivery_purpose);+ }+ renderAll();+ }, { allowCustom: true });host.appendChild(sec);}@@ -561,6 +587,18 @@// Replaced when the typography section mounts; the canvas section calls it so// the body-size hint tracks the chosen canvas height.var refreshBodySizeHint = function () {};+ // Replaced when the typography section mounts; body-size / delivery changes+ // call it so the per-role size overrides the user hasn't pinned re-derive.+ var refreshSizeInputs = function () {};++ // Per-role size slots the user can edit directly (parallel to color roles).+ // Defaults derive from `body` via mid-band ramp ratios (strategist.md §g);+ // values follow body's unit (pt on PPT canvases, px otherwise).+ var SIZE_ROLES = ["title", "subtitle", "annotation"];+ var SIZE_RATIO = { title: 1.75, subtitle: 1.35, annotation: 0.78 };+ function deriveSize(role, bodyVal) {+ return Math.round((bodyVal || 0) * (SIZE_RATIO[role] || 1));+ }// Canvas height (viewBox user units) parsed from a catalog `dim` like// "1242×1660" or from a custom canvas string containing WxH; null if unknown.@@ -571,6 +609,99 @@return m ? parseInt(m[2], 10) : null;}+ function bodySizeRatioBand(canvasVal) {+ var dim = null;+ (CAT.canvas || []).forEach(function (o) { if (o.id === canvasVal) dim = o.dim; });+ var raw = String(dim || canvasVal || "");+ var id = String(canvasVal || "").toLowerCase();+ var isPpt = id === "ppt169" || id === "ppt43" ||+ /1280\s*[×xX*]\s*720/.test(raw) ||+ /1024\s*[×xX*]\s*768/.test(raw);+ return isPpt ? { lo: 0.031, hi: 0.047 } : { lo: 0.025, hi: 0.033 };+ }++ // PPT canvases (16:9 / 4:3) carry the pt design language + pt→px conversion;+ // social / print canvases have no PowerPoint pt semantics and stay in px.+ function isPptCanvas(canvasVal) {+ var dim = null;+ (CAT.canvas || []).forEach(function (o) { if (o.id === canvasVal) dim = o.dim; });+ var raw = String(dim || canvasVal || "");+ var id = String(canvasVal || "").toLowerCase();+ return id === "ppt169" || id === "ppt43" ||+ /1280\s*[×xX*]\s*720/.test(raw) ||+ /1024\s*[×xX*]\s*768/.test(raw);+ }++ // PPT confirmation pt band + default per delivery purpose (see strategist.md §g).+ // The confirmed pt is converted to px (×4/3) before any spec is written.+ function deliveryPtBand(purposeId) {+ if (purposeId === "text") return { lo: 14, hi: 18, def: 16 };+ if (purposeId === "presentation") return { lo: 22, hi: 28, def: 24 };+ return { lo: 18, hi: 22, def: 20 }; // balanced — the default+ }++ function defaultBodySizeForCanvas(canvasVal, purposeId) {+ if (isPptCanvas(canvasVal)) return deliveryPtBand(purposeId).def;+ var h = canvasHeight(canvasVal);+ if (!h) return 40;+ var band = bodySizeRatioBand(canvasVal);+ return Math.round(h * (band.lo + band.hi) / 2);+ }++ function roundSize(value) {+ return Math.round(value * 100) / 100;+ }++ function ptToPx(value) {+ return roundSize(value * 4 / 3);+ }++ function normalizeTypographyForSubmit(payload) {+ if (!payload.typography || typeof payload.typography !== "object") return;+ var typ = payload.typography;+ var ppt = isPptCanvas(payload.canvas);+ var body = parseFloat(typ.body_size);+ if (!isFinite(body)) {+ // Cleared / invalid body field — fall back so role sizes never submit+ // against an empty anchor, and (on PPT) so the pt→px branch still runs+ // instead of leaking pt-valued role sizes through as px.+ body = defaultBodySizeForCanvas(payload.canvas, payload.delivery_purpose);+ typ.body_size = body;+ }+ if (ppt && isFinite(body)) {+ typ.body_size_pt = roundSize(body);+ typ.body_size = ptToPx(body);+ typ.body_size_unit = "px";+ typ.body_size_source_unit = "pt";+ if (typ.sizes && typeof typ.sizes === "object") {+ var sizesPt = {};+ var sizesPx = {};+ Object.keys(typ.sizes).forEach(function (role) {+ var raw = parseFloat(typ.sizes[role]);+ if (!isFinite(raw)) return;+ sizesPt[role] = roundSize(raw);+ sizesPx[role] = ptToPx(raw);+ });+ typ.sizes_pt = sizesPt;+ typ.sizes = sizesPx;+ }+ return;+ }+ if (isFinite(body)) {+ typ.body_size = roundSize(body);+ typ.body_size_unit = "px";+ }+ if (typ.sizes && typeof typ.sizes === "object") {+ Object.keys(typ.sizes).forEach(function (role) {+ var raw = parseFloat(typ.sizes[role]);+ if (isFinite(raw)) typ.sizes[role] = roundSize(raw);+ });+ }+ delete typ.body_size_pt;+ delete typ.sizes_pt;+ delete payload.delivery_purpose;+ }+function renderColor(host) {var cands = (REC.color && REC.color.candidates) || [];var sec = section(5, "sec_color");@@ -729,32 +860,38 @@customInput.placeholder = t("custom_typography_placeholder");customInput.style.display = "none";- function selectFont(idx) {+ function selectFont(idx, preserveSizing) {var c = normTypography(cands[idx] || {});+ var prev = STATE.typography || {};STATE.typography = {name: c.name || "",heading: c.heading || {},body: c.body || {},- body_size: c.body_size || (STATE.typography && STATE.typography.body_size) || ""+ body_size: (preserveSizing && prev.body_size) ? prev.body_size : (c.body_size || prev.body_size || ""),+ sizes: (preserveSizing && prev.sizes) ? Object.assign({}, prev.sizes) : Object.assign({}, c.sizes || {})};if (sizeInput) sizeInput.value = STATE.typography.body_size || "";customInput.style.display = "none";grid.querySelectorAll(".font-card").forEach(function (card, i) { card.classList.toggle("selected", i === idx); });+ refreshSizeInputs(); // fill any role with no value yet; never overwrites existing valuesrefreshStylePreview();}function selectCustomTypography() {+ var prev = STATE.typography || {};STATE.typography = {name: "custom",custom: customInput.value || "",heading: {},body: {},- body_size: (STATE.typography && STATE.typography.body_size) || ""+ body_size: prev.body_size || "",+ sizes: Object.assign({}, prev.sizes || {}) // switching font family must not drop sizes};grid.querySelectorAll(".font-card").forEach(function (card) { card.classList.remove("selected"); });customCard.classList.add("selected");customInput.style.display = "block";customInput.focus();+ refreshSizeInputs();refreshStylePreview();}@@ -766,7 +903,7 @@top.appendChild(el("span", "font-card-name", localized(c, "name") || (t("option_prefix") + " " + (idx + 1))));var meta = t("font_heading") + " " + t("cjk") + ":" + (head.cjk || "—") + " / " + t("latin") + ":" + (head.latin || "—")+ " · " + t("font_body") + " " + t("cjk") + ":" + (body.cjk || "—") + " / " + t("latin") + ":" + (body.latin || "—");- if (c.body_size) meta += " · " + t("font_body_size") + ":" + c.body_size + "px";+ if (c.body_size) meta += " · " + t("font_body_size") + ":" + c.body_size + (isPptCanvas(STATE.canvas) ? "pt" : "px");top.appendChild(el("span", "font-card-meta", meta));card.appendChild(top);var hbox = el("div", "font-sample-heading-box"); fontSample(hbox, head, head.css); card.appendChild(hbox);@@ -796,32 +933,115 @@sizeInput.max = "96";sizeInput.step = "1";sizeInput.value = (STATE.typography && STATE.typography.body_size) || "";- sizeInput.placeholder = "18 / 24";+ sizeInput.placeholder = isPptCanvas(STATE.canvas) ? "16 / 20 / 24" : "40 / 48";sizeInput.addEventListener("input", function () {if (!STATE.typography) STATE.typography = { name: "", heading: {}, body: {} };+ // Independent input — body never auto-changes the role sizes (no+ // interlinking); the role inputs carry their own values.STATE.typography.body_size = sizeInput.value;+ refreshBodySizeHint(); // hint text only (e.g. out-of-range flag) — no value cascaderefreshStylePreview();});sizeRow.appendChild(sizeInput);var sizeHint = el("div", "toggle-desc");sizeRow.appendChild(sizeHint);- // Suggest a canvas-appropriate baseline (≈2.5–3.3% of canvas height) so- // a 16:9 default is not silently kept on a tall canvas. Hint only — the- // user's value is never overwritten; downstream §g re-derives if ignored.+ // Hint only — the user's value is never overwritten; downstream §g+ // re-derives if ignored. PPT canvases speak pt (range by delivery+ // purpose); non-PPT canvases speak px (≈% of canvas height).refreshBodySizeHint = function () {- var h = canvasHeight(STATE.canvas);var txt = t("font_body_size_hint");- if (h) {- txt += " " + t("body_size_hint_canvas")- .replace("{lo}", Math.round(h * 0.025))- .replace("{hi}", Math.round(h * 0.033));+ var lo, hi;+ if (isPptCanvas(STATE.canvas)) {+ var pb = deliveryPtBand(STATE.delivery_purpose);+ lo = pb.lo; hi = pb.hi;+ txt += " " + t("body_size_hint_pt")+ .replace("{lo}", pb.lo).replace("{hi}", pb.hi).replace("{def}", pb.def);+ } else {+ var h = canvasHeight(STATE.canvas);+ var band = bodySizeRatioBand(STATE.canvas);+ if (h) {+ lo = Math.round(h * band.lo); hi = Math.round(h * band.hi);+ txt += " " + t("body_size_hint_canvas")+ .replace("{lo}", lo).replace("{hi}", hi);+ }+ }+ // Flag (hint only — never auto-corrected) a value outside the range,+ // e.g. a pt number kept after switching to a px canvas, so a cross-unit+ // switch is visible instead of silently submitting a mis-unit size.+ var cur = parseFloat(STATE.typography && STATE.typography.body_size);+ if (isFinite(cur) && isFinite(lo) && isFinite(hi) && (cur < lo || cur > hi)) {+ txt += " " + t("body_size_hint_oor");}sizeHint.textContent = txt;};refreshBodySizeHint();sizeField.appendChild(sizeRow);++ // Delivery purpose (PPT only) — informs the recommended pt baseline and the+ // suggested-range hint. Picking it updates the hint + strategy signal only;+ // it does not rewrite the body field (inputs are independent, no cascade).+ if (isPptCanvas(STATE.canvas)) {+ var purposeField = el("div", "subfield");+ purposeField.appendChild(el("div", "subfield-label", t("delivery_purpose")));+ enumField(purposeField, CAT.delivery_purpose,+ recOrFirst("delivery_purpose", CAT.delivery_purpose),+ function () { return STATE.delivery_purpose; },+ function (v) {+ STATE.delivery_purpose = v;+ // Purpose only updates the suggested-range hint and the strategy+ // signal it carries to result.json — it never rewrites the body+ // size the user sees (no input interlinking).+ refreshBodySizeHint();+ refreshStylePreview();+ });+ sec.appendChild(purposeField);+ }sec.appendChild(sizeField);+ // Per-role size override (parallel to color's per-role HEX override): the+ // ramp derives title / subtitle / annotation from body, but the user may+ // set each explicitly. Values follow body's unit (pt on PPT, px else).+ var sizeOverride = el("div", "hex-override");+ sizeOverride.appendChild(el("div", "subfield-label", t("size_override")));+ var srow = el("div", "hex-row");+ var sizeInputs = {};+ SIZE_ROLES.forEach(function (role) {+ var wrap = el("div", "hex-cell");+ wrap.appendChild(el("div", "hex-cell-label", t("size_role_" + role)));+ var inp = document.createElement("input");+ inp.type = "number"; inp.min = "6"; inp.max = "200"; inp.step = "1";+ inp.addEventListener("input", function () {+ if (!STATE.typography) STATE.typography = { name: "", heading: {}, body: {} };+ if (!STATE.typography.sizes) STATE.typography.sizes = {};+ // Independent input — each role holds its own value; no cascade.+ STATE.typography.sizes[role] = inp.value;+ refreshStylePreview();+ });+ sizeInputs[role] = inp;+ wrap.appendChild(inp); srow.appendChild(wrap);+ });+ sizeOverride.appendChild(srow);+ sec.appendChild(sizeOverride);++ // Inputs are independent — this only **fills a role that has no value yet**+ // (a one-time starting suggestion from the ramp) and reflects the current+ // value into the input. It never overwrites an existing value, so editing+ // body / purpose / canvas does not cascade into the role sizes, and a+ // re-render (canvas / language switch) preserves exactly what the user sees.+ refreshSizeInputs = function () {+ if (!STATE.typography) STATE.typography = { name: "", heading: {}, body: {} };+ if (!STATE.typography.sizes) STATE.typography.sizes = {};+ var bodyVal = parseFloat(STATE.typography.body_size) ||+ (isPptCanvas(STATE.canvas) ? deliveryPtBand(STATE.delivery_purpose).def : 40);+ SIZE_ROLES.forEach(function (role) {+ var cur = STATE.typography.sizes[role];+ var hasVal = cur !== undefined && cur !== null && cur !== "";+ if (!hasVal) STATE.typography.sizes[role] = deriveSize(role, bodyVal);+ if (sizeInputs[role]) sizeInputs[role].value = STATE.typography.sizes[role];+ });+ };+ refreshSizeInputs();+var subfp = el("div", "subfield");subfp.appendChild(el("div", "subfield-label", t("formula_policy")));enumField(subfp, CAT.formula_policy, recOrFirst("formula_policy", CAT.formula_policy),@@ -831,7 +1051,7 @@var selIdx = -1;if (STATE.typography && STATE.typography.name) cands.forEach(function (c, i) { if (c.name === STATE.typography.name) selIdx = i; });- if (selIdx >= 0) selectFont(selIdx);+ if (selIdx >= 0) selectFont(selIdx, true);else if (STATE.typography && STATE.typography.name === "custom") {customInput.value = STATE.typography.custom || "";customCard.classList.add("selected");@@ -888,7 +1108,10 @@var acc = hexOr(pal.accent, pri);var sacc = hexOr(pal.secondary_accent, acc);var txt = hexOr(pal.body_text, "#1d2430");- var bodyPx = Math.max(12, Math.min(26, parseInt(typ.body_size, 10) || 18));+ // body_size is pt on PPT canvases (×4/3 → px) and px elsewhere.+ var rawSize = parseFloat(typ.body_size) || (isPptCanvas(STATE.canvas) ? 20 : 18);+ var bodyPx = Math.max(12, Math.min(34,+ isPptCanvas(STATE.canvas) ? rawSize * 4 / 3 : rawSize));var headStack = previewFontStack(head.cjk, head.css);var headLatStack = previewFontStack(head.latin, head.css);var bodyStack = previewFontStack(body.cjk, body.css);@@ -1027,6 +1250,7 @@// write to now-detached nodes until renderStylePreview remounts it.refreshStylePreview = function () {};refreshBodySizeHint = function () {};+ refreshSizeInputs = function () {};renderCanvas(host);renderPages(host);renderAudience(host);@@ -1077,7 +1301,8 @@name: t0.name || "",heading: t0.heading || {},body: t0.body || {},- body_size: t0.body_size || typographyBodySize(REC.typography)+ body_size: t0.body_size || typographyBodySize(REC.typography),+ sizes: Object.assign({}, t0.sizes || {})};STATE.formula_policy = pick("formula_policy", CAT.formula_policy);@@ -1086,6 +1311,15 @@STATE.generation_mode = pick("generation_mode", CAT.generation_mode);STATE.refine_spec = !!((REC.refine_spec && REC.refine_spec.value) || (REC.recommend && REC.recommend.refine_spec));+ // Delivery purpose drives the PPT confirmation pt baseline; default balanced+ // (not the catalog-first id) when the Strategist did not recommend one.+ STATE.delivery_purpose = recId("delivery_purpose") || "balanced";+ // Guarantee a body baseline even when a candidate omitted body_size, on+ // any canvas (PPT → pt default by purpose, non-PPT → px from canvas height),+ // so role sizes never derive from an empty anchor.+ if (STATE.typography && !STATE.typography.body_size) {+ STATE.typography.body_size = defaultBodySizeForCanvas(STATE.canvas, STATE.delivery_purpose);+ }}// ---- confirm + close -------------------------------------------------@@ -1098,7 +1332,8 @@function confirm() {var btn = document.getElementById("btn-confirm");- var payload = Object.assign({}, STATE);+ var payload = JSON.parse(JSON.stringify(STATE));+ normalizeTypographyForSubmit(payload);var customImagePlan = usesCustomImagePlanValue(payload.image_usage);if (payload.image_usage === "custom" || (customImagePlan && !String(payload.image_usage).trim())) {document.getElementById("confirm-status").textContent = t("image_usage_custom_required");diff --git a/skills/ppt-master/scripts/confirm_ui/static/catalogs.json b/skills/ppt-master/scripts/confirm_ui/static/catalogs.jsonindex fb241fee..164f96c6 100644--- a/skills/ppt-master/scripts/confirm_ui/static/catalogs.json+++ b/skills/ppt-master/scripts/confirm_ui/static/catalogs.json@@ -448,5 +448,31 @@"label_zh": "分段模式","label_en": "split"}+ ],+ "delivery_purpose": [+ {+ "id": "text",+ "label": "text",+ "label_zh": "文字型 · 近读",+ "label_en": "text / read-close",+ "desc_zh": "当文件读、近距离看(报告、数据密集 brief、留底材料)。正文可小,14–18pt,默认 16pt。",+ "desc_en": "Read close as a file (report, data-dense brief, leave-behind). Body can run small, 14–18pt, default 16pt."+ },+ {+ "id": "balanced",+ "label": "balanced",+ "label_zh": "均衡 · 商务",+ "label_en": "balanced / business",+ "desc_zh": "既投影也阅读(路演、业务评审)。默认档,18–22pt,默认 20pt。",+ "desc_en": "Both projected and read (roadshow, business review). The default tier, 18–22pt, default 20pt."+ },+ {+ "id": "presentation",+ "label": "presentation",+ "label_zh": "展示型 · 演讲",+ "label_en": "presentation / keynote",+ "desc_zh": "投影、远距离扫一眼、内容稀疏(keynote、发布、课堂)。22–28pt,默认 24pt。",+ "desc_en": "Projected, glanced from the back, sparse (keynote, launch, classroom). 22–28pt, default 24pt."+ }]}diff --git a/skills/ppt-master/scripts/docs/confirm_ui.md b/skills/ppt-master/scripts/docs/confirm_ui.mdindex cb38c1cb..d9937e63 100644--- a/skills/ppt-master/scripts/docs/confirm_ui.md+++ b/skills/ppt-master/scripts/docs/confirm_ui.md@@ -39,7 +39,7 @@ pip install flask## Catalogs — `static/catalogs.json` (the finite option universe)-The front-end loads `/api/catalogs` (served by the confirm server) and falls back to the static `/static/catalogs.json` if that route is unavailable. `/api/catalogs` returns the static file **with the `canvas` list synced live from `config.py CANVAS_FORMATS`** — the set of formats and their `dim` come from config (single source of truth, zero drift), while bilingual labels / use text stay in catalogs.json (a plain fallback label is synthesized for any new id config adds). Keys: `canvas`, `modes`, `visual_styles` (grouped), `icons`, `image_usage`, `image_ai_path`, `formula_policy`, `generation_mode`. Each entry is `{ "id", "label", "label_zh", "label_en", ... }`; descriptions use `desc_zh` / `desc_en`, and `visual_styles` groups use `group_zh` / `group_en`. The front-end falls back to legacy `label` / `desc` / `group`, so old catalogs still load, but new user-facing catalog text must be bilingual. English labels should mirror canonical reference names (`pyramid`, `swiss-minimal`, `Path A`, `mixed`, etc.); Chinese labels should be translated for users. Descriptions render inline after the option title, not as a separate selected-option line. `visual_styles` is `[{ "group", "group_zh", "group_en", "items": [...] }]`. For `canvas` you only need to maintain the bilingual labels in catalogs.json; the format set and dimensions are authoritative in `config.py CANVAS_FORMATS`.+The front-end loads `/api/catalogs` (served by the confirm server) and falls back to the static `/static/catalogs.json` if that route is unavailable. `/api/catalogs` returns the static file **with the `canvas` list synced live from `config.py CANVAS_FORMATS`** — the set of formats and their `dim` come from config (single source of truth, zero drift), while bilingual labels / use text stay in catalogs.json (a plain fallback label is synthesized for any new id config adds). Keys: `canvas`, `modes`, `visual_styles` (grouped), `icons`, `image_usage`, `image_ai_path`, `formula_policy`, `generation_mode`, `delivery_purpose`. Each entry is `{ "id", "label", "label_zh", "label_en", ... }`; descriptions use `desc_zh` / `desc_en`, and `visual_styles` groups use `group_zh` / `group_en`. The front-end falls back to legacy `label` / `desc` / `group`, so old catalogs still load, but new user-facing catalog text must be bilingual. English labels should mirror canonical reference names (`pyramid`, `swiss-minimal`, `Path A`, `mixed`, etc.); Chinese labels should be translated for users. Descriptions render inline after the option title, not as a separate selected-option line. `visual_styles` is `[{ "group", "group_zh", "group_en", "items": [...] }]`. For `canvas` you only need to maintain the bilingual labels in catalogs.json; the format set and dimensions are authoritative in `config.py CANVAS_FORMATS`.## Round-trip data contract@@ -57,7 +57,8 @@ Both files live under `<project_path>/confirm_ui/`."icons": "tabler-outline","image_usage": "web","formula_policy": "mixed",- "generation_mode": "continuous"+ "generation_mode": "continuous",+ "delivery_purpose": "balanced"},"page_count": { "value": "12-15" },"audience": { "value": "..." },@@ -82,7 +83,7 @@ Both files live under `<project_path>/confirm_ui/`.{ "name": "...", "note": "...","heading": { "cjk": "思源黑体", "latin": "Inter", "css": "'Source Han Sans SC','Inter',sans-serif", "sample_cjk": "标题示例", "sample_latin": "Heading Sample" },"body": { "cjk": "思源黑体", "latin": "Inter", "css": "...", "sample_cjk": "正文示例", "sample_latin": "Body sample" },- "body_size": 18 }+ "body_size": 20 }]},"image_strategy": {@@ -114,7 +115,9 @@ Both files live under `<project_path>/confirm_ui/`.- For a custom image plan, the page treats "may include AI" as true only when the recommendation includes `recommend.image_ai_path` or `image_strategy.candidates`; a custom plan without those signals is handled as non-AI and omits AI controls / fields.- **Color candidates carry the user-facing core `palette`**: `background`, `secondary_bg`, `primary`, `accent`, `secondary_accent`, and `body_text`. The page renders labelled swatches and offers per-role override inputs for precise single-role edits, plus a **Custom color card with a free-text box** (parallel to the custom typography box) — the user can describe the palette in words or paste HEX values instead of filling each role; this writes `color: { "name": "custom", "custom": "<text>" }` to `result.json` for the AI to interpret. Legacy `text` is accepted as an alias for `body_text`, but new files should write `body_text`. Strategist derives secondary text, borders, state colors, and visual-style neutral tiers later when writing `design_spec.md` / `spec_lock.md`; those are not user-facing confirmation choices.- **Candidate display text may be bilingual**: color / typography candidates can provide `name_zh` / `name_en` and `note_zh` / `note_en`; the page falls back to legacy `name` / `note`.-- **Typography candidates split CJK and Latin** for both `heading` and `body`; `css` is the fallback preview `font-family` stack. The page previews CJK sample text with `cjk + css` and Latin sample text with `latin + css`, so the two script choices are visible independently. Each candidate should also include `body_size` (the body baseline in px; common values are 18 and 24, but any reasonable integer is valid). The page exposes `body_size` as an editable numeric field whose hint shows a canvas-appropriate range (≈2.5–3.3% of the confirmed canvas height, parsed from the canvas `dim`), updated when the canvas changes — a hint only, never an override, so a 16:9 default is not silently kept on a tall canvas (Xiaohongshu / Story / A4). It also offers a custom typography text box so the user is not limited to the proposed candidates.+- **Typography candidates split CJK and Latin** for both `heading` and `body`; `css` is the fallback preview `font-family` stack. The page previews CJK sample text with `cjk + css` and Latin sample text with `latin + css`, so the two script choices are visible independently. Each candidate should also include `body_size` — the body baseline, **shown in pt for PPT canvases (16:9 / 4:3), in px for non-PPT canvases** (Xiaohongshu / Story / A4 have no PowerPoint pt semantics). For PPT, the page shows/edits pt; the initial value comes from the candidate's `body_size` (sized for the recommended delivery purpose: 文字型 ~16 · 均衡 ~20 · 展示型 ~24). On submit, the page normalizes PPT values to px before writing `result.json`: `typography.body_size` is px, `typography.body_size_pt` preserves the original pt for provenance. Chat fallback must produce the same normalized contract before `design_spec.md` / `spec_lock.md` are written. The page exposes `body_size` as an editable numeric field whose hint shows a canvas-appropriate range (PPT 14–28pt by delivery purpose, non-PPT ≈2.5–3.3% of height in px). **Inputs are independent — the hint updates with canvas / delivery purpose but never rewrites a value the user can see.** It also offers a custom typography text box so the user is not limited to the proposed candidates.+- **Per-role size override** (parallel to color's per-role HEX override): besides `body_size`, the page exposes **independent** editable inputs for `title` / `subtitle` / `annotation`. Each role is pre-filled **once** with a starting value — the candidate's `typography.sizes[role]` if provided, otherwise a one-time ramp suggestion (`body × ` mid-band ratio) — and then holds its own value. **There is no cross-field cascade**: changing `body_size`, `delivery_purpose`, or canvas updates only the suggested-range hint, never the role values; a re-render preserves exactly what the user sees. The final values are written to `result.json` as `typography.sizes: { "title", "subtitle", "annotation" }` in px; for PPT canvases, `typography.sizes_pt` preserves the original pt values for provenance. Seeding `sizes` in a candidate is optional — omit it and each role gets its one-time ramp suggestion.+- **`delivery_purpose`** (enumerable, PPT only) is the primary driver of the body baseline: `text` (文字型 · read-close), `balanced` (均衡 · business, the default), `presentation` (展示型 · presentation). It is surfaced inside the typography section (item 7) because it informs the recommended body pt and the suggested-range hint above — but the pick itself does not rewrite the body field (inputs are independent). `recommend.delivery_purpose` pre-selects one (default `balanced`); the user's pick writes back to `result.json.delivery_purpose` as a plain id. Strategist uses it to choose the normalized px body baseline and the within-band density/style nudge (see [strategist.md §g](../../references/strategist.md)). Non-PPT canvases omit it.- **Combined style preview** — a compact live "overall impression" strip sits just above the color section and is **sticky**: it pins under the topbar so it stays visible while the user scrolls through the color / icon / typography sections, keeping the picking controls and their combined effect on screen together. It applies the currently selected color palette **and** typography (heading sample in `primary` over `background`, body sample in `body_text`, an `accent` bar, a `secondary_bg` chip) and repaints on every color / HEX-override / font / `body_size` change. It does not replace the per-candidate swatches or font samples (those stay for picking); it is deliberately an abstract style chip, **not** a slide-layout preview — page layout preview remains the live-preview server's job (Step 6). No schema field; it derives entirely from the existing color + typography selections.- **Generated image style candidates** live in `image_strategy.candidates` and are shown only when `image_usage` is `ai` or a custom image plan may include generated images. Each candidate records `rendering`, `palette`, and short `visual` / `color` / `mood` lines from Strategist h.5. The chosen value is written to `result.json.image_strategy`; it is omitted when generated images are not part of the plan.- **`visual_style_spectrum`** (optional) lets the AI surface the deck's aesthetic as a **personality spectrum** instead of one badged style. Each entry is `{ "id", "tag_zh"/"tag_en", "note_zh"/"note_en" }` where `id` is a real `visual_styles` catalog id; the page badges those chips with their temperament `tag` (replacing the single ★) and appends the `note` (a real-world analogy) inline. The full grouped style list and Custom box stay visible below, and `recommend.visual_style` is still the pre-selected default (it should equal the spectrum's safe pick). Author **≥3** spanning safe / shifted / bold (mirrors h.5; honest-shortfall exception applies — fewer only when the constraints genuinely cannot yield 3). The user's pick still writes back to `result.json.visual_style` as a plain id; the spectrum is presentation-only. Omit the field to fall back to the single-recommendation badge.@@ -134,7 +137,8 @@ Both files live under `<project_path>/confirm_ui/`."visual_style": "swiss-minimal","color": { "name": "...", "palette": { "background": "#...", "secondary_bg": "#...", "primary": "#...", "accent": "#...", "secondary_accent": "#...", "body_text": "#..." } },"icons": "tabler-outline",- "typography": { "name": "...", "heading": { "cjk": "...", "latin": "...", "css": "..." }, "body": { "cjk": "...", "latin": "...", "css": "..." }, "body_size": 18 },+ "typography": { "name": "...", "heading": { "cjk": "...", "latin": "...", "css": "..." }, "body": { "cjk": "...", "latin": "...", "css": "..." }, "body_size": 26.67, "body_size_pt": 20, "body_size_unit": "px", "body_size_source_unit": "pt", "sizes": { "title": 46.67, "subtitle": 36, "annotation": 21.33 }, "sizes_pt": { "title": 35, "subtitle": 27, "annotation": 16 } },+ "delivery_purpose": "balanced","formula_policy": "mixed","image_usage": "web","image_strategy": { "name": "方案 A", "rendering": "vector-illustration", "palette": "cool-corporate", "visual": "...", "color": "...", "mood": "..." },diff --git a/skills/ppt-master/scripts/pt_to_px.py b/skills/ppt-master/scripts/pt_to_px.pynew file mode 100644index 00000000..319f01ff--- /dev/null+++ b/skills/ppt-master/scripts/pt_to_px.py@@ -0,0 +1,94 @@+#!/usr/bin/env python3+"""+PPT Master - Point-to-Pixel Font Size Converter++Deterministic pt <-> SVG-px font-size conversion, the single source of truth for+the chat-fallback path of the Eight Confirmations (the Confirm UI does the same+math in app.js at submit time). PPT canvases confirm font sizes in pt; the+execution layer (design_spec.md / spec_lock.md / SVG) carries unitless px only.+Convert here instead of mental arithmetic so the chat path matches the UI path.++ px = pt * 4 / 3 (the inverse of the exporter's px * 0.75; canvas 1280px -> 960pt slide)++Rounding matches app.js `roundSize` (2 decimals, round-half-up), so a value+confirmed in pt round-trips back to the same pt at export.++Usage:+ python3 scripts/pt_to_px.py <pt> [<pt> ...]+ python3 scripts/pt_to_px.py --reverse <px> [<px> ...]++Examples:+ python3 scripts/pt_to_px.py 20 # -> 26.67 (write into spec_lock body)+ python3 scripts/pt_to_px.py 20 36 27 15 # body title subtitle annotation -> 26.67 48 36 20+ python3 scripts/pt_to_px.py --reverse 26.67 # -> 20 (what PowerPoint will display)++Dependencies:+ None (only uses standard library)++See references/strategist.md §g (Font Size Ramp) for the pt/px unit boundary.+"""++import sys+import math+import argparse+from typing import Optional++PT_TO_PX = 4 / 3 # px = pt * 4/3+PX_TO_PT = 0.75 # pt = px * 0.75 (mirrors svg_to_pptx FONT_PX_TO_HUNDREDTHS_PT)+++def _round_half_up(value: float, decimals: int = 2) -> float:+ """Round half-up to ``decimals`` places, matching app.js ``Math.round``."""+ factor = 10 ** decimals+ return math.floor(value * factor + 0.5) / factor+++def pt_to_px(pt: float) -> float:+ """Convert a pt font size to its unitless SVG px value."""+ return _round_half_up(pt * PT_TO_PX)+++def px_to_pt(px: float) -> float:+ """Convert an SVG px font size back to the pt PowerPoint will display."""+ return _round_half_up(px * PX_TO_PT)+++def _fmt(value: float) -> str:+ """Drop a trailing ``.0`` so integers print clean (32, not 32.0)."""+ return str(int(value)) if value == int(value) else f"{value:.2f}"+++def _parse_size(raw: str) -> float:+ """Accept a bare number or a value with a stray pt/px suffix."""+ return float(raw.strip().lower().removesuffix("pt").removesuffix("px").strip())+++def build_parser() -> argparse.ArgumentParser:+ parser = argparse.ArgumentParser(+ description="Convert pt font sizes to unitless SVG px (or back with --reverse).",+ formatter_class=argparse.RawDescriptionHelpFormatter,+ )+ parser.add_argument("sizes", nargs="+", help="One or more font sizes to convert.")+ parser.add_argument(+ "-r", "--reverse", action="store_true",+ help="Convert px -> pt instead of pt -> px (debug / verification).",+ )+ return parser+++def main(argv: Optional[list[str]] = None) -> int:+ parser = build_parser()+ args = parser.parse_args(argv)+ convert = px_to_pt if args.reverse else pt_to_px+ try:+ values = [convert(_parse_size(s)) for s in args.sizes]+ except ValueError:+ print("Error: every size must be a number (optionally suffixed pt/px).",+ file=sys.stderr)+ return 1+ print(" ".join(_fmt(v) for v in values))+ return 0+++if __name__ == "__main__":+ raise SystemExit(main())diff --git a/skills/ppt-master/scripts/svg_quality_checker.py b/skills/ppt-master/scripts/svg_quality_checker.pyindex c5c4bbc6..53b68466 100644--- a/skills/ppt-master/scripts/svg_quality_checker.py+++ b/skills/ppt-master/scripts/svg_quality_checker.py@@ -264,31 +264,34 @@ class SVGQualityChecker:# 2. Check forbidden elementsself._check_forbidden_elements(content, result)- # 3. Check fonts+ # 3. Check font-size values+ self._check_font_size_values(content, result)++ # 4. Check fontsself._check_fonts(content, result)- # 4. Check width/height consistency with viewBox+ # 5. Check width/height consistency with viewBoxself._check_dimensions(content, result)- # 5. Check text wrapping methods+ # 6. Check text wrapping methodsself._check_text_elements(content, result)- # 6. Check image references (file existence and resolution)+ # 7. Check image references (file existence and resolution)self._check_image_references(content, svg_path, result)- # 7. Check object-level animation anchor quality.+ # 8. Check object-level animation anchor quality.self._check_animation_group_ids(content, result)- # 7b. Check <pattern> elements declare a PPTX preset.+ # 8b. Check <pattern> elements declare a PPTX preset.self._check_pattern_fills(content, result)- # 8. Check spec_lock drift (colors / font-family / font-size).+ # 9. Check spec_lock drift (colors / font-family / font-size).# Templates do not ship a spec_lock.md, so skip in template# mode to avoid noise.if not self.template_mode:self._check_spec_lock_drift(content, svg_path, result)- # 9. Check web-sourced image attribution. Templates don't carry+ # 10. Check web-sourced image attribution. Templates don't carry# image_sources.json; skip in template mode.if not self.template_mode:self._check_sourced_image_attribution(content, svg_path, result)@@ -460,6 +463,31 @@ class SVGQualityChecker:if re.search(r'<image[^>]*\sopacity\s*=', content_lower):result['errors'].append("Detected forbidden <image opacity> (use overlay mask approach)")+ def _check_font_size_values(self, content: str, result: Dict):+ """Require font-size values to be unitless numeric SVG px values."""+ numeric_re = re.compile(r'^(?:\d+(?:\.\d+)?|\.\d+)$')+ bad_values = set()++ for match in re.finditer(r'\bfont-size\s*=\s*(["\'])(.*?)\1', content, re.IGNORECASE):+ raw = match.group(2).strip()+ if not numeric_re.fullmatch(raw):+ bad_values.add(raw)++ for match in re.finditer(r'\bfont-size\s*:\s*([^;"\']+)', content, re.IGNORECASE):+ raw = match.group(1).strip()+ if not numeric_re.fullmatch(raw):+ bad_values.add(raw)++ if bad_values:+ shown_values = sorted(bad_values)+ shown = ', '.join(shown_values[:5])+ more = len(shown_values) - 5+ suffix = f" (+{more} more)" if more > 0 else ""+ result['errors'].append(+ f"font-size must be a unitless numeric px value; found {shown}{suffix}. "+ "Write e.g. font-size=\"28\", never font-size=\"28px\" or \"21pt\"."+ )+def _check_fonts(self, content: str, result: Dict):"""Check font usage.@@ -734,6 +762,22 @@ class SVGQualityChecker:allowed_colors.add(v.upper())typo = lock.get('typography', {})+ numeric_size_re = re.compile(r'^(?:\d+(?:\.\d+)?|\.\d+)$')+ invalid_lock_sizes = []+ for k, v in typo.items():+ if k == 'font_family' or k.endswith('_family'):+ continue+ if not numeric_size_re.fullmatch(v.strip()):+ invalid_lock_sizes.append(f"{k}: {v}")+ if invalid_lock_sizes:+ shown = ', '.join(invalid_lock_sizes[:5])+ more = len(invalid_lock_sizes) - 5+ suffix = f" (+{more} more)" if more > 0 else ""+ result['errors'].append(+ f"spec_lock typography sizes must be unitless numeric px values; "+ f"found {shown}{suffix}."+ )+# Font families: default `font_family` plus any per-role `*_family`# override (title_family / body_family / emphasis_family / code_family,# per spec_lock_reference.md). Any of these is a legitimate declared@@ -893,9 +937,12 @@ class SVGQualityChecker:@staticmethoddef _normalize_size(value: str) -> str:- """Normalize a font-size value for comparison: lowercase, strip spaces,- strip trailing 'px'. Other units (em / rem / %) are kept as-is so that- e.g. '1.5em' vs '24' stay distinct."""+ """Normalize a font-size value for drift comparison.++ Unit-bearing SVG values are reported as errors before drift checking.+ The legacy `px` strip remains to avoid a duplicate drift warning after+ the hard error has already identified the unit problem.+ """v = value.strip().lower()if v.endswith('px'):v = v[:-2].strip()diff --git a/skills/ppt-master/scripts/svg_to_pptx/drawingml_elements.py b/skills/ppt-master/scripts/svg_to_pptx/drawingml_elements.pyindex a3a459eb..2197e8e4 100644--- a/skills/ppt-master/scripts/svg_to_pptx/drawingml_elements.py+++ b/skills/ppt-master/scripts/svg_to_pptx/drawingml_elements.py@@ -1007,7 +1007,11 @@ def _build_run_xml(text_dec = run.get('text_decoration', '')- sz = round(fs_px * FONT_PX_TO_HUNDREDTHS_PT)+ # Snap the exported font size to the nearest 0.5pt so PowerPoint shows a+ # clean value (integer or half-point), never 15.6pt / 22.67pt. Exact size is+ # fs_px * FONT_PX_TO_HUNDREDTHS_PT hundredths-of-pt; round that to the+ # 50-hundredths (0.5pt) grid. (Line spacing below keeps exact precision.)+ sz = int(fs_px * FONT_PX_TO_HUNDREDTHS_PT / 50 + 0.5) * 50b_attr = ' b="1"' if fw in ('bold', '600', '700', '800', '900') else ''i_attr = ' i="1"' if fstyle == 'italic' else ''u_attr = ' u="sng"' if 'underline' in text_dec else ''diff --git a/skills/ppt-master/templates/design_spec_reference.md b/skills/ppt-master/templates/design_spec_reference.mdindex 49f1e71f..19ff024b 100644--- a/skills/ppt-master/templates/design_spec_reference.md+++ b/skills/ppt-master/templates/design_spec_reference.md@@ -14,6 +14,7 @@| **Design Style** | {design_style} || **Target Audience** | [Filled by Strategist] || **Use Case** | [Filled by Strategist] |+| **Delivery Purpose** | [文字型 read-close / 均衡 business / 展示型 presentation — confirmed at item 7; a deck-wide consumption mode that drives per-page density, page-count recommendation, page_rhythm lean, and the normalized body baseline. See strategist.md §6.1.] || **Content Strategy** | [Material divergence — the user's free-text intent on how closely to follow the source vs how freely to reshape it (or "balanced default"); facts stay sourced however free. Confirmed at c; consumed when authoring §IX. Not in spec_lock.] || **Created Date** | {date_str} |@@ -98,7 +99,7 @@**Typography direction**: [Fill in one phrase, e.g., "modern CJK sans" / "academic serif" / "brand-specific: McKinsey Bower (requires font install)"]-> Step 4 Confirm UI: present **≥3** typography candidates (creative recommendations always offer real choice — same rule as h.5; fewer only on the honest-shortfall exception, with a stated reason), each splitting CJK + Latin for `heading` and `body` (with `css` preview stacks) and declaring `body_size` as the body baseline px, in `confirm_ui/recommendations.json`; the confirmed candidate from `result.json` seeds the plan below. Schema: [`scripts/docs/confirm_ui.md`](../scripts/docs/confirm_ui.md).+> Step 4 Confirm UI: present **≥3** typography candidates (creative recommendations always offer real choice — same rule as h.5; fewer only on the honest-shortfall exception, with a stated reason), each splitting CJK + Latin for `heading` and `body` (with `css` preview stacks) and declaring `body_size` as the user-facing body baseline (pt for PPT canvases, px for non-PPT), in `confirm_ui/recommendations.json`; the confirmed `result.json` normalizes the execution value to px before this spec is written. Schema: [`scripts/docs/confirm_ui.md`](../scripts/docs/confirm_ui.md).Two views on the same font decisions — fill both, keep them consistent:@@ -129,24 +130,24 @@ Two views on the same font decisions — fill both, keep them consistent:### Font Size Hierarchy-> **Ramp discipline, not a fixed menu.** `body` is the single anchor; every other size is a ratio of it. Each row below gives the role's allowed ratio band — Executor may pick any px value inside the band (e.g., 40px hero number, 13px chart annotation, 72px cover headline) without pre-declaring intermediates in `spec_lock.md`.-> **Unit**: px uniformly (SVG native) to avoid pt/px conversion errors.-> **Baseline selection**: drive by **content density**, not design style.+> **Ramp discipline, not a fixed menu.** `body` is the single anchor; every other size is a ratio of it. Each row below gives the role's allowed ratio band — Executor may pick any unitless px value inside the band (e.g., 48 page title, 18 chart annotation, 88 cover headline) without pre-declaring intermediates in `spec_lock.md`.+> **Unit boundary (HARD rule).** Author this section in **unitless px**. PPT canvases may be confirmed in pt, but that conversion is already resolved before writing this spec (`px = pt × 4⁄3`); `design_spec.md`, `spec_lock.md`, and SVG carry px only. Never write `pt`, `px`, `em`, or any unit in `spec_lock.md` or SVG. Geometry (margins / gaps / card sizes) is px everywhere. Non-PPT canvases use px throughout.+> **Baseline selection**: drive by **delivery purpose** first (read-close vs. presentation), then content density; visual style only nudges within the chosen band.-**Baseline**: Body font size = [fill in]px (any reasonable integer — `18` and `24` are most common; `16` for chart-heavy, `20`/`22` for medium density, `28-32` for poster / cover decks are all valid. Drive by content density.)+**Baseline (unitless px)**: Body font size = [fill in]. For PPT 16:9, normalize from the confirmed delivery-purpose pt band: **文字型 / read-close** `14–18pt` → `18.67–24`, **均衡 / business** `18–22pt` → `24–29.33` (default `26.67`), **展示型 / presentation** `22–28pt` → `29.33–37.33`. Within the band, density picks the point (6+ items → low · sparse / cover → high) and visual style nudges (technical / data low · corporate / instructional mid · editorial / narrative / showcase high). The user may also pin individual role sizes (`title` / `subtitle` / `annotation`) directly in the Confirm UI — a confirmed per-role value (`result.json typography.sizes`) is already px and becomes the locked slot for that role; the rest derive from the ramp. For non-PPT canvases, author px from the confirmed canvas scale (see [strategist.md §g](../references/strategist.md) per-canvas table).-| Purpose | Ratio to body | Example @ body=24 (relaxed) | Example @ body=18 (dense) | Weight |+| Purpose | Ratio to body | Example @ body=32 (24pt UI) | Example @ body=24 (18pt UI) | Weight || ------- | ------------- | --------------------------- | ------------------------- | ------ |-| Cover title (hero headline) | 2.5-5x | 60-120px | 45-90px | Bold / Heavy |-| Chapter / section opener | 2-2.5x | 48-60px | 36-45px | Bold |-| Page title | 1.5-2x | 36-48px | 27-36px | Bold |-| Hero number (consulting KPIs) | 1.5-2x | 36-48px | 27-36px | Bold |-| Subtitle | 1.2-1.5x | 29-36px | 22-27px | SemiBold |-| **Body content** | **1x** | **24px** | **18px** | Regular |-| Annotation / caption | 0.7-0.85x | 17-20px | 13-15px | Regular |-| Page number / footnote | 0.5-0.65x | 12-16px | 9-12px | Regular |--> The two px columns are illustrations for common baselines. For any other `body` value, multiply by each row's ratio — the checker (`svg_quality_checker._check_spec_lock_drift`) reads the live `body` from `spec_lock.md` and applies the bands, so no code change is needed for a different baseline.+| Cover title (hero headline) | 2.5-5x | 80-160 | 60-120 | Bold / Heavy |+| Chapter / section opener | 2-2.5x | 64-80 | 48-60 | Bold |+| Page title | 1.5-2x | 48-64 | 36-48 | Bold |+| Hero number (consulting KPIs) | 1.5-2x | 48-64 | 36-48 | Bold |+| Subtitle | 1.2-1.5x | 38-48 | 29-36 | SemiBold |+| **Body content** | **1x** | **32** | **24** | Regular |+| Annotation / caption | 0.7-0.85x | 22-27 | 17-20 | Regular |+| Page number / footnote | 0.5-0.65x | 16-21 | 12-16 | Regular |++> The two px columns are illustrations for common baselines. For any other `body` value, multiply by each row's ratio. When the confirmation came from PPT pt, you may record the provenance once (e.g. "confirmed as 20pt") in prose, but the size values in this section and in `spec_lock.md` stay normalized px. The checker (`svg_quality_checker._check_spec_lock_drift`) reads the live `body` (px) from `spec_lock.md` and applies the bands, so no code change is needed for a different baseline.> Sizes outside **every** band remain forbidden — surface the need and extend `spec_lock.md typography` (e.g., `cover_title: 96`) rather than invent a one-off value.diff --git a/skills/ppt-master/templates/spec_lock_reference.md b/skills/ppt-master/templates/spec_lock_reference.mdindex 5b2b8b37..b715ecda 100644--- a/skills/ppt-master/templates/spec_lock_reference.md+++ b/skills/ppt-master/templates/spec_lock_reference.md@@ -54,10 +54,10 @@- body_family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif- emphasis_family: Georgia, SimSun, serif- code_family: Consolas, "Courier New", monospace-- body: 22-- title: 32-- subtitle: 24-- annotation: 14+- body: 26.67+- title: 48+- subtitle: 36+- annotation: 20> **All five family lines are listed explicitly** so Strategist considers every role — `code_family` and `emphasis_family` are easily forgotten. In a real `spec_lock.md`:> - Keep any `*_family` whose role genuinely differs from `font_family`.@@ -68,9 +68,9 @@>> **Source**: copy verbatim from the *Per-role font stacks* list in `design_spec.md §IV Font Plan`. Stack **order** encodes browser-rendering intent (Latin-led vs. CJK-led) that the breakdown table cannot — strings here must match character-for-character. See `design_spec.md §IV` for the explainer.>-> Sizes (`body` / `title` / etc.) are in px, matching SVG units. `body` is the **required baseline anchor** — all other sizes derive as ratios of it (ramp table: `design_spec_reference.md §IV`).+> Sizes (`body` / `title` / etc.) are **unitless px numbers** — the execution unit and the same values recorded in `design_spec.md §IV`. PPT canvases may have been confirmed in pt, but that conversion is resolved before spec writing (`px = pt × 4⁄3`; e.g. body 20pt → `26.67`, title 36pt → `48`, subtitle 27pt → `36`, annotation 15pt → `20`). For non-PPT canvases there is no pt layer — the px is authored directly. Do not write `pt` / `px` / `em` or any unit, and **do not copy a confirmed pt number unconverted** (`20` would render as 15pt — the one error the unit guard cannot catch). `body` is the **required baseline anchor** — all other sizes derive as ratios of it (ramp table: `design_spec_reference.md §IV`).>-> **Size slots are anchors, not a closed menu.** Common slots (`title` / `subtitle` / `annotation`) cover frequent cases. Add role-specific slots (e.g. `cover_title: 72`, `hero_number: 48`, `chart_annotation: 13`) when needed — common for cover-heavy decks, consulting-style hero numbers, dense pages. Executor may use intermediate sizes as long as the ratio to `body` sits in the role's ramp band.+> **Size slots are anchors, not a closed menu.** Common slots (`title` / `subtitle` / `annotation`) cover frequent cases. Add role-specific slots (e.g. `cover_title: 88`, `hero_number: 56`, `chart_annotation: 18`) when needed — common for cover-heavy decks, consulting-style hero numbers, dense pages. Executor may use intermediate sizes as long as the ratio to `body` sits in the role's ramp band.>> **⚠️ PPT-safe stack discipline (HARD rule).** PPTX stores one `typeface` per run with no runtime fallback. Every stack MUST end with a cross-platform pre-installed font: `"Microsoft YaHei", sans-serif` / `SimSun, serif` / `Arial, sans-serif` / `"Times New Roman", serif` / `Consolas, "Courier New", monospace`. Non-preinstalled fonts (Inter / Google Fonts / brand typefaces) may lead the stack only when the Design Spec notes the font-install or embedding requirement.>diff --git a/skills/ppt-master/workflows/beautify-pptx.md b/skills/ppt-master/workflows/beautify-pptx.mdindex 2b590a85..d63df2e9 100644--- a/skills/ppt-master/workflows/beautify-pptx.md+++ b/skills/ppt-master/workflows/beautify-pptx.md@@ -181,8 +181,8 @@ Write `<project_path>/confirm_ui/recommendations.json` and launch the same confi{ "name_zh": "备选配色 A", "name_en": "Alternative palette A", "palette": { "background": "#...", "secondary_bg": "#...", "primary": "#...", "accent": "#...", "secondary_accent": "#...", "body_text": "#..." } }] },"typography": { "selected": 0, "candidates": [- { "name_zh": "复刻源 PPT(推荐)", "name_en": "Source replica (recommended)", "heading": { "cjk": "...", "latin": "...", "css": "<PPT-safe stack>" }, "body": { "cjk": "...", "latin": "...", "css": "<PPT-safe stack>" }, "body_size": <source observed size in px = dominant observed.sizes_pt ÷ 0.75> },- { "name_zh": "实际字体(observed)", "name_en": "Observed fonts", "heading": { "cjk": "...", "latin": "...", "css": "<PPT-safe stack>" }, "body": { "cjk": "...", "latin": "...", "css": "<PPT-safe stack>" }, "body_size": <source observed size in px> },+ { "name_zh": "复刻源 PPT(推荐)", "name_en": "Source replica (recommended)", "heading": { "cjk": "...", "latin": "...", "css": "<PPT-safe stack>" }, "body": { "cjk": "...", "latin": "...", "css": "<PPT-safe stack>" }, "body_size": <source observed size in pt = dominant observed.sizes_pt> },+ { "name_zh": "实际字体(observed)", "name_en": "Observed fonts", "heading": { "cjk": "...", "latin": "...", "css": "<PPT-safe stack>" }, "body": { "cjk": "...", "latin": "...", "css": "<PPT-safe stack>" }, "body_size": <source observed size in pt> },{ "name_zh": "备选字体 A", "name_en": "Alternative pairing A", "heading": { "cjk": "...", "latin": "...", "css": "<PPT-safe stack>" }, "body": { "cjk": "...", "latin": "...", "css": "<PPT-safe stack>" }, "body_size": <canvas-appropriate baseline> }] }}@@ -191,7 +191,7 @@ Write `<project_path>/confirm_ui/recommendations.json` and launch the same confi- **Recommend keep, allow override**: pre-fill canvas / mode / visual style / icons / image strategy with the source-faithful default (canvas = Step 3 format, mode = `briefing`, image_usage = `provided` since pictures are reused). Enumerable fields already list every catalog option with the source-faithful one badged, so the user can switch. Beautify's only true non-choices are the frozen text and the strict 1:1 page count (changing those means routing to the main pipeline instead — see CLAUDE.md). The §c material-divergence field is therefore not surfaced here — beautify never reshapes content (text is verbatim).- **Our recommendation is the pre-selected default = the source replica**: for color and typography, author **several candidates** like the from-scratch flow. The pre-selected default (`selected: 0`, the first card) is what beautify recommends — the candidate that **best replicates the source deck's style** (the truest reading of `theme` / `observed`). Replicate-by-default.- **Judge the other alternatives exactly as the from-scratch flow does — fonts as much as colors**: don't invent a beautify-specific rule. Author each non-replica candidate with the **same content-driven judgment the Strategist uses when generating from scratch** (color §e, typography §g), applied to the material this project provides — the source document's content and subject, the company's own theme colors, and any brand signal. Pick the palette **and** the font pairing by what fits *this* deck's content; fonts are chosen by content fit, not just defaulted to a safe face. Reach **≥3 candidates total** (PPT-safe stacks; the same creative-choice rule used elsewhere) so a user who departs from the replica still lands on a considered, content-fitting direction — depart-by-choice.-- **`body_size` is the load-bearing field, and the replica follows the source's own size**: seed the replica candidate's `body_size` (px) from the source's actual body size, not a blind canvas default — take the dominant `observed.sizes_pt` value (the most frequent run-level size, the **body proxy**) and convert to px (`px = pt ÷ 0.75`, e.g. source 13.5pt → `18`). The "most frequent = body" read is a proxy, not a guarantee — `observed.sizes_pt` counts every explicit run size (titles, captions, footnotes, chart/label text included, no placeholder-type resolution), so a deck dense with small labels can let a caption size outrank true body; cross-check the proxy against the page's actual body blocks and the sanity range below before trusting it, and prefer the size the body paragraphs visibly render at over the raw mode when the two disagree. Fall back to `theme.sizes.body` (the declared placeholder size) when `observed.sizes_pt` is empty, and to a canvas-appropriate baseline (≈2.5–3.3% of canvas height) only when neither is present. Note `theme.sizes.body` is the master `bodyStyle` **level-1 declared default** — a coarse value that commonly **over-reads** the real body density (decks often render body at a deeper outline level or override it smaller), so when you land on this fallback treat it as an upper-ish guess and run it through the sanity check below, never as a precise body size. `theme.sizes.body_levels` and `layout_sizes_pt` are **reference context, not extra fallback tiers**: consult them to judge a saner body value when the deck is theme-driven (`observed` empty) — e.g. a deeper `body_levels` entry or a `layout_sizes_pt` hint may read truer than level-1 — but do not auto-seed from them; the seed chain stays `observed → theme.sizes.body → canvas baseline`, and a theme-driven deck whose body size genuinely can't be pinned cleanly is exactly the case the sanity check is for. The canvas hint stays a **sanity range**, not the seed: if the source's own size lands far outside it (a dense source doc reads tiny on a projection canvas), surface that to the user rather than silently snapping — the replica recommendation is the source's size, the user confirms or overrides. Non-replica alternatives may use the canvas baseline. This is what prevents the deck from exporting at an unintentionally small size while still honoring the source.+- **`body_size` is the load-bearing field, and the replica follows the source's own size**: seed the replica candidate's `body_size` (pt, because this is the confirmation layer for a PPT canvas) from the source's actual body size — take the dominant `observed.sizes_pt` value (the most frequent run-level size, the **body proxy**) without converting it. The confirm page writes normalized px to `result.json` (`body_size`) and keeps the original pt as `body_size_pt`; chat fallback must do the same normalization before `design_spec.md` / `spec_lock.md`. The "most frequent = body" read is a proxy, not a guarantee — `observed.sizes_pt` counts every explicit run size (titles, captions, footnotes, chart/label text included, no placeholder-type resolution), so a deck dense with small labels can let a caption size outrank true body; cross-check the proxy against the page's actual body blocks and the sanity range below before trusting it, and prefer the size the body paragraphs visibly render at over the raw mode when the two disagree. Fall back to `theme.sizes.body` (the declared placeholder size) when `observed.sizes_pt` is empty, and to a PPT delivery-purpose baseline (read-close 14–18pt / balanced 18–22pt / presentation 22–28pt) only when neither is present. Note `theme.sizes.body` is the master `bodyStyle` **level-1 declared default** — a coarse value that commonly **over-reads** the real body density (decks often render body at a deeper outline level or override it smaller), so when you land on this fallback treat it as an upper-ish guess and run it through the sanity check below, never as a precise body size. `theme.sizes.body_levels` and `layout_sizes_pt` are **reference context, not extra fallback tiers**: consult them to judge a saner body value when the deck is theme-driven (`observed` empty) — e.g. a deeper `body_levels` entry or a `layout_sizes_pt` hint may read truer than level-1 — but do not auto-seed from them; the seed chain stays `observed → theme.sizes.body → delivery-purpose baseline`, and a theme-driven deck whose body size genuinely can't be pinned cleanly is exactly the case the sanity check is for. The canvas hint stays a **sanity range**, not the seed: if the source's own size lands far outside it (a dense source doc reads tiny on a projection canvas), surface that to the user rather than silently snapping — the replica recommendation is the source's size, the user confirms or overrides. Non-replica alternatives may use the delivery-purpose baseline. This is what prevents the deck from exporting at an unintentionally small size while still honoring the source.```bashpython3 ${SKILL_DIR}/scripts/confirm_ui/server.py <project_path> --daemon --wait