# Section Writing Agent

Step 4 of the PaperOrchestra pipeline (arXiv:2604.05018).

- Repository: https://github.com/Ar9av/PaperOrchestra (694 stars)
- Category: AI and agents
- License: see repository
- Last updated: 2026-10-11
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add Ar9av/PaperOrchestra --skill section-writing-agent -g -a claude-code -y`
Codex: `npx skills add Ar9av/PaperOrchestra --skill section-writing-agent -g -a codex -y`
Cursor: `npx skills add Ar9av/PaperOrchestra --skill section-writing-agent -g -a cursor -y`
Gemini CLI: `npx skills add Ar9av/PaperOrchestra --skill section-writing-agent -g -a gemini-cli -y`

## Description

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 experimental_log.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".

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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 plan
- `workspace/inputs/idea.md`, technical details
- `workspace/inputs/experimental_log.md`, raw data for tables and qualitative analysis
- `workspace/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 file
- `workspace/inputs/conference_guidelines.md`, formatting rules
- `workspace/figures/`, the actual PNG files from Step 2 (used as
  multimodal vision input!)
- `workspace/figures/captions.json`, caption text per figure_id
- `workspace/tex_profile.json`, TeX package availability flags (written by
  `check_tex_packages.py` at 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:

The rest: https://github.com/Ar9av/PaperOrchestra/blob/HEAD/skills/section-writing-agent/SKILL.md
