npx skills add ...
npx skills add snl-ucsb/paper-writing-skill --skill paper-writing
Research paper writing assistant that enforces Arpit Gupta's editorial principles, voice profile, and writing workflow. MANDATORY TRIGGERS: Use this skill whenever the user mentions writing a paper, drafting a section, revising a section, editing a paper, reviewing a draft, rewriting an introduction, writing an evaluation, polishing prose, compressing text, or any task involving .tex files, Overleaf, conference submissions, or paper deadlines. Also trigger when the user mentions any paper by name (NetBurst, NetForge, BQT+, TurboTest, etc.) in a writing context. This skill should activate for ANY research writing task — sections, abstracts, rebuttals, camera-ready edits, cover letters, or response to reviewers.
npx skills add snl-ucsb/paper-writing-skill --skill paper-writing
This skill encodes the writing methodology of the Systems and Networking Lab (SNL) at UC Santa Barbara, derived from forensic analysis of 6 papers (8 submissions), 7,600+ Overleaf edits, 100+ tex file versions, and 5 peer review processes. See The Paper Behind the Paper for the full analysis. It works out of the box — the default rules are calibrated and battle-tested.
The pipeline (fixed): A five-stage writing workflow. Does not change between users or papers.
The voice and editorial rules (defaults provided, customizable): Sentence-level style, structural rules, compression patterns, section checklists. These ship with the SNL lab's rules as defaults. Students may customize by editing files in author_profile/ — see the README for what to change.
The project context (per paper): Identity sentence, venue, contribution claims, locked decisions. Lives in a project_context.md in the paper's working directory.
This skill does not operate in isolation. It is part of a three-skill family, and the artifacts from the other two skills are direct inputs to the writing process:
From the literature-survey-skill:
From the data-visualization-skill:
exploration_log.md) → feeds Brainstorming Phase 3 (Evaluation Design). The exploration forced you to look at your data from multiple angles before forming hypotheses. The surprises you found — distributions you didn't expect, subgroups that behaved differently — shape what claims are defensible and where the real contribution lives.braindump.md) → feeds the figure/table plan. Each braindump articulates what question a figure answers, what you expected to see, and what would surprise you. These are the hypotheses your evaluation must validate.plot_context.md) → feeds the Architecture stage's figure/table plan. Each plot_context records intent, variable mappings, plot type rationale, and design decisions — ready-made entries for the paper's figure plan.The three skills create a closed loop: the literature survey reveals the gap and teaches you how accepted papers communicate; data visualization forces you to understand what your evidence actually shows and what hypotheses it validates; paper writing turns both into a publishable argument. If the student has artifacts from the other skills, Claude MUST load them.
author_profile/ — these are the source of truth for editorial rulesproject_context.md in the paper's working directoryexploration_log.md, braindump.md, plot_context.md, WALTER narrations. If found, load them as reference material for the relevant pipeline stagesThe biggest obstacle for students isn't writing — it's that their ideas live as unstructured intuitions. They know something is interesting but can't articulate what or why. The brainstorming process transforms scattered thinking into a precise project context that drives every section of the paper.
Claude MUST read brainstorming_guide.md and walk the student through its 6 phases interactively. The phases are:
| Phase | Focus | Key outcome |
|---|---|---|
| 1. Problem Discovery | Who suffers, what breaks, why it breaks structurally | The opening paragraph's stakes and the Problem Gap |
| 2. Contribution Crystallization | Core claim, headline number, key abstraction name | The identity sentence and contribution list |
| 3. Evaluation Design | Baselines, metrics, datasets, experiment-to-claim mapping | The evaluation plan that constrains what the introduction can promise |
| 4. Positioning and Framing | Venue fit, competitive positioning, category creation vs. competition | The Related Work positioning sentence |
| 5. Architecture and Constraints | Design pipeline, locked decisions, open questions | The Design section's structure and the project's scope |
| 6. Narrative Spine | Story arc, the "inevitable" moment, the tweet-length pitch | The thread connecting every section |
project_context.md using the template in examples/project_context.md. See examples/netburst_project_context.md for a real example of what a complete project context looks like.Claude MUST read these files from this skill's directory. They contain the detailed rules with examples.
| File | What it controls |
|---|---|
author_profile/editorial_principles.md | 14 cross-paper principles with evidence (introduction-twice, named-over-vague, what→why→so-what headings, compress-after-expanding, etc.) |
author_profile/craft_reference.md | How to write (the positive layer). Sentence-level style (~21-word mean, claim-first, active voice, named-over-vague, no filler), composition craft, and three registers: base/terse, conceptual/position, warm/narrative. Read while drafting a paragraph. |
author_profile/gate_mechanical.md | The single mechanical grep gate (M1–M18). Em-dashes, antithesis, intensifiers, banned + pompous + fancy verbs, throat-clearing, passive voice, wordiness, qualifiers, term-drift — one grep script. Run on every tex edit; the passive-voice scan also runs in the base gate. |
author_profile/gate_semantic.md | The single reader-judgment gate (S1–S31). Define-before-use, followability, parse-accessibility, thesis-tie, lexical + decomposition consistency, non-duplication, rigor/grounding, honest positioning, figures, and the closure gate. Runs in the red-team/loop pass. |
author_profile/compression_patterns.md | 7 compression operations with before/after examples and quantitative benchmarks |
author_profile/rhetorical_moves.md | Cross-section move sequences for introduction (6 moves), design (5 moves), evaluation (6 moves), related work (3 moves) |
author_profile/intervention_types.md | 7 types of advisor interventions — use this to simulate advisor feedback on drafts |
red_team_protocol.md | Independent adversarial red-team (evidence-gated): after the mechanical audit, a reviewer that did NOT write the text re-runs gate_mechanical.md and applies gate_semantic.md, and must return CLEAN before text ships. |
loop_mode.md | Resumable /loop audit-and-fix protocol: a disk-backed ledger, one section per iteration, self-terminating when clean. |
These are extracted from the detailed files above. In case of conflict, the files are the source of truth.
Before presenting or committing ANY new or modified tex content, Claude MUST run a sentence-level style audit. This is not optional, not triggered by the user, and not limited to full section drafts — it applies to every edit, including paragraph-level changes, subsection additions, and overview rewrites.
The audit checks every changed sentence against author_profile/gate_mechanical.md, author_profile/compression_patterns.md, and author_profile/craft_reference.md. Specifically, scan for and fix:
gate_mechanical.md) — run FIRST, with its greps. Em-dashes (---, —, --) are BANNED. Antithesis/mirror flourishes ("X, not Y"; "whatever it is called"), editorializing closers ("the saving is the point", "is not real"), vacuous intensifiers ("in effect", "at its core"), rule-of-three decoration, throat-clearing openers ("Moreover", "Notably"), banned/pompous/fancy words, and content-free openers ("In this paper, we…") are BANNED. Target the plain, short, declarative register (craft_reference.md). Do NOT report the audit as passed without running the grep gate in that file.author_profile/gate_mechanical.md (§Part C, M11) in this base gate; fix or justify every hit.Process: After writing, (a) run the grep gate in gate_mechanical.md Part C and fix every hit, then (b) read the changed text line by line for the items above. Report a summary table of violations found and fixed (category, count), INCLUDING the grep counts (em-dashes, flourishes) — not just "audited". Never claim the audit passed on a mental pass alone. Then (c) run the independent adversarial red-team (red_team_protocol.md): a reviewer that did NOT write the text re-runs gate_mechanical.md and applies author_profile/gate_semantic.md (define-before-use, followability, thesis-tie, lexical + decomposition consistency, non-duplication, mappability, honest positioning, and the closure gate) with a fresh-reader lens, returning a findings list, not a yes/no. Only text that survives (a) + (b) + (c), with the grep output pasted as evidence, is presented or committed. Per gate_semantic.md's closure gate (S31), iterate the red-team after every substantive change until a final closure reviewer returns zero CRITICAL/MAJOR; never defer residual items as "done."
This gate is SEPARATE from and IN ADDITION TO the structural section checklists below.
Loop mode. When invoked via /loop (e.g. "apply the paper-writing skill iteratively", "audit with loop"), follow loop_mode.md: a resumable, ledger-backed audit → red-team → fix cycle that processes one section per iteration and stops itself when every in-scope section is clean. The user need not specify which checks to run or when to stop — the protocol supplies those.
After generating ANY section draft, Claude MUST also read the corresponding structural checklist and run it:
| Section | Checklist file |
|---|---|
| Introduction | writing_checklists/intro_questions.md |
| Evaluation | writing_checklists/evaluation_questions.md |
| Design / Method | writing_checklists/design_questions.md |
| Related Work | writing_checklists/related_work_questions.md |
Flag every violation before presenting the draft. Severity levels: CRITICAL (structural — will cause rejection), MAJOR (visible to reviewers), MINOR (polish-level).
For detailed guidance on move sequences within each section type, read from section_rhetorical_moves/:
| Section | File | Key moves |
|---|---|---|
| Introduction | section_rhetorical_moves/introduction.md | Stakes → Problem Gap → Key Abstraction → Design Intuition → Contributions → Results Preview |
| Evaluation | section_rhetorical_moves/evaluation.md | Setup Anchoring → Head-to-Head → Deep Dive → Takeaway Synthesis → Ablation → Robustness |
| Design | section_rhetorical_moves/design.md | Abstraction Introduction → Design Justification → Component Architecture → Key Design Decision → Robustness |
| Related Work | section_rhetorical_moves/related_work.md | Category Clustering → Per-Category Limitation → Positioning Sentence |
These contain actionable guidance with concrete examples showing what works and what doesn't, drawn from accepted and rejected systems and ML papers.
Every paper goes through these stages in order. Claude identifies which stage the user is in and enforces that stage's rules.
Gate: The user must have a one-sentence identity statement and contribution claims written as results. If they don't, read brainstorming_guide.md and walk them through all 6 phases interactively. Don't rush — this is the most important stage. A vague project context produces a vague paper.
After brainstorming, generate a project_context.md file using the template in examples/project_context.md and save it in the paper's working directory. See examples/netburst_project_context.md for a real example.
Important: After creating project_context.md, add it to the project's .gitignore (create the file if it doesn't exist). This file contains strategic framing notes and advisor commentary that should not be committed to shared repositories by default.
Gate: Section outline with claim assignments, per-section narrative arcs, figure/table plan, evaluation structure, and page budget.
Craft reference: If the student has run a literature survey (using the literature-survey-skill or manually), check for Pass 3+ paper notes with writing craft extractions — introduction anatomy, evaluation architecture, design section structure, and figure design choices from the strongest papers in their area. Load these as reference material for the architecture. The section structure of the best paper at your target venue is a better starting point for your outline than a generic template. Reading and writing develop together: craft patterns extracted during deep reading feed directly into the architecture of your own paper.
Figure/table plan from visualization artifacts: If the student has been working with the data-visualization-skill, check for plot_context.md files and WALTER narrations. Each plot_context.md records the intent, variable mappings, plot type rationale, and design decisions for a figure — these are ready-made entries for the figure/table plan below. Each WALTER narration (Hypothesis → Axes → Look here → Trend → Exception → Result) maps directly to the evaluation prose that will accompany the figure. The iteration the student did in the viz skill — exploring what the data shows, forming predictions, confronting surprises — has already determined which figures carry the argument. The architecture should reflect that.
Output a structured table:
| Section | Pages | Key claim | Figures/Tables |
|---|---|---|---|
| ... | ... | ... | ... |
Non-data figure specs: For each figure in the plan that is NOT a data figure (architecture diagrams, pipeline illustrations, concept diagrams, comparison schematics), read figure_synthesis_guide.md and run spec mode to produce a figure_spec.md. Data figures (CDFs, bar charts, heatmaps, scatter plots) should be routed to the data-visualization-skill. The boundary is clear: if the figure requires experimental data to render, it goes through /viz; if it illustrates structure, flow, or concepts, it goes through figure synthesis.
Enforced order: Draft 0 Introduction → Evaluation → Design/Method → Background → Related Work → Final Introduction → Abstract.
The introduction is written twice. This is the most impactful principle in the entire system (Principle 1).
Draft 0 Introduction comes first. It is a framing scaffold — stakes, problem gap, rough contribution claims — that sets guardrails for the evaluation. Draft 0 clarifies what the paper is trying to show. It is explicitly disposable: it probably will not survive to the final version. Writing is a thinking tool, not just a communication tool — Draft 0 forces the student to externalize their framing before designing experiments.
The evaluation comes next, constrained by Draft 0's guardrails. Then Design, Background, and Related Work.
The final introduction is rewritten from scratch after the evaluation is complete. It promises exactly what the evidence supports — no more, no less. Draft 0 is reference material, not a starting point for editing. If the user asks to skip Draft 0 and go straight to evaluation, explain that evaluation without framing guardrails produces experiments that don't build toward a unified argument.
Per-section scaffolding: Before writing any section's full prose, write the topic sentences first. Read them in sequence — they should form a coherent argument on their own. If the topic sentences don't flow, the paragraphs won't either. Fill in the full paragraphs only after the topic-sentence sequence holds together. In LaTeX, a practical technique is to annotate each paragraph with a purpose comment before writing prose:
Each comment is a contract: the paragraph that follows must deliver on it. If a paragraph doesn't fit any comment, either the paragraph doesn't belong or a comment is missing.
Per-section audit: After generating a draft, read and run the appropriate checklist. Flag every violation with severity level before presenting the draft.
Cross-section consistency pass:
Read author_profile/compression_patterns.md for the 7 specific operations. Apply in order:
Target: 30–50% reduction from first draft. Report character count before and after.
Do not pad to fill page limits. If the paper is under the page limit after compression, that is fine. A short paper with appropriate content is better than a padded paper that reaches the limit. Padding introduces filler that weakens the argument.
After compression and before submission, Claude MUST automatically run these checks using shell commands on the paper's .tex and compiled .pdf files. Do not ask the student to run them manually — execute them and report results.
1. Page count. Extract page count from the compiled PDF and compare against the venue's limit (from project_context.md). Flag whether references/appendices count — this varies by venue.
2. Broken references. Search .tex source files for unresolved references that will render as [?] or ?? in the PDF. Also check the .log file for LaTeX warnings about undefined references and citations.
3. Embedded fonts. Verify all fonts are embedded. Non-embedded fonts cause rendering differences across machines and are rejected by some submission systems.
If any font shows no in the emb column, flag it and suggest adding \usepackage[T1]{fontenc} or compiling with GS_OPTIONS=-dPDFSETTINGS=/prepress.
4. Figure quality. Check that all included figure files are vector format (PDF/EPS) or high-resolution raster. List all figures referenced in the source and verify they exist.
Flag any PNG/JPG figures — these should be vector unless they are photographs or screenshots.
5. Anonymization (if double-blind). Search all .tex files for author names, institution names, grant numbers, acknowledgment sections, and self-citations that could reveal identity.
Replace AUTHOR_NAMES_HERE and INSTITUTION_HERE with actual names from project_context.md before running.
6. Column balancing. Check whether the balance package is loaded (for two-column formats). If not, suggest adding \usepackage{balance} and \balance before \bibliography.
7. Common LaTeX issues. Scan for frequently missed mechanical problems:
Report format: Run all checks, then present a single summary table:
| Check | Status | Details |
|---|---|---|
| Page count | ✓ or ✗ | N pages (limit: M) |
| Broken refs | ✓ or ✗ | List of undefined refs |
| Embedded fonts | ✓ or ✗ | List of non-embedded fonts |
| Figure quality | ✓ or ✗ | List of raster figures |
| Anonymization | ✓ or ✗ | List of leaks found |
| Column balance | ✓ or ✗ | Package present/missing |
| LaTeX issues | ✓ or ✗ | Count of dangling refs, duplicate labels |
Fix what can be fixed automatically (e.g., adding ~ before \cite). Flag what requires student decision (e.g., replacing a raster figure with vector).
project_context.mdauthor_profile/ filessection_rhetorical_moves/project_context.mdauthor_profile/intervention_types.md for the 7 intervention typeseditorial_principles.md), and a concrete rewriteauthor_profile/compression_patterns.mdauthor_profile/intervention_types.md) to simulate a round of feedback before spending a human reader's first reading on an early draft.project_context.md and the reviewsbrainstorming_guide.md and walk through all 6 phases to create their first project_context.md.section_rhetorical_moves/evaluation.md — they'll write the evaluation next, constrained by Draft 0.project_context.mdfigure_synthesis_guide.md and the relevant files in figure_templates/figure_spec.md/viz, not through figure synthesispdfinfo paper.pdf | grep Pagesgrep -n "LaTeX Warning.*undefined" paper.log
grep -rn '\\cite{' *.tex | grep -v '%' # list all citations for cross-checkpdffonts paper.pdf | grep -v "yes"grep -rn '\\includegraphics' *.tex # list all figure references
file figures/*.pdf figures/*.png 2>/dev/null # check file typesgrep -rni 'AUTHOR_NAMES_HERE\|INSTITUTION_HERE\|\\thanks\|acknowledgment' *.texgrep -rn 'balance' *.texgrep -rn '\\cite{.*}' *.tex | grep -v '~\\cite' # missing ~ before \cite (dangling references)
grep -rn 'et al\.' *.tex | grep -v '~' # missing ~ after "et al."
grep -rn '\\label{' *.tex | sort | uniq -d # duplicate labels