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

fix(svg-to-pptx): align mask rejection and gradient contracts

hugohe3e35e27abb688
diff --git a/skills/ppt-master/references/animations.md b/skills/ppt-master/references/animations.md
index 6c1f6553..4b3acdb0 100644
--- a/skills/ppt-master/references/animations.md
+++ b/skills/ppt-master/references/animations.md
@@ -389,7 +389,7 @@ mechanisms already defined above — none needs a new capability.
**Carousel** (Morph, §2.1 and §3.1) — hold a fixed row of card frames and rotate the *content* through them: on each page every image advances one position, so the card at centre changes while the frames stay put. Explicitly pair each moving content unit across adjacent pages; the fixed frames stay static and need no pair. Scales to any number of images with one page each.
-**Odometer / counting numerals** (morph or motion path) — build a vertical strip of digits 0–9 and show one through a fixed window: a masked opening, or a background-filled rectangle above and below ([`image-layout-patterns.md`](./image-layout-patterns.md) `#95`). Shift the strip so the target digit lands in the window, then either morph between two pages or run a `path_up` motion on the strip. Give each digit column a 0.1 s stagger so they settle in sequence rather than in lockstep.
+**Odometer / counting numerals** (morph or motion path) — build a vertical strip of digits 0–9 and show one through a fixed window formed by background-filled rectangles above and below ([`image-layout-patterns.md`](./image-layout-patterns.md) `#95`). Shift the strip so the target digit lands in the window, then either morph between two pages or run a `path_up` motion on the strip. Give each digit column a 0.1 s stagger so they settle in sequence rather than in lockstep.
**Parallax depth** (morph) — move a background layer a *short* distance and a foreground layer a longer one between two pages. The differing travel is read as depth. Keep both layers' z-order identical on both pages; a layer that changes stacking between pages breaks the tween and the transition jumps.
diff --git a/skills/ppt-master/references/image-layout-patterns.md b/skills/ppt-master/references/image-layout-patterns.md
index 86f2cc92..98afeff3 100644
--- a/skills/ppt-master/references/image-layout-patterns.md
+++ b/skills/ppt-master/references/image-layout-patterns.md
@@ -230,17 +230,22 @@ Stack any of these freely on top of a Primary structure. Multiple Modifiers per
26. **Triptych baked into a single wide image** — one wide `<image width=1160 height=334>` whose internal composition already contains 2–3 scenes. Generate the triptych as one image (not three separate calls) when scene-to-scene consistency matters — the model preserves character identity, lighting continuity, and color grading far more reliably when panels are produced together.
-## Overlay & Masking Treatments
+## Overlay, Scrim & Vignette Treatments
+
+**Hard rule — visual masking is not SVG `<mask>`**: Masking in a design brief
+names the intended appearance only. Realize it with crop/clip geometry,
+scrim/overlay shapes, a real cutout path, or a baked-alpha asset; never emit
+`<mask>` or `mask="url(...)"`.
> **Crop displacement (HARD rule for text over images).** `preserveAspectRatio="xMidYMid slice"` center-crops whatever the source aspect ratio does not cover — when source and display aspects differ, the subject can land under the text column even if the prompt asked for it on the "focal side". Before layering text on a slice-cropped image: estimate the crop from the aspect-ratio difference, and keep the **entire text column on the scrim's opaque plateau** — text must never start inside a gradient's transition zone. When the subject position is unverified, fall back to an opaque treatment (`#30` at high opacity, or a solid panel) instead of a two-stop scrim (`#29`).
-27. **Linear gradient mask for text legibility** — `<linearGradient>` in `<defs>` (set `x1/y1/x2/y2` for direction) + overlay `<rect fill="url(#grad)">`. Most common is top-to-bottom darkening on full-bleed cover images.
+27. **Linear gradient scrim for text legibility** — `<linearGradient>` in `<defs>` (set `x1/y1/x2/y2` for direction) + overlay `<rect fill="url(#grad)">`. Most common is top-to-bottom darkening on full-bleed cover images.
28. **Radial gradient vignette** — `<radialGradient cx cy r>` with dark outer stops; overlay `<rect>`. Focuses attention by darkening the periphery.
29. **Two-stop scrim — opaque on text side, transparent on focal side** — `<linearGradient>` with one stop at `stop-opacity="0.9"` and another at `stop-opacity="0"`. Use when text sits on one side and the image's subject on the other.
-30–31. **Flat overlay wash** — one `<rect fill-opacity>` over the image: neutral `#000` / `#fff` around 0.4 for uniform darkening or lightening, the simplest scrim there is (**#30**), or a deck color at 0.15–0.25 to pull a foreign-looking photo toward the palette without regenerating it (**#31**).
+30–31. **Flat overlay wash** — one `<rect fill-opacity>` over the image: neutral `#000000` / `#FFFFFF` around 0.4 for uniform darkening or lightening, the simplest scrim there is (**#30**), or a deck color at 0.15–0.25 to pull a foreign-looking photo toward the palette without regenerating it (**#31**).
> **Sample the scrim color from the photo itself.** For any gradient scrim over an image (#27, #29, #31, #32, #90), take the solid end's hex from a dominant color *in that image* rather than defaulting to black or a deck color, and slide the gradient stop until the seam between scrim and photo disappears. A black scrim over a warm photo announces itself as a rectangle; a scrim in the photo's own shadow tone reads as part of the picture. This one substitution is the difference between a page that looks masked and one that looks composed.
@@ -281,7 +286,7 @@ Stack any of these freely on top of a Primary structure. Multiple Modifiers per
The panel must stay in register with the base photo; a frosted panel showing a *different* part of the scene is the classic tell. Pair with #95 when the panel should also carry a floating edge.
-33. **Spotlight mask — clear region surrounded by darkness** — cover the canvas with `<rect>` filled by a `<radialGradient>` whose inner stop is fully transparent and outer stop is opaque dark. Reads as a flashlight beam on the focal area. Use sparingly — it kills everything outside the spotlight.
+33. **Radial spotlight overlay — clear region surrounded by darkness** — cover the canvas with `<rect>` filled by a `<radialGradient>` whose inner stop is fully transparent and outer stop is opaque dark. Reads as a flashlight beam on the focal area. Use sparingly — it kills everything outside the spotlight.
34. **Gaussian-blur backdrop** — blur the background in the source image, then layer sharp SVG content above it. Native filter export maps the supported blur graph to a glow/shadow effect; it does not preserve a blurred-image backdrop.
@@ -321,15 +326,17 @@ Stack any of these freely on top of a Primary structure. Multiple Modifiers per
70–71. **Frames** — a single `<rect fill="none" stroke="#color" stroke-width="2–6"/>` at the image edge (**#70**), or several nested outlines at slightly different sizes for a photo-print look (**#71**). When the image was cut to a non-rectangular contour, use #86 instead so the frame follows the cut.
-72. **Image-to-image transition / merge** — two `<image>` elements with overlapping regions, one or both with gradient masks (from group C) creating a soft blend between them.
+72. **Baked-alpha image-to-image blend** — a genuinely soft blend between two images requires a precomposited bitmap or source images with baked alpha. An ordinary gradient overlay can conceal the join only when both images fade through the same solid bridge color; it is not a per-pixel mask and cannot blend arbitrary imagery.
-95. **Shape filled with the page background itself** — the most-used trick in real decks and the one that has no obvious SVG name. A shape is painted not with a color but with *the page's own background, sampled at the shape's own position*, so it becomes invisible against the page while still being a real object that can be moved, animated, or given an edge.
+95. **Shape filled with the page background itself** — the most-used trick in real decks and the one that has no obvious SVG name. A shape is painted not with a color but with *the page's own background, sampled at the shape's own position*, so it becomes invisible against the page while still being a real object that can carry an edge treatment.
**SVG form**: give the shape the same `<image>` as the page background, positioned in root coordinates exactly as the background is, and clip it to the shape contour (§1.2). Because the fill stays registered to the page rather than to the shape, the object reads as a hole in whatever is above it.
+ **Registration boundary**: the sampled shape and page background must remain fixed in the same root coordinates. Moving, resizing, rotating, or morphing the sampled shape moves its pixels with it and exposes the seam; animate independent content above or below the stationary shape instead.
+
Three things it buys you, all of which otherwise require a second asset:
- **A cut that keeps the scene continuous** — the shape "removes" a foreground panel and shows the background through it, with no seam even over a photo or gradient.
- - **Invisible objects that still animate** — a background-filled bar can wipe, slide, or morph across the page to reveal or conceal content, while never being visible itself.
+ - **A stationary conceal/reveal patch** — it can cover one fixed region while independent content enters or leaves above or below it.
- **Edge-only forms** — the shape disappears but its stroke, glow, or shadow remains, giving a floating outline that appears cut into the page.
Distinct from #83 (a panel with a real hole) and #90 (a scrim with cuts): those remove paint, this one *impersonates* the background. Reach for it when the thing above must stay a solid object.
diff --git a/skills/ppt-master/references/strategist.md b/skills/ppt-master/references/strategist.md
index 05ced6a6..e7e59d35 100644
--- a/skills/ppt-master/references/strategist.md
+++ b/skills/ppt-master/references/strategist.md
@@ -272,18 +272,16 @@ The module owns formula policy, AI rendering alternatives, acquisition paths, re
### Presentation Capability & Visualization Recall (Non-blocking — Strategist recommends, no user confirmation needed)
-**Per-page capability recall**: Before finalizing §IX, consider the short menu
-below. Select only capabilities that strengthen the page's communication or
-visual expression; no page or deck owes a usage quota. Record semantic intent
-in existing Design Spec fields, never commands, coordinates, group ids, or
-effect parameters. Omit unused recommendation lines instead of writing `none`.
-Executor owns realization under the receiving capability contract and may adapt
-or decline the two non-literal §IX suggestion lines while preserving content
-and intent; explicit user/template requirements remain binding.
+**Per-page capability recall**: Before §IX, consider this menu without a usage
+quota. Use existing fields for semantic intent; omit unused lines and
+implementation parameters. Executor may adapt/decline the
+two non-literal suggestions while preserving content and intent; explicit
+user/template requirements bind.
| Capability | Opportunity signal | Design Spec handoff |
|---|---|---|
-| Image composition | Image-as-canvas plus native overlay, editorial crop, collage, cutout, or independently meaningful focus / comparison / evidence units carry the page better than an adjacent rectangle | Propose a permitted image source; when selected, load [`strategist-image.md`](./strategist-image.md), record each resource's exact catalog §VIII `Layout pattern`, and describe the page-level image/overlay relationship in §IX `Layout` / `Images` |
+| Image composition | Image-as-canvas, editorial crop, collage, cutout, or meaningful focus / comparison / evidence units carry the page better than an adjacent rectangle | Propose a permitted source; when selected, load [`strategist-image.md`](./strategist-image.md), record exact §VIII `Layout pattern`, and describe page-level image/overlay relationships in §IX `Layout` / `Images` |
+| Native paint / overlay | Gradient, translucency, scrim, vignette, or wash supports focus, hierarchy, depth, legibility, or image integration | Record purpose/layering in §IX `Layout`, plus `Images` when imagery participates; no new field or type/stops/opacity/coordinates—Executor chooses realization |
| Native shape / Merge Shapes | A literal Office symbol, a stock bent/curved relationship contour, or a compound silhouette, negative-space cutout, overlap-only region, or meaningful fragmentation strengthens the visual idea | Add an optional §IX `Native shape suggestion` with the semantic result plus a candidate preset/Connector family or Boolean operation/operands |
| Page transition | A section/state change, spatial continuity, recorded/self-running flow, or the same semantic object changing position, scale, crop, or state across adjacent pages benefits from motion | Add an optional §IX `Motion suggestion` describing the communication job and any continuing object's start/end semantic states; leave effect, ids, pairing names, and timing to Executor |
| Object animation | Progressive reveal clarifies sequence, causality, comparison, hierarchy, narration order, full-view → detail, atmosphere → evidence, or hotspot/annotation order | Add an optional §IX `Motion suggestion` describing semantic units/order and any visible image-state relationship; leave group ids, effect, and timing to Executor |
diff --git a/skills/ppt-master/references/svg-effects.md b/skills/ppt-master/references/svg-effects.md
index d70428b5..48baad9a 100644
--- a/skills/ppt-master/references/svg-effects.md
+++ b/skills/ppt-master/references/svg-effects.md
@@ -103,8 +103,8 @@ closed parser checks. See
|---|---|
| Definition | Direct `<linearGradient>` / `<radialGradient>` child of `<defs>` with unique `id` |
| Reference | Exact local `url(#id)` |
-| Stops | Direct `<stop>` children; explicit color; finite offset `0..1` or `0%..100%`; optional stop alpha |
-| Coordinates | Normalized values / percentages; do not depend on `gradientUnits` user-space geometry |
+| Stops | ≥2 direct `<stop>` children; explicit color; finite non-decreasing offset in `0..1` or `0%..100%` (ties form hard edges); optional alpha |
+| Coordinates | `objectBoundingBox` only. Generated values: `0..1`; omitted linear axis = `(0,0) → (1,0)`. Only import-normalized linear projections may reach `-0.105..1.105`; radial values stay in `0..1` |
| Forbidden | External/quoted refs, `href` inheritance, `gradientTransform`, `spreadMethod`, CSS gradients |
| Target | Contract and fidelity |
@@ -114,16 +114,14 @@ closed parser checks. See
| `<text>` / non-positional `<tspan>` | Gradient fill only; no gradient text outline |
| `<image>` | No gradient paint; use §6.5 overlays |
-Linear export preserves stops/alpha/direction but reduces coordinates to an
-angle. Radial export becomes a centered circular gradient and does not preserve
-`cx/cy/r/fx/fy`. Gradient strokes remain editable, but PPTX-to-SVG re-import may
-retain only the first stop. Stop alpha and element opacity multiply.
-PPTX import normalizes compatible gradients and records any property-level
-degradation without aborting the deck; `--strict` keeps the closed parser
-contract. See
+Linear export preserves stops/alpha and reduces direction to an angle;
+coincident endpoints are invalid. Radial export centers a circular
+approximation, dropping `cx/cy/r/fx/fy`. Gradient strokes stay editable;
+reverse import may keep the first stop only. Stop alpha multiplies element opacity.
+PPTX import normalizes gradients and reports degradation;
+`--strict` keeps the closed parser contract. See
[`conversion.md`](../scripts/docs/conversion.md#import-compatibility-and-recovery-boundary).
-The quality checker and exporter preflight both validate definition location,
-references, gradient structure, and paint context from the same closed contract.
+Checker/exporter preflight share this validation.
Gradient-stop colors are contextual paint values. Keep them coherent with the
deck anchors and page intent; they are not required to duplicate existing
`spec_lock.colors` literals.
diff --git a/skills/ppt-master/references/template-designer.md b/skills/ppt-master/references/template-designer.md
index d3c16571..f4b594c1 100644
--- a/skills/ppt-master/references/template-designer.md
+++ b/skills/ppt-master/references/template-designer.md
@@ -245,7 +245,7 @@ page_count: <N>
## IV. Signature Design Elements
- Decorative motifs that ARE this template — top bar, gradient underline, logo treatment, brand emblem placement
-- Source-derived layout grammar — grid / column rhythm, page chrome, image zones, mask / crop behavior, overlay treatment, and density rhythm that make the template recognizable
+- Source-derived layout grammar — grid / column rhythm, page chrome, image zones, crop/clip behavior, scrim/overlay or baked-alpha treatment, and density rhythm that make the template recognizable
- Optional XML snippet for any reusable component unique to this template
## V. Page Roster
@@ -337,7 +337,7 @@ Templates must strictly follow the finalized template brief and the generated `d
- **Color scheme**: Uses primary, secondary, and accent colors from the spec
- **Font plan**: Uses the per-role font families declared in the spec
- **Layout principles**: Margins and spacing conform to the spec
-- **Image system**: Image placement, crop / mask behavior, full-bleed zones, and overlay rules follow the source-derived norms in the spec
+- **Image system**: Image placement, crop/clip behavior, full-bleed zones, and scrim/overlay or baked-alpha treatment follow the source-derived norms in the spec
- **Deck application**: Template Overview describes the recurring situations, audiences/outcomes, and representative roles; Page Roster factually describes the actual prototypes and reusable slots without prescribing future use
If PPTX import output exists:
diff --git a/skills/ppt-master/scripts/docs/mask-gradient-smoke.md b/skills/ppt-master/scripts/docs/mask-gradient-smoke.md
new file mode 100644
index 00000000..4f125065
--- /dev/null
+++ b/skills/ppt-master/scripts/docs/mask-gradient-smoke.md
@@ -0,0 +1,210 @@
+# Mask and Gradient Maintenance Smoke
+
+Run this manual smoke from the repository root after changing gradient
+validation, gradient import/export, native background promotion, icon
+expansion, or mask rejection. It keeps XML in memory except for temporary SVG
+fixtures; do not turn it into a test framework or example deck.
+
+```bash
+python3 - <<'PY'
+import math
+import re
+import sys
+import tempfile
+from pathlib import Path
+from xml.etree import ElementTree as ET
+
+scripts = Path("skills/ppt-master/scripts").resolve()
+sys.path.insert(0, str(scripts))
+
+from pptx_to_svg.fill_to_svg import _angle_to_unit_endpoints
+from svg_quality_checker import SVGQualityChecker
+from svg_to_pptx.drawingml.converter import (
+ SvgNativeConversionError,
+ convert_svg_to_slide_shapes,
+)
+from svg_to_pptx.drawingml.styles import build_gradient_fill
+from svg_to_pptx.drawingml.utils import (
+ parse_project_linear_gradient_coordinate,
+ project_gradient_errors,
+ project_mask_errors,
+)
+
+SVG_NS = "http://www.w3.org/2000/svg"
+
+
+def svg(fragment):
+ return ET.fromstring(
+ f'<svg xmlns="{SVG_NS}" viewBox="0 0 1280 720" '
+ f'data-pptx-page-role="content">{fragment}</svg>'
+ )
+
+
+valid = svg(
+ """<defs>
+ <linearGradient id="linear">
+ <stop offset="0" stop-color="#2563EB"/>
+ <stop offset="100%" stop-color="#F97316" stop-opacity="0.4"/>
+ </linearGradient>
+ <radialGradient id="radial" cx="0.5" cy="0.5" r="0.5">
+ <stop offset="0" stop-color="#FFFFFF"/>
+ <stop offset="1" stop-color="#0F172A"/>
+ </radialGradient>
+</defs>
+<rect id="bg" x="0" y="0" width="1280" height="720"
+ fill="url(#linear)"/>"""
+)
+assert not project_gradient_errors(valid)
+linear, radial = list(valid.find(f"{{{SVG_NS}}}defs"))
+linear_xml = build_gradient_fill(linear)
+radial_xml = build_gradient_fill(radial)
+assert '<a:lin ang="0" scaled="1"/>' in linear_xml
+assert '<a:alpha val="40000"/>' in linear_xml
+assert '<a:path path="circle">' in radial_xml
+
+with tempfile.TemporaryDirectory(prefix="ppt-master-gradient-smoke-") as tmp:
+ source = Path(tmp) / "gradient.svg"
+ source.write_text(
+ ET.tostring(valid, encoding="unicode"),
+ encoding="utf-8",
+ )
+ trace = []
+ slide_xml, *_ = convert_svg_to_slide_shapes(source, trace_out=trace)
+assert slide_xml.count("<p:bg>") == 1
+assert "<a:gradFill>" in slide_xml
+assert trace[0]["summary"]["promoted_backgrounds"] == 1
+assert any(
+ event.get("decision") == "native-background"
+ for event in trace[0]["events"]
+)
+
+invalid_gradients = [
+ (
+ """<linearGradient id="single">
+ <stop offset="0" stop-color="#2563EB"/>
+</linearGradient>""",
+ "requires at least two direct <stop> children",
+ ),
+ (
+ """<linearGradient id="descending">
+ <stop offset="1" stop-color="#2563EB"/>
+ <stop offset="0" stop-color="#F97316"/>
+</linearGradient>""",
+ "offsets must be non-decreasing",
+ ),
+ (
+ """<linearGradient id="zero" x1="0.5" y1="0.5" x2="0.5" y2="0.5">
+ <stop offset="0" stop-color="#2563EB"/>
+ <stop offset="1" stop-color="#F97316"/>
+</linearGradient>""",
+ "linear gradient axis must not collapse to one point",
+ ),
+]
+for definition, expected in invalid_gradients:
+ errors = project_gradient_errors(svg(f"<defs>{definition}</defs>"))
+ assert any(expected in error for error in errors), errors
+
+mask_cases = [
+ """<defs><mask id="fade"><rect width="1" height="1"/></mask></defs>""",
+ """<rect width="100" height="100" mask="url(#fade)"/>""",
+ """<rect width="100" height="100" style="mask: url(#fade)"/>""",
+]
+for fragment in mask_cases:
+ errors = project_mask_errors(svg(fragment))
+ assert any("unsupported SVG mask" in error for error in errors), errors
+
+checker = SVGQualityChecker()
+with tempfile.TemporaryDirectory(prefix="ppt-master-mask-smoke-") as tmp:
+ for index, fragment in enumerate(mask_cases, start=1):
+ source = Path(tmp) / f"mask-{index}.svg"
+ source.write_text(
+ ET.tostring(svg(fragment), encoding="unicode"),
+ encoding="utf-8",
+ )
+ checked = checker.check_file(str(source))
+ assert any("mask" in error.lower() for error in checked["errors"])
+ try:
+ convert_svg_to_slide_shapes(source)
+ except SvgNativeConversionError as exc:
+ assert "invalid project mask" in str(exc)
+ else:
+ raise AssertionError(f"native export accepted {source.name}")
+
+with tempfile.TemporaryDirectory(prefix="ppt-master-icon-mask-smoke-") as tmp:
+ project = Path(tmp)
+ icon_dir = project / "icons" / "imported"
+ icon_dir.mkdir(parents=True)
+ (icon_dir / "masked.svg").write_text(
+ f"""<svg xmlns="{SVG_NS}" viewBox="0 0 24 24">
+ <defs>
+ <mask id="fade">
+ <rect x="0" y="0" width="24" height="24" fill="#FFFFFF"/>
+ </mask>
+ </defs>
+ <rect x="0" y="0" width="24" height="24"
+ fill="#000000" mask="url(#fade)"/>
+</svg>""",
+ encoding="utf-8",
+ )
+ source = project / "icon-mask.svg"
+ source.write_text(
+ ET.tostring(
+ svg(
+ """<use data-icon="imported/masked"
+ x="20" y="20" width="24" height="24"/>"""
+ ),
+ encoding="unicode",
+ ),
+ encoding="utf-8",
+ )
+ checked = checker.check_file(str(source))
+ assert any(
+ "Icon imported/masked" in error and "mask" in error.lower()
+ for error in checked["errors"]
+ )
+ try:
+ convert_svg_to_slide_shapes(source)
+ except SvgNativeConversionError as exc:
+ assert "invalid project mask" in str(exc)
+ else:
+ raise AssertionError("native export accepted a masked icon")
+
+x1, y1, x2, y2 = _angle_to_unit_endpoints(30)
+assert any(value < 0 or value > 1 for value in (x1, y1, x2, y2))
+for value in (x1, y1, x2, y2):
+ assert math.isclose(
+ parse_project_linear_gradient_coordinate(str(value)),
+ value,
+ abs_tol=1e-9,
+ )
+roundtrip = svg(
+ f"""<defs>
+ <linearGradient id="roundtrip"
+ x1="{x1:.9f}" y1="{y1:.9f}" x2="{x2:.9f}" y2="{y2:.9f}">
+ <stop offset="0" stop-color="#2563EB"/>
+ <stop offset="1" stop-color="#F97316"/>
+ </linearGradient>
+</defs>"""
+)
+assert not project_gradient_errors(roundtrip)
+roundtrip_gradient = roundtrip.find(
+ f"{{{SVG_NS}}}defs/{{{SVG_NS}}}linearGradient"
+)
+angle = int(
+ re.search(
+ r'<a:lin ang="(\d+)"',
+ build_gradient_fill(roundtrip_gradient),
+ ).group(1)
+) / 60000
+assert math.isclose(angle, 30, abs_tol=0.01), angle
+
+print("Mask and gradient smoke: passed")
+PY
+```
+
+The three invalid-gradient cases, all three direct mask forms, and a mask
+hidden inside a `data-icon` asset must produce the named shared-validator
+errors in both Checker and direct export. The legal cases must retain stop
+alpha, promote the full-canvas gradient to one native `p:bg`, default an
+unpositioned linear gradient to horizontal, and recover approximately 30
+degrees from the importer's out-of-unit-box endpoint form.
diff --git a/skills/ppt-master/scripts/prompt_audit_manifest.json b/skills/ppt-master/scripts/prompt_audit_manifest.json
index 45b9d868..62f4f4a1 100644
--- a/skills/ppt-master/scripts/prompt_audit_manifest.json
+++ b/skills/ppt-master/scripts/prompt_audit_manifest.json
@@ -12,24 +12,24 @@
"skills/ppt-master/templates/schemas/*.json"
],
"exclude": [],
- "max_tokens": 371100
+ "max_tokens": 386050
},
"file_budgets": {
- "AGENTS.md": 2350,
+ "AGENTS.md": 2400,
"skills/ppt-master/SKILL.md": 850,
- "skills/ppt-master/references/executor-base.md": 7925,
+ "skills/ppt-master/references/executor-base.md": 8125,
"skills/ppt-master/references/executor-structured.md": 5300,
"skills/ppt-master/references/executor-chart.md": 3100,
"skills/ppt-master/references/executor-image.md": 1200,
"skills/ppt-master/references/executor-web-image.md": 500,
"skills/ppt-master/references/executor-notes.md": 900,
"skills/ppt-master/references/shared-standards.md": 250,
- "skills/ppt-master/references/shared-standards-core.md": 10950,
+ "skills/ppt-master/references/shared-standards-core.md": 11100,
"skills/ppt-master/references/svg-effects.md": 11725,
"skills/ppt-master/references/native-data-interface.md": 6200,
"skills/ppt-master/references/pptx-structure-interface.md": 4300,
"skills/ppt-master/references/strategist.md": 14025,
- "skills/ppt-master/references/strategist-image.md": 2300,
+ "skills/ppt-master/references/strategist-image.md": 2400,
"skills/ppt-master/references/strategist-template.md": 2100,
"skills/ppt-master/templates/design_spec_reference.md": 3125,
"skills/ppt-master/templates/spec_lock_reference.md": 2350,
@@ -45,7 +45,7 @@
"skills/ppt-master/SKILL.md",
"skills/ppt-master/workflows/routing.md"
],
- "max_tokens": 5475
+ "max_tokens": 5700
},
"support.sponsor-recommendation.en": {
"description": "English sponsor context for explicit user requests for model, AI image model, API/provider, or hosted-service recommendations.",
@@ -93,7 +93,7 @@
"skills/ppt-master/templates/README.md",
"skills/ppt-master/templates/decks/README.md"
],
- "max_tokens": 57825
+ "max_tokens": 58225
},
"route.create-template.layout": {
"description": "Create Layout path through Template_Designer, SVG core, and the structured PPTX interface.",
@@ -111,7 +111,7 @@
"skills/ppt-master/templates/README.md",
"skills/ppt-master/templates/layouts/README.md"
],
- "max_tokens": 58000
+ "max_tokens": 58400
},
"route.enhance-native-pptx": {
"description": "Finished-PPTX native enhancement route.",
@@ -122,7 +122,7 @@
"files": [
"skills/ppt-master/workflows/native-enhance-pptx.md"
],
- "max_tokens": 8500
+ "max_tokens": 8725
},
"route.fill-native-pptx": {
"description": "Raw-PPTX native fill route.",
@@ -133,7 +133,7 @@
"files": [
"skills/ppt-master/workflows/template-fill-pptx.md"
],
- "max_tokens": 11150
+ "max_tokens": 11375
},
"route.generate.planning": {
"description": "Generate-PPTX planning through Strategist, including reference-first whole-document authoring and representative multi-source custom mode/style synthesis; schemas and optional scaffolds are tool-consumed.",
@@ -172,6 +172,19 @@
],
"max_tokens": 62000
},
+ "route.generate.quick-test": {
+ "description": "Explicit disposable Generate quick-test short circuit with the shared SVG authoring core.",
+ "scope": "cumulative",
+ "include": [
+ "bootstrap.routing"
+ ],
+ "files": [
+ "skills/ppt-master/workflows/generate-pptx.md",
+ "skills/ppt-master/workflows/profiles/quick-test.md",
+ "skills/ppt-master/references/shared-standards-core.md"
+ ],
+ "max_tokens": 30625
+ },
"route.generate.planning-image": {
"description": "Generate-PPTX planning context after a non-none image source is proposed or confirmed.",
"scope": "cumulative",
@@ -180,7 +193,7 @@
"stage.generate.strategist.image-layout"
],
"files": [],
- "max_tokens": 70000
+ "max_tokens": 74275
},
"route.generate.planning-formula": {
"description": "Formula-only planning context with no non-formula image resource or layout catalog.",
@@ -210,7 +223,7 @@
"registry": "image-renderings"
}
],
- "max_tokens": 76000
+ "max_tokens": 78525
},
"stage.generate.apply-template-workspace": {
"description": "Conditional Step 3 workspace validation, installation, and fusion framework.",
@@ -322,7 +335,7 @@
"stage.generate.executor.notes"
],
"files": [],
- "max_tokens": 84550
+ "max_tokens": 85375
},
"route.generate.flat-ai-two-types": {
"description": "Generate-PPTX context with AI images, representative multi-source custom rendering, and two local types.",
@@ -335,7 +348,7 @@
"stage.generate.image.ai-two-types"
],
"files": [],
- "max_tokens": 125650
+ "max_tokens": 132325
},
"route.generate.flat-in-hand-image": {
"description": "Generate-PPTX context with provided, placeholder, or formula images and no acquisition role.",
@@ -347,7 +360,7 @@
"stage.generate.executor.notes"
],
"files": [],
- "max_tokens": 98950
+ "max_tokens": 105650
},
"route.generate.flat-web-image": {
"description": "Generate-PPTX context with web image acquisition.",
@@ -360,7 +373,7 @@
"stage.generate.image.web"
],
"files": [],
- "max_tokens": 106200
+ "max_tokens": 112875
},
"route.enhance-native-pptx.audio": {
"description": "Enhance Native PPTX with the shared narration-audio stage.",
@@ -370,7 +383,7 @@
"stage.shared.generate-audio"
],
"files": [],
- "max_tokens": 13425
+ "max_tokens": 13650
},
"route.generate.beautify-flat-no-image": {
"description": "Generate-PPTX 1:1 beautify profile on the flat no-image path.",
@@ -380,7 +393,7 @@
"profile.generate.beautify-pptx"
],
"files": [],
- "max_tokens": 91450
+ "max_tokens": 92275
},
"route.generate.flat-no-image-chart": {
"description": "Default flat Generate-PPTX path with chart authoring, native-data replacement, and verification.",
@@ -393,7 +406,7 @@
"stage.generate.verify-charts"
],
"files": [],
- "max_tokens": 108900
+ "max_tokens": 109725
},
"route.generate.brand-flat-no-image": {
"description": "Brand-preset flat Generate-PPTX path without image acquisition.",
@@ -405,7 +418,7 @@
"stage.generate.template.brand"
],
"files": [],
- "max_tokens": 91550
+ "max_tokens": 92400
},
"route.generate.deck-structured-no-image": {
"description": "Deck-preset structured Generate-PPTX path without image acquisition.",
@@ -417,7 +430,7 @@
"stage.generate.template.deck"
],
"files": [],
- "max_tokens": 101500
+ "max_tokens": 102350
},
"route.generate.layout-structured-no-image": {
"description": "Layout-preset structured Generate-PPTX path without image acquisition.",
@@ -429,7 +442,7 @@
"stage.generate.template.layout"
],
"files": [],
- "max_tokens": 101950
+ "max_tokens": 102800
},
"route.generate.topic-only-flat-no-image": {
"description": "Topic research followed by the default flat no-image Generate-PPTX path.",
@@ -439,7 +452,7 @@
"route.generate.flat-no-image"
],
"files": [],
- "max_tokens": 85950
+ "max_tokens": 86775
},
"stage.generate.executor.flat": {
"description": "Incremental flat Executor core with representative multi-source custom mode/style execution.",
@@ -549,7 +562,7 @@
"stage.generate.executor.image"
],
"files": [],
- "max_tokens": 60550
+ "max_tokens": 67050
},
"stage.generate.topic-research": {
"description": "Gap-targeted factual intake stage.",
@@ -619,7 +632,7 @@
"skills/ppt-master/scripts/docs/pptx-transitions.md",
"skills/ppt-master/scripts/docs/svg-pipeline.md"
],
- "max_tokens": 24450
+ "max_tokens": 28700
},
"stage.generate.video-motion-plan": {
"description": "Conditional resolved animation-to-video handoff contract.",
@@ -635,7 +648,7 @@
"files": [
"skills/ppt-master/references/animations.md"
],
- "max_tokens": 5050
+ "max_tokens": 6950
},
"stage.shared.generate-audio": {
"description": "Shared narration-audio stage.",
@@ -685,7 +698,7 @@
"stage.generate.strategist.template"
],
"files": [],
- "max_tokens": 61550
+ "max_tokens": 62025
},
"route.generate.planning-template-ai": {
"description": "Explicit template workspace plus confirmed AI-image planning.",
@@ -695,7 +708,7 @@
"route.generate.planning-ai"
],
"files": [],
- "max_tokens": 74250
+ "max_tokens": 80600
},
"stage.generate.executor.chart": {
"description": "Conditional chart/table page execution rules.",
@@ -711,7 +724,7 @@
"files": [
"skills/ppt-master/references/strategist-image.md"
],
- "max_tokens": 2300
+ "max_tokens": 2400
},
"stage.generate.strategist.image-layout": {
"description": "Non-formula image planning plus the image-layout pattern catalog required for Section VIII rows.",
@@ -722,7 +735,7 @@
"files": [
"skills/ppt-master/references/image-layout-patterns.md"
],
- "max_tokens": 8500
+ "max_tokens": 14350
},
"stage.generate.strategist.template": {
"description": "Conditional Strategist module for an explicitly installed template workspace.",
@@ -749,7 +762,7 @@
"skills/ppt-master/references/image-layout-spec.md",
"skills/ppt-master/references/svg-image-embedding.md"
],
- "max_tokens": 12150
+ "max_tokens": 17900
},
"stage.generate.executor.web-image": {
"description": "Conditional sourced-image attribution layered on image execution.",
@@ -760,7 +773,7 @@
"files": [
"skills/ppt-master/references/executor-web-image.md"
],
- "max_tokens": 12575
+ "max_tokens": 18325
},
"stage.generate.executor.notes": {
"description": "Post-SVG speaker-notes generation rules.",
@@ -1120,6 +1133,10 @@
"glob": "skills/ppt-master/scripts/docs/prompt_audit.md",
"reason": "Maintainer-only documentation for this audit tool."
},
+ {
+ "glob": "skills/ppt-master/scripts/docs/mask-gradient-smoke.md",
+ "reason": "Maintainer-only executable smoke; never loaded by generation roles."
+ },
{
"glob": "skills/ppt-master/scripts/docs/update_spec.md",
"reason": "Maintainer command reference for an optional helper script."
diff --git a/skills/ppt-master/scripts/svg_quality_checker.py b/skills/ppt-master/scripts/svg_quality_checker.py
index ea69708a..4519078a 100644
--- a/skills/ppt-master/scripts/svg_quality_checker.py
+++ b/skills/ppt-master/scripts/svg_quality_checker.py
@@ -115,6 +115,7 @@ try:
project_filter_errors as _project_filter_errors,
project_gradient_errors as _project_gradient_errors,
project_image_aspect_ratio_errors as _project_image_aspect_ratio_errors,
+ project_mask_errors as _project_mask_errors,
project_marker_errors as _project_marker_errors,
project_opacity_errors as _project_opacity_errors,
project_paint_errors as _project_paint_errors,
@@ -164,6 +165,7 @@ except ImportError:
_project_filter_errors = None
_project_gradient_errors = None
_project_image_aspect_ratio_errors = None
+ _project_mask_errors = None
_project_marker_errors = None
_project_opacity_errors = None
_project_paint_errors = None
@@ -502,6 +504,9 @@ _BAKE_REQUIRED_VISUAL_PROPERTIES = frozenset({
'isolation',
'mix-blend-mode',
})
+_SHARED_FAIL_CLOSED_STYLE_PROPERTIES = frozenset({'mask'})
+
+
def _compact_preset_ancestor_paint(
root: ET.Element,
) -> list[tuple[str, tuple[str, ...]]]:
@@ -1276,6 +1281,7 @@ class SVGQualityChecker:
# 2. Check forbidden elements
self._check_forbidden_elements(content, root, result)
+ self._check_mask_contract(root, result)
# 2a. Validate direct geometry lengths and stroke widths.
self._check_geometry_length_values(root, result)
@@ -1509,11 +1515,6 @@ class SVGQualityChecker:
# Forbidden elements blocklist - PPT incompatible
# ============================================================
- # Clipping / masking. The closed image clip-path contract is validated
- # separately by _check_clip_path_contract.
- if 'mask' in local_names:
- result['errors'].append("Detected forbidden <mask> element (PPT does not support SVG masks)")
-
# Style system
if 'style' in local_names:
result['errors'].append("Detected forbidden <style> element (use inline attributes instead)")
@@ -1824,7 +1825,10 @@ class SVGQualityChecker:
f"{label} uses Bake-required visual property {name!r}; "
"bake the effect or rebuild it with supported geometry"
)
- elif name not in _SUPPORTED_INLINE_STYLE_PROPERTIES:
+ elif (
+ name not in _SUPPORTED_INLINE_STYLE_PROPERTIES
+ and name not in _SHARED_FAIL_CLOSED_STYLE_PROPERTIES
+ ):
errors.add(
f"{label} uses unsupported inline style property {name!r}; "
"native PPTX export would ignore it"
@@ -1944,6 +1948,16 @@ class SVGQualityChecker:
return
result['errors'].extend(_project_clip_path_errors(root))
+ def _check_mask_contract(self, root: ET.Element, result: Dict) -> None:
+ """Reject SVG masks through the native exporter's shared validator."""
+ if _project_mask_errors is None:
+ result['errors'].append(
+ 'Unable to import the shared mask validator; cannot verify '
+ 'that native PPTX export will preserve all visible effects'
+ )
+ return
+ result['errors'].extend(_project_mask_errors(root))
+
def _check_filter_effects(self, root: ET.Element, result: Dict) -> None:
"""Validate filters against the native shadow/glow approximation."""
if _project_filter_errors is None:
@@ -3744,6 +3758,11 @@ class SVGQualityChecker:
f"Icon {icon_name} has invalid native payload metadata: {exc}"
)
continue
+ if _project_mask_errors is not None:
+ result['errors'].extend(
+ f'Icon {icon_name}: {error}'
+ for error in _project_mask_errors(icon_root)
+ )
if hydrated:
result['info']['native_icon_payload_refs'] = (
result['info'].get('native_icon_payload_refs', 0) + hydrated
diff --git a/skills/ppt-master/scripts/svg_to_pptx/drawingml/converter.py b/skills/ppt-master/scripts/svg_to_pptx/drawingml/converter.py
index 90aea074..fa25d301 100644
--- a/skills/ppt-master/scripts/svg_to_pptx/drawingml/converter.py
+++ b/skills/ppt-master/scripts/svg_to_pptx/drawingml/converter.py
@@ -54,6 +54,7 @@ from .utils import (
project_geometry_length_errors,
project_gradient_errors,
project_image_aspect_ratio_errors,
+ project_mask_errors,
project_marker_errors,
project_opacity_errors,
project_paint_errors,
@@ -288,6 +289,22 @@ def _require_project_paints(
)
+def _require_project_masks(
+ root: ET.Element,
+ svg_path: Path | str,
+) -> None:
+ """Reject SVG masks before native conversion can silently drop them."""
+ errors = project_mask_errors(root)
+ if not errors:
+ return
+ preview = '; '.join(errors[:8])
+ suffix = '' if len(errors) <= 8 else f'; +{len(errors) - 8} more'
+ raise SvgNativeConversionError(
+ f'{Path(svg_path).name}: invalid project mask(s): '
+ f'{preview}{suffix}'
+ )
+
+
def _require_project_definitions(
root: ET.Element,
svg_path: Path | str,
@@ -1483,6 +1500,7 @@ def convert_svg_to_slide_shapes(
_require_project_stroke_styles(root, svg_path)
_require_project_opacities(root, svg_path)
_require_project_paints(root, svg_path)
+ _require_project_masks(root, svg_path)
_require_project_definitions(root, svg_path)
_require_project_paint_references(root, svg_path)
_require_project_line_end_markers(root, svg_path)
@@ -1564,6 +1582,7 @@ def convert_svg_to_slide_shapes(
_require_project_stroke_styles(root, svg_path)
_require_project_opacities(root, svg_path)
_require_project_paints(root, svg_path)
+ _require_project_masks(root, svg_path)
_require_project_definitions(root, svg_path)
_require_project_paint_references(root, svg_path)
_require_project_gradients(root, svg_path)
diff --git a/skills/ppt-master/scripts/svg_to_pptx/drawingml/styles.py b/skills/ppt-master/scripts/svg_to_pptx/drawingml/styles.py
index 426d0860..7a44fba1 100644
--- a/skills/ppt-master/scripts/svg_to_pptx/drawingml/styles.py
+++ b/skills/ppt-master/scripts/svg_to_pptx/drawingml/styles.py
@@ -16,7 +16,7 @@ from .utils import (
classify_project_marker_shape,
matrix_multiply, parse_svg_color, parse_transform_matrix, resolve_url_id,
parse_project_filter_params, project_filter_drawingml_coordinates,
- parse_project_gradient_ratio,
+ parse_project_gradient_ratio, parse_project_linear_gradient_coordinate,
parse_project_stroke_dasharray, parse_project_stroke_enum,
quantize_ooxml_alpha, quantize_ooxml_unit_ratio,
)
@@ -96,17 +96,18 @@ def build_gradient_fill(
gs_list = '\n'.join(stops_xml)
if tag == 'linearGradient':
- def parse_grad_coord(val_str: str, default: float = 0.0) -> float:
- val_str = val_str.strip()
- if val_str.endswith('%'):
- return float(val_str.rstrip('%')) / 100.0
- v = float(val_str)
- return v / 100.0 if v > 1.0 else v
-
- x1 = parse_grad_coord(grad_elem.get('x1', '0'))
- y1 = parse_grad_coord(grad_elem.get('y1', '0'))
- x2 = parse_grad_coord(grad_elem.get('x2', '1'))
- y2 = parse_grad_coord(grad_elem.get('y2', '1'))
+ x1 = parse_project_linear_gradient_coordinate(
+ grad_elem.get('x1', '0')
+ )
+ y1 = parse_project_linear_gradient_coordinate(
+ grad_elem.get('y1', '0')
+ )
+ x2 = parse_project_linear_gradient_coordinate(
+ grad_elem.get('x2', '1')
+ )
+ y2 = parse_project_linear_gradient_coordinate(
+ grad_elem.get('y2', '0')
+ )
angle_rad = math.atan2(y2 - y1, x2 - x1)
angle_deg = math.degrees(angle_rad)
diff --git a/skills/ppt-master/scripts/svg_to_pptx/drawingml/utils.py b/skills/ppt-master/scripts/svg_to_pptx/drawingml/utils.py
index c0eb7382..fd353649 100644
--- a/skills/ppt-master/scripts/svg_to_pptx/drawingml/utils.py
+++ b/skills/ppt-master/scripts/svg_to_pptx/drawingml/utils.py
@@ -216,6 +216,9 @@ PROJECT_DEFINITION_TAGS = frozenset({
'radialGradient',
})
PROJECT_GRADIENT_TAGS = frozenset({'linearGradient', 'radialGradient'})
+# PPTX angle projection can overshoot a unit box by at most ~0.1036.
+PROJECT_LINEAR_GRADIENT_COORDINATE_MIN = -0.105
+PROJECT_LINEAR_GRADIENT_COORDINATE_MAX = 1.105
PROJECT_FILTER_PRIMITIVES = frozenset({
'feDropShadow',
'feGaussianBlur',
@@ -2217,6 +2220,36 @@ def project_paint_reference_errors(root: ET.Element) -> list[str]:
return sorted(errors)
+def project_mask_errors(root: ET.Element) -> list[str]:
+ """Reject SVG masks that native PPTX conversion cannot preserve."""
+ errors: set[str] = set()
+ for elem in root.iter():
+ label = _transform_element_label(elem)
+ if _svg_element_tag(elem) == 'mask':
+ errors.add(
+ f'{label} is an unsupported SVG mask definition; replace it '
+ 'with editable overlay or Boolean/cutout shapes, an image '
+ 'clip-path, or pre-rendered alpha imagery'
+ )
+
+ sources: list[str] = []
+ if any(
+ name.rsplit('}', 1)[-1].lower() == 'mask'
+ for name in elem.attrib
+ ):
+ sources.append('mask attribute')
+ if 'mask' in parse_inline_style(elem.get('style')):
+ sources.append('inline style mask property')
+ if sources:
+ errors.add(
+ f'{label} uses unsupported SVG mask presentation via '
+ f'{", ".join(sources)}; native PPTX export would drop the '
+ 'effect. Use editable overlay or Boolean/cutout shapes, an '
+ 'image clip-path, or pre-rendered alpha imagery'
+ )
+ return sorted(errors)
+
+
def parse_project_gradient_ratio(raw: str) -> float:
"""Parse one normalized gradient coordinate or stop offset."""
number, unit = _parse_svg_length_parts(raw)
@@ -2229,6 +2262,24 @@ def parse_project_gradient_ratio(raw: str) -> float:
return number
+def parse_project_linear_gradient_coordinate(raw: str) -> float:
+ """Parse one objectBoundingBox linear-gradient projection coordinate."""
+ number, unit = _parse_svg_length_parts(raw)
+ if unit == '%':
+ number /= 100.0
+ elif unit:
+ raise ValueError('must be unitless or a percentage')
+ if not (
+ PROJECT_LINEAR_GRADIENT_COORDINATE_MIN
+ <= number
+ <= PROJECT_LINEAR_GRADIENT_COORDINATE_MAX
+ ):
+ raise ValueError(
+ 'must be within -0.105..1.105 or -10.5%..110.5%'
+ )
+ return number
+
+
def project_gradient_errors(root: ET.Element) -> list[str]:
"""Validate the normalized native gradient authoring interface."""
errors: set[str] = set()
@@ -2258,25 +2309,61 @@ def project_gradient_errors(root: ET.Element) -> list[str]:
'use normalized objectBoundingBox coordinates'
)
- coordinate_names = (
- ('x1', 'y1', 'x2', 'y2')
- if tag == 'linearGradient'
- else ('cx', 'cy', 'r', 'fx', 'fy')
- )
- for coordinate_name in coordinate_names:
- raw_coordinate = gradient.get(coordinate_name)
- if raw_coordinate is None:
- continue
- try:
- coordinate = parse_project_gradient_ratio(raw_coordinate)
- except ValueError:
+ if tag == 'linearGradient':
+ coordinate_defaults = {
+ 'x1': '0',
+ 'y1': '0',
+ 'x2': '1',
+ 'y2': '0',
+ }
+ coordinates: dict[str, float] = {}
+ for coordinate_name, default in coordinate_defaults.items():
+ raw_coordinate = gradient.get(coordinate_name, default)
+ try:
+ coordinates[coordinate_name] = (
+ parse_project_linear_gradient_coordinate(raw_coordinate)
+ )
+ except ValueError:
+ errors.add(
+ f'{label} {coordinate_name} must be a finite '
+ 'objectBoundingBox projection coordinate within '
+ '-0.105..1.105 or -10.5%..110.5%; '
+ f'got {raw_coordinate!r}'
+ )
+ if len(coordinates) == 4 and (
+ math.isclose(
+ coordinates['x1'],
+ coordinates['x2'],
+ rel_tol=0.0,
+ abs_tol=1e-12,
+ )
+ and math.isclose(
+ coordinates['y1'],
+ coordinates['y2'],
+ rel_tol=0.0,
+ abs_tol=1e-12,
+ )
+ ):
errors.add(
- f'{label} {coordinate_name} must be a normalized finite '
- f'value from 0 to 1 or 0% to 100%; got {raw_coordinate!r}'
+ f'{label} linear gradient axis must not collapse to one '
+ 'point; use different x1/y1 and x2/y2 coordinates'
)
- continue
- if coordinate_name == 'r' and coordinate <= 0:
- errors.add(f'{label} r must be greater than 0')
+ else:
+ for coordinate_name in ('cx', 'cy', 'r', 'fx', 'fy'):
+ raw_coordinate = gradient.get(coordinate_name)
+ if raw_coordinate is None:
+ continue
+ try:
+ coordinate = parse_project_gradient_ratio(raw_coordinate)
+ except ValueError:
+ errors.add(
+ f'{label} {coordinate_name} must be a normalized finite '
+ 'value from 0 to 1 or 0% to 100%; '
+ f'got {raw_coordinate!r}'
+ )
+ continue
+ if coordinate_name == 'r' and coordinate <= 0:
+ errors.add(f'{label} r must be greater than 0')
stops: list[ET.Element] = []
for child in list(gradient):
@@ -2290,20 +2377,35 @@ def project_gradient_errors(root: ET.Element) -> list[str]:
)
continue
stops.append(child)
- if not stops:
- errors.add(f'{label} requires at least one direct <stop> child')
+ if len(stops) < 2:
+ errors.add(
+ f'{label} requires at least two direct <stop> children for '
+ 'native PPTX gradient interpolation'
+ )
+ previous_offset: float | None = None
for index, stop in enumerate(stops, start=1):
stop_label = f'{label} stop #{index}'
raw_offset = stop.get('offset')
try:
if raw_offset is None:
raise ValueError
- parse_project_gradient_ratio(raw_offset)
+ offset = parse_project_gradient_ratio(raw_offset)
except ValueError:
errors.add(
f'{stop_label} offset must be explicit and within 0..1 '
f'or 0%..100%; got {raw_offset!r}'
)
+ else:
+ if (
+ previous_offset is not None
+ and offset < previous_offset
+ ):
+ errors.add(
+ f'{label} stop offsets must be non-decreasing; '
+ f'stop #{index} offset {raw_offset!r} precedes a '
+ f'larger offset at stop #{index - 1}'
+ )
+ previous_offset = offset
style_values = parse_inline_style(stop.get('style'))
if not (style_values.get('stop-color') or stop.get('stop-color')):
errors.add(f'{stop_label} requires an explicit stop-color')
diff --git a/skills/ppt-master/templates/design_spec_reference.md b/skills/ppt-master/templates/design_spec_reference.md
index 5876f7a8..c762e89b 100644
--- a/skills/ppt-master/templates/design_spec_reference.md
+++ b/skills/ppt-master/templates/design_spec_reference.md
@@ -170,6 +170,8 @@ In §VIII, author every planned or explicitly required resource from the confirm
§VIII `Layout pattern` is a per-resource preference. When a page uses several images, repeats one image in multiple views, or combines an image with native overlays, describe the page-level relationship and participating resources in §IX `Layout` / `Images`; do not duplicate an unchanged resource row merely to encode animation sequencing.
+Put native paint/overlay intent in §IX `Layout` plus `Images` for imagery—not a new field; state semantic job/layering, while Executor chooses type, stops, opacity, and geometry.
+
### 2.4 Complete page roster and notes
Write one ordered Slide block per page. Slide count and order must equal §I `Page Count`; `Content` is a complete page brief, not a skeleton.
diff --git a/skills/ppt-master/workflows/create-template.md b/skills/ppt-master/workflows/create-template.md
index 8d96866b..3cdc1f7c 100644
--- a/skills/ppt-master/workflows/create-template.md
+++ b/skills/ppt-master/workflows/create-template.md
@@ -274,7 +274,7 @@ Before composing Step 2, extract the template's reusable norms from the previous
| Canvas / page geometry | `manifest.json` slide size, SVG `width` / `height` / `viewBox` | `[fact]` canvas format, pixel dimensions, source `viewBox`, and aspect ratio |
| Identity system | theme colors, font usage, logo / emblem assets, recurring backgrounds | `[fact]` when imported; `[suggested]` only for visual estimates |
| Layout grammar | masters / layouts, repeated chrome, margins, columns, card grids, section dividers | Template-specific rules, not generic spacing boilerplate |
-| Image system | image crops, masks, full-bleed zones, hero-image placement, mosaic rules, caption / overlay treatment | Template-specific image-placement rules with source examples |
+| Image system | image crops/clips, scrim/overlay treatments, baked-alpha treatments, full-bleed zones, hero-image placement, mosaic rules, captions | Template-specific image-placement rules with source examples |
| Density rhythm | title scale, content block count, whitespace balance, dense vs. breathing pages | Page-type guidance for Strategist / Executor |
| Page roster semantics | cover / TOC / chapter / content / ending variants and their intended content slots | `design_spec.md §V Page Roster` rows |
| Asset policy | source images / icons / textures that are part of the template vs. sample-only content | `design_spec.md §VI Assets` or omit sample-only assets |