zcbot/skills/ppt/templates/layouts
caoqianming 5d23ee682b fix(ppt): 修生成 PPT 缺图标(图标管线四层断点)+ 沙箱 SVG 预览渲染(bump 0.33.3)
查真实用户两个「ppt生成」任务的 DB 执行轨迹:24 页 SVG 共 0 个 <use data-icon>。
根因是图标管线四环节无一强制图标落地——策略层(有时)锁图标,执行层不放、
质检层不拦、工具层还断着。四层一起修:

- B 工具断点:references/SKILL 23 处路径仍指向已不存在的 skills/ppt-master/
  (zcbot 是 skills/ppt/)→ 模型 `ls .../icons/<lib>/|grep` 验名得空集 → 放弃图标;
  且 strategist 强制用的 icon_sync.py 在 zcbot 根本没有(GATE 空转,正是某任务连
  图标都没锁的原因)。修:全量改路径(保留上游署名)+ 新建 icon_sync.py(复用
  embed_icons 解析,验名+拷进 project/icons,缺名非零退出)。
- A 质检兜底(硬门):svg_quality_checker 加图标校验——锁了 icons.library + 非空
  inventory 但全 deck 0 图标 → deck 级 error 退非零(逼回执行重写);单页 0 图标 →
  warning(封面/分节/breathing/尾页豁免)。
- C 执行强制:executor-base §4 + SKILL 执行纪律改为"内容页必须放 1–3 个 inventory
  图标"(自由设计无模板可继承图标,只能逐页手写)。
- D 导出兜底(纵深):svg_to_pptx 导出前预扫,锁了 inventory 却 0 图标 → stderr 大声
  [WARN](非致命,防跳过质检直接导出)。核实 native 转换器本就自己从图标库展开
  <use data-icon>,故原设想的"finalize 硬前置"前提不成立,D 改成与 A 同源的导出层警告。

同版附带修 svg_preview.py 在沙箱里渲不出 SVG(报"未找到 Chrome / Edge"):移植自
ppt-master 的 find_browser() 只认 Windows chrome/msedge,不认镜像自带 /usr/bin/chromium
(给 mermaid 装的)→ 视觉验收这关在容器里全程失效。对齐 rendering/pdf.py 发现逻辑
(认 chromium/chromium-browser/google-chrome + $CHROMIUM 覆盖);render() 补容器必需的
--disable-dev-shm-usage + 临时 --user-data-dir;并修一个静默已久的 bug——--screenshot
传相对路径 chromium 写不出文件(原代码吞 stderr,看着和"没浏览器"一样),改传绝对路径
并暴露 chromium stderr。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 13:59:00 +08:00
..
academic_defense feat(ppt): skill 重构为 SVG-first(移植 ppt-master,弃 python-pptx 版式件)(bump 0.33.0) 2026-06-29 16:38:58 +08:00
ai_ops feat(ppt): skill 重构为 SVG-first(移植 ppt-master,弃 python-pptx 版式件)(bump 0.33.0) 2026-06-29 16:38:58 +08:00
government_blue feat(ppt): skill 重构为 SVG-first(移植 ppt-master,弃 python-pptx 版式件)(bump 0.33.0) 2026-06-29 16:38:58 +08:00
government_red feat(ppt): skill 重构为 SVG-first(移植 ppt-master,弃 python-pptx 版式件)(bump 0.33.0) 2026-06-29 16:38:58 +08:00
medical_university feat(ppt): skill 重构为 SVG-first(移植 ppt-master,弃 python-pptx 版式件)(bump 0.33.0) 2026-06-29 16:38:58 +08:00
pixel_retro feat(ppt): skill 重构为 SVG-first(移植 ppt-master,弃 python-pptx 版式件)(bump 0.33.0) 2026-06-29 16:38:58 +08:00
psychology_attachment feat(ppt): skill 重构为 SVG-first(移植 ppt-master,弃 python-pptx 版式件)(bump 0.33.0) 2026-06-29 16:38:58 +08:00
zongyuan_red feat(ppt): skill 重构为 SVG-first(移植 ppt-master,弃 python-pptx 版式件)(bump 0.33.0) 2026-06-29 16:38:58 +08:00
README.md fix(ppt): 修生成 PPT 缺图标(图标管线四层断点)+ 沙箱 SVG 预览渲染(bump 0.33.3) 2026-06-30 13:59:00 +08:00
layouts_index.json feat(ppt): skill 重构为 SVG-first(移植 ppt-master,弃 python-pptx 版式件)(bump 0.33.0) 2026-06-29 16:38:58 +08:00

README.md

Layout Templates

Layout = structure-only template. Captures canvas, page structure, page types, and SVG roster — but no identity segment (color / typography / logo / voice / icon style). Layered identity comes from templates/brands/ or is decided per-deck in Strategist's Eight Confirmations. For full-identity replicas of specific PPTs, see templates/decks/ instead.

Single source of truth for what layouts exist: layouts_index.json (layout_id → { summary, canvas_format, page_count, page_types }). This README explains the kind; it does not enumerate layouts.

Full data model: docs/zh/templates-architecture.md.


Trigger rule

Layout selection is opt-in by explicit path. The main workflow defaults to free design. A layout is only used when the user gives an explicit directory path in their initial message (e.g. skills/ppt/templates/layouts/academic_defense/). Bare names do not trigger. See SKILL.md Step 3.

layouts_index.json is a discovery aid, not a trigger — it lets the AI answer "what layouts exist?" by listing ids and paths. Listing alone never advances the pipeline.


design_spec.md schema

Layouts write structure-only segments. Identity sections (Color Scheme / Typography / Logo / Voice / Icon Style) are forbidden — those belong to brands and decks. Minimum schema:

---
layout_id: <slug>
kind: layout
summary: <one-line use cases>
canvas_format: ppt169
page_count: 5
page_types: [cover, toc, chapter, content, ending]
---

# [Template Name] - Design Specification

## I. Template Overview         # Use cases / Design intent
## II. Canvas Specification     # Format / Dimensions / viewBox / Margins
## III. Page Structure          # Layout grid / Decorative DNA / Navigation
## IV. Page Types               # Per-page role descriptions
## V. SVG Page Roster           # File list + per-file purpose

Layouts may include additional supporting sections (Layout Patterns, Spacing Guidelines, SVG Technical Constraints, Placeholder Specification, Usage Notes). Do not include Color Scheme or Typography sections — those are identity-segment fields owned by templates/brands/ and templates/decks/.


Standard file set per layout directory

Filename Required Purpose
design_spec.md Yes Layout schema spec (frontmatter + structure sections)
01_cover.svg Yes Cover page
02_toc.svg Optional Table of contents
02_chapter.svg Yes Chapter page
03_content.svg Yes Content page
04_ending.svg Yes Ending page

All SVGs use viewBox="0 0 1280 720" for ppt169.


Placeholder convention

Templates use {{PLACEHOLDER}} to mark replaceable content. New layouts should use the canonical placeholder set documented in references/template-designer.md. Templates with intentionally different vocabulary declare a placeholders: block in design_spec.md frontmatter to silence advisory warnings.


Creating a new layout

  1. Run workflows/create-template.md (default produces a deck; explicit "structure only / no identity" option produces a layout)
  2. Resulting directory lands under templates/layouts/<id>/
  3. Validate: python3 skills/ppt/scripts/svg_quality_checker.py templates/layouts/<id> --template-mode --format ppt169
  4. Register: python3 skills/ppt/scripts/register_template.py <id> --kind layout

The register step updates layouts_index.json — the single source of truth for layout discovery.


SVG technical constraints

See shared-standards.md for the authoritative ban list (PPT incompatibilities, raw-character rules, clipPath conditional allowance, etc.). Layouts must comply.