AI turns documents or topics into real, native PowerPoint decks—with native shapes, transitions and animations, data-backed charts and tables on demand, audio narration from speaker notes, and support for your own .pptx templates. · by Hugo He
docs(svg-authoring): allow approximate group opacity
hugohe3813505aae304
diff --git a/skills/ppt-master/references/shared-standards.md b/skills/ppt-master/references/shared-standards.mdindex 07e437d5..ace24290 100644--- a/skills/ppt-master/references/shared-standards.md+++ b/skills/ppt-master/references/shared-standards.md@@ -152,14 +152,20 @@ One offending character invalidates the file and aborts export. Numeric refs (`&| Banned Syntax | Correct Alternative ||---------------|---------------------|| `fill="rgba(255,255,255,0.1)"` | `fill="#FFFFFF" fill-opacity="0.1"` |-| `<g opacity="0.2">...</g>` | Set `fill-opacity` / `stroke-opacity` on each child element individually |++**Allowed — group opacity (approximate)**: `<g opacity="0.3">...</g>` maps the+group alpha onto each descendant shape, text run, picture, and supported+shadow/glow effect. Nested group and child opacity values multiply. Overlapping+children may differ from SVG isolated-group compositing because DrawingML has no+equivalent group-alpha model. With `--native-objects`, transparent native+table/chart markers are rejected; omit that flag to export their SVG fallback.**Allowed — picture opacity**: `<image opacity="0.3"/>` maps to native DrawingML`a:alphaModFix` and round-trips back to SVG. Use a numeric value from `0` to`1`; use an overlay only when the design needs a color wash rather than simpletransparency.-**Mnemonic**: use explicit paint alpha for shapes; image opacity is native.+**Mnemonic**: image opacity is native; group opacity is a per-object approximation.> Arrows: prefer `marker-end` for connector lines (§1.1) — converter produces native auto-rotating arrow heads. For block/chunky arrows, use standalone closed shapes; see `templates/charts/chevron_process.svg` and `templates/charts/process_flow.svg`.@@ -276,7 +282,8 @@ Color: use the deck's primary brand color for emphasis. Reserve green/red for acWrap logically related elements in top-level `<g id="...">` groups. Produces PowerPoint groups in PPTX, making slides easier to select/move/edit and providing stable anchors for optional per-element entrance animation.-> ⚠️ Only `<g opacity="...">` is banned (§2). Plain `<g>` for grouping is required.+> `<g opacity="0..1">` is supported through the per-descendant alpha+> approximation in §2. Plain `<g>` remains the normal grouping primitive.**Animation-ready rule**: direct children of `<svg>` should be semantic groups, not raw drawing atoms. Aim for **3–8 top-level content `<g id>` groups per slide** (the 3–8 budget excludes page chrome — see below); each content group becomes one entrance step under the chosen `--animation-trigger` mode (one click in `on-click`, one cascade slot in `after-previous`, parallel in `with-previous`).diff --git a/skills/ppt-master/references/template-designer.md b/skills/ppt-master/references/template-designer.mdindex 8a537575..5ee419ef 100644--- a/skills/ppt-master/references/template-designer.md+++ b/skills/ppt-master/references/template-designer.md@@ -190,7 +190,7 @@ Sections to **omit** from template `design_spec.md` (sourced elsewhere — listi| Don't write | Source ||---|---|| SVG technical constraints / Mandatory rules / Prohibited elements | `shared-standards.md` §1 |-| PPT compatibility rules (`<g opacity>`, inline-styles-only, etc.) | `shared-standards.md` |+| PPT compatibility rules (opacity mapping, inline-styles-only, etc.) | `shared-standards.md` || Generic layout pattern library (centered card / 三栏 / timeline / …) | `design_spec_reference.md` §V || Generic spacing bands (margin 40-60px, card gap 20-32px, etc.) | `design_spec_reference.md` §V || Generic font-size hierarchy (cover 2.5-5x body, page title 1.5-2x, …) | `design_spec_reference.md` §IV |diff --git a/skills/ppt-master/scripts/config.py b/skills/ppt-master/scripts/config.pyindex fd5dd6ae..9f8ecc1d 100644--- a/skills/ppt-master/scripts/config.py+++ b/skills/ppt-master/scripts/config.py@@ -533,7 +533,6 @@ SVG_CONSTRAINTS = {r'<\?xml-stylesheet\b', # External CSSr'<link[^>]*rel\s*=\s*["\']stylesheet["\']',r'@import\s+', # External CSS- r'<g[^>]*\sopacity\s*=', # Group opacityr'\bon\w+\s*=', # Event attributesr'(?s)(?=.*<symbol)(?=.*<use\b)', # <symbol> + <use> complex usage (order-independent)],diff --git a/skills/ppt-master/scripts/docs/svg-pipeline.md b/skills/ppt-master/scripts/docs/svg-pipeline.mdindex 52a8a6d2..655a3cc9 100644--- a/skills/ppt-master/scripts/docs/svg-pipeline.md+++ b/skills/ppt-master/scripts/docs/svg-pipeline.md@@ -227,7 +227,11 @@ Use PowerPoint-safe transparency syntax:| Avoid | Use instead ||------|-------------|| `fill=\"rgba(...)\"` | `fill=\"#hex\"` + `fill-opacity` |-| `<g opacity=\"...\">` | Set opacity on each child |++`<g opacity="0..1">` is supported as a per-descendant alpha approximation.+Nested values multiply; overlapping children may differ from isolated SVG+group compositing. Transparent native table/chart markers require the default+SVG fallback rather than `--native-objects`.`<image opacity="0..1">` is supported directly. Native export writesDrawingML `a:alphaModFix`, and PPTX import restores the SVG opacity value.diff --git a/skills/ppt-master/scripts/error_helper.py b/skills/ppt-master/scripts/error_helper.pyindex 968c073a..744478f0 100644--- a/skills/ppt-master/scripts/error_helper.py+++ b/skills/ppt-master/scripts/error_helper.py@@ -210,15 +210,6 @@ class ErrorHelper:],'severity': 'error'},- 'group_opacity_detected': {- 'message': 'Forbidden <g opacity> detected',- 'solutions': [- 'Remove group-level opacity',- 'Set opacity individually on each child element',- 'Use fill-opacity / stroke-opacity for control'- ],- 'severity': 'error'- },'event_attribute_detected': {'message': 'Forbidden event attribute detected','solutions': [diff --git a/skills/ppt-master/scripts/svg_quality_checker.py b/skills/ppt-master/scripts/svg_quality_checker.pyindex 140850d2..cc58b799 100644--- a/skills/ppt-master/scripts/svg_quality_checker.py+++ b/skills/ppt-master/scripts/svg_quality_checker.py@@ -637,10 +637,9 @@ class SVGQualityChecker:"Detected alpha-channel HEX color (#RGBA/#RRGGBBAA is not exported ""to PPTX — fills become invisible; use 6-digit HEX plus ""fill-opacity/stroke-opacity)")- if any(_local_name(elem).lower() == 'g' and elem.get('opacity') for elem in elems):- result['errors'].append("Detected forbidden <g opacity> (set opacity on each child element individually)")for elem in elems:- if _local_name(elem).lower() != 'image':+ tag = _local_name(elem).lower()+ if tag not in {'g', 'image'}:continueraw_opacity = elem.get('opacity')if raw_opacity is None:@@ -658,7 +657,15 @@ class SVGQualityChecker:opacity = -1.0if not 0.0 <= opacity <= 1.0:result['errors'].append(- f"<image opacity> must be a numeric value from 0 to 1, got {raw_opacity!r}"+ f"<{tag} opacity> must be a numeric value from 0 to 1, got {raw_opacity!r}"+ )+ if tag == 'g' and opacity < 1.0 and any(+ descendant.get('data-pptx-native')+ for descendant in elem.iter()+ ):+ result['warnings'].append(+ "<g opacity> around data-pptx-native content uses the SVG "+ "fallback; --native-objects export rejects that combination")def _check_font_size_values(self, content: str, result: Dict):diff --git a/skills/ppt-master/templates/charts/CHART_STYLE_GUIDE.md b/skills/ppt-master/templates/charts/CHART_STYLE_GUIDE.mdindex 90cee57e..e5fd0a62 100644--- a/skills/ppt-master/templates/charts/CHART_STYLE_GUIDE.md+++ b/skills/ppt-master/templates/charts/CHART_STYLE_GUIDE.md@@ -254,7 +254,7 @@ font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Micr**命名约定**:使用描述性 `id`(如 `card-1`、`step-discover`、`header`、`footer`)。-> 只有 `<g opacity="...">` 被禁止(见 SS2)。纯结构 `<g>` 是必需的。+> `<g opacity="0..1">` 可按 SS2 近似转换;纯结构 `<g>` 仍是常规分组方式。### 5.2 viewBox@@ -301,12 +301,12 @@ font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Micr| 禁止语法 | 正确替代 ||---------|----------|| `fill="rgba(255,255,255,0.1)"` | `fill="#FFFFFF" fill-opacity="0.1"` |-| `<g opacity="0.2">...</g>` | 在每个子元素上单独设置 `fill-opacity` / `stroke-opacity` |### 6.3 条件允许| 特性 | 条件 | 转换结果 ||------|------|----------|+| `<g opacity="...">` | 数值范围 `0..1`;不包裹 `data-pptx-native` 图表/表格 | 后代对象分别写入 DrawingML alpha;重叠区域为近似 || `<image opacity="...">` | 数值范围 `0..1` | DrawingML `<a:alphaModFix>` || `marker-start` / `marker-end` | `<marker>` 在 `<defs>` 中,`orient="auto"`,形状为三角/菱形/圆 | DrawingML `<a:headEnd>` / `<a:tailEnd>` || `clipPath` on `<image>` | `<clipPath>` 在 `<defs>` 中,单子元素,**仅用于 image** | DrawingML `<a:prstGeom>` / `<a:custGeom>` |diff --git "a/skills/ppt-master/templates/decks/\344\270\255\345\233\275\347\224\265\345\273\272/design_spec.md" "b/skills/ppt-master/templates/decks/\344\270\255\345\233\275\347\224\265\345\273\272/design_spec.md"index 7518d0d2..631dd2f3 100644--- "a/skills/ppt-master/templates/decks/\344\270\255\345\233\275\347\224\265\345\273\272/design_spec.md"+++ "b/skills/ppt-master/templates/decks/\344\270\255\345\233\275\347\224\265\345\273\272/design_spec.md"@@ -197,7 +197,6 @@ primary_color: "#00418D"- `animate`, `animateTransform`, `set` (animations)- `rgba()` color format (must use hex + opacity)-- `<g opacity="...">` (group opacity — set individually on each element)---diff --git "a/skills/ppt-master/templates/decks/\344\270\255\346\261\275\347\240\224/design_spec.md" "b/skills/ppt-master/templates/decks/\344\270\255\346\261\275\347\240\224/design_spec.md"index 09406bed..80d3b98a 100644--- "a/skills/ppt-master/templates/decks/\344\270\255\346\261\275\347\240\224/design_spec.md"+++ "b/skills/ppt-master/templates/decks/\344\270\255\346\261\275\347\240\224/design_spec.md"@@ -197,7 +197,7 @@ primary_color: "#004098"### PPT Compatibility Rules-- No `<g opacity="...">` (group opacity) — set opacity on each child element individually+- `<g opacity="0..1">` is allowed as per-descendant alpha; overlapping children may composite differently- `<image opacity="0..1">` maps to native picture transparency; use overlays only for color washes- Inline styles only — no external CSS or `@font-face`diff --git "a/skills/ppt-master/templates/decks/\351\207\215\345\272\206\345\244\247\345\255\246/design_spec.md" "b/skills/ppt-master/templates/decks/\351\207\215\345\272\206\345\244\247\345\255\246/design_spec.md"index 1d0a200b..e0c0b594 100644--- "a/skills/ppt-master/templates/decks/\351\207\215\345\272\206\345\244\247\345\255\246/design_spec.md"+++ "b/skills/ppt-master/templates/decks/\351\207\215\345\272\206\345\244\247\345\255\246/design_spec.md"@@ -225,7 +225,6 @@ Small circle elements representing the nighttime lights of the Mountain City:- `mask`, `<style>`, `class`; `clipPath` is allowed only on `<image>` under `shared-standards.md` §1.2- `foreignObject`, `textPath`, `animate*`- `rgba()` color format-- `<g opacity="...">` (group opacity)---diff --git a/skills/ppt-master/templates/design_spec_reference.md b/skills/ppt-master/templates/design_spec_reference.mdindex c8a1985a..ca14bcc6 100644--- a/skills/ppt-master/templates/design_spec_reference.md+++ b/skills/ppt-master/templates/design_spec_reference.md@@ -368,6 +368,6 @@ One speaker note file per page, saved to `notes/`:### PPT Compatibility Rules:-- `<g opacity="...">` FORBIDDEN (group opacity); set on each child element individually+- `<g opacity="0..1">` is allowed as per-descendant alpha; overlapping children may composite differently- Image transparency may use `<image opacity="0..1">`; use overlays only for a color wash- Inline styles only; external CSS and `@font-face` FORBIDDENdiff --git a/skills/ppt-master/templates/layouts/academic_defense/design_spec.md b/skills/ppt-master/templates/layouts/academic_defense/design_spec.mdindex 84ae83c7..ae4f7ebf 100644--- a/skills/ppt-master/templates/layouts/academic_defense/design_spec.md+++ b/skills/ppt-master/templates/layouts/academic_defense/design_spec.md@@ -156,7 +156,7 @@ page_types: [cover, toc, chapter, content, ending]### PPT Compatibility Rules-- No `<g opacity="...">` (group opacity); set opacity on each child element individually+- `<g opacity="0..1">` is allowed as per-descendant alpha; overlapping children may composite differently- `<image opacity="0..1">` maps to native picture transparency; use overlays only for color washes- Inline styles only; no external CSS or `@font-face`diff --git a/skills/ppt-master/templates/layouts/ai_ops/design_spec.md b/skills/ppt-master/templates/layouts/ai_ops/design_spec.mdindex a2d10f3a..b350068d 100644--- a/skills/ppt-master/templates/layouts/ai_ops/design_spec.md+++ b/skills/ppt-master/templates/layouts/ai_ops/design_spec.md@@ -267,7 +267,7 @@ This template emulates the visual language of telecom technical reports. The cor5. Prohibited: `mask`, `<style>`, `class`, `foreignObject` (`id` inside `<defs>` is allowed). `clipPath` is allowed only on `<image>` under `shared-standards.md` §1.26. Prohibited: `textPath`, `animate*`, `script`7. Prohibited: `<symbol>+<use>`, `<iframe>`, `@font-face`-8. Prohibited: `<g opacity="...">` (group opacity) — set opacity on each child element individually+8. `<g opacity="0..1">` is allowed as per-descendant alpha; overlapping children may composite differently9. `marker-start` / `marker-end` conditionally allowed (marker in `<defs>`, `orient="auto"`, shape = triangle/diamond/oval) — see shared-standards.md §1.110. Use only system fonts and inline stylesdiff --git a/skills/ppt-master/templates/layouts/government_blue/design_spec.md b/skills/ppt-master/templates/layouts/government_blue/design_spec.mdindex 52fbea40..b18c3ba5 100644--- a/skills/ppt-master/templates/layouts/government_blue/design_spec.md+++ b/skills/ppt-master/templates/layouts/government_blue/design_spec.md@@ -154,7 +154,7 @@ page_types: [cover, toc, chapter, content, ending]### PPT Compatibility Rules-- No `<g opacity="...">` (group opacity); set opacity on each child element individually+- `<g opacity="0..1">` is allowed as per-descendant alpha; overlapping children may composite differently- `<image opacity="0..1">` maps to native picture transparency; use overlays only for color washes- Use inline styles only; external CSS and `@font-face` are prohibiteddiff --git a/skills/ppt-master/templates/layouts/government_red/design_spec.md b/skills/ppt-master/templates/layouts/government_red/design_spec.mdindex 2cc20628..f07dfb0f 100644--- a/skills/ppt-master/templates/layouts/government_red/design_spec.md+++ b/skills/ppt-master/templates/layouts/government_red/design_spec.md@@ -149,7 +149,7 @@ page_types: [cover, toc, chapter, content, ending]### PPT Compatibility Rules-- No `<g opacity="...">` (group opacity); set opacity on each child element individually+- `<g opacity="0..1">` is allowed as per-descendant alpha; overlapping children may composite differently- `<image opacity="0..1">` maps to native picture transparency; use overlays only for color washes- Use inline styles only; external CSS and `@font-face` are prohibiteddiff --git a/skills/ppt-master/templates/layouts/medical_university/design_spec.md b/skills/ppt-master/templates/layouts/medical_university/design_spec.mdindex 0302cd31..72cfec7f 100644--- a/skills/ppt-master/templates/layouts/medical_university/design_spec.md+++ b/skills/ppt-master/templates/layouts/medical_university/design_spec.md@@ -163,7 +163,6 @@ page_types: [cover, toc, chapter, content, ending]| `foreignObject` | Use `<tspan>` for wrapping || `textPath` | Use standard `<text>` || `animate*` / `set` | Do not use animations |-| `<g opacity>` | Set opacity on each element individually |> `marker-start` / `marker-end` are conditionally allowed — see `shared-standards.md` §1.1 (marker must be in `<defs>`, `orient="auto"`, shape = triangle / diamond / oval). The converter maps them to native DrawingML arrow heads.diff --git a/skills/ppt-master/templates/layouts/pixel_retro/design_spec.md b/skills/ppt-master/templates/layouts/pixel_retro/design_spec.mdindex be230203..bc1cb49c 100644--- a/skills/ppt-master/templates/layouts/pixel_retro/design_spec.md+++ b/skills/ppt-master/templates/layouts/pixel_retro/design_spec.md@@ -206,7 +206,7 @@ Apply glow filters to key text/elements:### PPT Compatibility Rules-- No `<g opacity="...">` (group opacity); set opacity on each child element individually+- `<g opacity="0..1">` is allowed as per-descendant alpha; overlapping children may composite differently- `<image opacity="0..1">` maps to native picture transparency; use overlays only for color washes- Use inline styles only; external CSS and `@font-face` are prohibited- `filter` effects serve as enhancements (allowed) and do not affect baseline displaydiff --git a/skills/ppt-master/templates/layouts/psychology_attachment/design_spec.md b/skills/ppt-master/templates/layouts/psychology_attachment/design_spec.mdindex 4760085a..740642e6 100644--- a/skills/ppt-master/templates/layouts/psychology_attachment/design_spec.md+++ b/skills/ppt-master/templates/layouts/psychology_attachment/design_spec.md@@ -295,7 +295,9 @@ Use `tabler-outline` as the stylistic icon library for this template. It matches| ---------------------------------- | ------------------------------------------------------ || `fill="rgba(255,255,255,0.1)"` | `fill="#FFFFFF" fill-opacity="0.1"` || `stroke="rgba(0,0,0,0.5)"` | `stroke="#000000" stroke-opacity="0.5"` |-| `<g opacity="0.2">...</g>` | Set `opacity` / `fill-opacity` on each child element individually |++`<g opacity="0..1">` is supported as per-descendant alpha; overlapping+children may composite differently from an isolated SVG group.---diff --git a/skills/ppt-master/templates/spec_lock_reference.md b/skills/ppt-master/templates/spec_lock_reference.mdindex f44f25d9..cbcd6218 100644--- a/skills/ppt-master/templates/spec_lock_reference.md+++ b/skills/ppt-master/templates/spec_lock_reference.md@@ -193,5 +193,4 @@- Mixing icon libraries- rgba()- `<style>`, `class`, `<foreignObject>`, `textPath`, `@font-face`, `<animate*>`, `<script>`, `<iframe>`, `<symbol>`+`<use>`-- `<g opacity>` (set opacity on each child element individually)- HTML named entities in text (` `, `—`, `©`, `–`, `®`, `…`, `•` …) — write as raw Unicode (`—`, `©`, `→`, NBSP, etc.); XML reserved chars `& < > " '` must be escaped as `& < > " '`. See shared-standards.md §1.0