From 13835a315a95c12deb2662b816a78f6ee41614c0 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 30 Jun 2026 15:57:52 +0800 Subject: [PATCH] =?UTF-8?q?feat(ppt):=20=E5=8A=A0=E5=95=86=E5=8A=A1?= =?UTF-8?q?=E7=BA=A2=E5=93=81=E7=89=8C=E9=A2=84=E8=AE=BE=20+=20=E9=85=8D?= =?UTF-8?q?=E5=9B=BE=E9=BB=98=E8=AE=A4=E4=B8=BB=E5=8A=A8=E6=8F=90=E8=AE=AE?= =?UTF-8?q?(bump=200.33.5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 用户两个需求:(1) 加一款红色主题;(2) 用户没给图时在需要处主动配图。 - 商务红品牌预设:新增 templates/brands/business-red/design_spec.md(同 anthropic 格式:#C00000 全色表 + primary-deep/gold/info/positive/alert/surface/border/muted 派生色 + 宋体标题/黑体正文字体栈(栈尾收预装字体)+ 实心图标偏好 + 政企口吻;无 logo,注明用文字 wordmark / 可后补)+ brands_index.json 加条目。红色承载在 brand 而非 visual-style(后者不带色)。同时把商务红设为 strategist §e 默认配色候选:中文 政企/集团/科研商务汇报默认列入 ≥3 候选(红金 #BF9B5F / 红蓝 #2B4C7E 二选一点缀, 纯红只压标题/关键数据)。SKILL §默认主题 + 八条对齐 h 行同步指向。 - 配图默认主动提议:strategist §h + SKILL h 行改——用户没给图时不再默认整本 A (no images);封面/分节/概念/breathing/氛围页主动把 ai 配图作为候选提给用户(数据/ 列表/流程页仍走图表→§VII,不配装饰图)。仍全程 gated:用户在 h 确认 + imagegen 自带成本门(提议免费,确认才花钱)。 附:scripts/config.py 的 INDUSTRY_COLORS 未移植(ppt-master 残留引用),strategist 文档表是实际依据,已直接在表里加商务红行。 Co-Authored-By: Claude Opus 4.8 (1M context) --- PROGRESS.md | 8 +- core/__init__.py | 2 +- skills/ppt/SKILL.md | 6 +- skills/ppt/references/strategist.md | 5 ++ skills/ppt/templates/brands/brands_index.json | 4 + .../brands/business-red/design_spec.md | 80 +++++++++++++++++++ 6 files changed, 100 insertions(+), 5 deletions(-) create mode 100644 skills/ppt/templates/brands/business-red/design_spec.md diff --git a/PROGRESS.md b/PROGRESS.md index e1d8349..fae9845 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -2,7 +2,7 @@ > 配合 `DESIGN.md`。本文件只记 phase 状态、决策偏差、文件量、下一步。每条 1-2 句:做了啥 + 关键判断;细节查 `git log` / `git diff` / `DESIGN §7.9`。 -最后更新:2026-06-30(ppt skill 修"缺图形":扁平 deck 质检 gate + strategist 视觉下限强制 + bump 0.33.4) +最后更新:2026-06-30(ppt skill 加商务红品牌预设 + 配图默认主动提议 + bump 0.33.5) --- @@ -21,6 +21,12 @@ ## 已完成关键能力 +### 2026-06-30 / ppt skill 加商务红品牌预设 + 配图默认主动提议(bump 0.33.5) +用户两个需求:(1) 加一款红色主题;(2) 用户没给图时在需要处主动配图。 +- **商务红品牌预设**:新增 `templates/brands/business-red/design_spec.md`(同 anthropic 格式:#C00000 全色表 + primary-deep/gold/info/positive/alert/surface/border/muted 派生色 + 宋体标题/黑体正文字体栈 + 实心图标偏好 + 政企口吻;无 logo,注明用文字 wordmark / 可后补)+ `brands_index.json` 加条目。**红色承载在 brand 而非 visual-style**(visual-style 不带色)。同时把**商务红设为 strategist §e 默认配色候选**:中文政企/集团/科研商务汇报默认列入 ≥3 候选(红金 #BF9B5F / 红蓝 #2B4C7E 二选一点缀,纯红只压标题/关键数据)。SKILL §默认主题 + 八条对齐 h 行同步指向。 +- **配图默认主动提议**:strategist §h + SKILL h 行改——用户没给图时**不再默认整本 A(no images)**;封面/分节/概念/breathing/氛围页主动把 ai 配图作为候选提给用户(数据/列表/流程页仍走图表→§VII,不配装饰图)。仍全程 gated:用户在 h 确认 + imagegen 自带成本门(提议免费,确认才花钱)。 +> 附:`scripts/config.py` 的 INDUSTRY_COLORS 未移植(又一处 ppt-master 残留引用),strategist 文档表是实际依据,已直接在表里加商务红行。 + ### 2026-06-30 / ppt skill 修「生成的 PPT 缺图形」:扁平 deck 质检 gate + 策略层视觉下限(bump 0.33.4) 延续缺图标排查,统计最近 ppt生成 任务 24 页 SVG 的元素构成:**``=0、``=0**,整本是 `` 摞 ``(文字方块),零示意图/图表/配图。根因同图标——71 个 `charts/` 模板没用、content→版式映射形同虚设,且策略层把"Not every page needs a chart"当跳过口子(spec_lock 实际 `page_layouts: free design`、无 page_charts 段),输出层无 gate 拦扁平 deck。两层修(用户选定): - **A' 输出 gate(svg_quality_checker)**:统计每页图形图元 `///`(`rect`/`line` 是版面脚手架不算);**≥6 页且文字密集(avg ``≥10/页)却全 deck 0 图元 → deck 级 error 退非零**;多数页无图元 → INFO;<6 页豁免(不误伤极简/teaser)。实测:8 页文字方块→exit 1;任一页带 path→放行;4 页→豁免。 diff --git a/core/__init__.py b/core/__init__.py index cbece73..999392e 100644 --- a/core/__init__.py +++ b/core/__init__.py @@ -1,3 +1,3 @@ # zcbot 版本号单一事实源:web/app.py 的 FastAPI version、/healthz 返回、前端展示都引这里。 # 改版本只动这一行。 -__version__ = "0.33.4" +__version__ = "0.33.5" diff --git a/skills/ppt/SKILL.md b/skills/ppt/SKILL.md index 782c2ca..c68bf77 100644 --- a/skills/ppt/SKILL.md +++ b/skills/ppt/SKILL.md @@ -67,8 +67,8 @@ description: 生成 PowerPoint 演示文稿 (.pptx) 文件。✅ 触发:用户 **默认不锁死配色**:策略阶段根据**内容 + 受众 + 选定的 visual_style** 派生一套协调配色与版式(在 spec 阶段给用户 ≥3 个配色/风格候选挑)。模板是地板也是天花板 —— 默认自由设计让版面跟着内容走,而非被固定语汇框死。 -- 商务红 `#C00000` / 中建材等品牌色,只作为**候选之一**;用户点名("做成蓝色 / 用我们公司紫色")或素材里有 brand guideline → 按其锁定。 -- 想用模板/品牌库 → 用户给 `templates/` 下的明确路径才触发(见 strategist.md 模板分发);不主动猜、不模糊匹配。 +- 商务红 `#C00000` / 中建材等品牌色,作为**候选之一**;**中文政企/集团/科研商务汇报默认就把商务红列进 ≥3 配色候选**(见 strategist.md §e)。用户点名("做成蓝色 / 用我们公司紫色")或素材里有 brand guideline → 按其锁定。 +- 现成一款 **`business-red` 商务红品牌预设**(`templates/brands/business-red/`:#C00000 全色表 + 宋体标题 + 实心图标);用户说"红色 / 商务红 / 中建材风"→ 指给他按路径 opt-in,或直接锁其配色。其它品牌/模板同理:**用户给 `templates/` 下明确路径才触发**(见 strategist.md 模板分发),不主动猜、不模糊匹配。 --- @@ -91,7 +91,7 @@ description: 生成 PowerPoint 演示文稿 (.pptx) 文件。✅ 触发:用户 | e | 配色 | 按 visual_style + 内容**派生 ≥3 套候选**(每套含 bg/primary/accent/text…);自由设计默认 | | f | 图标 | 选 1 个库(tabler-outline 等),stroke 库要定 stroke_width;**锁 inventory 前 `ls templates/icons//|grep` 验名** | | g | 字体 + 字号 | CJK+Latin 字体栈(栈尾必须是预装字体,见 shared-standards §字体);正文字号按投递目的一个定值;公式策略 mixed/render-all/text-only | -| h | 配图 | `none`/`ai`(走 imagegen skill)/`provided`/`placeholder`;ai 要定 image_rendering + image_palette(deck 级锁) | +| h | 配图 | `none`/`ai`(走 imagegen skill)/`provided`/`placeholder`;ai 要定 image_rendering + image_palette(deck 级锁)。**用户没给图时别默认整本 none**:封面/分节/概念/氛围页主动把 `ai` 配图作为候选提给用户(数据/列表/流程页仍走图表→§VII,不配装饰图);提议免费,只有用户确认后 imagegen 才花钱(成本门见阶段二)。见 strategist.md §h | **逐页大纲**(写进 design_spec.md §IX,也是 spec_lock 的 page_rhythm/page_layouts 依据):**论断式标题 + 每页标节奏**(`anchor`/`dense`/`breathing`)。三条硬纪律(大纲阶段定死): - **论断标题**:写结论不写主题("渗透率破 60%" 不是 "行业背景"); diff --git a/skills/ppt/references/strategist.md b/skills/ppt/references/strategist.md index 95f1bbc..323f81f 100644 --- a/skills/ppt/references/strategist.md +++ b/skills/ppt/references/strategist.md @@ -117,6 +117,9 @@ Proactively provide a color scheme (HEX values) based on content characteristics | Technology / Internet | `#1565C0` Bright Blue | Innovative, energetic | | Healthcare / Health | `#00796B` Teal Green | Professional, reassuring | | Government / Public Sector | `#C41E3A` Red | Authoritative, dignified | +| 中文政企 / 集团 / 研究院所 商务汇报 | `#C00000` 商务红 | 庄重、权威、结论先行(中建材系商务红) | + +> **商务红 default candidate.** For Chinese state-enterprise / group / research-institute business decks (工作汇报 / 述职 / 方案评审 / 年度总结 / 科技成果), offer **商务红 `#C00000`** as one of the ≥3 color candidates by default — it is the conventional, expected business color in this context. Anchor a red-dominant scheme on it: pair with a 鎏金 `#BF9B5F` *or* 沉靛蓝 `#2B4C7E` accent (red-gold or red-blue, pick one as the point accent), warm off-white surface (`#FBF5F5`), and reserve solid `#C00000` for headings / key data / one color block — never a full-canvas red. A ready-made bundle of exactly this (palette + serif-title typography + filled-icon style) ships as the **`business-red` brand preset** (`templates/brands/business-red/`); when the user wants "红色 / 商务红 / 中建材风" point them at it (apply by explicit path per Step 3) or lock its palette inline. **Color rules**: 60-30-10 rule (primary 60%, secondary 30%, accent 10%); text contrast ratio >= 4.5:1; no more than 4 colors per page. @@ -342,6 +345,8 @@ The script renders PNGs into `images/`, trying `codecogs`, `quicklatex`, `mathpa | **D** | Web-sourced | Real-world reference imagery, editorial support, stock-style needs (no API key required for default providers) | | **E** | Placeholders | Images to be added later | +> **Default toward imagery on framing pages — don't silently default the whole deck to A.** When the user provided **no** images, do not quietly pick A "no images" deck-wide. Proactively propose AI imagery (C) on the pages where it lifts the deck most — **cover, section dividers, single-concept / `breathing` pages, atmosphere / backdrop moments** — and surface it as one of the image-strategy candidates the user picks from. Keep **data / list / process / comparison pages chart- and diagram-driven** (route those to §VII visualizations, not §VIII imagery) — imagery is for framing and concept, not for decorating dense content. A "no images" is the right call only when the deck is genuinely all-data / operational and imagery would add nothing — then **say so explicitly** rather than defaulting there by omission. Everything stays gated: the user confirms image usage here, and AI generation runs through imagegen's own **cost-confirmation gate** (SKILL.md Step 4 / 阶段二) — *proposing* costs nothing, only *confirmed generation* spends. + > 🚧 **GATE — know your resources before recommending.** `images/` is a live working folder (source-extracted pictures, user drops, later replacements), so its facts are **re-derived on use, never trusted from a stale store**. Before recommending image usage, if `images/` is non-empty, regenerate the inventory from whatever is currently in it, then read it back: > > ```bash diff --git a/skills/ppt/templates/brands/brands_index.json b/skills/ppt/templates/brands/brands_index.json index 37995c0..c1bb571 100644 --- a/skills/ppt/templates/brands/brands_index.json +++ b/skills/ppt/templates/brands/brands_index.json @@ -6,5 +6,9 @@ "google": { "summary": "Google brand identity — multi-product corporate decks, developer events (Google I/O style), education and training in the Google ecosystem", "primary_color": "#4285F4" + }, + "business-red": { + "summary": "商务红 (Business Red) — 中文政企/集团/研究院所商务汇报、述职、方案评审、年度总结;商务红 #C00000(中建材系同色),庄重结论先行,红金/红蓝配,实心图标,宋体标题", + "primary_color": "#C00000" } } diff --git a/skills/ppt/templates/brands/business-red/design_spec.md b/skills/ppt/templates/brands/business-red/design_spec.md new file mode 100644 index 0000000..6a16563 --- /dev/null +++ b/skills/ppt/templates/brands/business-red/design_spec.md @@ -0,0 +1,80 @@ +--- +brand_id: business-red +kind: brand +summary: 商务红 (Business Red) identity — 中文政企/科研/集团商务汇报,商务红 #C00000(中建材系商务红同色);庄重、结论先行、红金/红蓝配 +primary_color: "#C00000" +--- + +# 商务红 Business-Red Brand Specification + +> Identity-only preset (no SVG page roster — pages are composed freely under these constraints). +> A **generic** Chinese business / state-enterprise / research-institute identity anchored on +> 商务红 `#C00000` (the PowerPoint "Dark Red", also 中建材系商务红). Not tied to one organization +> — reuse for 总院 / 集团 / 政企 / 科研 decks. To bind a real organization, drop its logo into this +> directory and fill §IV (see Logo note). + +## I. Brand Overview + +| Property | Value | +|---|---| +| Brand Name | 商务红 (Business Red) | +| Use Cases | 政企 / 集团 / 研究院所 工作汇报、述职、方案评审、年度总结、科技成果汇报、对外宣讲 | +| Tone | 庄重、严谨、结论先行、克制;权威而不浮夸(红为主、金/蓝点缀,避免大面积纯红刺眼) | + +## II. Color Scheme + +| Role | HEX | Provenance | Notes | +|---|---|---|---| +| primary | `#C00000` | fact | 商务红 — 主色(= PowerPoint 标准"深红",中建材系商务红同色)。标题强调、主色块、主图表系列 | +| primary-deep | `#8A0000` | approx | 深绛红 — 主红暗阶。表头、深色页底、强调描边、悬停/选中态 | +| neutral-dark | `#1A1A1A` | approx | 近黑 — 正文、深色面、图表基线/坐标轴 | +| bg | `#FFFFFF` | fact | 纯白页面背景 | +| accent (gold) | `#BF9B5F` | approx | 鎏金/古铜 — 点缀、金线分隔、奖项/关键数据高亮。红金为政企/官方经典搭配,显厚重 | +| accent (info) | `#2B4C7E` | approx | 沉靛蓝 — 流程/链接/可交互/第二数据系列。冷色平衡暖红,红蓝是另一套稳重搭配 | +| accent (positive) | `#2E7D32` | approx | 墨绿 — 推荐项、正向、达标、增长 | +| accent (alert) | `#E08A1E` | approx | 琥珀橙 — 风险/提醒/预警(刻意避开与主红撞色,不要再用一种红表示警示) | +| surface | `#FBF5F5` | approx | 暖调微红的卡片底/面板,比纯白略沉,承托内容 | +| border | `#ECDCDC` | approx | 暖浅灰 — 卡片边、分隔线、表格栏线 | +| muted-text | `#6E6260` | approx | 暖灰 — 次要文字、注释、图表标签、页码/出处 | + +第 1–4 行(primary / primary-deep / neutral-dark / bg)是身份骨架;gold / info / positive / alert / +surface / border / muted 是其上的演示约定色,按政企商务气质派生。语义三元组(info=流程 / positive= +推荐 / alert=风险)用于区分内容类型。**纪律**:红为主、金或蓝二选一作点缀主调(不要红金蓝同台喧宾); +大面积底色用 bg/surface,纯 `#C00000` 只压在标题条、关键数据、主色块等"少而重"的位置 —— 避免满屏 +红的廉价感。Strategist 可按页轮换主色支配比例。 + +## III. Typography + +| Role | Family | Weight | +|---|---|---| +| title | `"Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", "SimSun", serif` | 600–700 | +| body | `"Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", "PingFang SC", sans-serif` | 400 | + +> 宋体系标题给政企/官方的庄重感,黑体正文保清晰。两条字体栈尾都收在 **预装字体**(`SimSun` / +> `Microsoft YaHei`,见 shared-standards §字体),无运行时回退也不会掉成系统默认。若部署机装了思源 +> 宋体/黑体(沙箱镜像的 `fonts-noto-cjk` 即 Noto CJK),会优先吃到更优字形。纯数字/西文标号可另配 +> 一款衬线数字体(如 `Georgia`)增强财务/数据页质感,非必须。 + +## IV. Logo + +**本预设不绑定具体机构 logo**(通用商务红身份)。默认用机构中文全称作**文字 wordmark**: +- 封面:机构全称用 title 衬线体,`primary`(`#C00000`)或 `neutral-dark`,压在左下/居中;副标题用 body。 +- 页眉/页脚:可放机构简称小字 + 一条 `primary` 细色条作版式锚点;不要每页堆砌。 +- 要绑真实机构:把其 logo 存成 `./_logo.svg` 放进本目录,在此表补一行(File / Form / Usage), + 并按 anthropic 预设的 Logo 段写清留白(≥0.5× logo 高)、用色(单色优先 `primary` 或随页文字色)、 + 封面 vs 页内的取用规则。 + +## V. Voice & Tone + +- 正式度:正式、书面、政企汇报口吻;结论先行。 +- 人称:我们 / 各位(中文);单位自称用机构简称。 +- Emoji:避免(政企/官方场合不用)。 +- 缩略语 / 术语:首次出现给中文全称(必要时附英文/缩写),后文再用简称。 + +## VI. Icon Style + +- Preference: filled(实心) + +> 政企/官方汇报偏稳重厚实,实心图标比线性更压得住场。用 `templates/icons/` 时优先 `tabler-filled` / +> `chunk-filled` 实心库,不要 outline 线性库(太轻,与庄重调性不符)。图标用色走 `primary` / +> `primary-deep` / `neutral-dark`,点缀可用 `gold`;一套库到底,不混库。