$npx -y skills add CxyZyr/PPTX-Template-Skills --skill ppt-template-adaptationUse to generate or debug a new deck from an existing PPTX template and a parsed spec.json. Enforces the second half of the parse→generate pipeline: select pages, build one global outline, author content_plan.json, fill text while preserving parsed template style, replace icons/lo
| 1 | # PPT Template Adaptation |
| 2 | |
| 3 | Use this skill when the task is to rewrite an existing PPT template into a new deck while preserving the |
| 4 | template's visual logic. It consumes `spec.json` from `pptx-template-parsing`; do not start from a failed |
| 5 | generated deck or manually inferred shape indices. |
| 6 | |
| 7 | This skill is intentionally self-contained. Do not read old external handbooks from previous projects. |
| 8 | |
| 9 | ## What this skill enforces |
| 10 | |
| 11 | - Parse first, generate second. If a slot, card count, or style is missing, fix parsing before adding |
| 12 | generation fallback logic. |
| 13 | - Work page by page. Incremental runs keep original slide indices stable until the final full build. |
| 14 | - Keep one global outline as the source of truth for contents pages, section dividers, and section titles. |
| 15 | - Fill text before icons, logo, and images. |
| 16 | - Preserve parsed template style: geometry, alignment, theme colors, paragraph/run structure, and number |
| 17 | badges unless the user asks for redesign. |
| 18 | - Replace icons and images only when semantics require it and a valid slot exists. |
| 19 | - Validate each page before moving on. |
| 20 | |
| 21 | ## Inputs |
| 22 | |
| 23 | - Original template `.pptx`. |
| 24 | - Parsed `spec.json` from `pptx-template-parsing`. |
| 25 | - A `content_plan.json` with `spec`, `output`, `asset_dir`, optional `brand`, `keep_slides`, optional |
| 26 | `outline`, and `pages[]`. |
| 27 | |
| 28 | ## Required workflow |
| 29 | |
| 30 | 1. If no current `spec.json` exists, run `pptx-template-parsing` first. |
| 31 | 2. Read the parser `summary.txt`; choose template slides whose roles and slot counts match the needed |
| 32 | story. Avoid chart/table slides unless chart/table data will be supplied. |
| 33 | 3. Scaffold a plan: |
| 34 | |
| 35 | ```bash |
| 36 | python3 skills/ppt-template-adaptation/scripts/scaffold_content_plan.py \ |
| 37 | --spec workspace/specs/<template>/spec.json \ |
| 38 | --out workspace/plans/<deck>.content_plan.json \ |
| 39 | --output-pptx workspace/out/<deck>.pptx |
| 40 | ``` |
| 41 | |
| 42 | 4. Edit `keep_slides`, `outline`, and `pages[]`. Map each page to existing slots only: titles to |
| 43 | `title`, free labels to `labels[]`, body boxes to `body[]`, repeated structures to `cards[]`, |
| 44 | semantic glyphs to `cards[].icon`, and photos/screenshots to `images[]`. |
| 45 | 5. Validate global text coherence: |
| 46 | |
| 47 | ```bash |
| 48 | python3 skills/ppt-template-adaptation/scripts/validate_content_plan.py \ |
| 49 | --plan workspace/plans/<deck>.content_plan.json |
| 50 | ``` |
| 51 | |
| 52 | 6. Fill one or a few original slide indices at a time: |
| 53 | |
| 54 | ```bash |
| 55 | python3 skills/ppt-template-adaptation/scripts/apply_content_plan.py \ |
| 56 | --plan workspace/plans/<deck>.content_plan.json \ |
| 57 | --pages 0,1 \ |
| 58 | --render |
| 59 | ``` |
| 60 | |
| 61 | 7. Review the rendered page when visual review is available. If the user will do visual review, provide |
| 62 | the output files and continue with structural checks; do not use image tools when the user forbids it. |
| 63 | 8. Repeat the page loop until selected pages pass. Then run a full build without `--pages` so unused |
| 64 | slides are dropped according to `keep_slides`. |
| 65 | |
| 66 | ## Debugging order |
| 67 | |
| 68 | 1. Inspect parser output first: `summary.txt`, `spec.json` `fill_plan`, card count, `style.paragraphs`, |
| 69 | font availability, and visual obstacles. |
| 70 | 2. If parsing is wrong, fix `pptx-template-parsing`, rerun parsing, and rebuild the plan or affected |
| 71 | pages. |
| 72 | 3. If parsing is right but generation breaks style or layout, fix `ppt-template-adaptation` application |
| 73 | logic. |
| 74 | 4. Use `--no-clear-unfilled`, `--skip-global-text-check`, or `--skip-image-resolve` only for deliberate |
| 75 | diagnostics. Do not use them to declare a page complete. |
| 76 | |
| 77 | ## Reference read order |
| 78 | |
| 79 | Read only the references needed for the current task: |
| 80 | |
| 81 | - `references/workflow.md` — complete page-by-page workflow and acceptance criteria. |
| 82 | - `references/text-coherence.md` — contents/section outline consistency and text fitting. |
| 83 | - `references/icon-fill.md` — semantic icon replacement rules. |
| 84 | - `references/image-fill.md` — conservative image replacement and Tavily usage. |
| 85 | |
| 86 | ## Example scripts |
| 87 | |
| 88 | - `scripts/scaffold_content_plan.py` |
| 89 | - `scripts/validate_content_plan.py` |
| 90 | - `scripts/apply_content_plan.py` |
| 91 | - `scripts/render_pages.py` |
| 92 | - `scripts/tavily_image_service.py` |
| 93 | |
| 94 | ## Usage rule |
| 95 | |
| 96 | Do not jump to the next page until the current page has passed validation. For visual validation, either |
| 97 | review the render when allowed or hand the render artifact to the user for manual review. |