SkillsGrove
SkillsGrove/Documentos de escritório/sbsndbdhdhssbsbdbbdbdndbddbdbb-debug/kimi-ppt-screenshot-rebuild/kimi-ppt-screenshot-rebuild

kimi-ppt-screenshot-rebuild

Instalação

$npx skills add https://github.com/sbsndbdhdhssbsbdbbdbdndbddbdbb-debug/kimi-ppt-screenshot-rebuild --skill kimi-ppt-screenshot-rebuild
$git clone --depth 1 https://github.com/sbsndbdhdhssbsbdbbdbdndbddbdbb-debug/kimi-ppt-screenshot-rebuild.git /tmp/kimi-ppt-screenshot-rebuild && mkdir -p ~/.claude/skills && cp -r /tmp/kimi-ppt-screenshot-rebuild/. ~/.claude/skills/kimi-ppt-screenshot-rebuild
Por favor, instale esta Agent Skill para mim: https://github.com/sbsndbdhdhssbsbdbbdbdndbddbdbb-debug/kimi-ppt-screenshot-rebuild/tree/9091d8951012caed28adad6606633ebef9cc9348/. Leia primeiro o SKILL.md e os scripts, e só a instale na minha pasta de skills depois de confirmar que é segura.

Resumo

Descrição original · MITReconstruct one or more reference slide screenshots as editable PowerPoint (.pptx) slides. Use when Kimi must analyze screenshot layout, separate native PPT elements from complex image assets, generate or preserve transparent visual assets, build PPTX with Python and OOXML when needed, and render-compare the result against the reference. Kimi adaptation of the Codex ppt-screenshot-rebuild skill.
O SKILL.md abaixo é reproduzido de sbsndbdhdhssbsbdbbdbdndbddbdbb-debug/kimi-ppt-screenshot-rebuild (commit 9091d89) sob a licença MIT. O texto não foi alterado; apenas os metadados do cabeçalho do arquivo foram omitidos, as imagens são exibidas como links e arquivos muito longos são truncados. Copyright 2026 Fred. Licença: LICENSE. Apenas o arquivo de instruções é exibido; consulte o repositório original para ver os scripts.

PPT Screenshot Rebuild

Rebuild slide screenshots as editable PPTX files. Keep ordinary text and geometry native; isolate complex visual components as assets only when native PowerPoint cannot reproduce them reliably.

Start

  1. Read references/development-roadmap.md to identify the current implementation phase and its gate.
  2. Read references/ppt-element-schema.md before creating a Slide Spec or Asset Manifest.
  3. Read references/asset-decision-rules.md before deciding whether any visual region becomes an asset.
  4. Confirm the reference image dimensions, intended slide aspect ratio, and delivery environment before building.

Required Artifacts

Create and preserve these artifacts for each reconstruction:

reference.png
analysis/visual-inventory.json
analysis/slide-spec.json
analysis/asset-manifest.json
analysis/asset-preparation-report.json
analysis/single-page-quality-gate.json
assets/
output/rebuilt.pptx
output/rendered.png
output/comparison-report.json

Keep element and asset IDs stable across all artifacts.

Execution Guard

Treat the reconstruction as a gated production run, not as a styling suggestion. Run scripts/validate_single_page_contract.py three times for every single-slide delivery:

python scripts/validate_single_page_contract.py --job-root <validation-folder> --stage plan
python scripts/prepare_assets.py --manifest analysis/asset-manifest.json --reference reference.png
python scripts/validate_single_page_contract.py --job-root <validation-folder> --stage assets
python scripts/validate_single_page_contract.py --job-root <validation-folder> --stage delivery

The plan gate must pass before construction. The assets gate must pass before placing approved Image2 assets. The delivery gate is run only after the PPTX has been rendered, compared, and manually reviewed. A failed gate means the slide is still a draft.

This applies in a fresh conversation too. Do not assume ImageGen is optional merely because the request does not restate the workflow: complete the visual inventory and record an image2-assets decision or a named no-image2 decision for every complex bitmap candidate.

