| 1 | # AGENTS.md |
| 2 | |
| 3 | This file is the project entry point for general AI agents. |
| 4 | |
| 5 | **You MUST read [`skills/ppt-master/SKILL.md`](skills/ppt-master/SKILL.md) before any PPT generation task or repo modification.** It owns global execution discipline and points to the route selector; after routing, the selected runtime authority owns its steps, gates, and commands. The rest of this file only points to where related material lives. |
| 6 | |
| 7 | ## Project Overview |
| 8 | |
| 9 | PPT Master turns source material into natively editable DrawingML PPTX. Generate contains two mutually exclusive runtime paths: the default Strategist → Image_Generator → Executor pipeline and the self-contained Quick profile without a separate strategy/confirmation phase. Beautify selects between them from explicit Quick intent. |
| 10 | |
| 11 | **Route selection authority**: [`skills/ppt-master/workflows/routing.md`](skills/ppt-master/workflows/routing.md) owns the four top-level artifact routes: Generate PPTX, Create Template, Fill Native PPTX, and Enhance Native PPTX. Child workflows, profiles, stages, and governance documents refine one selected route; they are not competing top-level routes. |
| 12 | |
| 13 | - Topic-only or fact-insufficient inputs run [`topic-research`](skills/ppt-master/workflows/stages/topic-research.md) inside the selected Generate profile's source intake; facts only, no images. |
| 14 | - Default Generate prepares template candidates internally in Step 3, then confirms the communication contract and free-design/template choice together in Stage 1. Template content stays unread until that confirmation; selected roots are installed before template-aware Stage 2. Quick skips this interaction. |
| 15 | - Raw PPTX template plus new material/topic routes to [`template-fill-pptx`](skills/ppt-master/workflows/template-fill-pptx.md), not the SVG pipeline. |
| 16 | - Raw PPTX cannot be consumed as a Generate template workspace; run [`create-template`](skills/ppt-master/workflows/create-template.md) first and return with the generated workspace root as a Stage-1 candidate. Never add Master/Layout structure directly to an existing PPTX/SVG; generate new structured SVG pages from the workspace. |
| 17 | - Explicit quick/fast or skip-strategy generation may use [`quick-generate`](skills/ppt-master/workflows/profiles/quick-generate.md): prepare sources/resources as needed, decide without interaction, omit Strategist/confirmation/spec/lock, hand-author `svg_output/`, pass its lockless final checker, and export. |
| 18 | - PPTX beautify is a strict 1:1 Generate [`profile`](skills/ppt-master/workflows/profiles/beautify-pptx.md), not a separate route. Explicit Quick intent uses the Quick runtime; otherwise it uses Default. Any split/merge/drop/reorder disables Beautify and returns to ordinary Generate in the selected runtime. |
| 19 | - Finished PPTX native enhancement uses [`native-enhance-pptx`](skills/ppt-master/workflows/native-enhance-pptx.md) and must not enter SVG regeneration. |
| 20 | - [`visual-review`](skills/ppt-master/workflows/stages/visual-review.md), [`customize-animations`](skills/ppt-master/workflows/stages/customize-animations.md), and [`generate-audio`](skills/ppt-master/workflows/stages/generate-audio.md) are supporting stages; their trigger rules remain explicit/conditional. |
| 21 | |
| 22 | ## Execution Requirements |
| 23 | |
| 24 | - For any `brand`, `style`, `layout`, or `deck` workspace creation from PPTX/SVG, images/PDFs, documents/websites, brand assets, direct text, or mixed references, enter [`skills/ppt-master/workflows/create-template.md`](skills/ppt-master/workflows/create-template.md); it keeps the fixed Create Template name and dispatches exactly one of [`create-brand`](skills/ppt-master/workflows/create-template/create-brand.md), [`create-style`](skills/ppt-master/workflows/create-template/create-style.md), [`create-layout`](skills/ppt-master/workflows/create-template/create-layout.md), or [`create-deck`](skills/ppt-master/workflows/create-template/create-deck.md). |
| 25 | - Always-on SVG constraints and shared visual-quality defaults live in [`skills/ppt-master/references/shared-standards-core.md`](skills/ppt-master/references/shared-standards-core.md). Default and Quick Generate always load [`svg-effects.md`](skills/ppt-master/references/svg-effects.md); other routes load it, [`native-data-interface.md`](skills/ppt-master/references/native-data-interface.md), and [`pptx-structure-interface.md`](skills/ppt-master/references/pptx-structure-interface.md) only when their documented execution triggers apply. |
| 26 | - Canvas choices live in [`skills/ppt-master/references/canvas-formats.md`](skills/ppt-master/references/canvas-formats.md). |
| 27 | - Icon library details live in [`skills/ppt-master/templates/icons/README.md`](skills/ppt-master/templates/icons/README.md). |
| 28 | |
| 29 | ## Required Conventions |
| 30 | |
| 31 | - **Repo-wide style rules** — when editing prompt files under [`skills/ppt-master/references/`](skills/ppt-master/references/), Python under [`skills/ppt-master/scripts/`](skills/ppt-master/scripts/), or any other code/prose in the repo, follow the matching style rule in [`docs/rules/`](docs/rules/). |
| 32 | - **Prompt decision ownership** — follow [`docs/rules/prompt-style.md`](docs/rules/prompt-style.md) §4.1. Default Strategist prepares project-local resources and Executor realizes them; Quick's current agent decides and prepares before SVG authoring. This is not downstream acquisition. Every project icon is prepared material; `icons.inventory` indexes the default plan's curated bundled pool, not page usage or an execution whitelist. |
| 33 | - **Markdown language consistency** — Markdown files under `skills/ppt-master/workflows/`, `skills/ppt-master/references/`, and `docs/` are currently single-language per directory. New files mirror the language of their siblings; do not mix English scaffolding with Chinese paragraphs (or vice versa) inside one file. Chat replies are unaffected. |
| 34 | |
| 35 | ## Compatibility Boundary |
| 36 | |
| 37 | - This repository is a workflow/skill package, not an app or service scaffold. |
| 38 | - Do NOT assume generic-project conventions like `.worktrees/`, `tests/`, or mandatory branch setup unless the user explicitly requests them. |
| 39 | - On conflict with a generic coding skill, prioritize [`skills/ppt-master/SKILL.md`](skills/ppt-master/SKILL.md) inside this repository. |
| 40 | |
| 41 | ## Command Quick Reference |
| 42 | |
| 43 | Convenience summary only — route selection starts in [`SKILL.md`](skills/ppt-master/SKILL.md); Beautify uses [`quick-generate.md`](skills/ppt-master/workflows/profiles/quick-generate.md) only when Quick is explicit, otherwise [`generate-pptx.md`](skills/ppt-master/workflows/generate-pptx.md). |
| 44 | |
| 45 | ```bash |
| 46 | # Source content conversion |
| 47 | python3 skills/ppt-master/scripts/source_to_md.py <file_or_URL_or_dir> [<file_or_URL_or_dir> ...] |
| 48 | |
| 49 | # Project management |
| 50 | python3 skills/ppt-master/scripts/project_manager.py init <project_name> --format ppt169 |
| 51 | python3 skills/ppt-master/scripts/project_manager.py import-sources <project_path> <source_files_or_dirs_or_URLs...> |
| 52 | python3 skills/ppt-master/scripts/project_manager.py scaffold-spec <project_path> # optional manual helper |
| 53 | python3 skills/ppt-master/scripts/project_manager.py scaffold-lock <project_path> # optional manual helper |
| 54 | python3 skills/ppt-master/scripts/project_manager.py validate <project_path> |
| 55 | |
| 56 | # Icon selection — copy chosen library icons into <project>/icons/ (missing names reported + non-zero = re-pick) |
| 57 | python3 skills/ppt-master/scripts/icon_sync.py <project_path> <lib/name> [<lib/name>...] |
| 58 | |
| 59 | python3 skills/ppt-master/scripts/confirm_ui/server.py <project_path> --daemon |
| 60 | python3 skills/ppt-master/scripts/confirm_ui/server.py <project_path> --wait-only --wait-stage stage1 |
| 61 | |
| 62 | # Image tools and SVG quality check |
| 63 | python3 skills/ppt-master/scripts/analyze_images.py <project_path>/images |
| 64 | # Formula rendering — manifest written by Default Strategist after confirmation or by the Quick main agent during resource preparation: |
| 65 | python3 skills/ppt-master/scripts/latex_render.py <project_path> |
| 66 | python3 skills/ppt-master/scripts/latex_render.py <project_path> --dry-run |
| 67 | python3 skills/ppt-master/scripts/latex_render.py <project_path> --providers codecogs,quicklatex,mathpad,wikimedia |
| 68 | # In-pipeline AI image generation — manifest mode (required, even for 1 image): |
| 69 | python3 skills/ppt-master/scripts/image_gen.py --manifest <project_path>/images/image_prompts.json |
| 70 | python3 skills/ppt-master/scripts/image_gen.py --render-md <project_path>/images/image_prompts.json |
| 71 | # Out-of-pipeline one-off / debug / single-image fixup only (no manifest, no sidecar): |
| 72 | python3 skills/ppt-master/scripts/image_gen.py "prompt" --aspect_ratio 16:9 --image_size 1K -o <project_path>/images |
| 73 | # Spot illustrations — slice one AI grid sheet into individual elements (see image-generator.md §4.3): |
| 74 | python3 skills/ppt-master/scripts/slice_images.py <project_path>/images/<sheet>.png --grid RxC --names a,b,c --trim --alpha |
| 75 | python3 skills/ppt-master/scripts/svg_editor/server.py <project_path> --live --daemon |
| 76 | python3 skills/ppt-master/scripts/svg_quality_checker.py <project_path> |
| 77 | # Shared create-template coordinate compaction before template validation |
| 78 | python3 skills/ppt-master/scripts/compact_svg_coordinates.py "<template_workspace>/templates" --inplace --keep-native-frames |
| 79 | # Explicit create-template normalization: selected complex <g> -> one SVG picture asset / <image> |
| 80 | python3 skills/ppt-master/scripts/extract_svg_pictures.py "<svg_file>" --select "<group_id>" --resource-root "<workspace>" --images-dir "<workspace>/picture-assets" --inplace |
| 81 | # Type A create-template mirror: validated authoring IR -> deterministic structured template workspace |
| 82 | python3 skills/ppt-master/scripts/mirror_template_materialize.py "<import_workspace>" "<empty_template_workspace>" |
| 83 | # create-template review deck (workspace root may be global or project-scoped) |
| 84 | python3 skills/ppt-master/scripts/template_preview_pptx.py <template_workspace> |
| 85 | python3 skills/ppt-master/scripts/animation_config.py scaffold <project_path> # optional, only for custom object-level animation |
| 86 | python3 skills/ppt-master/scripts/animation_config.py validate <project_path> # optional, before re-export |
| 87 | |
| 88 | # Existing PPTX native enhancement workflow — direct OOXML patch, no SVG conversion |
| 89 | python3 skills/ppt-master/scripts/native_enhance_pptx.py init <PPTX_file> --name <project_slug> |
| 90 | python3 skills/ppt-master/scripts/native_enhance_pptx.py validate <project_path> |
| 91 | python3 skills/ppt-master/scripts/native_enhance_pptx.py apply <project_path> |
| 92 | ``` |
| 93 | |
| 94 | For serial post-processing and export, follow [`generate-pptx.md`](skills/ppt-master/workflows/generate-pptx.md) Step 7 exactly. See [`svg-pipeline.md`](skills/ppt-master/scripts/docs/svg-pipeline.md) for tool flags and behavior. |
| 95 | |
| 96 | ## Core Directories |
| 97 | |
| 98 | - `skills/ppt-master/SKILL.md` — global discipline and route-entry authority. |
| 99 | - `skills/ppt-master/workflows/generate-pptx.md` — Generate PPTX Step 1–7 authority. |
| 100 | - `skills/ppt-master/references/` — role cores plus conditionally loaded role and technical modules. |
| 101 | - `skills/ppt-master/scripts/` — runnable tool scripts. |
| 102 | - `skills/ppt-master/scripts/docs/` — topic-focused script docs. |
| 103 | - `skills/ppt-master/templates/` — layout templates, chart templates, icon library, brand presets. |
| 104 | - `skills/ppt-master/workflows/` — top-level route authorities plus supporting child workflows, profiles, stages, and governance runbooks. |
| 105 | - `docs/` — user-facing documentation (FAQ, installation, technical design, templates guide, audio narration). |
| 106 | - `docs/rules/` — repo-wide style rules. |
| 107 | - `examples/` — example projects. |
| 108 | - `projects/` — user project workspace. |
| 109 |