Generate guidance/paper-context.md from user-provided .tex, .md, or .pdf files
Generate a structured guidance/paper-context.md file that captures everything Claude needs to know about a paper before writing, editing, or auditing it. This file is consumed by /audit-section, /check-consistency, /edit-section, /full-paper-audit, /audit-captions, and other writing skills.
/build-context main.tex -- build context from the paper's LaTeX source/build-context draft.pdf -- build context from a PDF of the paper/build-context notes.md main.tex -- combine author notes with LaTeX source/build-context related_paper.pdf -- extract context from a related paper for reference/build-context -- scan for main.tex or .pdf files in the current project and ask which to useOne or more file paths. Supported formats:
.tex -- LaTeX source (richest; extracts section structure, labels, equations, citations).pdf -- PDF file (read with the Read tool; extracts prose content and structure).md -- Markdown notes (author's own description of the paper, key results, terminology)If no arguments are provided, scan the current project directory for main.tex or *.pdf files and prompt the user to select.
.tex: extract the full document.pdf: read the PDF (use pages parameter for large files; start with first 10 pages, then continue if needed).md: read as-is (these are usually the author's own notes)From the source material, identify:
\title{} or document header\author{} or byline\begin{abstract} or first sectionIdentify the paper's main quantitative and qualitative findings:
For each result, record:
Build a terminology table:
Format as:
| Preferred | Avoid | Notes |
|-----------|-------|-------|
| [correct term] | [incorrect/informal term] | [context] |
If working from .tex, record:
%% BEGIN:<key> / %% END:<key> markers found\label{}s for tables, figures, equations, theoremsIdentify the paper's most important citations:
Write the file to guidance/paper-context.md (creating the guidance/ directory if needed). Use this template:
# Paper Context
Generated by `/build-context` on [date]. Source files: [list].
## Identity
- **Title**: [title]
- **Authors**: [authors]
- **Core contribution**: [1-3 sentences]
## Abstract
[abstract text]
## Key Results
### Primary
1. [Result]: [magnitude] ([table/figure reference])
2. ...
### Secondary
1. ...
### Null Results
1. ...
## Terminology
| Preferred | Avoid | Notes |
|-----------|-------|-------|
| ... | ... | ... |
## Abbreviations
| Abbreviation | Definition |
|-------------|------------|
| ... | ... |
## Sample
- **Period**: [start] to [end]
- **Observations**: [count] ([unit])
- **Sources**: [data sources]
- **Key filters**: [any important sample restrictions]
## Section Structure
| Key | Section Title | Summary |
|-----|--------------|---------|
| `introduction` | Introduction | ... |
| ... | ... | ... |
## Key Labels
- Tables: [list of table labels]
- Figures: [list of figure labels]
- Equations: [list of key equation labels]
## Important Citations
- [Author (Year)]: [why it matters to this paper]
- ...
After writing, print:
[HUMAN EDIT REQUIRED] where information could not be determined from the source filesAsk the user to review and fill in any gaps.
This file is consumed by:
/audit-section (Step 3: factual accuracy cross-reference)/check-consistency (Step 1: canonical values)/edit-section (Step 2: correct claims and framing)/full-paper-audit (Step 3: cross-section consistency)/audit-captions (Step 5: terminology compliance)/outline (Step 3: project-specific structural checks)/research (Step 4/7: relevance assessment)If the paper evolves, re-run /build-context to regenerate. The skill will overwrite the existing guidance/paper-context.md. The user should review the diff to ensure nothing important was lost.
guidance/paper-context-main.md). Skills that read guidance/paper-context.md will use the default; the user can specify alternatives.