Core Split

Before building any PPTX, split the reference into explicit inventories:

  • code-ppt: ordinary text, cards, tables, lines, simple shapes, simple icons, and simple diagrams that will be rebuilt as editable PowerPoint objects.
  • source-assets: source-faithful photos, small icons, logos, badges, and other visual components where exact reference pixels are preferred.
  • image2-assets: independent complex bitmap subjects that cannot be reliably reproduced as editable PPT objects and are allowed to be visually recreated or cleaned through image generation.
  • structure-assets: deterministic complex structures such as curved timelines, fishbones, circular process arrows, dashed connector systems, and grouped decorative linework that should be rebuilt as SVG/PNG or native geometry, not simplified into generic straight lines.

This split is part of the skill's main value. Do not skip it. A reconstruction that only crops screenshot fragments and overlays editable text has not completed this workflow unless every complex bitmap was reviewed and either placed in image2-assets or explicitly rejected from image2-assets for a recorded source-fidelity or deterministic-structure reason.

Workflow

1. Analyze Before Building

Do not build a PPT directly from an informal visual description. Produce a Slide Spec and an Asset Manifest first. Use reference-image pixels only for analysis bounds; let the compiler convert them into PowerPoint coordinates.

Identify:

  • slide background, grid, groups, and draw order;
  • background layers across the corners, edges, and intentional whitespace; do not mistake a low-contrast atmosphere for empty white;
  • editable text, shapes, lines, and simple diagrams;
  • composite panels such as medical tool cards, worksheets, dashboards, schedule cards, and forms; split their background, visual subject, structure marks, labels, and tables before assigning asset strategies;
  • independent complex visual regions;
  • source-fidelity requirements;
  • background category: native fill, source-preserved, re-creatable, or shared-context;
  • artistic text and brand marks;
  • image target bounds, crop behavior, and alpha requirements.
  • the code-ppt, source-assets, image2-assets, and structure-assets lists, including a decision reason and explicit image2_requirement for every complex bitmap and complex-structure candidate.

Write analysis/visual-inventory.json with those four lists, complex_bitmap_candidates, and no_image2_decisions. Every candidate must use image2_requirement: required | prohibited | not-applicable: cleanable/re-creatable complex icons, illustrations, and atmospheric backgrounds are required; exact people/photos/logos are prohibited; deterministic geometry is not-applicable. For a composite panel, also record its layer split: native_chrome, editable_elements, structure, and visual_subject_assets. This artifact is the authoritative decision record; an informal explanation in chat is not a substitute.

2. Decide Native Versus Asset

Use native-ppt for editable text, simple shapes, lines, and simple icons. Classify by visual identity as well as drawing complexity: a distinctive illustration, emblem, or semantic object remains an independent asset when replacing it with a generic primitive would change what the component is. Use an asset strategy only after applying the decision rules. Do not rasterize ordinary text or geometry merely to mimic a screenshot.

Do not preserve a composite medical/tool card as one screenshot asset merely because it is visually complex. First decompose it into the minimum faithful layers: source or generated visual subject, deterministic structure assets, editable labels, editable tables, and native card chrome. A whole-panel crop is allowed only when the user explicitly accepts locked appearance or when the panel is a strict source document whose readable marks must remain exact; record that editability loss in the decision notes.

For every candidate in image2-assets, write its purpose, target size, visual style, crop/framing requirement, alpha requirement, and negative constraints. If the bitmap contains readable words, labels, badges, or other authoritative text, remove that text from the raster plan and rebuild the wording as native editable PPT text above the generated/cleaned asset.

For every asset, record one reconstruction strategy:

  • crop-original
  • crop-and-remove-background
  • crop-and-remove-flat-background
  • crop-original-with-feathered-edges
  • crop-original-with-polygon-mask
  • crop-original-with-ellipse-mask
  • crop-original-with-rect-exclusion-masks
  • image2-generate
  • render-as-svg
  • background-image

3. Prepare Assets

Run scripts/prepare_assets.py to crop source-faithful assets, stage source crops for background removal, and write an image-generation job report. Preserve source-faithful subjects by cropping the reference or a supplied source image. Use background removal when the original subject must overlay another PPT layer. Use image generation only for an independent complex visual that may be visually recreated.

When an Asset Manifest contains image2-generate or a model-assisted crop-and-remove-background job, actually generate or edit the asset before building the PPTX. The generated source file, final PNG, and alpha validation record must exist. Do not leave an image2-assets item as a plan, placeholder, source screenshot crop, or empty box.

For nearby screenshot components that will be reconstructed separately, declare source_component_regions and each crop's source_exclusion_ids. Review analysis/source-crop-audit.png before building. Never accept a source crop that carries pixels belonging to another independently owned component merely because its PPT layer is behind that component.

For a fidelity-critical real photograph inside a composite panel, preserve the photograph as a strict source crop first. When only a few slide labels, title bars, or note boxes overlap the photo, use crop-original-with-rect-exclusion-masks to make exactly those crop-local rectangles transparent, then rebuild those overlays as native PPT elements. Do not use ImageGen merely because the photo sits inside a complex panel: ImageGen is for a visual that is allowed to change, not for replacing people, clinical scenes, products, or other reference-specific imagery.

Before finalizing a transparent title, word-art, thin-stroke, or glow crop, inspect whether its intended artwork approaches a crop edge. Add source_padding_px and expand the matching placement by the same amount when it does; never accept clipped glyphs merely because the PNG has transparency.

For small strict source icons, badges, and circular pictograms, default to high-fidelity source cropping because visual resemblance is usually more important than editability. Do not use aggressive color-key removal that can erase white highlights, pale blue details, or parts of the icon body. Prefer these routes in order: preserve the full source badge with crop-original; use crop-original-with-ellipse-mask for circular badges; use crop-original-with-polygon-mask for simple badge silhouettes; use deterministic SVG/native redraw only when a crop is too small, contaminated, or cannot pass visual inspection. Add safety padding, inspect the output at target size, and reject any icon whose body is clipped, softened, or visibly lower resolution than the reference. If a re-creatable icon fails this review because of crop contamination or insufficient detail, promote it to a required image2-assets item: generate an unlettered independent icon on #00ff00, remove chroma locally, and validate alpha. Never substitute Unicode, emoji, or a generic glyph for a reference icon.

