{"id":"paper-orchestra","name":"paper-orchestra","summary":"PaperOrchestra(Songら、2026年、arXiv:2604.05018)5エージェントのパイプラインをオーケストレーションし、非構造化の研究資料(アイデア、実験ログ、LaTeXテンプレート、会議ガイドライン、任意図)を提出可能なLaTeX原稿およびまとめPDFに変換します。","body":"# paper-orchestra (Orchestrator)\n\nTop-level driver for the PaperOrchestra pipeline. Read this document and follow\nthe steps below. The detailed prompts and rules live in each sub-skill's\n`SKILL.md` and `references/` directories — you (the host agent) will load them\nas you go.\n\n> Source paper: Song et al., *PaperOrchestra: A Multi-Agent Framework for\n> Automated AI Research Paper Writing*, arXiv:2604.05018, 2026.\n> <https://arxiv.org/pdf/2604.05018>\n\n## What this skill produces\n\nA complete submission package `P = (paper.tex, paper.pdf)` written into\n`workspace/final/`, plus a full audit trail under `workspace/` (outline,\nfigures, refs, drafts, refinement worklog, provenance snapshot).\n\n## Inputs (the (I, E, T, G, F) tuple from the paper)\n\nThe workspace MUST contain:\n\n| File | Symbol | Required | Description |\n|---|---|---|---|\n| `workspace/inputs/idea.md` | `I` | yes | Idea Summary (Sparse or Dense variant — see `references/io-contract.md`) |\n| `workspace/inputs/experimental_log.md` | `E` | yes | Experimental Log: setup, raw numeric data, qualitative observations |\n| `workspace/inputs/template.tex` | `T` | yes | LaTeX template for the target conference (with `\\section{...}` commands) |\n| `workspace/inputs/conference_guidelines.md` | `G` | yes | Formatting rules, page limit, mandatory sections |\n| `workspace/inputs/figures/` | `F` | no | Optional pre-existing figures. If empty, the plotting agent generates everything. |\n\n`scripts/init_workspace.py` will scaffold this layout. `scripts/validate_inputs.py`\nwill check it before the pipeline runs.\n\n## Pipeline (read `references/pipeline.md` for the full diagram)\n\n```\nStep 1: Outline           ──▶  outline.json                       (1 LLM call)\nStep 2: Plotting     ─┐\n                      ├──▶  figures/*.png + captions.json         (~20-30 calls)\nStep 3: Lit Review   ─┘                                           (~20-30 calls)\n                          intro_relwork.tex + refs.bib\n\nStep 4: Section Writing  ──▶  drafts/paper.tex                    (1 LLM call)\nStep 5: Content Refine   ──▶  final/paper.tex + final/paper.pdf   (~5-7 calls, ~3 iters)\n```\n\nStep 2 and Step 3 are independent and **MUST run in parallel** when your host\nsupports parallel sub-agents. If not, run Step 3 first (it has the longer wall\ntime due to Semantic Scholar rate limits) and Step 2 second.\n\n## Critical pre-instruction (read once, apply always)\n\nBefore any LLM call that *writes* paper content (outline, intro/related work,\nsection writing, refinement), you MUST prepend the **Anti-Leakage Prompt** at\n`references/anti-leakage-prompt.md` to your system prompt. This is verbatim\nfrom Appendix D.4 of the paper and prevents pre-training-data leakage. The\npaper applies it uniformly across all baselines for fair comparison; we apply\nit for fidelity *and* to keep generated papers grounded in the user's inputs.\n\n## Step-by-step execution\n\n### 0. Pre-flight Checks\n\nBefore running the pipeline, perform the following quality gates in order:\n\n```bash\n# 1. Scaffold the workspace\npython skills/paper-orchestra/scripts/init_workspace.py --out workspace/\n# user drops their inputs into workspace/inputs/\n\n# 2. Validate required files are present and well-formed\npython skills/paper-orchestra/scripts/validate_inputs.py --workspace workspace/\n\n# 3. Check input density — idea and experimental log must meet minimum thresholds\npython skills/paper-orchestra/scripts/check_idea_density.py \\\n    --idea workspace/inputs/idea.md \\\n    --log workspace/inputs/experimental_log.md\n\n# 4. Cross-validate consistency between idea and experimental log\npython skills/paper-orchestra/scripts/validate_consistency.py \\\n    --idea workspace/inputs/idea.md \\\n    --log workspace/inputs/experimental_log.md\n```\n\nIf `validate_inputs.py` or `check_idea_density.py` fail (exit code 1 or 2), stop\nand tell the user what's missing or below threshold — do not proceed until fixed.\n\n`validate_consistency.py` produces warnings only (exit code 1 = WARN, non-blocking);\nreport warnings to the user but continue.\n\n**Before failing on missing inputs**, check whether aggregation can supply them:\n\n| Inputs state | Action |\n|---|---|\n| `idea.md` and `experimental_log.md` both present and non-empty | Continue to Step 1. |\n| Either is missing/empty, and the user mentioned a directory | Load and run `agent-research-aggregator` with that directory as `--search-roots`, then re-validate. |\n| Either is missing/empty, no directory mentioned | Ask the user: \"Your workspace is missing `idea.md` / `experimental_log.md`. Do you have a folder with research notes or agent history I can aggregate from? If so, tell me the path — or drop the files manually into `workspace/inputs/`.\" |\n\nIf validation still fails after aggregation (e.g. `template.tex` or `conference_guidelines.md` are missing), stop and tell the user exactly which files remain outstanding.\n\n**Also probe the TeX installation** (once per workspace, result cached):\n\n```bash\npython skills/paper-orchestra/scripts/check_tex_packages.py \\\n    --out workspace/tex_profile.json\n```\n\nThe Section Writing Agent reads `tex_profile.json` to decide which LaTeX\npatterns to use (e.g., `Figure~\\ref{}` vs `\\cref{}`, whether to include\n`\\usepackage{microtype}`, etc.). This eliminates compile-time package\nfailures that previously required iterative manual edits.\n\n### 1. Outline (Step 1 — 1 LLM call)\n\nLoad `skills/outline-agent/SKILL.md` and follow it. Output: `workspace/outline.json`.\nValidate with `python skills/outline-agent/scripts/validate_outline.py workspace/outline.json`.\n**Halt the pipeline if validation fails** — every downstream agent depends on the schema.\n\n### 2 ∥ 3. Plotting and Literature Review (in parallel)\n\nParse `outline.json`. Extract:\n- `outline.plotting_plan` → drives Step 2\n- `outline.intro_related_work_plan` → drives Step 3\n\nIf your host supports parallel sub-agents (Claude Code's Agent tool with multiple\nconcurrent calls; Cursor's parallel agents; Antigravity's worker pool), spawn\n**two concurrent sub-tasks**:\n\n- Sub-task A: load `skills/plotting-agent/SKILL.md`, execute the plotting plan,\n  produce `workspace/figures/<figure_id>.png` for every entry, plus\n  `workspace/figures/captions.json`.\n- Sub-task B: load `skills/literature-review-agent/SKILL.md`, execute the\n  research strategy, produce `workspace/drafts/intro_relwork.tex` and\n  `workspace/refs.bib`.\n\nIf your host does not support parallel sub-agents, run Sub-task B first (it has\nslower wall-clock due to Semantic Scholar QPS limits) then Sub-task A. The\nartifacts are independent, so order doesn't affect correctness.\n\n### 3.5. Outline Reconciliation (after Step 3 completes, before Step 4)\n\nOnce Step 3 (Literature Review) has produced `citation_pool.json` and\n`cross_verification_report.json`, run the reconciliation step.\n\nLoad `references/outline-reconciliation.md` and follow its prompt.\nOutput: `workspace/outline_reconciled.json`.\n\nValidate and diff:\n\n```bash\npython skills/outline-agent/scripts/validate_outline.py workspace/outline_reconciled.json\npython skills/paper-orchestra/scripts/diff_outlines.py \\\n    --original   workspace/outline.json \\\n    --reconciled workspace/outline_reconciled.json \\\n    --summary    workspace/reconciliation_summary.md\n```\n\nIf validation fails, fall back to `outline.json` for Step 4 and warn the user.\nShow the user the `reconciliation_summary.md` (even if no changes — it confirms\nthe outline matched the actual literature).\n\n**Skip conditions:** citation pool empty, Step 3 failed, or Step 2 is still\nrunning and the host cannot issue another call concurrently. See\n`references/outline-reconciliation.md` for full skip conditions.\n\n### 4. Section Writing (Step 4 — ONE single multimodal LLM call)\n\nLoad `skills/section-writing-agent/SKILL.md` and follow it. This is **one\nsingle call** in the paper (App. B: \"Section Writing Agent (1 call)\") — do\n*not* split it per section. The agent receives:\n\n- `outline_reconciled.json` (use this if it exists; fall back to `outline.json`)\n- `idea.md`, `experimental_log.md`\n- `intro_relwork.tex` (already-filled from Step 3 — preserve verbatim)\n- `refs.bib` (the citation map)\n- `conference_guidelines.md`\n- `research_brief.md` (if it exists — read §1–§3 for accumulated pipeline context)\n- The actual figure image files from `workspace/figures/` (multimodal input)\n\nOutput: `workspace/drafts/paper.tex` (a complete LaTeX document).\n\nThen run the deterministic gates:\n\n```bash\npython skills/section-writing-agent/scripts/orphan_cite_gate.py workspace/drafts/paper.tex workspace/refs.bib\npython skills/section-writing-agent/scripts/latex_sanity.py workspace/drafts/paper.tex\npython skills/paper-orchestra/scripts/anti_leakage_check.py workspace/drafts/paper.tex\npython skills/paper-orchestra/scripts/claim_evidence_gate.py \\\n    --paper workspace/drafts/paper.tex \\\n    --log   workspace/inputs/experimental_log.md \\\n    --out   workspace/claim_evidence_report.json\n```\n\n`claim_evidence_gate.py` is a WARN gate (exit 1 = warnings, not a hard stop).\nReport the count of unsupported claims to the user. The content-refinement agent\nwill address them in Step 5.\n\nIf any gate fails, the host agent must fix the issue (re-prompting the writing\nstep with the gate's error report) before proceeding.\n\n### 5. Content Refinement (Step 5 — ~3 iterations, ~5-7 calls)\n\nLoad `skills/content-refinement-agent/SKILL.md` and follow it. The skill\nimplements the loop with strict halt rules from `halt-rules.md`. Maintain\n`workspace/refinement/worklog.json` and snapshot each iteration into\n`workspace/refinement/iter<N>/`.\n\nHalt conditions (any one triggers the loop to stop and accept the current\nbest snapshot):\n\n1. Iteration count reaches the cap (default 3, see `halt-rules.md`).\n2. Overall score from the simulated reviewer **decreases** vs the previous\n   iteration → revert to previous snapshot, halt.\n3. Overall score **ties** but at least one sub-axis **decreases** while none\n   gain compensatingly (negative net sub-axis change) → revert, halt.\n4. Reviewer issues no new actionable weaknesses.\n\nThe accepted snapshot is copied to `workspace/final/paper.tex`.\n\n### 6. Compile and finalize\n\n```bash\ncd workspace/final && latexmk -pdf paper.tex\n```\n\nThen write `workspace/provenance.json` capturing input file hashes, outline\nhash, refs hash, figure hashes, and final tex/pdf hashes (helper:\n`scripts/snapshot.py` in the orchestrator scripts dir if you want a one-shot;\notherwise the host agent computes hashes inline).\n\nReport to the user: the path to `workspace/final/paper.pdf`, a brief summary of\nwhich sections were drafted, citation count, refinement iterations completed,\nand any gates that failed mid-pipeline.\n\n## Workspace layout\n\nSee `references/io-contract.md`. Summary:\n\n```\nworkspace/\n├── inputs/                          # user-provided\n│   ├── idea.md\n│   ├── experimental_log.md\n│   ├── template.tex\n│   ├── conference_guidelines.md\n│   └── figures/                     # optional pre-existing figures\n├── outline.json                     # Step 1 output\n├── figures/                         # Step 2 output\n│   ├── <figure_id>.png\n│   └── captions.json\n├── refs.bib                         # Step 3 output\n├── drafts/                          # Step 3 + Step 4 output\n│   ├── intro_relwork.tex\n│   └── paper.tex\n├── refinement/                      # Step 5 working dir\n│   ├── worklog.json\n│   ├── iter1/\n│   ├── iter2/\n│   └── iter3/\n├── final/                           # accepted snapshot + compiled PDF\n│   ├── paper.tex\n│   └── paper.pdf\n└── provenance.json                  # input/output hashes for reproducibility\n```\n\n## Cost budget (from paper App. B)\n\nTotal: ~60–70 LLM calls per paper, ~40 minutes wall-time on the paper's setup.\nBudget breakdown:\n\n| Step | Calls |\n|---|---|\n| Outline | 1 |\n| Plotting | ~20–30 |\n| Literature Review | ~20–30 |\n| Section Writing | 1 |\n| Content Refinement | ~5–7 |\n\n## Host integration\n\nSee `references/host-integration.md` for per-host invocation details (Claude\nCode, Cursor, Antigravity, Cline, Aider, OpenCode).\n\n## Resources\n\n- `references/pipeline.md` — full step-by-step flow + parallelism rules + halt rules\n- `references/io-contract.md` — workspace layout, input file schemas\n- `references/anti-leakage-prompt.md` — verbatim from App. D.4, prepend to every writing call\n- `references/paper-summary.md` — 1-page distillation of arXiv:2604.05018\n- `references/host-integration.md` — per-host invocation guide\n- `references/outline-reconciliation.md` — **NEW** Step 3.5 outline reconciliation protocol (AutoSci-inspired)\n- `scripts/init_workspace.py` — scaffold workspace dir tree\n- `scripts/validate_inputs.py` — verify (I, E, T, G) before running\n- `scripts/anti_leakage_check.py` — grep draft for leaked author names/emails/affils\n- `scripts/claim_evidence_gate.py` — **NEW** WARN gate: verify numeric claims in draft are grounded in experimental_log.md\n- `scripts/diff_outlines.py` — **NEW** diff original vs reconciled outline; writes reconciliation_summary.md\n- `skills/shared/research_brief_template.md` — **NEW** schema for workspace/research_brief.md (accumulated cross-agent context)","author":"@Ar9av","ownerProfile":null,"authorContacts":null,"sourceUrl":"https://github.com/Ar9av/PaperOrchestra/tree/main/skills/paper-orchestra","license":"MIT","category":"writing","lang":"en","tokens":3246,"stars":0,"calls30d":2,"claimed":false,"visibility":"public","origin":"crawler","version":"0.1.0","createdAt":"2026-08-22","updatedAt":"2026-08-22","files":[{"path":"references/anti-leakage-prompt.md","size":2520,"sha256":"426bb3a5f410ab6ad64678f6bad8642c511c8e1bb65ee5ba83199e20467b6598"},{"path":"references/host-integration.md","size":8007,"sha256":"f30d0b2c802dc66955028721c241a9c50149cdc0c778af2ffb2921207e722690"},{"path":"references/io-contract.md","size":7261,"sha256":"78371f9c365f03beb21c60afbfb2dbfd764d97bdaeb95acd8b3460de7cbff76d"},{"path":"references/outline-reconciliation.md","size":4841,"sha256":"e0b98c5e49b180a2db61dbe7c74066d9b0b3ece49dbe81c6f1e9a3642c63884c"},{"path":"references/paper-summary.md","size":4163,"sha256":"e4c426df636b355dc294ed7b0756398805520630693583eae6550698702b181a"},{"path":"references/pipeline.md","size":7341,"sha256":"c64ec54fcaad7f4e5ec626723497136c0f1b898cae6010a3a6e6b0c6c8970015"},{"path":"scripts/anti_leakage_check.py","size":3372,"sha256":"e03bb92fd934673085bcb45a61de7bf2ea15c8328a9c4063cf80c9e669e615e6"},{"path":"scripts/build_pdf.py","size":28986,"sha256":"9cc63f5d8e8e99a231aaf46cae41acfc4d08714bd85985b46721794580cc291e"},{"path":"scripts/check_idea_density.py","size":5782,"sha256":"4e0bfbfeab75b1127d5b6f9bdbf58704e2e7c11374d64b49f1c7c3c5ec59332c"},{"path":"scripts/check_tex_packages.py","size":6078,"sha256":"c5415a47f3e95b0b4dacf6b8d0bb426e29f69f01eef864c8287fbfaf93d5ab8d"},{"path":"scripts/claim_evidence_gate.py","size":11014,"sha256":"a56cd9f7889b271b15091b589e95f833d5abf3d821f22837deb5b33cdb2e55b9"},{"path":"scripts/diff_outlines.py","size":3624,"sha256":"960274469fa3bb1f4a740fb143e7c8eab68b82a0bf6c7ba3e67cf4215ae0f9dd"},{"path":"scripts/init_workspace.py","size":4604,"sha256":"ae48ddb0ed33e35fcbeef45fe05802b0147fae72a4d5c4c2de89f1ea6080e485"},{"path":"scripts/validate_consistency.py","size":9886,"sha256":"65abfa1f888d765106194c81d14cebf8642394a79643cbfad9d227f3e1228bfe"},{"path":"scripts/validate_inputs.py","size":4872,"sha256":"befdf2504f256a45b3bbfb3ab64eb46ffa3f6a97092ef8b37bcd8a37b167b761"}],"requires":{"mcp":[],"tools":[]},"safety":{"flags":[{"code":"net.endpoints","kind":"exfiltration","excerpt":"api.semanticscholar.org, arxiv.org","message":"bundled scripts reach 2 external host(s)","severity":"warn"}],"scannedAt":"2026-08-22","hasScripts":true,"networkEndpoints":["api.semanticscholar.org","arxiv.org"]}}