{"id":"c9ae27ef-bfb6-449d-8386-c2715c248e44","slug":"literature-figure-svg","kind":"skill","name":"literature-figure-svg","summary":"A Codex/CC/AI agent skill for image-to-SVG reconstruction—turn literature figures, screenshots, diagrams, plots, and AI-generated elements into clean, high-resolution, editable SVG/PDF vector graphics","owner":"bossccc1999-hue","repoUrl":"https://github.com/bossccc1999-hue/literature-figure-svg","license":"0BSD","licenseTier":"permissive","trust":"community","stars":8,"match":null,"fewStars":false,"format":"skill","createdAt":"2026-08-23T08:36:01.000Z","addedAt":"2026-10-21T23:40:55.867Z","logoUrl":"https://avatars.githubusercontent.com/u/279251957?v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["design-media","files-documents"],"tags":[],"runtime":"binary","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-21T23:41:15.905Z","sample":false,"url":"https://conduits.dev/tools/literature-figure-svg","language":"Python","transports":["stdio"],"install":{},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"# literature-figure-svg\n\nA Codex skill for reconstructing literature figures, screenshots, diagrams, plots, and AI-generated schematic elements as editable SVG and native PowerPoint figures.\n\nThe default deliverables are **editable SVG, directly editable native PPTX, and a PNG preview**. A current request for SVG only takes precedence. Native PPTX contains shapes and text boxes, so editing does not depend on PowerPoint's SVG “Convert to Shape” importer.\n\nThis is a vector-redraw workflow, not a one-click bitmap tracer or an arbitrary PDF converter. Diagrams and charts can be rebuilt as native vector elements; microscopy, blots, pathology, photographs, and other empirical images remain raster panels with editable annotations. A PDF extension alone does not establish that its contents are vectors.\n\n## What it does\n\n- Routes diagrams, mechanisms, topology figures, and workflow panels to vector-first redraw guidance.\n- Routes plots and statistical panels to data-aware reconstruction guidance.\n- Inspects actual PDF text spans, vector drawing paths, and embedded images before choosing a reconstruction route.\n- Distinguishes fully editable vector elements from raster evidence such as microscopy, blots, pathology, or photos.\n- Provides a scaffold for reproducible packages with SVG, native PPTX, previews, metadata, and assumptions; PDF and publication exports can be added when needed.\n- Normalizes a controlled SVG subset into explicit geometry, with curve-based clipping, rounded shapes, arrowheads, and native PowerPoint gradients.\n- Audits editability and can create a temporary ungrouped PPTX only after verifying that every group has an identity coordinate mapping and no unsupported group appearance properties.\n- Records source provenance, data status, permissions, and the boundary between editable vectors and retained raster evidence.\n\n## Install\n\nClone the repository into your Codex skills directory:\n\n```bash\ngit clone https://github.com/bossccc1999-hue/literature-figure-svg.git ~/.codex/skills/literature-figure-svg\n```\n\nThen invoke it as `$literature-figure-svg`, or let Codex use it automatically when the request matches literature-figure SVG conversion.\n\nInstalling this repository installs the skill source, not its external runtimes. Requirements depend on the operation:\n\n| Operation | Runtime requirements |\n| --- | --- |\n| Project scaffold | Python 3.10 or newer |\n| PDF inventory | Python and PyMuPDF |\n| SVG normalization | Python with `lxml`, Node.js, and `@napi-rs/canvas` |\n| Native PPTX text base | Node.js and the host-provided `@oai/artifact-tool` runtime |\n| Native geometry assembly and SVG/PPTX audit | Python with `lxml` |\n| Rendering and application verification | An available renderer such as LibreOffice/Poppler; PowerPoint for an actual application roundtrip |\n| Implemented plotting stubs | Matplotlib |\n\n**`@oai/artifact-tool` is supplied by a compatible Codex host.** It is not bundled here, and this repository does not assume that it can be installed from the public npm registry. Discover the host's workspace dependencies and follow its installed presentations skill, including finalization requirements. `RUNTIME_NODE_MODULES`, `PPT_COMPAT_NODE`, and `PPT_COMPAT_CANVAS_MODULE` can point helpers to explicitly discovered runtime locations; see the [native PowerPoint workflow](references/native-powerpoint-workflow.md).\n\nWithout the host-provided presentation runtime, the independent scaffold, PDF inspection, normalization, and audit helpers can still be used when their own dependencies are available. Do not claim that the native PPTX pipeline ran in an environment where its authoring runtime is unavailable.\n\n## Start a project\n\n```bash\npython scripts/scaffold_svg_project.py --output-dir work --name example_figure --type multi-panel\n```\n\nAdd `--svg-only` to exclude the default native PPTX companion. The scaffold creates a plan and implementation stubs, not a finished figure. For PDF inspection:\n\n```bash\npython scripts/inspect_pdf.py source.pdf --output work/pdf_inventory.json\n```\n\nFollow the [native PowerPoint workflow](references/native-powerpoint-workflow.md) for normalization, native assembly, rendering, temporary ungrouping comparisons, and finalization. Helper-generated PPTX files are candidates until those checks are completed.\n\n## Main files\n\n- `SKILL.md`: skill entrypoint and routing rules.\n- `references/vector-redraw-workflow.md`: guidance for diagrams, mechanisms, flowcharts, topology, and schematic panels.\n- `references/data-plot-reconstruction.md`: guidance for plots and statistical figure panels.\n- `references/native-powerpoint-workflow.md`: compatibility strategy, supported subset, runtime configuration, and verification.\n- `scripts/scaffold_svg_project.py`: creates a reusable project folder for figure-redraw work.\n- `scripts/inspect_pdf.py`: inventories PDF objects without dumping article body text.\n- `scripts/normalize_svg.py`: prepares explicit vector geometry and text metadata.\n- `scripts/build_native_base.mjs` and `scripts/build_native_pptx.py`: create an authoring-runtime text base and add native editable geometry.\n- `scripts/audit_editability.py`: checks objects, references, media, and safe temporary group expansion.\n- `evals/evals.json` and `evals/fixtures/`: regression scenarios and small original synthetic fixtures.\n- `agents/openai.yaml`: display metadata for Codex.\n\n## Accuracy boundary\n\n- Exact vector recovery is only claimed for elements that are actually rebuilt and checked.\n- Values reconstructed from a plot are marked `digitized`; illustrative values are marked `synthetic/demo`.\n- Raw scientific images are not represented as fully vectorized evidence.\n- Normalization supports an explicit subset. Unsupported constructs must be handled deliberately; they are not permission to drop objects or silently rasterize a claimed vector result.\n- Native radial-gradient shading can approximate an SVG elliptical gradient. Visual checks and disclosure of material differences remain necessary.\n- XML counts, renderer comparisons, and actual PowerPoint operations provide different evidence. Do not claim an application test that was not performed or guarantee identical rendering across all Office versions.\n- PDF exports can contain renderer-created raster regions. Inspect the export before describing it as entirely vector.\n\n## Rights and authorship\n\n- This repository does not claim authorship of any source paper, published figure, dataset, or scientific result.\n- No source paper PDF, publisher figure, or user's figure is included. The bundled PDF/SVG fixtures are small original synthetic test documents, not scientific evidence or third-party visual assets.\n- The synthetic mixed-content fixture is not microscopy. The genuine-microscopy evaluation requires separately supplied, user-authorized empirical images.\n- Source citations and license or permission notes belong in each generated project's `assumptions.md`.\n- Users remain responsible for confirming whether their intended reuse, redistribution, or publication is permitted.\n\nRepository code, instructions, and original test fixtures are released under the [0BSD license](LICENSE), which does not require attribution. Source literature and user-supplied materials are not covered by that license. External runtimes and libraries retain their own licenses and terms; they are not vendored or relicensed by this repository. See the [attribution audit](ATTRIBUTION_AUDIT.md) for the historical and current review scopes.\n"}