Use the Kimi image_generation plugin skill as the primary image-generation path (request a flat #00ff00 chroma-key background, then convert to alpha locally). scripts/image2_asset.py is the legacy Codex/OpenAI API fallback (gpt-image-2 + OPENAI_API_KEY); it is not available in the Kimi environment and is kept only for reference. Do not claim an image2 asset was generated unless its output file exists. A required Image2 candidate must produce a real generated source, final project asset, and asset-preparation-report.json result before its PPT placement is allowed.

When generating an alpha asset through the Kimi image_generation skill, request a flat chroma-key background and convert it locally to a transparent PNG. Include negative constraints that exclude UI chrome, unrelated text, logos, buttons, status bars, and unwanted backgrounds. Do not use image generation to recreate logos, exact photos, brand products, or authoritative readable text.

The default alpha route for re-creatable complex foregrounds is mandatory once the asset is accepted into image2-assets: first generate on a flat #00ff00 chroma-key background, then remove the chroma key locally, save a transparent PNG in assets/, and place it through the Slide Spec. This route is preferred over accepting visible screenshot-crop rectangles. If a reconstruction contains no image2-assets despite visible complex bitmap candidates, write a candidate-by-candidate no-image2 decision record explaining why each complex bitmap is better handled as source-assets or structure-assets.

After generation, run scripts/record_asset_result.py to record the channel, generated source, final output, and alpha validation in the preparation report.

When an asset declares deterministic postprocess calibration, run scripts/calibrate_asset_image.py after generation and before recording the completed result. Use it to soften a regenerated background toward its declared integration color without changing alpha or asking Image2 to regenerate again.

4. Build The PPTX

Use Python and python-pptx for normal slide construction. Apply the specified font profile, map reference-pixel bounds to the target slide size, and add elements in ascending draw order. For editable Chinese text, explicitly write the East Asian OOXML typeface (a:ea) on every run so WPS/PowerPoint does not silently fall back to a serif font. Use other OOXML/XML only for an identified feature gap; keep each extension isolated and documented.

5. Render And Compare

Render with the delivery renderer whenever possible. Use scripts/render_ppt.py and scripts/compare_reference.py as described in references/render-and-compare.md. Calibrate both global and 3x3 regional thresholds; the page fails when any important region is out of tolerance even if its global average passes. Check text overflow, line wrapping, explicit weight and run-level emphasis for titles, values, and callouts, element position and size, background-layer completeness, background contrast, asset crop, alpha edges, contextual-crop blend edges, layer order, semantic identity of reconstructed symbols, and overall visual similarity. Correct the relevant source of truth: layout spec, font profile, asset, or OOXML feature.

6. Close Single-Page Quality

Use references/single-page-quality-gate.md before declaring a single slide complete. A slide is not accepted merely because a PPTX and rendered PNG exist. Reject the result and revise when:

  • a composite card, medical tool sheet, form, or diagram panel is represented by one large screenshot crop without a locked-source-panel decision;
  • an owned asset appears as a loose object outside its intended card or panel;
  • small icons are clipped, softened, substituted by generic symbols, visually detached from their paired labels, or have not passed their own alpha/target-size review;
  • an image2-assets candidate was skipped, or a candidate marked image2_requirement: required lacks a generated result;
  • editable text, tables, labels, or number markers that should be native are locked inside raster assets.

Write analysis/single-page-quality-gate.json after reviewing the rendered PNG at target size. Mark these checks explicitly: inventory complete, image2 decisions complete, approved Image2 outputs verified, small icons verified, structures verified, composite panels decomposed, editable elements verified, and rendered output reviewed. All checks must be true before delivery.

Non-Negotiable Rules

  • Separate reference-pixel coordinates from PPT physical coordinates.
  • Use explicit native-line endpoints for angled or reverse-direction connectors; do not encode direction through negative bbox dimensions.
  • Keep body text and ordinary titles editable unless the delivery requirement explicitly favors locked appearance.
  • Treat transparent PNG or SVG as an output format, not proof that image generation was used.
  • Do not bypass image2-assets review. Complex re-creatable bitmap subjects must either be generated/edited into real asset files or explicitly documented as source-faithful/rejected with a reason.
  • Do not flatten composite panels containing readable labels, tables, forms, number markers, or instructional copy into one screenshot asset unless the decision record explicitly accepts locked editability.
  • Preserve logos and brand marks from source files; never regenerate them.
  • Preserve strict source icons and badges with conservative masks; transparent output must not damage the icon body or reduce perceived clarity.
  • A generated rebuilt.pptx is only a draft until the single-page quality gate has been checked against the rendered PNG.
  • Disable inherited theme effects unless the Slide Spec explicitly asks for them.
  • Validate generated PPTX files in the target environment before declaring a reconstruction complete.

References

  • references/development-roadmap.md: implementation phases, gates, and resume state.
  • references/ppt-element-schema.md: required JSON fields and coordinate contract.
  • references/asset-decision-rules.md: visual-asset and artistic-text decision process.
  • references/image2-asset-workflow.md: asset review, prompt, generation, and validation procedure.
  • references/vector-asset-workflow.md: deterministic SVG/PNG route for complex decorative vectors and flat-background source icons.
  • references/render-and-compare.md: PowerPoint rendering, visual diagnostics, and threshold calibration.
  • references/single-page-quality-gate.md: final acceptance gate for one-slide reconstruction.
  • references/ooxml-recipes.md: create only when an OOXML extension is implemented.
Ver o texto completo da licença (MIT)
MIT License

Copyright (c) 2026 Fred

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.