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/fit_solver.py

View on GitHub
#!/usr/bin/env python3
"""fit_solver — геометрическая гарантия до рендера (Слой 3).

Для каждого слайда с параметрами от composer.py измеряет реальную геометрию
текста в headless-Chromium (bbox-пересечения, заполненность, переносы) и либо
подтверждает fit, либо возвращает composer.py на повторный выбор с
исключённой опцией (детерминированный retry). Чистая геометрия, без LLM.

Использование (через build_html.py):
    fit, report = fit_solver.check_slide(html_fragment, slide_index, geometry)
"""
import json
import sys
from pathlib import Path

MIN_FILL = 0.15   # контент не может занимать < 15% площади (кроме dominant)
MAX_FILL = 0.85   # и > 85% (тесно)
MAX_ATTEMPTS = 5


def _render_and_measure(fragments: list[str], viewport=(1600, 900), base_css: str = "") -> list[dict]:
    """Отрендерить фрагменты в headless-Chromium и вернуть bbox ключевых блоков.

    base_css — реальный CSS деки (base.html + composition CSS + активный
    паттерн), передаётся вызывающей стороной (build_html.py). Без него
    измерение бессмысленно: карточки/сетки полагаются на .metrics-grid,
    .col-card и т.д., которые задаёт именно этот CSS, а не заглушка —
    на голых тегах все карточки схлопываются в одну точку и дают ложные
    "overlaps"/fill-провалы на КАЖДОМ слайде."""
    try:
        from playwright.sync_api import sync_playwright
    except ImportError:
        print("fit_solver: playwright недоступен — проверка пропущена", file=sys.stderr)
        return []
    fallback_css = (
        ".slide{position:relative;width:1600px;height:900px;overflow:visible;"
        "display:flex;flex-direction:column;justify-content:center;align-items:center;}"
        "h1,h2{font-size:44px;}h2{font-size:44px;}"
        ".bullet-list li{font-size:18px;line-height:1.5;}"
        ".metric-card{font-size:20px;padding:20px;}"
    )
    style_block = base_css or fallback_css
    results = []
    with sync_playwright() as p:
        browser = p.chromium.launch()
        page = browser.new_page(viewport={"width": viewport[0], "height": viewport[1]})
        for frag in fragments:
            page.set_content(
                f'<div id="deck">{frag}</div>'
                f"<style>{style_block}</style>"
            )
            page.wait_for_timeout(100)
            data = page.evaluate("""() => {
                const slide = document.getElementById('deck');
                const title = slide.querySelector('h1, h2');
                const content = slide.querySelector('.bullet-list, .metrics-grid, .spread-grid, '
                    + '.bars-block, .fact-grid, .menu-block, .ladder-block, .stats-block, '
                    + '.steps, .timeline, .table-wrap, .col-card');
                const boxes = [];
                const push = (el, name) => {
                    if (!el) return;
                    const r = el.getBoundingClientRect();
                    boxes.push({name, x: r.x, y: r.y, w: r.width, h: r.height});
                };
                push(title, 'title');
                push(content, 'content');
                // "карточки" — только повторяющиеся визуальные единицы верхнего
                // уровня (metric-card/col-card/...); голый <li> учитывается,
                // ТОЛЬКО если он не вложен внутрь уже выбранной карточки —
                // иначе li внутри .col-card «перекрывает» свой же контейнер
                // и даёт ложные overlaps на каждом comparison-слайде.
                const cardSel = '.metric-card, .col-card, .step-card, .tl-card';
                const cardEls = Array.from(slide.querySelectorAll(cardSel));
                cardEls.forEach((c, i) => push(c, 'card' + i));
                if (cardEls.length === 0) {
                    slide.querySelectorAll('li').forEach((c, i) => push(c, 'card' + i));
                }
                return boxes;
            }""")
            results.append(data)
        browser.close()
    return results


def _overlaps(a: dict, b: dict) -> bool:
    ox = min(a["x"] + a["w"], b["x"] + b["w"]) - max(a["x"], b["x"])
    oy = min(a["y"] + a["h"], b["y"] + b["h"]) - max(a["y"], b["y"])
    return ox > 4 and oy > 4


def _fails(measure: dict, geometry: dict, is_dominant: bool) -> list[str]:
    """Вернуть список нарушений fit для одного слайда."""
    issues = []
    title = next((b for b in measure if b["name"] == "title"), None)
    content = next((b for b in measure if b["name"] == "content"), None)
    cards = [b for b in measure if b["name"].startswith("card")]

    if title and content and _overlaps(title, content):
        issues.append("title overlaps content")
    # пересечения между карточками
    for i in range(len(cards)):
        for j in range(i + 1, len(cards)):
            if _overlaps(cards[i], cards[j]):
                issues.append(f"card{i} overlaps card{j}")
    # заполненность контента (кроме dominant/climax — там воздух часть брифа)
    if content and not is_dominant:
        area = content["w"] * content["h"]
        slide_area = 1600 * 900
        fill = area / slide_area
        if fill < MIN_FILL:
            issues.append(f"content fill {fill:.0%} < {MIN_FILL:.0%}")
        if fill > MAX_FILL:
            issues.append(f"content fill {fill:.0%} > {MAX_FILL:.0%}")
    # перенос заголовка: короткий заголовок не должен падать в 3+ строки
    if title and geometry.get("title_word_count", 99) < 8:
        if title["h"] > 200:
            issues.append("short title wraps to 3+ lines — title_scale too big")
    return issues


def check_slide(html_fragment: str, geometry: dict, is_dominant: bool = False,
                base_css: str = "") -> tuple[bool, list[str]]:
    """Проверить fit одного слайда. True = помещается.

    base_css — реальный CSS деки (см. _render_and_measure); без него
    результаты недостоверны."""
    # слайд без контента вовсе (bridge/statement — только заголовок) — не
    # применяем MIN_FILL, пустота тут осознанная (см. content_profile: role=bridge)
    is_empty_by_design = not any(geometry.get(k, 0) for k in
                                 ("bullet_count", "metric_count", "column_count", "step_count"))
    measured = _render_and_measure([html_fragment], base_css=base_css)
    if not measured:
        return True, []  # нет playwright — пропускаем (не блокируем)
    fails = _fails(measured[0], geometry, is_dominant or is_empty_by_design)
    return (not fails, fails)


if __name__ == "__main__":
    print("fit_solver: модуль измерения геометрии (вызывается из build_html.py)")
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