---
name: paper-writing
description: Turn research findings into a polished paper-style draft with sections, equations, and citations. Use when the user asks to write a paper, draft a report, write up findings, or produce a technical document from collected research.
---

# Paper Writing

Turn collected research notes into a polished paper-style draft with explicit claims, source-backed evidence, and clean Markdown+LaTeX formatting.

Derive a slug from the topic (lowercase, hyphens, ≤5 words). All files in this run use the slug as a prefix.

## Subagent mapping

See `../_platform-mapping.md`. Use `writer` (drafting) and `verifier` (citation + URL verification).

## Prerequisites

This skill assumes research notes already exist — from `deep-research`, `literature-review`, `source-comparison`, or the user's own notes. If research hasn't happened yet, run the appropriate research skill first.

## Workflow

### 1. Outline

Write `outputs/.plans/<slug>.md` with:

- **Proposed title**
- **Section structure** — title, abstract, problem statement, related work, method/synthesis, evidence/experiments, limitations, conclusion
- **Key claims** — numbered list of the strongest claims the paper will make
- **Source material** — which research notes or raw artifacts each claim will draw from
- **Verification log** — a row per critical claim, figure, and calculation; populated during drafting

Briefly summarize the outline to the user, continue immediately unless they asked for outline review.

### 2. Draft

**Option A — subagent-driven (preferred when the notes are dense and the outline is solid):** dispatch a `writer` subagent with the outline and note paths. Task:

> Write a paper-style draft from the outline in `outputs/.plans/<slug>.md` and the notes at `<slug>-research-*.md`. Save to `outputs/.drafts/<slug>-draft.md`. Include all sections from the outline. Use LaTeX where equations materially help. Do not invent results.

**Option B — lead-agent drafting:** write the draft yourself, saving to `outputs/.drafts/<slug>-draft.md`.

Section requirements (minimum):

- **Title** — descriptive, not clickbait
- **Abstract** — ≤200 words; problem, approach, headline result
- **Problem statement** — what's unsolved, why it matters
- **Related work** — honest positioning; no straw-manning
- **Method / synthesis** — clean exposition of what you're claiming
- **Evidence / experiments** — source-backed results; no invented tables
- **Limitations** — explicit, not buried
- **Conclusion** — what's established, what's next

### 3. Guardrails while drafting

- **No invented results.** If evidence is missing, leave a placeholder (`[TODO: verify claim against benchmark X]`) or describe the experiment you'd need to run, rather than fabricating.
- **Every number, figure, and benchmark** must map to a source URL, research note, or script output.
- **Tentative results** — mark them explicitly ("preliminary evidence suggests…" rather than "we show…").
- **Charts** — Mermaid or source-backed CSV, never invented.

### 4. Self-sweep before handoff

Before calling the verifier, sweep the draft:

- Does every strong claim have a traceable source?
- Is every figure caption provenance-bearing (names the source)?
- Are tentative claims marked as tentative?
- Are unsupported numerics removed or marked TODO?

If the sweep finds issues, fix them yourself — don't push the problem onto the verifier.

### 5. Cite

Dispatch `verifier` subagent to add inline citations and verify every URL:

> Add inline citations to `outputs/.drafts/<slug>-draft.md` using the research files as source material. Verify each URL is reachable. Write the complete cited draft to `outputs/.drafts/<slug>-cited.md`.

### 6. Deliver

Save the final draft to `papers/<slug>.md`. Write `papers/<slug>.provenance.md` with:

```markdown
# Provenance: <title>

- **Date:** YYYY-MM-DD
- **Outline:** outputs/.plans/<slug>.md
- **Research files:** <list>
- **Draft:** outputs/.drafts/<slug>-draft.md
- **Cited draft:** outputs/.drafts/<slug>-cited.md
- **Verification:** PASS | PASS WITH NOTES | BLOCKED
- **Sources:** <count accepted / count rejected>
```

End the paper with a `Sources` appendix listing direct URLs for all primary references.

## Format conventions

- Markdown with embedded LaTeX (`$\ldots$` inline, `$$\ldots$$` display). Equations only where they materially help comprehension.
- Mermaid `graph TD` / `flowchart` for architectures, pipelines, and taxonomies.
- Tables in standard Markdown; for complex tables, emit an HTML `<table>` block or a separate CSV.
- Figure captions always name the source.
