Ar9av/PaperOrchestra / skills/section-writing-agent
section-writing-agent
VerifiedStep 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".
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 12.9 KB |
| references/figure-integration.md | markdown | 3.5 KB |
| references/latex-table-patterns.md | markdown | 7.1 KB |
| references/prompt.md | markdown | 5.3 KB |
| scripts/extract_metrics.py | script | 3.8 KB |
| scripts/latex_sanity.py | script | 3.9 KB |
| scripts/orphan_cite_gate.py | script | 1.9 KB |
| scripts/table_lint.py | script | 7.2 KB |
| scripts/test_table_lint.py | script | 4.1 KB |
scripts/extract_metrics.py
View on GitHub#!/usr/bin/env python3
"""
extract_metrics.py — Parse markdown tables out of experimental_log.md's
"## 2. Raw Numeric Data" section into structured JSON.
The Section Writing Agent uses this to construct LaTeX booktabs tables
without re-deriving numeric values from raw markdown text. Per the App. F.1
prompt, "do not hallucinate numbers; use the exact values provided in the
log" — this script makes that mechanical.
Output JSON shape:
{
"tables": [
{
"label": "Performance comparison on Dataset X",
"headers": ["Method", "Accuracy", "F1", "Latency (ms)"],
"rows": [
["Baseline", "78.2", "0.79", "12.3"],
...
]
},
...
]
}
Usage:
python extract_metrics.py --log experimental_log.md --out metrics.json
"""
import argparse
import json
import re
import sys
def find_raw_data_section(text: str) -> str:
"""Return the slice of text from '## 2. Raw Numeric Data' to the next H2."""
m = re.search(r"^##\s+2\.?\s*Raw Numeric Data\s*$", text, re.M)
if not m:
return ""
start = m.end()
next_h2 = re.search(r"^##\s+", text[start:], re.M)
end = start + next_h2.start() if next_h2 else len(text)
return text[start:end]
def parse_markdown_tables(section: str) -> list[dict]:
"""Walk the section, extracting markdown tables and their preceding labels."""
lines = section.split("\n")
tables: list[dict] = []
current_label: str | None = None
i = 0
while i < len(lines):
line = lines[i].strip()
# Track table labels: ### Table N: Foo / ### Table: Foo / **Table 1: Foo**
m = re.match(r"^#+\s*Table[^:]*:\s*(.+?)\s*$", line)
if m:
current_label = m.group(1).strip()
i += 1
continue
m = re.match(r"^\*\*Table[^:]*:\s*(.+?)\*\*\s*$", line)
if m:
current_label = m.group(1).strip()
i += 1
continue
# Detect table start: a header row followed by a separator row.
if "|" in line and i + 1 < len(lines):
sep = lines[i + 1].strip()
if re.fullmatch(r"\|?\s*[:\-]+\s*(\|\s*[:\-]+\s*)+\|?", sep):
headers = [c.strip() for c in line.strip("|").split("|")]
rows: list[list[str]] = []
j = i + 2
while j < len(lines) and "|" in lines[j].strip():
cells = [c.strip() for c in lines[j].strip().strip("|").split("|")]
if len(cells) >= 2:
rows.append(cells)
j += 1
tables.append({
"label": current_label or f"Table {len(tables) + 1}",
"headers": headers,
"rows": rows,
})
current_label = None
i = j
continue
i += 1
return tables
def main() -> int:
p = argparse.ArgumentParser(description=__doc__)
p.add_argument("--log", required=True, help="experimental_log.md path")
p.add_argument("--out", required=True, help="metrics.json output path")
args = p.parse_args()
text = open(args.log).read()
section = find_raw_data_section(text)
if not section:
print("WARN: no '## 2. Raw Numeric Data' section found", file=sys.stderr)
with open(args.out, "w") as f:
json.dump({"tables": []}, f, indent=2)
return 0
tables = parse_markdown_tables(section)
out = {"tables": tables}
with open(args.out, "w") as f:
json.dump(out, f, indent=2, ensure_ascii=False)
print(f"OK: extracted {len(tables)} table(s) → {args.out}")
for t in tables:
print(f" - {t['label']}: {len(t['headers'])} cols × {len(t['rows'])} rows")
return 0
if __name__ == "__main__":
sys.exit(main())
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| 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: 198k | Updated | Claude CodeCodex | Verified | Install |
| 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: 119k | Updated | Claude CodeCodex | Verified | Install |
| 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: 118k | Updated | Claude CodeCodex | Verified | Install |