Skip to content

yzsp-studio/mediakit-shared-suite / artifact-preview

artifact-preview

Verified

Render workspace artifacts (pdf/pptx/docx/xlsx/html/png/jpg/txt/zip) into text + page screenshots + thumbnail + multi-page collages, saved under ./.preview/{hash}/. Use Read on the resulting jpg/png files to visually inspect your own deliverables before delivering them; it catches what a structural checker cannot — text truncation, colour clashes, clipped chart titles, layout drift, blank slides, CJK rendered as boxes. Triggered by: "看看产物长什么样", "视觉自检", "preview pptx", "render artifact", "screenshot pdf", "渲染产物", "我的报告画出来好看吗", "图表是否完整".

FileKindSize
README.mdmarkdown7.6 KB
SKILL.mdskill md10.1 KB
bin/previewother2.0 KB
bin/preview.cmdscript482 B
lib/__init__.pyscript1.7 KB
lib/_common.pyscript13.1 KB
lib/_types.pyscript3.5 KB
lib/cache.pyscript3.3 KB
lib/cli.pyscript10.2 KB
lib/collage.pyscript4.6 KB
lib/dispatch.pyscript8.3 KB
lib/docx.pyscript1.1 KB
lib/html.pyscript2.1 KB
lib/image.pyscript1.4 KB
lib/manifest.pyscript2.7 KB
lib/pdf.pyscript2.2 KB
lib/pptx.pyscript2.5 KB
lib/render/__init__.pyscript2.4 KB
lib/render/collage.pyscript10.9 KB
lib/render/constants.pyscript1.4 KB
lib/render/docx.pyscript2.2 KB
lib/render/html.pyscript12.4 KB
lib/render/pdf.pyscript3.4 KB
lib/render/pptx.pyscript5.6 KB
lib/render/types.pyscript1.3 KB
lib/render/xlsx.pyscript2.9 KB
lib/text.pyscript1.4 KB
lib/xlsx.pyscript1.1 KB
lib/zip_.pyscript1.4 KB
requirements.txtmanifest4.2 KB

lib/__init__.py

View on GitHub
"""artifact-preview hub library.

Public surface (reachable as ``from lib import ...`` once
``bin/preview`` adds the hub root to ``sys.path``):

* :class:`_types.Manifest` / :class:`_types.RenderOptions` etc — the
  on-disk manifest schema models.
* :func:`dispatch.render` / :func:`dispatch.detect_kind` — the public
  entrypoint used by both the CLI and any external Python consumer.
* :mod:`render` — pure rendering primitives (text + per-page PNG +
  collage) shared with ``swalm.core.utils.artifact_render`` on the host
  side via re-export.
"""

from . import render  # re-export sub-package for ``from lib import render``
from ._common import (
    ArtifactPreviewError,
    ErrCode,
    emit,
    err,
    lazy_import,
    ok,
)
from ._types import (
    KIND_DOCX,
    KIND_HTML,
    KIND_IMAGE,
    KIND_PDF,
    KIND_PPTX,
    KIND_TEXT,
    KIND_UNKNOWN,
    KIND_XLSX,
    KIND_ZIP,
    CollageEntry,
    Manifest,
    PageImage,
    RenderOptions,
)
from .cache import compute_source_hash, default_output_root, resolve_output_dir
from .dispatch import detect_kind, parse_page_range, render as dispatch_render
from .manifest import load_manifest, write_manifest

__all__ = [
    "ArtifactPreviewError",
    "CollageEntry",
    "ErrCode",
    "KIND_DOCX",
    "KIND_HTML",
    "KIND_IMAGE",
    "KIND_PDF",
    "KIND_PPTX",
    "KIND_TEXT",
    "KIND_UNKNOWN",
    "KIND_XLSX",
    "KIND_ZIP",
    "Manifest",
    "PageImage",
    "RenderOptions",
    "compute_source_hash",
    "default_output_root",
    "detect_kind",
    "dispatch_render",
    "emit",
    "err",
    "lazy_import",
    "load_manifest",
    "ok",
    "parse_page_range",
    "render",
    "resolve_output_dir",
    "write_manifest",
]

__version__ = "0.1.0"
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall