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(image-gen): unify Path A → B → C monotonic fallback chain

hugohe3cb91dba244a9
diff --git a/skills/ppt-master/references/image-generator.md b/skills/ppt-master/references/image-generator.md
index 19aa6d7c..24fc2e8f 100644
--- a/skills/ppt-master/references/image-generator.md
+++ b/skills/ppt-master/references/image-generator.md
@@ -275,16 +275,16 @@ C (AI-generated) supports three implementation modes sharing one `image_prompts.
| Trigger | Mode | Mechanism |
|---|---|---|
| **Default** — `IMAGE_BACKEND` configured | **Path A**: `image_gen.py --manifest` | One command runs the whole manifest with concurrency; status writes back per item |
-| **Path A unavailable/fails OR User explicitly names host tool** | **Path B**: Host-native tool | Agent invokes the host's image capability; outputs land at `project/images/<filename>` |
+| `IMAGE_BACKEND` not configured (or Path A fails) AND host has a native image tool | **Path B**: Host-native tool | Agent invokes the host's image capability; outputs land at `project/images/<filename>` |
| **Both Path A and Path B fail/unavailable** | **Offline Manual Mode** | Manifest stays on disk; user generates externally from `items[].prompt` and places files at `project/images/<filename>` |
-**Selection logic** (automatic, no user prompting):
+**Selection logic** — monotonic A → B → C fallback chain (automatic, no user prompting):
-1. User explicitly named Path B → use Path B
-2. Otherwise check `IMAGE_BACKEND` (env or `.env`)
- - configured → use Path A. If Path A fails twice in a row, automatically fall back to Path B.
- - not configured → skip Path A, automatically fall back to Path B.
-3. If Path B also fails or the host lacks native image generation → fall through to Offline Manual Mode.
+1. **Try Path A** — if `IMAGE_BACKEND` is configured (env or `.env`), run `image_gen.py --manifest`. If it fails twice in a row, fall to Path B.
+2. **Try Path B** — if `IMAGE_BACKEND` was not configured (A skipped), or A failed, and the host has a native image tool (Codex / Antigravity / Claude Code / similar), the agent invokes the host's image capability directly.
+3. **Fall to C (Offline Manual)** — if B is also unavailable (no host-native tool) or fails, write prompts to `images/image_prompts.json` and hand off to the user.
+
+**User override**: If the user explicitly names Path B ("use Codex's image tool"), skip A and start at B. Explicit naming is the only way to bypass an earlier path in the chain; otherwise the chain is monotonic.
**Hard rule**: Step 4 is execution, not re-decision. Never present an interactive choice between paths here — image strategy was locked in Strategist Step 4 h item.
@@ -344,9 +344,9 @@ Precedence:
- Interrupting mid-run is safe — completed items keep `status: Generated` and are skipped on re-run
- On normal completion the Markdown sidecar is re-rendered automatically; if the run is interrupted, run `--render-md` manually to refresh the sidecar
-### Path B — Host-Native Image Tool (On Explicit User Request)
+### Path B — Host-Native Image Tool
-Triggered only when the user explicitly asks the skill to use the host's built-in image generation (e.g. Codex, Antigravity, or any other host that provides a native image tool).
+Triggered automatically when `IMAGE_BACKEND` is not configured (or Path A fails) **and** the host provides a native image generation tool (Codex, Antigravity, Claude Code's image tool, and similar). No user prompting required — the agent detects the host capability and proceeds. The user may also explicitly name this path ("use Codex's image tool") to force it even when `IMAGE_BACKEND` is configured.
- Agent invokes the host's native image tool directly; prompts come from `items[].prompt`
- Outputs **must** land at `project/images/<filename-from-resource-list>` with dimensions matching the Image Resource List
diff --git a/skills/ppt-master/references/strategist.md b/skills/ppt-master/references/strategist.md
index 154d9953..528e6e3a 100644
--- a/skills/ppt-master/references/strategist.md
+++ b/skills/ppt-master/references/strategist.md
@@ -236,8 +236,8 @@ Baseline choice follows **content density**, not style. Common: `18px` (dense) /
| Mode | Trigger | Mechanism |
|---|---|---|
| **Path A** | `IMAGE_BACKEND` configured (default) | `image_gen.py` runs in Step 5 |
-| **Path B** | User explicitly names host's image tool (Codex / Antigravity) | Host-native generation |
-| **Offline Manual** | Path A unavailable AND Path B not in use | Prompts written to `images/image_prompts.json`; user generates externally and places files in `project/images/` |
+| **Path B** | `IMAGE_BACKEND` not configured AND host has a native image tool (Codex / Antigravity / Claude Code / similar) — auto-selected, no user prompting needed | Host-native generation |
+| **Offline Manual** | `IMAGE_BACKEND` not configured AND host has no native image tool | Prompts written to `images/image_prompts.json`; user generates externally and places files in `project/images/` |
Selection is automatic in Step 5 (A → B → Manual). Detailed contract: [`image-generator.md`](./image-generator.md) §3.2.
diff --git a/skills/ppt-master/scripts/image_gen.py b/skills/ppt-master/scripts/image_gen.py
index db65c6a9..01b81f78 100644
--- a/skills/ppt-master/scripts/image_gen.py
+++ b/skills/ppt-master/scripts/image_gen.py
@@ -319,9 +319,14 @@ def _resolve_backend() -> tuple[object, str]:
supported = ", ".join(SUPPORTED_BACKENDS)
print(
- "Error: No image backend configured.\n"
+ "Error: No image backend configured for Path A (image_gen.py).\n"
"\n"
- "Set IMAGE_BACKEND explicitly in one of these places:\n"
+ "If your host (Codex / Antigravity / Claude Code / etc.) has a native image\n"
+ "generation tool, do NOT run this script — switch to Path B: invoke the host's\n"
+ "image tool directly with the prompts from images/image_prompts.json and save\n"
+ "the outputs to images/<filename>. See references/image-generator.md §7 Path B.\n"
+ "\n"
+ "To use Path A instead, set IMAGE_BACKEND in one of these places:\n"
f" 1. Current process environment\n"
f" 2. {ENV_PATH}\n"
"\n"