Skip to content

bestdeejay-design/agent-skills / skills/presentation-maker

presentation-maker

Verified

End-to-end presentations from a topic — outline -> JSON spec -> 16:9 HTML slides (with mandatory Playwright verification) and real .pptx (full 14-type design system), plus strategy presets, PDF export, and deck-quality audits. One command per stage.

FileKindSize
SKILL.mdskill md20.8 KB
evals/evals.jsonconfig731 B
examples/cases/lovii-pitch/case.jsonconfig581 B
examples/cases/lovii-pitch/deck.jsonconfig7.8 KB
examples/cases/lovii-pitch/slides.htmlother46.2 KB
examples/demo/demo_deck.jsonconfig7.9 KB
examples/demo_deck.jsonconfig7.9 KB
readme.ru.mdmarkdown4.5 KB
references/audit.mdmarkdown7.3 KB
references/bento.mdmarkdown20.4 KB
references/design-system.mdmarkdown7.2 KB
references/pdf.mdmarkdown2.5 KB
references/product-designer.mdmarkdown11.2 KB
references/references.mdmarkdown489 B
references/strategy.mdmarkdown7.7 KB
scripts/build_bento.pyscript61.9 KB
scripts/build_html.pyscript41.2 KB
scripts/build_pdf.pyscript5.9 KB
scripts/build_pptx.pyscript46.4 KB
scripts/cases.pyscript2.7 KB
scripts/composer.pyscript12.4 KB
scripts/content_profile.pyscript4.6 KB
scripts/creative_brief.pyscript7.4 KB
scripts/deck_audit.pyscript17.0 KB
scripts/deck_md.pyscript22.7 KB
scripts/fit_solver.pyscript7.5 KB
scripts/patterns.pyscript3.4 KB
scripts/polish.pyscript4.0 KB
scripts/qa_bento.pyscript34.7 KB
scripts/qa_intern.pyscript5.8 KB
scripts/qa_pptx.pyscript8.6 KB
scripts/strategy.pyscript9.8 KB
scripts/verify_slides.pyscript5.4 KB
scripts/vision_qa.pyscript9.0 KB
skill.jsonconfig2.1 KB
templates/base.htmlother54.7 KB
templates/icons/arrow-right.svgother128 B
templates/icons/award.svgother211 B
templates/icons/bot.svgother212 B
templates/icons/briefcase.svgother233 B
templates/icons/building.svgother171 B
templates/icons/chart.svgother197 B
templates/icons/family.svgother240 B
templates/icons/graduation.svgother163 B
templates/icons/presentation.svgother256 B
templates/icons/users.svgother240 B
templates/icons/zap.svgother188 B
templates/pattern-css/before-after.cssother285 B
templates/pattern-css/big-type.cssother390 B
templates/pattern-css/card-dashboard.cssother552 B
templates/pattern-css/cyclic-process.cssother702 B
templates/pattern-css/data-story.cssother611 B
templates/pattern-css/editorial-asym.cssother787 B
templates/pattern-css/hero-left.cssother697 B
templates/pattern-css/quote-hero.cssother533 B
templates/pattern-css/recap-grid.cssother461 B
templates/pattern-css/soft-shapes.cssother1.0 KB
templates/pattern-css/sparkline-metric.cssother534 B
templates/pattern-css/split-diagonal.cssother547 B
templates/pattern-css/split-frame.cssother841 B
templates/pattern-css/swiss-grid.cssother1.0 KB
templates/pattern-css/vertical-rail.cssother2.1 KB
templates/pattern-css/vertical-stepper.cssother882 B
templates/pattern-css/z-pattern.cssother750 B
templates/pattern-css/zigzag-timeline.cssother312 B
templates/patterns/before-after.jsonconfig1.1 KB
templates/patterns/big-type.jsonconfig1.1 KB
templates/patterns/card-dashboard.jsonconfig1.1 KB
templates/patterns/cyclic-process.jsonconfig990 B
templates/patterns/data-story.jsonconfig1.1 KB
templates/patterns/editorial-asym.jsonconfig1.2 KB
templates/patterns/hero-left.jsonconfig1.2 KB
templates/patterns/quote-hero.jsonconfig1.1 KB
templates/patterns/recap-grid.jsonconfig978 B
templates/patterns/soft-shapes.jsonconfig1.1 KB
templates/patterns/sparkline-metric.jsonconfig1017 B
templates/patterns/split-diagonal.jsonconfig1.2 KB
templates/patterns/split-frame.jsonconfig1.1 KB
templates/patterns/swiss-grid.jsonconfig1.2 KB
templates/patterns/vertical-rail.jsonconfig1.1 KB
templates/patterns/vertical-stepper.jsonconfig1.0 KB
templates/patterns/z-pattern.jsonconfig1.1 KB
templates/patterns/zigzag-timeline.jsonconfig1004 B
templates/themes/dynamic.jsonconfig520 B
templates/themes/executive.jsonconfig526 B
templates/themes/general.jsonconfig515 B
templates/themes/lovii.jsonconfig647 B
templates/themes/modern.jsonconfig546 B
templates/themes/momentum.jsonconfig508 B
templates/themes/neo-consulting.jsonconfig862 B
templates/themes/standard.jsonconfig605 B
templates/themes/swift.jsonconfig552 B

