zcbot/skills/ppt/templates/brands
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
..
anthropic feat(ppt): skill 重构为 SVG-first(移植 ppt-master,弃 python-pptx 版式件)(bump 0.33.0) 2026-06-29 16:38:58 +08:00
google 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
brands_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

Brand Identity Presets

This directory holds brand-only templates: identity bundles (color / typography / logo / voice / icon style) without an SVG page roster. Strategist locks the brand's identity segment as truth; Executor designs pages freely under those constraints.

Brand is one of three template kinds in the library — alongside layouts/ (structure-only) and decks/ (full-PPT replica). Full data model: docs/zh/templates-architecture.md.

How brands are consumed

Brand application follows the same explicit-path rule as all template kinds at SKILL.md Step 3, and lands in the same project directory (<project_path>/templates/):

User input at SKILL.md Step 3 Behavior
An explicit brand directory path (e.g. templates/brands/anthropic/) Copy design_spec.md + logo files + asset subdirectories into <project_path>/templates/; Strategist locks identity segment
Bare brand name only ("use anthropic brand"), brand mention without path, or silence Skip — same mechanical rule as all template kinds: bare names never trigger
Brand path + layout path Fuse into one design_spec.md — brand owns identity segment (color / typography / logo / voice / icon style); layout owns structure segment (canvas / page roster). See SKILL.md Step 3.
Brand path + deck path Fuse — brand identity overrides deck identity; structure + middle segments come from deck
Brand path + layout path + deck path Three-way fuse — brand=identity, layout=structure, deck=middle
Two brand paths Conflict resolution prompt before fusion — user picks per-segment source

brands_index.json is discovery-only; listing brands never advances the pipeline.

Creating a new brand

Run the standalone workflow:

Read skills/ppt/workflows/create-brand.md

Three input paths are supported: brand asset (logo / brand site URL / branded PPTX / brand PDF), verbal spec dictated in chat, or empty skeleton for the user to fill in later.

Package structure

Every brand directory is self-contained:

templates/brands/<brand_id>/
├── design_spec.md            # required — brand identity spec (7 sections)
├── logo.<ext>                # optional — primary brand logo (single-lockup brands)
│   …or…
├── <brand>_wordmark.<ext>    # optional — wordmark variant (dual-lockup brands)
├── <brand>_mark.<ext>        # optional — symbol / icon variant (dual-lockup brands)
├── images/                   # optional — branded photos
├── illustrations/            # optional — branded illustrations
└── icons/                    # optional — branded icon overrides

Logo filenames are descriptive, not contractual — design_spec.md §IV lists the exact files and the contexts in which each is used. Single-lockup brands typically ship one logo.<ext>; dual-lockup brands (e.g. Google's wordmark + G mark) ship separately named files.

design_spec.md carries a YAML frontmatter block with kind: brand and is the single source of truth for the brand identity. The six required sections are: I Brand Overview / II Color Scheme / III Typography / IV Logo / V Voice & Tone / VI Icon Style.

Discovery index

brands_index.json is a slim machine-readable map (brand_id → { summary, primary_color }). It is refreshed by register_template.py --kind brand <brand_id> after a brand is created or edited.

Listing the index does not trigger any pipeline action — Step 3 triggers only on an explicit directory path supplied by the user, regardless of whether the brand appears in the index.