paper-creator
Scientific paper writing in LaTeX -- full pipeline from structure to compiled PDF. TDD-driven: every section is compiled and verified before moving to the next. Covers project scaffolding, citation management (OpenAlex to BibTeX), per-section academic writing with self-reflection, figure/table inclusion, LaTeX compilation, and comprehensive verification. Triggers on: 'write a paper', 'create a paper', 'academic paper about', 'scientific paper', 'LaTeX paper', 'write up results as a paper', 'draft a paper on', 'research paper about', any request to produce a formal academic/scientific paper in LaTeX. Assumes research findings, data, and/or figures already exist or will be provided -- this skill handles the WRITING, not the experimentation.
What this skill does
# Scientific Paper Creator
Write publication-quality scientific papers in LaTeX with a **test-driven workflow**: every section is compiled and verified before moving to the next. The paper is never in a broken state.
## Bundled Resources
This skill includes ready-to-use scripts and templates. Paths are relative to the skill directory (find it via `glob("**/KORTIX-paper-creator/")`):
| Resource | Path | Purpose |
|----------|------|---------|
| **LaTeX template** | `assets/template.tex` | Minimal IMRaD template -- copy to `main.tex` |
| **BibTeX generator** | `scripts/openalex_to_bibtex.py` | Convert OpenAlex API JSON to `.bib` entries |
| **Compiler** | `scripts/compile.sh` | `pdflatex + bibtex` pipeline with error reporting |
| **Verifier** | `scripts/verify.sh` | TDD verification suite (12 checks) |
## The TDD Rule
**After writing every section:**
```
1. WRITE section → sections/{name}.tex
2. COMPILE: bash compile.sh paper/{slug}/main.tex
3. VERIFY: bash verify.sh paper/{slug}/
4. If FAIL → FIX → go to 2
5. If PASS → move to next section
```
The paper must compile and pass verification at every step. Never batch errors. Never skip verification. This is non-negotiable.
## Pipeline Overview
```
Phase 1: SCAFFOLD → Create project, copy template, initialize empty sections
Verify: compiles to valid (empty) PDF ✓
Phase 2: CITE → Search literature (OpenAlex), build references.bib
Verify: bibliography builds without errors ✓
Phase 3: WRITE → Per-section composition in writing order
Verify: compile + verify after EACH section ✓
Phase 4: POLISH → Self-reflection pass, strict verification, final build
Verify: verify.sh --strict passes with zero warnings ✓
```
## Filesystem Architecture
```
paper/{paper-slug}/
├── main.tex # Master file (\input sections)
├── references.bib # BibTeX bibliography
├── sections/
│ ├── abstract.tex
│ ├── introduction.tex
│ ├── related-work.tex
│ ├── methods.tex
│ ├── results.tex
│ ├── discussion.tex
│ └── conclusion.tex
├── figures/ # .pdf/.png figures (+ generation scripts)
├── data/ # Supporting data, CSVs (optional)
└── build/ # Compilation output
└── main.pdf
```
## Phase 1: Scaffold
### 1a. Create project structure
```bash
SLUG="paper-slug-here"
mkdir -p "paper/$SLUG"/{sections,figures,data,build}
```
### 1b. Copy and adapt the template
```bash
SKILL_DIR=$(find . -path "*/KORTIX-paper-creator/assets/template.tex" -exec dirname {} \; | head -1 | sed 's|/assets||')
cp "$SKILL_DIR/assets/template.tex" "paper/$SLUG/main.tex"
```
Edit `main.tex`: set `\title{}`, `\author{}`, and adapt `\documentclass` if targeting a specific venue:
| Venue | Document class | Notes |
|-------|---------------|-------|
| General / arXiv | `\documentclass[11pt,a4paper]{article}` | Default in template |
| IEEE conference | `\documentclass[conference]{IEEEtran}` | Remove geometry package |
| ACM conference | `\documentclass[sigconf]{acmart}` | Remove geometry, use acmart bib style |
| Springer LNCS | `\documentclass{llncs}` | Remove geometry, use splncs04 bib style |
### 1c. Initialize section stubs
Create each section file with a section header and TODO marker:
```bash
for sec in abstract introduction related-work methods results discussion conclusion; do
SECTION_TITLE=$(echo "$sec" | sed 's/-/ /g; s/\b\(.\)/\u\1/g')
if [ "$sec" = "abstract" ]; then
echo '\begin{abstract}' > "paper/$SLUG/sections/$sec.tex"
echo "% TODO: Write abstract" >> "paper/$SLUG/sections/$sec.tex"
echo '\end{abstract}' >> "paper/$SLUG/sections/$sec.tex"
else
echo "\\section{$SECTION_TITLE}" > "paper/$SLUG/sections/$sec.tex"
echo "\\label{sec:$sec}" >> "paper/$SLUG/sections/$sec.tex"
echo "% TODO: Write $sec" >> "paper/$SLUG/sections/$sec.tex"
fi
done
```
### 1d. Initialize empty bibliography
```bash
echo "% References for $SLUG" > "paper/$SLUG/references.bib"
echo "% Generated by openalex_to_bibtex.py and manual entries" >> "paper/$SLUG/references.bib"
```
### 1e. VERIFY: First green state
```bash
bash "$SKILL_DIR/scripts/compile.sh" "paper/$SLUG/main.tex"
bash "$SKILL_DIR/scripts/verify.sh" "paper/$SLUG/"
```
The empty paper must compile cleanly. This is your baseline. Every subsequent change maintains this green state.
## Phase 2: Literature & Citations
### 2a. Search for papers
Load the `openalex-paper-search` skill for OpenAlex API reference. Search strategy:
```bash
# Seminal/highly-cited papers
curl -s "https://api.openalex.org/works?search=YOUR+TOPIC&filter=cited_by_count:>50,type:article,has_abstract:true&sort=cited_by_count:desc&per_page=15&select=id,display_name,publication_year,cited_by_count,doi,authorships,abstract_inverted_index&[email protected]"
# Recent work (last 2-3 years)
curl -s "https://api.openalex.org/works?search=YOUR+TOPIC&filter=publication_year:>2023,type:article&sort=publication_date:desc&per_page=15&[email protected]"
# Review/survey papers
curl -s "https://api.openalex.org/works?search=YOUR+TOPIC&filter=type:review&sort=cited_by_count:desc&per_page=10&[email protected]"
```
### 2b. Generate BibTeX entries
Pipe OpenAlex results through the converter:
```bash
curl -s "https://api.openalex.org/works?search=YOUR+TOPIC&per_page=20&[email protected]" | \
python3 "$SKILL_DIR/scripts/openalex_to_bibtex.py" >> "paper/$SLUG/references.bib"
```
For non-OpenAlex sources (web pages, books, reports), add manual BibTeX entries:
```bibtex
@misc{authorYYYYtitle,
title = {Page Title},
author = {Author Name},
year = {2024},
url = {https://example.com/page},
note = {Accessed: 2024-01-15}
}
@book{authorYYYYbook,
title = {Book Title},
author = {First Author and Second Author},
year = {2024},
publisher = {Publisher Name},
edition = {2nd}
}
```
### 2c. VERIFY: Bibliography builds
```bash
bash "$SKILL_DIR/scripts/compile.sh" "paper/$SLUG/main.tex"
bash "$SKILL_DIR/scripts/verify.sh" "paper/$SLUG/"
```
Check: zero BibTeX errors, all `.bib` entries parse correctly.
## Phase 3: Per-Section Writing
### Writing Order
Write sections in this order (each one builds on context from the previous):
1. **Abstract** (draft) -- establishes scope, will be revised last
2. **Introduction** -- context, problem, gap, contribution
3. **Methods** -- what you did and how
4. **Results** -- what you found
5. **Discussion** -- what it means, limitations
6. **Related Work** -- needs full paper context to position contribution
7. **Conclusion** -- recap, future work
8. **Abstract** (final) -- revise to match actual paper content
### The Writing Loop (for each section)
```
1. READ all previously written sections to build context
2. WRITE the section following the guidance below
3. COMPILE + VERIFY
4. SELF-REFLECT: re-read critically
- Every factual claim has a \cite{}?
- No filler words or empty hedging?
- Logical flow between paragraphs?
- Consistent with other sections?
- Quantitative where possible?
5. REVISE if needed → COMPILE + VERIFY again
6. Section DONE → next
```
### Section-Specific Guidance
#### Abstract (150-300 words)
Structure: **Context** (1-2 sentences) → **Problem** → **Approach** → **Key results** (quantitative!) → **Implications**.
```latex
\begin{abstract}
[Context sentence setting the broad area.]
[Problem: what gap or challenge exists.]
[Approach: what this paper does -- "We propose/present/introduce..."]
[Results: key quantitative findings -- "Our method achieves X\% on Y, outperforming Z by N\%."]
[Implications: why it matters.]
\end{abstract}
```
Rules: No citations in abstract. No undefined acronyms. Every number must appear in the actual results.
#### Introduction
**Funnel structure:** broad context → specific problem → gap in existing work → your contribution → paper outline.Related in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.