K-Dense-AI/scientific-agent-skills / skills/pptx-posters
pptx-posters
VerifiedCreates and audits editable scientific posters in macro-free PowerPoint (.pptx) from author-approved local content and assets. Used when the requested deliverable is a PowerPoint research/conference poster and exact physical, printer, accessibility, provenance, and package-security checks are required.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 12.2 KB |
| assets/generation_dependencies.json | config | 70 B |
| assets/poster_manifest_template.json | config | 4.4 KB |
| assets/poster_quality_checklist.md | markdown | 8.5 KB |
| references/manifest_spec.md | markdown | 9.2 KB |
| references/poster_content_guide.md | markdown | 7.6 KB |
| references/poster_design_principles.md | markdown | 10.3 KB |
| references/poster_layout_design.md | markdown | 8.4 KB |
| references/pptx_security.md | markdown | 8.7 KB |
| references/security_validation.md | markdown | 4.3 KB |
| references/source_ledger.md | markdown | 14.5 KB |
| scripts/_common.py | script | 13.2 KB |
| scripts/_manifest.py | script | 45.7 KB |
| scripts/_pptx.py | script | 53.3 KB |
| scripts/check_layout.py | script | 5.8 KB |
| scripts/check_palette.py | script | 4.7 KB |
| scripts/generate_poster.py | script | 15.0 KB |
| scripts/inspect_pptx.py | script | 1.2 KB |
| scripts/inventory_images.py | script | 9.4 KB |
| scripts/plan_export.py | script | 9.0 KB |
| scripts/validate_manifest.py | script | 1.6 KB |
scripts/check_layout.py
View on GitHub#!/usr/bin/env python3
"""Check PPTX shape bounds, overlap, reading order, and final font size."""
from __future__ import annotations
import argparse
import math
import sys
from typing import Any
from _common import CliError, emit_json
from _manifest import load_and_validate_manifest
from _pptx import analyze_layout
def _positive_float(value: str) -> float:
try:
number = float(value)
except ValueError as exc:
raise argparse.ArgumentTypeError("expected a number") from exc
if not math.isfinite(number) or number <= 0:
raise argparse.ArgumentTypeError("value must be finite and greater than zero")
return number
def build_parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser(
description=(
"Inspect direct PPTX shape bounding boxes for overlap and out-of-bounds "
"placement, list package reading order, and screen explicit font sizes "
"at final print scale. No rendering or network access occurs."
)
)
parser.add_argument("pptx", help="local macro-free .pptx file")
source = parser.add_mutually_exclusive_group()
source.add_argument(
"--manifest",
help="approved poster manifest supplying print scale and font requirement",
)
source.add_argument(
"--print-scale",
type=_positive_float,
default=None,
help="physical-artboard/canvas scale when no manifest is supplied",
)
parser.add_argument(
"--minimum-font-pt-final",
type=_positive_float,
help=(
"final-output font threshold; default is manifest value or an explicit "
"18 pt project heuristic"
),
)
parser.add_argument("--output", help="optional new JSON report path")
return parser
def _manifest_settings(path: str) -> tuple[float, float, dict[str, Any]]:
_, document, validation = load_and_validate_manifest(
path,
verify_assets=False,
require_approval=True,
)
scale = float(validation["physical_output"]["print_scale"])
minimum = float(document["quality"]["minimum_font_pt_final"])
basis = {
"kind": document["quality"]["font_guidance_basis"],
"source_id": document["quality"]["font_guidance_source_id"],
}
return scale, minimum, {
"document": document,
"validation": validation,
"font_basis": basis,
}
def apply_manifest_checks(
report: dict[str, Any],
document: dict[str, Any],
validation: dict[str, Any],
) -> None:
"""Append approved-canvas and direct reading-order mismatches to a report."""
expected = validation["canvas"]
actual = report["slide_size"]
if (
abs(float(expected["width_in"]) - float(actual["width_in"])) > 0.001
or abs(float(expected["height_in"]) - float(actual["height_in"])) > 0.001
):
report["issues"].append(
{
"code": "CANVAS_MISMATCH",
"message": "PPTX slide dimensions do not match the approved manifest",
"expected": expected,
"actual": actual,
}
)
expected_order = [
{
"order": int(element["reading_order"]),
"name": (
f"R{int(element['reading_order']):03d}_"
f"{'TEXT' if element['type'] == 'text' else 'IMAGE'}_"
f"{element['id']}"
),
}
for element in document["elements"]
]
actual_order = (
report["slides"][0]["reading_order"] if report["slides"] else []
)
if actual_order != expected_order:
report["issues"].append(
{
"code": "READING_ORDER_MISMATCH",
"message": (
"direct PPTX shape order/names do not match the approved manifest"
),
"expected": expected_order,
"actual": actual_order,
}
)
def main(argv: list[str] | None = None) -> int:
parser = build_parser()
try:
args = parser.parse_args(argv)
manifest_context: dict[str, Any] | None = None
if args.manifest:
print_scale, manifest_minimum, manifest_context = _manifest_settings(
args.manifest
)
minimum_font = (
args.minimum_font_pt_final
if args.minimum_font_pt_final is not None
else manifest_minimum
)
else:
print_scale = args.print_scale if args.print_scale is not None else 1.0
minimum_font = (
args.minimum_font_pt_final
if args.minimum_font_pt_final is not None
else 18.0
)
report = analyze_layout(
args.pptx,
print_scale=print_scale,
minimum_font_pt_final=minimum_font,
)
if manifest_context is not None:
validation = manifest_context["validation"]
apply_manifest_checks(
report,
manifest_context["document"],
validation,
)
report["manifest"] = {
"path": validation["manifest_path"],
"content_sha256": validation["content_sha256"],
}
report["minimum_font_basis"] = manifest_context["font_basis"]
else:
report["minimum_font_basis"] = {
"kind": (
"caller_supplied"
if args.minimum_font_pt_final is not None
else "project_heuristic"
),
"source_id": None,
}
report["pass"] = not report["issues"]
emit_json(report, output=args.output)
return 0 if report["pass"] else 1
except CliError as exc:
parser.exit(2, f"error: {exc}\n")
if __name__ == "__main__":
sys.exit(main())
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 472k | Updated | Claude CodeCodex | Verified | Install |
| 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: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |