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_palette.py
View on GitHub#!/usr/bin/env python3
"""Report declared WCAG contrast and heuristic palette separation."""
from __future__ import annotations
import argparse
import itertools
import sys
from typing import Any
from _common import CliError, contrast_ratio, emit_json, parse_hex_color, relative_luminance
from _manifest import load_and_validate_manifest
THRESHOLDS = {"normal_text": 4.5, "large_text": 3.0, "non_text": 3.0}
def _lstar(color: str) -> float:
luminance = relative_luminance(color)
delta = 6.0 / 29.0
transformed = (
luminance ** (1.0 / 3.0)
if luminance > delta**3
else luminance / (3.0 * delta**2) + 4.0 / 29.0
)
return 116.0 * transformed - 16.0
def audit_palette(document: dict[str, Any]) -> dict[str, Any]:
palette = document["palette"]
colors = {
color_id: parse_hex_color(value, context=f"palette.colors.{color_id}")
for color_id, value in palette["colors"].items()
}
declared: list[dict[str, Any]] = []
issues: list[dict[str, Any]] = []
for pair in palette["contrast_pairs"]:
foreground = colors[pair["foreground_color_id"]]
background = colors[pair["background_color_id"]]
ratio = contrast_ratio(foreground, background)
threshold = THRESHOLDS[pair["usage"]]
passed = ratio + 1e-9 >= threshold
declared.append(
{
"id": pair["id"],
"foreground_color_id": pair["foreground_color_id"],
"foreground": foreground,
"background_color_id": pair["background_color_id"],
"background": background,
"usage": pair["usage"],
"ratio": round(ratio, 3),
"threshold": threshold,
"pass": passed,
}
)
if not passed:
issues.append(
{
"code": "DECLARED_CONTRAST_FAILURE",
"pair_id": pair["id"],
"message": (
f"{ratio:.2f}:1 is below {threshold:.1f}:1 for "
f"{pair['usage']}"
),
}
)
pairwise: list[dict[str, Any]] = []
for first_id, second_id in itertools.combinations(colors, 2):
first = colors[first_id]
second = colors[second_id]
pairwise.append(
{
"first_color_id": first_id,
"second_color_id": second_id,
"contrast_ratio": round(contrast_ratio(first, second), 3),
"grayscale_delta_lstar": round(abs(_lstar(first) - _lstar(second)), 3),
}
)
return {
"schema_version": "1.0",
"pass": not issues,
"declared_contrast_pairs": declared,
"pairwise_screen": pairwise,
"redundant_encoding_confirmed": palette[
"data_series_redundant_encoding"
],
"issues": issues,
"standards_basis": {
"normal_text": "WCAG 2.2 SC 1.4.3, 4.5:1",
"large_text": (
"WCAG 2.2 SC 1.4.3, 3:1; large text is at least 18 pt, "
"or 14 pt and bold"
),
"non_text": (
"WCAG 2.2 SC 1.4.11, 3:1 for graphical parts required "
"to understand content"
),
},
"pairwise_notice": (
"Pairwise contrast and CIE L* separation are screening data, not a "
"color-vision accessibility certification. Keep direct labels and "
"redundant shape, marker, pattern, or line-style encoding."
),
}
def build_parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser(
description=(
"Audit an approved poster manifest's declared sRGB foreground/background "
"pairs against WCAG 2.2 and report heuristic pairwise separation. "
"No network is used."
)
)
parser.add_argument("manifest", help="approved local poster manifest JSON")
parser.add_argument("--output", help="optional new JSON report path")
return parser
def main(argv: list[str] | None = None) -> int:
parser = build_parser()
try:
args = parser.parse_args(argv)
_, document, validation = load_and_validate_manifest(
args.manifest,
verify_assets=False,
require_approval=True,
enforce_contrast=False,
)
report = audit_palette(document)
report["manifest"] = {
"path": validation["manifest_path"],
"content_sha256": validation["content_sha256"],
}
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 |