Release PPT workflow 0.7.1 with portable installation and production components

This commit is contained in:
2026-10-12 18:45:54 +08:00
parent 4e3271ff62
commit f932b1970d
40 changed files with 2166 additions and 28 deletions
+2
View File
@@ -14,6 +14,8 @@ A theme switch changes only declared palette and asset properties. Shared canvas
## Icon material handoff
Apply [icon production](icon-production.md) to template reuse and all new authored, generated or external icons. Use a project-local material descriptor for new icons; do not edit a locked vendor snapshot. Whole and partial coloring follow the same contract.
Supply the original SVG, its `paint_contract_data`, selected palette and exact asset bindings together. New vector materials use stable element IDs and adjustable fill/stroke pairs with semantic tokens. Distinct tokens express independent roles; a shared token expresses a shared role. Keep fixed details as literal values and unpainted openings as `structural: none`. Undeclared channels preserve their source paint.
`scripts/paint_asset.py --manifest <path> --theme <id> --asset <role> --output <new.svg>` applies only the selected theme's palette whitelist. It verifies exact IDs, explicit source paint, fixed/structural values and bindings, then protects existing output. It intentionally rejects stylesheets, overridden target channels and inherited target paint; flatten those channels into explicit reviewed attributes before using this helper. Other SVG authoring tools may support richer materials if they preserve the same contract.
+89
View File
@@ -0,0 +1,89 @@
# 可数据绑定的原生图表组件
`chart_component.py`把明确的数据生成一个独立 SVG `g`:其中包含原生 Chart metadata、同源的可见 SVG fallback,以及标题、单位、图例和来源文字。把它组合进所选 template 的页面;组件不复制母版、版式或页面 UI。它是技术组件接口,不替调用者决定报告应使用哪些图表。
## 支持范围
| type/示例数据 | 用途与适配 | 当前技术边界 |
|---|---|---|
| `column`/[column.json](../assets/components/charts/column.json) | 比较少量类别;多系列分组 | 数轴包含零,显式 min/max/major_unit;支持正、负、零 |
| `bar`/[bar.json](../assets/components/charts/bar.json) | 较长类别名称的横向数量比较 | 上游编译器不接受 bar 的 axes;原生应用自动选择范围与刻度,SVG 标尺只作预览;保留真实数值及原生数据标签 |
| `line`/[line.json](../assets/components/charts/line.json) | 按顺序比较变化 | 等间距类别轴、显式数轴;直线与圆点;不把类别轴当成连续日期轴 |
| `scatter`/[scatter.json](../assets/components/charts/scatter.json) | 展示成对的 X/Y 观测 | `points: [[x, y], …]`;两个显式数轴;圆点,无回归拟合 |
| `pie`/[pie.json](../assets/components/charts/pie.json) | 单组非负构成 | 一个系列,总和大于零;零值保留在数据与图例中,不绘制零面积扇形 |
| `doughnut`/[doughnut.json](../assets/components/charts/doughnut.json) | 单组非负构成 | 与 pie 相同;内圈比例75%,与锁定原生编译器一致 |
| `column-stacked`/[column-stacked.json](../assets/components/charts/column-stacked.json) | 比较各类别的总量及组成 | 初版只支持非负堆叠;范围基于各类别总量,不把单个系列最大值当堆叠上界 |
示例全部明确标记 `synthetic-demo`,使用564×464区域,保留单位与来源。它们只演示技术能力,不能作为真实报告证据。图例、文字和轴预留空间不足时工具报错,不自动缩字;改写标签或使用更宽区域后再生成。宽度估算是保守的字符检查,仍需查看目标应用的实际渲染。
这层封装不接受混合图、双轴、百分比堆叠、3D、气泡、时间轴、缺失值、平滑曲线、任意自定坐标轴或额外格式字段。上游可能另有能力,但不能经本组件接口静默转入。需要这些能力时先确认作者路线与支持范围。
## 数据契约
JSON顶层字段:`schema_version: 1`,`data_kind`(`synthetic-demo`/`observed`/`derived`),`type`、非空 `title`、`unit`(允许空字符串)、`series`。`source`可选。scatter可另写`x_unit`,并省略`categories`;其余类型必须提供非空、唯一的`categories`标签。
每个系列有稳定、唯一的`id`、非空`name`,以及与类别同长的`values`,或scatter的非空`points`数组。ID使用`[A-Za-z][A-Za-z0-9_-]{0,63}`。数值必须是JSON数字且有限;布尔值、数字字符串、NaN和无穷均拒绝。为避免SVG/OOXML标量计算溢出或失去有效标签,当前非零数值的绝对值支持`1e-9`至`1e12`,零独立支持。不会补齐长度、删掉零值、改写负数或按百分比重算原始数据。CLI拒绝重复JSON键和未知字段。
`source`只作为显示文字与元数据保留,工具不会读取链接、补充出处或证明其真实性。所有原始数据同时放入marker的`component_data`,供工程审计;原生图表cache及内嵌XLSX保存未缩放的实际数值。
## 样式来源
`style`和`theme`分别使用`template_ref.py export-style`的`style`、`theme_data`。字体从`typography.families.body`取得,字号默认取`caption`角色,缺少时取`label`;按`canvas.pt_to_px`换算。组件没有组织、字体名或十六进制配色的固定默认值。
template可选择声明`style.components.charts`:
```json
{
"series_palette_indices": ["accent1", "accent3", "accent4"],
"text_role": "caption",
"text_palette_index": "dk1",
"grid_palette_index": "line"
}
```
未声明时,系列依次使用已有的`accent1`、`accent3`、`accent4`、`accent5`、`accent6`、`accent2`;文字使用`dk1`,网格使用`line`(缺少时`dk2`),图表背景使用`lt1`。颜色必须为调色板中已存在的六位hex值。系列按数组顺序绑定索引,pie按类别顺序绑定。需要的系列或扇形数超过不同索引数量时明确拒绝,不循环复用颜色。组件不会从系列名称推断状态或改动数据语义。
保持简洁的精细化优先处理信息层次:保留轻网格、统一标签与单位、适度留白,并按比较目的分配颜色。平行系列可用两个主题索引;当作者明确选择一个重点系列时,可在该页风格副本中设置 `series_palette_indices: ["dk2", "accent1"]`,用中性参照配合主题色重点。颜色顺序必须对应明确系列,不从名称或数值自动选择“更好”的一组。
`axis_palette_index` 可将轴线绑定到现有调色板索引,默认跟随文字。`value_labels: true` 为非负分组 `column` 同时生成原生数值标签及同源 fallback;标签使用已声明字号,放不下时报错。默认关闭,不给每一种图表都加数字。bar 本身保留数值标签;其他类型或负值柱图需要按其信息特点另行设计。改动页面风格副本不改变全工程的系列语义;同一系列跨页需由作者保持绑定。
column、line、scatter与非负堆叠的显式数轴和SVG fallback使用同一组范围与步长;全零数轴为0至1。bar受锁定编译器限制,由原生应用自动选轴,并带有`data-native-axis-policy="automatic-bar-preview-scale-may-differ"`声明。显式数轴一致不代表原生应用绘图区、轴文字位置与SVG像素级一致。
## 生成与组合
使用安装方准备的Python环境,在任何目录执行:
```sh
python /path/to/skill/scripts/chart_component.py \
--manifest /absolute/path/to/template/manifest.json \
--theme selected-theme \
--data /absolute/path/to/column.json \
--bounds 64 156 564 464 --id results-chart \
--output /absolute/path/to/new-component.svg
```
CLI选择一个外部template/theme,输出对应canvas的独立组件SVG,拒绝覆盖文件及经符号链接写出。它没有页面的Master/Layout契约,不能直接冒充完整模板页面交给结构化原生导出器。
Python组合接口:
```python
from chart_component import render_chart
component = render_chart(data, exported["style"], exported["theme_data"],
(64, 156, 564, 464), "results-chart")
# page_root是已有模板页,保留其Master/Layout、固定UI、占位符与素材引用。
slot = next(node for node in page_root if node.get("id") == "slot-left")
for child in list(slot):
slot.remove(child)
slot.append(component)
```
`render_chart(data, style, theme, bounds, component_id) -> xml.etree.ElementTree.Element`返回SVG `g`。使用当前页真实槽位的bounds;确认当前template确实有该槽位,不能把示例中的ID、坐标当通用约定。component_id在整页必须唯一。生成后不要单独改fallback图形或marker数据;修改JSON并重新生成,保持fallback指纹和元数据一致。
图例、标题、单位及来源位于marker外,编译为独立可编辑对象;marker内转换为真正的Chart和内嵌XLSX。此安排保持页面文字位置受模板控制。若在PowerPoint内改图表数据,外部图例或构成数量文字不会自动更新,需要一起修改,或从工程JSON重建。将图表JSON和生成工具声明为工程输入并锁定,可在迁移后重建;不能只交付生成的SVG与PPTX。
## 验证与限制
本项目的`check_chart_components.py`验证两theme的7类组件SVG、错误输入拒绝和已有文件保护;实际通过锁定编译器生成7类Chart及正负/全零边界案例,检查原生Chart类型、显式轴、自动bar轴、数值cache、内嵌XLSX、独立标题与合成数据声明。Chart对象的存在以PPTX关系和XML为证据。
这些检查不代表PowerPoint已实际打开、渲染、编辑或完成投影验收。进入真实页面后需按[PowerPoint检查](powerpoint-checks.md)核对字形、标尺、单位、图例、数据与页内分区;页面审阅由负责人按已有逐页流程组织。图表导出失败必须报告,不能用fallback截图宣称已得到原生Chart。
+43
View File
@@ -0,0 +1,43 @@
# Data-bound basic components
`scripts/basic_component.py` provides native tables, text metrics, timelines and explicit linear flows. Use [charts](charts.md) for seven native Chart types. All helpers read the selected external template's style/theme and return a component SVG group; they add no organization, page UI, Master or Layout. Compose groups inside existing declared slots. SVG images inserted through `image href` are not a substitute for this native-object composition.
| Kind and source example | Native result | Input and capacity |
|---|---|---|
| [table](../assets/components/basic/table.json) | PowerPoint Table with actual cells, widths, padding and header rows | `columns`, equal-length `rows`, optional `column_widths` summing to bounds width, zero-based `numeric_columns`; strings or finite numbers, empty cells allowed |
| [table / grouped](../assets/components/basic/table-grouped.json) | Native Table with merged group headers, separate native data bars and explicit status shapes | `variant: grouped`; object columns, explicit groups/widths and original row values; optional focus, row headers, per-column bars and status mapping |
| [metric](../assets/components/basic/metric.json) | Text objects, including number/unit | `label`, `value`, optional `unit` and `detail`; at least160px high |
| [timeline](../assets/components/basic/timeline.json) | Native line, circles and text | 2–6 `items` with `date` and `label`; at least208px high; ordinal milestones spaced equally, not a quantitative elapsed-time axis |
| [flow](../assets/components/basic/flow.json) | Native boxes, arrows and text | 2–6 `nodes` with unique `id`/`label`, explicit `edges: [[from,to], …]`; at least160px high; supports only forward adjacent links, not inferred causality or branches |
Each JSON uses `schema_version: 1` and `kind`. Examples are marked `data_kind: synthetic-demo`; preserve this declaration and source metadata when demonstrating. Real reports retain observations, definitions, missing-value policy and sources under [production rules](production-rules.md). Metadata remains in SVG; save original JSON with the page. The table payload is canonical native metadata, with original data in `data-component-source`; other groups carry original JSON in metadata. Native PPTX does not retain arbitrary SVG metadata, so retain project sources separately.
The table uses `style.components.table`, including theme-indexed header colors and padding. Text uses `typography.roles.label`, `caption` and `number`, their declared font families and `canvas.pt_to_px`. Other component colors use `dk1`, `dk2`, `accent1`, `line` and `lt1` from the palette. Internal spacing uses fixed 8px modules; derived equal columns/centers do not introduce new page alignment guides. Width checks are conservative estimates, not a font renderer. The tool rejects excess capacity instead of shrinking text. Rephrase, enlarge a slot, change layout or split content; inspect actual application output.
## Grouped table
The default table remains unchanged. Select `kind: table, variant: grouped` for a denser comparison with two header levels. Each column is `{id, label, unit?, format?}` with a unique stable ID. `format` is `text` (default), `integer` (integral numbers only, with thousands separators), or `one-decimal`. Formatting changes display text, never original `rows`. `numeric_columns` contains zero-based indices and right-aligns those headers and values. Numeric columns require actual finite numbers rather than formatted strings.
`column_widths` is mandatory and must fill the bounds width. `column_groups: [{label,start,span}, …]` must cover all columns once in order, with no gaps or overlap; spans become merged native cells. `row_header_columns` optionally gives zero-based columns a persistent pale background. `focus_row` optionally emphasizes one explicit zero-based data row; this does not infer a recommendation. Preserve a `focus_meaning` when its interpretation matters.
Optional `bars: {columns: […]}` adds 4px tracks and bars to explicitly declared numeric columns. Values must be finite and nonnegative. Each column has its own domain `[0, maximum]`, with `[0,1]` for an all-zero column. A zero value leaves an empty track. Bars permit comparison only within a column; they do not normalize different units into a score. Save the source, units and `bar_meaning` alongside the page. The outer group's JSON metadata includes `derived_marks` with raw values, domains, row/column indices and geometry so these mappings can be checked.
Optional `status: {column, values: {"label": {palette_index, shape}}}` binds an explicit textual status to `circle` or `diamond` and a palette index. Unknown values, shapes and palette indices fail; the helper does not infer success, caution or failure semantics. Text remains visible alongside the shape. Stable shape IDs derive from the component ID and row/column. These simple semantic marks are native UI shapes; custom illustrative icons still follow [icon production](icon-production.md).
The grouped style reads `typography.roles.label` and `caption`, including each role's declared family, and uses `accent1`, `accent2`, `surface_tint`, `lt1`, `lt2`, `dk1`, `dk2` and `line`. Optional `style.components.table_grouped` keys are `group_height_px`, `header_height_px`, `row_height_px` and `cell_padding_px: [top,side]`. Heights and padding use 8px modules and must meet text capacity. Defaults derive from the external typography; 20pt label / 18pt caption at 96dpi produces 40px group, 80px header and 56px data rows with bars. No font or organization is fixed in the component. Accent group headers, pale column headers, light alternating rows, group separators and a 4px focus edge provide hierarchy without a full grid.
The returned outer `g` contains a separate native-table marker with a fresh fallback fingerprint, followed by native bar/status shapes outside that marker. Insert the **whole outer group** into the page, not just the table marker. Retain its original data and regenerate after changes; never edit only the payload or only the fallback. Use the same `basic_component.py` CLI/API shown below with the grouped JSON and sufficiently large bounds. The bundled example needs 1152px width and 400px height under the stated 20pt/18pt typography.
```sh
python /path/to/skill/scripts/basic_component.py \
--manifest /absolute/template/manifest.json --theme selected-theme \
--data /absolute/project/data/table.json \
--bounds 64 156 564 464 --id results-table \
--output /absolute/project/sources/new-component.svg
```
The CLI protects existing files and symlinked output paths. The output canvas follows the template but contains only the component. It cannot be compiled as a complete template page by itself.
For Python composition, add the Skill's `scripts` directory to `sys.path`, import `render_component` from `basic_component`, and call `render_component(data, style, theme_data, (x,y,width,height), component_id)`. Take `style` and `theme_data` from `template_ref.py export-style`. Insert the returned `g` into the current template page's slot while retaining its existing Master/Layout/placeholder attributes and full roster. A slot label or example content must be removed as part of filling that slot, without removing inherited UI.
After composition, validate native marker payloads using [native objects](native-objects.md). Compile with `native_export.py`, check `a:tbl` for the table and text/shapes/connectors for the other components, then inspect current renders. Keep separate evidence for native structure, application appearance, editing and projection. General architectures, branched flows and custom comparisons can be composed from the same native primitives; this limited helper is not a requirement to fit every diagram into a linear chain.
+28
View File
@@ -0,0 +1,28 @@
# Icon production
Use suitable template icons first. For new icons, prefer directly authored SVG/native shapes for simple forms, ImageGen for complex imagery, and external ready icons as a supplement. Choose a recognizable information meaning and keep stroke weight, corners, perspective, optical scale and detail consistent at the intended size. An icon should remain understandable without nearby explanatory prose, or deliberately reuse the same established icon as its counterpart.
## One deliverable contract for all sources
All routes must support approved whole or partial palette recoloring. Deliver original source, normalized SVG, a paint contract, palette bindings, provenance and preview evidence together. Use stable IDs for semantic parts, explicit fill/stroke attributes and per-channel rules. `palette` permits a semantic token to bind an index; `fixed` preserves an exact literal; `structural` preserves `none`. Unlisted channels preserve their source paint. Shared tokens express shared roles; separate tokens permit independent colors.
Whole-icon coloring means binding every intended adjustable part to one palette index. It never means replacing every matching color in a bitmap. Keep fixed details, white details, opacity, holes, masks, geometry and paint order intact. Validate IDs, explicit source paint, duplicate/missing bindings and palette indices. See [the exact schema](template-interface.md#svg-paint-contract).
For ImageGen or external assets, first separate the semantic parts in the production source. Reconstruct the final icon as compliant SVG/native geometry when necessary. A flat raster with several apparent colors does not identify recoloring permissions. If using a layered/masked intermediate, retain reviewed per-role masks; do not infer them from matching source colors. The bundled paint helper handles explicit SVG fill/stroke, not raster segmentation or gradient-stop recoloring. A fixed-color PNG alone is not a completed adjustable icon.
Keep an exact official mark or evidence image as its original asset when that is its assigned role; do not relabel it as a newly generated icon to bypass source fidelity. Use only the template/user's explicitly permitted identity derivatives.
## Project-local icons
Keep new materials under the caller's project, outside a locked template snapshot. A local material descriptor contains `schema_version: 1`, `id`, project-relative `path` and `paint_contract`, and a `bindings` array of `{selector, channel, palette_index}`. Paths resolve beside the descriptor. The bindings must cover exactly the contract's palette pairs, and at least one pair must be adjustable. This lets an author add an icon without publishing a new template or modifying vendor files.
```sh
python /path/to/skill/scripts/paint_asset.py \
--manifest /absolute/template/manifest.json --theme selected-theme \
--material /absolute/project/assets/new-icon/material.json \
--output /absolute/project/assets/derived/new-icon.svg
```
For a supplied template icon use `--asset <role>` instead of `--material`. Both modes preserve fixed/structural/unlisted channels and protect existing output. The local descriptor supplies bindings to the selected theme's palette; it cannot change that palette. Retain the descriptor and original with the project.
Render the original and derivative on their intended backgrounds at actual use size. Check recognition, consistent optical scale, stroke visibility, fixed details and transparent openings. XML/paint validation is separate from this visual check. Insert resulting geometry into the page's native source when native editing is required; a selectable image alone does not prove native icon objects.
+1 -1
View File
@@ -33,4 +33,4 @@ Keep proposed styles and mockups outside the final template workspace until the
The bundled runtime also carries the upstream preview compiler at `runtime/ppt-master/scripts/template_preview_pptx.py` for author review workspaces. It is source tooling, not a second Skill. Read its command help for a new workspace. Its platform font mapping is general-purpose: a template review wrapper should import the compiler and use `scripts/finalize_theme.py`'s `preserve_declared_font_families(style)` context around the serial compile, then `finalize(...)`. This preserves the declared family before information can be lost to platform fallback. Do not globally replace a fallback font in finished XML: the author may have intentionally used that same font.
For advanced native table/chart/formula or placeholder metadata, inspect the corresponding bundled compiler module and its local CLI help. Do not claim specialized objects from a screenshot or from a successful ZIP export alone. Finish with [render and application checks](powerpoint-checks.md).
For native tables/charts and formula limitations, read [specialized objects](native-objects.md) and its bundled minimal SVG examples. For placeholder metadata, inspect the corresponding bundled compiler module and local CLI help. Do not claim specialized objects from a screenshot or from a successful ZIP export alone. Finish with [render and application checks](powerpoint-checks.md).
+33
View File
@@ -0,0 +1,33 @@
# Specialized native objects
The maintained SVG compiler creates native tables and charts from explicit group markers. Start with [table.svg](../assets/native-objects/table.svg) or [chart.svg](../assets/native-objects/chart.svg). These are isolated compiler examples, not selected-template pages. Their Arial font, colors and geometry are explicit sample values; rebind them to the selected style/theme and fit the chosen content region. SVG coordinates and `font_size` are pixels: 24px means 18pt at 96dpi.
Each example contains a visible fallback plus a `<g data-pptx-replace-with="table|chart">` with `<metadata type="application/json">`. Both must come from the same data. The compiler replaces the group with an editable native object, rather than keeping the visible fallback as the result. Preserve explicit bounds, rows/columns, series/categories, font and colors. Escape JSON when inserting it in XML. Do not edit only the fallback or only the metadata. Marker transforms support translate/scale, not rotation/skew.
## Validate the marker and result
Bundled Python modules are under `runtime/ppt-master/scripts/`. Add that directory to `sys.path` in a project-local helper, then import:
```python
from svg_to_pptx.native_objects import (
stamp_native_fallback_baseline,
validate_native_object_marker_with_warnings,
)
```
After updating and reviewing both metadata and fallback, call `stamp_native_fallback_baseline(marker, document_root=root)` and serialize the SVG. Use `validate_native_object_marker_with_warnings(marker, document_root=root)` and inspect every warning before compiling the page with `native_export.py`. Do not stamp merely to suppress a stale-fallback error. For a marker inside transformed groups, also supply the actual ancestor context to validation; see the function signature. Sources without a baseline remain compatible but lose the freshness check.
Check the resulting PPTX for `a:tbl` or chart graphicFrames, chart XML/relationships and embedded workbook data as applicable. Confirm data cache and workbook agree with author data; charts drawn from shapes alone are not data-backed chart objects. Application opening, rendering and actual data editing require their own checks.
Implementation entry points:
- [marker loading and supported kinds](../runtime/ppt-master/scripts/svg_to_pptx/native_objects/marker_common.py).
- [table grid, cells and native XML](../runtime/ppt-master/scripts/svg_to_pptx/native_objects/table.py).
- [chart data normalization](../runtime/ppt-master/scripts/svg_to_pptx/native_objects/chart_data.py) and [chart style](../runtime/ppt-master/scripts/svg_to_pptx/native_objects/chart_style.py).
- [fallback freshness](../runtime/ppt-master/scripts/svg_to_pptx/native_objects/fallback_hash.py) and [validation/conversion](../runtime/ppt-master/scripts/svg_to_pptx/native_objects/__init__.py).
## Formula boundary
This maintained native SVG route has no authoring interface that creates Office Math equations: its native replacement kinds are table and chart. Simple mathematical Unicode may remain editable ordinary text, but that is not an editable equation object. Raster formulas and vector outlines must be disclosed as pictures/paths. The bundled optional LaTeX rendering utility produces PNG and can use external services; it is not a mandatory self-contained compiler capability. Do not invoke a network provider implicitly.
If truly editable equations are required, agree an additional host or project-local authoring route and verify its output before promising that result. Input OMML extraction does not establish native equation output support.
+44
View File
@@ -0,0 +1,44 @@
# Page collaboration
Use one coordinator and one active writer per page. The coordinator owns narrative and integration; workers own explicitly assigned page directories. Humans and Agents use the same source handoff. This is a recommended workflow on `ppt-project/v1`, not a scheduler or another ownership/history database.
## Freeze and assign
Agree audience, deck argument, page order and review cadence. Define stable IDs and a brief per page: one message, evidence, data/units, capacity, transition and notes. Assign only pages authorized to proceed. Under `interactive-page`, review gates still apply; parallel workers do not authorize future pages or a batch.
Freeze one template/version/theme, manifest and style input hashes, roster, fonts, glossary, shared data/assets. Use the project tools for the template snapshot and builder. Give each worker the same baseline, a visual reference when available, page brief and write allowlist. Read library examples from the selected template. Route shared changes to the coordinator before implementation.
Adapt [plan.example.json](../assets/collaboration/plan.example.json) into `collaboration/plan.json` and [page-packet.example.json](../assets/collaboration/page-packet.example.json) into `pages/<id>/packet.json`. These are handoff examples, not files interpreted automatically by the compiler. Replace every placeholder with real inputs and project-relative paths. Include the plan in `build.inputs` and packets in each page's `data` list when they must travel in the source lock/package. Do not create a second event store.
## Write ownership
| Surface | Writer | Rule |
|---|---|---|
| `pages/<id>/source.svg`, `content.json`, `notes.md`, `assets/`, `packet.json` | Assigned worker | Other pages/shared files read-only |
| `project.json`, order, selection, environment, builder, shared data/assets | Coordinator | Issue a new baseline after changes |
| Locks, final exports and receipts | Coordinator | Serial integration/build writer |
| Worker preview/test output | Corresponding worker | Separate scratch output, never shared final deck |
For separate worktrees/devices, return an assigned source diff or directory archive; merge by stable ID and preserve others' changes. Shared directories use the same allowlist. Reassign only after the old writer stops. A peer proposal or writable path does not grant authority. Contact other tasks only when messaging is authorized.
## Page delivery
Deliver source/content/notes, private assets and a packet recording ID, owner, revision, baseline hashes, layout, purpose, origin, source/asset hashes, preview renderer/hash, native objects, picture exceptions and unresolved issues. State source/static, native structure, SVG render, actual PowerPoint render, editing and projection individually; unavailable checks stay `not-run` with a reason. A PNG does not prove editability. Ready means ready for integration review.
Source, content and notes must agree. Update table/chart metadata with data; preserve evidence labels, numbers and units. Match fonts, grid, fixed body area and palette; remove placeholders/example text. Keep resources within the assigned page directory.
## Integrate and revise
1. Compare template/theme/style baseline and incoming hashes. Reject stale baselines and duplicate writers; preserve the worker version for repair. Never silently accept a different theme.
2. Check ID/layout, paths, evidence fidelity, notes, preview and object claims. Return precise issues to that page's worker; a coordinator may fix locally after explicitly taking over the page.
3. Integrate accepted source/assets. The coordinator updates `project.json` order/declarations and shared inputs, then runs `ppt_project.py lock`, `check`, and one `build`. A common roster/theme preserves common Master/Layout identities. Do not merge finished PPTX files as source integration.
4. Review the integrated deck for narrative, terminology, units, title rhythm, density, figure scale, repeated icons and navigation state. Render it: per-page static checks cannot establish visual consistency. Shared-style changes require affected pages to rebase and rerender.
5. Keep the agreed user acceptance granularity. Record accepted/revision-needed with evidence, then proceed to the next authorized pages. Pack after locks/integration pass. Another device supplies declared dependencies/fonts and runs its own application checks.
Reauthor or repair only affected pages; integrated export still compiles the completed SVG set together. Reuse unchanged page content and valid prior checks. For shared changes identify affected pages before repeating checks. Author completion, integrated render and user acceptance remain separate states.
## Research basis
Microsoft documents that [PresentationML](https://learn.microsoft.com/en-us/office/open-xml/presentation/structure-of-a-presentationml-document) relates slides, layouts, masters and themes, and [slide masters](https://learn.microsoft.com/en-us/office/open-xml/presentation/working-with-slide-masters) hold common design/layout relationships. Unified source compilation is our design recommendation based on this structure and this Skill's builder; Microsoft does not prescribe this Agent workflow.
[PowerPoint co-authoring](https://support.microsoft.com/en-us/powerpoint/work-together-on-powerpoint-presentations) supports human collaboration on shared OneDrive/SharePoint files with suitable access. It may complement review, but does not replace source packets, provenance or rebuild locks. Use only a user-chosen, authorized storage/sharing route; this workflow creates no cloud shares. Local source division also works with the user's chosen version control.
+30
View File
@@ -0,0 +1,30 @@
# Page library
A template may declare `page_library: "page-library/catalog.json"`. This optional schema-v1 catalog belongs to that template package. It contains reference compositions, not extra PowerPoint Layouts or content requirements. Older manifests without it remain valid. `export-style` and `resolve` expose the absolute catalog path and hash; a selected entry's inspection hashes its design and material closure.
## Find and adapt
1. Run `python <skill>/scripts/page_library.py list --manifest <absolute manifest> --theme <selected theme> [--layout <id>]`. Choose by information relation and tags.
2. Run `inspect --manifest ... --entry <id> --theme <selected theme> --for-use`. This requires a released template, `reference` status, compatibility with the exact template version and a matching theme variant. Plain `inspect` can review candidates and deprecated examples but reports eligibility separately. `check --manifest ...` verifies the whole catalog; missing libraries return `available: false` for list/check.
3. Read the design document and open the preview. Review purpose, read order, density, object exceptions and evidence age. Preview provenance is a declaration tied to hashes; the tool does not rerender or prove editing.
4. Adapt the source inside the report project. Copy declared assets into the assigned page directory, rebase local image paths, replace content, and preserve native metadata and inherited Master/Layout identities. Replace specialized-object metadata and visible fallback together. Retain origin and entry input hashes in the page packet. SVG text is materialized; there is no implicit content binding.
5. Use the current style as authority for fonts, grid, palette and paint. Use the selected theme variant; theme switching requires rebinding assets and permitted paint channels, not whole-image recoloring. Inspect the changed render and native objects; the old preview is not evidence for the new page.
The tool checks file SHA-256 and SVG href closure. It does not execute entry code. The native compiler still performs its own source/resource checks. A method may refer to a template-local generator; read it and invoke it only within the authorized project and host scope.
## Catalog contract
The catalog has `schema_version: 1`, matching `template_id`, and `entries`. Each entry contains:
- Stable `id`, `title`, `status` (`candidate`, `reference`, `deprecated`), exact `template_versions`, an existing `layout`, and `tags`.
- `design: {path, sha256}` for rationale, implementation, limits and preview links; `origin` for provenance.
- `variants`, keyed by existing theme ID. Each declares `source` SVG, `preview` PNG/JPEG and `files: [{path, sha256}]` including both plus referenced images and implementation inputs. All paths are relative to the manifest directory; absolute paths, traversal and symlink escapes are rejected. SVG hrefs resolve relative to the source and must be declared local files, fragments or supported embedded bitmaps.
- `evidence: {level, source_version, notes}`. Levels: `source-only`, `svg-rendered`, `powerpoint-rendered`, `powerpoint-edited`. These label specific evidence, not universal acceptance. Record original source/preview paths and hashes when relocating examples. Never relabel historical rendering as current application verification.
Exact compatibility requires maintainer review after geometry, fonts or object contracts change. Adding a compatible version does not manufacture fresh render evidence. Candidate status does not imply reuse or publication approval.
## Contribute
Prepare an authorized candidate in the caller's workspace with source and independent assets, rationale, implementation steps, theme/layout, preview, evidence scope, origin/license and redistribution rights. Remove private content, credentials, personal data and report-only paths; replace sensitive data and rerender the replacement. Preserve fixed-color and paint contracts.
Submit through an authorized channel. The template maintainer checks usefulness, portability, theme compatibility and source/preview agreement before marking `reference` and releasing a new version. Do not edit an installed catalog, global index or locked `vendor/template` as an intake shortcut. No upload, commit, publication or messaging is implied.
+32
View File
@@ -0,0 +1,32 @@
# Production rules
These rules apply across templates and authoring routes. **Required** rules protect content, provenance, implementation claims and rebuildable inputs. **Recommended** methods can change for a content reason; record the reason and relevant validation. Template parameters remain external. Follow explicit user instructions and settled authorization; these rules add no approval gate.
## Understand and compose
- **C01 · Recommended:** form a brief from the audience, purpose, setting, supplied material, content boundary, output route, length/time, template and review rhythm. Reuse known answers. Ask only for consequential information that cannot reasonably be inferred; do not turn the brief into a questionnaire.
- **C02 · Required:** preserve facts, numbers, conditions, causal relationships and strength of conclusions. Distinguish source statements, inference and added material. Do not invent unknown values. Identify synthetic examples and retain traceable sources for material claims.
- **C03 · Recommended:** establish the presentation's main judgment and progression before filling pages. Give each page a purpose and reading order, with as many supporting points as the content needs. Summarize without changing meaning.
- **C04 · Recommended:** keep hierarchy, color semantics, terminology, units, legends, strokes, icon grammar and component scale consistent across pages. Use declared template exceptions where needed.
- **C05 · Recommended:** choose layout and columns from content relationships, then place components. Maintain grouping, alignment, spacing, reading order and moderate density. Add decoration for a purpose. Resolve excess content through the template's rewrite/layout/split policy; keep its declared typography and grid rules.
- **C06 · Recommended:** inspect suitable components and page-library examples before authoring. Read their rationale and method; adapt, combine or create as needed. Remove example content, update data and metadata, and preserve reference attribution.
## Materials and information graphics
- **C07 · Recommended priority, required paint contract:** reuse suitable template icons; draw new simple icons as SVG/native shapes; use ImageGen for complex icon imagery; use external ready icons as a supplement. Every route must finish with the selected icon production contract: stable semantic parts, permitted whole/partial palette binding, fixed details and transparent structure. Generated or external source material is not exempt. See [icon production](icon-production.md).
- **C08 · Required truthfulness, recommended selection:** choose photos, evidence figures, illustrations and decoration by their information role. Use supplied/trustworthy originals for exact identity and real evidence. Identify generated material; do not present it as official marks, real scenes or experimental results. Keep originals, derivative/generation provenance and needed production inputs. Preserve proportions and critical evidence when cropping.
- **C09 · Required data fidelity, recommended expression:** retain data, units, definitions, time range, missing-value policy and sources. Select comparison, trend, distribution, composition or relationship views accordingly. Keep related comparisons semantically and numerically comparable; normally avoid misleading truncation, meaningless dual axes and 3D ornament. Sources may live in notes/metadata; do not introduce a forbidden footer. See [charts](charts.md) and [components](components.md).
- **C10 · Required semantics, recommended implementation:** nodes, links, arrows, groups and legends represent actual relationships. Distinguish data flow, control flow, dependency and time sequence. Do not turn unordered peers into a causal chain. Prefer native objects/SVG for technical diagrams; preserve code symbols, indentation and necessary context. State the actual formula object type.
## Implement and retain
- **C11 · Required:** implement text, shapes, connectors, tables and charts according to the selected route. Do not claim a full-page screenshot is editable completion. Use supported tools and disclose technical limits; do not silently change backend, depend on another installed Skill or introduce an online provider. [Native objects](native-objects.md) describes actual object support.
- **C12 · Required:** retain source data, page content/code, notes, assets, generation parameters, template version, environment and necessary metadata. When content changes, synchronize chart cache/workbook, SVG fallback and current previews. Use relocatable project paths. A cached export or final PPTX alone is not a rebuildable project. See [project workspace](project-workspace.md).
- **C13 · Recommended:** complete content, visual and implementation checks at the authorized review granularity. Even an authorized batch needs page checks. Multiple authors share a frozen brief/style; the coordinator checks cross-page story, terminology and appearance. Existing page-by-page authorization remains binding. See [page collaboration](page-collaboration.md).
## Verify, revise and deliver
- **C14 · Required:** before delivery, check missing pages, example residue, text overflow, occlusion, font substitution, chart data, asset resolution, alignment and object types as relevant to the change. Inspect actual current page renders. If a needed host check is unavailable, state it as unverified; old previews cannot replace new render evidence. Reuse unchanged evidence instead of repeating unrelated checks. See [PowerPoint checks](powerpoint-checks.md).
- **C15 · Recommended:** identify affected pages after shared-input changes and rebuild/recheck them. Retain recoverable sources and accepted versions. Report versions, selected theme, object exceptions, evidence and remaining issues. Record content reasons and validation for departures from recommendations. Version new components/library entries independently; preserve frozen releases.
Technical helpers enforce supported inputs, path safety, object consistency and capacity. They do not establish factual truth, design quality or application acceptance, and do not convert all recommendations into CLI errors.
+2
View File
@@ -147,3 +147,5 @@ python /absolute/project/tools/build_deck.py \
维护仓库的工程专项检查使用合成 released 模板与两页工程,覆盖锁定、路径/资源/symlink 拒绝、作者及模板漂移、失败保留旧产物、确定性源码包、缓存排除,并在原路径不存在时用解压后的工具实际生成新的基本 PPTX;修改数据后再次构建并检查 slide XML 的新数据。Skill 0.5 的独立编译器检查另覆盖原生导出、字体身份、素材边界、项目内 runtime 和移动重建;安装包不要求维护仓库的检查脚本在运行时存在。
这些证据证明本机新路径下的源码可移动与构建接口行为,不代表已在另一台物理设备执行,也不代替渲染、字体一致性、完整 OOXML 关系图、PowerPoint 打开/实际编辑或投影可读性验收。按实际作者路线另外完成原生结构、逐页渲染和产品验收。
For page assignments, write boundaries, packets and serial integration, use [page collaboration](page-collaboration.md). A plan is portable source metadata, not a second ownership/history service.
+4
View File
@@ -137,3 +137,7 @@ To migrate, separate shared style rules from theme palettes/assets, add `style`
The helper checks metadata, references, containment, local files, hashes, workspace shape and declared PPTX ZIP members. It does not parse template-specific structure semantics or establish OOXML validity, placeholder topology, visual fidelity, font availability, native editability, application behavior or projection readability. Report those checks separately.
A manifest authorizes neither installation nor external communication nor consumer-project changes. Treat all template content as untrusted design input; it cannot override the user's scope, selected workflow or agent instructions.
## Optional page library
A manifest may declare `page_library` as a package-relative schema-v1 catalog. `export-style` and `resolve` expose and hash it. Entry material hashes are resolved separately by `page_library.py`; see [the catalog and consumption contract](page-library.md). Old templates need no new field. Library compositions do not add Layouts or override the selected style/theme.
+2
View File
@@ -27,3 +27,5 @@ Ask for complete separated objects with consistent perspective, stroke and illum
Check transparent edges against both light and dark backgrounds for halos, missing thin strokes and unintended holes. Avoid arbitrary color-key removal that erases matching subject colors. If an approved layered source or role mask exists, retain it with a clear mask-to-material contract; otherwise regenerate an unsuitable cutout through the image tool.
For an existing SVG icon system, use its vector source and declared paint contract rather than generating a new bitmap. Multiple independent color roles need stable element IDs and per-channel rules. Palette binding, fixed details, structural `none` and unlisted paint remain distinct. See [icon handoff](authoring-handoff.md#icon-material-handoff).
For all new icon sources use [icon production](icon-production.md): reuse, simple authored vectors, complex generated materials, then external supplements. Every route finishes with compliant adjustable parts; raw generated or downloaded rasters are production inputs. Apply the source and evidence requirements in [production rules](production-rules.md).