/spark-to-paper:ts-paper-datafrom spark-to-paper
Writes LaTeX paper sections from real experimental data. Reads CSV/JSON/tables, fills results tables with measured numbers, and produces matplotlib figures. For data-driven proposals and reports.
Ships in spark-to-paper. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
The proposal path forbids numbers and writes forward-looking ("we expect…"). DATA-AWARE mode inverts
that: the experiments are done, so report what was measured, in past tense, with the real numbers.
Per the project philosophy, Claude reads and judges the data itself — no rigid results.json schema,
no loader. Code does only the two irreducible things: machine-check that no number is fabricated, and
plot precise results figures.
Only when the router set template.results_mode == "data_aware" (the input had real results — a
file, a pasted table, or measured numbers in the prose). Otherwise the suite stays in proposal mode and
this skill is not used.
results.facts.json (the one artifact)Read whatever the user gave — a CSV, a JSON, a Markdown/LaTeX table, or numbers written in the proposal
prose. Understand it: which methods/variants, which datasets, which metrics, ablation deltas, runtime
costs, and any qualitative findings. Then write results.facts.json — simply the set of REAL numbers
you will use, in any convenient shape (a flat list, or {"label": value}, or nested). This is the
ground truth the number-audit checks against. Example:
{"main": {"Ours": {"HOTA": 0.621, "IDF1": 0.704}, "ByteTrack": {"HOTA": 0.476}},
"ablation": {"w/o formation prior": {"IDsw": 0.18}}, "runtime": {"fps": 27.3, "latency_ms": 36},
"notes": ["FPR is 0.03 — non-zero, a real weakness"]}
Rules: every number must come from the user's data — never invent or round-trip a number that wasn't
given. A metric that was measured-but-unavailable is the sentinel "TBD"; a cell never run is null.
Write the experiment result tables directly in sections/experiments.tex (same LaTeX table pattern as
proposal mode, with \label{tab:main_results} / secondary_results / ablation_results in the spec
order) — but with the real measured numbers in the cells instead of --. null → --; "TBD" →
TBD. Keep cells consistent with results.facts.json (the audit cross-checks the prose, and you should
keep table and prose numbers identical). Do not write a metric the data doesn't contain.
For each result-bearing section the active template defines (abstract + experiments always; plus any
analysis / results / limitations section present in template.sections), swap the proposal-mode rules
for evidence-grounded ones:
-- in prose, NO vague outcomes.method / related_work / introduction are written normally (no results numbers).
TBD rule: a TBD/missing metric is unavailable evidence — stay silent about it; never guess it.The single owner of drawing figures is ts-paper-figure (routing is by SECTION: matplotlib ONLY for
the results-section data plots, image model for every other figure). In data-aware mode it draws the results plots from CODE
(numerically exact, never the image model) using THIS skill's toolkit and the numbers in
results.facts.json / your filled tables. Your job in the data stage is to make sure results.facts.json
and the filled tables exist (Steps 1–2); the figure stage runs the plotter.
The toolkit it uses (kept here):
scripts/plot_results.py --script figures/<label>.plot.py --out figures/<label>.png — runs a
self-contained matplotlib script and saves PNG + a vector PDF (born-vector, even if the script
self-saves). The figure stage embeds that .pdf via an extension-less \includegraphics{figures/<label>},
so matplotlib figures are editable vectors with no extra step (they skip the DrawAI hybrid vectorization in
ts-figure-optimize, which is only for image-model rasters).scripts/plot_style.py — the figures4papers publication house style; plot_results.py applies the
rcParams and injects PALETTE, SEMANTIC, style_axes, finalize into the plot script's namespace.references/plot-style.md — colour BY MEANING (SEMANTIC["ours"] blue / ["positive"] green /
["contrast"] red / ["baseline"] grey) + per-chart encoding rules (bars: black edges, value labels,
alpha-ablation, hatch for grayscale, tight y-limits; trends: 2–4 curves + fill_between; heatmap/radar;
wide canvas + dedicated legend axis) + finalize(fig, OUT) (dpi 300, +PDF; 600 for dense bars).
A null/TBD value is a gap in the plot, never a fabricated point. (This matplotlib toolkit is for the
results-section data plots only. Concept / math-geometry illustrations are NOT drawn here anymore —
the figure stage routes every non-results figure to the image model, since matplotlib renders concepts poorly.)Run the write-stage linter; in data-aware mode it flips from "ban all numbers" to "flag untraceable ones":
python3 ../ts-paper-write/scripts/draft_lint.py <workdir>
It flags suspicious_number for any decimal/percent in prose not present in results.facts.json
(bare integers are treated as design constants and not audited), and missing_results_facts if you
forgot to write the facts file. Drive it to zero by correcting the prose to the real numbers — never by
adding a fake number to the facts file; it must be ok:true before proceeding. citations_lint and the
rest of the suite are unchanged.
If the input was an idea/proposal whose claimed outcomes don't match the real data, silently align the claims to the data as you plan and write (a proposal that predicted "large gains" but the data shows a small gain must say the small gain). This is just honest writing against the evidence — no separate fusion artifact needed.
Write logs/data.io.md — INPUT (the data form received + what you extracted), DECISIONS (table values,
per-section number choices, any TBD/weakness surfaced, the plot scripts), OUTPUT (results.facts.json
summary, draft_lint result). This is a conditional log (only when results_mode == data_aware); it is
linked from logs/index.md when this stage runs.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Generated from the plugin's indexed repository (spark-to-paper-skills/spark-to-paper-skills) — no native marketplace selected
npx claudepluginhub p/spark-to-paper-skills-spark-to-paper14 skills in this plugin
/ts-figure-optimizeThe suite's SOLE figure vectorizer: turn ONE raster scientific figure (a PNG/JPG, e.g. a gpt-image-2 schematic) into an editable, publication-ready figure via DrawAI's **key-free HYBRID** — local perception (SAM3 region detection + PaddleOCR + Box-IR layout, no account) then a deterministic hybrid build that keeps the approved render **pixel-exact** (a whole-canvas raster) and lays an **editable <text> overlay** on top (~0.91 SSIM), exported as a self-contained SVG + vector PDF + an editable PPTX. The render's full richness is preserved EXACTLY (it IS the approved image) while every label becomes editable. The original raster is always kept. Hybrid is the ONLY mode used: there is no Codex full-vector redraw (legacy/off — it needs an account, and a redraw of a dense figure loses fidelity) and no Claude-redraw fallback. If this runtime cannot be provisioned, the caller keeps the approved PNG as-is — never a lossy redraw. Independent of the paper pipeline — give it any figure image.
/ts-figure-svgPaperBanana+ — turn a paper's figure brief into a native, editable, publication-grade SVG. Stage 1 runs the OFFICIAL PaperBanana (dwzhu-pku/PaperBanana, pulled by `setup_paperbanana.py`, its own Retriever→Planner→Stylist→Visualizer→Critic pipeline) to produce candidate PNGs. Stage 2 is the "+": Claude LOOKS at the chosen PNG, extracts its DESIGN LANGUAGE (palette, type scale, spacing, idiom) into a style sheet, then redraws the figure FROM THE PAPER'S FACTS as real <rect>/<path>/<text> objects — never tracing pixels, never embedding the PNG. Stage 3 is a measured repair loop: `audit_svg.py` (stdlib, no renderer needed) catches overflow, text-on-text, icons cutting labels, stroke-scaled and canvas-clipped arrowheads, dangling connectors, sub-legible type, font-fallback glyphs, CSS-cascade colour traps and traced path-soup; ≥4 rounds, no upper bound while defects remain. Ends on a vector PDF verified on the real compiled page. Use when a figure must be editable and correct, not merely pretty.
/ts-idea2storyTurn a raw research idea into a compelling, well-grounded research STORY (an 8-field structured proposal) ready to feed the ts-paper pipeline. Claude does almost everything natively — idea packaging, recall reasoning over a knowledge graph, agentic external literature search (WebSearch/WebFetch), story generation, and a critique→refine→fusion loop; tiny scripts do only embeddings/recall math and the schema gate. Emits story.json + story_proposal.md + retrieved_papers.json (a citation seed the cite stage reuses, so paper-writing searches less). Use when the user has an idea (not yet a full proposal) and wants a paper-ready story.
/ts-kg-buildBuild a reusable research-PATTERN knowledge graph from a paper corpus, so ts-idea2story can recall prior problem→solution→story patterns. Claude does the reasoning (story-first pattern extraction, cluster naming + summaries); small scripts do the irreducible math (embeddings via a USER-SUPPLIED endpoint, clustering, graph assembly). Best-effort and honestly optional — without an embedding endpoint it degrades to a flat in-context "pattern shelf". Use to (re)build the KG for a domain, or skip it and let ts-idea2story rely on web search alone.
/ts-paperGenerate a complete, publication-format journal/conference paper (LaTeX → compiled PDF) from whatever the user drops — a one-line idea, a proposal, or a proposal WITH real results. It ROUTES the input (idea→idea2story; proposal→proposal mode; results-present→data-aware mode), then runs plan→cite→write→refine→review→figure→latex using Claude's native abilities (reasoning, WebSearch, vision, file I/O, running Python) instead of a heavyweight per-call pipeline. Template-agnostic (ts_iieta + neurips bundled). Use for "write the paper", "proposal to paper", "turn this idea/report into a paper". Integrity is absolute: in proposal mode never fabricate numbers; in data-aware mode every number must trace to the user's real data.
/ts-paper-citeStage 2 of the ts-paper suite. Build a complete, REAL refs.bib for a Traitement du Signal paper — using the user's provided references first and Claude's native WebSearch/WebFetch only for genuine gaps. Every entry must have full metadata (authors, year, venue, vol(issue):pages, DOI); never a title-only stub; reference count is driven by real evidence, not a quota. Use when assembling or fixing the bibliography of a TS paper, or whenever citations must be real and complete.
Other plugins' skills for the same job