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

refactor(ppt): rename visual-edit → live-preview and unify trigger

hugohe3b4bd4f6665d8
diff --git a/CLAUDE.md b/CLAUDE.md
index 9270a082..2e5209c7 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -20,7 +20,7 @@ PPT Master is an AI-driven presentation generation system. Multi-role collaborat
>
> Object-level animation tuning: when the user asks to change animation order, effect, timing, or a specific object's reveal behavior, run the standalone [`customize-animations`](skills/ppt-master/workflows/customize-animations.md) workflow. Default export already has global animations; do not create `animations.json` unless customization was requested.
>
-> Finished-deck re-entry: the main pipeline starts the live preview during Executor. If the deck has been exported, the editor was closed, and the user later wants another visual edit pass, run [`visual-edit`](skills/ppt-master/workflows/visual-edit.md) to reopen the editor, apply annotations, re-export, and reopen again.
+> Live preview / visual edit: any time the user mentions "live preview", "preview", "看效果", "visual edit", or wants to click/select a slide element, run [`live-preview`](skills/ppt-master/workflows/live-preview.md). Works for both mid-generation preview (`--live`) and post-export re-entry — one unified workflow.
## Execution Requirements
diff --git a/skills/ppt-master/SKILL.md b/skills/ppt-master/SKILL.md
index 63c9187c..d870cf5d 100644
--- a/skills/ppt-master/SKILL.md
+++ b/skills/ppt-master/SKILL.md
@@ -77,7 +77,7 @@ For complete tool documentation, see `${SKILL_DIR}/scripts/README.md`.
| `resume-execute` | `workflows/resume-execute.md` | Phase B entry — resume execution in a fresh chat after Phase A (Step 1–5) completed in another session (split mode) |
| `verify-charts` | `workflows/verify-charts.md` | Chart coordinate calibration — run after SVG generation if the deck contains data charts |
| `customize-animations` | `workflows/customize-animations.md` | Object-level PPTX animation customization — run only when the user explicitly asks to tune animation order/effects/timing |
-| `visual-edit` | `workflows/visual-edit.md` | Browser-based re-entry editor for finished/exported decks — reopen after edits are applied, not the main generation viewer |
+| `live-preview` | `workflows/live-preview.md` | Browser-based SVG editor — auto-started during generation and re-enterable any time the user mentions "live preview", "preview", "visual edit", or wants to click/select a slide element |
---
@@ -293,7 +293,7 @@ Read references/executor-consultant-top.md # Top consulting style (MBB level)
```bash
python3 ${SKILL_DIR}/scripts/svg_editor/server.py <project_path> --live
```
-- This is the main generation preview, not the finished-deck `visual-edit` workflow.
+- This uses the unified [`live-preview`](workflows/live-preview.md) workflow in `--live` mode.
- Start it immediately when Executor begins; `svg_output/` may be empty.
- Run it as a long-running side process/session; do not wait for the server process to exit before generating SVG pages.
- The editor opens `http://localhost:5050` by default and polls for new SVG pages in live mode.
@@ -311,15 +311,7 @@ python3 ${SKILL_DIR}/scripts/svg_editor/server.py <project_path> --live
**Visual Construction Phase**: generate SVG pages sequentially, one at a time, in one continuous pass → `<project_path>/svg_output/`
-**Live Annotation Handling (Mandatory)**: after each page generation and before Step 7, check for submitted annotations:
-```bash
-python3 ${SKILL_DIR}/scripts/check_annotations.py <project_path>
-```
-- If no annotations are found, continue.
-- If annotations are found, apply them to the targeted SVG elements, remove `data-edit-target` / `data-edit-annotation`, then run `svg_quality_checker.py`.
-- Do not proceed past a touched page with quality-check `error`s.
-
-**Quality Check Gate (Mandatory)** — after all SVGs, BEFORE speaker notes:
+**Quality Check Gate (Mandatory)** — after all SVGs, BEFORE annotation handling and speaker notes:
```bash
python3 ${SKILL_DIR}/scripts/svg_quality_checker.py <project_path>
```
@@ -327,6 +319,13 @@ python3 ${SKILL_DIR}/scripts/svg_quality_checker.py <project_path>
- `warning` entries (low-res image, non-PPT-safe font tail, etc.): fix when straightforward, otherwise acknowledge and release.
- Run against `svg_output/` (not after `finalize_svg.py` — finalize rewrites SVG and masks violations).
+**Live Annotation Handling (Mandatory)** — after quality check passes, before speaker notes:
+```bash
+python3 ${SKILL_DIR}/scripts/check_annotations.py <project_path>
+```
+- If no annotations found: continue to Logic Construction Phase.
+- If annotations found: apply each change to the targeted SVG elements (read `data-edit-annotation`, edit in place, remove `data-edit-target` / `data-edit-annotation`), then re-run `svg_quality_checker.py`. Do not proceed past a touched page with quality-check `error`s.
+
**Logic Construction Phase**: generate speaker notes → `<project_path>/notes/total.md`
**✅ Checkpoint — Confirm all SVGs and notes are fully generated and quality-checked. Proceed directly to Step 7 post-processing**:
@@ -334,8 +333,8 @@ python3 ${SKILL_DIR}/scripts/svg_quality_checker.py <project_path>
## ✅ Executor Phase Complete
- [x] Live preview started and kept available at the reported URL
- [x] All SVGs generated to svg_output/
-- [x] Submitted live annotations checked/applied or confirmed absent
- [x] svg_quality_checker.py passed (0 errors)
+- [x] Submitted live annotations checked/applied or confirmed absent
- [x] Speaker notes generated at notes/total.md
```
@@ -406,7 +405,7 @@ Full effect list, anchor logic, and limits: [`references/animations.md`](referen
> ❌ **NEVER** force `-s output` for the legacy/preview pptx (PowerPoint's internal SVG parser drops icons and rounded corners). The default auto-split already gives native the high-fidelity source it needs without touching legacy.
> ❌ **NEVER** use `--only` (it suppresses one of the two output files)
-> Finished-deck re-entry: the main pipeline automatically starts live preview in Step 6. If the deck has been exported and the user later wants another visual edit pass, run [`visual-edit`](workflows/visual-edit.md); that workflow automatically reopens the same editor service in finished-deck mode, applies annotations, re-exports, and reopens again.
+> Finished-deck re-entry: any time the user mentions "live preview", "preview", "visual edit", "看效果", or wants to select/click a slide element, run [`live-preview`](workflows/live-preview.md). It handles both mid-generation preview (`--live`) and post-export re-entry in one unified workflow.
---
diff --git a/skills/ppt-master/workflows/visual-edit.md b/skills/ppt-master/workflows/live-preview.md
similarity index 52%
rename from skills/ppt-master/workflows/visual-edit.md
rename to skills/ppt-master/workflows/live-preview.md
index bea7a0cd..c09a7f8b 100644
--- a/skills/ppt-master/workflows/visual-edit.md
+++ b/skills/ppt-master/workflows/live-preview.md
@@ -1,46 +1,54 @@
---
-description: Reopen the browser-based visual editor for a finished/exported deck; AI applies annotations, re-exports, and reopens the editor for another pass
+description: Start or reopen the browser-based live preview editor; AI applies submitted annotations, re-exports, and loops until the user is done
---
-# Visual Edit Workflow
+# Live Preview Workflow
-> Standalone finished-deck re-entry step. The main pipeline automatically starts the editor in live mode during Executor; use this workflow only after a deck has been generated/exported and the editor needs to be reopened for another visual edit pass.
+> Unified entry point for the browser-based SVG editor. Run this workflow any time the user mentions "live preview", "preview", "看一下效果", "visual edit", "改一下某个元素", or similar — whether the deck is mid-generation or already exported.
-This workflow is **independent**: it operates on `<project_path>/svg_output/`, applies submitted annotations, and re-runs the same post-processing scripts the main pipeline uses. Safe to invoke in a fresh session as long as the project has reached Step 7.
+This workflow is **independent**: it operates on `<project_path>/svg_output/`, applies submitted annotations, and re-runs the same post-processing scripts the main pipeline uses. Safe to invoke at any stage as long as `svg_output/` contains at least one SVG file.
## When to Run
-- The deck has been exported once (Steps 1–7 of the main workflow are complete), or the main live preview was closed after generation.
-- The user wants to change one or more specific visual elements **and either can't pinpoint them in words or would benefit from clicking the slide directly**.
-- A browser is reachable — either the host has a local desktop, or you can forward the port from a remote Linux server (see "Remote Linux access" below). Truly headless with no forwarding option: skip and apply edits via conversation instead.
+- **During Executor**: automatically, right after quality check passes — the main pipeline launches this via `--live` mode so the user can preview slides as they're generated.
+- **Finished-deck re-entry**: the deck has been exported at least once (Steps 1–7 complete), or the editor was closed after generation, and the user wants to refine specific visual elements.
+- Trigger phrases (any of these): "live preview", "preview", "看效果", "visual edit", "改一下", "打开编辑器", "看一下", "能不能看看", or the user describes clicking/selecting a slide element.
## When NOT to Run
-- The main Executor phase is still running with `--live` preview available — use that existing editor session instead.
-- The user gave a precise edit you can apply right now ("change page 3 title font-size to 32") — just edit the SVG.
+- The user gave a precise edit you can apply right now ("change page 3 title font-size to 32") — just edit the SVG directly.
- The user wants a full regeneration ("redo this slide", "换个风格") — use the main workflow.
+- Truly headless with no port-forwarding option: skip and apply edits via conversation instead.
---
## Step 1: Start the editor
+**During Executor (live mode):**
+```bash
+python3 ${SKILL_DIR}/scripts/svg_editor/server.py <project_path> --live
+```
+
+**Finished-deck / re-entry:**
```bash
python3 ${SKILL_DIR}/scripts/svg_editor/server.py <project_path>
```
-The server binds to `127.0.0.1:5050`, opens the browser automatically on local desktop environments, and edits `<project_path>/svg_output/` in place. **Submit annotations** only writes annotations to disk; it never stops the server. The preview UI includes **Exit preview** for closing the Flask server without saving pending annotations. `svg_to_pptx` already snapshots `svg_output` into `backup/<timestamp>/` on every export, so prior versions are recoverable from there.
+The server binds to `127.0.0.1:5050`, opens the browser automatically on local desktop environments, and edits `<project_path>/svg_output/` in place. **Submit annotations** writes annotations to disk; it never stops the server. **Exit preview** closes the Flask server without saving pending annotations. `svg_to_pptx` snapshots `svg_output` into `backup/<timestamp>/` on every export, so prior versions are recoverable.
### Remote Linux access
-If the project lives on a remote Linux server, run the editor with `--no-browser`; it still listens only on `127.0.0.1` for safety. Forward port 5050 from your local machine using one of:
+If the project lives on a remote Linux server, run with `--no-browser`:
```bash
python3 ${SKILL_DIR}/scripts/svg_editor/server.py <project_path> --no-browser
+# or with --live during generation:
+python3 ${SKILL_DIR}/scripts/svg_editor/server.py <project_path> --live --no-browser
```
- **VS Code / Cursor Remote-SSH**: open the **PORTS** panel (`Ctrl+Shift+P` → `Ports: Focus on Ports View`), click **Forward a Port**, enter `5050`. The workspace remembers it.
-- **Termius**: open the **Port Forwarding** module from the left sidebar (it's a top-level module, not nested under the host). Add a rule with **Type = Local** (not Remote — Remote forwards the opposite direction), Host = your remote, Binding `127.0.0.1:5050`, Destination `127.0.0.1:5050`. Save, then **start the rule** (▶ button) — saving alone does not activate it.
-- **Plain SSH**: in a local terminal, run `ssh -L 5050:127.0.0.1:5050 <user>@<host>` (or add `LocalForward 5050 127.0.0.1:5050` to `~/.ssh/config` once).
+- **Termius**: open the **Port Forwarding** module from the left sidebar (top-level, not nested). Add a rule with **Type = Local**, Host = your remote, Binding `127.0.0.1:5050`, Destination `127.0.0.1:5050`. Save, then **start the rule** (▶ button).
+- **Plain SSH**: `ssh -L 5050:127.0.0.1:5050 <user>@<host>` (or add `LocalForward 5050 127.0.0.1:5050` to `~/.ssh/config`).
Then open `http://localhost:5050` in your local browser.
@@ -48,10 +56,10 @@ After the server prints `SVG Editor running at http://localhost:5050`, tell the
- the editor is running at `http://localhost:5050`
- they should open it in a browser, click the element they want changed, write the change as a short instruction, then click **Submit annotations**
-- after submitting annotations, they should return to the conversation; the server remains open until they click **Exit preview**
+- after submitting, they should return to the conversation; the server stays open until they click **Exit preview**
- if they'd rather just describe the edit in chat, they can say so and you'll apply it directly without the editor
-Do **not** wait for the user to confirm before launching — they already asked for fine-grained edits, so launching is the response. The "describe in chat instead" line is the escape hatch.
+Do **not** wait for user confirmation before launching — they already signalled preview intent, so launching is the response. The "describe in chat" line is the escape hatch.
## Step 2: Apply annotations (Edit Loop)
@@ -72,11 +80,11 @@ Triggered when the user signals (in any wording) that they have submitted annota
python3 ${SKILL_DIR}/scripts/finalize_svg.py <project_path>
python3 ${SKILL_DIR}/scripts/svg_to_pptx.py <project_path>
```
-6. If the preview server is still running, keep using it; if it was closed, restart the editor with the Step 1 command.
-7. Tell the user (in their language) that annotations have been applied, the PPT is updated, and the editor is available at `http://localhost:5050`. If their browser still shows an old slide, ask them to refresh or reselect the slide.
+6. If the preview server is still running, keep using it; if it was closed, restart with the Step 1 command.
+7. Tell the user (in their language) that annotations have been applied, the PPT is updated, and the editor is at `http://localhost:5050`. If their browser shows an old slide, ask them to refresh or reselect the slide.
8. Wait for the user's next message:
- If they indicate they're done, the loop ends.
- - If they submit more annotations, return to step 1.
+ - If they submit more annotations, return to step 2.
---
@@ -85,4 +93,4 @@ Triggered when the user signals (in any wording) that they have submitted annota
- **Browser preview**: the server inlines `<use data-icon>` placeholders and serves `images/*` so the SVG renders correctly in the browser. The on-disk SVG is unchanged by these previews.
- **Element targeting**: each element gets a transient `_edit_N` id assigned by the server while previewing. After save, only annotated elements keep their id; unannotated `_edit_N` ids are stripped before writing back to disk.
- **Port conflict**: if `5050` is taken, pass `--port <other>` and update the URL you tell the user.
-- **Idle timeout**: the server self-terminates after 15 minutes of inactivity (override with `--timeout <seconds>`).
+- **Idle timeout**: the server self-terminates after 15 minutes of inactivity in standard mode (override with `--timeout <seconds>`). In `--live` mode, timeout is disabled by default.