Yuan1z0825/nature-skills / skills/nature-image2ppt
nature-image2ppt
FlaggedReconstruct slide images, screenshots, scanned PDFs, or image-only PPTX files as object-level editable PowerPoint. Use for 图片转可编辑PPT、截图还原PPT and diagram reconstruction; not authoring a new deck from research notes.
tests/test_visual_review_runtime.py
View on GitHubfrom __future__ import annotations
import json
import subprocess
import sys
import tempfile
import unittest
from pathlib import Path
from support import SCRIPTS, build_page, complete_visual_review_evidence, filled_arrow_manifest
sys.path.insert(0, str(SCRIPTS))
from visual_review_evidence import expected_page, validate_evidence # noqa: E402
class VisualReviewRuntimeTests(unittest.TestCase):
"""Integration tests that require a real PowerPoint or LibreOffice renderer."""
def test_generic_review_notes_do_not_pass_without_structured_evidence(self) -> None:
with tempfile.TemporaryDirectory() as name:
page = Path(name)
filled_arrow_manifest(page)
build_page(page)
result = subprocess.run(
[
sys.executable,
str(SCRIPTS / "run_image2ppt_qa.py"),
str(page),
"--visual-review-status",
"reviewed",
"--visual-review-notes",
"looks good",
],
text=True,
capture_output=True,
check=False,
)
self.assertEqual(result.returncode, 2, result.stdout + result.stderr)
report = json.loads((page / "image2ppt_qa.json").read_text(encoding="utf-8"))
self.assertFalse(report["passed"])
self.assertTrue(any("visual review evidence" in error for error in report["errors"]))
def test_evidence_hashes_bind_review_to_current_render(self) -> None:
with tempfile.TemporaryDirectory() as name:
page = Path(name)
manifest_path = filled_arrow_manifest(page)
build_page(page)
pending = subprocess.run(
[sys.executable, str(SCRIPTS / "run_image2ppt_qa.py"), str(page)],
text=True,
capture_output=True,
check=False,
)
self.assertEqual(pending.returncode, 2, pending.stdout + pending.stderr)
evidence = page / "visual-review-evidence.json"
complete_visual_review_evidence(
page / "visual-review-evidence.template.json", evidence
)
payload = json.loads(evidence.read_text(encoding="utf-8"))
payload["pages"][0]["rendered_sha256"] = "0" * 64
evidence.write_text(json.dumps(payload), encoding="utf-8")
expected = [
expected_page(
page_id=page.name,
source=page / "source.png",
rendered=page / "render" / "rendered.png",
manifest=json.loads(manifest_path.read_text(encoding="utf-8")),
)
]
_payload, errors = validate_evidence(evidence, expected)
self.assertTrue(any("rendered_sha256" in error for error in errors))
if __name__ == "__main__":
unittest.main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |