ImageGen PPTX Pipeline
Build an editable PPTX deck through a controlled pipeline, or convert user-supplied final slide images into a faithful editable PPTX.
Generated slide images are visual construction targets, not content truth. deck_spec.json owns final text, numbers, slide order, claims, and source provenance.
The PPTX conversion phase is now the bundled strict slide-image converter:
slidelib.py: native PowerPoint builder in source-pixel coordinates.scene_builder.py: optional declarative native builder with a separate source inventory and atomic audited output.asset_sheet.py: optional alpha/chroma sheet splitter with count, clipping, hash and source-review checks.iconcut3.py: strict transparent icon extractor with amputation guards, HD supersampling/sharpening, and no silent fallback.scripts/realesrgan_upscale.py: preserves native 3840x2160 comp bytes; otherwise uses PythonRealESRGANerCPU/tile processing for 4K comps and 256px+ icons.imagegen_contract.py: validates GPT Image 2.5 request plans and records actual generated assets, model disclosure, quality, dimensions, format and hashes.qa_gate.py: mechanical QA gates that read real renders, real PPTX XML/media, real icon manifests, and real render logs.object_audit.py: source-bound checks of native objects, exact text, geometry, image bytes, and supplied speaker notes, including after final assembly.scripts/measure_text.py: local glyph-height measurements and advisory font-size groups from confirmed text-line boxes.PITFALLS.md: required trap catalog for icon extraction, measurement, python-pptx, LibreOffice rendering, and render-compare loops.
Do not use any legacy audit-script image-to-PPTX path. Do not use full-slide or region-image layers as the main output. The approved comp or supplied slide image is a measurement target; the PPTX must be rebuilt from native text, shapes, connectors, charts, tables, and only validated icon/art assets.
Hard Invariants
- Stateful pauses are mandatory: before any user question, write
pipeline_state.json. On "continue/resume/继续", readpipeline_state.json,deck_spec.json, anduser_decisions.mdbefore doing anything else. - "帮我做 PPT" is not full automation consent: only explicit wording such as "全自动", "不用问我", "你自己决定", or a recorded user answer may skip user style selection.
- Template is a hard constraint: if a template/source PPTX is supplied, preserve master/layout inheritance, typography, palette, logos, footer/page markers, title furniture, and protected brand chrome unless the user explicitly asks to restyle away from it.
- ImageGen owns visual design: generated images are not loose mood boards. After style selection, each page image is the approved construction target for conversion.
- Content, slide intent, and narrative are locked before visual work: confirm slide titles/core ideas/proof goals, then narrative treatment, then style options.
- Style lanes are visual skins, not story lanes: style options may differ by art direction only. They must not change slide count, order, claims, data, proof object intent, or selected narrative treatment.
- Style recommendations must fit the actual task: classify the deck profile, audience, and occasion before proposing styles. A company profile deck should start from company/brand/corporate-profile styles, a product deck from product/keynote styles, a technical deck from schematic/data styles, a finance deck from finance/investor styles, and a defense/interview deck from personal/academic proof styles. If the user explicitly asks for an off-profile style, honor it and record that it was user-requested.
- Multi-style means structural diversity: different options must use visibly different layout archetypes, evidence-presentation patterns, composition grammar, density/pacing, and title treatment. Options that only swap icons, line styles, small modules, or accent colors on the same skeleton are failed style options.
- No HTML/browser surrogate comps: do not create HTML/CSS/SVG/React/canvas screenshots as
styles/*contact-sheet.pngorslides/slide-XXX-comp.png. Comps must come from ImageGen/Image2 or from user-supplied final slide images. - Per-slide comps are required: a full-deck contact sheet alone is never enough for PPTX conversion.
- Final single-slide ImageGen comps are serial within each style lane: parallelize across selected styles if needed, but do not shard final pages across page-owning agents unless the user accepts style drift risk in
user_decisions.md. - Generated comps require role review evidence: after each per-slide ImageGen comp is produced, run bounded reviewer subagents for content, text/typography, visual fidelity, style continuity, image art direction, PPTX feasibility, chart logic, asset authenticity, template fidelity, accessibility/readability, and visual clarity. Write one approved JSON artifact per slide under
qa/reviews/slide-comp/before conversion. - Image clarity is a hard gate: use a fixed style/stage request plan; prefer Flare/high for exploration and Sunburst/xhigh for production and edits when the backend exposes those parameters. Try 4K 16:9 for final comps, then 2560x1440, then API-safe 2048x1152 after bounded failures. Keep the internal 1920x1080 measurement basis. Decode actual images; file byte counts are informational, not clarity thresholds.
- Exact 4K comp preparation is mandatory: run
scripts/realesrgan_upscale.py --kind compfor every source. A fully decoded native 3840x2160 image must pass through with identical bytes andtool="native_4k"; do not run it through Real-ESRGAN. Other dimensions use PythonRealESRGANer,RealESRGAN_x4plus.pth, CPU, tile=400, tile_pad=12, pre_pad=0, half=False to produce exact 3840x2160. Keep the preparation manifest and raw source hashes. Lanczos-only enlargement is not a substitute for the non-native path. - Strict converter owns PPTX output: use measurement, strict HD icon extraction/enhancement, native build, and at least 10 render-compare-fix rounds. Do not ship a generic deck that merely resembles the content.
- No full-image or region-image backgrounds: headings, body text, numbers, labels, card titles, flow nodes, buttons, lines, arrows, charts, tables, cards, and color blocks must be native. Only complex icon artwork, photos, official marks, or inseparable art slices may remain images.
- Icons fail closed: source line-art icons must pass
iconcut3.strict_cut3and a 4-edge alpha audit. OnClipError, fix the box or clear rects and rerun. Never hand-crop or alpha-key around the failure. For complex artwork that needs a separate alpha/chroma sheet, select the controlled route inreferences/scene-and-assets.mdbefore extraction; it requires provenance and source-match review and is not a ClipError fallback. - Real source icons must be extracted, not redrawn: if a pictogram can be named (target, shield, database, briefcase, person, building, light bulb, cube, chart, people, etc.), treat it as source artwork and extract it with
iconcut3. Do not useslidelibglyph helpers such asshield(),target(),person(),bars(), ortrend()as a fidelity path for real source icons; those helpers are placeholder scaffolding for trivial primitives or temporary layout only. A PPTX with zero extracted icons when the source contains recognizable pictograms is a failed generic redraw. - Icons must be HD-enhanced before placement:
iconcut3.strict_cut3supersamples and sharpens strict line-art icons to at least 256px minimum dimension by default, then the extracted assets must run throughscripts/realesrgan_upscale.py --kind iconintoicons/upscaled/. PPTX placement must use the Real-ESRGAN icon outputs, not the first-pass crops. Feathered opaque slices must preserve alpha and be recorded in the icon manifest. - Icon content audit is separate: every extracted asset must be checked in a contact sheet. If an asset contains Chinese characters, Latin words, or a text label, re-measure the real pictogram and rebuild the text natively.
- Never rely on automatic wrapping for multi-line text: split CJK/mixed-size/multi-line text into absolute text boxes per source line or run.
- Render-compare-fix means 10+ real export rounds: each counted round must produce a new LibreOffice/Poppler render file. Looking at the same render multiple times is still one round. Keep a strict
render_log.jsonlist with one object per round:round,render,timestamp,max_metric,issues,fix, andrecheck. - Mechanical gates read real artifacts: do not satisfy conversion QA with hand-written metrics, rounded-down blocking values, or review notes.
qa_gate.pymust recompute the real max region diff from the latest render, inspect the PPTX media/text XML, and verify distinct render files. If the real max diff is over the threshold, fix the slide rather than writing a lower value into a manifest. - New conversions audit source-bound objects: v2 conversion manifests require a per-slide
object_manifest_pathand final output records with orderedslide_ids. Author inventories from approved sources and locked text, name PPTX objects with their inventory IDs, and rerun object audits on the final assembled deck. Seereferences/object-audit.md; structural success never replaces visual QA. - Final reports disclose real numbers: paste or summarize the actual
qa_gate.pyoutput: real render count, distinct render files, real max region diff, picture/media count, text-run count, icon-manifest count, and any explicitly accepted risk.
Required Tools And Skills
Use the imagegen skill for generated bitmap style options and per-slide comps. Read references/image-generation.md before generating: create a fixed plan per style/stage, execute through an available imagegen backend, then record the returned file. Never claim a selected/actual model from prompt text alone.
Use the bundled converter files in this skill directory for PPTX conversion:
bashcp "$SKILL_DIR/slidelib.py" "$WORKSPACE/slidelib.py" cp "$SKILL_DIR/scene_builder.py" "$WORKSPACE/scene_builder.py" cp "$SKILL_DIR/asset_sheet.py" "$WORKSPACE/asset_sheet.py" cp "$SKILL_DIR/iconcut3.py" "$WORKSPACE/iconcut3.py" cp "$SKILL_DIR/qa_gate.py" "$WORKSPACE/qa_gate.py" cp "$SKILL_DIR/object_audit.py" "$WORKSPACE/object_audit.py" cp "$SKILL_DIR/imagegen_contract.py" "$WORKSPACE/imagegen_contract.py" cp "$SKILL_DIR/PITFALLS.md" "$WORKSPACE/PITFALLS.md" mkdir -p "$WORKSPACE/scripts" cp "$SKILL_DIR/scripts/realesrgan_upscale.py" "$WORKSPACE/scripts/realesrgan_upscale.py" cp "$SKILL_DIR/scripts/measure_text.py" "$WORKSPACE/scripts/measure_text.py"
Runtime requirements:
- Python 3
Pillow,numpy,python-pptx- LibreOffice
soffice - Poppler
pdftoppm realesrgan,basicsr,torch, andRealESRGAN_x4plus.pthonly for non-native comp processing and icon enhancementmarkitdownoptional for text QA- an image-viewing path for paired crops and contact sheets
Use the Presentations plugin only as an optional helper for template inspection or preview rendering. It is not the PPTX conversion method for approved slide images.
Deterministic Gate Checks
Use the gate checker:
bashSKILL_DIR=<directory containing this SKILL.md> python "$SKILL_DIR/scripts/check_pipeline_gates.py" \ --workspace <workspace> \ --stage <content-lock|slide-intent-lock|narrative-lock|style-selection|conversion-lock|before-pptx|final>
Run it after:
- content lock:
--stage content-lock - slide-intent confirmation:
--stage slide-intent-lock - narrative selection:
--stage narrative-lock - style selection:
--stage style-selection - conversion-only input registration:
--stage conversion-lock - visual contract and converter plan are ready:
--stage before-pptx - final export:
--stage final
If the checker returns FAIL, fix the listed artifacts and rerun. Do not work around the checker by writing prose that says unperformed work happened.
Interaction And Resume Contract
Normal pause points are content lock, slide-intent confirmation, narrative treatment selection, design-direction count/brief, visual style selection, and finished-comp style-set selection for PPTX conversion.
Before asking the user, update pipeline_state.json:
skill:imagegen-pptx-pipelineworkspace: absolute workspace pathcurrent_stage: one ofcontent_gate,slide_intent_lock,narrative_selection,style_count,style_selection,single_slide_comps,multi_style_comp_selection,slide_comp_review,conversion_input_lock,visual_contract,pptx_conversion,final_reviewawaiting_user:truerequired_user_reply: exact question or decision needednext_action: first action after the user replieslast_completed_artifacts: latest valid artifactsresume_instructions: "Read pipeline_state.json, deck_spec.json, user_decisions.md, then continue this stage; do not restart unless the user requests a restart."
End the user-facing question with a concise resume promise: "回复后我会继续用 $imagegen-pptx-pipeline 从 pipeline_state.json 继续。"
On resume, set awaiting_user=false, append the answer to user_decisions.md, and continue from next_action.
Workflow
0. Resume Or Continue
If a workspace exists or the user says "继续", "resume", "用新的 skill 继续", or similar:
- Read
pipeline_state.json,deck_spec.json,design_system.json,user_decisions.md, and the stage's required artifacts. - Confirm the state belongs to
imagegen-pptx-pipeline. - Continue from
current_stageandnext_action. - Do not repeat completed parsing, style exploration, or slide generation unless the state marks them invalid.
1. Set Workspace
Create a workspace:
bashSKILL_DIR=<directory containing this SKILL.md> python "$SKILL_DIR/scripts/init_pipeline_workspace.py" \ --slug <task-slug> \ --title "<deck title>" \ --mode <create|template-following|targeted-edit|reconstruction-only|repair-existing-pptx>
Use reconstruction-only when the user already has final per-slide images and wants direct image-to-PPTX conversion. This is a legacy mode name for compatibility; the implementation path is the strict converter.
The initializer copies all bundled conversion tools, including object_audit.py and scripts/measure_text.py. When resuming an older workspace, copy missing tools before opting into the v2 object audit contract; keep existing artifacts.
2. Read Inputs
Classify inputs:
- Brief outline: content seed; expand only where the user allows.
- Template PPTX: hard constraint for source slide skeletons, master/layout inheritance, typography, palette, footer, logos, title furniture, page markers, and brand chrome.
- Historical/reference PPTX: soft reference for taste, pacing, density, chart language, and image treatment.
- Data/source files: truth source for metrics and charts.
- Brand/media assets: verified source assets; do not invent logos, product UI, official marks, or people.
- Final slide images: direct conversion targets; skip content/narrative/style generation unless the user asks to redesign.
For every PPTX input, render previews/contact sheets and extract slide text before using it.
When a template/source PPTX exists, write:
template-audit.mdtemplate-frame-map.jsondeviation-log.md
2A. Conversion-Only Fast Path
Use this path when the user supplies final slide images and asks to convert them to PPTX. Do not rerun content planning, narrative selection, style exploration, or ImageGen unless an image is missing/invalid and the user asks to regenerate it.
Required inputs:
- one high-resolution 16:9 image per final slide, preferably ordered as
slide-001,slide-002, etc. - exact text per slide, or permission to OCR and verify text before PPTX conversion
- optional template/source PPTX for logos, footer, page markers, or corporate chrome
First process every supplied image through scripts/realesrgan_upscale.py --kind comp so the conversion source is exact 3840x2160 and record its manifest. Then write and lock:
conversion_manifest.json: raw source path, prepared 4K source image path,upscale_manifest_path, text source status, basis image path, measurement status, icon extraction status, render-compare status, strict render-log path, per-slide output path, QA-gate output path, and merge status.- minimal
deck_spec.json: slide count, slide IDs, exact text when known, and editability targets. Setdeck.lock_state="locked"after text is provided, OCR is verified, or the user accepts image text. visual_contract.json: each supplied image becomes an approved conversion target withconversion_method="strict_slide_image_to_editable_pptx".
If the user provides only a contact sheet, stop and ask for individual high-resolution slide images unless they explicitly accept lower fidelity.
3. Produce Draft Truth Files
Before ImageGen, write:
pipeline_state.jsondeck_spec.jsondesign_system.jsonslide_intent_plan.jsonslide_intent_matrix.mdnarrative_plan.jsonnarrative_matrix.mdstyle_brief.jsonconversion_manifest.jsontemplate-frame-map.jsonwhen a template/source PPTX existssource_notes.mdcontent_review.mduser_decisions.md
Read references/schemas.md when drafting structures.
Read references/taste-system.md before style exploration. Read references/style-library.md when selecting concrete style IDs.
4. Grill And Lock Content
Before ImageGen, run content review. Ask only P0/P1 clarification questions unless the user explicitly requested full automation.
Do not proceed to ImageGen until:
deck_spec.json.deck.lock_stateislocked- each slide has a title, claim, proof object, and editability target
- P0/P1 content findings are resolved or explicitly accepted
- unsupported metrics/sources/assets are removed
check_pipeline_gates.py --stage content-lockpasses
Read references/subagent-rubrics.md for pre-visual role prompts.
5. Propose And Lock Slide Intent
Write slide_intent_plan.json and slide_intent_matrix.md.
The matrix rows are slides. Columns are page number, proposed title, core idea, proof goal, evidence/data candidates, content gaps/user questions, and confidence.
If the user did not request full automation, ask them to confirm or edit the proposed titles/core ideas.
Do not proceed until:
slide_intent_plan.json.lock_stateislocked- every slide has a confirmed title, core idea, proof goal, and evidence strategy
slide_intent_matrix.mdexistscheck_pipeline_gates.py --stage slide-intent-lockpasses
6. Propose And Lock Narrative Treatment
Write narrative_plan.json and narrative_matrix.md.
Narrative options may change framing and emphasis, but may not invent claims, data, logos, sources, products, results, slide count, or slide order.
Do not proceed until:
narrative_plan.json.lock_stateislockednarrative_plan.json.selected_narrative_idis set- every slide has a selected narrative cell
narrative_matrix.mdexistscheck_pipeline_gates.py --stage narrative-lockpasses
7. Explore And Select Visual Directions
If the user did not specify a count and did not request full automation, ask for the number of directions and any style preference. If full automation is explicit, default to 4 directions.
Before recommending directions, fill style_brief.json.deck_profile_evidence from the locked content, audience, and occasion, then choose the matching route in style_brief.json.style_recommendation_policy.profile_style_routes. The recommendation must explain why each option fits that profile. Do not offer generic lanes just because they are common, and do not reuse a previous task's preferred styles. If the user named a specific style outside the route, add it to user_style_preferences, set task_fit.user_requested_off_profile=true, and generate it.
Use ImageGen to create materially different full-deck contact-sheet style options from locked content/narrative files. Use concrete style_id values from references/style-library.md where possible. Examples: enterprise/company introductions should prefer styles such as corporate-profile-architectural, corporate-team-collaboration, nordic-business-future, brand-proposal-minimal, or a justified annual-report treatment; product decks should prefer launch/product styles; technical decks should prefer schematic/data styles; finance decks should prefer finance/investor styles; defense/promotion/interview/academic tasks should prefer personal/academic proof styles.
Each candidate direction must record task_fit, layout_archetype, evidence_presentation, composition_grammar, density_and_pacing, thumbnail_differentiators, and must_not_reuse. The visible contact sheets must honor those fields. A candidate that keeps the same central loop, four-card ring, equal-card grid, top breadcrumb, bottom metric strip, or red-white frame while only changing icons/colors is invalid and must be regenerated before showing the user.
Prompt every contact sheet with readable PPT targets: body text designed around at least 10-11pt in the eventual editable deck, larger key labels, crisp title edges, and no dense microtext.
Require each direction to preserve:
- slide count and order
- titles and claims
- data and source meaning
- proof-object intent
- selected narrative treatment
- template frame, if any
Do not proceed until every candidate option is task-fit and structurally distinct across style ID, aesthetic family, layout archetype, evidence presentation, and composition grammar.
Show all contact sheets unless full automation was explicit. Record selected options in style_brief.json.selected_options.
Do not proceed until check_pipeline_gates.py --stage style-selection passes.
8. Generate Single-Slide Visual Comps
For each selected style, generate one complete set of per-slide comps. Keep generation serial within each style lane so page chrome, footer, logo, page number, and title furniture stay consistent.
Each output must become an exact 3840x2160 16:9 slide image:
- raw ImageGen return under
slides/raw/ - optional Real-ESRGAN intermediate under
slides/upscaled/for non-native sources - final downstream comp under
slides/slide-XXX-comp.pngorslides/<style-lane-id>/slide-XXX-comp.png - preparation manifest under
upscale/slide-XXX-comp.preparation.json - prompt under
prompts/; fixed generation plan and returned asset record undergeneration/ generation_record_pathon each generated slide and contact sheet; the record binds the raw return, not the prepared comp- dimensions, source type, review status, clarity status, raw path, final comp path, and
upscale_manifest_pathrecorded indeck_spec.json,visual_contract.json, andconversion_manifest.json
Run comp preparation before review and conversion (native 4K bypasses SR and requires no model weights):
bashpython scripts/realesrgan_upscale.py \ --input slides/raw/slide-XXX-raw.png \ --output slides/slide-XXX-comp.png \ --manifest upscale/slide-XXX-comp.preparation.json \ --kind comp \ --tile 400 \ --tile-pad 12 \ --pre-pad 0 \ --target-width 3840 \ --target-height 2160
Review comps before PPTX conversion. Fix P0/P1 findings by targeted ImageGen regeneration, not by hiding defects in PPTX.
For generated ImageGen comps, the comp review is not optional and not a prose-only final note:
- Read
references/subagent-rubrics.md. - Dispatch bounded reviewer subagents for the slide-comp roles, or record
reviewer_mode="main_agent_role_review"with a concretesubagent_fallback_reasonif subagent tooling is unavailable. - Write one JSON file per slide under
qa/reviews/slide-comp/slide-XXX.json. - Include all required role reviews,
approval_to_advance=truefor every role,unresolved_p0_p1=[],overall_status="approved", and the exact approved comp path. - If any role returns P0/P1, regenerate or repair the comp, then rerun the review before locking the conversion contract.
9. Lock The Conversion Contract
Before writing PPTX code, translate approved comps into visual_contract.json and conversion_manifest.json.
For each slide record:
- approved comp path
- raw source path and preparation
upscale_manifest_path - source image dimensions and basis image path
- exact text source status
- visual archetype
- measurement plan and status
- native elements required
- icon extraction jobs and audit status
- text line-splitting plan
- build script path
- object manifest path (v2), with stable object IDs and supplied speaker notes
- output slide/module PPTX path
- preview path
- render-compare rounds status
- unresolved accepted risks
Reject any approved comp path that points to preview/, output/, template-starter preview images, or browser/HTML output.
Do not proceed to PPTX build until:
- every slide has an approved
slide-XXX-comp.pngor user-supplied final image - generated ImageGen comps have matching approved
qa/reviews/slide-comp/slide-XXX.jsonevidence for all required roles conversion_manifest.json.lock_stateislockedvisual_contract.json.conversion_policy.methodisstrict_slide_image_to_editable_pptxslidelib.py,iconcut3.py,qa_gate.py,PITFALLS.md, andscripts/realesrgan_upscale.pyare copied into the workspace- every slide's conversion source is exact 3840x2160 and has a matching preparation manifest
- every slide has a measurement plan, text split plan, and converter output path
- icon assets either pass strict extraction, Real-ESRGAN HD enhancement, and contact-sheet audit, or
not_applicableis backed by an explicit source-icon inventory stating no recognizable source pictograms exist check_pipeline_gates.py --stage before-pptxpasses
10. Convert Slide Images To Editable PPTX
Read PITFALLS.md before writing conversion code.
Read references/object-audit.md for measured text hints, the per-page object schema, and final assembly checks. Use hints when they help calibrate text; they are approximate measurements, not OCR or permission to change locked text.
Read references/scene-and-assets.md when using declarative construction or processing a separate asset sheet. Clear source icons and official marks still default to direct source extraction.
Work in 1920x1080 basis coordinates, but use the prepared 4K comp as the high-resolution source. Keep hd = Image.open(source_image_path) where source_image_path is the 3840x2160 prepared output, and use scale = hd.width / 1920 for extraction.
Use the strict converter workflow:
- Measure: resize the source to
src.pngat 1920x1080. Use numpy scans for edges, text rows, column runs, color masks, and exact sampled colors. For ambiguous regions, create magnified labeled grid crops with burnt-in coordinates. - Extract and HD-enhance icons: default to extraction for every recognizable source pictogram from the 4K
hdsource. Useiconcut3.run_jobsoriconcut3.strict_cut3for line-art/glyph icons;strict_cut3supersamples and sharpens to a 256px minimum dimension before adding transparent padding. OnClipError, fix coordinates/clears and rerun. Then runscripts/realesrgan_upscale.py --kind icon --input icons --output icons/upscaled --manifest icons/icon_upscale_manifest.json --target-min 256and place onlyicons/upscaled/*assets in PPTX. For inseparable art, use feathered opaque slices with sampled native underlay color, document the exception, and keepalpha_crisp=Falsefor those slice names. Only bare primitives such as plain dots, rings, chevrons, checkmarks, bars, and dividers may be native. Do not useslidelibcomposite glyph helpers to redraw real source icons. - Audit icons: run 4-edge alpha audit and visual contact-sheet audit after Real-ESRGAN icon enhancement. Text labels are never icon assets.
- Build natively: use
SB(1920,1080,bg)fromslidelib.py, orscene_builder.pywith a measured scene and independent source inventory. Build text, cards, lines, circles, arrows, charts, tables, page chrome, and simple glyphs as native elements. Split multi-line CJK and mixed-size runs into absolute boxes. Write the source-derived object inventory, set every shape'snameto its inventory ID, and preserve supplied notes. Runobject_audit.pyagainst each page module. The scene builder does not preserve supplied templates; use the existing template-preserving path for those jobs. - Render: use LibreOffice and Poppler:
bashsoffice --headless --convert-to pdf --outdir pdf out.pptx pdftoppm -jpeg -r 150 -scale-to-x 2001 -scale-to-y -1 pdf/out.pdf r
- Compare and fix: each round must include a fresh full-page render, full-page side-by-side, paired source/render crops for suspect regions, and region diff metrics. Fix one issue cluster per round.
- Log real rounds: append one object to
qa/render-compare/render_log.jsonfor every real export round. Therenderpath must point to a distinct existing render file. Do not backfill review notes as rounds. - Run mechanical gates: after the latest render, run:
bashpython qa_gate.py all SRC.png LATEST_RENDER.jpg out.pptx qa/render-compare/render_log.json icons/icon_jobs.json --objects measurements/slide-XXX-objects.json
The output is the truth for max region diff, media audit, and render-round integrity. A failing gate blocks completion.
9. Stop only after 10+ real export rounds: all paired crops must match closely, the real region diff must be below the blocking threshold, text QA should pass or be explicitly accepted, icon audits must still pass, and qa_gate.py all must print PASS.
For multi-slide decks, build single-page modules under slide-modules/slide-XXX.pptx. One builder script may emit all page modules and the combined deck, recording per-slide rounds. Merge only pages with no unresolved P0/P1 conversion defects.
For v2, record every final output's actual hash and ordered slide_ids. The final gate audits the objects on each assembled slide again; preserve names and notes during assembly. Existing v1 conversion manifests keep their legacy object-audit behavior; image policies must be refreshed as described in references/image-generation.md.
11. Final Review And Export
Render final PPTX previews and compare them to approved comps/source images. Run a final council review on rendered previews, final contact sheet, deck_spec.json, design_system.json, visual_contract.json, conversion_manifest.json, source_notes.md, and qa_report.md.
Final council roles:
content-integritytext-typographysource-data-verifierchart-logicasset-authenticitytemplate-fidelitywhen a template/source deck existscolor-brandstyle-coherencevisual-clarityaccessibility-readabilitylayout-pptx-feasibilityvisual-fidelitypptx-conversion-fidelityexecutive-polishtaste-directionnarrative-invariance
Blocking QA:
- final slide count and order match
deck_spec.json - all main text and numbers are visible and editable
- no full-slide or region-image layer is used as the primary slide
- every retained icon asset passed strict extraction plus Real-ESRGAN HD enhancement, or has a documented art-slice exception with feathered alpha preserved
- every named source pictogram is extracted or has a documented inseparable-art exception; all-vector icon redraws are blocking defects
- every slide/output deck has at least 10 real render-compare-fix rounds backed by distinct render files
qa_gate.py allpasses for the latest render and PPTX, and its real metrics support the fidelity claim- paired crops and region diff metrics support the fidelity claim without substituting hand-written blocking values
- no obvious typo, overflow, missing page number, malformed chart, or fake source remains
- final council roles have
approval_to_advance=true - no P0/P1 final council findings remain unless accepted in
user_decisions.md
Before final response, run check_pipeline_gates.py --stage final. If it fails, report the blocker or iterate.
Deliver:
- final editable
.pptx - preview contact sheet or rendered previews
- concise QA report with retained-image/art-slice exceptions, real
qa_gate.pynumbers, and any accepted text/data risks
Keep final deliverables under output/; keep internal prompts, measurements, crops, icon sheets, and render rounds in the workspace.
Reference Files
PITFALLS.md: required converter trap catalog.qa_gate.py: required mechanical QA gate for real render metrics, PPTX media/text audit, and distinct render-round audit.references/schemas.md: required intermediate JSON/Markdown files.references/object-audit.md: local text measurement, source-bound object inventories, and final assembly verification.references/scene-and-assets.md: declarative scene construction and controlled asset-sheet processing.references/prompt-templates.md: ImageGen, conversion-contract, and final-review prompts.references/subagent-rubrics.md: reviewer roles and feedback schema.references/taste-system.md: bundled PPT taste system and anti-generic rules.references/style-library.md: concrete style IDs for visual exploration.references/taste-integration.md: optional external taste-source supplement rules.
Boundaries
- Do not invent metrics, sources, logos, product screenshots, or official marks.
- Do not let ImageGen OCR output override the structured slide spec.
- Do not skip rendering previews before claiming the PPTX is finished.
- Do not ignore a supplied template or replace its visible system with self-designed layouts.
- Treat use of this skill for full ImageGen deck generation as authorization for bounded reviewer subagents described in
references/subagent-rubrics.md. Do not use page-owning subagents to generate final single-slide comps unless the user explicitly accepts style drift risk.


