/spark-to-paper:ts-paper-citefrom spark-to-paper
Builds a complete, real refs.bib for a Traitement du Signal paper by using user-provided references and Claude's web search only for genuine gaps. Ensures every entry has full metadata.
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.
Citations support real claims with real evidence. Every entry in refs.bib is a paper that
actually exists and that you verified. This stage replaces the original 100+-call retrieve→triage→
slot→bind→postdraft engine (which fabricated title-only stubs to hit hardcoded quotas) with a few
Claude reasoning passes + native web search.
A TS journal paper is expected to be well-read: it situates itself in a full literature, not a minimal one. Do NOT stop at "just enough" — search broadly and systematically, then keep only the real, well-matched papers. This is the original product's strength (systematic query planning → retrieve many → triage), minus its fabrication.
retrieved_papers.json exists in the workdir (written by ts-idea2story, which already searched the literature), ingest it as a verified seed: for each paper run scripts/doi2bib.py <doi> to upgrade it to complete BibTeX (the DOI must resolve, or drop it — Crossref is authoritative over the seed's own metadata), and use its abstract+supports_claim to place it into claims_map.json. This is NOT a free pass — it removes the cold-start sweep, but you still verify each, place by abstract, and gap-fill below. Then the angles you must still search are the ones the seed does NOT cover.retrieval_plan.md:
abstract → family classification → section routing:
section + claim in claims_map.json. Do NOT slot a paper by its title alone; the abstract is what justifies both "is it relevant" and "where does it go".
Log kept/rejected counts per angle in retrieval_plan.md.scripts/doi2bib.py <doi> (deterministic, ASCII-folded, no LLM). User-provided references take priority and are preserved exactly.refs.bib (complete entries only) + claims_map.json, then run the linter (which now enforces a coverage floor).@article/@inproceedings/@book with all fields populated. A bare @misc{key, title={...}} stub is forbidden. If you can only find a title, the paper is not verified — do not cite it.scripts/doi2bib.py <doi> (which actually resolves the DOI against Crossref) or a real venue/publisher/arXiv/Crossref/DBLP page. citations_lint.py by default only checks structural completeness (the fields are present) — it cannot tell a real DOI from an invented one; DOI resolution is enforced only under the opt-in citations_lint.py <workdir> --resolve flag (and by doi2bib.py), not by the default lint. Do not trust a title that only appears in your own generated text.firstauthorYEARkeyword, ASCII, no leading digit); reuse it everywhere; never duplicate a paper under two keys.scripts/doi2bib.py <doi> to fetch a fully-populated BibTeX entry from Crossref deterministically (no hand-transcription). For an arXiv-only preprint, give doi2bib.py the arXiv id instead — it takes an arXiv path (arXiv API → eprint/archivePrefix, journal={arXiv preprint}) so the venue field is satisfied without a Crossref DOI.citations_lint.py --resolve resolves DOIs only; it skips entries that have an eprint (arXiv) and no doi, treating the arXiv id as its own existence signal — so a legitimate preprint is never wrongly flagged doi_unresolved.Coverage is template-driven and enforced on TWO axes by citations_lint.py — a global count
and a per-section distribution. The global floor alone is NOT sufficient: a paper can clear 40
total cites while whole body sections carry zero and related_work overflows its band. Both axes read
template.json's citations block:
citations.floor; TS ts_iieta = 40, target ~40–50; neurips = 30) →
coverage_below_floor if under.citations.per_section_coverage, e.g. related_work:[20,30],
introduction:[8,12]) → an evidence-bearing body section (introduction/related_work/method/
experiments/analysis) with zero cites is a HARD error section_zero_citations; a non-empty
section outside its band is a warning section_coverage_out_of_band (rebalance — move/merge
real cites; never fabricate or delete real support). Citation-free sections in a proposal
(abstract, conclusion, future_work) are exempt from the zero-error.A well-read paper sits at/above the floor and spreads its evidence across every body section. The only way to satisfy both is to search more broadly for real papers and place each in the section whose claim it actually supports — never to invent, pad, or dump everything into related_work. Stub/incomplete entries hard-fail separately, so coverage can only be cleared with real, fully-specified papers ("search harder", never "fabricate"). The seed from ts-idea2story (step 0) counts toward this once each entry is verified.
Per-section coverage (real papers; expand the search until each is genuinely covered):
To reach 40–50 honestly, widen the angle set (more sub-lineages, more surveys, the foundational works behind each component, neighbouring tasks) rather than padding with off-topic papers. If after a genuinely broad search a niche topic truly has little prior work, fewer is acceptable and honest — but for a mainstream TS topic, under 40 almost always means the search was too shallow. Do not bloat with off-topic papers to hit the number; an off-topic cite fails claims_map.json's weak_claim_match anyway.
Numeric [n] via natbib: the bundled ts_iieta.sty sets \setcitestyle{numbers,square,comma,sort&compress} with \bibliographystyle{unsrtnat}. The write stage emits \cite{bibkey} (or \cite{k1,k2,k3} for grouped) — never hand-typed [1]. No citations in the abstract or in headings.
Cite only to support claims about prior work / datasets / methods / metrics. Never cite to imply your proposed method has results it doesn't, and never hang a citation on a fabricated "outperforms by X%" sentence.
claims_map.json (enforced claim↔citation matching)Alongside refs.bib, write claims_map.json mapping every bibkey you will cite to its justification:
{ "chung2016syncnet": {"claim": "lip-sync models detect audio-video offset by contrasting windows",
"support_label": "same_line_support", "section": "related_work"} }
support_label ∈ {direct_core, same_line_support, context, baseline, dataset_metric, definition}. If the honest label for a match is off_topic/adjacent/weak, do not cite — drop or rephrase the claim. This makes the one-pass claim-matching an auditable artifact instead of a trust-me step.
Citations are inserted in the write stage, so the per-section bands above are only meaningful after
the draft exists. Re-running citations_lint.py on the drafted sections/*.tex is mandatory: it now
fails on any evidence-bearing section left with zero cites (section_zero_citations) and on any
claims_map section that disagrees with where the key is actually cited
(claims_map_section_mismatch). Do a positive pass to catch citeable sentences the draft introduced
that carry no cite — without porting the product's heavyweight ledger/cluster engine (the per-section
gate distills its essential purpose deterministically).
\cite. (Self-method, self-results, and future-work sentences
are non-citeable — never bolt a prior-work cite onto a results sentence.)doi2bib.py + claims_map.json discipline;
honesty-by-omission if no real paper fits. At most 3–4 new cites per rewritten paragraph; preserve
every existing \cite exactly.citations_lint.py (the floor + claim-match gate already exists; no new linter needed).data_aware mode, treat results sentences as citeable measurement claims that should cite
the dataset/baseline they report on, and nudge the floor up slightly (e.g. +4) — real data warrants
a denser bibliography.Run python scripts/citations_lint.py <workdir>; it must report zero issues:
\cite{key} in sections/*.tex resolves to a refs.bib entry; no orphans; no dup keys;doi2bib.py and, when network is available, by the authoritative existence gate
python scripts/citations_lint.py <workdir> --resolve (opt-in; default OFF to keep offline/sandboxed runs
deterministic), which flags doi_unresolved for any DOI that 404s.claims_map.json entry with a non-weak support_label (else cite_without_claim_justification / weak_claim_match), and its section field MUST match a section where the key is actually cited (else claims_map_section_mismatch);section_zero_citations, hard), and every section within its per_section_coverage band (section_coverage_out_of_band, warning — rebalance, don't fabricate). The report's cites_per_section shows the live distribution.
Run it again after the write stage (cites are inserted there) — the per-section and section-mismatch gates can only be satisfied once the drafted sections/*.tex exist. Then write logs/2_cite.io.md — INPUT (claims needing support), DECISIONS (per-claim: provided vs Crossref-fetched vs dropped; the DOIs used), OUTPUT (refs.bib + claims_map.json summary).What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
bibtex, bibliography, citations, academic-writing, signal-processing
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