scripts/qa_pptx.py

View on GitHub
#!/usr/bin/env python3
"""Geometric QA for presentation-maker .pptx decks.

Checks every slide of a deck generated by build_pptx.py:
  * bounds   — every shape must stay inside the 1600x900 design canvas;
  * content  — content shapes must not end lower than BOTTOM_STOP (80px from bottom);
  * overlap  — text-bearing shapes must not intersect each other;
  * tables   — tables must fit the canvas and have positive cell sizes.

Design elements (ghost-num, decor ovals, chrome logo/page indicator) are
exempt from bounds/content checks by name prefix: `ghost*`, `decor*`, `chrome-*`.

Optionally renders the deck to JPEGs via LibreOffice (soffice -> PDF -> pdftoppm)
so the human (or a vision-capable agent) can eyeball it.

Usage:
  python3 qa_pptx.py deck.pptx [--render] [--out dir] [--json report.json]
Exit codes: 0 = clean, 1 = issues found, 2 = error.
"""
from __future__ import annotations

import argparse
import json
import shutil
import subprocess
import sys
import tempfile
from pathlib import Path

try:
    from pptx import Presentation
    from pptx.util import Emu
except ImportError:
    sys.exit("qa_pptx.py requires python-pptx: pip install python-pptx")

PX = 7620                       # EMU per design pixel (same constant as build_pptx.py)
W, H = 1600, 900                # design canvas, px
BOTTOM_STOP = 80                # content must not end lower than this, px
OVERLAP_TOLERANCE = 2           # px of intersection allowed before flagging

EXEMPT_BOUNDS_PREFIXES = ("ghost", "decor", "chrome-")
EXEMPT_OVERLAP_PREFIXES = ("ghost", "decor", "chrome-", "hairline")


def _px(emu) -> float:
    """EMU -> design px."""
    return emu / PX


def _shape_rect(shape):
    """Return (x, y, w, h) in design px for a shape, or None if unpositioned."""
    try:
        if shape.left is None or shape.top is None:
            return None
        return (
            _px(shape.left), _px(shape.top),
            _px(shape.width), _px(shape.height),
        )
    except Exception:
        return None


def _is_exempt(name: str, prefixes) -> bool:
    for p in prefixes:
        if name.lower().startswith(p):
            return True
    return False


def _has_text(shape) -> bool:
    if shape.has_text_frame:
        text = shape.text_frame.text.strip()
        if text:
            return True
    if shape.shape_type == 19:  # TABLE
        return True
    return False


def _rects_overlap(a, b, tol=OVERLAP_TOLERANCE) -> bool:
    ax, ay, aw, ah = a
    bx, by, bw, bh = b
    return not (
        ax + aw - tol <= bx or bx + bw - tol <= ax
        or ay + ah - tol <= by or by + bh - tol <= ay
    )


def _check_slide(slide, idx: int, issues: list):
    slide_issues = []
    shapes = list(slide.shapes)

    # Pass 1: bounds + content bottom.
    for shp in shapes:
        name = shp.name or "?"
        rect = _shape_rect(shp)
        if rect is None:
            continue
        x, y, w, h = rect
        if _is_exempt(name, EXEMPT_BOUNDS_PREFIXES):
            continue
        if x < -1 or y < -1 or x + w > W + 1 or y + h > H + 1:
            slide_issues.append({
                "kind": "bounds",
                "name": name,
                "message": (f"shape outside canvas: x={x:.0f} y={y:.0f} "
                            f"w={w:.0f} h={h:.0f} (canvas {W}x{H})"),
            })
        if y + h > H - BOTTOM_STOP + 1:
            slide_issues.append({
                "kind": "content",
                "name": name,
                "message": (f"content ends at y={y + h:.0f}px, lower than "
                            f"BOTTOM_STOP ({H - BOTTOM_STOP}px from top)"),
            })

    # Pass 2: overlap between text-bearing, non-exempt shapes.
    texts = []
    for shp in shapes:
        name = shp.name or "?"
        if _is_exempt(name, EXEMPT_OVERLAP_PREFIXES):
            continue
        rect = _shape_rect(shp)
        if rect is None or not _has_text(shp):
            continue
        texts.append((name, rect))

    for i in range(len(texts)):
        for j in range(i + 1, len(texts)):
            n1, r1 = texts[i]
            n2, r2 = texts[j]
            if _rects_overlap(r1, r2):
                slide_issues.append({
                    "kind": "overlap",
                    "name": f"{n1} <-> {n2}",
                    "message": (f"text shapes overlap: {n1} {tuple(round(v) for v in r1)} "
                                f"vs {n2} {tuple(round(v) for v in r2)}"),
                })

    # Pass 3: tables fit canvas.
    for shp in shapes:
        if not shp.has_table:
            continue
        rect = _shape_rect(shp)
        if rect is None:
            continue
        x, y, w, h = rect
        if w <= 0 or h <= 0:
            slide_issues.append({"kind": "table", "name": shp.name,
                                 "message": "table has zero size"})
        if x < -1 or y < -1 or x + w > W + 1 or y + h > H + 1:
            slide_issues.append({"kind": "table", "name": shp.name,
                                 "message": "table exceeds canvas bounds"})

    for issue in slide_issues:
        issue["slide"] = idx + 1
        issues.append(issue)


def _render(pptx_path: Path, out_dir: Path) -> list:
    """Render deck to JPEGs via LibreOffice + pdftoppm. Returns render errors."""
    errors = []
    soffice = shutil.which("soffice") or shutil.which("libreoffice")
    pdftoppm = shutil.which("pdftoppm")
    if not soffice or not pdftoppm:
        errors.append("render skipped: soffice or pdftoppm not found in PATH")
        return errors

    with tempfile.TemporaryDirectory() as tmp:
        tmp = Path(tmp)
        try:
            subprocess.run(
                [soffice, "--headless", "--convert-to", "pdf",
                 "--outdir", str(tmp), str(pptx_path)],
                check=True, capture_output=True, timeout=120,
            )
        except (subprocess.CalledProcessError, subprocess.TimeoutExpired) as e:
            errors.append(f"soffice conversion failed: {e}")
            return errors

        pdf = tmp / (pptx_path.stem + ".pdf")
        if not pdf.exists():
            errors.append("soffice produced no PDF")
            return errors

        out_dir.mkdir(parents=True, exist_ok=True)
        try:
            subprocess.run(
                [pdftoppm, "-jpeg", "-r", "100", str(pdf), str(out_dir / "slide")],
                check=True, capture_output=True, timeout=120,
            )
        except (subprocess.CalledProcessError, subprocess.TimeoutExpired) as e:
            errors.append(f"pdftoppm failed: {e}")
            return errors

        n = len(list(out_dir.glob("slide-*.jpg")))
        if n == 0:
            errors.append("render produced no JPEGs")
    return errors


def main() -> int:
    ap = argparse.ArgumentParser(description="Geometric QA for presentation-maker .pptx")
    ap.add_argument("pptx", help="path to .pptx deck")
    ap.add_argument("--render", action="store_true",
                    help="render slides to JPEGs (LibreOffice + pdftoppm)")
    ap.add_argument("--out", default=None, help="dir for render output (default: qa/ next to deck)")
    ap.add_argument("--json", default=None, help="write machine-readable report to this path")
    args = ap.parse_args()

    pptx_path = Path(args.pptx)
    if not pptx_path.exists():
        print(f"error: {pptx_path} not found", file=sys.stderr)
        return 2

    try:
        prs = Presentation(str(pptx_path))
    except Exception as e:
        print(f"error: cannot open deck: {e}", file=sys.stderr)
        return 2

    issues: list = []
    for idx, slide in enumerate(prs.slides):
        _check_slide(slide, idx, issues)

    errors = [i for i in issues if i["kind"] in ("bounds", "overlap", "table")]
    warnings = [i for i in issues if i["kind"] == "content"]

    report = {
        "deck": str(pptx_path),
        "slides": len(prs.slides._sldIdLst),  # count of slides
        "issues": issues,
        "counts": {"errors": len(errors), "warnings": len(warnings), "total": len(issues)},
        "verdict": "PASS" if not errors else "FAIL",
    }

    if args.render:
        out_dir = Path(args.out) if args.out else pptx_path.parent / "qa"
        report["render"] = _render(pptx_path, out_dir)

    if args.json:
        Path(args.json).write_text(json.dumps(report, ensure_ascii=False, indent=2),
                                   encoding="utf-8")

    print(f"{report['verdict']}  {len(prs.slides)} slides, "
          f"{len(errors)} errors, {len(warnings)} warnings")
    for issue in issues:
        loc = f"[slide {issue['slide']}]"
        print(f"  {issue['kind']:9s} {loc} {issue['name']}: {issue['message']}")
    if "render" in report:
        for line in report["render"]:
            print(f"  render: {line}")

    return 0 if not errors else 1


if __name__ == "__main__":
    sys.exit(main())
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall