
section-writing-agent
Step 4 of the PaperOrchestra pipeline (arXiv:2604.05018). ONE single multimodal LLM call that drafts the remaining paper sections (Abstract, Methodology, Experiments, Conclusion), extracts numeric values from experimentallog.md into LaTeX booktabs tables, splices the generated figures from Step 2, and merges everything into the template that already contains Intro + Related Work from Step 3. TRIGGER when the orchestrator delegates Step 4 or when the user asks to "write the methodology and experiments sections" or "fill in the rest of the paper".
- Installs
- 67
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/ar9av/paperorchestra --skill section-writing-agent- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads section-writing-agent automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Section Writing Agent (Step 4)
Faithful implementation of the Section Writing Agent from PaperOrchestra (Song et al., 2026, arXiv:2604.05018, §4 Step 4, App. F.1 pp. 47–49).
Cost: ONE LLM call (App. B: "Section Writing Agent (1 call): A single, comprehensive multimodal call to draft and compile the complete LaTeX manuscript"). Do NOT split this into per-section calls — the paper explicitly designs it as one comprehensive call so the model can maintain global coherence across sections.
Inputs
workspace/outline.json— the master planworkspace/inputs/idea.md— technical detailsworkspace/inputs/experimental_log.md— raw data for tables and qualitative analysisworkspace/drafts/intro_relwork.tex— the template with Intro + Related Work already filled in by Step 3. This is your starting point. The preamble, package list, style, and the two pre-filled sections must be preserved verbatim.workspace/citation_pool.json— the citation map ({key, title, abstract}for each verified paper)workspace/refs.bib— the BibTeX fileworkspace/inputs/conference_guidelines.md— formatting rulesworkspace/figures/— the actual PNG files from Step 2 (used as multimodal vision input!)workspace/figures/captions.json— caption text per figure_idworkspace/tex_profile.json— TeX package availability flags (written bycheck_tex_packages.pyat Step 0). Read this before generating any LaTeX. It tells you which packages are installed so you select the right cross-reference pattern, font packages, etc. before you write — not after you try to compile.
Output
workspace/drafts/paper.tex— the complete LaTeX paper, with all sections filled. The Step 5 Refinement Agent will iterate on this file.
How to do it
0.5. Read tex_profile.json and select LaTeX patterns
Before composing the prompt, read workspace/tex_profile.json and apply
these rules to every LaTeX choice in the generated paper:
| Profile flag | True → use | False → use instead |
|---|---|---|
use_cleveref | \cref{fig:X}, \cref{tab:Y} | Figure~\ref{fig:X}, Table~\ref{tab:Y} |
use_nicefrac | \nicefrac{a}{b} | $a/b$ |
use_microtype | \usepackage{microtype} | omit the line |
use_t1_fontenc | \usepackage[T1]{fontenc} | omit the line |
If tex_profile.json does not exist (old workspace), default to the safe
fallback column (no cleveref, no nicefrac, no microtype, no T1 fontenc).
1. Pre-extract metrics from the experimental log
Run the deterministic helper:
python skills/section-writing-agent/scripts/extract_metrics.py \
--log workspace/inputs/experimental_log.md \
--out workspace/metrics.json
This parses the ## 2. Raw Numeric Data section's markdown tables into
structured JSON. The Section Writing Agent uses this to construct LaTeX
booktabs tables without re-deriving values from raw text. Read
references/latex-table-patterns.md for the booktabs conventions.
2. Compose the prompt and make ONE multimodal call
Load references/prompt.md (verbatim Section Writing Agent prompt from App.
F.1). Prepend the Anti-Leakage Prompt from
../paper-orchestra/references/anti-leakage-prompt.md.
Then append the craft constraints for the sections being drafted. Pull
them from skills/shared/section_rhetoric.md — the global rules plus only
the templates for Abstract, Method, Experiments, and Conclusion (Intro and
Related Work are already written by Step 3; do not re-open them). The App.
F.1 prompt specifies what each section must contain; the rhetoric
templates specify the paragraph roles and their order. Without them the
model produces content-complete sections whose paragraphs all make the same
kind of move, which the Step 5 reviewer scores down on Logical Flow.
The user message contains:
outline.json— full contentidea.md— full contentexperimental_log.md— full content (tables AND prose)intro_relwork.tex— full content (this becomestemplate.texfor the prompt)citation_pool.json— full content (becomescitation_map.json)conference_guidelines.md— full contentfigures_list— array of{figure_id, filename, caption}fromcaptions.jsonand the file listing- The actual figure PNGs as multimodal image inputs, so the model can visually inspect them and write accurate descriptions / refer to them correctly in the prose.
If your host LLM has no vision input, fall back to text-only mode: pass the
captions in captions.json as descriptions and tell the agent it cannot see
the images directly. Quality drops noticeably (the paper notes that visual
grounding measurably improves figure-text alignment), but the pipeline
still completes.
3. Save the output
The agent's response is wrapped in \``latex ... ```fences. Extract the LaTeX code and save toworkspace/drafts/paper.tex`.
4. Run the deterministic gates
# Orphan citation gate: every \cite{KEY} must exist in refs.bib
python skills/section-writing-agent/scripts/orphan_cite_gate.py \
workspace/drafts/paper.tex workspace/refs.bib
# Latex sanity: matched braces, matched begin/end, no unescaped specials
python skills/section-writing-agent/scripts/latex_sanity.py \
workspace/drafts/paper.tex
# Anti-leakage post-check: no author names, emails, affiliations
python skills/paper-orchestra/scripts/anti_leakage_check.py \
workspace/drafts/paper.tex
# Table conventions: booktabs rules, caption placement, metric direction,
# decimal precision. ERRORs block; WARNs go into the re-prompt.
python skills/section-writing-agent/scripts/table_lint.py \
workspace/drafts/paper.tex
If any gate fails, re-prompt the writing call with the gate's error report appended to the user message and ask the agent to fix the specific issues. Do NOT try to fix the gate violations by hand — the model needs to see its own mistakes.
Critical rules from the prompt
These are excerpted from references/prompt.md (App. F.1, pp. 47-49). The
host agent MUST honor them on the writing call:
Existing-content preservation
- DO NOT modify the text, style, or content of sections that are already
filled in
intro_relwork.tex. Preserve Intro + Related Work verbatim. - Keep the preamble (packages, document class, style) exactly as is.
- Come up with a good title if one is missing. Fill author names if missing (but the Anti-Leakage Prompt says not to invent real ones — use a placeholder like "Anonymous Authors" for double-blind).
Data and tables
- Build LaTeX tables for the experimental results.
- Extract numeric values directly from
experimental_log.md. Do not hallucinate numbers — use the exact values in the log. - Use the
booktabspackage format:\toprule,\midrule,\bottomrule. - All tables must appear before the Conclusion section, unless they are explicitly placed in an Appendix.
Citations
- The
outline.jsonprovides citation_hints per subsection. For each hint, find the matching key incitation_pool.json(by title or content) and use that exact key in\cite{...}. - Use ONLY keys from
refs.bib. Inventing or guessing keys violates the Lit Review Agent's verified pool. - Read the abstract from
citation_pool.jsonfor the papers you cite. Use the abstract context to write specific, accurate sentences about those works — not generic "[A, B] proposed methods for X".
Writing content
- Write the missing sections following
outline.json'ssection_planstructure exactly. Hierarchy rule: if 4.1 exists, 4.2 must exist. - Use formal mathematical equations, notations, and definitions where
appropriate AND directly supported by
idea.mdorexperimental_log.md. Do not hallucinate math. Do not use complex math just for the sake of it. - Always provide detailed ablation studies and qualitative analysis of the experimental results: what worked, what does not, and why.
- Optional: discuss limitations and future work at the end.
- If you put anything in the Appendix, the Appendix section appears AFTER the References section, on a fresh new page.
Figures and visual fidelity
- You are being given the actual image files of the figures. You MUST describe them faithfully and accurately. Do NOT hallucinate interpretations that contradict the visual evidence in the plots.
- Use ALL of the figures provided in
figures/. Use the exact filenames including extensions (e.g.,.png) in your\includegraphicscommands. - DO NOT merge or group multiple figures into one display.
- If the paper is in a 2-column format, prefer single-column figures
(
\begin{figure}) unless they are very wide. - All figures must appear before the Conclusion section, unless explicitly in the Appendix.
- Refine the captions if necessary, but they are already provided in
captions.jsonand should generally be used as-is. - Do NOT include "Figure X" in the caption text — LaTeX handles numbering.
Rhetorical structure
Templates and checklists live in skills/shared/section_rhetoric.md. The
constraints the writing call must honor:
- One paragraph, one message, stated in the first sentence. A paragraph whose point arrives in sentence five is a paragraph reviewers skim.
- Abstract follows one of three templates, chosen by contribution count: Challenge→Contribution, Challenge→Insight→Contribution, or multiple-contributions (each contribution paired with its advantage in the same sentence).
- Method subsections carry the triad — design (the forward process as
input → step → step → output), then motivation (because X fails, we design Y), then technical advantage. Design-only subsections read as a system manual; motivation-only subsections read as a pitch. - Experiments answers three questions: better than strong baselines, which design choices produce the gain (ablations as deltas), and how far it generalizes. Every contribution claimed in the Introduction maps to at least one experiment.
- Conclusion limitations are scope boundaries, not defects. "We evaluate only on short sequences" bounds the method; "we did not tune the learning rate" invites rejection.
- Terminology is frozen across Abstract→Conclusion. One name per concept.
Style
- Adopt the tone of a top-tier ML conference paper: dense, objective, technical.
- Match the indentation and spacing style of the original
template.tex. Do not change the overall LaTeX style.
LaTeX integrity
- The output must compile flawlessly out-of-the-box.
- All
\begin{X}must match a\end{X}(e.g.,\begin{figure*}must be closed with\end{figure*}, not\end{figure}). - DO NOT change
\usepackage[capitalize]{cleveref}to\usepackage[capitalize]{cleverref}— there is nocleverref.sty. - Always emit
\clearpageimmediately before\bibliographystyle{...}. Without it, figures deferred by LaTeX's float algorithm will appear inside or after the References section — a hard-to-spot layout defect that only shows up in the compiled PDF.\clearpageforces all pending floats to be output before the bibliography starts. Seereferences/latex-table-patterns.mdfor details. - Cross-references: prefer
Figure~\ref{fig:X}andTable~\ref{tab:Y}over bare\ref{fig:X}. This is necessary whencleverefis unavailable and produces readable prose in all cases. Use\cref{...}only whencleveref.styis confirmed present.
Output format
- Wrap the full updated
template.texin\``latex ... ````. - The previously empty sections should now be filled.
- Previously filled sections (Intro, Related Work) should remain mostly untouched; only adjust for consistency purposes.
Resources
references/prompt.md— verbatim Section Writing Agent prompt from App. F.1references/latex-table-patterns.md— booktabs rules + table-from-log examplesreferences/figure-integration.md—\includegraphics, 2-column handling, placementscripts/extract_metrics.py— markdown tables in experimental_log → JSONscripts/latex_sanity.py— unmatched braces, env mismatches, specialsscripts/orphan_cite_gate.py— every\cite{KEY}exists in refs.bibscripts/table_lint.py— NEW booktabs rule violations + table readability conventionsskills/shared/section_rhetoric.md— NEW per-section structural templates (abstract variants, module triad, experiment questions) + checklists
FAQ
What does the section-writing-agent skill do?
Step 4 of the PaperOrchestra pipeline (arXiv:2604.05018). ONE single multimodal LLM call that drafts the remaining paper sections (Abstract, Methodology, Experiments, Conclusion), extracts numeric values from experimentallog.md into LaTeX booktabs tables, splices the generated figures from Step 2, and merges everything into the template that already contains Intro + Related Work from Step 3. TRIGGER when the orchestrator delegates Step 4 or when the user asks to "write the methodology and experiments sections" or "fill in the rest of the paper".
How do I install section-writing-agent?
Run npx skills add https://github.com/ar9av/paperorchestra --skill section-writing-agent in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/section-writing-agent/ (personal) or .claude/skills/section-writing-agent/ (project).
Which AI agents can use section-writing-agent?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is section-writing-agent safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains section-writing-agent?
It is published by ar9av in ar9av/paperorchestra. It has 67 recorded installs.
More from ar9av/paperorchestra
paper-orchestra
ar9av/paperorchestra
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.
literature-review-agent
ar9av/paperorchestra
Step 3 of the PaperOrchestra pipeline (arXiv:2604.05018). Execute the literature search strategy from outline.json — discover candidate papers via web search, verify them through Semantic Scholar (Levenshtein 70 fuzzy title match, temporal cutoff, dedup by paperId), cross-corroborate against Crossref + OpenAlex to flag hallucinated citations, build a BibTeX file, and draft Introduction + Related Work using ≥90% of the verified pool. Runs in parallel with the plotting-agent. TRIGGER when the orchestrator delegates Step 3 or when the user asks to "find citations for my paper", "draft the related work", or "build the bibliography".
plotting-agent
ar9av/paperorchestra
Step 2 of the PaperOrchestra pipeline (arXiv:2604.05018). Execute the visualization plan from outline.json — render plots and conceptual diagrams from experimentallog.md and idea.md, optionally refine via VLM critique loop, and produce context-aware captions. Runs in parallel with the literature-review-agent. TRIGGER when the orchestrator delegates Step 2 or when the user asks to "generate the figures for my paper" or "render the plots from this experiment log".
paper-autoraters
ar9av/paperorchestra
Run the four paper-quality autoraters from PaperOrchestra (arXiv:2604.05018, App. F.3) — Citation F1 (P0/P1 partition + Precision/Recall/F1), Literature Review Quality (6-axis 0-100 with anti-inflation rules), SxS Overall Paper Quality (side-by-side), and SxS Literature Review Quality (side-by-side). TRIGGER when the user asks to "score this paper draft", "evaluate against the benchmark", "compare two papers", or "run the autoraters".
content-refinement-agent
ar9av/paperorchestra
Step 5 of the PaperOrchestra pipeline (arXiv:2604.05018). Iteratively refine drafts/paper.tex by simulating peer review and applying targeted revisions, with strict accept/revert halt rules, deterministic 0-100 decision bands (Accept/Minor/Major/Reject) that drive a target-met early stop, and a Devil's Advocate concession-threshold guard that blocks acceptance on unresolved critical findings. Maintains a worklog and snapshots each iteration so revert is real, not symbolic. TRIGGER when the orchestrator delegates Step 5 or when the user asks to "refine the draft", "iterate on the paper", or "run peer review on this paper".
outline-agent
ar9av/paperorchestra
Step 1 of the PaperOrchestra pipeline (arXiv:2604.05018). Convert (idea.md, experimentallog.md, template.tex, conferenceguidelines.md) into a strict JSON outline containing a plotting plan, literature search plan (Intro + Related Work), and section-level writing plan with citation hints. TRIGGER when the orchestrator delegates Step 1 or when the user asks to "outline a paper from raw materials" or "generate the paper structure".
Popular docs & writing skills
grill-with-docs
mattpocock/skills
A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.
lark-markdown
open.feishu.cn
飞书 Markdown:查看、创建、上传、编辑和比较飞书中的原生 Markdown 文件。当用户要操作飞书 Markdown 文件,或比较其远端版本及本地草稿时使用。纯本地 Markdown 文件操作不触发本 skill。不负责将 Markdown 导入为飞书在线文档,也不负责文件搜索、权限、评论、移动、删除等云空间管理操作。
writing-beats
mattpocock/skills
Writing, exploit; assemble raw material into a journey of beats, grounding each term before a beat leans on it.
writing-shape
mattpocock/skills
Writing, exploit: shape raw material into an article, paragraph by paragraph.
writing-fragments
mattpocock/skills
Writing, explore: mine raw fragments, no structure yet.
writing-for-agents
mattpocock/skills
Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.