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_thin_profile.py
View on GitHubfrom __future__ import annotations
import json
import subprocess
import sys
import tempfile
import unittest
from pathlib import Path
from support import SKILL_ROOT, SCRIPTS, write_json
class SingleRuntimeTests(unittest.TestCase):
def test_only_one_state_and_manifest_lifecycle_is_defined(self) -> None:
forbidden_files = [
"image2ppt_jobs.json",
"image2ppt_plan.json",
"source_reconstruction_plan.json",
"image2ppt_page_result.json",
]
runtime_text = "\n".join(
path.read_text(encoding="utf-8")
for root in (SKILL_ROOT / "cli", SKILL_ROOT / "scripts")
for path in root.rglob("*.py")
)
for name in forbidden_files:
self.assertNotIn(name, runtime_text)
self.assertTrue((SKILL_ROOT / "cli/image2ppt/runtime/deck_run_state.py").is_file())
self.assertTrue((SKILL_ROOT / "cli/image2ppt/runtime/paddle_text_hints.py").is_file())
self.assertTrue((SKILL_ROOT / "cli/image2ppt/runtime/text_hints.py").is_file())
def test_prompt_builder_is_complete_and_uses_absolute_local_cli(self) -> None:
with tempfile.TemporaryDirectory() as name:
run = Path(name)
page = run / "pages" / "page_001"
page.mkdir(parents=True)
source = page / "source.png"
source.write_bytes(b"fixture-path-only")
write_json(
run / "page_jobs.json",
{"schema_version": 1, "pages": [{"page_id": "page_001", "page_dir": "pages/page_001", "status": "pending"}]},
)
write_json(page / "page_request.json", {"source_image": str(source)})
out = page / "worker-prompt.md"
result = subprocess.run(
[sys.executable, str(SCRIPTS / "build_page_worker_prompt.py"), str(run), "--page", "page_001", "--out", str(out)],
text=True,
capture_output=True,
check=False,
)
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
payload = json.loads(result.stdout)
self.assertEqual(payload["state_owner"], "page_jobs.json")
self.assertEqual(Path(payload["prompt_template"]), SKILL_ROOT / "prompts" / "page-worker-base.md")
self.assertEqual(Path(payload["prompt_addendum"]), SKILL_ROOT / "prompts" / "page-worker.md")
prompt = out.read_text(encoding="utf-8")
self.assertIn("Rebuild one page for Image2PPT", prompt)
self.assertIn(str(SKILL_ROOT / "cli/image2ppt/cli.py"), prompt)
self.assertIn("Every non-text foreground visual object must be separated", prompt)
self.assertIn("Execute the three steps in order", prompt)
self.assertIn("Do not invent an object-source strategy", prompt)
self.assertIn("Put icons/foreground objects onto one sparse asset sheet", prompt)
self.assertIn("Replace only the base prompt's final page build/validate sequence", prompt)
self.assertIn("3-5 semantic regions", prompt)
self.assertIn("image2ppt_region_decomposition", prompt)
self.assertIn("every node center/size and every edge endpoint/direction", prompt)
self.assertIn("complex local subparts that would visibly drift", prompt)
self.assertNotIn("{{RUN_DIR}}", prompt)
self.assertNotIn("{{CLI}}", prompt)
def test_skill_declares_local_owners_and_final_gate(self) -> None:
skill = (SKILL_ROOT / "SKILL.md").read_text(encoding="utf-8")
self.assertIn("`page_jobs.json` as the only page-state source", skill)
self.assertIn("`pages/page_NNN/manifest.json` as the only page-content source", skill)
self.assertIn("PADDLE_OCR_TOKEN", skill)
self.assertIn("builtin-ink", skill)
self.assertIn("run_final_image2ppt_qa.py", skill)
self.assertIn("measured compound diagrams", skill.lower())
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 |