| 1 | --- |
| 2 | description: Deterministic selection among PPT Master's four top-level artifact routes. |
| 3 | --- |
| 4 | |
| 5 | # Routing Rules |
| 6 | |
| 7 | Route selection authority for PPT Master. Select exactly one top-level route, then activate only the child workflows, profiles, and stages owned by that route. |
| 8 | |
| 9 | **Hard rule**: If this file conflicts with a route summary elsewhere in the |
| 10 | Skill package or in a repository-level user-facing document, this file wins for |
| 11 | route selection. After selection, the active runtime authority owns execution. |
| 12 | |
| 13 | --- |
| 14 | |
| 15 | ## 1. Routing Discipline |
| 16 | |
| 17 | | Rule | Behavior | |
| 18 | |---|---| |
| 19 | | One artifact lifecycle | Every request enters Generate PPTX, Create Template, Fill Native PPTX, or Enhance Native PPTX | |
| 20 | | Supporting documents are not top-level routes | Create Template child workflows, generation profiles, stages, and governance documents refine the selected route; never offer them as competing top-level routes | |
| 21 | | Missing prerequisite | State the missing prerequisite and stop that route; do not invent an alternative | |
| 22 | | Ambiguous existing-deck request | Ask one discriminator question only when needed: regenerate visible slides, fill native slide shells with new content, or preserve slides and add native behavior? | |
| 23 | | Explicit user override | Honor explicit route instructions only when the route preconditions are satisfied | |
| 24 | |
| 25 | **Forbidden — route-choice menus**: Do not present multiple implementation paths when the request already matches one row in §2. Ordinary design choices remain at the selected route's existing confirmation gate. |
| 26 | |
| 27 | --- |
| 28 | |
| 29 | ## 2. Top-Level Route Matrix |
| 30 | |
| 31 | | Route | Request shape | Authority | Preconditions | Mutation model | Output contract | |
| 32 | |---|---|---|---|---|---| |
| 33 | | Generate PPTX | Create a new presentation; regenerate an existing deck visually; use source material or a topic; optionally select a registered library template or supply an explicit workspace | Beautify: [`beautify-pptx`](./profiles/beautify-pptx.md), which selects Default or Quick; ordinary Default: [`generate-pptx`](./generate-pptx.md); ordinary explicit Quick: [`quick-generate`](./profiles/quick-generate.md) | Source facts exist or research can gather them; explicit quick intent activates its runtime | Author new SVG pages and export a new PPTX | Default: spec, lock, SVG, validation, and PPTX; Quick: optional source/resource artifacts, no spec/lock, SVG, and one PPTX | |
| 34 | | Create Template | Create a reusable brand/style/layout/deck template from one or more PPTX/SVG files, images/PDFs, direct or file-based text, documents/websites, brand assets, or a mixed reference bundle | [`create-template`](./create-template.md) | A reusable-template request exists; reference material is optional, and project scope additionally requires an initialized target project | Author a new portable workspace; never modify any reference file in place | Workspace with required `templates/`, optional `images/` / `icons/`, and optional review `exports/` | |
| 35 | | Fill Native PPTX | Use a raw PPTX's native slide shells and replace/fill content | [`template-fill-pptx`](./template-fill-pptx.md) | Source PPTX plus new material/topic | Clone and patch PPTX through OOXML; no SVG pipeline | New filled PPTX in project `exports/` | |
| 36 | | Enhance Native PPTX | Keep a finished PPTX's visible slides stable while adding notes, audio, timings, or transitions | [`native-enhance-pptx`](./native-enhance-pptx.md) | Finished source PPTX exists | Append/update scoped OOXML parts; no slide regeneration | New enhanced PPTX in project `exports/` | |
| 37 | |
| 38 | --- |
| 39 | |
| 40 | ## 3. Generate PPTX Profiles and Stages |
| 41 | |
| 42 | | Request condition | Generate-route behavior | |
| 43 | |---|---| |
| 44 | | Existing PPTX must preserve wording, page count, and page order 1:1 | Activate [`beautify-pptx`](./profiles/beautify-pptx.md); it selects `quick-generate` when that profile's explicit trigger also matches, otherwise `generate-pptx` | |
| 45 | | Explicit quick/fast, skip-strategy, or direct SVG-to-PPTX intent without Beautify | Load [`quick-generate`](./profiles/quick-generate.md) directly without loading `generate-pptx.md`: prepare sources/resources as needed, let the current agent decide without interaction, directly apply at most one exact workspace root per kind supplied for this run, otherwise use free design, omit Strategist/Confirm UI/spec/lock, hand-author SVG, run the lockless final checker, and export the final PPTX | |
| 46 | | Topic only, or supplied sources leave planning-critical factual gaps | Run [`topic-research`](./stages/topic-research.md) inside the selected Generate profile's source preparation: immediately for topic-only input, or after conversion and reading for source-backed input; research only the identified gaps | |
| 47 | | Existing PPTX may be split, merged, dropped, reordered, or re-outlined | Treat the PPTX as source content through the selected Generate authority's source intake; continue the default pipeline unless explicit Quick Generate intent selected that profile | |
| 48 | | Default Generate reaches planning | Step 3 prepares template candidates without interaction. Stage 1 then confirms the communication contract and free-design/template choice together; only a confirmed non-free choice runs [`apply-template-workspace`](./stages/apply-template-workspace.md) before Stage 2 | |
| 49 | | Explicit current brand/style/layout/deck workspace root | Default Generate preserves the exact path as a Stage-1 template candidate; Quick Generate validates and installs it directly without Steps 3–4 or Confirm UI. Classify it as `library` only when its normalized root exactly matches a registered index entry; otherwise retain `explicit`. Consume the workspace root, never only its inner `templates/` directory | |
| 50 | | Split-mode project resumes in a fresh chat | Run [`resume-execute`](./stages/resume-execute.md) inside the active Generate route | |
| 51 | | Existing generated project needs a deck-wide `colors.*` or universal `typography.font_family` substitution | Stay in Generate; load [`update_spec.py`](../scripts/docs/update_spec.md), honor its supported-key boundary, then rerun the final quality gate and Step 7 export | |
| 52 | | User explicitly requests spec refinement | Run [`refine-spec`](./stages/refine-spec.md) after Design Spec Gate 1 and before lock Gate 2 | |
| 53 | | Data charts exist | Run [`verify-charts`](./stages/verify-charts.md) before export | |
| 54 | | User explicitly requests visual review | Run [`visual-review`](./stages/visual-review.md) before post-processing | |
| 55 | | User requests preview, selection, or annotation application | Use the default Generate pipeline and run [`live-preview`](./stages/live-preview.md) at the stage defined there; explicit Quick + preview intent falls back to default rather than dropping preview | |
| 56 | | User requests page transitions, auto-advance, or deck-wide animation settings without page-specific motion planning or an existing `animations.json` | Load [`animations`](../references/animations.md) and apply its export-level contract | |
| 57 | | `<project_path>/animations.json` already exists, the user explicitly requests per-slide/object-level animation control, or the effective Custom Animations outcome in `design_spec.md §I` is enabled | Run [`customize-animations`](./stages/customize-animations.md) after the final SVG quality gate and any enabled speaker-note pass, before Generate Step 7. A §IX `Motion suggestion` informs an active pass but never triggers it alone | |
| 58 | | Generate PPTX receives an explicit narration request or has effective Narration Audio enabled in `design_spec.md §I`; Enhance Native PPTX has a confirmed `audio.enabled: true` module | Run [`generate-audio`](./stages/generate-audio.md) after the owning route's notes/export readiness; Generate audio implies effective Speaker Notes enabled | |
| 59 | |
| 60 | **Hard rule — profile, not fifth route**: Beautify changes content/page |
| 61 | invariants, then selects one existing Generate runtime: explicit Quick intent |
| 62 | uses Quick; otherwise it uses Default. It does not define a separate artifact |
| 63 | lifecycle or load both runtimes. |
| 64 | |
| 65 | **Hard rule — direct-generation profile, not a fifth route**: `quick-generate` |
| 66 | stays inside Generate PPTX but owns an explicit SVG → PPTX short circuit. Page |
| 67 | count alone never activates or blocks it. Conversion, bounded research, and |
| 68 | project-local resources remain available. Package capabilities may be requested |
| 69 | or agent-selected. Quick may consume exact Brand/Style/Layout/Deck workspaces as |
| 70 | flat authoring inputs; compiling reusable Master/Layout/placeholder structure |
| 71 | still requires the default lock-backed Generate pipeline. Once selected, Quick |
| 72 | is the complete runtime procedure and never loads `generate-pptx.md`; Default |
| 73 | never loads `quick-generate.md`. Beautify may select either one, but not both. |
| 74 | |
| 75 | --- |
| 76 | |
| 77 | ## 4. Template and Master/Layout Boundary |
| 78 | |
| 79 | **Hard rule — no direct structure grafting**: An existing PPTX or SVG is never upgraded in place by adding Master/Layout/placeholder structure. If reusable native structure is required: |
| 80 | |
| 81 | 1. Run [`create-template`](./create-template.md) to produce a separate validated workspace. |
| 82 | 2. Pass that workspace root to [`generate-pptx`](./generate-pptx.md) as a Stage-1 template candidate. |
| 83 | 3. Author new structured SVG pages whose Master/Layout contract exists from their first generated draft. |
| 84 | 4. Export a new PPTX from those pages. |
| 85 | |
| 86 | When a PPTX already contains native Master/Layout parts, `create-template` mirror may read and preserve those existing package facts in the new workspace. It does not infer missing historical intent. An incomplete or legacy SVG package may guide `standard` / `fidelity` visually, but it is not mutated into a structured template and cannot claim source-topology recovery. |
| 87 | |
| 88 | **Hard rule — no automatic structure upgrade**: Free-design, brand-only, and style-only generation remains `pptx_structure.mode: flat`. Repeated Slide-local objects never trigger `structured`, Master/Layout promotion, placeholder inference, or deduplication. The minimal Master plus Blank Layout emitted by flat export is package scaffolding, not an inferred reusable design master. |
| 89 | |
| 90 | | Input | Route behavior | |
| 91 | |---|---| |
| 92 | | Raw PPTX called a template + new content | Fill Native PPTX unless the user explicitly asks for a reusable template workspace | |
| 93 | | Any supported reference bundle or direct-text brief + reusable template request | Create Template | |
| 94 | | Current template workspace root + content | [`generate-pptx`](./generate-pptx.md) Stage-1 template choice | |
| 95 | | Legacy-flat Brand/Layout/Deck root satisfying its current kind contract; Layout/Deck also require current structured SVGs | [`apply-template-workspace`](./stages/apply-template-workspace.md) compatibility reader; Style has no flat form | |
| 96 | | Semantic-legacy or incomplete structured package | Create a new workspace through Create Template; do not migrate in place | |
| 97 | | Request to add a master directly to an existing PPTX/SVG | Unsupported; explain the Create Template → Generate PPTX lifecycle | |
| 98 | |
| 99 | --- |
| 100 | |
| 101 | ## 5. Create Template Child Workflows |
| 102 | |
| 103 | | Selected kind | Behavior | |
| 104 | |---|---| |
| 105 | | `brand` | Dispatch to [`create-brand`](./create-template/create-brand.md); write identity only and no SVG roster | |
| 106 | | `style` | Dispatch to [`create-style`](./create-template/create-style.md); write reusable communication method and design direction only, with no SVG roster or native structure | |
| 107 | | `layout` | Dispatch to [`create-layout`](./create-template/create-layout.md); author brand-neutral, application-neutral structure and an SVG roster | |
| 108 | | `deck` | Dispatch to [`create-deck`](./create-template/create-deck.md); author descriptive recurring-application context with integrated identity, structure, and an SVG roster | |
| 109 | |
| 110 | Create Template remains the fixed route name and owns the shared contract. These four documents are mutually exclusive child workflows, not additional top-level routes. |
| 111 | |
| 112 | **Hard rule — classify reusable rules, not source completeness**: A complete |
| 113 | PPTX does not automatically select Deck. Use Brand when only identity is |
| 114 | stable; use Style when reusable communication method and design direction |
| 115 | should travel without identity truth, page prototypes, or native |
| 116 | structure; use Layout when structure is brand-neutral and the communication |
| 117 | application stays downstream-defined; use Deck when structure carries identity |
| 118 | or reusable scenario/content semantics. |
| 119 | |
| 120 | --- |
| 121 | |
| 122 | ## 6. Native and Shared Post-Processing Boundary |
| 123 | |
| 124 | | Artifact state | Narration route | |
| 125 | |---|---| |
| 126 | | Main-generated project with notes and exported deck | Shared [`generate-audio`](./stages/generate-audio.md) stage | |
| 127 | | Arbitrary finished PPTX that must preserve visible slides | Enhance Native PPTX; its narration module invokes the same shared audio-stage rules | |
| 128 | |
| 129 | Object animation for generated SVG projects uses the animation stage. Native PPTX routes preserve existing object-animation fingerprints and do not silently claim an animation-editing capability. |
| 130 | |
| 131 | --- |
| 132 | |
| 133 | ## 7. Template Selection Boundary |
| 134 | |
| 135 | | User input | Behavior | |
| 136 | |---|---| |
| 137 | | Default Generate | Step 3 prepares candidates only; Stage 1 confirms one communication contract plus either free design or template use in the same interaction | |
| 138 | | Explicit current workspace root containing `templates/design_spec.md` | Preserve it as a Stage-1 candidate and initialize template mode; preselect that specific candidate only when it is the sole supplied root. An exact registered-root match may be displayed as `library` | |
| 139 | | No exact workspace root and no explicit template intent | Initialize Stage 1 to free design; the user may switch to template mode and select an indexed workspace | |
| 140 | | Explicit template intent or any exact workspace root | Initialize Stage 1 to template mode; exactly one root may be preselected, while multiple roots remain unselected candidates | |
| 141 | | Bare template/brand name or style label without an explicit template-use request | Do not resolve it to a local path or preselect a template; treat it as a style brief. An explicit request to use templates still initializes template mode, but leaves the specific candidate for the user to choose | |
| 142 | | “What templates exist?” in chat | List indexed workspace paths; Stage 1 still requires an explicit free-design/template choice | |
| 143 | |
| 144 | The default UI and chat discovery read only these indexes. Never scan the |
| 145 | corresponding directories to construct or supplement the catalog: |
| 146 | |
| 147 | | Kind | Discovery index | |
| 148 | |---|---| |
| 149 | | Brand | [`brands_index.json`](../templates/brands/brands_index.json) | |
| 150 | | Style | [`styles_index.json`](../templates/styles/styles_index.json) | |
| 151 | | Layout | [`layouts_index.json`](../templates/layouts/layouts_index.json) | |
| 152 | | Deck | [`decks_index.json`](../templates/decks/decks_index.json) | |
| 153 | |
| 154 | **Hard rule — one Stage-1 confirmation, delayed template reading**: Author the |
| 155 | communication recommendation without reading candidate workspaces. Stage 1 |
| 156 | confirms that contract and the template/free-design choice together. Only then |
| 157 | validate/install selected roots and complete the handoff. Stage 2 waits for that |
| 158 | handoff, reads only the installed project-local state, and decides how to apply |
| 159 | it; it never reselects a template. |
| 160 | |
| 161 | **Forbidden — fuzzy resolution**: Never resolve a bare name to a local template |
| 162 | directory on the user's behalf. A library choice comes from an index-derived |
| 163 | root; an unregistered workspace requires an explicit root, including the exact |
| 164 | validated workspace handed off by Create Template in the current conversation. |
| 165 |