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(project-manager): restrict source moves to project workspaces

hugohe3477488084f72
diff --git a/AGENTS.md b/AGENTS.md
index 28ff8bed..1b8d4f1a 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -46,7 +46,7 @@ python3 skills/ppt-master/scripts/source_to_md.py <file_or_URL_or_dir> [<file_or
# Project management
python3 skills/ppt-master/scripts/project_manager.py init <project_name> --format ppt169
-python3 skills/ppt-master/scripts/project_manager.py import-sources <project_path> <source_files_or_dirs_or_URLs...> --move
+python3 skills/ppt-master/scripts/project_manager.py import-sources <project_path> <source_files_or_dirs_or_URLs...>
python3 skills/ppt-master/scripts/project_manager.py scaffold-spec <project_path> # optional manual helper
python3 skills/ppt-master/scripts/project_manager.py scaffold-lock <project_path> # optional manual helper
python3 skills/ppt-master/scripts/project_manager.py validate <project_path>
diff --git a/docs/technical-design.md b/docs/technical-design.md
index d79ef7db..c08b9639 100644
--- a/docs/technical-design.md
+++ b/docs/technical-design.md
@@ -262,7 +262,7 @@ Two converter design choices still shape the system:
| `exports/` | timestamped native PPTX deliverables |
| `backup/<timestamp>/` | frozen `svg_output/` snapshots written by default export |
-The CLI still supports three source-import modes: `--move`, `--copy`, and an automatic default that moves repo-local files but copies external files. The Generate PPTX production workflow in [`workflows/generate-pptx.md`](../skills/ppt-master/workflows/generate-pptx.md) deliberately tightens that: agents must call `import-sources ... --move` so every source artifact and generated intermediate enters `sources/` and the working root stays clean. The script-level default exists for ad hoc CLI safety; the workflow-level contract is stricter so AI runs are reproducible and auditable.
+The CLI supports `--move`, `--copy`, and an automatic default, with one fixed ownership boundary: only sources already under the repository's `projects/` tree may move into a target project's `sources/`; every other local path is copied and remains untouched, even when `--move` is supplied. `--copy` preserves a projects-local input. Generate PPTX uses the automatic mode so canonical repository documents and external user files cannot be removed during intake.
---
diff --git a/docs/zh/technical-design.md b/docs/zh/technical-design.md
index a2f5774d..a10ca463 100644
--- a/docs/zh/technical-design.md
+++ b/docs/zh/technical-design.md
@@ -263,7 +263,7 @@ SVG 也是唯一同时满足流程中所有角色需要的格式:**AI 能可
| `exports/` | 带时间戳的 native PPTX 交付物 |
| `backup/<timestamp>/` | 默认导出时写入的冻结 `svg_output/` 快照 |
-CLI 仍支持三种导入模式:`--move`、`--copy`,以及“仓库内文件 move、仓库外文件 copy”的自动默认。[`workflows/generate-pptx.md`](../../skills/ppt-master/workflows/generate-pptx.md) 中的 Generate PPTX 生产工作流会刻意收紧这一点:agent 必须调用 `import-sources ... --move`,让所有源文件和中间产物进入 `sources/`,保持工作根目录干净。脚本级默认服务临时 CLI 使用的安全性;工作流级契约更严格,是为了让 AI 执行具备可复现和可审计性。
+CLI 支持 `--move`、`--copy` 和自动默认,但共享同一条固定的所有权边界:只有仓库 `projects/` 目录下的源文件可以 move 到目标项目的 `sources/`;其他本地路径一律 copy 并保留原文件,即使显式传入 `--move` 也不例外。`--copy` 用于要求保留的 projects-local 输入。Generate PPTX 使用自动模式,因此仓库正式文档和外部用户文件不会在导入时被移除。
---
diff --git a/skills/ppt-master/scripts/README.md b/skills/ppt-master/scripts/README.md
index 182d3ea3..532d9a36 100644
--- a/skills/ppt-master/scripts/README.md
+++ b/skills/ppt-master/scripts/README.md
@@ -27,7 +27,7 @@ python3 scripts/source_to_md/pdf_to_md.py <file.pdf>
python3 scripts/source_to_md/ppt_to_md.py <deck.pptx>
python3 scripts/source_to_md/excel_to_md.py <workbook.xlsx>
python3 scripts/project_manager.py init <project_name> --format ppt169
-python3 scripts/project_manager.py import-sources <project_path> <source_files_or_dirs...> --move
+python3 scripts/project_manager.py import-sources <project_path> <source_files_or_dirs...>
python3 scripts/total_md_split.py <project_path>
python3 scripts/finalize_svg.py <project_path>
python3 scripts/animation_config.py scaffold <project_path> # optional object-level animation overrides
@@ -72,7 +72,7 @@ Project setup:
```bash
python3 scripts/project_manager.py init <project_name> --format ppt169
-python3 scripts/project_manager.py import-sources <project_path> <source_files_or_dirs...> --move
+python3 scripts/project_manager.py import-sources <project_path> <source_files_or_dirs...>
python3 scripts/project_manager.py scaffold-spec <project_path> # optional manual helper
python3 scripts/project_manager.py scaffold-lock <project_path> # optional manual helper
python3 scripts/project_manager.py validate <project_path>
diff --git a/skills/ppt-master/scripts/docs/project.md b/skills/ppt-master/scripts/docs/project.md
index a2fd763f..180efa02 100644
--- a/skills/ppt-master/scripts/docs/project.md
+++ b/skills/ppt-master/scripts/docs/project.md
@@ -1,8 +1,8 @@
# Project Tools
-> **Import boundary**: copy out-of-repository sources by default to protect user
-> files; move in-repository sources by default to avoid leaving accidental
-> commit artifacts. Explicit `--copy` / `--move` flags override the default.
+> **Import boundary**: move only sources already under the repository's
+> `projects/` tree. Copy every other local path, even when `--move` is supplied.
+> Use `--copy` to preserve a projects-local source.
Project tools create, validate, and inspect the standard PPT Master workspace.
@@ -22,18 +22,17 @@ python3 scripts/project_manager.py page-context-report <project_path>
```
Notes:
-- Files outside the repo are copied into `sources/` by default
-- With `--move`, files outside the repo are moved into `sources/`
+- Files outside `projects/` are always copied into `sources/`
+- `--move` applies only to sources under the repository's `projects/` tree
- Directory inputs are expanded non-recursively. After Step 1 conversion,
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.
+- A projects-local supplied source directory left strictly empty after import
+ (or empty from the start) is removed; every directory outside `projects/`
+ remains untouched. `--copy` never removes directories.
+- Files already under `projects/` move into `sources/` by default. Pass `--copy`
+ to preserve them in place.
- `--move` and `--copy` are mutually exclusive.
- Normal Generate authoring reads `templates/design_spec_reference.md`, writes
the complete `design_spec.md` from scratch, then reads
diff --git a/skills/ppt-master/scripts/project_manager.py b/skills/ppt-master/scripts/project_manager.py
index bb3c09c0..19d2c363 100644
--- a/skills/ppt-master/scripts/project_manager.py
+++ b/skills/ppt-master/scripts/project_manager.py
@@ -58,6 +58,7 @@ except ImportError:
TOOLS_DIR = Path(__file__).resolve().parent
SKILL_DIR = TOOLS_DIR.parent
REPO_ROOT = SKILL_DIR.parent.parent
+PROJECTS_ROOT = REPO_ROOT / "projects"
SOURCE_TO_MD_TOOLS_DIR = TOOLS_DIR / "source_to_md"
if str(SOURCE_TO_MD_TOOLS_DIR) not in sys.path:
sys.path.insert(0, str(SOURCE_TO_MD_TOOLS_DIR))
@@ -707,19 +708,25 @@ class ProjectManager:
summary["skipped"].append(f"{item}: directories are not supported")
continue
+ inside_projects = is_within_path(source_path, PROJECTS_ROOT)
if copy:
effective_move = False
- elif move:
- effective_move = True
- elif is_within_path(source_path, REPO_ROOT):
+ elif inside_projects:
effective_move = True
+ else:
+ effective_move = False
+ if move and not inside_projects:
print(
- f"note: {source_path} is inside the ppt-master repo; moved "
- f"(not copied) to avoid accidental commit. Pass --copy to override.",
+ f"note: {source_path} is outside {PROJECTS_ROOT}; copied "
+ f"(not moved). Only sources under projects/ may be moved.",
+ file=sys.stderr,
+ )
+ elif inside_projects and not move and not copy:
+ print(
+ f"note: {source_path} is under projects/; moved into the target "
+ f"project. Pass --copy to preserve it.",
file=sys.stderr,
)
- else:
- effective_move = False
suffix = source_path.suffix.lower()
if suffix in {".md", ".markdown"}:
@@ -859,12 +866,11 @@ 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.
+ # Cleanup: only a projects-local source directory may be removed after
+ # its files move into the target project. Every other location is copied
+ # and remains untouched, even when the caller passes --move.
for directory in supplied_dirs:
- if copy or not (move or is_within_path(directory, REPO_ROOT)):
+ if copy or not is_within_path(directory, PROJECTS_ROOT):
continue
if directory.is_dir() and not any(directory.iterdir()):
try:
@@ -926,7 +932,7 @@ def build_parser() -> argparse.ArgumentParser:
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog="""Examples:
python3 scripts/project_manager.py init demo --format ppt169
- python3 scripts/project_manager.py import-sources projects/demo file.md --move
+ python3 scripts/project_manager.py import-sources projects/demo file.md
python3 scripts/project_manager.py scaffold-spec projects/demo_ppt169_20260718
python3 scripts/project_manager.py scaffold-lock projects/demo_ppt169_20260718
python3 scripts/project_manager.py validate projects/demo
@@ -949,7 +955,11 @@ def build_parser() -> argparse.ArgumentParser:
import_sources.add_argument("project_path", help="Project directory")
import_sources.add_argument("sources", nargs="+", help="Source files, directories, or URLs")
mode = import_sources.add_mutually_exclusive_group()
- mode.add_argument("--move", action="store_true", help="Move local source files")
+ mode.add_argument(
+ "--move",
+ action="store_true",
+ help="Move local sources under projects/; sources elsewhere are copied",
+ )
mode.add_argument("--copy", action="store_true", help="Copy local source files")
scaffold_spec = subparsers.add_parser(
diff --git a/skills/ppt-master/workflows/generate-pptx.md b/skills/ppt-master/workflows/generate-pptx.md
index ccfe47d4..ff868405 100644
--- a/skills/ppt-master/workflows/generate-pptx.md
+++ b/skills/ppt-master/workflows/generate-pptx.md
@@ -106,7 +106,7 @@ Import source content (choose based on the situation):
| Situation | Action |
|-----------|--------|
-| Has source files (PDF/MD/etc.) | `python3 ${SKILL_DIR}/scripts/project_manager.py import-sources <project_path> <source_files_or_dirs...> --move` |
+| Has source files (PDF/MD/etc.) | `python3 ${SKILL_DIR}/scripts/project_manager.py import-sources <project_path> <source_files_or_dirs...>` |
| User provided text directly in conversation | No import needed — content is already in conversation context; subsequent steps can reference it directly |
For PPTX sources, `import-sources` automatically runs the standard intake enrichment:
@@ -119,7 +119,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, and a source directory left empty by the move is removed automatically. Intermediate artifacts (e.g., `_files/`) are handled automatically.
+**Source ownership boundary**: Use the automatic import mode shown above. Only inputs already under the repository's `projects/` tree move into the target project's `sources/`; every other local path is copied and remains untouched, even if `--move` is supplied. Use `--copy` when a projects-local input must also remain in place. 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. 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/profiles/beautify-pptx.md b/skills/ppt-master/workflows/profiles/beautify-pptx.md
index 70999ded..41109a87 100644
--- a/skills/ppt-master/workflows/profiles/beautify-pptx.md
+++ b/skills/ppt-master/workflows/profiles/beautify-pptx.md
@@ -53,7 +53,7 @@ Match the canvas to the source so 1:1 pages and paste-back align. Determine the
```bash
python3 ${SKILL_DIR}/scripts/project_manager.py init <project_name> --format <format>
-python3 ${SKILL_DIR}/scripts/project_manager.py import-sources <project_path> <source.pptx> --move
+python3 ${SKILL_DIR}/scripts/project_manager.py import-sources <project_path> <source.pptx>
```
---
diff --git a/skills/ppt-master/workflows/stages/topic-research.md b/skills/ppt-master/workflows/stages/topic-research.md
index 6859ac51..ae3856db 100644
--- a/skills/ppt-master/workflows/stages/topic-research.md
+++ b/skills/ppt-master/workflows/stages/topic-research.md
@@ -108,7 +108,7 @@ IDs are immutable within the file. Correct a claim under the same ID; never reus
Import the research supplement and provenance alongside any user-supplied sources in Generate Step 2:
```bash
-python3 ${SKILL_DIR}/scripts/project_manager.py import-sources projects/<project_name> [<source_paths...>] projects/<research_slug>.md projects/<research_slug>.facts.json --move
+python3 ${SKILL_DIR}/scripts/project_manager.py import-sources projects/<project_name> [<source_paths...>] projects/<research_slug>.md projects/<research_slug>.facts.json
```
The Research Brief remains evidence-facing context, not a locked presentation contract. Strategist reads all imported source material, then confirms the complete contract and decides the content, page roster, and image resource plan. Generate Step 5 acquires only the selected image rows after that confirmation.
diff --git a/skills/ppt-master/workflows/template-fill-pptx.md b/skills/ppt-master/workflows/template-fill-pptx.md
index aff1e55a..2f50801c 100644
--- a/skills/ppt-master/workflows/template-fill-pptx.md
+++ b/skills/ppt-master/workflows/template-fill-pptx.md
@@ -60,7 +60,7 @@ python3 skills/ppt-master/scripts/project_manager.py init "<project_name>" --for
python3 skills/ppt-master/scripts/project_manager.py import-sources "<project_dir>" "<source.pptx>" "<material...>"
```
-**Source import rule**: `project_manager.py import-sources` copies files from outside the repository and moves repo-local files by default, unless `--copy` / `--move` is explicitly supplied. Keep this shared behavior; do not create a separate template-fill import path.
+**Source import rule**: `project_manager.py import-sources` moves only sources under repository `projects/` and copies all others. `--copy` preserves a projects-local input; `--move` never widens that scope. Reuse this path.
Use this fixed layout: