diff --git a/README.en.md b/README.en.md
index 8feadb8..98456e0 100644
--- a/README.en.md
+++ b/README.en.md
@@ -38,7 +38,7 @@ LearnDeck is designed for that moment when you already have knowledge, but need
- **Clearer structure** with sections, key points, examples, and takeaways
- **Polished pages** that feel ready for lessons, workshops, reports, and sharing
- **Editable delivery** so you can keep refining the wording, flow, and style
-- **Multiple visual styles** such as clean, academic, warm, bold, or dark
+- **Custom visual direction** derived from your brief, audience, brand, or reference image
- **Reusable knowledge assets** that can grow into courses, training decks, or study reviews
## Install
@@ -57,8 +57,29 @@ To update an existing installation:
npx --yes github:LearnAIHubC/LearnDeck --force
```
+## Direct HTML to PPTX
+
+LearnDeck's default creative workflow does not require an intermediate JSON plan or a fixed layout list:
+
+`your content + visual direction → model-designed HTML/CSS → browser geometry → editable PPTX`
+
+The model designs each slide around its message and keeps the deck coherent with shared colors, typography, spacing, and visual motifs. The existing JSON generator remains available only as a deterministic legacy option.
+
+To convert a model-authored HTML deck directly:
+
+```bash
+node scripts/html_to_ppt.js \
+ --input templates/learn-deck-polished-style.html \
+ --out-dir output \
+ --name learn-deck-polished-style
+```
+
+The bundled HTML is a seven-slide composition library, not a required sequence or content schema. Keep its visual language while selecting and reshaping only the pages that fit the user's material.
+
## Showcase Templates
+- [Open the seven-slide polished HTML style library](templates/learn-deck-polished-style.html)
+- [Download the polished editable PPTX style template](templates/learn-deck-polished-style.pptx)
- [Download the English editable PPTX template](templates/learn-deck-showcase-en.pptx)
- [Download the Chinese editable PPTX template](templates/learn-deck-showcase-zh.pptx)
diff --git a/README.md b/README.md
index 334cf55..2286032 100644
--- a/README.md
+++ b/README.md
@@ -1,122 +1,181 @@
-# LearnDeck
+
Model-designed HTML → polished, editable PowerPoint
+
+
+ Turn a topic, outline, notes, or source material into a coherent presentation.
+ The model designs each slide in HTML/CSS, then LearnDeck rebuilds it as editable PPTX objects.
-
- Let AI create PPTs in one click.
- Turn knowledge into clear, polished, editable presentation decks.
+
-## What Is LearnDeck?
+
-LearnDeck is an AI presentation companion for learning content.
+
-It helps you turn a topic, outline, notes, course material, article summary, or rough idea into a clear, beautiful, editable PPT. Instead of starting from a blank deck, you start with knowledge. LearnDeck helps shape that knowledge into a presentation people can follow.
+## Why LearnDeck
-The idea is simple: let AI create the first high-quality PPT for you, then keep the result easy to revise, personalize, and reuse.
+Most presentation generators make you choose between a rigid schema and a flattened screenshot. LearnDeck takes a different route:
-## Why It Exists
+| Design follows the message | The result stays editable | Quality is visually verified |
+| --- | --- | --- |
+| The model authors the final HTML/CSS directly. No fixed layout enum is required. | Text, cards, shapes, gradients, and icons are rebuilt as separate PowerPoint objects. | Chromium audits the DOM before conversion; the final PPTX is rendered once for delivery QA. |
-Learning content often has enough substance, but turning it into a deck takes time:
+The default creative pipeline does **not** require an intermediate JSON slide plan:
-- You need a clear order for the ideas
-- You need pages that are easy to scan
-- You need a polished look that feels presentation-ready
-- You need the result to stay editable after generation
-- You need something that works for teaching, training, reporting, or sharing
+```text
+content + visual direction
+ ↓
+model-designed HTML/CSS
+ ↓
+browser DOM audit
+ ↓
+browser-measured geometry
+ ↓
+editable PowerPoint objects
+ ↓
+contact-sheet + full-size visual QA
+```
-LearnDeck is designed for that moment when you already have knowledge, but need a deck that makes it easier to teach and easier to understand.
+## Latest seven-slide style system
-## Who It Is For
+
+
+
-- Teachers, instructors, and workshop hosts
-- Course creators and knowledge creators
-- Teams preparing internal training or onboarding material
-- Learners and researchers turning notes into reports
-- Anyone who wants AI to turn scattered knowledge into a presentable PPT
+This showcase includes a cover, statement page, relationship map, timeline, comparison, data story, and action close. It is a **composition library, not a mandatory sequence or fixed content template**. The user's content still determines the slide count, structure, visual emphasis, and layout of every page.
-## What You Get
+## Quick start
-- **One-click PPT generation** from a topic, outline, notes, or learning material
-- **Clearer structure** with sections, key points, examples, and takeaways
-- **Polished pages** that feel ready for lessons, workshops, reports, and sharing
-- **Editable delivery** so you can keep refining the wording, flow, and style
-- **Multiple visual styles** such as clean, academic, warm, bold, or dark
-- **Reusable knowledge assets** that can grow into courses, training decks, or study reviews
+### 1. Install the Skill
-## Install
+```bash
+npx --yes github:LearnAIHubC/LearnDeck
+```
-Run:
+Restart Codex, then invoke `$learn-deck`. To refresh an existing installation:
```bash
-npx --yes github:LearnAIHubC/LearnDeck
+npx --yes github:LearnAIHubC/LearnDeck --force
```
-Then restart Codex and use `$learn-deck`.
+### 2. Describe the presentation you want
-To update an existing installation:
+```text
+Use $learn-deck to turn my onboarding notes into a concise 10-slide deck.
+Use a calm editorial style with generous whitespace and a clear data story.
+Keep every text box, shape, gradient, and icon editable in PowerPoint.
+```
+
+You can provide a topic, outline, document, course material, study notes, brand direction, or reference image. LearnDeck derives the visual language from the request instead of forcing the content into a preset card count.
+
+### 3. Audit the DOM before conversion
```bash
-npx --yes github:LearnAIHubC/LearnDeck --force
+node scripts/html_to_ppt.js \
+ --input path/to/deck.html \
+ --dom-audit-only
```
-## Showcase Templates
+This Chromium preflight checks slide and text overflow, declared overlap/containment rules, unexpected single-line wrapping, centered text, centered SVG icons, chart labels, and text safety inside circles and compact cards. It produces structured errors without generating screenshots.
-- [Download the English editable PPTX template](templates/learn-deck-showcase-en.pptx)
-- [Download the Chinese editable PPTX template](templates/learn-deck-showcase-zh.pptx)
+### 4. Keep revising the same HTML
-The cover and workflow images in this README are rendered from these actual editable decks.
+The generated HTML remains the source of truth. When the content or style changes, LearnDeck edits that HTML, reconverts the PPTX, rerenders the previews, and checks the result again.
-## What Can You Create?
+## What stays editable
-LearnDeck is especially useful for:
+| HTML/CSS source | PowerPoint output |
+| --- | --- |
+| Headings, paragraphs, labels, and bullets | Separate editable text boxes |
+| Cards, panels, pills, borders, and circles | Native PowerPoint shapes |
+| Linear gradients and quiet decorative accents | Editable gradient and shape objects |
+| Inline SVG icons | Separate icon objects, with SVG sources preserved |
+| Browser positions and dimensions | Rebuilt on a 16:9 PowerPoint canvas |
-- Course introductions and lesson outlines
-- Classroom slides and learning cards
-- Internal training decks
-- Learning progress reports
-- Study group and book club presentations
-- Methodology explainers
-- Product or business knowledge training
-- Research summaries and knowledge reviews
+The converter favors **editable, separated elements** over a single full-slide screenshot.
-If your goal is to help people understand something more clearly, LearnDeck gives you a strong first deck.
+## DOM first, final render once
-## The Experience
+LearnDeck separates fast structural validation from final presentation validation:
-1. **Bring content**: start with a topic, outline, notes, article summary, or course material
-2. **Let AI shape it**: organize the message into titles, key points, examples, and takeaways
-3. **Create PPT**: get a coherent deck with a clean visual style and a clear learning rhythm
-4. **Edit freely**: adjust wording, tone, brand, sequence, and classroom style
+1. **Browser DOM preflight, no screenshots** — catches overflow, overlap, wrapping, centering, icon, chart-label, circle, pill, and card failures before a PPTX is written.
+2. **Final contact-sheet review** — checks narrative flow, composition variety, density, whitespace, hierarchy, color, and page-to-page consistency.
+3. **Final full-size slide review** — checks PowerPoint-specific clipping, wrapping, reconstruction, fine alignment, contrast, and chart labels.
-
-
-
+The DOM audit replaces repeated draft screenshots, but not the final render: PowerPoint and LibreOffice can use different font metrics and object geometry from Chromium. If a problem appears, the original HTML is edited and the relevant audit/conversion loop runs again.
+
+Generate the same QA assets manually with:
+
+```bash
+node scripts/render_pptx_preview.js \
+ --input output/deck-name-editable.pptx \
+ --out-dir output/deck-name-qa
+```
+
+## Convert HTML directly
+
+Use any converter-compatible local HTML deck or URL:
+
+```bash
+node scripts/html_to_ppt.js \
+ --input templates/learn-deck-polished-style.html \
+ --out-dir output \
+ --name learn-deck-polished-style
+```
+
+The output is `output/learn-deck-polished-style-editable.pptx`. The legacy JSON generator remains available for deterministic compatibility, but it is not the default creative path.
+
+## Included templates
+
+- [Seven-slide polished HTML style library](templates/learn-deck-polished-style.html)
+- [Seven-slide polished editable PPTX](templates/learn-deck-polished-style.pptx)
+- [English editable showcase PPTX](templates/learn-deck-showcase-en.pptx)
+- [Chinese editable showcase PPTX](templates/learn-deck-showcase-zh.pptx)
-## Why The Name LearnDeck?
+Use the templates to study converter-compatible visual grammar: palette relationships, typography, spacing rhythm, corner radii, borders, shadows, and decorative motifs. Do not copy their sample content or treat their boxes as a schema.
-“Learn” stands for learning content, knowledge sharing, and teaching moments.
+## Good fits
-“Deck” stands for a complete presentation that can be taught, shared, edited, and reused.
+- Courses, lessons, workshops, and classroom slides
+- Internal training, onboarding, and enablement decks
+- Research summaries, reports, and knowledge reviews
+- Product explainers and methodology presentations
+- Reference-image-driven presentations that still need editable objects
-LearnDeck is not just a slide maker. It is a learning-deck partner that helps knowledge become a complete presentation with flow, clarity, and visual polish.
+## Development
+
+Requirements: Node.js 18 or newer. Final visual preview generation also uses LibreOffice, Poppler (`pdftoppm`), and `sharp`.
+
+```bash
+npm test
+npm pack --dry-run
+```
-## Vision
+The smoke test covers direct HTML conversion, DOM-audit failures, layout guards, multiline text handling, and legacy JSON compatibility.
-LearnDeck aims to make high-quality learning decks easier to create.
+## Project links
-It is for people who have ideas, notes, expertise, or teaching material, but do not want to spend most of their time shaping structure and polishing pages. A good PPT should help the presenter speak clearly and help the audience understand easily.
+- [Report an issue](https://github.com/LearnAIHubC/LearnDeck/issues)
+- [LINUX DO](https://linux.do/) — a community for technology enthusiasts
-LearnDeck exists to make that bridge lighter, faster, and more beautiful.
+
-## 友情链接
+If LearnDeck helps you turn knowledge into clearer presentations, consider starring the repository.
-- [LINUX DO](https://linux.do/) —— 新的理想型社区,技术爱好者的聚集地。
+
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 8a9dbf1..a872d62 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -44,7 +44,7 @@ LearnDeck 的交付结果更像是一套“学习型演示稿”,而不是普
- **更清楚的内容结构**:主题、章节、重点、案例和结论被整理得更有层次
- **更适合讲解的节奏**:页面顺序围绕学习者的理解路径展开
- **更有质感的视觉表达**:版式干净,重点突出,适合课堂、培训和汇报
-- **更多风格选择**:可选择清爽、学术、暖色、大胆、深色等方向
+- **按需求定制视觉**:根据受众、品牌、内容和参考图动态设计风格
- **更方便修改的结果**:后续可以继续调整文字、页面顺序和表达方式
- **更容易复用的材料**:同一套内容可以延展成课程、培训、分享或复盘
@@ -64,8 +64,29 @@ npx --yes github:LearnAIHubC/LearnDeck
npx --yes github:LearnAIHubC/LearnDeck --force
```
+## HTML 直接生成 PPTX
+
+LearnDeck 默认的创作链路不需要中间 JSON,也不限制在固定版式列表里:
+
+`你的内容 + 视觉要求 → 模型逐页设计 HTML/CSS → 浏览器真实坐标 → 可编辑 PPTX`
+
+模型会根据每页要表达的信息设计构图,再用共享的配色、字体、间距和视觉元素保持整套演示稿一致。现有 JSON 生成器仅作为需要确定性批量输出时的兼容选项保留。
+
+模型生成 HTML 后,可直接转换:
+
+```bash
+node scripts/html_to_ppt.js \
+ --input templates/learn-deck-polished-style.html \
+ --out-dir output \
+ --name learn-deck-polished-style
+```
+
+内置 HTML 是一套七页构图样本库,不是必须照搬的顺序、内容模板或固定版式。生成时保留视觉语言,只选择并重构适合用户内容的页面。
+
## 展示模板
+- [查看七页精致浅色 HTML 构图样本库](templates/learn-deck-polished-style.html)
+- [下载精致浅色可编辑 PPTX 风格模板](templates/learn-deck-polished-style.pptx)
- [下载中文可编辑 PPTX 模板](templates/learn-deck-showcase-zh.pptx)
- [下载英文可编辑 PPTX 模板](templates/learn-deck-showcase-en.pptx)
diff --git a/SKILL.md b/SKILL.md
index d5101b4..a9f061b 100644
--- a/SKILL.md
+++ b/SKILL.md
@@ -1,56 +1,58 @@
---
name: learn-deck
-description: Generate editable learning PPTX decks by first creating HTML slides, or convert local HTML slide decks and single-page HTML presentations into editable PPTX files by rendering in a browser, reading DOM element positions, extracting inline SVG assets, and rebuilding text, shapes, gradients, bullets, and icons as separated PowerPoint objects. Use when a user asks to generate PPT/PPTX from a topic, outline, course material, study notes, or structured content, or asks for pixel-level/browser-positioned HTML-to-PPT/PPTX conversion with editable/separate elements instead of one full-slide screenshot.
+description: Design custom HTML slide decks from a user's content and visual direction, then convert the browser-rendered slides into editable PPTX objects. Use for new PPT/PPTX generation, reference-image-driven presentation styling, or converting local HTML/URLs to editable PowerPoint while preserving separate text, shapes, gradients, and icons.
---
# LearnDeck
-## Quick Start
+## Core Rule
-This skill has two main commands.
+For a new presentation, author the final slide HTML directly. Do not create a slide-plan JSON and do not choose from a fixed layout enum unless the user explicitly requests the legacy deterministic generator.
-### 1. Generate PPT
+The default pipeline is:
-Use this when the user asks to create a new PPT/PPTX from a topic, outline, notes, or source material.
+`user content + visual direction -> model-designed HTML/CSS -> browser DOM audit -> editable PPTX -> final render QA`
-1. Create a slide plan JSON using the shape in `examples/slides.example.json`.
-2. Run:
+Shared design tokens should make the deck coherent, but every slide's composition should follow its own message. Do not force all slides into repeated cover/content/steps/compare/summary templates.
-```bash
-node /path/to/learn-deck/scripts/generate_ppt.js \
- --slides /path/to/slides.json \
- --out-dir /path/to/output \
- --name deck-name \
- --style clean \
- --no-preview
-```
+## Quick Start
-This command first writes `/.html`, then calls the HTML-to-PPT converter.
+### Create a New PPT
-### 2. HTML to PPT
+1. Understand the audience, purpose, content hierarchy, and requested visual direction. If the user provides a reference image, inspect it and reuse its visual language without copying its composition blindly.
+2. Write one self-contained HTML file. Use `templates/learn-deck-polished-style.html` as a converter-compatible style template when that visual direction fits the request.
+3. Give every slide a `.slide` root and design its DOM/CSS directly around that slide's content.
+4. Run the browser DOM preflight and fix every reported issue:
-Use this when the user already has a local HTML file or URL:
+```bash
+node /path/to/learn-deck/scripts/html_to_ppt.js \
+ --input /path/to/deck.html \
+ --dom-audit-only
+```
+
+5. Convert only after the DOM audit reports zero issues:
```bash
node /path/to/learn-deck/scripts/html_to_ppt.js \
- --input /path/to/source.html \
+ --input /path/to/deck.html \
--out-dir /path/to/output \
--name deck-name
```
-If Codex workspace dependencies are available, prefer the bundled runtime:
+This produces `/-editable.pptx` and preserves the source HTML for revisions.
+
+### Convert Existing HTML
+
+Use the same command for a local HTML file or URL:
```bash
-NODE_PATH="$NODE_MODULES:/Users/$USER/node_modules" "$NODE_BIN" \
- /path/to/learn-deck/scripts/generate_ppt.js \
- --slides /path/to/slides.json \
+node /path/to/learn-deck/scripts/html_to_ppt.js \
+ --input /path/to/source.html \
--out-dir /path/to/output \
- --name deck-name \
- --style clean \
- --no-preview
+ --name deck-name
```
-or:
+If Codex workspace dependencies are available, call `load_workspace_dependencies` first and run with the returned Node.js paths:
```bash
NODE_PATH="$NODE_MODULES:/Users/$USER/node_modules" "$NODE_BIN" \
@@ -60,77 +62,135 @@ NODE_PATH="$NODE_MODULES:/Users/$USER/node_modules" "$NODE_BIN" \
--name deck-name
```
-When running in Codex Desktop, call `load_workspace_dependencies` first and set:
+## Direct HTML Workflow
+
+### 1. Establish the Art Direction
+
+- Derive the style from the user's words, audience, brand, and references. Do not reduce the choice to a fixed list of named themes.
+- Define a small set of CSS variables for the palette, type scale, spacing, borders, radii, and shadows.
+- Match reference images by visual grammar: density, whitespace, hierarchy, color behavior, geometry, and motif. Adapt the layout to the new content.
+- If style is unspecified, infer a suitable direction. Ask one short question only when the missing choice would materially change the result.
+
+### 2. Design the Narrative and Each Slide
+
+- Give each slide one clear communication goal.
+- Split content instead of shrinking text or overcrowding a page.
+- Choose each composition from the content itself: a strong statement, diagram, comparison, timeline, data story, annotated visual, card system, or another bespoke arrangement.
+- Vary composition and scale across the deck while keeping shared tokens consistent.
+- Avoid repeating the same grid on consecutive slides unless repetition is meaningful.
+
+### Style Template Contract
+
+- A style template defines visual grammar only: palette relationships, typography, spacing rhythm, corner radii, border treatment, shadows, and decorative motifs.
+- The user's content determines the narrative, slide count, DOM structure, composition, number of cards, charts, diagrams, and visual emphasis.
+- Never copy the template's sample text into a customer deck.
+- Never force new content into the template's existing boxes or preserve its card count when the content calls for another composition.
+- It is acceptable to resize, remove, add, or rearrange components while retaining the same visual family.
+- Use `templates/learn-deck-polished-style.html` for the polished light aesthetic shown in the bundled showcase. Treat its seven slides as a composition library, not a required sequence or fixed page set. Select and reshape only the specimens that fit the user's content.
+
+### 3. Author Converter-Compatible HTML
+
+- Use a fixed `1280px × 720px` canvas for every `.slide` by default.
+- Make the HTML self-contained. Prefer local/system fonts, CSS shapes, and inline SVG.
+- Use normal DOM elements for every object that should remain independently editable.
+- Keep intended text boxes as semantic text elements such as `h1`, `h2`, `p`, `li`, or `span`.
+- Flexbox, grid, and absolute positioning are all acceptable; browser coordinates are authoritative.
+- Use simple backgrounds, borders, rounded rectangles, ellipses, linear gradients, restrained shadows, and inline SVG icons.
+- Do not use canvas, video, CSS filters, masks, blend modes, or transform-based rotation for content that must survive as editable PPT objects.
+- The current converter does not rebuild `` elements or CSS `url(...)` backgrounds. Use inline SVG/CSS visuals, or extend the converter before relying on raster images.
+- Do not use a large radial gradient as the primary slide background. The converter approximates it as a literal editable ellipse, which creates an awkward object boundary in PowerPoint. Prefer a full-canvas two-color linear-gradient rectangle for a soft atmospheric background.
+- Treat PowerPoint selection ergonomics as part of the design. Large background objects should either match the full slide bounds or stay as small corner accents; do not place a giant selectable decorative shape behind the title or body copy.
+- Keep optional decorative shapes visually quiet and below roughly one quarter of the slide area. They must not compete with the main message or create misleading selection boxes during editing.
+
+### 4. Mandatory Layout Safety Checks
+
+- Set a content budget before fixing a card or panel height. Test the longest real title and body copy, including CJK text where relevant.
+- No text may cross a card, panel, footer, or slide boundary. Preserve at least `10px` of visible bottom padding inside compact cards.
+- If content does not fit, shorten the copy, enlarge the container, or redesign the composition. Do not hide overflow and do not solve it by making important text illegibly small.
+- Use inline SVG with an explicit `viewBox` for small icons. Do not use Unicode symbols, emoji, or font glyphs such as `□` or `◇` inside icon containers; their metrics shift across Chrome, PowerPoint, and LibreOffice. Plain arrows are acceptable only as inline text separators when exact icon centering is not required.
+- Center icon artwork with explicit dimensions and `display: flex; align-items: center; justify-content: center`. Keep the SVG smaller than its colored container so it has even internal padding.
+- Reserve separate layout slots for controls, logos, labels, titles, and page markers. Use grid or flex columns with an explicit gap of at least `8px`; never separate independent objects with repeated spaces, ` `, transparent text, or negative margins.
+- For window-like chrome, keep the control-dot cluster and the window title in separate sibling elements. The title must start after the full control cluster plus the safety gap.
+- Add `data-layout-guard="no-overlap"` to critical rows whose direct children must never intersect. Add `data-layout-guard="contain"` to cards and panels whose direct children must remain inside their bounds. Combine them as `data-layout-guard="contain no-overlap"` when both rules apply.
+- Add `text-contain` to circles, pills, compact cards, and other text-bearing shapes whose text must remain inside the padded content area. Ellipse-like shapes receive an additional shape-aware text check.
+- Add `single-line` to titles, labels, chips, and chart annotations that must never wrap. Do not add it to intentionally multiline copy.
+- Add `text-center` to short labels that must be geometrically centered inside a circle, pill, or compact card.
+- Add `icon-center` to an icon container that must contain exactly one centered inline SVG.
+- Add `chart-labels` to a chart-series container. Mark each direct series child with `data-chart-series` and its visible label with `data-chart-label`.
+- Use `data-layout-allow-overflow` only for an intentional decorative element that extends past the slide edge. Never use it for text, charts, cards, or content. Do not add `data-layout-ignore` merely to silence an audit failure.
+- The converter treats layout-guard failures as blocking errors. Fix the HTML structure or spacing; do not remove the guard merely to make conversion pass.
+- Run `--dom-audit-only` after every meaningful HTML revision. It checks slide overflow and text overflow automatically, then enforces the declared overlap, containment, wrapping, centering, icon, and chart-label contracts in Chromium without generating screenshots.
+- Browser success is not enough: PowerPoint font metrics can change wrapping and baseline positions. Render the converted PPTX and inspect every slide at full size.
+- The final QA pass must have zero unintended text overflow, clipping, overlap, icon drift, unexpected wrapping, or objects crossing neighboring cards. Fix the HTML and reconvert until clean.
+
+### 5. Mandatory Browser DOM Preflight
+
+1. Run `scripts/html_to_ppt.js --input --dom-audit-only` before creating the PPTX.
+2. Read every reported slide number, issue type, element label, edge, box, wrap count, center drift, or missing chart label.
+3. Fix the original HTML and rerun the preflight until `domAudit.issues` is `0`.
+4. Do not convert a deck that fails preflight, and do not remove guards or add overflow exceptions simply to make the command pass.
+
+The DOM preflight replaces repeated draft screenshots. It does not replace the final PPTX render because PowerPoint and LibreOffice can use different font metrics and object reconstruction from Chromium.
+
+### 6. Mandatory Final Visual QA and Revision Loop
+
+1. Run `scripts/html_to_ppt.js` on the authored HTML.
+2. Render the resulting PPTX into full-size slide images and a contact sheet. Do not judge only from the source HTML or assume a successful conversion is visually correct:
-- `NODE_BIN` to the returned Node.js executable.
-- `NODE_MODULES` to the returned Node.js packages directory.
-
-## Workflow
+```bash
+node /path/to/learn-deck/scripts/render_pptx_preview.js \
+ --input /path/to/output/deck-name-editable.pptx \
+ --out-dir /path/to/output/deck-name-qa
+```
-### Generate PPT
+3. **Pass 1 — inspect the contact sheet first.** Open `contact-sheet.png` with an image-viewing tool. Review the deck as one sequence for narrative flow, pacing, composition variety, repeated silhouettes, density balance, consistent margins/title hierarchy/color/footer/page markers, and unexpectedly empty or overloaded slides.
+4. **Pass 2 — inspect every slide at full size.** Open every PNG under `slides/`; the contact sheet does not replace this pass. Check title wrapping, text clipping or overflow, unintended overlap, icon centering, fine alignment, contrast, chart labels and data, and decorative objects that are too large or misleading when selected in PowerPoint. Pay special attention to the first and last characters of centered multiline labels inside circles, pills, and compact cards; line-break conversion can reveal clipping that is invisible in the HTML.
+5. If either pass finds a problem, edit the original HTML, not an intermediate JSON or the rendered preview. Reconvert the PPTX, rerender all previews, and repeat both passes. Do not patch only the affected PNG, and do not reuse a stale contact sheet.
+6. Deliver only after the latest contact sheet and every latest full-size slide have been inspected and there is zero unintended overflow, clipping, overlap, wrapping, icon drift, visual imbalance, or accidental layout repetition. If an intentional exception remains, disclose it explicitly.
-1. Ask one short style question when the user has not specified a style and the request is not urgent. Offer choices such as `clean`, `academic`, `warm`, `bold`, or `dark`; if the user says they do not care, choose based on audience and topic.
-2. Turn the user's topic/content into a concise `slides.json` plan. Include `"style": ""` in the plan or pass `--style`.
-3. Keep each slide focused; split long content into more slides rather than crowding one slide.
-4. Use `layout` values `cover`, `content`, `steps`, `compare`, or `summary` when useful.
-5. Run `scripts/generate_ppt.js`; it writes HTML and then runs the converter. Use `--no-preview` by default for direct delivery.
-6. Do not run extra validation by default. Directly report the generated `.html` and `.pptx` paths to the user/customer.
+This final QA loop is mandatory for a final deck, even when the browser DOM audit passes. The DOM audit catches HTML geometry and semantic guard failures; the final render catches PowerPoint font-metric changes, reconstruction differences, weak hierarchy, poor rhythm, and composition problems.
-### Revision Loop
+## What the Converter Preserves
-When the user/customer asks for adjustments after delivery:
+The converter:
-1. Edit the original generated HTML file rather than starting over.
-2. Run `scripts/html_to_ppt.js` on that same HTML file with the same `--name`/output directory.
-3. Return the regenerated PPTX path. Only validate or preview when the user explicitly asks or a conversion error occurs.
+1. Loads the HTML in Chromium/Chrome through Playwright and waits for fonts.
+2. Detects `.slide` roots, or another selector passed with `--slide-selector`.
+3. Automatically audits slide/text overflow and enforces explicit containment, overlap, wrapping, centering, icon, and chart-label guards before reading visible DOM bounding boxes, computed styles, text runs, pseudo bullets, and inline SVG children.
+4. Rebuilds editable text boxes and native rectangle, rounded-rectangle, ellipse, border, shadow, and gradient objects.
+5. Saves inline SVG sources and PNG compatibility assets beside the PPTX.
-### HTML to PPT
+The result favors editable, separated elements over screenshot-perfect reproduction.
-1. Load the HTML in Chromium/Chrome through Playwright.
-2. Wait for network idle and `document.fonts.ready`.
-3. Detect slides with `.slide` by default; pass `--slide-selector` for another selector.
-4. Read every visible DOM element's bounding box, computed styles, text runs, pseudo bullets, and SVG children relative to its slide.
-5. Save each inline SVG to `