Skip to content

Ar9av/PaperOrchestra / skills/paper-orchestra

paper-orchestra

Verified

Orchestrate the full PaperOrchestra (Song et al., 2026, arXiv:2604.05018) five-agent pipeline to turn unstructured research materials (idea, experimental log, LaTeX template, conference guidelines, optional figures) into a submission-ready LaTeX manuscript and compiled PDF. TRIGGER when the user asks to "write a paper from my experiments", "turn this idea and these results into a paper", "generate a conference submission", "run paper-orchestra on X", or otherwise wants the end-to-end paper-writing pipeline. Coordinates the outline-agent, plotting-agent, literature-review-agent, section-writing-agent, and content-refinement-agent skills.

scripts/check_tex_packages.py

View on GitHub
#!/usr/bin/env python3
"""
check_tex_packages.py — Probe the local TeX installation for packages used
by common conference templates, and write tex_profile.json so downstream
agents can select the correct LaTeX patterns at generation time rather than
discovering failures during compilation.

Without this probe, the pipeline learns which packages are missing only after
a compile failure — requiring manual edits and re-runs. Running this script
once at pipeline startup eliminates that iteration.

Checks:
  cleveref   → if missing: use Figure~\\ref{} instead of \\cref{}
  nicefrac   → if missing: use a/b instead of \\nicefrac{a}{b}
  microtype  → if missing: omit \\usepackage{microtype}
  fontenc    → if missing: omit \\usepackage[T1]{fontenc} (avoids pcrr8t error)
  url        → if missing: omit \\usepackage{url}
  booktabs   → required for tables; warns if absent
  natbib     → required for plainnat bibliography style
  hyperref   → optional; common in many templates
  times      → optional; some templates request Times fonts
  lmodern    → fallback font package

Output: workspace/tex_profile.json
  {
    "available": ["booktabs", "natbib", ...],
    "missing": ["cleveref", "nicefrac", ...],
    "use_cleveref": false,
    "use_nicefrac": false,
    "use_microtype": false,
    "use_t1_fontenc": false,
    "tex_binary": "/Library/TeX/texbin/pdflatex",
    "checked_at": "2026-04-10T12:00:00"
  }

Usage:
    python check_tex_packages.py --out workspace/tex_profile.json
    python check_tex_packages.py --out workspace/tex_profile.json \\
        --tex-bin /Library/TeX/texbin/pdflatex
"""
import argparse
import datetime
import json
import os
import shutil
import subprocess
import sys
import tempfile

PACKAGES_TO_CHECK: list[tuple[str, str]] = [
    # (package_name, load_option)  — empty string means no option
    ("cleveref",  "capitalize"),
    ("nicefrac",  ""),
    ("microtype", ""),
    ("url",       ""),
    ("booktabs",  ""),
    ("natbib",    ""),
    ("hyperref",  ""),
    ("fontenc",   "T1"),
    ("times",     ""),
    ("lmodern",   ""),
]

TEX_BINARY_CANDIDATES = [
    "pdflatex",
    "/Library/TeX/texbin/pdflatex",
    "/usr/local/bin/pdflatex",
    "/usr/bin/pdflatex",
    "/opt/homebrew/bin/pdflatex",
]


def find_tex_binary(hint: str | None) -> str | None:
    candidates = ([hint] if hint else []) + TEX_BINARY_CANDIDATES
    for c in candidates:
        if shutil.which(c) or (os.path.isabs(c) and os.path.isfile(c)):
            return c
    return None


def probe_package(tex_binary: str, package: str, option: str = "") -> bool:
    """Compile a minimal .tex document that loads the package. Returns True if OK."""
    if option:
        use_line = f"\\usepackage[{option}]{{{package}}}"
    else:
        use_line = f"\\usepackage{{{package}}}"

    minimal = (
        "\\documentclass{article}\n"
        f"{use_line}\n"
        "\\begin{document}x\\end{document}\n"
    )
    with tempfile.TemporaryDirectory() as tmpdir:
        tex_path = os.path.join(tmpdir, "probe.tex")
        with open(tex_path, "w") as f:
            f.write(minimal)
        try:
            result = subprocess.run(
                [tex_binary, "-interaction=nonstopmode", "-halt-on-error",
                 "-output-directory", tmpdir, tex_path],
                capture_output=True,
                timeout=20,
            )
            return result.returncode == 0
        except (subprocess.TimeoutExpired, FileNotFoundError):
            return False


def build_fallback_profile(reason: str) -> dict:
    """Profile assuming nothing is available — used when pdflatex not found."""
    return {
        "available": [],
        "missing": [pkg for pkg, _ in PACKAGES_TO_CHECK],
        "use_cleveref": False,
        "use_nicefrac": False,
        "use_microtype": False,
        "use_t1_fontenc": False,
        "tex_binary": None,
        "error": reason,
        "checked_at": datetime.datetime.utcnow().isoformat(),
    }


def main() -> int:
    p = argparse.ArgumentParser(description=__doc__)
    p.add_argument("--out", required=True, help="Output tex_profile.json path")
    p.add_argument("--tex-bin", help="Path to pdflatex (auto-detected if omitted)")
    args = p.parse_args()

    tex_binary = find_tex_binary(args.tex_bin)
    if not tex_binary:
        print("WARN: pdflatex not found — writing fallback profile (all missing)",
              file=sys.stderr)
        profile = build_fallback_profile("pdflatex not found in PATH or known locations")
        os.makedirs(os.path.dirname(os.path.abspath(args.out)), exist_ok=True)
        with open(args.out, "w") as f:
            json.dump(profile, f, indent=2)
        return 1

    print(f"TeX binary: {tex_binary}")
    print("Probing packages...")
    available: list[str] = []
    missing: list[str] = []

    for pkg, opt in PACKAGES_TO_CHECK:
        ok = probe_package(tex_binary, pkg, option=opt)
        label = f"[{opt}]{pkg}" if opt else pkg
        status = "ok" if ok else "MISSING"
        print(f"  {label:30s} {status}")
        (available if ok else missing).append(pkg)

    profile = {
        "available": available,
        "missing": missing,
        "use_cleveref": "cleveref" in available,
        "use_nicefrac": "nicefrac" in available,
        "use_microtype": "microtype" in available,
        "use_t1_fontenc": "fontenc" in available,
        "tex_binary": tex_binary,
        "checked_at": datetime.datetime.utcnow().isoformat(),
    }

    os.makedirs(os.path.dirname(os.path.abspath(args.out)), exist_ok=True)
    with open(args.out, "w") as f:
        json.dump(profile, f, indent=2)

    print(f"\nProfile written → {args.out}")
    print(f"  use_cleveref   = {profile['use_cleveref']}")
    print(f"  use_nicefrac   = {profile['use_nicefrac']}")
    print(f"  use_microtype  = {profile['use_microtype']}")
    print(f"  use_t1_fontenc = {profile['use_t1_fontenc']}")
    if missing:
        print(f"  missing pkgs   = {', '.join(missing)}")

    return 0


if __name__ == "__main__":
    sys.exit(main())
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall