/spark-to-paper:ts-paper-refinefrom spark-to-paper
Polishes a Traitement du Signal journal paper draft: right-sizes sections to journal length, enforces coherence, removes redundancy, preserves citations/math, and scrubs AI tells.
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.
None: SKILL.md is the whole skill.
Do this as one reasoning pass over the whole draft (you see every section at once, so coherence and de-duplication are free). The original's purpose was conference page-compression — that is wrong for a journal. Traitement du Signal papers are substantial (≈8–14 two-column pages); right-size, do not aggressively cut.
Length toward the template's targets — the table below is the ts_iieta default; for another
template, right-size to its template.json sections[].words (e.g. NeurIPS bands differ). The
spec is authoritative (draft_lint reads bands from template.json). Expand thin sections, trim only
genuine bloat — never compress below the floor:
| section (ts_iieta) | final words |
|---|---|
| method | 2000–3000 |
| experiments | 1000–1500 |
| introduction | 800–1200 |
| related_work | 800–1200 (3 themes) |
| analysis | 900–1400 |
| conclusion | 200–280 (1 paragraph) |
| abstract | 150–220 (1 paragraph) |
These bands target a substantial ~10–12 page two-column TS article. Expand by adding real substance (more method detail/derivation, more components, deeper analysis, more ablation discussion, fuller related-work lineage) — never by padding, restating, or filler sentences.
Coherence: the same method/component/dataset/baseline names everywhere (use the blueprint terminology); no contradictions between sections; intro/abstract accurately summarize what Method/Experiments actually say.
No redundancy: each mechanism explained once (Method), not re-derived in Analysis; remove repeated motivation across intro/related/method.
Preserve exactly: every \cite{}, every equation, every \ref{}, every table/figure label and the -- result placeholders. Refinement changes prose, never citations/structure/math semantics.
Honesty intact: still zero fabricated numbers in any sentence; results stay forward-looking; tables stay blank.
TS tone: no bold in body, hedged conclusion language, no hype, no filler phrases.
Every section was drafted by an LLM, so it is prone to AI tells. Read each section and rewrite where it improves (don't churn natural sentences). Scan for and replace:
\cite/\ref/math intact; add no new emphasis.
draft_lint code-enforces (hard-fails, ai_tell) ONLY the CONTEXT-FREE canned phrases — tapestry,
testament, "plays a crucial role", "it is worth noting", "delve into", "realm of", "paradigm shift",
"navigating the landscape", "ever-evolving", … plus in order to — those MUST be gone. The
CONTEXT-DEPENDENT cohesion tells — em-dashes, sentence-initial firstly/moreover/furthermore/additionally,,
not only … but also, rule-of-three triplets, leverage/utilize — are deliberately NOT gated (a regex
would kill the good appositive em-dash along with the abuse — precisely what produced the comma soup): you
remove the abuse by judgment while keeping legitimate uses. (Source: PaperJury writing-toolkit de-ai.)After you change a passage, re-read ONLY that passage for a show-stopper introduced by the edit: a logic contradiction, an undeclared terminology switch (a term silently renamed), or severe Chinglish. Fix it; do not raise style nits here (the de-AI pass owns those). This is the in-pass honesty check; the adversarial peer-review (ts-paper-review, stage 5, runs by default) is the heavier, separate hardening loop that runs after this stage and routes its fix-now issues back here in Review-fix mode.
template.results_mode == "data_aware")When the paper reports real results (data-aware — see ts-paper-data), the "remove unbacked
numbers" instinct inverts for numbers that trace to results.facts.json:
"TBD" metric).results.facts.json (the number-audit re-runs after refine).
Everything else (length right-sizing, coherence, de-duplication, tone) is as in proposal mode.If the active template is a journal (e.g. ts_iieta), strip any leaked conference framing ("to fit
the page limit / 8-page / camera-ready") and don't over-compress — journals are substantial. If the
template is a conference style (e.g. neurips), respect its tighter conventions instead. Let the
template's word bands — not a fixed venue habit — decide length.
Re-run python ../ts-paper-write/scripts/draft_lint.py <workdir> — it now fails the build on any section outside its template.json word band and on any broken shape contract, so "right-sized" is verified in code, not by eye. Drive every word_band violation to zero by expanding thin sections with real substance (more method detail, more discussion, a deeper failure analysis) — never by padding. Then re-run python ../ts-paper-cite/scripts/citations_lint.py <workdir> to confirm citations survived. Re-run both until they exit 0 (ok:true); do not hand off on a nonzero exit. Then run python ../ts-paper-write/scripts/reflow_tex.py <workdir> so every sections/*.tex is one logical line per paragraph (your de-AI rewrites may have re-wrapped them; idempotent, PDF-neutral). Then write logs/4_refine.io.md (INPUT: pre-refine word counts; DECISIONS: per-section deltas + what was added/cut; OUTPUT: post-refine counts, all in band). Hand off to ts-paper-review (stage 5, the default next stage): it returns a triaged issue list, and for each fix-now issue the orchestrator re-invokes THIS skill in Review-fix mode (below). Only after review is dry/closed does the chain proceed to ts-paper-figure then ts-paper-latex. If the user explicitly opted out of review, hand directly to ts-paper-figure.
This mode is triggered only when the orchestrator hands you one ts-paper-review issue
{section, severity, evidence_quote, close_criterion} to close. It is a separate entry path: do not
run it on a normal stage-4 invocation, and do not run the holistic right-size / de-AI pass here. The
default full-pass behavior above is unchanged.
close_criterion true. Bind
strictly to that criterion; do not touch other sections and do not over-rewrite.\cite{}, equation, \ref{}, table/figure label, the -- placeholders,
and the section's template.json word band (stay in band — no compression below the floor).draft_lint now hard-fails notation_incomplete (this is exactly the path that let a
stray \psi into the central equation), so an unmatched new symbol will block the re-gate below.python ../ts-paper-write/scripts/draft_lint.py <workdir> AND
python ../ts-paper-cite/scripts/citations_lint.py <workdir> until both exit 0 (ok:true) to confirm
nothing broke (including notation_incomplete); do not return a fix on a nonzero exit.logs/5_review.io.md
(the review log — not 4_refine.io.md).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.
Other plugins' skills for the same job