@hfyjq/crannia 1.1.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -201
- package/NOTICE +48 -45
- package/README.md +1 -1
- package/THIRD-PARTY-FRONTEND.md +5266 -5266
- package/THIRD-PARTY-PYTHON-linux.md +174 -0
- package/THIRD-PARTY-PYTHON.md +176 -162
- package/THIRD-PARTY.md +323 -316
- package/apps/desktop/quotes.txt +56 -56
- package/bus/core.py +677 -671
- package/bus/loaders/channel_loader.py +64 -64
- package/bus/loaders/provider_loader.py +4 -7
- package/bus/loaders/skill_loader.py +46 -27
- package/bus/loaders/skill_md.py +9 -9
- package/bus/mcp_disabled.py +4 -6
- package/bus/quarantine.py +10 -13
- package/bus/registry.py +2315 -2284
- package/bus/skill_state.py +124 -124
- package/channels/cli_channel/handler.py +3 -3
- package/channels/cli_channel/manifest.yaml +5 -5
- package/channels/dingtalk_channel/handler.py +32 -32
- package/channels/dingtalk_channel/manifest.yaml +12 -12
- package/channels/feishu_channel/handler.py +33 -33
- package/channels/feishu_channel/manifest.yaml +12 -12
- package/channels/qq_bot_channel/__init__.py +1 -1
- package/channels/qq_bot_channel/handler.py +24 -24
- package/channels/qq_bot_channel/manifest.yaml +4 -4
- package/channels/telegram_channel/__init__.py +1 -1
- package/channels/telegram_channel/handler.py +21 -21
- package/channels/telegram_channel/manifest.yaml +4 -4
- package/channels/telegram_channel/media.py +231 -231
- package/channels/textfmt.py +58 -58
- package/channels/wechat_channel/__init__.py +1 -1
- package/channels/wechat_channel/converter.py +1 -1
- package/channels/wechat_channel/handler.py +8 -8
- package/channels/wechat_channel/manifest.yaml +5 -5
- package/channels/wechat_channel/media.py +178 -178
- package/core/activity.py +753 -709
- package/core/agent_loop.py +7673 -7522
- package/core/allowlist.py +2 -3
- package/core/approval.py +34 -24
- package/core/approval_timeout.py +256 -228
- package/core/artifacts.py +3 -3
- package/core/attachment_gc.py +21 -0
- package/core/auto_review.py +2 -2
- package/core/browser/cdp.py +5 -2
- package/core/browser/discover.py +55 -19
- package/core/browser/session.py +4 -4
- package/core/cache_break_detector.py +97 -0
- package/core/cache_breakpoints.py +103 -0
- package/core/cache_policies.py +255 -0
- package/core/cancellation.py +3 -3
- package/core/channel_configs.py +3 -3
- package/core/channel_turns.py +13 -13
- package/core/child_approval.py +2 -3
- package/core/code_intel.py +11 -11
- package/core/command_policy.py +13 -7
- package/core/computer/annotate.py +231 -11
- package/core/computer/capture.py +140 -1
- package/core/computer/guard.py +7 -4
- package/core/computer/input.py +452 -26
- package/core/computer/session.py +563 -381
- package/core/computer/tools.py +2170 -928
- package/core/computer/uia.py +100 -1
- package/core/computer/watch.py +1 -1
- package/core/computer/win32.py +302 -7
- package/core/config_requirements.py +205 -205
- package/core/cron/runner.py +4 -4
- package/core/daily_log.py +2 -2
- package/core/dedup.py +2 -2
- package/core/egress_channels.py +326 -0
- package/core/egress_gate.py +96 -8
- package/core/egress_preapproved.py +59 -3
- package/core/endpoint.py +141 -141
- package/core/events.py +17 -8
- package/core/extension.py +2 -2
- package/core/file_history.py +10 -10
- package/core/file_tools.py +3 -3
- package/core/github_config.py +1 -1
- package/core/group_digest.py +3 -4
- package/core/group_minutes.py +5 -5
- package/core/group_reply.py +24 -0
- package/core/groups.py +5 -9
- package/core/hooks.py +15 -15
- package/core/i18n.py +2 -2
- package/core/ice/canary.py +3 -3
- package/core/ice/net_heuristics.py +2 -2
- package/core/im_routing.py +2 -2
- package/core/image_input.py +183 -43
- package/core/inbound.py +3 -3
- package/core/jobs.py +6 -6
- package/core/last_good.py +150 -150
- package/core/leaf_md.py +3 -3
- package/core/llm_errors.py +36 -27
- package/core/mail_config.py +2 -2
- package/core/memory/compressor.py +8 -8
- package/core/memory/manager.py +30 -45
- package/core/memory/session_memory.py +1 -2
- package/core/memory/short_term.py +4 -4
- package/core/memory_extract.py +1 -1
- package/core/memory_organize.py +8 -8
- package/core/memory_store.py +7 -9
- package/core/memory_transfer.py +2 -2
- package/core/model_capabilities.py +2 -2
- package/core/model_configs.py +219 -68
- package/core/model_profiles.py +333 -0
- package/core/modes.py +12 -11
- package/core/net_proxy.py +3 -3
- package/core/pipeline/scheduler.py +48 -43
- package/core/pipeline/stage.py +3 -0
- package/core/pipeline/stages/agent_loop.py +36 -15
- package/core/pipeline/stages/group_reply.py +22 -20
- package/core/pipeline/stages/post_process.py +7 -7
- package/core/pipeline/stages/pre_process.py +360 -68
- package/core/prompt_assembler.py +13 -4
- package/core/recycle.py +227 -16
- package/core/response_language.py +1 -1
- package/core/retention.py +2 -2
- package/core/rg.py +4 -3
- package/core/security.py +26 -8
- package/core/services.py +8 -8
- package/core/session_model.py +3 -5
- package/core/session_pool.py +35 -5
- package/core/session_recap.py +40 -3
- package/core/session_workspace.py +2 -3
- package/core/settings_baseline.py +2 -2
- package/core/settings_transfer.py +25 -1
- package/core/shell.py +52 -20
- package/core/side_call.py +3 -3
- package/core/skill_config.py +164 -0
- package/core/skill_factory.py +2 -2
- package/core/skill_guidance.py +2 -4
- package/core/skill_index.py +3 -4
- package/core/skill_settings.py +1 -1
- package/core/skill_sources.py +7 -7
- package/core/ssh_config.py +129 -0
- package/core/state_registry.py +67 -5
- package/core/subagent.py +28 -5
- package/core/subagent_defs.py +3 -3
- package/core/summarizer.py +4 -5
- package/core/tasks_notify.py +6 -6
- package/core/tiers.py +2 -2
- package/core/todos.py +1 -1
- package/core/token_calibrator.py +1 -4
- package/core/tool_outcome.py +108 -108
- package/core/touched_files.py +1 -1
- package/core/trace.py +12 -3
- package/core/unlock.py +4 -4
- package/core/update_tui.py +184 -158
- package/core/updater.py +5 -3
- package/core/version.py +14 -14
- package/core/vision_budget.py +235 -0
- package/core/web_cache.py +152 -152
- package/core/web_request.py +474 -0
- package/core/window_estimate.py +1 -1
- package/core/workspace.py +56 -26
- package/crannia_tray.py +278 -278
- package/licenses/GPL-3.0.txt +619 -619
- package/licenses/LGPL-2.1.txt +502 -502
- package/licenses/LGPL-3.0.txt +165 -165
- package/licenses/MIT-chat-on-wechat.txt +18 -18
- package/licenses/MIT-deepseek-harness.txt +21 -21
- package/licenses/Molio-LICENSE.txt +44 -44
- package/locales/en.json +1876 -1755
- package/main.py +154 -154
- package/mcpx/client.py +12 -1
- package/mcpx/manager.py +530 -522
- package/mcpx/servers/web_search.py +5 -13
- package/package.json +15 -23
- package/providers/anthropic/client.py +35 -33
- package/providers/base.py +13 -13
- package/providers/cache_policies.json +294 -0
- package/providers/cost_table.json +3779 -3779
- package/providers/lmstudio/client.py +2 -2
- package/providers/model_capabilities.json +6665 -6665
- package/providers/model_profiles.json +629 -0
- package/providers/ollama/client.py +2 -2
- package/providers/openai_compat.py +37 -16
- package/providers/openrouter/client.py +2 -2
- package/providers/qwen/__init__.py +1 -1
- package/providers/qwen/client.py +2 -2
- package/providers/qwen/manifest.yaml +16 -16
- package/providers/rate_limiter.py +2 -2
- package/providers/siliconflow/client.py +2 -2
- package/providers/validation.py +171 -171
- package/providers/vision_profiles.json +89 -0
- package/providers/window_table.json +8909 -8909
- package/requirements.txt +59 -51
- package/sbom-linux-x64.json +4580 -0
- package/sbom.json +4600 -4413
- package/skills/diagram/SKILL.md +47 -0
- package/skills/diagram/__init__.py +1 -0
- package/skills/diagram/handler.py +294 -0
- package/skills/diagram/layout.py +174 -0
- package/skills/diagram/manifest.yaml +106 -0
- package/skills/diagram/mermaid.py +170 -0
- package/skills/diagram/svg.py +223 -0
- package/skills/entertainment/SKILL.md +35 -35
- package/skills/entertainment/__init__.py +1 -1
- package/skills/entertainment/handler.py +91 -91
- package/skills/entertainment/manifest.yaml +26 -26
- package/skills/file_parser/GUIDANCE.md +10 -10
- package/skills/file_parser/handler.py +33 -11
- package/skills/github/SKILL.md +32 -32
- package/skills/github/__init__.py +1 -1
- package/skills/mail_parser/SKILL.md +68 -68
- package/skills/mail_parser/__init__.py +1 -1
- package/skills/mail_parser/handler.py +1 -1
- package/skills/media_gen/GUIDANCE.md +19 -19
- package/skills/media_gen/SKILL.md +43 -43
- package/skills/media_gen/__init__.py +1 -1
- package/skills/media_gen/handler.py +1 -1
- package/skills/media_gen/manifest.yaml +93 -93
- package/skills/netops/SKILL.md +45 -0
- package/skills/netops/__init__.py +1 -0
- package/skills/netops/handler.py +418 -0
- package/skills/netops/manifest.yaml +118 -0
- package/skills/office_parser/_excel_io.py +3 -3
- package/skills/office_parser/handler.py +2 -2
- package/skills/office_parser/ppt_tools.py +1 -1
- package/skills/office_parser/pptx_export/console_encoding.py +27 -27
- package/skills/office_parser/pptx_export/resource_paths.py +88 -88
- package/skills/office_parser/pptx_export/svg_finalize/__init__.py +12 -12
- package/skills/office_parser/pptx_export/svg_finalize/crop_images.py +366 -366
- package/skills/office_parser/pptx_export/svg_finalize/embed_images.py +288 -288
- package/skills/office_parser/pptx_export/svg_finalize/fix_image_aspect.py +388 -388
- package/skills/office_parser/pptx_export/svg_finalize/flatten_tspan.py +818 -818
- package/skills/office_parser/pptx_export/svg_finalize/svg_rect_to_path.py +345 -345
- package/skills/office_parser/pptx_export/svg_to_pptx/__init__.py +14 -14
- package/skills/office_parser/pptx_export/svg_to_pptx/drawingml/__init__.py +1 -1
- package/skills/office_parser/pptx_export/svg_to_pptx/drawingml/context.py +186 -186
- package/skills/office_parser/pptx_export/svg_to_pptx/drawingml/converter.py +781 -781
- package/skills/office_parser/pptx_export/svg_to_pptx/drawingml/paths.py +429 -429
- package/skills/office_parser/pptx_export/svg_to_pptx/drawingml/utils.py +40 -21
- package/skills/office_parser/pptx_export/svg_to_pptx/pptx_package/__init__.py +1 -1
- package/skills/office_parser/pptx_export/svg_to_pptx/pptx_package/builder.py +1267 -1267
- package/skills/office_parser/pptx_export/svg_to_pptx/pptx_package/dimensions.py +155 -155
- package/skills/office_parser/pptx_export/svg_to_pptx/pptx_package/discovery.py +101 -101
- package/skills/office_parser/pptx_export/svg_to_pptx/pptx_package/narration.py +236 -236
- package/skills/office_parser/pptx_export/svg_to_pptx/pptx_package/notes.py +257 -257
- package/skills/office_parser/pptx_export/svg_to_pptx/pptx_package/slide_xml.py +136 -136
- package/skills/office_parser/pptx_export/svg_to_pptx/tspan_flattener.py +44 -44
- package/skills/office_parser/pptx_export/svg_to_pptx/use_expander.py +129 -129
- package/skills/office_parser/references/LICENSE-Office-Word-MCP-Server.txt +20 -20
- package/skills/office_parser/references/LICENSE-excel-mcp-server.txt +21 -21
- package/skills/office_parser/references/layout_library.md +816 -816
- package/skills/office_parser/references/ppt-master/LICENSE +21 -21
- package/skills/office_parser/references/ppt-master/references/executor-base.md +474 -474
- package/skills/office_parser/references/ppt-master/references/shared-standards.md +1002 -1002
- package/skills/office_parser/references/ppt-master/references/strategist.md +880 -880
- package/skills/office_parser/references/ppt-master/references/template-designer.md +402 -402
- package/skills/office_parser/references/ppt-master/references/visual-review.md +240 -240
- package/skills/office_parser/references/ppt-master/references/visual-styles/_index.md +106 -106
- package/skills/office_parser/references/ppt-master/references/visual-styles/blueprint.md +37 -37
- package/skills/office_parser/references/ppt-master/references/visual-styles/brutalist.md +38 -38
- package/skills/office_parser/references/ppt-master/references/visual-styles/chalkboard.md +36 -36
- package/skills/office_parser/references/ppt-master/references/visual-styles/dark-tech.md +37 -37
- package/skills/office_parser/references/ppt-master/references/visual-styles/data-journalism.md +36 -36
- package/skills/office_parser/references/ppt-master/references/visual-styles/editorial.md +38 -38
- package/skills/office_parser/references/ppt-master/references/visual-styles/glassmorphism.md +36 -36
- package/skills/office_parser/references/ppt-master/references/visual-styles/ink-notes.md +37 -37
- package/skills/office_parser/references/ppt-master/references/visual-styles/ink-wash.md +36 -36
- package/skills/office_parser/references/ppt-master/references/visual-styles/memphis.md +37 -37
- package/skills/office_parser/references/ppt-master/references/visual-styles/paper-cut.md +36 -36
- package/skills/office_parser/references/ppt-master/references/visual-styles/photo-editorial.md +38 -38
- package/skills/office_parser/references/ppt-master/references/visual-styles/pixel-art.md +36 -36
- package/skills/office_parser/references/ppt-master/references/visual-styles/sketch-notes.md +36 -36
- package/skills/office_parser/references/ppt-master/references/visual-styles/soft-rounded.md +37 -37
- package/skills/office_parser/references/ppt-master/references/visual-styles/swiss-minimal.md +38 -38
- package/skills/office_parser/references/ppt-master/references/visual-styles/vintage-poster.md +36 -36
- package/skills/office_parser/references/ppt-master/references/visual-styles/zine.md +37 -37
- package/skills/office_parser/references/spec_lock.md +235 -235
- package/skills/office_parser/soffice.py +68 -68
- package/skills/office_parser/word_tools.py +3 -3
- package/skills/ssh/SKILL.md +81 -0
- package/skills/ssh/__init__.py +1 -0
- package/skills/ssh/handler.py +609 -0
- package/skills/ssh/manifest.yaml +182 -0
- package/tui/crannia.cmd +134 -134
- package/tui/crannia.sh +82 -0
- package/tui/crannia_tui/__init__.py +1 -1
- package/tui/crannia_tui/app.py +240 -17
- package/tui/crannia_tui/app.tcss +21 -0
- package/tui/crannia_tui/clipboard.py +78 -10
- package/tui/crannia_tui/commands.py +37 -0
- package/tui/crannia_tui/events.py +6 -0
- package/tui/crannia_tui/i18n.py +164 -164
- package/tui/crannia_tui/locales/en.json +31 -6
- package/tui/crannia_tui/paths.py +4 -1
- package/tui/crannia_tui/profile.py +178 -169
- package/tui/crannia_tui/settings.py +134 -134
- package/tui/crannia_tui/setup.py +44 -5
- package/tui/crannia_tui/ui.py +156 -16
- package/tui/crannia_tui/update.py +393 -389
- package/vendor/ripgrep/COPYING.txt +3 -3
- package/vendor/ripgrep/LICENSE-MIT.txt +21 -21
- package/vendor/ripgrep/NOTICE-vscode-ripgrep.txt +13 -13
- package/vendor/ripgrep/README.md +30 -14
- package/vendor/ripgrep/UNLICENSE.txt +24 -24
- package/vendor/ripgrep/linux-x64/rg +0 -0
- package/vendor/ripgrep/package-source.json +15 -16
- package/web/__main__.py +12 -15
- package/web/server.py +8481 -8594
- package/web/static/img/channel-telegram.svg +1 -1
- package/web/static/img/channel-wechat.svg +1 -1
- package/web/templates/logs.html +49 -49
- package/web/templates/models.html +46 -46
|
@@ -1,402 +1,402 @@
|
|
|
1
|
-
> See shared-standards.md for common technical constraints.
|
|
2
|
-
|
|
3
|
-
# Template Designer — Template Design Role
|
|
4
|
-
|
|
5
|
-
## Core Mission
|
|
6
|
-
|
|
7
|
-
Generate reusable page templates for the **global template library** based on a finalized template brief, and write a concise `design_spec.md` that captures the source-derived basic norms that make the template reusable.
|
|
8
|
-
|
|
9
|
-
> This is a standalone role: only triggered via the `/create-template` workflow. It is **not** the project-level template selection/customization step in the main PPT generation pipeline.
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
- **Trigger**: `/create-template` workflow
|
|
14
|
-
- **Output location**: `templates/<kind_dir>/<template_name>/` where `<kind_dir>` is `decks` (default — full-PPT replica with identity) or `layouts` (structure-only, no identity segment)
|
|
15
|
-
- **Input**: finalized template brief (template ID, display name, kind, applicable scenarios, tone, theme mode, canvas format, optional reference assets, accepted basic template norms)
|
|
16
|
-
|
|
17
|
-
When the workflow provides a PPTX reference source, the effective input package comes from the unified `pptx_template_import.py` preparation workspace and becomes:
|
|
18
|
-
|
|
19
|
-
- finalized template brief
|
|
20
|
-
- `manifest.json` — single source of truth (slide size, theme, per-master themes, assets, asset map, placeholders, layouts, masters, slides, SVG file paths, page-type candidates)
|
|
21
|
-
- `summary.md` — short orientation digest derived from manifest.json
|
|
22
|
-
- exported `assets/`
|
|
23
|
-
- `svg/master_*.svg` / `svg/layout_*.svg` — every master / layout in the deck rendered once as standalone SVG, including ones no sample slide references (template packages often ship more design surfaces than the embedded samples exercise)
|
|
24
|
-
- `svg/slide_NN.svg` — each slide's own shapes and slide-local background only; master / layout decoration and backgrounds are **not** inlined here
|
|
25
|
-
- `svg/inheritance.json` — which layout / master each slide consumes
|
|
26
|
-
- `svg-flat/slide_NN.svg` — companion view; each slide is self-contained so you can preview or screenshot a single page without losing the surrounding chrome. Use it as a sanity check for "what would PowerPoint actually show", not as an authoring source — the master/layout chrome will be duplicated across every flat slide.
|
|
27
|
-
- optional screenshots for visual cross-checking
|
|
28
|
-
|
|
29
|
-
PPTX import interpretation:
|
|
30
|
-
|
|
31
|
-
- Placeholder guides in master / layout SVGs are layout signals. Use `manifest.json` placeholder records for type / index / geometry / base style; do not copy dashed guide boxes into final templates unless the visual design truly uses dashed boxes.
|
|
32
|
-
- Charts, SmartArt, diagrams, and OLE objects may appear as typed placeholders in layered SVGs. In flat SVGs they may show preview images. Treat them as source intent markers, not reusable decorative assets.
|
|
33
|
-
- The asset filenames referenced by SVGs are governed by the manifest asset map. Prefer those references over inventing duplicate asset names.
|
|
34
|
-
|
|
35
|
-
Input priority for PPTX-backed template creation:
|
|
36
|
-
|
|
37
|
-
1. `manifest.json` for all factual metadata (theme, assets, unique layout/master structure, slide reuse, page-type guidance)
|
|
38
|
-
2. `svg/master_*.svg` + `svg/layout_*.svg` — the **primary source for the deck's shared visual language**: backgrounds, page chrome, decorative bars, recurring brand motifs. These are what the new template's fixed structure should adopt or reinterpret. Read these before any slide SVG.
|
|
39
|
-
3. `svg/inheritance.json` for confirming which slide uses which layout / master
|
|
40
|
-
4. exported `assets/` for reusable visual resources
|
|
41
|
-
5. `svg/slide_NN.svg` — each slide's unique content, useful for judging composition rhythm and content density (not for fixed structure)
|
|
42
|
-
6. `summary.md` only as a fast scan; never as the canonical fact source
|
|
43
|
-
7. screenshots / original PPTX only for style verification
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## Page Roster
|
|
48
|
-
|
|
49
|
-
The output page set is determined by **replication mode**, declared in the finalized template brief:
|
|
50
|
-
|
|
51
|
-
| Mode | When to use | Roster |
|
|
52
|
-
|------|-------------|--------|
|
|
53
|
-
| `standard` (default) | Most templates — clean, reusable, balanced coverage | `01_cover`, `02_chapter`, `03_content`, `04_ending`, optional `02_toc` |
|
|
54
|
-
| `fidelity` | User explicitly wants strict replication of a source PPTX, but still wants the AI to clean / cluster / cap variants | Standard roster + one variant per distinct layout cluster found in `manifest.json` |
|
|
55
|
-
| `mirror` | Creation-time harvesting mode: every source slide is preserved 1:1 as a reference page for the template package. Verbatim copy, no abstraction, no placeholders | One SVG per source slide, named `<NNN>_<page_type>.svg` by source order |
|
|
56
|
-
|
|
57
|
-
### Standard mode
|
|
58
|
-
|
|
59
|
-
| # | Filename | Purpose | Description |
|
|
60
|
-
|---|----------|---------|-------------|
|
|
61
|
-
| 01 | `01_cover.svg` | Cover | Fixed structure: title, subtitle, date, organization |
|
|
62
|
-
| 02 | `02_chapter.svg` | Chapter page | Fixed structure: chapter number, chapter title |
|
|
63
|
-
| 03 | `03_content.svg` | Content page | Flexible structure: only defines header/footer; content area freely laid out by AI |
|
|
64
|
-
| 04 | `04_ending.svg` | Ending page | Fixed structure: thank-you message, contact info |
|
|
65
|
-
| -- | `02_toc.svg` | Table of contents | Optional: TOC title, chapter list (number + title) |
|
|
66
|
-
|
|
67
|
-
**Design philosophy**: Templates define visual consistency and structural pages; content pages maintain maximum flexibility.
|
|
68
|
-
|
|
69
|
-
**Naming note**: TOC page keeps `02_toc.svg` naming for template library compatibility and sort order.
|
|
70
|
-
|
|
71
|
-
### Fidelity mode
|
|
72
|
-
|
|
73
|
-
When the brief sets `Replication mode: fidelity`, derive the page roster from `manifest.json` page-type clusters and emit one SVG per distinct visual cluster.
|
|
74
|
-
|
|
75
|
-
**Variant naming**: append a lowercase letter suffix to the parent type's index, preserving sort order:
|
|
76
|
-
|
|
77
|
-
| Parent type | Example variants |
|
|
78
|
-
|-------------|------------------|
|
|
79
|
-
| Chapter | `02a_chapter_full.svg`, `02b_chapter_minimal.svg` |
|
|
80
|
-
| Content | `03a_content_two_col.svg`, `03b_content_data_card.svg`, `03c_content_quote.svg` |
|
|
81
|
-
| Ending | `04a_ending_thanks.svg`, `04b_ending_contact.svg` |
|
|
82
|
-
|
|
83
|
-
Extension page types beyond the canonical four (transition / appendix / disclaimer / divider) take the next free index: `05_section_break.svg`, `06_appendix.svg`, `07_disclaimer.svg`.
|
|
84
|
-
|
|
85
|
-
**Roster decision**:
|
|
86
|
-
|
|
87
|
-
- Cluster slides from `manifest.json` by `pageType` + visual structure (column count, hero-image vs. icon-grid vs. quote, etc.)
|
|
88
|
-
- One SVG per cluster — do **not** emit a variant for a cluster represented by a single source slide unless that slide is structurally distinct from existing variants
|
|
89
|
-
- One variant per visually distinct cluster — let the source's structural diversity drive the count. Collapse only **near-duplicates** (same column count, same hero element, same content density); do not collapse genuine structural differences just to keep the variant count down. If you find yourself wanting one variant per source slide, that is the signal the user should be in `mirror` mode, not `fidelity`
|
|
90
|
-
- Record every emitted page in `design_spec.md §V Page Roster`; the corresponding index entry (`decks_index.json` or `layouts_index.json`) is generated automatically by `register_template.py` from the directory's actual SVG files
|
|
91
|
-
|
|
92
|
-
> Variants reuse the parent type's placeholder set — see §4 (Placeholder Reference) below.
|
|
93
|
-
|
|
94
|
-
### Mirror mode
|
|
95
|
-
|
|
96
|
-
When the brief sets `Replication mode: mirror`, the role does **not** abstract or reconstruct. Each source slide becomes one template page **byte-for-byte**:
|
|
97
|
-
|
|
98
|
-
- Source: `<import_workspace>/svg-flat/slide_NN.svg` (the self-contained "what PowerPoint shows" view). Do **not** read or use `svg/master_*.svg`, `svg/layout_*.svg`, or `svg/inheritance.json` — chrome / content separation is irrelevant because mirror does not insert placeholders.
|
|
99
|
-
- Output: `templates/<kind_dir>/<template_id>/<NNN>_<page_type>.svg`, where `<NNN>` is the zero-padded source slide index (3 digits) and `<page_type>` is derived from `manifest.json` `pageTypeCandidates` — `cover` / `toc` / `chapter` / `content` / `ending`. When the page-type heuristic is ambiguous, fall back to `content`. Preserve source slide order via the numeric prefix.
|
|
100
|
-
- Modifications allowed: **only** rewriting `<image href="...">` paths to point at the local `assets/` copy, and renaming asset files to semantic names. Everything else — geometry, decoration, sprite-sheet wrappers, original example text, chart placeholders, embedded fonts — is copied as-is.
|
|
101
|
-
- Modifications forbidden: inserting `{{TITLE}}` / `{{CONTENT_AREA}}` / any other placeholder; "cleaning up" decorative complexity; merging similar slides; dropping master/layout chrome (it's already baked into the flat SVG, leave it).
|
|
102
|
-
- `design_spec.md` §V Page Roster lists every emitted file with **a one-line description** of what the page contains and what content slot it suits — Strategist selects pages from these descriptions, since the SVG itself carries no placeholder contract.
|
|
103
|
-
|
|
104
|
-
**Mirror consumption boundary**: `mirror` applies only while creating the template package from the source deck. Once created, the package is consumed as an ordinary deck / layout template roster: downstream generation may select, repeat, skip, reorder, or adapt pages according to the new content. The `replication_mode: mirror` field must not force the generated deck to preserve the source page count, source order, or one-output-slide-per-template-slide mapping.
|
|
105
|
-
|
|
106
|
-
**What mirror is not**: a pixel-perfect re-rendering pipeline test. Charts, SmartArt, OLE objects, and EMF / WMF media that fail to round-trip in `pptx_template_import.py` will fail the same way in mirror. If the import workspace has missing media or unsupported objects, mirror inherits those gaps — the user should be told before generation begins.
|
|
107
|
-
|
|
108
|
-
---
|
|
109
|
-
|
|
110
|
-
## Template Design Specifications
|
|
111
|
-
|
|
112
|
-
### 1. Must Generate design_spec.md
|
|
113
|
-
|
|
114
|
-
**Scope rule — personality only.** A template `design_spec.md` describes **what makes this template recognizable**: brand colors, signature decorative motifs, page-by-page visual character, bundled assets. It does **not** restate generic constraints — those live in the canonical references and are already loaded by every downstream role:
|
|
115
|
-
|
|
116
|
-
- SVG technical constraints, PPT compatibility rules → [`shared-standards.md`](shared-standards.md)
|
|
117
|
-
- Generic layout pattern library, spacing bands, font-size ratio bands → [`templates/design_spec_reference.md`](../templates/design_spec_reference.md) (read by Strategist when authoring the **project** design_spec)
|
|
118
|
-
- Canonical placeholder vocabulary → §4 below
|
|
119
|
-
- Content methodology (pyramid / SCQA / MECE) → [`strategist.md`](strategist.md)
|
|
120
|
-
|
|
121
|
-
Re-declaring any of these in a template `design_spec.md` is noise — Strategist already has them in context, and duplication forces every relaxation to sweep N templates instead of one source. **If a rule is generic, omit it. If this template breaks a generic rule, write only the deviation.**
|
|
122
|
-
|
|
123
|
-
**Required skeleton:**
|
|
124
|
-
|
|
125
|
-
```markdown
|
|
126
|
-
---
|
|
127
|
-
template_id: <id>
|
|
128
|
-
category: brand | general | scenario | government | special
|
|
129
|
-
summary: <one-line tone & use case>
|
|
130
|
-
keywords: [tag1, tag2, tag3]
|
|
131
|
-
primary_color: "#......"
|
|
132
|
-
canvas_format: ppt169
|
|
133
|
-
canvas_width: 1280
|
|
134
|
-
canvas_height: 720
|
|
135
|
-
canvas_viewbox: "0 0 1280 720"
|
|
136
|
-
# Required when a PPTX/SVG source canvas is known; keep equal to canvas_* unless explicitly normalized.
|
|
137
|
-
source_canvas_width: 1280
|
|
138
|
-
source_canvas_height: 720
|
|
139
|
-
source_viewbox: "0 0 1280 720"
|
|
140
|
-
replication_mode: standard | fidelity | mirror
|
|
141
|
-
# Optional — only when this template overrides canonical placeholder vocabulary.
|
|
142
|
-
# Omit entirely for `mirror` mode (mirror has no placeholders).
|
|
143
|
-
# placeholders:
|
|
144
|
-
# 01_cover: ["{{TITLE}}", "{{SUBTITLE}}", "{{BRAND_LOGO}}"]
|
|
145
|
-
# 03_content: ["{{KEY_MESSAGE}}", "{{CONTENT_AREA}}"]
|
|
146
|
-
---
|
|
147
|
-
|
|
148
|
-
# [Template Name] — Design Specification
|
|
149
|
-
|
|
150
|
-
## I. Template Overview
|
|
151
|
-
- Use cases, design tone, theme mode (light / dark / mixed)
|
|
152
|
-
- One paragraph: what visually identifies this template at a glance
|
|
153
|
-
|
|
154
|
-
## II. Color Scheme
|
|
155
|
-
- HEX values with role labels (primary / accent / background / text / etc.)
|
|
156
|
-
- Brand-specific application rules when present (e.g. "KPI cards rotate blue→green→red→yellow")
|
|
157
|
-
|
|
158
|
-
## III. Typography (omit when using the default `Arial, "Microsoft YaHei", sans-serif` stack)
|
|
159
|
-
- Per-role font stacks ONLY when the template intentionally diverges (display serif title, brand typeface, etc.)
|
|
160
|
-
- Font-install or embedding requirement when a non-preinstalled font leads any stack
|
|
161
|
-
- Body baseline px (informational; `spec_lock.md` owns the actual values per project)
|
|
162
|
-
|
|
163
|
-
## IV. Signature Design Elements
|
|
164
|
-
- Decorative motifs that ARE this template — top bar, gradient underline, logo treatment, brand emblem placement
|
|
165
|
-
- Source-derived layout grammar — grid / column rhythm, page chrome, image zones, mask / crop behavior, overlay treatment, and density rhythm that make the template recognizable
|
|
166
|
-
- Optional XML snippet for any reusable component unique to this template
|
|
167
|
-
|
|
168
|
-
## V. Page Roster
|
|
169
|
-
One row per emitted SVG describing what this template's version of cover / chapter / content / ending looks like (background treatment, decorative anchors, layout rhythm, image behavior, content density, intended content slot). For `fidelity` mode, also note the cluster source and visual differentiator. For `mirror` mode the roster is the **load-bearing artifact** — Strategist picks pages from these descriptions, so each row must include enough detail to distinguish it from siblings (column count, hero element, content density, what kind of content slot it fits — "three-column KPI grid with large numbers, suits quarterly summary"). Roster entries must match the actual SVG files on disk.
|
|
170
|
-
|
|
171
|
-
## VI. Assets (omit when none)
|
|
172
|
-
Logos, cover backgrounds, brand textures bundled with the template package — file name, dimensions, intended usage.
|
|
173
|
-
|
|
174
|
-
## VII. Placeholder Overrides (omit when none)
|
|
175
|
-
Reference the `placeholders:` frontmatter declaration and explain the rationale (e.g. "consulting decks lead with `{{KEY_MESSAGE}}` instead of `{{PAGE_TITLE}}`").
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
Sections to **omit** from template `design_spec.md` (sourced elsewhere — listing them here is noise):
|
|
179
|
-
|
|
180
|
-
| Don't write | Source |
|
|
181
|
-
|---|---|
|
|
182
|
-
| SVG technical constraints / Mandatory rules / Prohibited elements | `shared-standards.md` §1 |
|
|
183
|
-
| PPT compatibility rules (`<g opacity>`, inline-styles-only, etc.) | `shared-standards.md` |
|
|
184
|
-
| Generic layout pattern library (centered card / 三栏 / timeline / …) | `design_spec_reference.md` §V |
|
|
185
|
-
| Generic spacing bands (margin 40-60px, card gap 20-32px, etc.) | `design_spec_reference.md` §V |
|
|
186
|
-
| Generic font-size hierarchy (cover 2.5-5x body, page title 1.5-2x, …) | `design_spec_reference.md` §IV |
|
|
187
|
-
| Canonical placeholder table (`{{TITLE}}`, `{{PAGE_NUM}}`, …) | §4 below |
|
|
188
|
-
| Content methodology (pyramid / SCQA / MECE / 金字塔) | `strategist.md` |
|
|
189
|
-
| "Usage Instructions" boilerplate (copy template / select page / …) | `create-template.md` |
|
|
190
|
-
| Created Date / Page Count rows | not a library-level field |
|
|
191
|
-
|
|
192
|
-
When rewriting an existing template that contains the omitted sections, delete them — do not leave a "see XXX" pointer behind. The pointer is what this scope rule replaces.
|
|
193
|
-
|
|
194
|
-
### 2. Inherit Design Specification
|
|
195
|
-
|
|
196
|
-
Templates must strictly follow the finalized template brief and the generated `design_spec.md`:
|
|
197
|
-
- **Canvas dimensions**: `canvas_format` is not enough; root SVG `viewBox` matches `canvas_viewbox` in the design spec. Root `width` / `height` are optional compatibility attributes and are not PPT Master canvas authority.
|
|
198
|
-
- **Source canvas**: when a PPTX/SVG reference is used, record `source_canvas_width`, `source_canvas_height`, and `source_viewbox`. If the output canvas differs from the source, normalize all geometry, typography, line heights, strokes, and image crop coordinates explicitly instead of relying on the shared aspect ratio.
|
|
199
|
-
- **Color scheme**: Uses primary, secondary, and accent colors from the spec
|
|
200
|
-
- **Font plan**: Uses the per-role font families declared in the spec
|
|
201
|
-
- **Layout principles**: Margins and spacing conform to the spec
|
|
202
|
-
- **Image system**: Image placement, crop / mask behavior, full-bleed zones, and overlay rules follow the source-derived norms in the spec
|
|
203
|
-
|
|
204
|
-
If PPTX import output exists:
|
|
205
|
-
- Prefer imported theme colors and fonts over visually guessed values
|
|
206
|
-
- Reuse exported `assets/` images directly — `<image>` references in `svg/` already point at canonical files
|
|
207
|
-
- Treat page-type candidates from `manifest.pageTypeCandidates` as hints, not guarantees
|
|
208
|
-
|
|
209
|
-
**Precondition**:
|
|
210
|
-
|
|
211
|
-
- When PPTX import output is provided, do not generate any template SVG or `design_spec.md` until every file under `<import_workspace>/svg/` has been read — including `master_*.svg`, `layout_*.svg`, and every `slide_*.svg`
|
|
212
|
-
- Before template generation begins, explicitly report the read slide indexes
|
|
213
|
-
|
|
214
|
-
### 2.1 PPTX Import Simplification Rule
|
|
215
|
-
|
|
216
|
-
The imported PPTX is a **reference source**, not a direct conversion target.
|
|
217
|
-
|
|
218
|
-
Do:
|
|
219
|
-
- preserve brand assets, recurring backgrounds, and stable structural motifs
|
|
220
|
-
- rebuild the layout into a clean SVG structure aligned with PPT Master constraints
|
|
221
|
-
- simplify repeated decorative fragments into a smaller number of maintainable SVG elements
|
|
222
|
-
- use a background image asset when the original decorative layer is too complex to recreate cleanly
|
|
223
|
-
- use cleaned slide SVG references to inspect composition, spacing, text hierarchy, and fixed decorative structure only after factual metadata has been anchored
|
|
224
|
-
- read every reference SVG under `svg/` — `master_*.svg`, `layout_*.svg`, and every `slide_*.svg` regardless of slide count. Master / layout files describe the deck's shared visual language (read first); slide files describe per-page content (read after). Partial coverage drops template fidelity.
|
|
225
|
-
- rename adopted assets to semantic names (`cover_bg.png`, `brand_emblem.png`) rather than carrying raw `image3.png` into the final template
|
|
226
|
-
|
|
227
|
-
Do not:
|
|
228
|
-
- attempt 1:1 translation of every PowerPoint shape, group, shadow, or decorative fragment
|
|
229
|
-
- mirror PPT-specific complexity when it makes the resulting SVG brittle or hard to edit
|
|
230
|
-
- introduce dense low-value vector detail that does not materially improve template reuse
|
|
231
|
-
|
|
232
|
-
### 3. Placeholder Markers
|
|
233
|
-
|
|
234
|
-
> **Mirror mode skips this section entirely.** Mirror SVGs are verbatim copies of the source flat slides — they carry no `{{}}` markers. Mirror is only a template-creation mode; downstream generation treats the finished files as normal template roster candidates. The rest of this section applies to `standard` and `fidelity` only.
|
|
235
|
-
|
|
236
|
-
Use clear placeholder markers for replaceable content:
|
|
237
|
-
|
|
238
|
-
```xml
|
|
239
|
-
<!-- Text placeholder -->
|
|
240
|
-
<text x="80" y="320" fill="#FFFFFF" font-size="48" font-weight="bold">
|
|
241
|
-
{{TITLE}}
|
|
242
|
-
</text>
|
|
243
|
-
|
|
244
|
-
<!-- Content area placeholder (content page only) -->
|
|
245
|
-
<rect x="40" y="90" width="1200" height="550" fill="#FFFFFF" rx="8"/>
|
|
246
|
-
<text x="640" y="365" text-anchor="middle" fill="#CBD5E1" font-size="16">
|
|
247
|
-
{{CONTENT_AREA}}
|
|
248
|
-
</text>
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
### 4. Placeholder Reference (canonical convention, overridable per template)
|
|
252
|
-
|
|
253
|
-
This is the **default vocabulary** used across the library. Newly created templates SHOULD prefer these names so projects that consume the library find familiar slots; designers MAY substitute or extend them when a style genuinely needs different vocabulary (e.g. consulting decks lead with `{{KEY_MESSAGE}}` instead of `{{PAGE_TITLE}}`; a brand cover may need `{{BRAND_LOGO}}`).
|
|
254
|
-
|
|
255
|
-
`svg_quality_checker.py --template-mode` emits **advisory warnings** when a page lacks the conventional placeholder for its type. To silence those warnings — and document the template's actual contract — declare a `placeholders:` map in `design_spec.md` frontmatter:
|
|
256
|
-
|
|
257
|
-
```yaml
|
|
258
|
-
placeholders:
|
|
259
|
-
01_cover: ["{{TITLE}}", "{{SUBTITLE}}", "{{BRAND_LOGO}}"]
|
|
260
|
-
03_content: ["{{KEY_MESSAGE}}", "{{CONTENT_AREA}}"]
|
|
261
|
-
03a_content_dual_col: [] # explicitly assert "no required placeholders"
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
| Placeholder | Purpose | Applicable page | Convention role |
|
|
265
|
-
|------------|---------|-------------------|--------|
|
|
266
|
-
| `{{TITLE}}` | Main title | Cover | Default |
|
|
267
|
-
| `{{SUBTITLE}}` | Subtitle | Cover | Default |
|
|
268
|
-
| `{{DATE}}` | Date | Cover | Default |
|
|
269
|
-
| `{{AUTHOR}}` | Author / Organization | Cover | Default |
|
|
270
|
-
| `{{CHAPTER_NUM}}` | Chapter number | Chapter page | Default |
|
|
271
|
-
| `{{CHAPTER_TITLE}}` | Chapter title | Chapter page | Default |
|
|
272
|
-
| `{{CHAPTER_DESC}}` | Chapter description | Chapter page | Optional |
|
|
273
|
-
| `{{PAGE_TITLE}}` | Page title | Content page | Default |
|
|
274
|
-
| `{{CONTENT_AREA}}` | Content area | Content page | Default |
|
|
275
|
-
| `{{PAGE_NUM}}` | Page number | Content page, ending page | Default |
|
|
276
|
-
| `{{KEY_MESSAGE}}` | Key takeaway | Content page (consulting style) | Style-specific |
|
|
277
|
-
| `{{SECTION_NAME}}` | Section name | Content page footer | Optional |
|
|
278
|
-
| `{{SOURCE}}` | Data source | Content page footer | Optional |
|
|
279
|
-
| `{{THANK_YOU}}` | Thank-you message | Ending page | Default |
|
|
280
|
-
| `{{CONTACT_INFO}}` | Contact info | Ending page | Default |
|
|
281
|
-
| `{{ENDING_SUBTITLE}}` | Ending subtitle | Ending page | Optional |
|
|
282
|
-
| `{{CLOSING_MESSAGE}}` | Closing message | Ending page | Style-specific |
|
|
283
|
-
| `{{COPYRIGHT}}` | Copyright | Ending page | Optional |
|
|
284
|
-
|
|
285
|
-
For TOC pages in **newly created library templates**, use indexed placeholders:
|
|
286
|
-
|
|
287
|
-
- `{{TOC_ITEM_1_TITLE}}`, `{{TOC_ITEM_1_DESC}}`
|
|
288
|
-
- `{{TOC_ITEM_2_TITLE}}`, `{{TOC_ITEM_2_DESC}}`
|
|
289
|
-
- ...
|
|
290
|
-
|
|
291
|
-
Do **not** create new TOC placeholder families such as `{{CHAPTER_01_TITLE}}` for new templates. Existing templates may contain legacy placeholder variants, but new library assets should converge on the indexed TOC contract.
|
|
292
|
-
|
|
293
|
-
Variants reuse their parent type's placeholder set by default: every `03*_content*.svg` shares the content placeholder list above, unless the spec frontmatter declares an override for that specific stem.
|
|
294
|
-
|
|
295
|
-
When rebuilding from imported PPTX references, placeholder insertion takes priority over visual mimicry. If the original layout leaves insufficient room for canonical placeholders, adjust the layout instead of inventing one-off placeholder families — or, if the deviation is intentional and meaningful, declare it in frontmatter.
|
|
296
|
-
|
|
297
|
-
---
|
|
298
|
-
|
|
299
|
-
## Output Requirements
|
|
300
|
-
|
|
301
|
-
### File Save Location
|
|
302
|
-
|
|
303
|
-
Standard mode (default):
|
|
304
|
-
|
|
305
|
-
```
|
|
306
|
-
templates/<kind_dir>/<template_name>/
|
|
307
|
-
├── design_spec.md # Design specification (required)
|
|
308
|
-
├── 01_cover.svg
|
|
309
|
-
├── 02_chapter.svg
|
|
310
|
-
├── 02_toc.svg # Optional
|
|
311
|
-
├── 03_content.svg
|
|
312
|
-
├── 04_ending.svg
|
|
313
|
-
└── *.png / *.jpg # Image assets (if any)
|
|
314
|
-
```
|
|
315
|
-
|
|
316
|
-
Fidelity mode adds variants and extension pages, e.g.:
|
|
317
|
-
|
|
318
|
-
```
|
|
319
|
-
templates/<kind_dir>/<template_name>/
|
|
320
|
-
├── design_spec.md
|
|
321
|
-
├── 01_cover.svg
|
|
322
|
-
├── 02a_chapter_full.svg
|
|
323
|
-
├── 02b_chapter_minimal.svg
|
|
324
|
-
├── 02_toc.svg
|
|
325
|
-
├── 03a_content_two_col.svg
|
|
326
|
-
├── 03b_content_data_card.svg
|
|
327
|
-
├── 03c_content_quote.svg
|
|
328
|
-
├── 04_ending.svg
|
|
329
|
-
├── 05_section_break.svg
|
|
330
|
-
└── *.png / *.jpg
|
|
331
|
-
```
|
|
332
|
-
|
|
333
|
-
Mirror mode emits one SVG per source slide, named by source order:
|
|
334
|
-
|
|
335
|
-
```
|
|
336
|
-
templates/<kind_dir>/<template_name>/
|
|
337
|
-
├── design_spec.md
|
|
338
|
-
├── 001_cover.svg
|
|
339
|
-
├── 002_toc.svg
|
|
340
|
-
├── 003_content.svg
|
|
341
|
-
├── 004_content.svg
|
|
342
|
-
├── 005_chapter.svg
|
|
343
|
-
├── 006_content.svg
|
|
344
|
-
├── ...
|
|
345
|
-
├── 049_content.svg
|
|
346
|
-
├── 050_ending.svg
|
|
347
|
-
└── *.png / *.jpg
|
|
348
|
-
```
|
|
349
|
-
|
|
350
|
-
Filenames preserve the source slide order via the 3-digit prefix; `<page_type>` is derived from `manifest.json` `pageTypeCandidates`. No `{{}}` placeholders appear in any mirror SVG.
|
|
351
|
-
|
|
352
|
-
### Template Preview
|
|
353
|
-
|
|
354
|
-
After each template is generated, provide a brief summary table listing each template's status.
|
|
355
|
-
|
|
356
|
-
If the template is based on PPTX import output, briefly note:
|
|
357
|
-
- which extracted assets were reused directly
|
|
358
|
-
- which complex original decorations were intentionally simplified
|
|
359
|
-
- whether any page-type mapping required judgment beyond the import heuristic
|
|
360
|
-
|
|
361
|
-
---
|
|
362
|
-
|
|
363
|
-
## Using Pre-built Template Library (Optional)
|
|
364
|
-
|
|
365
|
-
If suitable template resources already exist, use them directly instead of generating new ones:
|
|
366
|
-
|
|
367
|
-
1. **Copy template**: copy the spec + template SVGs into the project's `templates/`, and any bundled bitmaps into the project's `images/` (the runtime image pool, referenced as `../images/`)
|
|
368
|
-
2. **Adjust colors**: Modify colors per the project design spec
|
|
369
|
-
3. **Customize**: Make project-specific adjustments
|
|
370
|
-
|
|
371
|
-
This section describes downstream reuse. The `Template_Designer` role itself is responsible for creating or normalizing the reusable library asset first.
|
|
372
|
-
|
|
373
|
-
**Example library structure** (query the appropriate kind's index — `templates/layouts/layouts_index.json` for structure-only templates, `templates/decks/decks_index.json` for full-PPT replicas, `templates/brands/brands_index.json` for identity-only presets):
|
|
374
|
-
|
|
375
|
-
```
|
|
376
|
-
templates/
|
|
377
|
-
├── brands/
|
|
378
|
-
│ ├── anthropic/ # Anthropic brand identity (logo + colors + typography)
|
|
379
|
-
│ └── google/ # Google brand identity
|
|
380
|
-
├── layouts/
|
|
381
|
-
│ ├── academic_defense/ # Academic-defense structure (no identity)
|
|
382
|
-
│ └── pixel_retro/ # Pixel retro / cyberpunk structure (no identity)
|
|
383
|
-
└── decks/
|
|
384
|
-
├── 招商银行/ # China Merchants Bank full PPT replica
|
|
385
|
-
└── 中国电建/ # PowerChina full PPT replica
|
|
386
|
-
```
|
|
387
|
-
|
|
388
|
-
---
|
|
389
|
-
|
|
390
|
-
## Phase Completion Checkpoint
|
|
391
|
-
|
|
392
|
-
```markdown
|
|
393
|
-
## Template_Designer Phase Complete
|
|
394
|
-
|
|
395
|
-
- [x] Read `references/template-designer.md`
|
|
396
|
-
- [x] Replication mode confirmed: `standard` | `fidelity` | `mirror`
|
|
397
|
-
- [x] Every page listed in `design_spec.md §V Page Roster` saved to `templates/<layouts|decks>/<template_name>/` (decks for full-PPT replicas, layouts for structure-only)
|
|
398
|
-
- [x] Naming convention applied (standard / fidelity: letter-suffix variants; mirror: `<NNN>_<page_type>.svg`)
|
|
399
|
-
- [x] Templates follow design spec (colors, fonts, layout)
|
|
400
|
-
- [x] Placeholder markers are clear and standardized (standard / fidelity); mirror SVGs contain **no** `{{}}` markers
|
|
401
|
-
- [ ] **Next step**: Validate assets and register the template via `register_template.py <id> --kind <deck|layout>`
|
|
402
|
-
```
|
|
1
|
+
> See shared-standards.md for common technical constraints.
|
|
2
|
+
|
|
3
|
+
# Template Designer — Template Design Role
|
|
4
|
+
|
|
5
|
+
## Core Mission
|
|
6
|
+
|
|
7
|
+
Generate reusable page templates for the **global template library** based on a finalized template brief, and write a concise `design_spec.md` that captures the source-derived basic norms that make the template reusable.
|
|
8
|
+
|
|
9
|
+
> This is a standalone role: only triggered via the `/create-template` workflow. It is **not** the project-level template selection/customization step in the main PPT generation pipeline.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
- **Trigger**: `/create-template` workflow
|
|
14
|
+
- **Output location**: `templates/<kind_dir>/<template_name>/` where `<kind_dir>` is `decks` (default — full-PPT replica with identity) or `layouts` (structure-only, no identity segment)
|
|
15
|
+
- **Input**: finalized template brief (template ID, display name, kind, applicable scenarios, tone, theme mode, canvas format, optional reference assets, accepted basic template norms)
|
|
16
|
+
|
|
17
|
+
When the workflow provides a PPTX reference source, the effective input package comes from the unified `pptx_template_import.py` preparation workspace and becomes:
|
|
18
|
+
|
|
19
|
+
- finalized template brief
|
|
20
|
+
- `manifest.json` — single source of truth (slide size, theme, per-master themes, assets, asset map, placeholders, layouts, masters, slides, SVG file paths, page-type candidates)
|
|
21
|
+
- `summary.md` — short orientation digest derived from manifest.json
|
|
22
|
+
- exported `assets/`
|
|
23
|
+
- `svg/master_*.svg` / `svg/layout_*.svg` — every master / layout in the deck rendered once as standalone SVG, including ones no sample slide references (template packages often ship more design surfaces than the embedded samples exercise)
|
|
24
|
+
- `svg/slide_NN.svg` — each slide's own shapes and slide-local background only; master / layout decoration and backgrounds are **not** inlined here
|
|
25
|
+
- `svg/inheritance.json` — which layout / master each slide consumes
|
|
26
|
+
- `svg-flat/slide_NN.svg` — companion view; each slide is self-contained so you can preview or screenshot a single page without losing the surrounding chrome. Use it as a sanity check for "what would PowerPoint actually show", not as an authoring source — the master/layout chrome will be duplicated across every flat slide.
|
|
27
|
+
- optional screenshots for visual cross-checking
|
|
28
|
+
|
|
29
|
+
PPTX import interpretation:
|
|
30
|
+
|
|
31
|
+
- Placeholder guides in master / layout SVGs are layout signals. Use `manifest.json` placeholder records for type / index / geometry / base style; do not copy dashed guide boxes into final templates unless the visual design truly uses dashed boxes.
|
|
32
|
+
- Charts, SmartArt, diagrams, and OLE objects may appear as typed placeholders in layered SVGs. In flat SVGs they may show preview images. Treat them as source intent markers, not reusable decorative assets.
|
|
33
|
+
- The asset filenames referenced by SVGs are governed by the manifest asset map. Prefer those references over inventing duplicate asset names.
|
|
34
|
+
|
|
35
|
+
Input priority for PPTX-backed template creation:
|
|
36
|
+
|
|
37
|
+
1. `manifest.json` for all factual metadata (theme, assets, unique layout/master structure, slide reuse, page-type guidance)
|
|
38
|
+
2. `svg/master_*.svg` + `svg/layout_*.svg` — the **primary source for the deck's shared visual language**: backgrounds, page chrome, decorative bars, recurring brand motifs. These are what the new template's fixed structure should adopt or reinterpret. Read these before any slide SVG.
|
|
39
|
+
3. `svg/inheritance.json` for confirming which slide uses which layout / master
|
|
40
|
+
4. exported `assets/` for reusable visual resources
|
|
41
|
+
5. `svg/slide_NN.svg` — each slide's unique content, useful for judging composition rhythm and content density (not for fixed structure)
|
|
42
|
+
6. `summary.md` only as a fast scan; never as the canonical fact source
|
|
43
|
+
7. screenshots / original PPTX only for style verification
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Page Roster
|
|
48
|
+
|
|
49
|
+
The output page set is determined by **replication mode**, declared in the finalized template brief:
|
|
50
|
+
|
|
51
|
+
| Mode | When to use | Roster |
|
|
52
|
+
|------|-------------|--------|
|
|
53
|
+
| `standard` (default) | Most templates — clean, reusable, balanced coverage | `01_cover`, `02_chapter`, `03_content`, `04_ending`, optional `02_toc` |
|
|
54
|
+
| `fidelity` | User explicitly wants strict replication of a source PPTX, but still wants the AI to clean / cluster / cap variants | Standard roster + one variant per distinct layout cluster found in `manifest.json` |
|
|
55
|
+
| `mirror` | Creation-time harvesting mode: every source slide is preserved 1:1 as a reference page for the template package. Verbatim copy, no abstraction, no placeholders | One SVG per source slide, named `<NNN>_<page_type>.svg` by source order |
|
|
56
|
+
|
|
57
|
+
### Standard mode
|
|
58
|
+
|
|
59
|
+
| # | Filename | Purpose | Description |
|
|
60
|
+
|---|----------|---------|-------------|
|
|
61
|
+
| 01 | `01_cover.svg` | Cover | Fixed structure: title, subtitle, date, organization |
|
|
62
|
+
| 02 | `02_chapter.svg` | Chapter page | Fixed structure: chapter number, chapter title |
|
|
63
|
+
| 03 | `03_content.svg` | Content page | Flexible structure: only defines header/footer; content area freely laid out by AI |
|
|
64
|
+
| 04 | `04_ending.svg` | Ending page | Fixed structure: thank-you message, contact info |
|
|
65
|
+
| -- | `02_toc.svg` | Table of contents | Optional: TOC title, chapter list (number + title) |
|
|
66
|
+
|
|
67
|
+
**Design philosophy**: Templates define visual consistency and structural pages; content pages maintain maximum flexibility.
|
|
68
|
+
|
|
69
|
+
**Naming note**: TOC page keeps `02_toc.svg` naming for template library compatibility and sort order.
|
|
70
|
+
|
|
71
|
+
### Fidelity mode
|
|
72
|
+
|
|
73
|
+
When the brief sets `Replication mode: fidelity`, derive the page roster from `manifest.json` page-type clusters and emit one SVG per distinct visual cluster.
|
|
74
|
+
|
|
75
|
+
**Variant naming**: append a lowercase letter suffix to the parent type's index, preserving sort order:
|
|
76
|
+
|
|
77
|
+
| Parent type | Example variants |
|
|
78
|
+
|-------------|------------------|
|
|
79
|
+
| Chapter | `02a_chapter_full.svg`, `02b_chapter_minimal.svg` |
|
|
80
|
+
| Content | `03a_content_two_col.svg`, `03b_content_data_card.svg`, `03c_content_quote.svg` |
|
|
81
|
+
| Ending | `04a_ending_thanks.svg`, `04b_ending_contact.svg` |
|
|
82
|
+
|
|
83
|
+
Extension page types beyond the canonical four (transition / appendix / disclaimer / divider) take the next free index: `05_section_break.svg`, `06_appendix.svg`, `07_disclaimer.svg`.
|
|
84
|
+
|
|
85
|
+
**Roster decision**:
|
|
86
|
+
|
|
87
|
+
- Cluster slides from `manifest.json` by `pageType` + visual structure (column count, hero-image vs. icon-grid vs. quote, etc.)
|
|
88
|
+
- One SVG per cluster — do **not** emit a variant for a cluster represented by a single source slide unless that slide is structurally distinct from existing variants
|
|
89
|
+
- One variant per visually distinct cluster — let the source's structural diversity drive the count. Collapse only **near-duplicates** (same column count, same hero element, same content density); do not collapse genuine structural differences just to keep the variant count down. If you find yourself wanting one variant per source slide, that is the signal the user should be in `mirror` mode, not `fidelity`
|
|
90
|
+
- Record every emitted page in `design_spec.md §V Page Roster`; the corresponding index entry (`decks_index.json` or `layouts_index.json`) is generated automatically by `register_template.py` from the directory's actual SVG files
|
|
91
|
+
|
|
92
|
+
> Variants reuse the parent type's placeholder set — see §4 (Placeholder Reference) below.
|
|
93
|
+
|
|
94
|
+
### Mirror mode
|
|
95
|
+
|
|
96
|
+
When the brief sets `Replication mode: mirror`, the role does **not** abstract or reconstruct. Each source slide becomes one template page **byte-for-byte**:
|
|
97
|
+
|
|
98
|
+
- Source: `<import_workspace>/svg-flat/slide_NN.svg` (the self-contained "what PowerPoint shows" view). Do **not** read or use `svg/master_*.svg`, `svg/layout_*.svg`, or `svg/inheritance.json` — chrome / content separation is irrelevant because mirror does not insert placeholders.
|
|
99
|
+
- Output: `templates/<kind_dir>/<template_id>/<NNN>_<page_type>.svg`, where `<NNN>` is the zero-padded source slide index (3 digits) and `<page_type>` is derived from `manifest.json` `pageTypeCandidates` — `cover` / `toc` / `chapter` / `content` / `ending`. When the page-type heuristic is ambiguous, fall back to `content`. Preserve source slide order via the numeric prefix.
|
|
100
|
+
- Modifications allowed: **only** rewriting `<image href="...">` paths to point at the local `assets/` copy, and renaming asset files to semantic names. Everything else — geometry, decoration, sprite-sheet wrappers, original example text, chart placeholders, embedded fonts — is copied as-is.
|
|
101
|
+
- Modifications forbidden: inserting `{{TITLE}}` / `{{CONTENT_AREA}}` / any other placeholder; "cleaning up" decorative complexity; merging similar slides; dropping master/layout chrome (it's already baked into the flat SVG, leave it).
|
|
102
|
+
- `design_spec.md` §V Page Roster lists every emitted file with **a one-line description** of what the page contains and what content slot it suits — Strategist selects pages from these descriptions, since the SVG itself carries no placeholder contract.
|
|
103
|
+
|
|
104
|
+
**Mirror consumption boundary**: `mirror` applies only while creating the template package from the source deck. Once created, the package is consumed as an ordinary deck / layout template roster: downstream generation may select, repeat, skip, reorder, or adapt pages according to the new content. The `replication_mode: mirror` field must not force the generated deck to preserve the source page count, source order, or one-output-slide-per-template-slide mapping.
|
|
105
|
+
|
|
106
|
+
**What mirror is not**: a pixel-perfect re-rendering pipeline test. Charts, SmartArt, OLE objects, and EMF / WMF media that fail to round-trip in `pptx_template_import.py` will fail the same way in mirror. If the import workspace has missing media or unsupported objects, mirror inherits those gaps — the user should be told before generation begins.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Template Design Specifications
|
|
111
|
+
|
|
112
|
+
### 1. Must Generate design_spec.md
|
|
113
|
+
|
|
114
|
+
**Scope rule — personality only.** A template `design_spec.md` describes **what makes this template recognizable**: brand colors, signature decorative motifs, page-by-page visual character, bundled assets. It does **not** restate generic constraints — those live in the canonical references and are already loaded by every downstream role:
|
|
115
|
+
|
|
116
|
+
- SVG technical constraints, PPT compatibility rules → [`shared-standards.md`](shared-standards.md)
|
|
117
|
+
- Generic layout pattern library, spacing bands, font-size ratio bands → [`templates/design_spec_reference.md`](../templates/design_spec_reference.md) (read by Strategist when authoring the **project** design_spec)
|
|
118
|
+
- Canonical placeholder vocabulary → §4 below
|
|
119
|
+
- Content methodology (pyramid / SCQA / MECE) → [`strategist.md`](strategist.md)
|
|
120
|
+
|
|
121
|
+
Re-declaring any of these in a template `design_spec.md` is noise — Strategist already has them in context, and duplication forces every relaxation to sweep N templates instead of one source. **If a rule is generic, omit it. If this template breaks a generic rule, write only the deviation.**
|
|
122
|
+
|
|
123
|
+
**Required skeleton:**
|
|
124
|
+
|
|
125
|
+
```markdown
|
|
126
|
+
---
|
|
127
|
+
template_id: <id>
|
|
128
|
+
category: brand | general | scenario | government | special
|
|
129
|
+
summary: <one-line tone & use case>
|
|
130
|
+
keywords: [tag1, tag2, tag3]
|
|
131
|
+
primary_color: "#......"
|
|
132
|
+
canvas_format: ppt169
|
|
133
|
+
canvas_width: 1280
|
|
134
|
+
canvas_height: 720
|
|
135
|
+
canvas_viewbox: "0 0 1280 720"
|
|
136
|
+
# Required when a PPTX/SVG source canvas is known; keep equal to canvas_* unless explicitly normalized.
|
|
137
|
+
source_canvas_width: 1280
|
|
138
|
+
source_canvas_height: 720
|
|
139
|
+
source_viewbox: "0 0 1280 720"
|
|
140
|
+
replication_mode: standard | fidelity | mirror
|
|
141
|
+
# Optional — only when this template overrides canonical placeholder vocabulary.
|
|
142
|
+
# Omit entirely for `mirror` mode (mirror has no placeholders).
|
|
143
|
+
# placeholders:
|
|
144
|
+
# 01_cover: ["{{TITLE}}", "{{SUBTITLE}}", "{{BRAND_LOGO}}"]
|
|
145
|
+
# 03_content: ["{{KEY_MESSAGE}}", "{{CONTENT_AREA}}"]
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
# [Template Name] — Design Specification
|
|
149
|
+
|
|
150
|
+
## I. Template Overview
|
|
151
|
+
- Use cases, design tone, theme mode (light / dark / mixed)
|
|
152
|
+
- One paragraph: what visually identifies this template at a glance
|
|
153
|
+
|
|
154
|
+
## II. Color Scheme
|
|
155
|
+
- HEX values with role labels (primary / accent / background / text / etc.)
|
|
156
|
+
- Brand-specific application rules when present (e.g. "KPI cards rotate blue→green→red→yellow")
|
|
157
|
+
|
|
158
|
+
## III. Typography (omit when using the default `Arial, "Microsoft YaHei", sans-serif` stack)
|
|
159
|
+
- Per-role font stacks ONLY when the template intentionally diverges (display serif title, brand typeface, etc.)
|
|
160
|
+
- Font-install or embedding requirement when a non-preinstalled font leads any stack
|
|
161
|
+
- Body baseline px (informational; `spec_lock.md` owns the actual values per project)
|
|
162
|
+
|
|
163
|
+
## IV. Signature Design Elements
|
|
164
|
+
- Decorative motifs that ARE this template — top bar, gradient underline, logo treatment, brand emblem placement
|
|
165
|
+
- Source-derived layout grammar — grid / column rhythm, page chrome, image zones, mask / crop behavior, overlay treatment, and density rhythm that make the template recognizable
|
|
166
|
+
- Optional XML snippet for any reusable component unique to this template
|
|
167
|
+
|
|
168
|
+
## V. Page Roster
|
|
169
|
+
One row per emitted SVG describing what this template's version of cover / chapter / content / ending looks like (background treatment, decorative anchors, layout rhythm, image behavior, content density, intended content slot). For `fidelity` mode, also note the cluster source and visual differentiator. For `mirror` mode the roster is the **load-bearing artifact** — Strategist picks pages from these descriptions, so each row must include enough detail to distinguish it from siblings (column count, hero element, content density, what kind of content slot it fits — "three-column KPI grid with large numbers, suits quarterly summary"). Roster entries must match the actual SVG files on disk.
|
|
170
|
+
|
|
171
|
+
## VI. Assets (omit when none)
|
|
172
|
+
Logos, cover backgrounds, brand textures bundled with the template package — file name, dimensions, intended usage.
|
|
173
|
+
|
|
174
|
+
## VII. Placeholder Overrides (omit when none)
|
|
175
|
+
Reference the `placeholders:` frontmatter declaration and explain the rationale (e.g. "consulting decks lead with `{{KEY_MESSAGE}}` instead of `{{PAGE_TITLE}}`").
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Sections to **omit** from template `design_spec.md` (sourced elsewhere — listing them here is noise):
|
|
179
|
+
|
|
180
|
+
| Don't write | Source |
|
|
181
|
+
|---|---|
|
|
182
|
+
| SVG technical constraints / Mandatory rules / Prohibited elements | `shared-standards.md` §1 |
|
|
183
|
+
| PPT compatibility rules (`<g opacity>`, inline-styles-only, etc.) | `shared-standards.md` |
|
|
184
|
+
| Generic layout pattern library (centered card / 三栏 / timeline / …) | `design_spec_reference.md` §V |
|
|
185
|
+
| Generic spacing bands (margin 40-60px, card gap 20-32px, etc.) | `design_spec_reference.md` §V |
|
|
186
|
+
| Generic font-size hierarchy (cover 2.5-5x body, page title 1.5-2x, …) | `design_spec_reference.md` §IV |
|
|
187
|
+
| Canonical placeholder table (`{{TITLE}}`, `{{PAGE_NUM}}`, …) | §4 below |
|
|
188
|
+
| Content methodology (pyramid / SCQA / MECE / 金字塔) | `strategist.md` |
|
|
189
|
+
| "Usage Instructions" boilerplate (copy template / select page / …) | `create-template.md` |
|
|
190
|
+
| Created Date / Page Count rows | not a library-level field |
|
|
191
|
+
|
|
192
|
+
When rewriting an existing template that contains the omitted sections, delete them — do not leave a "see XXX" pointer behind. The pointer is what this scope rule replaces.
|
|
193
|
+
|
|
194
|
+
### 2. Inherit Design Specification
|
|
195
|
+
|
|
196
|
+
Templates must strictly follow the finalized template brief and the generated `design_spec.md`:
|
|
197
|
+
- **Canvas dimensions**: `canvas_format` is not enough; root SVG `viewBox` matches `canvas_viewbox` in the design spec. Root `width` / `height` are optional compatibility attributes and are not PPT Master canvas authority.
|
|
198
|
+
- **Source canvas**: when a PPTX/SVG reference is used, record `source_canvas_width`, `source_canvas_height`, and `source_viewbox`. If the output canvas differs from the source, normalize all geometry, typography, line heights, strokes, and image crop coordinates explicitly instead of relying on the shared aspect ratio.
|
|
199
|
+
- **Color scheme**: Uses primary, secondary, and accent colors from the spec
|
|
200
|
+
- **Font plan**: Uses the per-role font families declared in the spec
|
|
201
|
+
- **Layout principles**: Margins and spacing conform to the spec
|
|
202
|
+
- **Image system**: Image placement, crop / mask behavior, full-bleed zones, and overlay rules follow the source-derived norms in the spec
|
|
203
|
+
|
|
204
|
+
If PPTX import output exists:
|
|
205
|
+
- Prefer imported theme colors and fonts over visually guessed values
|
|
206
|
+
- Reuse exported `assets/` images directly — `<image>` references in `svg/` already point at canonical files
|
|
207
|
+
- Treat page-type candidates from `manifest.pageTypeCandidates` as hints, not guarantees
|
|
208
|
+
|
|
209
|
+
**Precondition**:
|
|
210
|
+
|
|
211
|
+
- When PPTX import output is provided, do not generate any template SVG or `design_spec.md` until every file under `<import_workspace>/svg/` has been read — including `master_*.svg`, `layout_*.svg`, and every `slide_*.svg`
|
|
212
|
+
- Before template generation begins, explicitly report the read slide indexes
|
|
213
|
+
|
|
214
|
+
### 2.1 PPTX Import Simplification Rule
|
|
215
|
+
|
|
216
|
+
The imported PPTX is a **reference source**, not a direct conversion target.
|
|
217
|
+
|
|
218
|
+
Do:
|
|
219
|
+
- preserve brand assets, recurring backgrounds, and stable structural motifs
|
|
220
|
+
- rebuild the layout into a clean SVG structure aligned with PPT Master constraints
|
|
221
|
+
- simplify repeated decorative fragments into a smaller number of maintainable SVG elements
|
|
222
|
+
- use a background image asset when the original decorative layer is too complex to recreate cleanly
|
|
223
|
+
- use cleaned slide SVG references to inspect composition, spacing, text hierarchy, and fixed decorative structure only after factual metadata has been anchored
|
|
224
|
+
- read every reference SVG under `svg/` — `master_*.svg`, `layout_*.svg`, and every `slide_*.svg` regardless of slide count. Master / layout files describe the deck's shared visual language (read first); slide files describe per-page content (read after). Partial coverage drops template fidelity.
|
|
225
|
+
- rename adopted assets to semantic names (`cover_bg.png`, `brand_emblem.png`) rather than carrying raw `image3.png` into the final template
|
|
226
|
+
|
|
227
|
+
Do not:
|
|
228
|
+
- attempt 1:1 translation of every PowerPoint shape, group, shadow, or decorative fragment
|
|
229
|
+
- mirror PPT-specific complexity when it makes the resulting SVG brittle or hard to edit
|
|
230
|
+
- introduce dense low-value vector detail that does not materially improve template reuse
|
|
231
|
+
|
|
232
|
+
### 3. Placeholder Markers
|
|
233
|
+
|
|
234
|
+
> **Mirror mode skips this section entirely.** Mirror SVGs are verbatim copies of the source flat slides — they carry no `{{}}` markers. Mirror is only a template-creation mode; downstream generation treats the finished files as normal template roster candidates. The rest of this section applies to `standard` and `fidelity` only.
|
|
235
|
+
|
|
236
|
+
Use clear placeholder markers for replaceable content:
|
|
237
|
+
|
|
238
|
+
```xml
|
|
239
|
+
<!-- Text placeholder -->
|
|
240
|
+
<text x="80" y="320" fill="#FFFFFF" font-size="48" font-weight="bold">
|
|
241
|
+
{{TITLE}}
|
|
242
|
+
</text>
|
|
243
|
+
|
|
244
|
+
<!-- Content area placeholder (content page only) -->
|
|
245
|
+
<rect x="40" y="90" width="1200" height="550" fill="#FFFFFF" rx="8"/>
|
|
246
|
+
<text x="640" y="365" text-anchor="middle" fill="#CBD5E1" font-size="16">
|
|
247
|
+
{{CONTENT_AREA}}
|
|
248
|
+
</text>
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### 4. Placeholder Reference (canonical convention, overridable per template)
|
|
252
|
+
|
|
253
|
+
This is the **default vocabulary** used across the library. Newly created templates SHOULD prefer these names so projects that consume the library find familiar slots; designers MAY substitute or extend them when a style genuinely needs different vocabulary (e.g. consulting decks lead with `{{KEY_MESSAGE}}` instead of `{{PAGE_TITLE}}`; a brand cover may need `{{BRAND_LOGO}}`).
|
|
254
|
+
|
|
255
|
+
`svg_quality_checker.py --template-mode` emits **advisory warnings** when a page lacks the conventional placeholder for its type. To silence those warnings — and document the template's actual contract — declare a `placeholders:` map in `design_spec.md` frontmatter:
|
|
256
|
+
|
|
257
|
+
```yaml
|
|
258
|
+
placeholders:
|
|
259
|
+
01_cover: ["{{TITLE}}", "{{SUBTITLE}}", "{{BRAND_LOGO}}"]
|
|
260
|
+
03_content: ["{{KEY_MESSAGE}}", "{{CONTENT_AREA}}"]
|
|
261
|
+
03a_content_dual_col: [] # explicitly assert "no required placeholders"
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
| Placeholder | Purpose | Applicable page | Convention role |
|
|
265
|
+
|------------|---------|-------------------|--------|
|
|
266
|
+
| `{{TITLE}}` | Main title | Cover | Default |
|
|
267
|
+
| `{{SUBTITLE}}` | Subtitle | Cover | Default |
|
|
268
|
+
| `{{DATE}}` | Date | Cover | Default |
|
|
269
|
+
| `{{AUTHOR}}` | Author / Organization | Cover | Default |
|
|
270
|
+
| `{{CHAPTER_NUM}}` | Chapter number | Chapter page | Default |
|
|
271
|
+
| `{{CHAPTER_TITLE}}` | Chapter title | Chapter page | Default |
|
|
272
|
+
| `{{CHAPTER_DESC}}` | Chapter description | Chapter page | Optional |
|
|
273
|
+
| `{{PAGE_TITLE}}` | Page title | Content page | Default |
|
|
274
|
+
| `{{CONTENT_AREA}}` | Content area | Content page | Default |
|
|
275
|
+
| `{{PAGE_NUM}}` | Page number | Content page, ending page | Default |
|
|
276
|
+
| `{{KEY_MESSAGE}}` | Key takeaway | Content page (consulting style) | Style-specific |
|
|
277
|
+
| `{{SECTION_NAME}}` | Section name | Content page footer | Optional |
|
|
278
|
+
| `{{SOURCE}}` | Data source | Content page footer | Optional |
|
|
279
|
+
| `{{THANK_YOU}}` | Thank-you message | Ending page | Default |
|
|
280
|
+
| `{{CONTACT_INFO}}` | Contact info | Ending page | Default |
|
|
281
|
+
| `{{ENDING_SUBTITLE}}` | Ending subtitle | Ending page | Optional |
|
|
282
|
+
| `{{CLOSING_MESSAGE}}` | Closing message | Ending page | Style-specific |
|
|
283
|
+
| `{{COPYRIGHT}}` | Copyright | Ending page | Optional |
|
|
284
|
+
|
|
285
|
+
For TOC pages in **newly created library templates**, use indexed placeholders:
|
|
286
|
+
|
|
287
|
+
- `{{TOC_ITEM_1_TITLE}}`, `{{TOC_ITEM_1_DESC}}`
|
|
288
|
+
- `{{TOC_ITEM_2_TITLE}}`, `{{TOC_ITEM_2_DESC}}`
|
|
289
|
+
- ...
|
|
290
|
+
|
|
291
|
+
Do **not** create new TOC placeholder families such as `{{CHAPTER_01_TITLE}}` for new templates. Existing templates may contain legacy placeholder variants, but new library assets should converge on the indexed TOC contract.
|
|
292
|
+
|
|
293
|
+
Variants reuse their parent type's placeholder set by default: every `03*_content*.svg` shares the content placeholder list above, unless the spec frontmatter declares an override for that specific stem.
|
|
294
|
+
|
|
295
|
+
When rebuilding from imported PPTX references, placeholder insertion takes priority over visual mimicry. If the original layout leaves insufficient room for canonical placeholders, adjust the layout instead of inventing one-off placeholder families — or, if the deviation is intentional and meaningful, declare it in frontmatter.
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## Output Requirements
|
|
300
|
+
|
|
301
|
+
### File Save Location
|
|
302
|
+
|
|
303
|
+
Standard mode (default):
|
|
304
|
+
|
|
305
|
+
```
|
|
306
|
+
templates/<kind_dir>/<template_name>/
|
|
307
|
+
├── design_spec.md # Design specification (required)
|
|
308
|
+
├── 01_cover.svg
|
|
309
|
+
├── 02_chapter.svg
|
|
310
|
+
├── 02_toc.svg # Optional
|
|
311
|
+
├── 03_content.svg
|
|
312
|
+
├── 04_ending.svg
|
|
313
|
+
└── *.png / *.jpg # Image assets (if any)
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
Fidelity mode adds variants and extension pages, e.g.:
|
|
317
|
+
|
|
318
|
+
```
|
|
319
|
+
templates/<kind_dir>/<template_name>/
|
|
320
|
+
├── design_spec.md
|
|
321
|
+
├── 01_cover.svg
|
|
322
|
+
├── 02a_chapter_full.svg
|
|
323
|
+
├── 02b_chapter_minimal.svg
|
|
324
|
+
├── 02_toc.svg
|
|
325
|
+
├── 03a_content_two_col.svg
|
|
326
|
+
├── 03b_content_data_card.svg
|
|
327
|
+
├── 03c_content_quote.svg
|
|
328
|
+
├── 04_ending.svg
|
|
329
|
+
├── 05_section_break.svg
|
|
330
|
+
└── *.png / *.jpg
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
Mirror mode emits one SVG per source slide, named by source order:
|
|
334
|
+
|
|
335
|
+
```
|
|
336
|
+
templates/<kind_dir>/<template_name>/
|
|
337
|
+
├── design_spec.md
|
|
338
|
+
├── 001_cover.svg
|
|
339
|
+
├── 002_toc.svg
|
|
340
|
+
├── 003_content.svg
|
|
341
|
+
├── 004_content.svg
|
|
342
|
+
├── 005_chapter.svg
|
|
343
|
+
├── 006_content.svg
|
|
344
|
+
├── ...
|
|
345
|
+
├── 049_content.svg
|
|
346
|
+
├── 050_ending.svg
|
|
347
|
+
└── *.png / *.jpg
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
Filenames preserve the source slide order via the 3-digit prefix; `<page_type>` is derived from `manifest.json` `pageTypeCandidates`. No `{{}}` placeholders appear in any mirror SVG.
|
|
351
|
+
|
|
352
|
+
### Template Preview
|
|
353
|
+
|
|
354
|
+
After each template is generated, provide a brief summary table listing each template's status.
|
|
355
|
+
|
|
356
|
+
If the template is based on PPTX import output, briefly note:
|
|
357
|
+
- which extracted assets were reused directly
|
|
358
|
+
- which complex original decorations were intentionally simplified
|
|
359
|
+
- whether any page-type mapping required judgment beyond the import heuristic
|
|
360
|
+
|
|
361
|
+
---
|
|
362
|
+
|
|
363
|
+
## Using Pre-built Template Library (Optional)
|
|
364
|
+
|
|
365
|
+
If suitable template resources already exist, use them directly instead of generating new ones:
|
|
366
|
+
|
|
367
|
+
1. **Copy template**: copy the spec + template SVGs into the project's `templates/`, and any bundled bitmaps into the project's `images/` (the runtime image pool, referenced as `../images/`)
|
|
368
|
+
2. **Adjust colors**: Modify colors per the project design spec
|
|
369
|
+
3. **Customize**: Make project-specific adjustments
|
|
370
|
+
|
|
371
|
+
This section describes downstream reuse. The `Template_Designer` role itself is responsible for creating or normalizing the reusable library asset first.
|
|
372
|
+
|
|
373
|
+
**Example library structure** (query the appropriate kind's index — `templates/layouts/layouts_index.json` for structure-only templates, `templates/decks/decks_index.json` for full-PPT replicas, `templates/brands/brands_index.json` for identity-only presets):
|
|
374
|
+
|
|
375
|
+
```
|
|
376
|
+
templates/
|
|
377
|
+
├── brands/
|
|
378
|
+
│ ├── anthropic/ # Anthropic brand identity (logo + colors + typography)
|
|
379
|
+
│ └── google/ # Google brand identity
|
|
380
|
+
├── layouts/
|
|
381
|
+
│ ├── academic_defense/ # Academic-defense structure (no identity)
|
|
382
|
+
│ └── pixel_retro/ # Pixel retro / cyberpunk structure (no identity)
|
|
383
|
+
└── decks/
|
|
384
|
+
├── 招商银行/ # China Merchants Bank full PPT replica
|
|
385
|
+
└── 中国电建/ # PowerChina full PPT replica
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
---
|
|
389
|
+
|
|
390
|
+
## Phase Completion Checkpoint
|
|
391
|
+
|
|
392
|
+
```markdown
|
|
393
|
+
## Template_Designer Phase Complete
|
|
394
|
+
|
|
395
|
+
- [x] Read `references/template-designer.md`
|
|
396
|
+
- [x] Replication mode confirmed: `standard` | `fidelity` | `mirror`
|
|
397
|
+
- [x] Every page listed in `design_spec.md §V Page Roster` saved to `templates/<layouts|decks>/<template_name>/` (decks for full-PPT replicas, layouts for structure-only)
|
|
398
|
+
- [x] Naming convention applied (standard / fidelity: letter-suffix variants; mirror: `<NNN>_<page_type>.svg`)
|
|
399
|
+
- [x] Templates follow design spec (colors, fonts, layout)
|
|
400
|
+
- [x] Placeholder markers are clear and standardized (standard / fidelity); mirror SVGs contain **no** `{{}}` markers
|
|
401
|
+
- [ ] **Next step**: Validate assets and register the template via `register_template.py <id> --kind <deck|layout>`
|
|
402
|
+
```
|