@dickpy/dsh-oil-slide 0.0.0-stage → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +90 -2
  3. package/bundled-assets/brand/empty-deck-cobalt.webp +0 -0
  4. package/bundled-assets/brand/oil-slide-mark-512.png +0 -0
  5. package/bundled-assets/skill/LICENSE +21 -0
  6. package/bundled-assets/skill/README.md +61 -0
  7. package/bundled-assets/skill/SKILL.md +185 -0
  8. package/bundled-assets/skill/references/art-directions.md +99 -0
  9. package/bundled-assets/skill/references/brand-and-canvas.md +72 -0
  10. package/bundled-assets/skill/references/design-baseline.txt +1 -0
  11. package/bundled-assets/skill/references/prompt-compiler.md +99 -0
  12. package/bundled-assets/skill/references/restore-and-pptx.md +178 -0
  13. package/bundled-assets/skill/references/staged-pptx.md +71 -0
  14. package/bundled-assets/skill/scripts/_runtime_utils.py +351 -0
  15. package/bundled-assets/skill/scripts/asset_sheet.py +528 -0
  16. package/bundled-assets/skill/scripts/brand_ref.py +776 -0
  17. package/bundled-assets/skill/scripts/crop_asset.py +1709 -0
  18. package/bundled-assets/skill/scripts/deck_shell.py +2322 -0
  19. package/bundled-assets/skill/scripts/export_images.py +280 -0
  20. package/bundled-assets/skill/scripts/extract_pptx.py +360 -0
  21. package/bundled-assets/skill/scripts/extract_slide_dom.js +1640 -0
  22. package/bundled-assets/skill/scripts/html_to_pptx.py +4042 -0
  23. package/bundled-assets/skill/scripts/measure_slide_layout.py +952 -0
  24. package/bundled-assets/skill/scripts/oiloil-connect.mjs +1493 -0
  25. package/bundled-assets/skill/scripts/oiloil-image.mjs +492 -0
  26. package/bundled-assets/skill/scripts/prepare_plate.py +412 -0
  27. package/bundled-assets/skill/scripts/render_gradient.py +258 -0
  28. package/bundled-assets/skill/scripts/slide_brand.py +111 -0
  29. package/bundled-assets/skill/scripts/slide_incremental.py +122 -0
  30. package/bundled-assets/skill/scripts/slide_workflow.py +711 -0
  31. package/bundled-assets/skill/scripts/verify_deck.py +3483 -0
  32. package/bundled-assets/skill/vendor/README.md +4 -0
  33. package/bundled-assets/skill/vendor/codex-ppt/LICENSE +21 -0
  34. package/bundled-assets/skill/vendor/codex-ppt/assemble_ppt.py +435 -0
  35. package/bundled-assets/skill/vendor/codex-ppt/codex_ppt_runtime.py +284 -0
  36. package/bundled-assets/skill/vendor/codex-ppt/image_gen.py +972 -0
  37. package/bundled-assets/skill/vendor/codex-ppt/image_providers/__init__.py +6 -0
  38. package/bundled-assets/skill/vendor/codex-ppt/image_providers/atlascloud.py +222 -0
  39. package/bundled-assets/skill/vendor/codex-ppt/image_providers/base.py +32 -0
  40. package/bundled-assets/skill/vendor/codex-ppt/image_providers/factory.py +21 -0
  41. package/bundled-assets/skill/vendor/codex-ppt/image_providers/openai_compatible.py +238 -0
  42. package/bundled-assets/skill/vendor/codex-ppt/requirements.txt +5 -0
  43. package/bundled-assets/skill/vendor/codex-ppt/styles//345/205/232/346/224/277/347/272/242/351/243/216/346/240/274.md +98 -0
  44. package/bundled-assets/skill/vendor/codex-ppt/styles//345/210/233/346/204/217/346/235/202/345/277/227/351/243/216.md +72 -0
  45. package/bundled-assets/skill/vendor/codex-ppt/styles//345/244/215/345/217/244/346/211/201/345/271/263/346/217/222/347/224/273/351/243/216.md +72 -0
  46. package/bundled-assets/skill/vendor/codex-ppt/styles//346/211/213/347/273/230/346/212/200/346/234/257/350/247/243/351/207/212/351/243/216.md +86 -0
  47. package/bundled-assets/skill/vendor/codex-ppt/styles//346/211/213/347/273/230/347/231/275/346/235/277/351/243/216.md +72 -0
  48. package/bundled-assets/skill/vendor/codex-ppt/styles//346/225/231/345/255/246/350/257/276/344/273/266/351/243/216.md +107 -0
  49. package/bundled-assets/skill/vendor/codex-ppt/styles//346/225/260/346/215/256/344/273/252/350/241/250/347/233/230/351/243/216.md +73 -0
  50. package/bundled-assets/skill/vendor/codex-ppt/styles//346/270/205/347/210/275/344/270/223/344/270/232/351/243/216.md +87 -0
  51. package/bundled-assets/skill/vendor/codex-ppt/styles//346/270/251/346/232/226/346/211/213/345/267/245/351/243/216.md +72 -0
  52. package/bundled-assets/skill/vendor/codex-ppt/styles//347/224/265/345/255/220/345/242/250/346/260/264/346/235/202/345/277/227/351/243/216.md +86 -0
  53. package/bundled-assets/skill/vendor/codex-ppt/styles//347/247/221/347/240/224/347/255/224/350/276/251/351/243/216.md +138 -0
  54. package/bundled-assets/skill/vendor/codex-ppt/styles//351/272/246/350/202/257/351/224/241/351/243/216/346/240/274.md +119 -0
  55. package/bundled-assets/skill/vendor/image-to-editable-ppt/LICENSE +21 -0
  56. package/bundled-assets/skill/vendor/image-to-editable-ppt/SKILL.md +171 -0
  57. package/bundled-assets/skill/vendor/image-to-editable-ppt/agents/openai.yaml +4 -0
  58. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/__init__.py +1 -0
  59. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/cli.py +25 -0
  60. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/__init__.py +1 -0
  61. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/_input_normalization.py +355 -0
  62. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/_page_artifacts.py +132 -0
  63. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/build_pptx_from_manifest.py +1029 -0
  64. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/configure_image_backend.py +52 -0
  65. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/deck_run_state.py +214 -0
  66. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/deck_text_hints.py +179 -0
  67. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/finalize_deck_run.py +96 -0
  68. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/formula_renderer.py +254 -0
  69. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/image_gen.py +206 -0
  70. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/main.py +795 -0
  71. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/make_page_contact_sheet.py +28 -0
  72. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/native_tables.py +140 -0
  73. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/paddle_text_hints.py +212 -0
  74. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/page_job_status.py +54 -0
  75. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/page_text_metrics.py +334 -0
  76. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/path_geometry.py +174 -0
  77. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/prepare_deck_run.py +209 -0
  78. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/process_asset_sheet.py +104 -0
  79. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/record_imagegen_result.py +118 -0
  80. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/record_page_dispatch.py +83 -0
  81. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/record_page_result.py +130 -0
  82. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/remove_chroma_key.py +441 -0
  83. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/reset_page_job.py +74 -0
  84. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/runtime_env.py +283 -0
  85. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/split_alpha_components.py +323 -0
  86. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/text_hints.py +309 -0
  87. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/editppt/runtime/validate_pptx.py +873 -0
  88. package/bundled-assets/skill/vendor/image-to-editable-ppt/cli/pyproject.toml +29 -0
  89. package/bundled-assets/skill/vendor/image-to-editable-ppt/prompts/page-worker.md +47 -0
  90. package/bundled-assets/skill/vendor/image-to-editable-ppt/references/cli-helper.md +282 -0
  91. package/bundled-assets/skill/vendor/image-to-editable-ppt/references/manifest-schema.md +423 -0
  92. package/bundled-assets/skill/vendor/image-to-editable-ppt/references/page-decision-tree.md +301 -0
  93. package/bundled-assets/skill/vendor/image-to-editable-ppt/scripts/build-page-worker-prompt.py +134 -0
  94. package/cordis.patch.yml +3 -0
  95. package/lib/client.js +11423 -0
  96. package/lib/index.js +2638 -0
  97. package/package.json +140 -4
