Pinvou/pinvou-agent / pinvou3-app/src-tauri/resources/common/bundle/wecom-skills/wecomcli-pptx
wecomcli-pptx
Verified何时用:仅当用户明确指向企业微信 PPT/演示文稿(生成在线 PPT、编辑在线 PPT、导入本地 .ppt/.pptx)时使用;泛指做文档/表格默认走本地工具。「做个PPT」「写份汇报PPT」「把文档转成PPT」「改第3页标题」或需要能讲的分页材料(周会/汇报/路演/课件)时触发;一律作用于企微在线 slide 文档,交付在线链接;不支持编辑本地文件、无导出能力;仅读取本地 PPT 改用 wecomcli-media。
references/component-image.md
View on GitHub---
name: component-image
description: Image 图片组件规范 — 材料图来源约束、objectFit、SVG 边界与资源自检
---
# Image 组件规范
Image 是本 DSL 中承载**位图 / 照片**的组件,继承 Box 所有属性。
🔴 **`src` 直接写上传口返回的 `url`。** 先把图传过上传口拿 `url`,再把它填进 `src`,服务端编译时下载渲染。**不接受**本地路径、base64、任何公网图片直链。完整通道说明见 `pptx-api.md` §配图接口。
## 基础用法
```jsx
<Image src="https://...(上传口返回的 url)" style={{ width: 400, borderRadius: 12 }} />
```
```jsx
<Image
src="https://...(上传口返回的 url)"
style={{ width: '100%', height: '100%', objectFit: 'cover' }}
/>
```
## 属性速查
| 属性 | 说明 |
| :--- | :--- |
| `src` | **必填**。上传口返回的 **`url`**。服务端编译时下载渲染。**不接受**本地路径、base64、公网图片直链 |
| `style.width` / `style.height` | 显示尺寸,**由 `DESIGN.md` 图位布局决定**。原图与图位宽高比不一致时用 `objectFit` 适配,不要为迁就原图改布局 |
| `style.objectFit` | `'cover'`(裁切填满,默认推荐) / `'contain'`(完整显示,可能留白) / `'fill'`(强制拉伸,不推荐) |
| `style.clipPath` | 裁切形状(圆形 / 多边形 / SVG path) |
| `style.border` / `style.borderRadius` | 边框、圆角 |
| `style.opacity` | 透明度 |
| `style.filter` | CSS 滤镜(`blur` / `grayscale` / `brightness` 等) |
## 配图前置流程(先图后写,强制)
> 所有图片必须在写页面源码之前完成获取与核对。严禁先写源码占位后补图——会导致布局比例与图片不匹配。
> **取消搜图策略**:位图只来自用户材料(上传图、材料抽取图、用户明确提供的品牌 / 产品 / 人物 / 场景图片),其余视觉元素用 `<SVG>` 或版式设计承载。
### P0 · 材料图(已有可信图片,最高优先级)
用户上传材料、`scripts/doc_image_extractor.py` 抽取图、用户明确提供的品牌 / 产品 / 人物 / 场景图片,是**优先级最高**的配图来源。高置信度场景必须优先使用材料中原有的图片。
> **用户直接发进对话的图到手是 `media_id`**:`wecom-cli smartpage images upload` 可直接吃 `media_id`,**无需落地成本地文件**。材料**内嵌**的图(pptx/docx/xlsx 里的图)才需要先下载文档、用 `doc_image_extractor.py` 抽出本地文件。见 `pptx-api.md` §配图接口。
⚠️ **材料图先上传拿 `url`,再把 `url` 直接写进 JSX 的 `src`**:
1. 上传(直接调 CLI,无需脚本):`media_id` 优先 —— `wecom-cli smartpage images upload --json '{"docid": "<DOCID>", "media_id": "<MEDIA_ID>"}'`;本地文件改传 `file_path`;
2. 写本页源码:`<Image src="<url>" style={{ width, height, ... }} />`,与文字、图表同页一次性插入。
具体命令见 `pptx-api.md` §配图接口。
🔴 **材料图一律原图直传、零重绘**——任何二次加工都会让数字、文字、细节走样。
使用前须逐张核对内容、比例、清晰度。
### P1 · 无生图工具(不支持 AI 配图)
**当前环境没有生图工具,不提供 AI 配图能力。** 不要尝试调用任何生图接口、不要反复重试、不要换其他方式生图。见 `pptx-api.md` §配图接口。
材料里没有可用位图的图位(L1 主视觉、封面主图、章节过渡页、左右图文页主图等),改用 `<SVG>` / 色块 / 版式留白 / 巨型数字 / 图表承载,并在 `DESIGN.md` 配图清单标注该图位为「版式替代」。**不主动告知用户"没有 AI 配图 / 已用版式替代"**——版式替代是正常设计手段,交付时不需要解释;仅当用户明确要求 AI 生图 / 照片级配图时才说明当前不支持。P0 材料图与 P2 SVG 两条路径**不依赖生图工具**,可独立完成。
### P2 · SVG(结构化 / 低语义元素)
`<SVG>` 用于结构化、抽象化、低语义或品牌化元素:流程图、时间轴、矩阵、漏斗、架构图、关系网络、图表底图、巨型数字、趋势箭头、进度环、L3 角标、印章、页脚纹样、背景网格、抽象几何概念页。
在没有可用材料图时,`<SVG>` / 色块 / 版式留白也是 L1 / L2 图位的正式承载方式。禁止把 L3 角标或 200×70 小装饰当作 L1/L2。
### 引用前自检
每张图在用于页面前必须确认四件事:
1. **内容正确**:图片主体与页面语义一致。
2. **比例可用**:能适配页面中的 L1 / L2 位置,不会裁掉关键主体。
3. **清晰度足够**:放到演示文稿中不糊。
4. **风格统一**:全篇图片属于同一视觉类型(摄影 / 插画 / 3D / 水墨等),不混用。
```jsx
<Image src="https://...(上传口返回的 url)" style={{ width: 400, height: 225, objectFit: 'cover' }} />
// src 写上传口返回的 url;尺寸按 DESIGN.md 图位,objectFit 适配原图宽高比
```
## 严禁事项
- **`src` 只写上传口返回的 `url`**,不得写本地路径 / 公网图片直链 / base64。
- **图片不得自带页面需要精确控制的文字 / Logo**。需要精确文字时用干净背景图 + Slide 文本组件叠加。
- **材料图必须先上传拿 `url`**(`media_id` 优先直传 CLI,本地文件传 `file_path`),不得把本地路径 / `media_id` 写进任何参数。
- **正文页不得使用全屏背景图**。大图以独立组件形式出现(占 50% 宽 / 高),保留页面默认背景在四周可见。
- **不得用 SVG 几何背景代替可用的材料图**——材料里有可用位图的图位必须原图直传使用。
## 图片规划指引
- **配图率**:按项目 `DESIGN.md` 控制图文搭配密度;单页图片 / 图表数量不超过 3 个,总面积不超过内容区 60%。
- **风格一致性**:全篇要么摄影、要么插画、要么 3D 渲染,严禁混用;靠 `DESIGN.md` 声明的统一风格词逐字复用进每张 prompt 保证。
- **强制配图位置**:「左标题 + 右内容」必在右侧顶部或左侧标题下;「分栏」必须有一栏分配给图像。
- **图片清单必填**:项目 `DESIGN.md` 必须记录**来源**(材料图 / SVG / 版式替代 / `—`)、**上传后的 `url`**(位图必经 `smartpage images upload`,写进 `src`)、真实内容、使用页面和是否已核对。
## 扩展能力
- 图片超链接(`<Picture href="...">`)→ [component-hyperlink.md](component-hyperlink.md)
材料图可用(`src` 写上传口 `url`,`href` 随源码一并提交)。
- 入场 / 退出 / 强调动画(`<Animation>` 包裹)→ [component-animation.md](component-animation.md)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |