Paper Scaffold
Overview
Papers in a research monorepo follow one shape: a per-paper LaTeX directory that shares the
repo's references.bib, harvests its results from a sibling code repo, and is tracked in a
portfolio record. This skill scaffolds that shape so a new paper builds on day one and you
only write prose.
Core principle: a paper is a harvest of the code — result numbers come from a script
that reads the source repo's corpus, never hand-typed.
When to use
- Starting a new first-author paper in a
papers/-style repo.
- "Scaffold a paper called X", "new paper from
<sister>".
- NOT for editing an existing paper's prose, or for one-off non-repo documents.
Inputs
<name> — kebab-case paper / directory name (e.g. kourai, velocity-fl-systems).
--from <repo> (optional) — sibling code repo the results harvest from.
--venue <venue> (optional) — target venue, recorded in the header and portfolio.
Config
Read the ## paper section of <repo>/.claude/skill-context.md for: author,
affiliation, email, bib (default ../references), engine (default tectonic, else
pdflatex), and portfolio (default LINEAGE.md). Use sensible defaults if absent.
Procedure
- Refuse if
papers/<name>/ already exists — never overwrite a paper.
- Copy
templates/main.tex.tmpl → papers/<name>/main.tex, filling __TITLE__ (title-cased
from <name>; confirm with the user), __AUTHOR__, __AFFIL__, __EMAIL__, __VENUE__,
__BIB__, __NAME__, __ENGINE__.
- Copy
templates/harvest.py.tmpl → papers/<name>/harvest.py, filling __SISTER__
(--from, else TODO). Create papers/<name>/figures/.gitkeep.
- Append a row to the portfolio file's first-author table:
| <name> | <repo> | (contribution -- fill in) | scaffolded |.
- Build-verify: run the configured engine in
papers/<name>/. On success, report the PDF
path + size. If no engine is installed, print an Overleaf note instead of failing.
- Report the directory, the build status, and: "write prose into the
% HARVEST: blocks;
run python harvest.py once --from is wired."
Common mistakes
- Hand-typing result numbers — they belong in
harvest.py output (\input-ed) so they
regenerate. The template's \nocite{*} line is only a build-enabler; delete it once real
\cite{} commands exist (an empty bibliography errors under many classes).
- Overwriting an existing paper dir — step 1 guards this.
The exact main.tex and harvest.py scaffolds live in templates/.
1---2name: paper3description: Use when starting or scaffolding a new research paper in a papers-style monorepo (a repo of LaTeX paper directories that share one bibliography). Triggers include "scaffold a paper", "start a new paper", "set up a paper dir", "new paper from <repo>", "add a paper to papers/".4---56# Paper Scaffold78## Overview910Papers in a research monorepo follow one shape: a per-paper LaTeX directory that shares the11repo's `references.bib`, harvests its results from a sibling code repo, and is tracked in a12portfolio record. This skill scaffolds that shape so a new paper builds on day one and you13only write prose.1415**Core principle:** a paper is a *harvest of the code* — result numbers come from a script16that reads the source repo's corpus, never hand-typed.1718## When to use1920- Starting a new first-author paper in a `papers/`-style repo.21- "Scaffold a paper called X", "new paper from `<sister>`".22- NOT for editing an existing paper's prose, or for one-off non-repo documents.2324## Inputs2526- `<name>` — kebab-case paper / directory name (e.g. `kourai`, `velocity-fl-systems`).27- `--from <repo>` (optional) — sibling code repo the results harvest from.28- `--venue <venue>` (optional) — target venue, recorded in the header and portfolio.2930## Config3132Read the `## paper` section of `<repo>/.claude/skill-context.md` for: `author`,33`affiliation`, `email`, `bib` (default `../references`), `engine` (default `tectonic`, else34`pdflatex`), and `portfolio` (default `LINEAGE.md`). Use sensible defaults if absent.3536## Procedure37381. Refuse if `papers/<name>/` already exists — never overwrite a paper.392. Copy `templates/main.tex.tmpl` → `papers/<name>/main.tex`, filling `__TITLE__` (title-cased40 from `<name>`; confirm with the user), `__AUTHOR__`, `__AFFIL__`, `__EMAIL__`, `__VENUE__`,41 `__BIB__`, `__NAME__`, `__ENGINE__`.423. Copy `templates/harvest.py.tmpl` → `papers/<name>/harvest.py`, filling `__SISTER__`43 (`--from`, else `TODO`). Create `papers/<name>/figures/.gitkeep`.444. Append a row to the portfolio file's first-author table:45 `| <name> | <repo> | (contribution -- fill in) | scaffolded |`.465. Build-verify: run the configured engine in `papers/<name>/`. On success, report the PDF47 path + size. If no engine is installed, print an Overleaf note instead of failing.486. Report the directory, the build status, and: "write prose into the `% HARVEST:` blocks;49 run `python harvest.py` once `--from` is wired."5051## Common mistakes5253- Hand-typing result numbers — they belong in `harvest.py` output (`\input`-ed) so they54 regenerate. The template's `\nocite{*}` line is only a build-enabler; delete it once real55 `\cite{}` commands exist (an empty bibliography errors under many classes).56- Overwriting an existing paper dir — step 1 guards this.5758The exact `main.tex` and `harvest.py` scaffolds live in `templates/`.