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

feat(import-sources): remove source directories left empty after move

hugohe33aca96653849
diff --git a/skills/ppt-master/scripts/docs/project.md b/skills/ppt-master/scripts/docs/project.md
index e34db98c..ac178854 100644
--- a/skills/ppt-master/scripts/docs/project.md
+++ b/skills/ppt-master/scripts/docs/project.md
@@ -28,6 +28,9 @@ Notes:
pass the source file/directory once when generated Markdown lives beside the
original source. If Step 1 used `-o` to write Markdown elsewhere, pass both
the original source path/directory and the Markdown output path/directory.
+- Under move semantics, a supplied source directory left strictly empty after
+ import (or empty from the start) is removed; a directory that still holds any
+ file or subdirectory is left untouched. `--copy` never removes directories.
- Files already inside the repo are moved into `sources/` by default (with a stderr
note), to avoid leaving unintended artifacts that could be committed by mistake.
Pass `--copy` to force a copy for in-repo sources instead.
diff --git a/skills/ppt-master/scripts/project_manager.py b/skills/ppt-master/scripts/project_manager.py
index 60a03bc4..bb3c09c0 100644
--- a/skills/ppt-master/scripts/project_manager.py
+++ b/skills/ppt-master/scripts/project_manager.py
@@ -645,12 +645,14 @@ class ProjectManager:
}
expanded_items: list[str] = []
+ supplied_dirs: list[Path] = []
for item in source_items:
if is_url(item):
expanded_items.append(item)
continue
item_path = Path(item)
if item_path.is_dir():
+ supplied_dirs.append(item_path)
directory_files = sorted(
path for path in item_path.iterdir() if path.is_file()
)
@@ -857,6 +859,22 @@ class ProjectManager:
else:
summary["notes"].append(f"{item}: archived only, no automatic conversion")
+ # Cleanup: a supplied source directory that ends up empty (moved out or
+ # empty from the start) is removed so no husk is left behind. Only under
+ # move semantics — explicit --copy, or default copy outside the repo,
+ # must not delete a user directory.
+ for directory in supplied_dirs:
+ if copy or not (move or is_within_path(directory, REPO_ROOT)):
+ continue
+ if directory.is_dir() and not any(directory.iterdir()):
+ try:
+ directory.rmdir()
+ except OSError:
+ continue
+ summary["notes"].append(
+ f"{directory}: removed empty source directory after import"
+ )
+
return summary
def validate_project(self, project_path: str) -> tuple[bool, list[str], list[str]]:
diff --git a/skills/ppt-master/workflows/generate-pptx.md b/skills/ppt-master/workflows/generate-pptx.md
index 2bc9d9a3..118bb441 100644
--- a/skills/ppt-master/workflows/generate-pptx.md
+++ b/skills/ppt-master/workflows/generate-pptx.md
@@ -109,7 +109,7 @@ For each PPTX it writes `<stem>.identity.json` (canvas, theme palette/fonts, obs
Multi-deck: several PPTX files may be imported into one main-pipeline project — each gets its own `<stem>.*` artifacts and a deck entry in `source_profile.json`. `source_profile.json` stays the single must-read index (one entry for a one-deck project, several for a combined-source project). Stems must be distinct; re-importing the same stem replaces that deck's entry. The beautify profile and Fill Native PPTX route remain single-deck (1:1 to one chosen source deck) and read that deck's `<stem>.*` artifacts.
-> ⚠️ **MUST use `--move`** (not copy): all source files — Step 1's generated Markdown, original PDFs / MDs / images — go into `sources/` via `import-sources --move`. If Step 1 wrote Markdown beside the original sources, pass that source path/directory once. If Step 1 used `-o` to write Markdown elsewhere, pass both the original source path(s)/directory and the Markdown output path(s)/directory. After execution they no longer exist at the original location. Intermediate artifacts (e.g., `_files/`) are handled automatically.
+> ⚠️ **MUST use `--move`** (not copy): all source files — Step 1's generated Markdown, original PDFs / MDs / images — go into `sources/` via `import-sources --move`. If Step 1 wrote Markdown beside the original sources, pass that source path/directory once. If Step 1 used `-o` to write Markdown elsewhere, pass both the original source path(s)/directory and the Markdown output path(s)/directory. After execution they no longer exist at the original location, and a source directory left empty by the move is removed automatically. Intermediate artifacts (e.g., `_files/`) are handled automatically.
**✅ Checkpoint — Confirm project structure created successfully, `sources/` contains all source files, converted materials are ready. Proceed to Step 3.**
diff --git a/skills/ppt-master/workflows/stages/topic-research.md b/skills/ppt-master/workflows/stages/topic-research.md
index 9f858517..eee8ae09 100644
--- a/skills/ppt-master/workflows/stages/topic-research.md
+++ b/skills/ppt-master/workflows/stages/topic-research.md
@@ -146,4 +146,4 @@ The Research Brief is evidence-facing context, not a locked presentation contrac
`project_manager.py import-sources projects/<project_name> projects/<topic_slug>.md projects/<topic_slug>.facts.json projects/<topic_slug>/*.* --move`
```
-`<project_name>` is the user's chosen project identifier (typically `<format>_<topic_slug>`, e.g. `ppt169_joe_hisaishi`); `--move` removes the research artifacts from `projects/<topic_slug>` after they are imported.
+`<project_name>` is the user's chosen project identifier (typically `<format>_<topic_slug>`, e.g. `ppt169_joe_hisaishi`); `--move` removes the research artifacts from `projects/<topic_slug>` after they are imported and deletes the folder itself once it is empty.