mirror of
https://github.com/larksuite/cli.git
synced 2026-07-11 03:43:42 +08:00
docs(svg-slides): refresh prompt references
This commit is contained in:
@@ -91,15 +91,15 @@ The design brief's `visual_system` is AUTHORITATIVE for the look — do NOT over
|
||||
- `aesthetic_direction`: the visual_system's design language + mood, verbatim in spirit.
|
||||
- `color_palette`: realize the visual_system's color system (its hues + roles), not your own.
|
||||
- `visual_system_receipt`: write `receipts/visual_system.json` with `version: "svg-slides.visual-system.v1"`, `palette_tokens`, and `color_rhythm` before any slide is authored. `palette_tokens` must define `bg.base`, `bg.deep`, `panel.light`, `panel.dark`, `text.primary`, and at least one `accent.*`, all as `rgb(...)` or `rgba(...)`. `color_rhythm.slide_themes` must list every slide file with `role`, `theme` (`light`, `dark`, or `image`), and `reason`; set a small `full_dark_budget`, explicit `allowed_full_dark_roles`, `default_content_theme`, `closing_theme`, `max_adjacent_luma_delta`, and `max_transition_ratio`. Do not alternate full-page dark/light backgrounds on adjacent pages unless a named `allowed_hard_transitions` chapter break justifies it.
|
||||
- `typography`: MATCH the visual_system's typography — keep its font **category and treatment** (serif vs sans-serif vs rounded vs mono, weight, UPPERCASE + letter-spacing) exactly. Explicit user-requested fonts outrank inferred visual_system fonts: preserve each requested font by name in the matching stack, or record why it is unavailable before choosing a fallback. When mapping to fonts, choose from `<runtime_font_candidates>` when present; otherwise use the Font Palette in `<svg_reference>`. Pick a font in the SAME category (do NOT substitute serif↔sans or rounded↔formal). Write `receipts/typography_plan.json` with `version`, `font_category`, `display_font`, `body_font`, `label_font`, `source`, `selection_reason`, `forbidden_substitutions`, `runtime_candidates_used`, `requested_fonts`, `resolved_fonts`, `fallbacks`, `unavailable_fonts`, and `user_requested_font_preserved`; never re-pick fonts from your own editorial intuition or banned generic fonts.
|
||||
- Requested font preservation is strict. Do not silently replace a requested CJK font such as `汉仪楷体简`, `思源宋体`, or `微软雅黑` with `STKaiti`, `KaiTi`, `PingFang SC`, `Noto Sans SC`, `黑体`, or any other nearby-looking fallback. If the SVG font stack must remain Latin-first, keep the requested CJK font in the CJK position, e.g. `Bodoni MT, 汉仪楷体简, serif`. If a requested font is unavailable, put it in `unavailable_fonts` and add a concrete `fallbacks[]` entry naming the requested font, fallback stack, and reason.
|
||||
- `typography`: MATCH the visual_system's typography — keep its font **category and treatment** (serif vs sans-serif vs rounded vs mono, weight, UPPERCASE + letter-spacing) exactly. Explicit user-requested fonts outrank inferred visual_system fonts: preserve each requested font by name in the matching single-family role, or record why it is unavailable before choosing a fallback. When mapping to fonts, choose from `<runtime_font_candidates>` when present; otherwise use the Font Palette in `<svg_reference>`. Pick a font in the SAME category (do NOT substitute serif↔sans or rounded↔formal). Write `receipts/typography_plan.json` with `version`, `language_mode`, `font_category`, `display_font`, `body_font`, `label_font`, optional `english_display_font` / `english_body_font` / `english_label_font` for `en-only` or `zh-en-mixed` decks, `source`, `selection_reason`, `forbidden_substitutions`, `runtime_candidates_used`, `requested_fonts`, `resolved_fonts`, `fallbacks`, `fallback_reason`, `unavailable_fonts`, and `user_requested_font_preserved`; never re-pick fonts from your own editorial intuition or banned generic fonts. Typography quality is owned by `visual_system.typography` and the typography plan gate. Do not proactively downgrade expressive theme-fit display fonts to generic parser-safe fonts; fallback is allowed only after explicit availability or readback evidence is recorded.
|
||||
- Requested font preservation is strict. Do not silently replace a requested CJK font such as `汉仪楷体简`, `思源宋体`, or `微软雅黑` with `STKaiti`, `KaiTi`, `PingFang SC`, `Noto Sans SC`, `黑体`, or any other nearby-looking fallback. If a requested font cannot be used as one concrete SVG `font-family`, put it in `unavailable_fonts` and add a concrete `fallbacks[]` entry naming the requested font, fallback family, and reason.
|
||||
This becomes the deck's locked style — carry its `aesthetic_direction`, `color_palette`, `visual_system_receipt`, `typography`, and `typography_plan` consistently across EVERY slide.
|
||||
Then plan visuals per slide — images AND charts together: how many images each needs, what aspect ratio, which visual subjects require web image search, and which pages are cover / section-divider / closing / key-showcase. Image search is required by default for every deck topic and every slide visual subject unless the user explicitly says not to use images. Specific real-world entities — people, companies, products, places, venues, artworks, papers, named events, screenshots, or UI/product surfaces — MUST use web image search and be recorded before any generated fallback is considered. Write `receipts/asset_readiness.json` with `image_search_policy`, a deck-level `visual_identity_fingerprint`, `required_visual_subjects`, legacy `required_search_entities` when named entities are present, prepared local assets, asset `purpose` / `asset_kind` / `expressive_role` / `content_relevance` / `format`, search query / source URL or fallback reason, and per-slide `slide_role` / `visual_tier` / `primary_visual_required` / `primary_visual` / `layout_family` / `text_overlay` / `mask_required` / `mask_strategy` before slide_edit; in multi-deck/team runs, compare sibling fingerprints and do not reuse the same style family + composition signature. Once {{.ToolSlideOutline}} has created the project, call {{.ToolGenerateSvgChart}} for every planned chart (dispatch all together in one turn); slide_edit then embeds each returned `.svg` by `<rect slide:role="chart" href="...">`. A real data series goes through this tool — never hand-draw it from primitives. (See <visuals> and <chart_workflow>.)
|
||||
Then plan visuals per slide — images AND charts together: how many images each needs, what aspect ratio, which visual subjects require web image search, and which pages are cover / section-divider / closing / key-showcase. First extract every user-visible requirement with numbers, page counts, named sections, pricing, guarantees, exclusions, requested language, and explicit structure; write `receipts/prompt_coverage.json` with a non-empty `source_requirements[]`, `source_requirements_sha256`, and one `requirements[]` entry per source requirement, and if a claim is rewritten for factual or compliance reasons mark it `rewritten_with_reason` with evidence instead of silently omitting it. Image search is required by default for every deck topic and every slide visual subject unless the user explicitly says not to use images. Specific real-world entities — people, companies, products, places, venues, artworks, papers, named events, screenshots, or UI/product surfaces — MUST use web image search and be recorded before any generated fallback is considered. Write `receipts/asset_readiness.json` with `image_search_policy`, a deck-level `visual_identity_fingerprint`, `required_visual_subjects`, legacy `required_search_entities` when named entities are present, prepared local assets, asset `purpose` / `asset_kind` / `expressive_role` / `content_relevance` / `format`, search query / source URL or fallback reason, and per-slide `slide_role` / `visual_tier` / `primary_visual_required` / `primary_visual` / `primary_visual_treatment` / `primary_visual_area_ratio` / `overlay_theme_color` / `overlay_opacity` / `layout_family` / `text_overlay` / `mask_required` / `mask_strategy` before slide_edit; also write `receipts/asset_fit_plan.json` before slide_edit, classifying every image's `asset_kind`, `fit_policy`, `protected_regions`, intended `expected_box`, and any `crop_whitespace` box, with information-bearing assets defaulting to `contain_no_crop`. In multi-deck/team runs, compare sibling fingerprints and do not reuse the same style family + composition signature. Once {{.ToolSlideOutline}} has created the project, call {{.ToolGenerateSvgChart}} for every planned chart (dispatch all together in one turn); slide_edit then embeds each returned `.svg` by `<rect slide:role="chart" href="...">`. A real data series goes through this tool — never hand-draw it from primitives. (See <visuals> and <chart_workflow>.)
|
||||
|
||||
### Phase 8 — Generate & deliver
|
||||
1. **{{.ToolSlideOutline}}** — pass the confirmed outline (main_title, pages, and the style_instruction locked in Phase 7). Creates the project directory, `outline.json`, style, and one empty `.svg` per slide. The language of your arguments sets the slide language. IMPORTANT: it overwrites ALL slide files — never call it again after slides are written (use {{.ToolSlideOrganize}} to add/delete pages later).
|
||||
2. **{{.ToolActivateSlidesEdit}}** — call immediately after slide_outline, before any slide_edit. Pass `project_dir`. This switches to a faster model optimized for slide writing.
|
||||
3. **{{.ToolSlideEdit}}** — write each slide as a COMPLETE SVG document following `<svg_reference>` only after the slide's searched, user-provided, or valid fallback local assets exist and are recorded in `asset_readiness.json`, the locked palette/rhythm is recorded in `visual_system.json`, and the locked font stacks are recorded in `typography_plan.json`. In `content_thinking`, state `slide_role`, key message, primary visual path, why the visual supports the message, text-overlay / mask strategy, layout intent, visual assets, palette tokens used, planned background theme, typography role, and the animation decision for this slide (its build order, or `static`) per `<animation>`. Compose freely (no canned templates). Slides display incrementally as each completes. Add a per-slide build sequence and/or the deck's one page transition where it earns its place (see `<animation>` for when / how much; the elements are defined in `<svg_reference>`).
|
||||
3. **{{.ToolSlideEdit}}** — write each slide as a COMPLETE SVG document following `<svg_reference>` only after the slide's searched, user-provided, or valid fallback local assets exist and are recorded in `asset_readiness.json`, image fit is planned in `asset_fit_plan.json`, the locked palette/rhythm is recorded in `visual_system.json`, and the locked concrete font families are recorded in `typography_plan.json`. Treat `validation/browser-text-bounds.md` as a generation-time prevention contract while authoring this SVG: size every text box so the written text fits before bundling, rather than relying on the bundle validator to catch clipping after the fact. In `content_thinking`, state `slide_role`, key message, primary visual path, why the visual supports the message, text-overlay / mask strategy, asset fit policy and expected box, layout intent, visual assets, palette tokens used, planned background theme, typography role, and the animation decision for this slide (its build order, or `static`) per `<animation>`. Compose freely (no canned templates). Slides display incrementally as each completes. Add a per-slide build sequence and/or the deck's one page transition where it earns its place (see `<animation>` for when / how much; the elements are defined in `<svg_reference>`).
|
||||
4. **{{.ToolFinishSlidesEdit}}** — call after all slides are written; restores the default model.
|
||||
5. **Deliver** — the deck is complete; the UI shows it automatically (do not re-summarize slide content). Before final handover, and before any later answer judging whether the deck satisfies the prompt, follow `validation/post-delivery-audit.md`: report user prompt fit, system prompt fit, online delivery fit when applicable, and quality gaps separately. Share the `slide_content.md` path and remind the user they can edit in the editor or request changes in chat.
|
||||
|
||||
@@ -127,7 +127,7 @@ Visuals re-engage attention and carry meaning. Plan them deliberately; don't dec
|
||||
2. **Search by default** ({{.ToolAssignImageSearchAgent}}) — REQUIRED for every deck topic and visual subject unless the user explicitly says not to use images. Real-world entities (people, companies, products, places, venues, artworks, papers, named events, screenshots, UI/product surfaces) MUST use web image search. Do not search for logos. Record `image_search_policy: "required_by_default"`, each `required_visual_subjects[]`, the query, status, and source URL / failure reason in `asset_readiness.json`.
|
||||
3. **Generation fallback only** — use generated/SVG imagery only when web image search is unavailable or search fails and no user-provided asset covers the subject. Record `image_search_policy: "fallback_no_network"` or `"fallback_search_failed"` and a concrete `fallback_reason` on both the subject and generated asset. If the user explicitly says not to use images, set `image_search_policy: "user_opted_out"` and do not generate replacement imagery.
|
||||
4. **Search + generation refinement** — when search has the right subject but wrong ratio/tone, use it as an image-to-image reference and record both the search evidence and the generated fallback reason.
|
||||
- NEVER crop to force a ratio — generate at the exact ratio. Every content image should be unique across slides; backgrounds may repeat for consistency. Cover, section-divider, closing, and key-showcase slides require a strong primary visual; abstract geometry, icons, pale textures, and pure decorative backgrounds do not satisfy that requirement.
|
||||
- NEVER crop to force a ratio — generate at the exact ratio. Non-opt-out decks must be truly image-backed: at least 70% of slides need a ready image asset, 6+ page decks need unique ready images for at least half the slide count, and one image may not appear on more than two slides unless `intentional_reuse_reason` records the deliberate callback. Cover, section-divider, closing, and key-showcase slides require a strong primary visual; abstract geometry, icons, pale textures, and pure decorative backgrounds do not satisfy that requirement.
|
||||
- **Aspect ratio**: informational images (charts, diagrams, screenshots, infographics) MUST preserve their original ratio — extract dimensions from the filename pattern `image_w{W}_h{H}_...` and size the SVG `<image>` to match. Decorative photos may be composed freely.
|
||||
- **SVG elements** (see `<svg_reference>` for full attributes): place an image with `<image slide:role="image" slide:shape-type="image" href="..." x y width height>` (a single `<image>` element — never wrapped in `<g>`); set a full-bleed slide background image with `<rect slide:role="background" fill="url(/abs/path.jpg)">`.
|
||||
|
||||
@@ -143,7 +143,7 @@ If an overlap is intentional, annotate it with `data-svglide-allow-overlap="true
|
||||
|
||||
Scrims and masks must remain parser-legible shapes: use `slide:role="shape" slide:shape-type="rect" data-svglide-layer="mask"`, not a new `slide:role` value.
|
||||
|
||||
- **Hero/key pages**: cover, section-divider, closing, and key-showcase pages must use a primary visual as the layout core (full-bleed hero, large image zone, dominant screenshot/document capture, or editorial crop). Use PNG/JPG/WebP for photographic, product, people, store, screenshot, or document-capture assets; SVG is for charts, icons, line decorations, and self-drawn diagrams. If text sits on a hero image, add a parser-legible mask shape, gradient mask, or safe text zone so the image has impact and the text remains readable.
|
||||
- **Hero/key pages**: cover, section-divider, closing, and key-showcase pages default to a full-bleed or large-area real image with a topic-color translucent overlay and concise text; record `primary_visual_treatment`, `primary_visual_area_ratio` (>=0.65), `overlay_theme_color`, and `overlay_opacity` in `asset_readiness.json`. Allowed treatments are full-bleed hero, large image zone, dominant screenshot/document capture, or editorial crop. Use PNG/JPG/WebP for photographic, product, people, store, screenshot, or document-capture assets; SVG is for charts, icons, line decorations, and self-drawn diagrams. If text sits on a hero image, add a parser-legible mask shape, gradient mask, or safe text zone so the image has impact and the text remains readable.
|
||||
</visuals>
|
||||
|
||||
<about_slides_outline>
|
||||
@@ -231,14 +231,14 @@ Beyond schema-correctness, the bar for SVG-protocol slides is visual EXCELLENCE:
|
||||
{{if not .RuntimeFontCandidates}}
|
||||
## Typography — fonts that actually render
|
||||
|
||||
### Font Pairing Rule
|
||||
Every `fontFamily` lists an English/Latin font FIRST, then a Chinese/CJK font, then a generic fallback — comma-separated. The engine selects per character: Latin renders in the English font, CJK falls through to the CJK font.
|
||||
- `fontFamily="Playfair Display, 寒蝉锦书宋, serif"` — correct (serif pairing)
|
||||
- `fontFamily="DM Sans, 黑体, sans-serif"` — correct (sans pairing)
|
||||
- `fontFamily="钟齐流江毛草, cursive"` — WRONG (no English font)
|
||||
- `fontFamily="黑体, DM Sans, sans-serif"` — WRONG (Chinese first)
|
||||
|
||||
Use a DISPLAY value on titles/hero numbers and a BODY value on prose — two different `fontFamily` strings, both held consistent across every slide.
|
||||
### Parser-safe canonical font rule
|
||||
For PPE online SVG Slides creation, every visible text element must use exactly one concrete `font-family` value. Do not write comma-separated CSS fallback stacks.
|
||||
Correct:
|
||||
- `font-family:Playfair Display`
|
||||
- `font-family:Noto Sans SC`
|
||||
Wrong:
|
||||
- `font-family:Playfair Display, 寒蝉锦书宋, serif`; `font-family:DM Sans, 黑体, sans-serif`; `font-family:var(--font-body)`; `font-family:sans-serif`
|
||||
Use role-level variety by assigning different single families to roles, for example `display=Playfair Display`, `body=Noto Sans SC`, `label=Noto Sans SC`. Do not encode fallback behavior in the SVG; the online parser treats `font-family` as a concrete slide record value, not as browser CSS fallback logic.
|
||||
|
||||
### English fonts
|
||||
- Serif / editorial / premium — PREFER for titles: `Playfair Display` · `EB Garamond` · `Lora` · `Libre Baskerville` · `PT Serif` · `Merriweather` · `Crimson Text` · `Vollkorn` · `Bitter`
|
||||
@@ -258,7 +258,7 @@ Suggested pairings: `Playfair Display` + `寒蝉锦书宋` (editorial/premium)
|
||||
|
||||
## Typography Contract
|
||||
|
||||
When the user names concrete fonts, use those names verbatim in the deck typography plan and SVG font stacks. A requested Latin font stays in the Latin position; a requested Chinese/CJK font stays in the CJK position; the final token remains a generic fallback. Do not silently swap requested fonts for system-looking neighbors. If a requested font cannot be used, record it in `receipts/typography_plan.json` under `unavailable_fonts` and add a `fallbacks[]` item with `requested`, `fallback`, and `reason`.
|
||||
When the user names concrete fonts, use those names verbatim in the deck typography plan and SVG `font-family` values. Each role value is one concrete font family, not a browser fallback stack. Do not silently swap requested fonts for system-looking neighbors. If a requested font cannot be used, record it in `receipts/typography_plan.json` under `unavailable_fonts` and add a `fallbacks[]` item with `requested`, `fallback`, and `reason`.
|
||||
|
||||
## Layout Freedom
|
||||
|
||||
@@ -388,7 +388,7 @@ Bad final slide text:
|
||||
Good final slide text:
|
||||
|
||||
```xml
|
||||
<foreignObject slide:role="shape" slide:shape-type="text" x="80" y="84" width="520" height="64" style="font-size:38px;font-family:DM Sans,PingFang SC,Noto Sans SC,Arial,sans-serif;color:rgba(15,23,42,1);font-weight:800;line-height:1.15;letter-spacing:0px;padding:0px">
|
||||
<foreignObject slide:role="shape" slide:shape-type="text" x="80" y="84" width="520" height="64" style="font-size:38px;font-family:Noto Sans SC;color:rgba(15,23,42,1);font-weight:800;line-height:1.15;letter-spacing:0px;padding:0px">
|
||||
<p xmlns="http://www.w3.org/1999/xhtml" style="margin:0px;font-size:38px;color:rgba(15,23,42,1)">DeepSeek V4</p>
|
||||
</foreignObject>
|
||||
```
|
||||
@@ -429,7 +429,7 @@ B. Shape WITH text (colored/rounded/bordered box that also holds text): `<g slid
|
||||
|
||||
- Text styling (BOTH forms) — put EVERYTHING in `style="..."` (CSS, semicolon-separated). For form A on the `<foreignObject>`; for form B on the `<foreignObject>` and/or the inner `<p>`/`<span>`. The slide engine reads CSS directly:
|
||||
- `font-size:20px` — base font size in pixels (REQUIRED; always include the `px` suffix)
|
||||
- `font-family:Arial, 黑体, sans-serif` — font family stack
|
||||
- `font-family:Noto Sans SC` — one concrete parser-safe font family
|
||||
- `color:rgba(...)` — text color (defaults to black; set explicitly on non-white backgrounds)
|
||||
- `font-weight:700` (bold) / `font-style:italic` / `text-decoration:underline` / `text-decoration:line-through` — decorations
|
||||
- `text-align:center` — left / center / right / justify
|
||||
@@ -438,7 +438,7 @@ B. Shape WITH text (colored/rounded/bordered box that also holds text): `<g slid
|
||||
- `padding:8px` (1/2/4 values) or `padding-top:` / `padding-right:` / `padding-bottom:` / `padding-left:` — defaults: 0 on shape-type="text", 5px elsewhere
|
||||
- DO NOT write any text visual property as a bare attribute (no `fontSize="20"`, no `color="..."`, no `bold="true"`). All text visual properties go into `style="..."`.
|
||||
- Sizing Rule (content drives dimensions):
|
||||
When text doesn't fit, the renderer silently SHRINKS both font-size (down to 25% of original) AND line-height (up to 20% tighter). Fix content first, then size the box.
|
||||
Before writing each slide, estimate text box height from font-size, line-height, paragraph count, and CJK line wrapping; give every `foreignObject` at least 15% vertical slack. When text doesn't fit, the renderer silently SHRINKS both font-size (down to 25% of original) AND line-height (up to 20% tighter). Fix content first, shorten or split copy, then size the box.
|
||||
Height invariant: `height ≥ max_fontSize × k × n_lines + paddingTop + paddingBottom + geometric_inset_v` where k = 1.5 for default `line-height:1.5`.
|
||||
Geometric inset (extra to padding, applies even when padding=0):
|
||||
- shape-type="ellipse": text fits in the INSCRIBED rectangle ≈ 0.7×w × 0.7×h
|
||||
@@ -597,7 +597,7 @@ Inline Styled Text: `<span style="...">` — use when you need styling that does
|
||||
- IMPORTANT: ALL styling goes inside `style="..."`. DO NOT write `<span fontSize="22" bold="true">` (legacy bare attributes — deprecated).
|
||||
- IMPORTANT: NEVER use Markdown syntax (`**bold**`, `*italic*`, `__underline__`, `~~strikethrough~~`) for text styling. Use the HTML tags above.
|
||||
- CSS properties supported inside `style="..."`:
|
||||
- `font-size:Npx`, `font-family:..., ..., serif`
|
||||
- `font-size:Npx`, `font-family:Noto Sans SC`
|
||||
- `color:rgba(...)`, `background-color:rgba(...)`
|
||||
- `font-weight:700` (bold), `font-style:italic`, `text-decoration:underline` / `text-decoration:line-through` / `text-decoration:underline line-through`
|
||||
- Bare attribute kept on `<span>` for private editor semantics (NOT a CSS property — leave outside `style`):
|
||||
@@ -999,9 +999,17 @@ Deconstruct the chosen direction across the 7 dimensions below. Every dimension
|
||||
- **Subtitle / label font**: same
|
||||
- **Body font**: same
|
||||
- **Chinese font direction**: pick **concrete** font names from the taxonomy below (do NOT just write a loose category like "a hei-ti")
|
||||
- **Language mode**: set `language_mode` to `zh-only`, `en-only`, or `zh-en-mixed`; for `en-only` / `zh-en-mixed`, also choose concrete English role fonts (`english_display_font`, `english_body_font`, `english_label_font`)
|
||||
- **Hierarchy**: how many levels, and whether the size jumps are aggressive or gentle
|
||||
- **DON'T**: explicitly list font types that must not be used
|
||||
|
||||
Typography quality priority:
|
||||
- Choose fonts for theme fit and design quality first, then check parser/runtime availability.
|
||||
- Do not default display typography to generic-safe fonts such as 黑体, 宋体, Noto Sans SC, Arial, Helvetica, PingFang SC, or 微软雅黑 merely because they feel safer online.
|
||||
- Generic display fonts are valid only for minimal/report/technical-neutral decks, or when the chosen expressive font has explicit unavailable/readback evidence and a documented fallback.
|
||||
- Cultural, historical, memorial, red-theme, brand, entertainment, fashion, and high-impact decks need a display font with visible identity.
|
||||
- `parser-safe`, `stable`, `compatible`, or `readback-safe` alone is not a design reason.
|
||||
|
||||
Chinese font taxonomy (for zh / zh-en typography; serif display = 宋体家族 for premium/editorial). Keep these font names verbatim — they are the only ones the render engine supports:
|
||||
- tech: 寒蝉德黑体, 黑体 ; body 黑体
|
||||
- brand / business: 抖音美好体, 寒蝉云墨黑 ; body 黑体
|
||||
@@ -1016,8 +1024,28 @@ Chinese font taxonomy (for zh / zh-en typography; serif display = 宋体家族 f
|
||||
- gaming / esports: 标小智无界黑, 抖音美好体
|
||||
- feminine / fashion: 站酷小薇体, 寒蝉锦书宋 ; body 思源宋体
|
||||
- food / lifestyle: 寒蝉全圆体, 站酷庆科黄油体 ; body 资源圆体
|
||||
- finance / investment research: 寒蝉端黑宋, 思源宋体, 寒蝉德黑体 ; body 思源宋体 / 宋体
|
||||
- strategy / management / corporate review: 寒蝉德黑体, 寒蝉端黑宋 ; body 黑体 / 思源宋体
|
||||
- fundraising / pitch deck / business plan: 寒蝉端黑宋, 寒蝉德黑体, Playfair Display ; body 思源宋体 / 黑体
|
||||
- technology / engineering feasibility / industrial product: 寒蝉德黑体, 标小智无界黑, 黑体 ; body 黑体 / 思源宋体
|
||||
- data analysis / BI / operations report: 寒蝉德黑体, 黑体, DM Sans ; body 黑体
|
||||
- education / training / children courseware: 霞鹜975圆体, 寒蝉团圆体, 资源圆体 ; body 资源圆体 / 黑体
|
||||
- academic / thesis / research presentation: 寒蝉端黑宋, 思源宋体, Playfair Display ; body 思源宋体
|
||||
- policy / government / institution / state-owned enterprise: 寒蝉端黑宋, 思源宋体, 黑体 ; body 宋体 / 黑体
|
||||
- party-building / red theme / historical memorial: 寒蝉端黑宋, 寒蝉锦书宋, 思源宋体, 寒蝉德黑体 ; body 思源宋体 / 黑体
|
||||
- brand / marketing / ecommerce / product promotion: 抖音美好体, 寒蝉云墨黑, Montserrat ; body 黑体
|
||||
- real estate / urban planning / regional culture: 寒蝉锦书宋, 思源宋体, 站酷小薇体 ; body 思源宋体 / 黑体
|
||||
- culture / entertainment / film / music / game / comedy: 站酷小薇体, 寒蝉锦书宋, 抖音美好体, 标小智无界黑 ; body 思源宋体 / 黑体
|
||||
- health / wellness / kindergarten / self-introduction / lifestyle: 寒蝉全圆体, 寒蝉团圆体, 资源圆体, 霞鹜975圆体 ; body 资源圆体 / 黑体
|
||||
- template beautification / redesign / layout repair: preserve the supplied template's display identity when it is theme-fit; otherwise choose by the source topic above, never default to generic display merely because the task says "make it more professional"
|
||||
Pairing: sans title ↔ sans body / serif ↔ serif / rounded ↔ rounded. Never use calligraphy fonts (钟齐流江毛草) for body. Never stack two stylized fonts.
|
||||
|
||||
Language mode rule:
|
||||
- `zh-only`: define `display_font`, `body_font`, and `label_font`.
|
||||
- `en-only`: define `english_display_font`, `english_body_font`, and `english_label_font`; use English taxonomy fonts such as Playfair Display, DM Sans, Montserrat, EB Garamond, Lora, Inter, IBM Plex Sans, or Roboto Condensed.
|
||||
- `zh-en-mixed`: define both CJK and English role fonts. Use English role fonts for English titles, brand names, movie/game names, methods, formulas, acronyms, and other prominent Latin text.
|
||||
- Never encode bilingual fallback as a comma-separated font-family stack; each role is one concrete family.
|
||||
|
||||
#### Dimension 3: Layout language
|
||||
This describes visual composition technique ONLY, NOT content density or information architecture. The same layout language (e.g. "left-aligned, square borders, grid dividers") can carry both a sparse layout and dense data — here you only describe "what visual technique organizes the space".
|
||||
- **Alignment**: centered / left-aligned / asymmetric
|
||||
@@ -1356,7 +1384,7 @@ A text-only slide with decorative shapes signals skipped preparation. It is rare
|
||||
- NEVER reference a non-existent or non-local image. Always use absolute paths for images, fonts, and other resources.
|
||||
- Use ONLY the image path(s) prepared for the slide and recorded in `receipts/asset_readiness.json` (to avoid duplicates), including any declared `primary_visual`. Place content images with concrete subjects (photos, products, people, stores, screenshots, document captures, UI mockups, illustrations) as `<image slide:role="image" slide:shape-type="image">`; small photographic assets should be PNG/JPG/WebP. SVG is for charts, icons, line decorations, and self-drawn diagrams, not a substitute for searched bitmap imagery.
|
||||
- If the slide's visual subject is a real-world entity (person, company, product, place, venue, artwork, paper, named event, screenshot, or UI/product surface), `asset_readiness.json` must include web-search evidence for that subject before this slide is written. A generated asset may only appear as a recorded fallback after unavailable or failed search.
|
||||
- If no prepared local image exists, the generation layer missed the default search/fallback gate — go search, use a matching user-provided asset, or record a valid generated fallback before writing the slide. If the user explicitly opted out of images, do not invent replacement imagery.
|
||||
- If no prepared local image exists, the generation layer missed the default search/fallback gate — go search, use a matching user-provided asset, or record a valid generated fallback before writing the slide. If the user explicitly opted out of images, do not invent replacement imagery. State the `asset_fit_plan` entry for every image used on this slide: asset path, fit policy, expected box, crop box when present, and which protected regions remain visible.
|
||||
|
||||
## Incremental processing
|
||||
- Slides are written and displayed as soon as each one is complete.
|
||||
@@ -1385,7 +1413,7 @@ Use visual elements (shapes, lines, icons, accent bars, gradients) to break up t
|
||||
|
||||
<thinking_process_instructions>
|
||||
Before writing the SVG, use the `content_thinking` parameter to document:
|
||||
1. **Visual assets**: the slide_role, primary visual path when required, which images/charts you will use (list file paths and the asset_readiness entry), why the primary visual supports the key message, whether real-world subjects have web-search evidence, and whether text overlays require a mask/scrim. If none are available, the slide is missing preparation — go search/download user-approved visuals first, then use generated fallback only after the fallback is recorded.
|
||||
1. **Visual assets**: the slide_role, primary visual path when required, which images/charts you will use (list file paths and the asset_readiness entry), the asset_fit_plan entry for each image, why the primary visual supports the key message, whether real-world subjects have web-search evidence, and whether text overlays require a mask/scrim. If none are available, the slide is missing preparation — go search/download user-approved visuals first, then use generated fallback only after the fallback is recorded.
|
||||
2. **Layout**: what composition best fits this content, and how it differs from adjacent slides.
|
||||
3. **Key message**: the ONE takeaway, and how typography and spacing emphasize it.
|
||||
4. **Data visualization**: can any content be shown as a chart or large stat number instead of text?
|
||||
|
||||
@@ -16,127 +16,127 @@
|
||||
"id": "system_prompt_workflow",
|
||||
"lines": [
|
||||
3,
|
||||
221
|
||||
223
|
||||
],
|
||||
"target": "system-prompt.md"
|
||||
},
|
||||
{
|
||||
"id": "svg_reference",
|
||||
"lines": [
|
||||
223,
|
||||
929
|
||||
225,
|
||||
931
|
||||
],
|
||||
"target": "svg-reference.md"
|
||||
},
|
||||
{
|
||||
"id": "resolve_design_brief",
|
||||
"lines": [
|
||||
931,
|
||||
1144
|
||||
933,
|
||||
1174
|
||||
],
|
||||
"target": "resolve-design-brief/full.md"
|
||||
},
|
||||
{
|
||||
"id": "deck_design_reference_catalog",
|
||||
"lines": [
|
||||
1146,
|
||||
1298
|
||||
1176,
|
||||
1328
|
||||
],
|
||||
"target": "deck-design-reference-catalog.md"
|
||||
},
|
||||
{
|
||||
"id": "slide_outline_tool",
|
||||
"lines": [
|
||||
1300,
|
||||
1318
|
||||
1330,
|
||||
1348
|
||||
],
|
||||
"target": "tools/slide-outline.md"
|
||||
},
|
||||
{
|
||||
"id": "activate_slides_edit_tool",
|
||||
"lines": [
|
||||
1320,
|
||||
1326
|
||||
1350,
|
||||
1356
|
||||
],
|
||||
"target": "tools/activate-slides-edit.md"
|
||||
},
|
||||
{
|
||||
"id": "slides_edit_tool",
|
||||
"lines": [
|
||||
1328,
|
||||
1345
|
||||
1358,
|
||||
1375
|
||||
],
|
||||
"target": "tools/slides-edit.md"
|
||||
},
|
||||
{
|
||||
"id": "svg_document_rules",
|
||||
"lines": [
|
||||
1347,
|
||||
1351
|
||||
1377,
|
||||
1381
|
||||
],
|
||||
"target": "tools/slides-edit.md"
|
||||
},
|
||||
{
|
||||
"id": "image_usage",
|
||||
"lines": [
|
||||
1353,
|
||||
1355
|
||||
1383,
|
||||
1387
|
||||
],
|
||||
"target": "tools/slides-edit.md"
|
||||
},
|
||||
{
|
||||
"id": "incremental_processing",
|
||||
"lines": [
|
||||
1357,
|
||||
1395
|
||||
1389,
|
||||
1427
|
||||
],
|
||||
"target": "tools/slides-edit.md"
|
||||
},
|
||||
{
|
||||
"id": "finish_slides_edit_tool",
|
||||
"lines": [
|
||||
1397,
|
||||
1403
|
||||
1429,
|
||||
1435
|
||||
],
|
||||
"target": "tools/finish-slides-edit.md"
|
||||
},
|
||||
{
|
||||
"id": "slide_organize_tool",
|
||||
"lines": [
|
||||
1405,
|
||||
1411
|
||||
1437,
|
||||
1443
|
||||
],
|
||||
"target": "tools/slide-organize.md"
|
||||
},
|
||||
{
|
||||
"id": "compute_custom_shape_bbox_tool",
|
||||
"lines": [
|
||||
1413,
|
||||
1419
|
||||
1445,
|
||||
1451
|
||||
],
|
||||
"target": "tools/compute-custom-shape-bbox.md"
|
||||
},
|
||||
{
|
||||
"id": "generate_svg_chart_tool",
|
||||
"lines": [
|
||||
1421,
|
||||
2420
|
||||
1453,
|
||||
2450
|
||||
],
|
||||
"target": "generate-svg-chart/full.md"
|
||||
},
|
||||
{
|
||||
"id": "slides_convert_tool",
|
||||
"lines": [
|
||||
2422,
|
||||
2459
|
||||
2454,
|
||||
2491
|
||||
],
|
||||
"target": "tools/slides-convert.md"
|
||||
},
|
||||
{
|
||||
"id": "slides_parse_template_tool",
|
||||
"lines": [
|
||||
2461,
|
||||
2484
|
||||
2493,
|
||||
2516
|
||||
],
|
||||
"target": "tools/slides-parse-template.md"
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ Use it only after the SVG Slides local generation/validation layer has produced
|
||||
## What It Owns
|
||||
|
||||
- Read `svglide.manifest.v1`.
|
||||
- Validate `protocol == "svg-slides.v1"`, `publish_ready == true`, required bundle receipts, `receipts.validate_svg_deck.totalErrors == 0`, visual-system/color-rhythm zero-error reports, page order, page count, 960x540 size, local file paths, and `pages[].sha256`.
|
||||
- Validate `protocol == "svg-slides.v1"`, `publish_ready == true`, required bundle receipts, `receipts.validate_svg_deck.totalErrors == 0`, asset-fit/visual-system/color-rhythm zero-error reports, page order, page count, 960x540 size, local file paths, and `pages[].sha256`.
|
||||
- Verify each page is still raw SVG by re-reading the file, checking sha256, checking the XML root with an XML decoder, and rejecting Slides XML/SXSD/HTML/raster/data URL fallback.
|
||||
- Upload local SVG image resources and rewrite `<image href>` / `<image xlink:href>` values to Slides media `file_token`s before submitting each raw SVG page.
|
||||
- Create the presentation shell.
|
||||
@@ -80,6 +80,8 @@ Minimum shape:
|
||||
"validate_svg_deck": "receipts/validate_svg_deck.json",
|
||||
"prompt_read_trace": "receipts/prompt_read_trace.json",
|
||||
"asset_readiness": "receipts/asset_readiness.json",
|
||||
"asset_fit_plan": "receipts/asset_fit_plan.json",
|
||||
"asset_fit_report": "receipts/asset_fit_report.json",
|
||||
"typography_plan": "receipts/typography_plan.json",
|
||||
"visual_system": "receipts/visual_system.json",
|
||||
"visual_system_report": "receipts/visual_system_report.json",
|
||||
@@ -123,6 +125,8 @@ node skills/lark-slides/scripts/svg_slides_readback_gate.mjs <deck-dir> --presen
|
||||
|
||||
The gate must report `ok: true`. A successful `slide.create` transport receipt without this gate is not sufficient evidence that text and images survived parser conversion.
|
||||
|
||||
The online readback gate must compare uploaded `<img>` boxes against `receipts/asset_fit_plan.json`. Screenshot validation is stronger when available, but XML readback still blocks obvious online image box drift when screenshot scope is unavailable.
|
||||
|
||||
Expected output includes:
|
||||
|
||||
- `xml_presentation_id`
|
||||
@@ -144,6 +148,7 @@ Page-level repair context can be generated from these receipt families:
|
||||
- `frame_discipline`: text-adjacent frame misuse.
|
||||
- `readability_safety`: overlap, out-of-bounds, and missing text-over-image mask failures.
|
||||
- `asset_readiness_report`: only page-level asset execution failures, such as missing embedded primary visuals or missing mask shapes.
|
||||
- `asset_fit_report`: page-level information-image placement failures, such as information images cropped as cover, expected image box drift, or content coverage below threshold.
|
||||
- `typography_plan_report`: only page-level SVG font execution failures, such as a slide using a font stack outside the plan.
|
||||
- `visual_system_report`: only page-level SVG palette execution failures, such as one slide using a color outside the locked palette.
|
||||
|
||||
@@ -152,6 +157,8 @@ Deck-level failures still require chain-level correction and must not be convert
|
||||
- missing prompt reads
|
||||
- missing web-search evidence
|
||||
- missing prepared assets
|
||||
- invalid `asset_fit_plan` schema
|
||||
- missing local asset files
|
||||
- invalid deck visual identity
|
||||
- invalid typography plan fields
|
||||
- invalid visual_system palette/rhythm fields
|
||||
|
||||
@@ -15,10 +15,13 @@ Do not use maintainer prompt-source files as generation context. Runtime agents
|
||||
| Generate or revise charts | `generate-svg-chart/README.md` | matching files under `generate-svg-chart/snippets/` |
|
||||
| Continue or convert an existing deck | `tools/slides-convert.md` | `tools/slide-organize.md`, `tools/slides-edit.md` |
|
||||
| Prove asset search/readiness | `validation/asset-readiness.md` | `../../../scripts/svg_slides_asset_readiness.mjs`, `../../../scripts/svg_slides_visual_identity_check.mjs` |
|
||||
| Prove asset fit | `validation/asset-fit.md` | `../../../scripts/svg_slides_asset_fit.mjs` |
|
||||
| Prove typography planning | `validation/typography-plan.md` | `../../../scripts/svg_slides_typography_plan.mjs` |
|
||||
| Prove visual system and color rhythm | `validation/visual-system.md` | `../../../scripts/svg_slides_visual_system.mjs`, `../../../scripts/svg_slides_color_rhythm.mjs` |
|
||||
| Prove frame discipline | `validation/frame-discipline.md` | `../../../scripts/svg_slides_frame_discipline.mjs` |
|
||||
| Prove readability safety | `validation/README.md` | `../../../scripts/svg_slides_readability_safety.mjs` |
|
||||
| Prevent text clipping while authoring | `validation/browser-text-bounds.md` | `../../../scripts/svg_slides_browser_text_bounds.mjs` |
|
||||
| Prove user request coverage | `validation/prompt-coverage.md` | `../../../scripts/svg_slides_prompt_coverage.mjs` |
|
||||
| Prove prompt reads for a generated deck | `validation/prompt-read-trace.md` | `../../scripts/svg_slides_prompt_trace.mjs` |
|
||||
| Audit a delivered deck before answering the user | `validation/post-delivery-audit.md` | `validation/asset-readiness.md`, `../../../scripts/svg_slides_readback_gate.mjs` |
|
||||
|
||||
@@ -38,11 +41,23 @@ Every generated local bundle must include `receipts/asset_readiness.json` before
|
||||
|
||||
The receipt records the deck's visual identity fingerprint, default image-search policy, required visual subjects, prepared local assets, and per-slide layout families.
|
||||
|
||||
## Asset Fit Gate
|
||||
|
||||
Every generated local bundle must include `receipts/asset_fit_plan.json`, then pass `asset_fit_report` validation before `manifest.json` may set `publish_ready=true`.
|
||||
|
||||
The receipt records per-image fit policy, protected regions, intended slide box, and any explicit whitespace crop.
|
||||
|
||||
## Prompt Coverage Gate
|
||||
|
||||
Every generated local bundle must include `receipts/prompt_coverage.json`, then pass `prompt_coverage_report` validation before `manifest.json` may set `publish_ready=true`.
|
||||
|
||||
The receipt maps explicit user requirements to evidence slides, including page counts, required sections, pricing, guarantees, exclusions, requested language, and compliance rewrites.
|
||||
|
||||
## Typography Plan Gate
|
||||
|
||||
Every generated local bundle must include `receipts/typography_plan.json` before `manifest.json` may set `publish_ready=true`.
|
||||
|
||||
The receipt records the deck's selected font category, display/body/label stacks, requested fonts, fallback decisions, source, and rejected substitutions. Slide SVG text must use only those planned stacks.
|
||||
The receipt records the deck's selected language mode, font category, display/body/label role fonts, English role fonts when needed, requested fonts, fallback decisions, source, and rejected substitutions. Slide SVG text must use only those planned single-family role fonts.
|
||||
|
||||
## Visual System Gate
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
- Role: reference
|
||||
- Purpose: Narrative archetypes and depth rubric consumed by the design brief prompt.
|
||||
## Content
|
||||
|
||||
|
||||
# Deck design reference catalog
|
||||
|
||||
Use this as your reference library: SELECT the best-fit narrative archetype for the deck's scenario, then ADAPT to specifics, and set depth per the rubric. Do not invent from scratch when a fit exists.
|
||||
@@ -156,3 +154,5 @@ THREE QUICK DISAMBIGUATIONS (where decks wrongly converge to MID)
|
||||
==================================================
|
||||
1. Same metric, different altitude: a board QBR shows ONE variance walk + the ask (high altitude / low density); the operating MOR behind it shows every driver four ways (low altitude / high density). Don't ship the MOR to the board or the QBR to ops.
|
||||
2. Expert vs lay on the SAME topic (ai-hardtech-pitch vs ai-101): both about AI — one is eval tables + failure-mode rates for technical partners, the other bans benchmark charts entirely. Audience, not topic, sets altitude.
|
||||
3. Pitch is NOT low-detail everywhere: stage demo-day is C1 (one sentence/slide), but the Series B/C IC pre-read is A-altitude self-read (cohort triangles, Rule-of-40, 20-page-memo-equivalent density). Same category, opposite depth — delivery_mode + audience decide.
|
||||
```
|
||||
|
||||
@@ -11,10 +11,6 @@
|
||||
5. Matching snippet files by `chart_type`
|
||||
|
||||
## Content
|
||||
```text
|
||||
Compute the exact bounding box of one or more SVG custom-shape paths. You CANNOT eyeball a path's real size, so before writing any <path slide:role="shape" slide:shape-type="custom"> call this with each path's `d`. For each path it returns the true width/height, a normalized `d` (shifted to the (0,0) origin) and an (offsetX, offsetY). Author the element as: <path slide:shape-type="custom" d="<returned d>" slide:width="<width>" slide:height="<height>" transform="translate(<offsetX>,<offsetY>)" .../> — never set slide:width/slide:height to the slide/canvas size.
|
||||
```
|
||||
|
||||
## generate_svg_chart
|
||||
|
||||
生成一张 SVG chart 文件。下含①工具描述 ②入参 schema(含 chart_type 路由规则,选型方法论唯一真相源,见 chart service implementation)③chart 子 agent 契约模板(chart contract template) ④设计简报(\_envelope.md,始终注入) ⑤signature snippets(signature snippets,按 chart_type 动态选取)。
|
||||
@@ -1011,3 +1007,5 @@ Draw connectors **before** the bar rects (document order) so bars overlap them.
|
||||
the math behind your driver values is wrong — recheck before drawing. -->
|
||||
<line x1="200" y1="224" x2="240" y2="224"
|
||||
stroke="[context]" stroke-width="1" stroke-dasharray="2,2"/>
|
||||
```
|
||||
````
|
||||
|
||||
@@ -25,3 +25,4 @@ Draw connectors **before** the bar rects (document order) so bars overlap them.
|
||||
the math behind your driver values is wrong — recheck before drawing. -->
|
||||
<line x1="200" y1="224" x2="240" y2="224"
|
||||
stroke="[context]" stroke-width="1" stroke-dasharray="2,2"/>
|
||||
```
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
- Role: reference
|
||||
- Purpose: Describes generated chart outputs.
|
||||
## Content
|
||||
```text
|
||||
Compute the exact bounding box of one or more SVG custom-shape paths. You CANNOT eyeball a path's real size, so before writing any <path slide:role="shape" slide:shape-type="custom"> call this with each path's `d`. For each path it returns the true width/height, a normalized `d` (shifted to the (0,0) origin) and an (offsetX, offsetY). Author the element as: <path slide:shape-type="custom" d="<returned d>" slide:width="<width>" slide:height="<height>" transform="translate(<offsetX>,<offsetY>)" .../> — never set slide:width/slide:height to the slide/canvas size.
|
||||
```
|
||||
|
||||
## generate_svg_chart
|
||||
|
||||
生成一张 SVG chart 文件。下含①工具描述 ②入参 schema(含 chart_type 路由规则,选型方法论唯一真相源,见 chart service implementation)③chart 子 agent 契约模板(chart contract template) ④设计简报(\_envelope.md,始终注入) ⑤signature snippets(signature snippets,按 chart_type 动态选取)。
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
4. `../deck-design-reference-catalog.md`
|
||||
|
||||
## Content
|
||||
````
|
||||
|
||||
## resolve_design_brief
|
||||
|
||||
SVG 专属:锁定视觉前调用,产出 deck 级设计 brief。
|
||||
@@ -81,9 +79,17 @@ Deconstruct the chosen direction across the 7 dimensions below. Every dimension
|
||||
- **Subtitle / label font**: same
|
||||
- **Body font**: same
|
||||
- **Chinese font direction**: pick **concrete** font names from the taxonomy below (do NOT just write a loose category like "a hei-ti")
|
||||
- **Language mode**: set `language_mode` to `zh-only`, `en-only`, or `zh-en-mixed`; for `en-only` / `zh-en-mixed`, also choose concrete English role fonts (`english_display_font`, `english_body_font`, `english_label_font`)
|
||||
- **Hierarchy**: how many levels, and whether the size jumps are aggressive or gentle
|
||||
- **DON'T**: explicitly list font types that must not be used
|
||||
|
||||
Typography quality priority:
|
||||
- Choose fonts for theme fit and design quality first, then check parser/runtime availability.
|
||||
- Do not default display typography to generic-safe fonts such as 黑体, 宋体, Noto Sans SC, Arial, Helvetica, PingFang SC, or 微软雅黑 merely because they feel safer online.
|
||||
- Generic display fonts are valid only for minimal/report/technical-neutral decks, or when the chosen expressive font has explicit unavailable/readback evidence and a documented fallback.
|
||||
- Cultural, historical, memorial, red-theme, brand, entertainment, fashion, and high-impact decks need a display font with visible identity.
|
||||
- `parser-safe`, `stable`, `compatible`, or `readback-safe` alone is not a design reason.
|
||||
|
||||
Chinese font taxonomy (for zh / zh-en typography; serif display = 宋体家族 for premium/editorial). Keep these font names verbatim — they are the only ones the render engine supports:
|
||||
- tech: 寒蝉德黑体, 黑体 ; body 黑体
|
||||
- brand / business: 抖音美好体, 寒蝉云墨黑 ; body 黑体
|
||||
@@ -98,8 +104,28 @@ Chinese font taxonomy (for zh / zh-en typography; serif display = 宋体家族 f
|
||||
- gaming / esports: 标小智无界黑, 抖音美好体
|
||||
- feminine / fashion: 站酷小薇体, 寒蝉锦书宋 ; body 思源宋体
|
||||
- food / lifestyle: 寒蝉全圆体, 站酷庆科黄油体 ; body 资源圆体
|
||||
- finance / investment research: 寒蝉端黑宋, 思源宋体, 寒蝉德黑体 ; body 思源宋体 / 宋体
|
||||
- strategy / management / corporate review: 寒蝉德黑体, 寒蝉端黑宋 ; body 黑体 / 思源宋体
|
||||
- fundraising / pitch deck / business plan: 寒蝉端黑宋, 寒蝉德黑体, Playfair Display ; body 思源宋体 / 黑体
|
||||
- technology / engineering feasibility / industrial product: 寒蝉德黑体, 标小智无界黑, 黑体 ; body 黑体 / 思源宋体
|
||||
- data analysis / BI / operations report: 寒蝉德黑体, 黑体, DM Sans ; body 黑体
|
||||
- education / training / children courseware: 霞鹜975圆体, 寒蝉团圆体, 资源圆体 ; body 资源圆体 / 黑体
|
||||
- academic / thesis / research presentation: 寒蝉端黑宋, 思源宋体, Playfair Display ; body 思源宋体
|
||||
- policy / government / institution / state-owned enterprise: 寒蝉端黑宋, 思源宋体, 黑体 ; body 宋体 / 黑体
|
||||
- party-building / red theme / historical memorial: 寒蝉端黑宋, 寒蝉锦书宋, 思源宋体, 寒蝉德黑体 ; body 思源宋体 / 黑体
|
||||
- brand / marketing / ecommerce / product promotion: 抖音美好体, 寒蝉云墨黑, Montserrat ; body 黑体
|
||||
- real estate / urban planning / regional culture: 寒蝉锦书宋, 思源宋体, 站酷小薇体 ; body 思源宋体 / 黑体
|
||||
- culture / entertainment / film / music / game / comedy: 站酷小薇体, 寒蝉锦书宋, 抖音美好体, 标小智无界黑 ; body 思源宋体 / 黑体
|
||||
- health / wellness / kindergarten / self-introduction / lifestyle: 寒蝉全圆体, 寒蝉团圆体, 资源圆体, 霞鹜975圆体 ; body 资源圆体 / 黑体
|
||||
- template beautification / redesign / layout repair: preserve the supplied template's display identity when it is theme-fit; otherwise choose by the source topic above, never default to generic display merely because the task says "make it more professional"
|
||||
Pairing: sans title ↔ sans body / serif ↔ serif / rounded ↔ rounded. Never use calligraphy fonts (钟齐流江毛草) for body. Never stack two stylized fonts.
|
||||
|
||||
Language mode rule:
|
||||
- `zh-only`: define `display_font`, `body_font`, and `label_font`.
|
||||
- `en-only`: define `english_display_font`, `english_body_font`, and `english_label_font`; use English taxonomy fonts such as Playfair Display, DM Sans, Montserrat, EB Garamond, Lora, Inter, IBM Plex Sans, or Roboto Condensed.
|
||||
- `zh-en-mixed`: define both CJK and English role fonts. Use English role fonts for English titles, brand names, movie/game names, methods, formulas, acronyms, and other prominent Latin text.
|
||||
- Never encode bilingual fallback as a comma-separated font-family stack; each role is one concrete family.
|
||||
|
||||
#### Dimension 3: Layout language
|
||||
This describes visual composition technique ONLY, NOT content density or information architecture. The same layout language (e.g. "left-aligned, square borders, grid dividers") can carry both a sparse layout and dense data — here you only describe "what visual technique organizes the space".
|
||||
- **Alignment**: centered / left-aligned / asymmetric
|
||||
|
||||
@@ -54,9 +54,17 @@ Deconstruct the chosen direction across the 7 dimensions below. Every dimension
|
||||
- **Subtitle / label font**: same
|
||||
- **Body font**: same
|
||||
- **Chinese font direction**: pick **concrete** font names from the taxonomy below (do NOT just write a loose category like "a hei-ti")
|
||||
- **Language mode**: set `language_mode` to `zh-only`, `en-only`, or `zh-en-mixed`; for `en-only` / `zh-en-mixed`, also choose concrete English role fonts (`english_display_font`, `english_body_font`, `english_label_font`)
|
||||
- **Hierarchy**: how many levels, and whether the size jumps are aggressive or gentle
|
||||
- **DON'T**: explicitly list font types that must not be used
|
||||
|
||||
Typography quality priority:
|
||||
- Choose fonts for theme fit and design quality first, then check parser/runtime availability.
|
||||
- Do not default display typography to generic-safe fonts such as 黑体, 宋体, Noto Sans SC, Arial, Helvetica, PingFang SC, or 微软雅黑 merely because they feel safer online.
|
||||
- Generic display fonts are valid only for minimal/report/technical-neutral decks, or when the chosen expressive font has explicit unavailable/readback evidence and a documented fallback.
|
||||
- Cultural, historical, memorial, red-theme, brand, entertainment, fashion, and high-impact decks need a display font with visible identity.
|
||||
- `parser-safe`, `stable`, `compatible`, or `readback-safe` alone is not a design reason.
|
||||
|
||||
Chinese font taxonomy (for zh / zh-en typography; serif display = 宋体家族 for premium/editorial). Keep these font names verbatim — they are the only ones the render engine supports:
|
||||
- tech: 寒蝉德黑体, 黑体 ; body 黑体
|
||||
- brand / business: 抖音美好体, 寒蝉云墨黑 ; body 黑体
|
||||
@@ -71,8 +79,28 @@ Chinese font taxonomy (for zh / zh-en typography; serif display = 宋体家族 f
|
||||
- gaming / esports: 标小智无界黑, 抖音美好体
|
||||
- feminine / fashion: 站酷小薇体, 寒蝉锦书宋 ; body 思源宋体
|
||||
- food / lifestyle: 寒蝉全圆体, 站酷庆科黄油体 ; body 资源圆体
|
||||
- finance / investment research: 寒蝉端黑宋, 思源宋体, 寒蝉德黑体 ; body 思源宋体 / 宋体
|
||||
- strategy / management / corporate review: 寒蝉德黑体, 寒蝉端黑宋 ; body 黑体 / 思源宋体
|
||||
- fundraising / pitch deck / business plan: 寒蝉端黑宋, 寒蝉德黑体, Playfair Display ; body 思源宋体 / 黑体
|
||||
- technology / engineering feasibility / industrial product: 寒蝉德黑体, 标小智无界黑, 黑体 ; body 黑体 / 思源宋体
|
||||
- data analysis / BI / operations report: 寒蝉德黑体, 黑体, DM Sans ; body 黑体
|
||||
- education / training / children courseware: 霞鹜975圆体, 寒蝉团圆体, 资源圆体 ; body 资源圆体 / 黑体
|
||||
- academic / thesis / research presentation: 寒蝉端黑宋, 思源宋体, Playfair Display ; body 思源宋体
|
||||
- policy / government / institution / state-owned enterprise: 寒蝉端黑宋, 思源宋体, 黑体 ; body 宋体 / 黑体
|
||||
- party-building / red theme / historical memorial: 寒蝉端黑宋, 寒蝉锦书宋, 思源宋体, 寒蝉德黑体 ; body 思源宋体 / 黑体
|
||||
- brand / marketing / ecommerce / product promotion: 抖音美好体, 寒蝉云墨黑, Montserrat ; body 黑体
|
||||
- real estate / urban planning / regional culture: 寒蝉锦书宋, 思源宋体, 站酷小薇体 ; body 思源宋体 / 黑体
|
||||
- culture / entertainment / film / music / game / comedy: 站酷小薇体, 寒蝉锦书宋, 抖音美好体, 标小智无界黑 ; body 思源宋体 / 黑体
|
||||
- health / wellness / kindergarten / self-introduction / lifestyle: 寒蝉全圆体, 寒蝉团圆体, 资源圆体, 霞鹜975圆体 ; body 资源圆体 / 黑体
|
||||
- template beautification / redesign / layout repair: preserve the supplied template's display identity when it is theme-fit; otherwise choose by the source topic above, never default to generic display merely because the task says "make it more professional"
|
||||
Pairing: sans title ↔ sans body / serif ↔ serif / rounded ↔ rounded. Never use calligraphy fonts (钟齐流江毛草) for body. Never stack two stylized fonts.
|
||||
|
||||
Language mode rule:
|
||||
- `zh-only`: define `display_font`, `body_font`, and `label_font`.
|
||||
- `en-only`: define `english_display_font`, `english_body_font`, and `english_label_font`; use English taxonomy fonts such as Playfair Display, DM Sans, Montserrat, EB Garamond, Lora, Inter, IBM Plex Sans, or Roboto Condensed.
|
||||
- `zh-en-mixed`: define both CJK and English role fonts. Use English role fonts for English titles, brand names, movie/game names, methods, formulas, acronyms, and other prominent Latin text.
|
||||
- Never encode bilingual fallback as a comma-separated font-family stack; each role is one concrete family.
|
||||
|
||||
#### Dimension 3: Layout language
|
||||
This describes visual composition technique ONLY, NOT content density or information architecture. The same layout language (e.g. "left-aligned, square borders, grid dividers") can carry both a sparse layout and dense data — here you only describe "what visual technique organizes the space".
|
||||
- **Alignment**: centered / left-aligned / asymmetric
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
- Role: tool_contract
|
||||
- Purpose: Defines the design brief tool timing, outputs, and required inputs.
|
||||
## Content
|
||||
````
|
||||
|
||||
## resolve_design_brief
|
||||
|
||||
SVG 专属:锁定视觉前调用,产出 deck 级设计 brief。
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
- Role: reference
|
||||
- Purpose: Protocol schema and design rules for SVG Slides documents.
|
||||
## Content
|
||||
````
|
||||
|
||||
# SVG reference(协议 schema + 设计规范 / svg_reference)
|
||||
|
||||
````text
|
||||
@@ -16,18 +14,11 @@ Beyond schema-correctness, the bar for SVG-protocol slides is visual EXCELLENCE:
|
||||
|
||||
### Parser-safe canonical font rule
|
||||
For PPE online SVG Slides creation, every visible text element must use exactly one concrete `font-family` value. Do not write comma-separated CSS fallback stacks.
|
||||
|
||||
Correct:
|
||||
- `font-family:Playfair Display`
|
||||
- `font-family:Noto Sans SC`
|
||||
- `font-family:Songti SC`
|
||||
|
||||
Wrong:
|
||||
- `font-family:Playfair Display, 寒蝉锦书宋, serif`
|
||||
- `font-family:DM Sans, 黑体, sans-serif`
|
||||
- `font-family:var(--font-body)`
|
||||
- `font-family:sans-serif`
|
||||
|
||||
- `font-family:Playfair Display, 寒蝉锦书宋, serif`; `font-family:DM Sans, 黑体, sans-serif`; `font-family:var(--font-body)`; `font-family:sans-serif`
|
||||
Use role-level variety by assigning different single families to roles, for example `display=Playfair Display`, `body=Noto Sans SC`, `label=Noto Sans SC`. Do not encode fallback behavior in the SVG; the online parser treats `font-family` as a concrete slide record value, not as browser CSS fallback logic.
|
||||
|
||||
### English fonts
|
||||
@@ -228,7 +219,7 @@ B. Shape WITH text (colored/rounded/bordered box that also holds text): `<g slid
|
||||
- `padding:8px` (1/2/4 values) or `padding-top:` / `padding-right:` / `padding-bottom:` / `padding-left:` — defaults: 0 on shape-type="text", 5px elsewhere
|
||||
- DO NOT write any text visual property as a bare attribute (no `fontSize="20"`, no `color="..."`, no `bold="true"`). All text visual properties go into `style="..."`.
|
||||
- Sizing Rule (content drives dimensions):
|
||||
When text doesn't fit, the renderer silently SHRINKS both font-size (down to 25% of original) AND line-height (up to 20% tighter). Fix content first, then size the box.
|
||||
Before writing each slide, estimate text box height from font-size, line-height, paragraph count, and CJK line wrapping; give every `foreignObject` at least 15% vertical slack. When text doesn't fit, the renderer silently SHRINKS both font-size (down to 25% of original) AND line-height (up to 20% tighter). Fix content first, shorten or split copy, then size the box.
|
||||
Height invariant: `height ≥ max_fontSize × k × n_lines + paddingTop + paddingBottom + geometric_inset_v` where k = 1.5 for default `line-height:1.5`.
|
||||
Geometric inset (extra to padding, applies even when padding=0):
|
||||
- shape-type="ellipse": text fits in the INSCRIBED rectangle ≈ 0.7×w × 0.7×h
|
||||
@@ -717,3 +708,5 @@ Slide with animation (private `<slide:animations>` + one `<slide:transition>` as
|
||||
</svg>
|
||||
```
|
||||
</canonical_examples>
|
||||
</svg_reference>
|
||||
````
|
||||
|
||||
@@ -94,15 +94,15 @@ The design brief's `visual_system` is AUTHORITATIVE for the look — do NOT over
|
||||
- `aesthetic_direction`: the visual_system's design language + mood, verbatim in spirit.
|
||||
- `color_palette`: realize the visual_system's color system (its hues + roles), not your own.
|
||||
- `visual_system_receipt`: write `receipts/visual_system.json` with `version: "svg-slides.visual-system.v1"`, `palette_tokens`, and `color_rhythm` before any slide is authored. `palette_tokens` must define `bg.base`, `bg.deep`, `panel.light`, `panel.dark`, `text.primary`, and at least one `accent.*`, all as `rgb(...)` or `rgba(...)`. `color_rhythm.slide_themes` must list every slide file with `role`, `theme` (`light`, `dark`, or `image`), and `reason`; set a small `full_dark_budget`, explicit `allowed_full_dark_roles`, `default_content_theme`, `closing_theme`, `max_adjacent_luma_delta`, and `max_transition_ratio`. Do not alternate full-page dark/light backgrounds on adjacent pages unless a named `allowed_hard_transitions` chapter break justifies it.
|
||||
- `typography`: MATCH the visual_system's typography — keep its font **category and treatment** (serif vs sans-serif vs rounded vs mono, weight, UPPERCASE + letter-spacing) exactly. Explicit user-requested fonts outrank inferred visual_system fonts: preserve each requested font by name in the matching stack, or record why it is unavailable before choosing a fallback. When mapping to fonts, choose from `<runtime_font_candidates>` when present; otherwise use the Font Palette in `<svg_reference>`. Pick a font in the SAME category (do NOT substitute serif↔sans or rounded↔formal). Write `receipts/typography_plan.json` with `version`, `font_category`, `display_font`, `body_font`, `label_font`, `source`, `selection_reason`, `forbidden_substitutions`, `runtime_candidates_used`, `requested_fonts`, `resolved_fonts`, `fallbacks`, `unavailable_fonts`, and `user_requested_font_preserved`; never re-pick fonts from your own editorial intuition or banned generic fonts.
|
||||
- Requested font preservation is strict. Do not silently replace a requested CJK font such as `汉仪楷体简`, `思源宋体`, or `微软雅黑` with `STKaiti`, `KaiTi`, `PingFang SC`, `Noto Sans SC`, `黑体`, or any other nearby-looking fallback. If the SVG font stack must remain Latin-first, keep the requested CJK font in the CJK position, e.g. `Bodoni MT, 汉仪楷体简, serif`. If a requested font is unavailable, put it in `unavailable_fonts` and add a concrete `fallbacks[]` entry naming the requested font, fallback stack, and reason.
|
||||
- `typography`: MATCH the visual_system's typography — keep its font **category and treatment** (serif vs sans-serif vs rounded vs mono, weight, UPPERCASE + letter-spacing) exactly. Explicit user-requested fonts outrank inferred visual_system fonts: preserve each requested font by name in the matching single-family role, or record why it is unavailable before choosing a fallback. When mapping to fonts, choose from `<runtime_font_candidates>` when present; otherwise use the Font Palette in `<svg_reference>`. Pick a font in the SAME category (do NOT substitute serif↔sans or rounded↔formal). Write `receipts/typography_plan.json` with `version`, `language_mode`, `font_category`, `display_font`, `body_font`, `label_font`, optional `english_display_font` / `english_body_font` / `english_label_font` for `en-only` or `zh-en-mixed` decks, `source`, `selection_reason`, `forbidden_substitutions`, `runtime_candidates_used`, `requested_fonts`, `resolved_fonts`, `fallbacks`, `fallback_reason`, `unavailable_fonts`, and `user_requested_font_preserved`; never re-pick fonts from your own editorial intuition or banned generic fonts. Typography quality is owned by `visual_system.typography` and the typography plan gate. Do not proactively downgrade expressive theme-fit display fonts to generic parser-safe fonts; fallback is allowed only after explicit availability or readback evidence is recorded.
|
||||
- Requested font preservation is strict. Do not silently replace a requested CJK font such as `汉仪楷体简`, `思源宋体`, or `微软雅黑` with `STKaiti`, `KaiTi`, `PingFang SC`, `Noto Sans SC`, `黑体`, or any other nearby-looking fallback. If a requested font cannot be used as one concrete SVG `font-family`, put it in `unavailable_fonts` and add a concrete `fallbacks[]` entry naming the requested font, fallback family, and reason.
|
||||
This becomes the deck's locked style — carry its `aesthetic_direction`, `color_palette`, `visual_system_receipt`, `typography`, and `typography_plan` consistently across EVERY slide.
|
||||
Then plan visuals per slide — images AND charts together: how many images each needs, what aspect ratio, which visual subjects require web image search, and which pages are cover / section-divider / closing / key-showcase. Image search is required by default for every deck topic and every slide visual subject unless the user explicitly says not to use images. Specific real-world entities — people, companies, products, places, venues, artworks, papers, named events, screenshots, or UI/product surfaces — MUST use web image search and be recorded before any generated fallback is considered. Write `receipts/asset_readiness.json` with `image_search_policy`, a deck-level `visual_identity_fingerprint`, `required_visual_subjects`, legacy `required_search_entities` when named entities are present, prepared local assets, asset `purpose` / `asset_kind` / `expressive_role` / `content_relevance` / `format`, search query / source URL or fallback reason, and per-slide `slide_role` / `visual_tier` / `primary_visual_required` / `primary_visual` / `layout_family` / `text_overlay` / `mask_required` / `mask_strategy` before slide_edit; in multi-deck/team runs, compare sibling fingerprints and do not reuse the same style family + composition signature. Once {{.ToolSlideOutline}} has created the project, call {{.ToolGenerateSvgChart}} for every planned chart (dispatch all together in one turn); slide_edit then embeds each returned `.svg` by `<rect slide:role="chart" href="...">`. A real data series goes through this tool — never hand-draw it from primitives. (See <visuals> and <chart_workflow>.)
|
||||
Then plan visuals per slide — images AND charts together: how many images each needs, what aspect ratio, which visual subjects require web image search, and which pages are cover / section-divider / closing / key-showcase. First extract every user-visible requirement with numbers, page counts, named sections, pricing, guarantees, exclusions, requested language, and explicit structure; write `receipts/prompt_coverage.json` with a non-empty `source_requirements[]`, `source_requirements_sha256`, and one `requirements[]` entry per source requirement, and if a claim is rewritten for factual or compliance reasons mark it `rewritten_with_reason` with evidence instead of silently omitting it. Image search is required by default for every deck topic and every slide visual subject unless the user explicitly says not to use images. Specific real-world entities — people, companies, products, places, venues, artworks, papers, named events, screenshots, or UI/product surfaces — MUST use web image search and be recorded before any generated fallback is considered. Write `receipts/asset_readiness.json` with `image_search_policy`, a deck-level `visual_identity_fingerprint`, `required_visual_subjects`, legacy `required_search_entities` when named entities are present, prepared local assets, asset `purpose` / `asset_kind` / `expressive_role` / `content_relevance` / `format`, search query / source URL or fallback reason, and per-slide `slide_role` / `visual_tier` / `primary_visual_required` / `primary_visual` / `primary_visual_treatment` / `primary_visual_area_ratio` / `overlay_theme_color` / `overlay_opacity` / `layout_family` / `text_overlay` / `mask_required` / `mask_strategy` before slide_edit; also write `receipts/asset_fit_plan.json` before slide_edit, classifying every image's `asset_kind`, `fit_policy`, `protected_regions`, intended `expected_box`, and any `crop_whitespace` box, with information-bearing assets defaulting to `contain_no_crop`. In multi-deck/team runs, compare sibling fingerprints and do not reuse the same style family + composition signature. Once {{.ToolSlideOutline}} has created the project, call {{.ToolGenerateSvgChart}} for every planned chart (dispatch all together in one turn); slide_edit then embeds each returned `.svg` by `<rect slide:role="chart" href="...">`. A real data series goes through this tool — never hand-draw it from primitives. (See <visuals> and <chart_workflow>.)
|
||||
|
||||
### Phase 8 — Generate & deliver
|
||||
1. **{{.ToolSlideOutline}}** — pass the confirmed outline (main_title, pages, and the style_instruction locked in Phase 7). Creates the project directory, `outline.json`, style, and one empty `.svg` per slide. The language of your arguments sets the slide language. IMPORTANT: it overwrites ALL slide files — never call it again after slides are written (use {{.ToolSlideOrganize}} to add/delete pages later).
|
||||
2. **{{.ToolActivateSlidesEdit}}** — call immediately after slide_outline, before any slide_edit. Pass `project_dir`. This switches to a faster model optimized for slide writing.
|
||||
3. **{{.ToolSlideEdit}}** — write each slide as a COMPLETE SVG document following `<svg_reference>` only after the slide's searched, user-provided, or valid fallback local assets exist and are recorded in `asset_readiness.json`, the locked palette/rhythm is recorded in `visual_system.json`, and the locked font stacks are recorded in `typography_plan.json`. In `content_thinking`, state `slide_role`, key message, primary visual path, why the visual supports the message, text-overlay / mask strategy, layout intent, visual assets, palette tokens used, planned background theme, typography role, and the animation decision for this slide (its build order, or `static`) per `<animation>`. Compose freely (no canned templates). Slides display incrementally as each completes. Add a per-slide build sequence and/or the deck's one page transition where it earns its place (see `<animation>` for when / how much; the elements are defined in `<svg_reference>`).
|
||||
3. **{{.ToolSlideEdit}}** — write each slide as a COMPLETE SVG document following `<svg_reference>` only after the slide's searched, user-provided, or valid fallback local assets exist and are recorded in `asset_readiness.json`, image fit is planned in `asset_fit_plan.json`, the locked palette/rhythm is recorded in `visual_system.json`, and the locked concrete font families are recorded in `typography_plan.json`. Treat `validation/browser-text-bounds.md` as a generation-time prevention contract while authoring this SVG: size every text box so the written text fits before bundling, rather than relying on the bundle validator to catch clipping after the fact. In `content_thinking`, state `slide_role`, key message, primary visual path, why the visual supports the message, text-overlay / mask strategy, asset fit policy and expected box, layout intent, visual assets, palette tokens used, planned background theme, typography role, and the animation decision for this slide (its build order, or `static`) per `<animation>`. Compose freely (no canned templates). Slides display incrementally as each completes. Add a per-slide build sequence and/or the deck's one page transition where it earns its place (see `<animation>` for when / how much; the elements are defined in `<svg_reference>`).
|
||||
4. **{{.ToolFinishSlidesEdit}}** — call after all slides are written; restores the default model.
|
||||
5. **Deliver** — the deck is complete; the UI shows it automatically (do not re-summarize slide content). Before final handover, and before any later answer judging whether the deck satisfies the prompt, follow `validation/post-delivery-audit.md`: report user prompt fit, system prompt fit, online delivery fit when applicable, and quality gaps separately. Share the `slide_content.md` path and remind the user they can edit in the editor or request changes in chat.
|
||||
|
||||
@@ -130,7 +130,7 @@ Visuals re-engage attention and carry meaning. Plan them deliberately; don't dec
|
||||
2. **Search by default** ({{.ToolAssignImageSearchAgent}}) — REQUIRED for every deck topic and visual subject unless the user explicitly says not to use images. Real-world entities (people, companies, products, places, venues, artworks, papers, named events, screenshots, UI/product surfaces) MUST use web image search. Do not search for logos. Record `image_search_policy: "required_by_default"`, each `required_visual_subjects[]`, the query, status, and source URL / failure reason in `asset_readiness.json`.
|
||||
3. **Generation fallback only** — use generated/SVG imagery only when web image search is unavailable or search fails and no user-provided asset covers the subject. Record `image_search_policy: "fallback_no_network"` or `"fallback_search_failed"` and a concrete `fallback_reason` on both the subject and generated asset. If the user explicitly says not to use images, set `image_search_policy: "user_opted_out"` and do not generate replacement imagery.
|
||||
4. **Search + generation refinement** — when search has the right subject but wrong ratio/tone, use it as an image-to-image reference and record both the search evidence and the generated fallback reason.
|
||||
- NEVER crop to force a ratio — generate at the exact ratio. Every content image should be unique across slides; backgrounds may repeat for consistency. Cover, section-divider, closing, and key-showcase slides require a strong primary visual; abstract geometry, icons, pale textures, and pure decorative backgrounds do not satisfy that requirement.
|
||||
- NEVER crop to force a ratio — generate at the exact ratio. Non-opt-out decks must be truly image-backed: at least 70% of slides need a ready image asset, 6+ page decks need unique ready images for at least half the slide count, and one image may not appear on more than two slides unless `intentional_reuse_reason` records the deliberate callback. Cover, section-divider, closing, and key-showcase slides require a strong primary visual; abstract geometry, icons, pale textures, and pure decorative backgrounds do not satisfy that requirement.
|
||||
- **Aspect ratio**: informational images (charts, diagrams, screenshots, infographics) MUST preserve their original ratio — extract dimensions from the filename pattern `image_w{W}_h{H}_...` and size the SVG `<image>` to match. Decorative photos may be composed freely.
|
||||
- **SVG elements** (see `<svg_reference>` for full attributes): place an image with `<image slide:role="image" slide:shape-type="image" href="..." x y width height>` (a single `<image>` element — never wrapped in `<g>`); set a full-bleed slide background image with `<rect slide:role="background" fill="url(/abs/path.jpg)">`.
|
||||
|
||||
@@ -146,7 +146,7 @@ If an overlap is intentional, annotate it with `data-svglide-allow-overlap="true
|
||||
|
||||
Scrims and masks must remain parser-legible shapes: use `slide:role="shape" slide:shape-type="rect" data-svglide-layer="mask"`, not a new `slide:role` value.
|
||||
|
||||
- **Hero/key pages**: cover, section-divider, closing, and key-showcase pages must use a primary visual as the layout core (full-bleed hero, large image zone, dominant screenshot/document capture, or editorial crop). Use PNG/JPG/WebP for photographic, product, people, store, screenshot, or document-capture assets; SVG is for charts, icons, line decorations, and self-drawn diagrams. If text sits on a hero image, add a parser-legible mask shape, gradient mask, or safe text zone so the image has impact and the text remains readable.
|
||||
- **Hero/key pages**: cover, section-divider, closing, and key-showcase pages default to a full-bleed or large-area real image with a topic-color translucent overlay and concise text; record `primary_visual_treatment`, `primary_visual_area_ratio` (>=0.65), `overlay_theme_color`, and `overlay_opacity` in `asset_readiness.json`. Allowed treatments are full-bleed hero, large image zone, dominant screenshot/document capture, or editorial crop. Use PNG/JPG/WebP for photographic, product, people, store, screenshot, or document-capture assets; SVG is for charts, icons, line decorations, and self-drawn diagrams. If text sits on a hero image, add a parser-legible mask shape, gradient mask, or safe text zone so the image has impact and the text remains readable.
|
||||
</visuals>
|
||||
|
||||
<about_slides_outline>
|
||||
@@ -222,3 +222,5 @@ When slide tools fail: retry once. If the retry also fails, consider the task fa
|
||||
- Never expose raw internal terms (internal color names, slide-type identifiers, parameter names). Translate to user-friendly language (e.g., "section-divider" → "section transition slide"); use real font names as-is.
|
||||
- For text-overflow complaints: apologize, note the slide editor is still evolving, and tell the user they can drag the text boxes in the editor.
|
||||
</user_communication_guidelines>
|
||||
</about_slides>
|
||||
````
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
- Role: tool_contract
|
||||
- Purpose: Switches into the fast slide-writing mode after outline creation.
|
||||
## Content
|
||||
```
|
||||
|
||||
## activate_slides_edit
|
||||
|
||||
进入快速写图模型。工具描述
|
||||
|
||||
```text
|
||||
Activate slide edit mode. Call this AFTER slide_outline and BEFORE slide_edit. This switches to a faster model optimized for writing slides. Pass project_dir.
|
||||
```
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
- Role: tool_contract
|
||||
- Purpose: Computes custom SVG path bounds before authoring custom shapes.
|
||||
## Content
|
||||
```text
|
||||
Add or delete slide pages in an existing presentation project. Use this instead of calling slide_outline again when you need to modify the page structure after the initial outline is created. Operations are executed in order.
|
||||
```
|
||||
|
||||
## compute_custom_shape_bbox
|
||||
|
||||
SVG 专属:算 custom path 真实包围盒。工具描述
|
||||
|
||||
```text
|
||||
Compute the exact bounding box of one or more SVG custom-shape paths. You CANNOT eyeball a path's real size, so before writing any <path slide:role="shape" slide:shape-type="custom"> call this with each path's `d`. For each path it returns the true width/height, a normalized `d` (shifted to the (0,0) origin) and an (offsetX, offsetY). Author the element as: <path slide:shape-type="custom" d="<returned d>" slide:width="<width>" slide:height="<height>" transform="translate(<offsetX>,<offsetY>)" .../> — never set slide:width/slide:height to the slide/canvas size.
|
||||
```
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
- Role: tool_contract
|
||||
- Purpose: Leaves edit mode and checks for placeholder slides.
|
||||
## Content
|
||||
- Stay consistent with the style_instruction provided in slide_outline.
|
||||
</quality_standards>
|
||||
```
|
||||
|
||||
## finish_slides_edit
|
||||
|
||||
退出编辑模式并校验无占位页。工具描述
|
||||
|
||||
```text
|
||||
Finish slide edit mode. Call this AFTER all slide_edit calls are completed. This restores the original model. The tool will verify that all slides have been edited — if any placeholder slides remain, the call will fail and you must edit them first.
|
||||
```
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
- Role: tool_contract
|
||||
- Purpose: Adds or deletes pages after outline creation.
|
||||
## Content
|
||||
```text
|
||||
Finish slide edit mode. Call this AFTER all slide_edit calls are completed. This restores the original model. The tool will verify that all slides have been edited — if any placeholder slides remain, the call will fail and you must edit them first.
|
||||
```
|
||||
|
||||
## slide_organize
|
||||
|
||||
大纲创建后增删页。工具描述
|
||||
|
||||
```text
|
||||
Add or delete slide pages in an existing presentation project. Use this instead of calling slide_outline again when you need to modify the page structure after the initial outline is created. Operations are executed in order.
|
||||
```
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
- Role: tool_contract
|
||||
- Purpose: Creates project structure, outline metadata, style settings, and empty slide files.
|
||||
## Content
|
||||
```
|
||||
|
||||
## slide_outline
|
||||
|
||||
创建大纲 / 项目结构。
|
||||
@@ -22,3 +20,5 @@ Create the project structure with outline metadata, style settings, and empty sl
|
||||
|
||||
<recommended_usage>
|
||||
- Use to define the presentation structure and style before writing individual slides
|
||||
</recommended_usage>
|
||||
```
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
- Role: tool_contract
|
||||
- Purpose: Converts uploaded PPTX files into editable slides format.
|
||||
## Content
|
||||
````
|
||||
|
||||
## slides_convert
|
||||
|
||||
把上传 PPTX 导入成可编辑 deck(两协议共用;SVG 下产出 .svg)。
|
||||
@@ -39,3 +37,7 @@ OUTPUT:
|
||||
- directory: directory containing individual slide XML files
|
||||
|
||||
IMPORTANT:
|
||||
- After conversion, use slides_update tool with the slides_path to modify the presentation
|
||||
- The original PPTX content is preserved exactly in the converted .slides file
|
||||
- If user wants to use PPTX as a STYLE REFERENCE for new slides, use slides_parse_template instead
|
||||
```
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
- Role: tool_contract
|
||||
- Purpose: Writes SVG page documents and carries slide-edit hard gates.
|
||||
## Content
|
||||
```
|
||||
|
||||
## slides_edit
|
||||
|
||||
写单页 SVG 文档。
|
||||
@@ -21,19 +19,19 @@ Each slide will be projected in front of an audience. Before writing, ask:
|
||||
- If there's a concept, is there an image or just words on a background?
|
||||
|
||||
A text-only slide with decorative shapes signals skipped preparation. It is rarely the right solution.
|
||||
</slide_quality_mindset>
|
||||
|
||||
<core_technical_requirements>
|
||||
## SVG document
|
||||
- Each slide item's `svg_code` parameter MUST contain a single `<svg slide:role="slide" ...>` element as the root — a standard SVG document carrying private `slide:*` attributes. See `<svg_reference>` for the full element/attribute schema.
|
||||
- This is SVG, NOT HTML and NOT any XML DSL. Use only the elements and attributes documented in `<svg_reference>`.
|
||||
|
||||
- DO NOT wrap with `<presentation>` — each item edits one slide at a time.
|
||||
- The slide's `id` should match the filename (e.g., `slide_01_cover.svg` uses `id="cover"`).
|
||||
|
||||
## Image usage
|
||||
|
||||
- NEVER reference a non-existent or non-local image. Always use absolute paths for images, fonts, and other resources.
|
||||
- Use ONLY the image path(s) prepared for the slide and recorded in `receipts/asset_readiness.json` (to avoid duplicates), including any declared `primary_visual`. Place content images with concrete subjects (photos, products, people, stores, screenshots, document captures, UI mockups, illustrations) as `<image slide:role="image" slide:shape-type="image">`; small photographic assets should be PNG/JPG/WebP. SVG is for charts, icons, line decorations, and self-drawn diagrams, not a substitute for searched bitmap imagery.
|
||||
- If the slide's visual subject is a real-world entity (person, company, product, place, venue, artwork, paper, named event, screenshot, or UI/product surface), `asset_readiness.json` must include web-search evidence for that subject before this slide is written. A generated asset may only appear as a recorded fallback after unavailable or failed search.
|
||||
- If no prepared local image exists, the generation layer missed the default search/fallback gate — go search, use a matching user-provided asset, or record a valid generated fallback before writing the slide. If the user explicitly opted out of images, do not invent replacement imagery.
|
||||
- If no prepared local image exists, the generation layer missed the default search/fallback gate — go search, use a matching user-provided asset, or record a valid generated fallback before writing the slide. If the user explicitly opted out of images, do not invent replacement imagery. State the `asset_fit_plan` entry for every image used on this slide: asset path, fit policy, expected box, crop box when present, and which protected regions remain visible.
|
||||
|
||||
## Incremental processing
|
||||
- Slides are written and displayed as soon as each one is complete.
|
||||
@@ -62,7 +60,7 @@ Use visual elements (shapes, lines, icons, accent bars, gradients) to break up t
|
||||
|
||||
<thinking_process_instructions>
|
||||
Before writing the SVG, use the `content_thinking` parameter to document:
|
||||
1. **Visual assets**: the slide_role, primary visual path when required, which images/charts you will use (list file paths and the asset_readiness entry), why the primary visual supports the key message, whether real-world subjects have web-search evidence, and whether text overlays require a mask/scrim. If none are available, the slide is missing preparation — go search/download user-approved visuals first, then use generated fallback only after the fallback is recorded.
|
||||
1. **Visual assets**: the slide_role, primary visual path when required, which images/charts you will use (list file paths and the asset_readiness entry), the asset_fit_plan entry for each image, why the primary visual supports the key message, whether real-world subjects have web-search evidence, and whether text overlays require a mask/scrim. If none are available, the slide is missing preparation — go search/download user-approved visuals first, then use generated fallback only after the fallback is recorded.
|
||||
2. **Layout**: what composition best fits this content, and how it differs from adjacent slides.
|
||||
3. **Key message**: the ONE takeaway, and how typography and spacing emphasize it.
|
||||
4. **Data visualization**: can any content be shown as a chart or large stat number instead of text?
|
||||
@@ -70,3 +68,7 @@ Before writing the SVG, use the `content_thinking` parameter to document:
|
||||
</thinking_process_instructions>
|
||||
|
||||
<quality_standards>
|
||||
- All content must be verifiable — never use fabricated data or present subjective assessments as fact.
|
||||
- Stay consistent with the style_instruction provided in slide_outline.
|
||||
</quality_standards>
|
||||
```
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
- Role: tool_contract
|
||||
- Purpose: Parses and preprocesses XML templates for template-based generation.
|
||||
## Content
|
||||
- The original PPTX content is preserved exactly in the converted .slides file
|
||||
- If user wants to use PPTX as a STYLE REFERENCE for new slides, use slides_parse_template instead
|
||||
```
|
||||
|
||||
## slides_parse_template
|
||||
|
||||
解析模板元数据。
|
||||
@@ -27,3 +23,7 @@ INPUT:
|
||||
- file_path: path to the XML template file (must be .xml, typically the xml_path returned by slides_convert)
|
||||
|
||||
OUTPUT:
|
||||
- tmpl_path: absolute path to processed template XML '{folder}/tmpl.xml'
|
||||
|
||||
After parsing, read tmpl.xml to understand the template's layout patterns, then replicate those layouts when writing SML with slide_edit.
|
||||
```
|
||||
|
||||
@@ -186,10 +186,13 @@ function writeRootReadme() {
|
||||
"| Generate or revise charts | `generate-svg-chart/README.md` | matching files under `generate-svg-chart/snippets/` |",
|
||||
"| Continue or convert an existing deck | `tools/slides-convert.md` | `tools/slide-organize.md`, `tools/slides-edit.md` |",
|
||||
"| Prove asset search/readiness | `validation/asset-readiness.md` | `../../../scripts/svg_slides_asset_readiness.mjs`, `../../../scripts/svg_slides_visual_identity_check.mjs` |",
|
||||
"| Prove asset fit | `validation/asset-fit.md` | `../../../scripts/svg_slides_asset_fit.mjs` |",
|
||||
"| Prove typography planning | `validation/typography-plan.md` | `../../../scripts/svg_slides_typography_plan.mjs` |",
|
||||
"| Prove visual system and color rhythm | `validation/visual-system.md` | `../../../scripts/svg_slides_visual_system.mjs`, `../../../scripts/svg_slides_color_rhythm.mjs` |",
|
||||
"| Prove frame discipline | `validation/frame-discipline.md` | `../../../scripts/svg_slides_frame_discipline.mjs` |",
|
||||
"| Prove readability safety | `validation/README.md` | `../../../scripts/svg_slides_readability_safety.mjs` |",
|
||||
"| Prevent text clipping while authoring | `validation/browser-text-bounds.md` | `../../../scripts/svg_slides_browser_text_bounds.mjs` |",
|
||||
"| Prove user request coverage | `validation/prompt-coverage.md` | `../../../scripts/svg_slides_prompt_coverage.mjs` |",
|
||||
"| Prove prompt reads for a generated deck | `validation/prompt-read-trace.md` | `../../scripts/svg_slides_prompt_trace.mjs` |",
|
||||
"| Audit a delivered deck before answering the user | `validation/post-delivery-audit.md` | `validation/asset-readiness.md`, `../../../scripts/svg_slides_readback_gate.mjs` |",
|
||||
"",
|
||||
@@ -209,11 +212,23 @@ function writeRootReadme() {
|
||||
"",
|
||||
"The receipt records the deck's visual identity fingerprint, default image-search policy, required visual subjects, prepared local assets, and per-slide layout families.",
|
||||
"",
|
||||
"## Asset Fit Gate",
|
||||
"",
|
||||
"Every generated local bundle must include `receipts/asset_fit_plan.json`, then pass `asset_fit_report` validation before `manifest.json` may set `publish_ready=true`.",
|
||||
"",
|
||||
"The receipt records per-image fit policy, protected regions, intended slide box, and any explicit whitespace crop.",
|
||||
"",
|
||||
"## Prompt Coverage Gate",
|
||||
"",
|
||||
"Every generated local bundle must include `receipts/prompt_coverage.json`, then pass `prompt_coverage_report` validation before `manifest.json` may set `publish_ready=true`.",
|
||||
"",
|
||||
"The receipt maps explicit user requirements to evidence slides, including page counts, required sections, pricing, guarantees, exclusions, requested language, and compliance rewrites.",
|
||||
"",
|
||||
"## Typography Plan Gate",
|
||||
"",
|
||||
"Every generated local bundle must include `receipts/typography_plan.json` before `manifest.json` may set `publish_ready=true`.",
|
||||
"",
|
||||
"The receipt records the deck's selected font category, display/body/label stacks, requested fonts, fallback decisions, source, and rejected substitutions. Slide SVG text must use only those planned stacks.",
|
||||
"The receipt records the deck's selected language mode, font category, display/body/label role fonts, English role fonts when needed, requested fonts, fallback decisions, source, and rejected substitutions. Slide SVG text must use only those planned single-family role fonts.",
|
||||
"",
|
||||
"## Visual System Gate",
|
||||
"",
|
||||
@@ -494,14 +509,17 @@ function writeValidationDocs() {
|
||||
"- Source coverage audit: `source-coverage.md`",
|
||||
"- Protocol validation script: `../../../scripts/validate_svg_deck.mjs`",
|
||||
"- Bundle manifest script: `../../../scripts/svg_slides_bundle.mjs`",
|
||||
"- Browser text bounds script: `../../../scripts/svg_slides_browser_text_bounds.mjs`",
|
||||
"- Asset readiness script: `../../../scripts/svg_slides_asset_readiness.mjs`",
|
||||
"- Visual identity comparison script: `../../../scripts/svg_slides_visual_identity_check.mjs`",
|
||||
"- Asset fit script: `../../../scripts/svg_slides_asset_fit.mjs`",
|
||||
"- Typography plan script: `../../../scripts/svg_slides_typography_plan.mjs`",
|
||||
"- Visual system script: `../../../scripts/svg_slides_visual_system.mjs`",
|
||||
"- Color rhythm script: `../../../scripts/svg_slides_color_rhythm.mjs`",
|
||||
"- Frame discipline script: `../../../scripts/svg_slides_frame_discipline.mjs`",
|
||||
"- Readability safety script: `../../../scripts/svg_slides_readability_safety.mjs`",
|
||||
"- Browser text bounds contract: `browser-text-bounds.md`",
|
||||
"- Browser text bounds script: `../../../scripts/svg_slides_browser_text_bounds.mjs`",
|
||||
"- Prompt coverage script: `../../../scripts/svg_slides_prompt_coverage.mjs`",
|
||||
"- Prompt read trace script: `../../../scripts/svg_slides_prompt_trace.mjs`",
|
||||
"- Post-delivery audit checklist: `post-delivery-audit.md`",
|
||||
"",
|
||||
@@ -510,15 +528,42 @@ function writeValidationDocs() {
|
||||
"A generated SVG Slides bundle is publish-ready only when all visual safety gates pass:",
|
||||
"",
|
||||
"1. `validate_svg_deck`: parser semantics, no browser-only text or untyped shapes.",
|
||||
"2. `svg_slides_visual_system`: actual SVG colors stay inside the locked deck palette.",
|
||||
"3. `svg_slides_color_rhythm`: adjacent pages follow the planned full-page color rhythm.",
|
||||
"4. `svg_slides_frame_discipline`: ordinary text is not wrapped in meaningless stroked frames.",
|
||||
"5. `svg_slides_readability_safety`: foreground overlap, out-of-bounds content, and missing text-over-image masking.",
|
||||
"2. `svg_slides_asset_fit`: information-bearing images are neither cropped without a plan nor shrunk inside unsuitable frames.",
|
||||
"3. `svg_slides_visual_system`: actual SVG colors stay inside the locked deck palette.",
|
||||
"4. `svg_slides_color_rhythm`: adjacent pages follow the planned full-page color rhythm.",
|
||||
"5. `svg_slides_frame_discipline`: ordinary text is not wrapped in meaningless stroked frames.",
|
||||
"6. `svg_slides_readability_safety`: foreground overlap, out-of-bounds content, and missing text-over-image masking.",
|
||||
"7. `svg_slides_browser_text_bounds`: rendered or estimated text bounds do not overflow their `foreignObject` boxes.",
|
||||
"8. `svg_slides_prompt_coverage`: explicit user requirements are covered, rewritten with a reason, or marked not applicable with a reason.",
|
||||
"",
|
||||
"## Response Audit",
|
||||
"",
|
||||
"When a user asks whether a finished deck satisfies the prompt, do not answer from the user's visible request alone. Read `post-delivery-audit.md` and report against user-visible requirements, SVG Slides default requirements, and receipt/readback evidence."
|
||||
].join("\n"));
|
||||
writeFile("validation/browser-text-bounds.md", [
|
||||
"# Browser Text Bounds",
|
||||
"",
|
||||
"Use this contract during slide authoring, not only during bundle validation.",
|
||||
"",
|
||||
"The goal is prevention: size every `foreignObject` so the intended text already fits while writing the SVG. The later `svg_slides_browser_text_bounds.mjs` run is a verifier, not the first time anyone should think about clipping.",
|
||||
"",
|
||||
"## Required Behavior",
|
||||
"",
|
||||
"1. Before finalizing a text box, estimate the actual line count and height from the written copy, font size, line height, and padding.",
|
||||
"2. If the text may grow during iteration, reserve slack rather than packing the box to the exact current line break.",
|
||||
"3. When a title, KPI, or list must stay in a fixed box, shorten or restructure the copy instead of hoping the browser renderer will fit it.",
|
||||
"4. For hero overlays, treat the text box and the scrim as one unit: the overlay must cover the full text area plus breathing room.",
|
||||
"",
|
||||
"## Validation Surface",
|
||||
"",
|
||||
"- Script: `../../../scripts/svg_slides_browser_text_bounds.mjs`",
|
||||
"- Receipt: `receipts/browser_text_bounds.json`",
|
||||
"- Bundle gate: `svg_slides_bundle.mjs` rejects any deck whose rendered or heuristic text bounds overflow their `foreignObject` boxes.",
|
||||
"",
|
||||
"## Failure Rule",
|
||||
"",
|
||||
"If the validator reports `text_bounds_overflow`, the SVG authoring step was incomplete. Fix the SVG geometry or rewrite the text before bundling."
|
||||
].join("\n"));
|
||||
writeFile("validation/post-delivery-audit.md", [
|
||||
"# SVG Slides Post-Delivery Audit",
|
||||
"",
|
||||
@@ -527,8 +572,8 @@ function writeValidationDocs() {
|
||||
"## Required Review Surfaces",
|
||||
"",
|
||||
"1. User-visible requirements: page count, named sections, language, topic, style words, explicit exclusions, and delivery mode.",
|
||||
"2. SVG Slides default requirements: image search policy, required visual subjects, primary visual rules for cover / section-divider / closing / key-showcase slides, typography plan, frame discipline, readability safety, and prompt read trace.",
|
||||
"3. Execution evidence: local manifest, validation command results, `receipts/asset_readiness.json`, `receipts/typography_plan.json`, `receipts/prompt_read_trace.json`, and online readback receipt when the deck was published.",
|
||||
"2. SVG Slides default requirements: prompt coverage, image search policy, required visual subjects, primary visual rules for cover / section-divider / closing / key-showcase slides, typography plan, typography theme fit, language mode, English role fonts, generic display fallback evidence, frame discipline, browser text bounds, readability safety, and prompt read trace.",
|
||||
"3. Execution evidence: local manifest, validation command results, `receipts/prompt_coverage.json`, `receipts/asset_readiness.json`, `receipts/browser_text_bounds.json`, `receipts/typography_plan.json`, `receipts/prompt_read_trace.json`, and online readback receipt when the deck was published.",
|
||||
"",
|
||||
"## Mandatory Answer Shape",
|
||||
"",
|
||||
@@ -536,8 +581,9 @@ function writeValidationDocs() {
|
||||
"",
|
||||
"- User prompt fit: satisfied / partially satisfied / failed, with the exact unmet or changed requirement.",
|
||||
"- System prompt fit: asset search policy, primary visual coverage, typography and readability gates.",
|
||||
"- Typography fit: whether `display_font` matches the deck theme and `visual_system.typography`; whether `language_mode` is correct; whether English-heavy or bilingual decks define English role fonts; whether a generic display font was used; if yes, whether it is justified by a minimal/report theme or explicit fallback evidence.",
|
||||
"- Online delivery fit: publish/readback status when online delivery was requested.",
|
||||
"- Quality gaps: issues that pass validation but still reduce real usefulness, such as one asset reused across too many slides, placeholder company evidence, weak cover identity, or factual compliance rewrites.",
|
||||
"- Quality gaps: issues that pass validation but still reduce real usefulness, such as one asset reused across too many slides, placeholder company evidence, weak cover identity, unsupported generic display font for a cultural / historical / memorial / brand / high-impact theme, English-heavy text rendered without English role fonts, or factual compliance rewrites.",
|
||||
"",
|
||||
"## Asset Search Checks",
|
||||
"",
|
||||
@@ -621,6 +667,10 @@ function writeValidationDocs() {
|
||||
" \"visual_tier\": \"hero | supporting | chart | none\",",
|
||||
" \"primary_visual_required\": true,",
|
||||
" \"primary_visual\": \"/absolute/path/to/local/image.png\",",
|
||||
" \"primary_visual_treatment\": \"full_bleed_image | large_area_image | dominant_screenshot | editorial_crop | inline_image\",",
|
||||
" \"primary_visual_area_ratio\": 0.75,",
|
||||
" \"overlay_theme_color\": \"rgba(120,0,0,0.38)\",",
|
||||
" \"overlay_opacity\": 0.38,",
|
||||
" \"layout_family\": \"hero-image-left-code-right\",",
|
||||
" \"text_overlay\": true,",
|
||||
" \"mask_required\": true,",
|
||||
@@ -642,9 +692,13 @@ function writeValidationDocs() {
|
||||
"- Generated assets are fallback-only. They must include `fallback_reason`; they cannot satisfy the default search requirement by themselves.",
|
||||
"- If the user explicitly says not to use images, set `image_search_policy: \"user_opted_out\"` plus `image_search_opt_out_reason`; only then may `assets` and `required_visual_subjects` be empty and key pages omit `primary_visual`. Do not create generated replacement imagery under `user_opted_out`.",
|
||||
"- Every slide must declare `slide_role` and `layout_family`. `cover`, `section-divider`, `closing`, and `key-showcase` slides must set `primary_visual_required: true` and provide a `primary_visual`.",
|
||||
"- Non-opt-out decks must have ready image assets on at least 70% of slides. Decks with more than three slides must use unique ready images for at least half the slide count.",
|
||||
"- Do not reuse a ready image on more than two slides, or more than one slide for decks of three pages or fewer, unless the asset records `intentional_reuse_reason`.",
|
||||
"- Key pages (`cover`, `section-divider`, `closing`, `key-showcase`) must set `primary_visual_treatment` to `full_bleed_image`, `large_area_image`, `dominant_screenshot`, or `editorial_crop`, and the actual SVG primary visual area must be at least `0.65` of the slide.",
|
||||
"- When text overlays a key-page image, record `overlay_theme_color` and `overlay_opacity`; use a topic-color translucent overlay that preserves image impact and text contrast.",
|
||||
"- Primary/hero assets must declare `asset_kind`, `expressive_role`, `content_relevance`, and `format`; charts, icons, decorative patterns, textures, and abstract geometry do not satisfy a primary visual requirement.",
|
||||
"- Photographic/product/person/storefront/screenshot/document-capture assets should use PNG/JPG/JPEG/WebP. SVG is allowed for those only with `format_exception_reason`.",
|
||||
"- If slide text overlays a hero image (`text_overlay: true` and `mask_required: true`), the slide SVG must include a readable parser-legible mask/scrim/safe-zone structure such as `<rect slide:role=\"shape\" slide:shape-type=\"rect\" data-svglide-layer=\"mask\" ...>`, a gradient overlay, or a semi-transparent overlay rect. Do not invent new `slide:role` values for masks.",
|
||||
"- If `text_overlay` is true, record `overlay_theme_color` and numeric `overlay_opacity`, and the slide SVG must include a readable parser-legible mask/scrim/safe-zone structure such as `<rect slide:role=\"shape\" slide:shape-type=\"rect\" data-svglide-layer=\"mask\" ...>`, a gradient overlay, or a semi-transparent overlay rect. Do not invent new `slide:role` values for masks.",
|
||||
"- Every `ready` visual asset must have an existing local path, be assigned to a slide's `visual_assets`, and be embedded by that slide SVG. Remote-only URLs are not publish-ready.",
|
||||
"- Every slide must declare a `layout_family`; multi-deck/team runs must compare `visual_identity_fingerprint` and layout-family overlap with `../../../scripts/svg_slides_visual_identity_check.mjs`.",
|
||||
"",
|
||||
@@ -654,6 +708,62 @@ function writeValidationDocs() {
|
||||
"node skills/lark-slides/scripts/svg_slides_asset_readiness.mjs <deck-dir>",
|
||||
"node skills/lark-slides/scripts/svg_slides_visual_identity_check.mjs <deck-a> <deck-b> [<deck-c>...]",
|
||||
"```"
|
||||
].join("\n"));
|
||||
writeFile("validation/asset-fit.md", [
|
||||
"# Asset Fit Plan",
|
||||
"",
|
||||
"## Context",
|
||||
"",
|
||||
"- Role: schema",
|
||||
"- Purpose: Defines the receipt that proves local visual assets are placed without destructive crop or unreadable shrink.",
|
||||
"",
|
||||
"## Content",
|
||||
"",
|
||||
"# Asset Fit Plan",
|
||||
"",
|
||||
"Role: schema",
|
||||
"",
|
||||
"## Purpose",
|
||||
"",
|
||||
"`receipts/asset_fit_plan.json` is the generation-time contract for how each local visual asset is placed into a slide. It prevents information images such as paper figures, tables, screenshots, charts, and UI captures from being cropped or shrunk as if they were decorative photos.",
|
||||
"",
|
||||
"## Required Receipt",
|
||||
"",
|
||||
"Write `receipts/asset_fit_plan.json` after `asset_readiness.json` and before any `slide_edit` call.",
|
||||
"",
|
||||
"```json",
|
||||
"{",
|
||||
" \"version\": \"svg-slides.asset-fit-plan.v1\",",
|
||||
" \"images\": [",
|
||||
" {",
|
||||
" \"slide\": \"slides/slide_01.svg\",",
|
||||
" \"asset\": \"assets/table.png\",",
|
||||
" \"asset_kind\": \"table_screenshot\",",
|
||||
" \"fit_policy\": \"contain_no_crop\",",
|
||||
" \"protected_regions\": [\"table_header\", \"key_labels\"],",
|
||||
" \"expected_box\": { \"x\": 520, \"y\": 96, \"width\": 340, \"height\": 260 },",
|
||||
" \"crop_box\": null,",
|
||||
" \"reason\": \"The table is evidence, so headers and row labels must remain visible.\"",
|
||||
" }",
|
||||
" ]",
|
||||
"}",
|
||||
"```",
|
||||
"",
|
||||
"## Rules",
|
||||
"",
|
||||
"- Information-bearing assets default to `contain_no_crop`.",
|
||||
"- `cover_allowed` is forbidden for `paper_figure`, `table_screenshot`, `chart_screenshot`, `document_capture`, `ui_screenshot`, and `benchmark_table`.",
|
||||
"- `crop_whitespace` is allowed only when `crop_box` is recorded in source-image pixels.",
|
||||
"- `decorative_cover` is allowed only for `photo`, `illustration`, or `decorative`.",
|
||||
"- If the source image includes a title, axis, legend, table header, caption, or diagram labels, list those in `protected_regions`.",
|
||||
"- The slide SVG image box must match `expected_box` within 2 px.",
|
||||
"- The displayed content must use enough of the box: information-bearing assets should have content coverage at least 0.62 after whitespace crop.",
|
||||
"",
|
||||
"## Validation Command",
|
||||
"",
|
||||
"```bash",
|
||||
"node skills/lark-slides/scripts/svg_slides_asset_fit.mjs <deck-dir> --json",
|
||||
"```"
|
||||
].join("\n"));
|
||||
writeFile("validation/typography-plan.md", [
|
||||
"# Typography Plan",
|
||||
@@ -667,23 +777,23 @@ function writeValidationDocs() {
|
||||
"```json",
|
||||
"{",
|
||||
" \"version\": \"svg-slides.typography-plan.v1\",",
|
||||
" \"font_category\": \"clean sans display and body\",",
|
||||
" \"display_font\": \"DM Sans, 黑体, sans-serif\",",
|
||||
" \"body_font\": \"DM Sans, 黑体, sans-serif\",",
|
||||
" \"label_font\": \"DM Sans, 黑体, sans-serif\",",
|
||||
" \"language_mode\": \"zh-en-mixed\",",
|
||||
" \"font_category\": \"editorial serif with CJK body\",",
|
||||
" \"preferred_display_font\": \"Playfair Display\",",
|
||||
" \"display_font\": \"Playfair Display\",",
|
||||
" \"body_font\": \"Noto Sans SC\",",
|
||||
" \"label_font\": \"Noto Sans SC\",",
|
||||
" \"english_display_font\": \"Playfair Display\",",
|
||||
" \"english_body_font\": \"DM Sans\",",
|
||||
" \"english_label_font\": \"DM Sans\",",
|
||||
" \"source\": \"visual_system.typography\",",
|
||||
" \"selection_reason\": \"Why this category and stack match the deck's topic, audience, and tone.\",",
|
||||
" \"forbidden_substitutions\": [\"serif display for a sans visual system\", \"calligraphy body\"],",
|
||||
" \"selection_reason\": \"Display uses an editorial title face that matches the deck theme while body and labels use a canonical CJK-readable Slide font.\",",
|
||||
" \"forbidden_substitutions\": [\"CSS fallback stacks\", \"browser generic fonts\", \"CSS variables\"],",
|
||||
" \"runtime_candidates_used\": true,",
|
||||
" \"requested_fonts\": [\"Bodoni MT\", \"汉仪楷体简\", \"思源宋体\", \"微软雅黑\"],",
|
||||
" \"resolved_fonts\": [\"Bodoni MT, 汉仪楷体简, serif\", \"Arial, 微软雅黑, sans-serif\"],",
|
||||
" \"fallbacks\": [",
|
||||
" {",
|
||||
" \"requested\": \"汉仪楷体简\",",
|
||||
" \"fallback\": \"Bodoni MT, KaiTi, serif\",",
|
||||
" \"reason\": \"Only if the requested font is unavailable in runtime candidates or local font probes.\"",
|
||||
" }",
|
||||
" ],",
|
||||
" \"display_font_evidence\": \"runtime_candidates\",",
|
||||
" \"requested_fonts\": [\"Playfair Display\", \"Noto Sans SC\"],",
|
||||
" \"resolved_fonts\": [\"Playfair Display\", \"Noto Sans SC\"],",
|
||||
" \"fallbacks\": [],",
|
||||
" \"fallback_reason\": \"One-sentence summary when any requested font is unavailable; empty when all requested fonts are preserved.\",",
|
||||
" \"unavailable_fonts\": [],",
|
||||
" \"user_requested_font_preserved\": true",
|
||||
@@ -692,14 +802,25 @@ function writeValidationDocs() {
|
||||
"",
|
||||
"## Rules",
|
||||
"",
|
||||
"- `language_mode` is required. Valid values are `zh-only`, `en-only`, and `zh-en-mixed`.",
|
||||
"- `en-only` and `zh-en-mixed` decks must define `english_display_font`, `english_body_font`, and `english_label_font` as concrete single font families.",
|
||||
"- The design brief's `visual_system.typography` is authoritative. Keep its category and treatment: serif vs sans-serif vs rounded vs mono, weight, case, and letter spacing.",
|
||||
"- Explicit user-requested fonts outrank inferred visual_system fonts. Preserve every requested font by name in `display_font`, `body_font`, or `label_font`, or record it in `unavailable_fonts` with a concrete fallback reason.",
|
||||
"- Select explicit `display_font`, `body_font`, and `label_font` stacks before slide authoring. Use `<runtime_font_candidates>` when provided; otherwise use the Font Palette in `svg-reference.md`.",
|
||||
"- Each stack must start with a Latin font and end with a generic fallback such as `serif`, `sans-serif`, `monospace`, or `cursive`.",
|
||||
"- Explicit user-requested fonts outrank inferred visual_system fonts. Preserve every requested font by exact family name in `display_font`, `body_font`, or `label_font`, or record it in `unavailable_fonts` with a concrete fallback reason.",
|
||||
"- Select explicit `display_font`, `body_font`, and `label_font` before slide authoring. Select explicit English role fonts when `language_mode` requires them. Use `<runtime_font_candidates>` when provided; otherwise use the Font Palette in `svg-reference.md`.",
|
||||
"- Each font field is one concrete font family string. Commas are invalid.",
|
||||
"- English role font fields follow the same single-family rule as CJK role fields.",
|
||||
"- Generic-only values are invalid: `serif`, `sans-serif`, `monospace`, `cursive`, `system-ui`.",
|
||||
"- CSS variables are invalid: `var(--font-body)` and similar values must never appear.",
|
||||
"- Body text must not use calligraphy, cursive, handwriting, or decorative script fonts.",
|
||||
"- Font selection must optimize for theme fit and design quality before runtime conservatism.",
|
||||
"- Do not proactively downgrade `display_font` to generic-safe fonts such as 黑体, 宋体, Noto Sans SC, Arial, Helvetica, PingFang SC, or 微软雅黑 merely because they feel stable online.",
|
||||
"- Generic display fonts are valid only when `font_category` explicitly indicates minimal / report / technical-neutral / neutral typography.",
|
||||
"- Cultural, historical, memorial, red-theme, brand, entertainment, fashion, and high-impact decks require an expressive display font unless a generic fallback has explicit evidence.",
|
||||
"- Fallback evidence for a generic `display_font` must include `preferred_display_font`, `display_font_evidence`, `fallback_reason`, and a `fallbacks[]` entry whose `requested` is the preferred font and whose `fallback` is the actual `display_font`.",
|
||||
"- `selection_reason` must justify theme/design fit. Reasons that only say parser-safe, stable, compatible, or readback-safe are invalid for non-neutral decks.",
|
||||
"- `forbidden_substitutions` must name the tempting but wrong swaps for this deck, such as flipping serif and sans-serif or replacing a technical mono treatment with a cute rounded font.",
|
||||
"- Do not silently replace requested Chinese/CJK fonts with `STKaiti`, `KaiTi`, `PingFang SC`, `Noto Sans SC`, `黑体`, or any other nearby-looking fallback.",
|
||||
"- All slide SVG text must use only the planned display/body/label stacks. If a new stack is needed, update `typography_plan.json` first and keep the category rationale explicit.",
|
||||
"- All slide SVG text must use only the planned single font families. If a new family is needed, update `typography_plan.json` first and keep the category rationale explicit.",
|
||||
"",
|
||||
"## Validation Command",
|
||||
"",
|
||||
@@ -785,7 +906,7 @@ function writeValidationDocs() {
|
||||
"",
|
||||
"Both must have `ok: true` and `totalErrors: 0` before the bundle can publish."
|
||||
].join("\n"));
|
||||
writeFile("validation/frame-discipline.md", [
|
||||
writeFile("validation/frame-discipline.md", [
|
||||
"# Frame Discipline",
|
||||
"",
|
||||
"Every generated SVG Slides bundle must pass frame-discipline validation before `manifest.json` may set `publish_ready=true`.",
|
||||
@@ -806,6 +927,29 @@ function writeValidationDocs() {
|
||||
"node skills/lark-slides/scripts/svg_slides_frame_discipline.mjs <deck-dir>",
|
||||
"```"
|
||||
].join("\n"));
|
||||
writeFile("validation/prompt-coverage.md", [
|
||||
"# Prompt Coverage",
|
||||
"",
|
||||
"Every generated SVG Slides bundle must write `receipts/prompt_coverage.json` before bundling.",
|
||||
"",
|
||||
"The receipt maps user-visible requirements to evidence slides. It covers page counts, required sections, exact numeric terms, pricing, guarantees, exclusions, requested language, and explicit structure.",
|
||||
"",
|
||||
"## Allowed Statuses",
|
||||
"",
|
||||
"- `covered`",
|
||||
"- `rewritten_with_reason`",
|
||||
"- `not_applicable_with_reason`",
|
||||
"",
|
||||
"`covered` and `rewritten_with_reason` require `evidence_slides`. Rewritten claims require `rewrite_reason`; not-applicable claims require `not_applicable_reason`.",
|
||||
"",
|
||||
"Evidence slides must be real generated slide files, not placeholders such as `待补充`, `可替换`, `placeholder`, `TBD`, or `TODO`.",
|
||||
"",
|
||||
"## Validation Command",
|
||||
"",
|
||||
"```bash",
|
||||
"node skills/lark-slides/scripts/svg_slides_prompt_coverage.mjs <deck-dir> --json",
|
||||
"```"
|
||||
].join("\n"));
|
||||
writeFile("validation/prompt-read-trace.md", [
|
||||
"# Prompt Read Trace",
|
||||
"",
|
||||
|
||||
Reference in New Issue
Block a user