@@ -0,0 +1,99 @@
1
+ # 提示词编译与生图纪律
2
+
3
+ 返回 [主入口](../SKILL.md)。本页规定风格与版式解耦拓扑(无构图色卡 + 锁定 `style_dna`)、1K 分辨率策略、正向 6 段提示词写法与总览双轴验收。
4
+
5
+ ## 一、母图派生拓扑:所有后续页都以定稿封面为母图,写明角色、换镜头
6
+
7
+ ```text
8
+ brand-ref.png / style-ref.png ──(--ref)──▶ s1.png (定稿封面 = 本套母图)
9
+ │
10
+ ├──(图 1 母图 + 角色句 + 镜头:全景)────────▶ s2.png
11
+ ├──(图 1 母图 + 角色句 + 镜头:细节特写)────▶ s3.png
12
+ └──(图 1 母图 + 角色句 + 镜头:主角的动作)──▶ sN.png
13
+ (背景有结构时,另加图 2 = bg-plate.png 锁背景)
14
+ ```
15
+
16
+ - **母图的角色句(每页逐字写)**:「图 1 是本套母图,只作参考:保留同一个世界、同一个主角、同一种画法、配色与光线;文字、版面和构图完全重新设计。这一张换成〈镜头〉:〈具体画面〉。」不写角色就传整张 `s1.png`,模型会把标题、页眉和卡片壳子原样复制,几页长成同一个模板。
17
+ - **镜头**:全景、细节特写、正上方俯视、孤体留白、主角的一个动作、暗调或夜晚,相邻两页不重复,至少一页没有地平线(详见 [画风方向](art-directions.md))。
18
+ - **永远参考母图**:禁止链式接力(`s1 -> s2 -> s3`),画风会一页页漂走;每批并行 ≤4 路防限流。使用已配置的自定义渠道,将母图作为真实图片输入。
19
+ - **背景锁(`bg-plate.png`,可选的图 2)**:封面背景有结构(一片柔光、渐变方向、网格或点阵、纸张肌理、角落的形状)时,以 `s1.png` 为参考图生成 `assets/reference/bg-plate.png`,提示词写:「图 1 是本套封面。只保留它的背景做成空白底图:去掉所有文字、线条、插画和卡片,被遮住的地方按周围背景自然补全;背景的颜色、光的位置和强弱、明暗过渡、纸张颗粒、网格或点阵的位置大小疏密都与原图完全一致,不新增任何元素。」和 `s1.png` 并排看一遍,多了或少了东西就重出一次。之后作为图 2 传入,写明「图 2 是本套的背景底图,整张原样沿用」。还原成网页时也用同一张 `bg-plate.png` 做背景。背景是纯色或整页饱和色时不需要底图。支持自动背景锁的宿主可以替你生成并传入底图。
20
+ - **`style-swatch.png`(无构图色卡)**只在宿主一次只能传一张参考图、又不能传母图时作为退路使用。
21
+ - **1K 分辨率与画幅尺寸表**:汉字清晰、单张 `< 2 MiB` 且成本低;若外部参考图超过 `2 MiB`,先执行 `<python> scripts/prepare_plate.py prepare-ref <in.png> --out <ref.jpg>`。社交图文帖子、手机竖屏阅读与小红书图文选 `3:4`:
22
+
23
+ | 画幅比例 | 画布像素 | 生图尺寸 | PPTX 尺寸 |
24
+ | --- | --- | --- | --- |
25
+ | 16:9 | 1920×1080 | `1536x864` 或 `1536x1024` | 13.33×7.5 英寸 |
26
+ | 3:4 | 1080×1440 | `1104x1472`(标准 3:4,同属 1K 档位) | 7.5×10 英寸 |
27
+ | 9:16 | 1080×1920 | `864x1536` | 7.5×13.33 英寸 |
28
+ | 1:1 | 1440×1440 | `1024x1024` | 10×10 英寸 |
29
+ - 复用用户风格图 `style-ref.png` 时,只继承底材色温、色板、媒介与留白节奏,显式移除原图主题物件并 100% 替换为新主题与新文案。
30
+
31
+ ## 二、正向 6 段结构化 Brief 写法(写给设计师,不堆元素清单与负面禁令)
32
+
33
+ 中文演示直接用中文写 Brief(英文演示用英文),每页严格按以下 6 段组织。
34
+
35
+ **篇幅分配(最重要)**:一页提示词控制在 1000–1600 字。**一半以上的篇幅写画面**——像对插画师描述一幅画:流派和它的标志特征、谁在什么地方做什么、颜色(说出两三种颜色的名字)、质感(颗粒、纸纹、布纹、笔触)、光、主体在画面哪里多大。风格 DNA 用四五句话写完。**不要把 60/30/10 比例、像素字号、百分比边距、色值占比写进提示词**——这些是你自己排版时用的,写进去只会让模型画出干净但平庸的办公模板(见第三节第 1 条)。
36
+
37
+ 可以照这个骨架写(尖括号换成本题的内容,不要照搬):
38
+
39
+ ```text
40
+ 【参考图分工】(有参考图时写)图 1 是……
41
+ 【风格】〈流派名〉:〈两三条标志特征〉;颜色只有〈底色〉、〈主色〉和〈一个强调色〉;整页带〈质感〉;全套主角是〈角色或物件,一句外貌〉。
42
+ 【画面】〈用三到六句话描述一幅正在发生的画:谁、在哪、在做什么、动作和表情、周围有什么、光从哪来;主体落在哪个构图位置、体量多大、是否出血〉。
43
+ 【版面】采用〈具体构图重心〉,标题与次要文字落在〈对应安静区〉,其余留白。
44
+ 【文字】逐字渲染,每条只出现一次,不要多余文字:〈逐条列出〉
45
+ 【设计基线】〈design-baseline.txt 全文〉
46
+ ```
47
+
48
+ 下面是 6 段各自要写清的东西:
49
+
50
+ 1. **【参考图分工】(有参考图必填)**:按传入顺序逐张写明「图 N 是什么、只继承哪一点、构图完全重新设计」。传入 `style-swatch.png` 时写清「仅继承底面质感、色温与色板,本页构图与主视觉完全独立新建」。
51
+ 2. **【整套统一风格 DNA】(按本次题材与调研选定,确定后全套每一页逐字一致)**:
52
+ - **底面材质与克制三色分工**(60 / 30 / 10 是你心里的分配,提示词里只写颜色名字和谁是强调色,不写比例):写明本套选定的背景材质、明暗极性、**冷暖色温偏向**(防止冷灰米纸漂成偏黄牛皮纸)与精简色板分工——**1 个主底色(60%–75%)+ 1 套主墨色/中性灰阶(20%–30%)+ 严格 1 个高饱和强调色(5%–10%)**(注明「色值仅作参考不画进画面」),不预设固定风格、不堆彩虹色标签;做品牌/产品/编辑展示类演示时(包括封面多方向探索),不要因为官网是纯平网页色就给幻灯片底面写死 `flat matte / no grain`——给 16:9 画布一层肉眼可辨但克制的方向柔光、细腻微颗粒、轻度角落色温晕染或淡网格,即可明显拉开质感(管理咨询/纯白传阅报告除外,可保持纯白 `#FFFFFF`);
53
+ - **唯一媒介语言**:锁定整套共用的单一视觉表现媒介与统一光向(依题材选择插画、摄影、实物场景、强平面构成、Risograph/Zine 半调拼贴或界面展示等,确保整套统一不跳戏);
54
+ - **字形与页眉锁**:用肉眼可见特征写明契合本套风格的字体配对(主副字阶清晰、全套严守同一字体家族;具体字号比例留给还原阶段,不写进提示词;**禁用廉价毛笔书法体**,除非明确是书法/古籍主题),以及统一的页眉锁(左上角真实 Logo 建议 `38–48px` 高、清晰可辨)与页码/来源栏。
55
+ - **背景与配图的统一写法**:底色跟着画风走——负空间插画是整页饱和色,色块静物是一种饱和无缝背景,网点摄影是荧光底,细线插画是白底,暗房是深炭黑;写明底色和它的冷暖,全套不变。配图写明同一种媒介,让每页的图像出自同一位作者之手;媒介怎么选、每页怎么从封面母图换镜头见 [画风方向](art-directions.md)。封面与章节页可以浓一些,内容页保持安静。
56
+ - **外部实图/图表融合**:真实白底截图或榜单图表落入主底色时,保持四周 `4%–5%` 干净底材边框与轻圆角白底托盘,绝不强行 AI 重绘模糊原图数据。
57
+ 3. **【这页只说一句话】+【画面主角】**:写 1 句听众能懂的价值结论 + 主视觉画面(演讲型用概念插画、物理/空间隐喻、场景或真实截图标注;传阅/咨询型直接写清统计图表、瀑布图、象限图、对照表或流程结构与关键数据标注)。
58
+ - **「不画真人的脸」不等于「不出现人」**:讲组合、人物的活动(上节目、演出、领奖)的页面,用调研找到的真实照片做参考;找不到时,用认不出脸的人物(背影、逆光剪影、观众席、握麦的手)、现场或代表那一刻的物件(奖杯、话筒、舞台)。不要在 Brief 里写「不要人物」「不要观众」「空舞台」,这些词会产出只有一束追光的空页。
59
+ - **`style_dna` 的媒介必须能画东西**:摄影、插画、立体物件或真实截图。「粗体海报、平面色块」只是排字方式,不是图像媒介;只写它,就会得到一页页黑底大字。两样都要写,例如「粗体海报排字,叠在真实舞台摄影上,右上一束硬光」。
60
+ - **版面和画风是两件事**:版面永远是规整的演示页(层级清楚、网格对齐、字好读),画风可以按受众选——真实摄影、棚拍物件、平面图形,或者一个手绘的插画世界(水粉、蜡笔、墨线)。编辑插画风的做法:同一个手画的固定角色贯穿全套;插画是每页唯一的主角、可以被画面边缘裁切、只占约三分之一;纸张底色留白过半;几块很小的细衬线文字;一列竖排英文;每章角落一个换色的小方块。它和干净的摄影风一样是正当的方向,而且常常更让人记得住。
61
+ - **构图手艺与多元重心(所有方向通用)**:每页只有一个视觉主角、一个大标题,次要文字小而克制,对齐方式随构图重心走(居中舞台可居中对齐,分栏与角标可左/右对齐),点缀只需页码、章节号或小色块。封面与主视觉页按题材在多种成熟构图间切换:**居中舞台**(主体居中 + 上下留白排字)、**满版出血摄影/长卷**(全幅铺开 + 底角或顶部安静区排字)、**上下横幅分层**(上标题下宽幅主图或反之)、**左图右文**、**左文右图**、**巨字居中海报**;相邻页与不同稿件都应主动换构图重心,不要把每套都默认做成「左文右图」。内容页保留约一半干净留白,主体可按构图需要收在三分之一左右或贴边出血,避免无层次的拥挤堆砌。
62
+ - **固定角色**:插画方向时,在 `style_dna` 里写清主角的年龄、脸、发型和一件标志物(比如一顶蓝色毛线帽);`s2..sN` 除色卡外再传入定稿的 `s1.png`,写明「图 2 是本套封面,只继承其中人物的样子和画法,构图完全重新设计」。这是「不传整页 s1」规则的唯一例外。
63
+ - **先用图生图把真实素材变好用**:找到的真图常常太小、太乱或是多人合照。用它做参考图生图:把合照里的每位成员各自提取成干净的半身照、放大小封面、去掉文字或杂乱背景、补全被裁的肩膀、换成和本套一致的纸色背景。每次都写明「五官、脸型、发型、服装、表情与原图完全一致,不美化、不改姿态,只提取 / 补全 / 提高清晰度 / 换干净背景」。不改真人的表情和姿态,不把他们放进没发生过的场景,不改 logo 的形状;生成后和原图并排看一遍,对不上就丢掉。
64
+ - **讲的是具体对象时,封面先认人认物**:演示的主角是一个有名字的对象(组合、人物、品牌、产品、学校、城市、活动、作品)时,封面和重点页必须让人一眼认出它是谁:用它的真实标识(logo 或字标)、真实照片(成员合影、人物、产品、地点)和代表性作品(专辑封面、海报、主视觉)。只有大字名称加抽象色块或空舞台的「氛围海报」,对这类演示是不合格的封面。真实素材通过 `--ref` 传入,并在第 1 段写清分工(「图 1 是组合的真实合影,人物原样保留,只设计版面和背景」);不要让生图模型画真实人物的脸或重画真实 logo。手上没有这些素材时,先向用户要,或者用已有的真实作品(比如专辑封面)撑起封面。讲抽象话题(概念、方法)时,主视觉改用具体的物理隐喻。
65
+ - **并列项逐一点名配图**:页面里有并列的要点、步骤、对比行、分栏或大数字时,给每一项写明一件具体物件,让它代表这一项的意思(「调研」是放大镜下的一块网页,「确认」是盖了对勾章的稿纸,「速度」是仪表盘),并写明放在哪(分栏放在文字上方,列表和表格放在行首)。只写「每项配一张小图」不够,必须点名;不用图标、不用抽象几何体、不带品牌标志。只有标题、数字和文字卡片的页面,用代码几分钟就能排出来,不算合格的设计稿。封面、单句观点页和以真实图表或截图为主的页面不需要逐项配图。
66
+ 4. **【版面】**:一两句话写清本页选用的构图重心(如居中舞台上下排字、满版画面底角/顶部排字、上下横幅分层、左图右文、左文右图或巨字居中)以及文字安静区位置,其余留白;传阅/咨询型可以写「顶部一行结论标题,下方一张图表」。不写百分比边距。满版摄影、插画或暗场舞台页,把标题与标注放在天空、暗部留边或纯色带等低细节安静区,远离高细节前景主体,保证文字清晰且阶段二不会出现重影字或轮廓被切。
67
+ 5. **【逐字文字清单】**:按身份分行逐条列出图上必须出现的全部文字(如 `[左上眉题]` `[主标题]` `[副标]` `[标注]` `[页码]`),注明「逐字渲染、每条只出现一次、除此之外不要多余文字」。**严禁在文字清单中使用全角竖线 `|` 作分隔符**(模型会画出难看的竖杠;请拆成独立带标签行或用空格/圆点)。
68
+ 6. **【设计基线】(固定收口,逐字使用,不要改写)**:每页提示词的最后一段固定追加 [design-baseline.txt](design-baseline.txt) 的全文:
69
+
70
+ > 设计要求:以顶级独立设计工作室的水准设计这一页,气质贴合题材与受众:结构清楚、主次分明、网格严谨、留白大方;每页只有一个视觉主角,文字是配角,小字排得整齐细致;配色克制,强调色少而准;整页底色就用本套写明的那一种,清晰明快,带本套画法自带的颗粒、纸纹或笔触质感,背景安静、不抢内容;配图全套出自同一种手法(照片、插画或立体物件按本套风格),质感精良,物件边缘干净利落,只带贴着地面的柔和投影,不加外发光、彩色光晕或光圈,除非有意出血,否则完整留在画面内;文字清晰锐利,标题尽量一行排完。有并列的要点、步骤或对比项时,用与内容对应的具体画面表达,而不是只排文字;没有并列项的页面不必硬加。不要书法体、图标库图标、斜切色块、描边胶囊、装饰边框、廉价渐变和海报化。
71
+
72
+ 这一段全套、全题材通用;随题材变化的只有第 2 段的 `style_dna`。除它之外不再追加别的负面禁令,也不写参考工作室或作者名。宿主的生图工具若已自动追加这段话,就不要重复写。
73
+
74
+ ## 三、为什么收口是这一句(对照实验结论)
75
+
76
+ 这句话不是凭感觉写的。我们用 8 类差别很大的页面(历史课件、工具对比、答辩流程、视频封面、科技数据页、小学数学、古诗鉴赏、带表格的工作汇报)加一套四页连排,把同一页内容配上不同写法并排比较,前后共 75 张 1K 图。六条结论决定了它现在的样子,改写之前先读一遍:
77
+
78
+ 1. **定水准胜过列规则**。逐条规定网格、字体、图位的写法,只得到干净但平庸的办公模板;换成「顶级设计工作室做发布会演示文稿的水准」后,同样的内容质感高一档,而且仍是结构清楚的演示页。先告诉模型要达到什么水准,再补少量必要约束。
79
+ 2. **禁用清单必须点名**。「不要模板感」这类说法没有效果;点名「书法体、图标库图标、斜切色块、描边胶囊、装饰边框」后,这些元素才真的消失。只点名反复出现的东西,清单越短越好。
80
+ 3. **背景那一句不能省**。去掉它,模型会拿与内容无关的写实图片填背景(工作汇报页长出一栋写字楼);保留它,背景是淡网格、流光或渐变,文字区保持干净。
81
+ 4. **别替模型做排版决定**。曾经加过「标题在语义完整处换行」,结果它把一行能排完的标题硬拆成两行,留下「进展」「4 份」这样的孤字;改成「标题尽量一行排完」后消失。想加新要求时,先出对照图确认它没有副作用。
82
+ 5. **配图要点名,不能只说「配图」**。第一版的设计稿背景很好,内容区却只有编号卡片和文字,和代码排出来的没有区别。补了一轮对照:只在基线里加一句「每个要点配一件小配图」,模型会配上笔记本电脑、方块和球这类没有含义的摆件,还画出了软件图标;在每页内容里逐项点名物件之后,流程页的四步分别是放大镜下的网页、翘起一角的设计稿、盖章的稿纸和拆成几层的幻灯片,版面仍然规整,但这是代码做不出来的。所以规则分两层:每页 Brief 第 3 段逐项点名(必须),基线里留一句兜底。兜底这句在封面、数据页和表格页上都试过,没有把页面弄乱。
83
+ 6. **「质感真实」和「只用一种强调色」会把插画风挡在门外**。用同一套流程给课堂汇报做编辑插画风:基线里写着「图片质感真实」时,模型只会出摄影和立体物件;去掉这类限定、在 `style_dna` 里写清平涂水粉加墨线、插画只占三分之一、留白过半、小字成块、每章换色小方块,再用定稿封面传递固定角色,三页出来就有了独立设计工作室作品集的气质。基线因此只管版面质量和禁用元素,媒介和配色交给 `style_dna`。
84
+
85
+ 使用时注意两点:
86
+
87
+ - **`style_dna` 里必须写配图的拍法**,哪怕封面上没有图:材质、光线、角度和大小(如「浅色棚拍立体小物件,磨砂玻璃与哑光白材质,带一点强调色,顶光加浅接触阴影」)。全套配图出自同一次拍摄,逐页点名的物件才不会各画各的。
88
+ - **基线托住下限,`style_dna` 决定个性**。只用基线不写 `style_dna`,每套都好看但彼此相像;一句本套基调(底色与强调色、配图拍法、背景细节)加上基线,四页连排能保持统一。
89
+ - **气质特殊的题材要在 `style_dna` 里说出来**。低龄课件、强风格品牌这类需要活泼或夸张气质的场合,基线里的「气质贴合题材与受众」只是兜底,仍需在 `style_dna` 里写明想要的气质。英文演示可用同义英文直译这段话,尚未单独做对照验证。
90
+
91
+ ## 四、总览双轴验收与单页改稿
92
+
93
+ 生成后拼 2×2 总览图并亲自看图复核:
94
+ ```text
95
+ <python> scripts/prepare_plate.py stitch s1.png s2.png s3.png s4.png --out deck-2x2.png --cols 2
96
+ ```
97
+
98
+ - **五项必查**:① **整套风格统一**(4 页底材、色温、媒介、字形、页眉是否明显出自同一套 PPT);② **跨页构图节奏**(相邻页重心、版式与疏密是否真正错开,无模板复刻);③ 汉字与数字清晰无错字、无多余竖线 `|`;④ 外松内紧(`5%–8%` 外边距、无框套框、无标题压主体);⑤ 无白/黑底块假 Logo、无网页杂物、无断头杂线。⑥ **代码测试**:逐页问一句「这页用 HTML 五分钟能不能排出来」——只有标题、几行字、卡片、一道色线,背景是纯色或一束追光、没有画任何东西的页面,就是不合格,用真实照片或点名的物件重画。
99
+ - **单页改稿**:只重绘有问题的一页(仍传 `style-swatch.png` 与锁定 `style_dna`,在提示词开头写清具体修正点),不整套推翻重来,改完重新拼图确认。
@@ -0,0 +1,178 @@
1
+ # 净板重绘、HTML 还原与原生 PPTX 交付
2
+
3
+ 返回 [主入口](../SKILL.md)。本页规定从定稿设计图到可交互 HTML、原生可编辑 `.pptx` 及双端并排验收的工程协议(画幅尺寸对照见 [主入口画幅表](../SKILL.md#画幅比例与尺寸速查))。
4
+
5
+ ## 一、逐页看清原图 + 四路素材路由(严禁盲写、严禁拿粗糙 CSS 硬搓复杂插画)
6
+
7
+ 阶段二动手写 HTML 前,**必须先按单页原图分辨率分批看清每一张 `assets/reference/s1..sN.png`**(`deck-2x2.png` 缩略图仅用于阶段一整体风格走查,字太小看不清细节,严禁看缩略图盲写)。接着运行 `measure_slide_layout.py` 读取每页的 `backdrop_recommendation`(`flat_solid` / `css_micro_gradient` / `clean_backdrop_plate`),按元素复杂度严格路由:
8
+
9
+ | 路径 | 视觉素材类型 | 标准实现方式 | 严禁动作 |
10
+ | --- | --- | --- | --- |
11
+ | **路径 1:满版氛围底图与整幅场景净板(`clean_backdrop_plate` 强门禁)** | 星云/极光、流光油膜、斜向舞台光束、边角辉光、纸纹/胶片颗粒、文字叠在连续天空/光影上的满版实景或连贯插画,或 `backdrop_recommendation == "clean_backdrop_plate"` | 以参考图 `sN.png` 作 `--ref` 并发生成去字净板(`assets/plates/sN-bg.png`;满版连续场景/插画直接走本路径,把需要透明底的独立前景物件/角色留给路径 2;封面强光带**不可**满亮度硬套到密集文字内页,内页须用与原图一致的边缘微光净板),通过 `slide.bg_image` 注入;`html_to_pptx.py` 自动写为锁定原生 `<p:bg><p:bgPr><a:blipFill>`(按 SHA-1 去重) | **严禁用纯黑底或极淡 CSS `radial-gradient`(如 10% 透明度)假造复杂光影、油膜辉光或纸纹(`verify_deck` 会直接拦截)** |
12
+ | **路径 2(默认):图生图重画透明素材** | 设计稿里画出来的物件:角色/吉祥物、插画、图标、立体物件、贴纸、微缩浏览器/文档/纸张物件 | 每页一次:`python3 scripts/asset_sheet.py prompt --items items.json` 得到提示词与尺寸,以 `assets/reference/sN.png` 为 `--ref`、`--background transparent` 生成网格图(每张最多 6 个物件),再 `python3 scripts/asset_sheet.py slice --sheet <网格图> --items items.json --out-dir assets/cutouts` 切成单个透明 PNG;把每个素材放在浅底和深底上看一遍,空格子或碰到格子边的只重做那一个。设计稿里被画面边缘切掉的物件会被补全 | **严禁从设计稿上直接裁这类物件**(会带着原稿的光晕、底色和切边),也不要用粗糙 CSS 矩形或简陋 SVG 硬搓 |
13
+ | **路径 3:参考图本地精准裁切(照片与截图,禁裁可读文字卡)** | `assets/reference/sN.png` 里必须保持原样像素的照片、肖像、产品实拍、截图、地图或实景局部 | 调用本地脚本 `scripts/crop_asset.py`(`< 0.2s`)做**单次干净裁切**(避开原图页眉/页码/主标题);支持 `pill`、`circle`、`rounded:R`、`--remove-bg white|black|auto` 与 `--fade-edge bottom:30` | **严禁把带清晰多行中文正文的斜贴纸卡/文档卡整块裁成静态 PNG(须用原生 HTML+CSS 旋转还原可编辑文字),也不要切无用临时检查图** |
14
+ | **路径 4:纯平涂底色、可编辑文字与简洁矢量图表** | 纯平涂单色底(`flat_solid`)、轻单色微渐变(`css_micro_gradient`)、柱图/折线/点阵/表格/干净卡片与箭头连线 | 原生 HTML / CSS / 内联 SVG;`html_to_pptx.py` 直接编译为原生形状、细线与文本框 | 严禁把包含文字的整页截图塞进 `<img>`,也不要用它硬扛复杂插画 |
15
+
16
+ ### 裁切与净板检查点
17
+
18
+ 1. **本地裁切常用命令(`scripts/crop_asset.py`,仅用于照片/截图/地图)**:
19
+ - **纯色统一底面优先用不透明底色融合**:画布是均匀单色时,优先 `--remove-bg none`(必要时配 `--fade-edge ... --matte-bg "#HEX"` 将羽化边缘合成到精确画布色,输出无透明通道 RGB 图),避免 Keynote / PowerPoint 合成半透明柔和阴影时出现锯齿色边;仅在渐变/肌理底图或跨元素叠加时保留透明 PNG/WebP(`--remove-bg blend` 或路径 2 透底素材)。
20
+ ```text
21
+ # 例 1:纯色暗底人像底部 30% 柔边并合成到精确画布色 #0A0A0A(无 alpha 锯齿风险)
22
+ <python> scripts/crop_asset.py --src assets/reference/s4.png --bbox 1160,120,620,860 --coord-space 1920x1080 --remove-bg none --fade-edge bottom:30 --matte-bg "#0A0A0A" --out assets/crops/portrait.jpg --json
23
+
24
+ # 例 2:裁出对称胶囊形照片(上下等半径 stadium pill)
25
+ <python> scripts/crop_asset.py --src assets/reference/s2.png --bbox 1080,180,540,720 --coord-space 1920x1080 --remove-bg none --mask pill --out assets/crops/hero-pill.png --json
26
+
27
+ # 例 3:渐变/肌理底上的独立物件照片(自动溶入周围底色保留透明通道)
28
+ <python> scripts/crop_asset.py --src assets/reference/s3.png --bbox 980,220,760,640 --coord-space 1920x1080 --remove-bg blend --out assets/crops/product.webp --json
29
+ ```
30
+ 2. **真透明底前景图生成**:`node scripts/oiloil-image.mjs image --prompt "<isolated 3D glass prism, zero text, centered>" --background transparent --size 1024x1024 --out assets/cutouts/prism.webp`(自定义宽高须为 16 的倍数;`--out *.webp`、`crop_asset.py --out *.webp` 与 `asset_sheet.py slice --format webp` 均原生支持透明 WebP,体积约为 PNG 的 1/10,`html_to_pptx.py` 编译时保留透明图并自动将大体积不透明位图压为高质量 JPEG 以控制 `.pptx` 体积)。
31
+ 3. **满版净板重绘**:若参考图超过 `2 MiB`,先用 `scripts/prepare_plate.py prepare-ref` 压缩为 JPEG 再作 `--ref`;生成净板后必须亲自看图确认零幽灵残字或 Logo 印记。
32
+ 4. **裁切边界与出血贴边纪律**:
33
+ - **清理裁切杂边**:每张裁切图入画前检查四边,确认未带入原参考图的页眉/页脚细线、邻列留白边条或残留字屑;若存在,向内收紧 `--bbox` 重裁或以 `object-fit: cover` 铺满相框。
34
+ - **区分平面 2D 边框/标尺与立体 3D 透视标记**:参考图里正面平贴的 2D 框线、铭牌或线性标尺,裁切时向内避开并改用原生 HTML/CSS 与 `<img>` 边框重建;附着在立体物件透视面上的 3D 刻度或表面纹理标记则完整保留,避免生硬擦除留下修补痕。
35
+ - **禁止悬空硬切边**:被截断的主体边缘必须三选一——贴死对应画布边缘(`top/bottom/left/right: 0`,`verify_deck.py` 以 `floating-bleed-cutout` 拦截悬空刀口)、收进显式 CSS 边框/相框(`html_to_pptx.py` 自动保留 `<img>` 的原生 PPTX 边框),或用 `--fade-edge`(纯色底加 `--matte-bg`)自然溶出。
36
+
37
+ ## 二、先量测像素坐标骨架(`scripts/measure_slide_layout.py`)
38
+
39
+ 在写第一行 HTML 之前,先对参考图目录运行本地 Pillow 骨架脚本(`< 0.5s`),把每页的真实背景色与渐变、背景纹理能量、多色光晕扩散、背景实现建议、主墨色、强调色、明暗极性、顶栏对齐锁、左右内容包围盒与估算标题字高全部直接映射到 **`1920×1080` 精确像素坐标**,保存到 `verify/layout-skeleton.json`:
40
+
41
+ ```text
42
+ <python> scripts/measure_slide_layout.py --ref-dir assets/reference --out verify/layout-skeleton.json --json
43
+ ```
44
+
45
+ 关键产出字段(写 HTML 时直接照着落位,禁止盲目目测 1K 原图猜字号和边距):
46
+ - `deck_summary`:`polarity`(`light`/`dark`/`mixed`)、`dominant_bg_hex`、`dominant_ink_hex`、`dominant_accent_hex`、`backdrop_recommendation`、`clean_backdrop_slides`、`header_lock`(全套统一 `top_px` / `left_px` / `right_inset_px` / `logo_height_px`);
47
+ - `slides[i]`:`bg_hex`、`has_gradient` / `bg_gradient`、`gradient_delta`、`bg_texture_energy`、`bg_hue_spread`、`backdrop_recommendation`(`flat_solid` / `css_micro_gradient` / `clean_backdrop_plate`)、`ink_hex`、`accent_hex`、`layout.split_x`、`layout.left_bbox` / `right_bbox`、`layout.has_right_visual_bleed`、`typography.headline_est_font_px`、`typography.hero_kpi_est_px`。
48
+
49
+ ## 三、多文件按页分片 + 确定性壳组装 HTML(`scripts/deck_shell.py`)
50
+
51
+ **禁止手写 150+ 行重复样板代码**(`@font-face`、`.deck-stage`、`fitStage()`、`?slide=1..N`、键鼠翻页与底部控件),也**不要把多页直接堆在单个巨型文件中串行输出**。标准做法是先写共享 `web/theme.json` 与每页独立的 `web/slides/s01.html..sNN.html`,再交由 `scripts/deck_shell.py` 确定性合并为单文件 `web/index.html`:
52
+
53
+ ```text
54
+ # 推荐(默认):多文件按页分片合并(支持 4+ 页宿主并行子 Agent 分头写 s01..sNN.html,每页落盘即可提前合并预览)
55
+ <python> scripts/deck_shell.py --slides-dir web/slides --theme web/theme.json --ratio 16:9 --out web/index.html --json
56
+
57
+ # 兼容方式:单份 fragments.json 一次组装(仅用于单页或脚本批处理)
58
+ <python> scripts/deck_shell.py --input fragments.json --out web/index.html --json
59
+ ```
60
+
61
+ `web/theme.json` 示例(跨页复用的类如 `.abs`、`.card`、`.slide-header` **必须**写进 `global_css`):
62
+
63
+ ```json
64
+ {
65
+ "title": "Deck Title",
66
+ "font_style": "sans",
67
+ "polarity": "light",
68
+ "bg": "#F7F8FA",
69
+ "bg_image": "../assets/reference/bg-plate.png",
70
+ "ink": "#1F2328",
71
+ "accent": "#3A83EF",
72
+ "global_css": ".abs { position: absolute; }"
73
+ }
74
+ ```
75
+
76
+ 单页分片 `web/slides/s01.html` 示例(也兼容 `s01.json`):
77
+
78
+ ```html
79
+ <!-- slide: {"slide_number": 1, "bg": "#F7F8FA", "bg_image": "../assets/reference/bg-plate.png"} -->
80
+ <style>
81
+ /* 单页 CSS 会被 deck_shell.py 自动作用域隔离到 .slide[data-slide="1"],不会串扰其他页 */
82
+ .hero-title { font-size: 112px; font-weight: 800; }
83
+ </style>
84
+ <div class="slide-body">
85
+ <h1 class="hero-title">标题文案</h1>
86
+ </div>
87
+ ```
88
+
89
+ > **重要工程纪律**:
90
+ > - **CSS 作用域隔离**:`deck_shell.py` 会自动把每页 `<style>` 里的选择器加上 `.slide[data-slide="N"]` 前缀。若把通用类(如 `.abs`)只写在第 1 页 `<style>` 里,第 2–N 页会完全失效——跨页类一律写进 `web/theme.json` 的 `global_css`。
91
+ > - **单页微调不翻编译产物**:需要改某页时,直接读写对应的 `web/slides/s0K.html`(通常 30–60 行)再重跑 `deck_shell.py`,严禁在 1,200 行的编译产物 `web/index.html` 里盲翻源码。
92
+ > - **`bg_image` 规则**:`theme.bg_image` 作为整套默认底图;单页设置 `"bg_image": ""` 可显式关闭默认底图;`data-bg` 始终只输出纯色 Hex(绝不混入 `url(...)`),确保 16:9 视口外边缘留白永不拉伸背景画作。
93
+ > - **禁高开销 SVG 滤镜**:HTML/CSS 严禁使用 `<feTurbulence>`、`<feDisplacementMap>`、`<feConvolveMatrix>`(含内联 `<filter>` 与 `data:image/svg+xml` 噪点纹理),改用轻量 CSS 渐变或 `assets/plates/` 去字净板(`verify_deck.py` 会以 `expensive-svg-filter` 拦截)。
94
+
95
+ ### `deck_shell.py` 自动内建的工程护栏
96
+
97
+ 1. **零构建兼容 `file://` 与图标零 404**:内联全部 CSS/JS,内置 `<link rel="icon" href="data:,">`,禁止 `fetch()` 本地 JSON。
98
+ 2. **免费商用中英文字体库与 400–900 真实字重阶梯**:
99
+ - `deck_shell.py` 内置 7 套免费商用开源中英搭配(`theme.font_style`):`"sans"`(MiSans / 普惠体 3.0 + Plus Jakarta Sans)、`"tech"`(MiSans / 普惠体 3.0 + Space Grotesk + JetBrains Mono)、`"serif"`(思源宋体 Source Han Serif CN + Fraunces + IBM Plex Mono)、`"editorial"`(朱雀仿宋 + Instrument Serif + IBM Plex Mono)、`"poster"`(阿里妈妈数黑体 + MiSans + Syne / Space Grotesk)、`"kinetic"`(得意黑 Smiley Sans + Space Grotesk + MiSans)、`"wenkai"`(霞鹜文楷 LXGW WenKai + Plus Jakarta Sans);
100
+ - 页面 CSS 统一使用 `var(--font-display)` / `var(--font-sans)` / `var(--font-num)` / `var(--font-mono)`,大标题按原稿厚重度直接使用 `font-weight: 800` 或 `900`(不再受限于 macOS W6 半粗天花板),未装字体宿主回退时仍保证 `HiraginoSansGB-W6` 排在 `PingFangSC-Semibold` 之前;
101
+ - 字体尺度与零漂移铁律(`1920×1080`):**阶段二是忠实还原 `s1..sN.png`,不是重新设计**。优先对齐 `measure_slide_layout.py` 实测的 `headline_est_font_px`(±15%)、`hero_kpi_est_px`(±15%)与外边距,并按表达模式与参考图等比拉足字号与墨量:
102
+ - **现场演讲 / 展示型**:页眉/页码 `22–28px`,二级标题与序号 `36–64px` 粗体,正文/列表/说明 `26–36px`(绝不写网页式 `14–18px` 小字),表头/图注 `22–28px`,大 KPI 数字 `140–260px`(`tabular-nums`);无参考值时兜底:封面主标 `104–140px`、内容主标 `84–116px`、正文 `26–34px`;
103
+ - **脱手传阅 / 管理咨询 / 数据报告型**:Action Title `42–58px` 粗体、单行副标 `22–26px`、模块小标 `24–30px`、正文/要点/数据表格 `17–24px`、坐标轴与底部来源 `13–16px`;
104
+ - **通用锁定**:**逐字锁死文案**(不凭空加删行),**锁死色值与分隔线粗细**(不把黑字改橙或把实线淡化成浅灰),**锁死图表包围盒高度与点/柱密度**(视觉非背景墨量比 `ink_parity.nonbg_ratio` 保持在 `0.80–1.20`)。
105
+ 3. **无黑边无缝视口缩放、分页打印与触屏翻页**:`html, body` 动态同步当前页 `data-bg`(零黑边、零阴影);`.deck-stage` 锁定 `position: absolute; left: 50%; top: 50%; width: 1920px; height: 1080px;` 并用 JS `fitStage()` 做 `translate(-50%, -50%) scale(Math.min(innerWidth/1920, innerHeight/1080))`;`?slide=1..N` 自动激活 `body.capture-mode` 隐藏控件与触屏热区;内置 `@media print`(`@page { size: 1920px 1080px; margin: 0; }`,自动展开全页、解除缩放并按页分页,浏览器直接打印/另存 PDF 即为标准 16:9 演示稿)以及触屏设备的左右隐形点击翻页热区与左右滑动翻页(桌面精细指针下自动隐藏热区)。
106
+ 4. **跨端字体、字距与数据一致性纪律**:
107
+ - **PPTX 友好 DOM**:全部文字保持真实 HTML 文本(不栅格化);容器与留白遵循 [品牌实测与构图规则](brand-and-canvas.md)。需要原生形状或边框的元素使用清晰 CSS `background` / `border` / `border-radius`,由 `html_to_pptx.py` 1:1 转为原生对象与图片边框。
108
+ - **粗体字宽与字距克制**:导出 `.pptx` 时,无衬线 `font-weight >= 800` 会映射为更宽的跨平台粗体(`Arial Black`),`600–700` 映射为 `Helvetica Neue` / `Microsoft YaHei`。大标题与宽数字容器需预留字宽余量,**粗体英文大标与 KPI 数字默认 `letter-spacing: 0`**(避免负字距在跨渲染器下引起相邻字母或货币符号粘连)。
109
+ - **PPTX 可读字阶**:画布按 `1920px HTML → 960pt PPTX`(`2px = 1pt`)等比换算,主要阅读正文与数据标注在版面允许时保持 `≥ 20–24px`(PPTX `10–12pt`),确保投影与导出后清晰可读。
110
+ - **图表几何与文案口径一致**:柱长、时间轴跨度、热力色阶与网格列宽必须由所标数值按统一比例算出;标题断言、指标口径、分母和单位须与同页图表/表格一致,避免同页混用矛盾来源措辞(如标题写「权威实测」而页脚注「示例数据」);若页内放置二维码等可扫描交互图形,须生成真实可解码图形而非装饰网格。
111
+ - **原创与事实卫生**:生图提示词中的画风描述仅使用通用艺术流派、材质、光影与构图语汇(不点名在世艺术家、商业出版物或无关第三方品牌作风格锚点;这不影响门禁 2 与门禁 3 要求纳入的演示主体自身官方 Logo、吉祥物与真实素材);绝不虚构未经核实的第三方背书、奖项或实测指标。
112
+ 5. **克制动效与一镜到底双端协议(HTML + 原生 PPTX 同源)**:
113
+ - `theme.motion` 默认 `"none"`(纯静态,不加任何入场与转场);用户明确要动画时才设 `"refined"`(克制)或 `"cinematic"`(发布会节奏);单页片段可选 `transition`(`"auto"|"none"|"fade"|"push"|"morph"`)与 `transition_dur`(ms)。
114
+ - **一镜到底(Morph)**:整套 10–15 页只在 **1–3 处核心转折**使用;在前后相邻两页的 **1–3 个锚点元素**(主视觉图、大号 KPI、核心卡片/短标题)上标记相同 `data-morph-id="hero-card"`,HTML 端执行零克隆 3 层 FLIP 平滑插值,PPTX 端自动生成 `!!hero-card` 命名配对与 `<p159:morph option="byObject"/>`(附 `<mc:Fallback><p:fade/></mc:Fallback>`)。**严禁**对长段正文段落加 `data-morph-id`。
115
+ - **页内入场(`data-anim`)**:每页最多分 2–3 个语义层标记 `data-anim="fade|float-up|float-left|scale-in|wipe"` 与 `data-anim-order="1|2|3"`(默认随页自动错峰完播,对应 PPTX `withEffect`;仅在需要点击分步揭晓时加 `data-anim-trigger="click"`)。`body.capture-mode`(`?slide=N`)自动禁用一切动效并直达终态,保证核验截图与 PPTX 提取零污染。
116
+
117
+ ## 四、快速 HTML 核验 → 按需通用原生 PPTX(`html_to_pptx.py` + `verify_deck.py`)
118
+
119
+ ### 1. 先跑快速 HTML 核验(`--skip-pptx`,约 3 秒)
120
+
121
+ 改稿与打磨阶段**严禁反复等待 LibreOffice 渲染**。先用 `--skip-pptx` 快速采集全部 HTML 画面、检测 `1120×680` 无缝缩放与零溢出,并生成 `verify/compare-ref-vs-html.png`:
122
+
123
+ ```text
124
+ # 首次全量快速 HTML 核验
125
+ <python> scripts/verify_deck.py --html web/index.html --ref-dir assets/reference --out-dir verify --skip-pptx --json
126
+
127
+ # 修改单页(如 web/slides/s04.html)后的快速增量核验
128
+ <python> scripts/verify_deck.py --html web/index.html --ref-dir assets/reference --out-dir verify --skip-pptx --slides 4 --json
129
+ ```
130
+
131
+ **只要 `verification_ok` 为 `false`(含 `fidelity_issues` 阻断项),还原任务即未完成,严禁直接结束交付**。碰到以下阻断项时按对应方式一次修好并重跑 `--skip-pptx`:
132
+ - **背景不一致(`background-mismatch`)**:设计稿底色偏离(ΔE > 12)或原稿带纸纹/肌理而 HTML 退化为平涂时,必须复用 `bg-plate.png` 或为该页生成去字净板写入 `bg_image`。
133
+ - **标题缩水或字重过轻(`headline-scale`)**:HTML 标题高度低于设计稿的 80% 或标题框内墨量密度低于设计稿的 70% 时,按 `measure_slide_layout.py` 量出的 `headline_est_font_px`(`headline_px`)和 `800–900` 粗字重拉足标题体量。
134
+ - **多出原稿没有的文字(`extra-text`)**:HTML 可见字数超出 `prompts/sN.txt` 逐字清单 30% 以上时,只保留设计稿上已有的文字,删掉自行添加的段落、解说或页脚。
135
+ - **高开销 SVG 滤镜(`expensive-svg-filter`)**:移除内联或 `data:image/svg+xml` 中的 `feTurbulence` / `feDisplacementMap` / `feConvolveMatrix`,改用轻量 CSS 渐变或 `assets/plates/` 净板。
136
+ - **裁切残字(`residual-crop-text`)**:`assets/crops/` 或 `assets/cutouts/` 上下边缘残留切碎文字带时,收紧 `--bbox` 重裁或走路径 2 重抽干净透明素材。
137
+
138
+ 亲自用看图能力检查 `verify/compare-ref-vs-html.png`,确认标题文案、字重、超级数字比例与版式拓扑完全忠实参考图;若有偏差集中一次修改后重跑 `--skip-pptx`。若交付模式为「仅网页演示」,通过此处即可交付结束。
139
+
140
+ ### 2. 按需编译 100% 原生 `.pptx` 与单次终审
141
+
142
+ 仅当用户需要 `.pptx` 文件时,才调用通用 DOM 编译器 `scripts/html_to_pptx.py`(直接解析任意自由布局 `web/index.html` 的真实 DOM 几何、层级与行内 run,按 `0.5 pt/px` 与 `6350 EMU/px` 写入 `<a:latin>` + `<a:ea>` 原生文本框、单边细线矩形与 `<img>` 原生边框;导出前强制所有 `<img>` 急加载并解码,防止 `<p:pic>` 遗漏;自动将 `.slide` 单张背景图、复合渐变底与底层满版 `<img>` 写入锁定原生 `<p:bg><p:bgPr><a:blipFill>` 并按 SHA-1 去重;透明图保留无损 PNG,大体积不透明图自动压为高质量 JPEG 控制文件体积;自动以 2× DPR 透明 PNG 保留旋转/斜切装饰图形),再执行**单次**双端并排核验:
143
+
144
+ ```text
145
+ <python> scripts/html_to_pptx.py --html web/index.html --out dist/deck.pptx --audit
146
+ <python> scripts/verify_deck.py --html web/index.html --pptx dist/deck.pptx --ref-dir assets/reference --out-dir verify --json
147
+ ```
148
+
149
+ `verify_deck.py` 同时校验 HTML 可见 `<img>` 与 PPTX `<p:pic>` 数量一致(缺失图片以 `pptx-missing-image` 直接阻断),并对 `Arial Black` 字宽漂移风险、非常规字体回退及 `> 15 MB` 过大 `.pptx` 输出预警。用看图能力核对 `verify/compare-html-vs-pptx.png`,确认无意外折行、无字距粘连、无阴影色边、无图形错位。
150
+
151
+ ### 3. 无浏览器 / 无 Chromium 环境回退(`--from-manifest`)
152
+
153
+ 仅在实测无头 Chromium / Playwright 无法启动时启用本回退路径(优先先探测环境,能启动浏览器仍走上文完整 HTML 还原流程):
154
+
155
+ 1. **完整保留阶段一视觉资产**:先按标准流程完成阶段一视觉设计稿、像素骨架量测(`measure_slide_layout.py`)、透底物件提取或精准裁切(`asset_sheet.py` / `crop_asset.py`)与无字净板准备,**不得因无浏览器而删减插画、底纹或降级为纯文字白底页**。
156
+ 2. **构建 `manifest_version: 1` 清单直出原生 `.pptx`**:将每页的 `backgroundColor` / `backgroundImageCss`、矢量 `box`、裁切或透底 `img` 路径与分层 `text` 项写入 `manifest.json`(含 `canvas: {width, height}` 与 `slides` 数组),不依赖浏览器直接编译:
157
+ ```text
158
+ <python> scripts/html_to_pptx.py --from-manifest manifest.json --assets-dir . --out dist/deck.pptx --audit --json
159
+ ```
160
+ 3. **离线渲染与对照核验**:用 LibreOffice 导出 PDF 并转成逐页 PNG,对照阶段一参考图逐页核查对齐、字号、配色与图片完整性:
161
+ ```text
162
+ soffice --headless --convert-to pdf dist/deck.pptx --outdir verify/
163
+ pdftoppm -png -r 150 verify/deck.pdf verify/pptx-page
164
+ ```
165
+
166
+ ## 五、高频还原踩坑对照表
167
+
168
+ | 问题现象 | 根因 | 标准修复动作 |
169
+ | --- | --- | --- |
170
+ | `<1920px` 浏览器视口页面被裁切或压成方框 | 手写 CSS `scale(calc(...))` 或 flex-shrink 压缩舞台 | 统一使用 `scripts/deck_shell.py` 壳组装,内置绝对居中 + JS `fitStage()` |
171
+ | 中间微调阶段每次等 15–30 秒 | 每轮 HTML 修改都触发 LibreOffice `.pptx` 渲染 | HTML 精修全程传 `--skip-pptx`,仅终稿按需跑一次 `html_to_pptx.py` + 终审 |
172
+ | macOS 无头浏览器中文标题字重异常 | `PingFangSC-Semibold` 排在 `HiraginoSansGB-W6` 前,或宋体字重绑定缺失 | 使用 `deck_shell.py` 内置 `@font-face` 顺序(无衬线 `HiraginoSansGB-W6` 在先,衬线按 `400–600` 常规/中等字重渲染) |
173
+ | 还原后坐标、配色或字高偏离参考图 | 凭肉眼估测 1K 原图像素 | 先跑 `scripts/measure_slide_layout.py` 读取 `1920×1080` 实测骨架与色值 |
174
+ | PPTX 中软阴影边缘发灰或出现锯齿色边 | 纯色画布上使用了半透明 alpha 抠图 | 改用 `crop_asset.py --remove-bg none --fade-edge ... --matte-bg "#HEX"` 输出精确匹配底色的不透明图 |
175
+ | PPTX 大标或大数字出现字距粘连/意外换行 | 粗体设了负 `letter-spacing` 或 `>= 800` 映射 `Arial Black` 变宽 | 粗体大标与 KPI 设 `letter-spacing: 0`,或改用 `font-weight: 700` 并预留行宽 |
176
+ | PPTX 字号或坐标整体放大 1.5 倍 | 误用 96 DPI 的 `0.75 pt/px` | 统一使用 `0.5 pt/px` 与 `6350 EMU/px`(`html_to_pptx.py` 已内建) |
177
+ | Keynote/PowerPoint 中文换行跑偏 | 仅写 `<a:latin>` 缺 `<a:ea>` | 同步写入 `<a:ea>` 并设 `margin=0` |
178
+ | PPTX 卡片顶/底实色栏出现 1px 白缝或边角外探 | 内部填充块未按父边框宽度内缩,或与父边框叠加错位 | 使内部填充块按父边框宽度内缩,或由外层容器统一绘制边框 |
@@ -0,0 +1,71 @@
1
+ # PPTX: review outline → approve a design image → image deck → optional editability
2
+
3
+ Use this path by default for new PowerPoint requests. For an explicit HTML or social-image export, use the existing Oil Slide path instead. Never mix generated files from separate decks. Commands below use `W=(python3 /path/to/oil-slide/scripts/slide_workflow.py --deck /path/to/deck)` in Bash; elsewhere invoke the Python script with the same arguments directly. Paths should be explicit, quoted, and task-local.
4
+
5
+ ## 1. Outline review: no generation yet
6
+
7
+ Create an outline JSON array in a new deck directory. Each entry needs `title` and `content`; optionally add `layout`, `notes`, and `assets` (strings; list which source assets must be preserved). Use the existing Oil Slide brand and facts requirements. Run:
8
+
9
+ ```bash
10
+ "${W[@]}" outline --file /path/to/outline.json --ratio 16:9
11
+ ```
12
+
13
+ Show the actual outline with each page's title/content, ask for corrections, and ask how many **actual** design images to produce (1–3). Suggest a representative content page, not always the cover. No images or PPTX before explicit acceptance of both outline and count. If the user revises the outline, call `outline` again and request approval of the new revision. The DSH outline editor saves titles, content, page order and a brand preset directly. Read status before approving so edits from the panel are included. A preset is reusable on this host and is copied into the project when selected. Brand colors, typography, footer and optional PPT theme guide rendering. The logo and embedded PPT thumbnail, when available, travel as image references. For CLI use, `brand-list` returns preset IDs and `edit-outline --file edits.json` takes `{"revision":"<outlineRevision>","pages":[...],"brandId":"<preset id>"}` (null clears a preset). In DSH, use a single question with id `outlineQuestionId` if asking for outline approval. The panel displays the outline and count/page controls; after each state change, use the existing preview-open functionality when available, targeting this deck, or provide paths in hosts with no panel.
14
+
15
+ ```bash
16
+ "${W[@]}" approve-outline --revision <current-outlineRevision> --count 3 --sample-page 2
17
+ ```
18
+
19
+ ## 2. Actual design samples: stop for a choice
20
+
21
+ Generate the approved count for **the same slide**, with the same approved content and canvas. Differ in palette (within brand guidelines), composition, art direction, or typography system. For inspiration see `art-directions.md` and `../vendor/codex-ppt/styles/`; do not force a single design template. Write each style specification to a short file recording palette, type hierarchy, illustration material, grid/margins and density. Bring necessary brand and source assets as reference inputs; never repaint an official logo or change factual labels.
22
+
23
+ Use the DSH sidebar’s **生图设置** to add each API base URL, optional key and model IDs from discovery or manual entry. Choose the default and any backups in order. Standalone installs can set `OPENAI_BASE_URL` and `CODEX_PPT_IMAGE_MODEL` with an optional `OPENAI_API_KEY`. Saved settings take precedence. Install Pillow and requests in the active Python. Additional local `--ref` inputs are sent as reference images. If all configured routes fail, stop generation and keep recorded pages.
24
+
25
+ ```bash
26
+ "${W[@]}" render-draft --number 1 --style style-a.txt
27
+ ```
28
+
29
+ Show the normalized `assets/explore/design-XX.png` images, not just text descriptions. If the user dislikes all options, replace those numbered samples while staying in the style stage, then show the updated images. For a targeted revision, update the style file to include the user's changes, then run `render-draft --number N --style FILE --from-sha256 CURRENT --feedback "exact request"`. This edits the displayed image and archives the previous pixels and style. Start a fresh group with `new-design-set --review-id CURRENT_REVIEW_ID` (omit --review-id for old decks), then use render-draft for each slot without --feedback. To restore a historical sample use `restore-draft --number N --from-sha256 CURRENT --version ARCHIVED_HASH`. Always show the new images and wait again. For hosts with structured questions, ask one single-choice question whose id is the exact current reviewId from state. Prefix each option with its actual candidate number (e.g. “设计稿 2 · 官方字场” or “Design 2 · Typography”). Keep numbers when reordering options. Accept custom answers for requested changes and restore actions. Verify text, brand and layout before asking for approval. Use the current candidate digest from state, never approve a stale candidate. User approval of one sample locks both its exact pixels and style spec:
30
+
31
+ ```bash
32
+ "${W[@]}" approve-style --number 1 --sha256 <selected-candidate-current-sha256>
33
+ ```
34
+
35
+ ## 3. Image-only final first
36
+
37
+ The approved sample is copied byte-for-byte as the final for its original page. Do not redraw it. Use that sample as actual image reference 1 on every other page, with the locked style rules. Change the layout to match the content rather than cloning the sample. Preserve the facts, numbers and source figures. `page-prompt` returns the complete prompt and the on-disk reference path for inspection. For the API path, `render-page` sends the reference as an actual input and records the page. The image model can still drift page to page: review visual consistency and text before export and redo only mismatches. The renderer reports any automatic switch to a user-configured backup and sends it the same references. If all configured models fail, keep already recorded pages and resume missing pages after the issue is resolved.
38
+
39
+ ```bash
40
+ "${W[@]}" page-prompt --number 1
41
+ "${W[@]}" add-page --number 1 --image /path/to/page-1.png # optional import of an existing user-provided image
42
+ # or: "${W[@]}" render-page --number 1
43
+ "${W[@]}" export-images
44
+ ```
45
+
46
+ Wait until all pages are present and reviewed before export. Deliver `dist/deck-images.pptx` immediately, and show the pages for review. This is a PowerPoint file with an exact image per slide and native notes if supplied; its text is **not editable**. Ask if the user wants the optional reconstruction only after this deck is available. To revise the current image or editable deck, run `revise-pages --revision R --number N --feedback "user request"` (R is deckRevision, default 1). The previous downloads remain under dist/revisions/rR/. Render the pending pages and export-images again before asking about editability. Subsequent rounds use the latest page image as a reference. The sample page can be changed locally while other slides keep the approved style. Only when the user explicitly wants its style applied to the whole deck, pass --restyle for that sample, render it first, then the remaining pages. A new editable conversion uses the run path returned by editable-prepare. Keep earlier runs separate. Show the right-side slide canvas after export; download is a separate action.
47
+
48
+ For a localized change, drag a rectangle on the image deck in the DSH Slides tab. The candidate is previewed before replacing the current page. The CLI equivalent is `propose-region --number N --revision R --box LEFT TOP RIGHT BOTTOM --feedback "…"`, with coordinates measured from the top left on a 0–1000 scale. Inspect the candidate and run `resolve-region --proposal ID --choice keep` or `--choice apply` only after the user decides. The edit uses the configured image channel. Applying keeps original pixels outside the rectangle and exports a new image revision.
49
+
50
+ ## 4. Optional separate editable PPTX
51
+
52
+ On explicit request after reviewing the image deck, record the approval. Read the pinned [conversion skill](../vendor/image-to-editable-ppt/SKILL.md), including required runtime setup / OCR choice, reconstruction, and asset policy. Install the bundled version of the converter. Oil Slide prepares serial-local runs: the current agent reconstructs one page at a time, including multi-page decks. Each page goes through the same build, validation and record steps before the next page is claimed. After an interruption, inspect the current claim and resume it.
53
+
54
+ ```bash
55
+ "${W[@]}" approve-images
56
+ pipx install --force --editable <skill>/vendor/image-to-editable-ppt/cli
57
+ editppt doctor
58
+ "${W[@]}" editable-prepare
59
+ ```
60
+
61
+ Read the plan returned by `editable-prepare`. For example, `changed: [2, 5]` maps the run's `page_001` to original slide 2 and `page_002` to slide 5. Reconstruct just those pages. Run `editppt run next <returned-run> --json` to begin or resume. If `changed` is empty, go straight to `editable-finalize`. The first conversion covers all pages. Updates reuse the project's most recent paired image and editable exports, preserving the native objects on reused pages. PowerPoint edits saved into the project editable file are included, while edits in a separately downloaded copy are outside this workflow.
62
+
63
+ The prepared input is the image PPTX for the pages identified by the plan, so native notes and exact image pixels can be extracted without rendering the deck. Use the converter's page prompt, dispatch, native-object reconstruction, per-page visual checks, and record commands. Every visible text line that can be recognized should be a native text box; straightforward shapes and supported tables should be native. Repaired backgrounds and separate photos/complex illustrations may remain bitmap assets. Compare each PowerPoint rendering against its approved image for layout, alignment, typography, data and assets; repair significant differences before recording. Do not paste the original slide as a flattened background with invisible/editable text on top. Keep page reports and artifacts in the editable run, separate from the image deck. Use the actual run path returned by editable-prepare for every converter command. After the converter accepts the pages:
64
+
65
+ ```bash
66
+ "${W[@]}" editable-finalize
67
+ ```
68
+
69
+ For subsequent revisions, `inspect-native --number N` reports the source pages that changed and the real native objects on page N. When the user selects a single changed page, use `approve-images --number N` and complete the returned run. Other changed pages remain pending until the user requests them. For the initial full conversion or to update all outstanding changes, use `approve-images` without a page number.
70
+
71
+ Deliver `dist/deck-editable.pptx` and retain `dist/deck-images.pptx` for the original visual fidelity. Explain bitmap objects when applicable and distinguish a structural check from a visual comparison. DSH workflow buttons submit the requested step to the active conversation. If that composer already has text or attachments, the request is copied instead so you can send it without losing your draft. The slide canvas previews the image deck directly. Editable previews render the exported PPTX using LibreOffice + pdftoppm (or supported macOS Keynote). After installing a renderer, run `preview-editable` to backfill old decks. Download buttons open the DSH file viewer with its download control. A host without a panel can run the same steps conversationally.