vibepaper
AI-agent-friendly scientific paper builder — analysis outputs wire directly into manuscript text.
No reported result value in a vibepaper document is typed by hand. Analysis scripts write key results to named CSV files; the paper references those values by name using Jinja2 templates; the build substitutes every reference before producing Word output. Every number in the final document traces back to a computed file — not the author's memory, and not an AI agent's memory.
The name is a nod to vibe coding: give an AI agent write access to output/facts/, have it update CSVs as it runs analysis, and rebuild. The agent authors the narrative and iterates the analysis; it cannot inject numeric values directly into the manuscript. Nothing falls out of date.
Using an AI agent?
Paste ONBOARDING_PROMPT.md into your LLM agent in the target project. It walks through auditing hardcoded numbers, writing facts CSVs from your analysis scripts, and verifying the build. Already using vibepaper? RETROFIT_PROMPT.md converts the hand-written words next to your facts ("under 1%", "nearly a year") into word filters and asserts. Moving to a new vibepaper release? UPGRADE_PROMPT.md checks what the upgrade changes and adopts the new features. The typical loop from there:
- Agent reads existing paper sections and analysis scripts
- Agent writes/updates
output/facts/*.csvafter each analysis run - You run
vibepaper— numbers update everywhere, with a hard error if any reference is missing
For a manual walkthrough, see the end-to-end example below.
The problem
Numbers in scientific prose go stale. You finish the analysis, write up the results, and six months later a reviewer asks you to rerun with a corrected dataset. Now you have updated CSVs and a paper full of hardcoded figures: "the mean increased from 4.6 to 9.2", "of the 7,318 variants that lost HIGH impact". Finding every number, checking which is still current, updating without introducing new errors — this is tedious, error-prone, and nearly impossible to review.
The solution
vibepaper separates computation from communication. Analysis scripts write their key results to named CSV files. The paper references those values by name using Jinja2 template syntax. The build pipeline substitutes every reference before passing the document to pandoc for final Word output.
Mean transcripts per variant doubled from
{{ vep_impact.giab_mean_v112 | dp(1) }} to
{{ vep_impact.giab_mean_v115_full | dp(1) }} on upgrading to Ensembl v115.
When you rerun the analysis, you rerun the build. The numbers update everywhere, simultaneously, with a loud error if any reference is missing.
Three design principles:
- Templates express intent; scripts express computation. No arithmetic in templates. If you need a percentage increase, the analysis script computes and writes it. The template formats it.
- Loud failures over silent omissions. A missing or renamed CSV column is a build error, not an empty string in the output.
- Every inserted value can be traced back to its template reference and source data file. Nothing is injected silently — if a value is in the paper, there is a
{{ }}reference in the Markdown and a data file that supplied it.
These constraints matter most in an agent-driven workflow: an agent can iterate analysis freely and update CSVs, but it cannot introduce transcription errors because no values are ever typed by hand.
Why not Quarto or R Markdown? Those tools embed code in the document itself (literate programming) and are excellent for that model. vibepaper is language-agnostic — your analysis scripts can be Python, R, bash, or anything else, and the paper is plain Markdown. Word output is first-class for journal submission. And an AI agent can iterate the analysis and update CSVs without ever touching the manuscript source.
End-to-end example
-
Create a facts CSV with your analysis result:
mkdir -p output/facts printf "field,value\nn,412\nmean_age,54.3\n" > output/facts/cohort.csv
-
Write a Markdown section referencing those values — save as
paper/results.md:# Results The cohort included {{ cohort.n | commas }} participants with a mean age of {{ cohort.mean_age | dp(1) }} years. -
Create
paper.toml:[paper] sections = ["paper/results.md"] name = "my_paper"
-
Build:
vibepaper
-
The output at
output/my_paper_<date>.docxcontains:The cohort included 412 participants with a mean age of 54.3 years.
Now update cohort.csv (rerun your analysis), rebuild, and the numbers update everywhere automatically.
Installation
Requirements: Python ≥ 3.10.
Install vibepaper
pip install vibepaper
Verify: vibepaper --help
pandoc — which converts the rendered Markdown to Word — ships bundled with the install (via pypandoc-binary), so there is no separate system pandoc to install and no version wall (--citeproc needs pandoc ≥ 2.11). To use a specific pandoc instead of the bundled one, set the PYPANDOC_PANDOC environment variable to its path.
Installing into a virtual environment (recommended)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install vibepaper
Installing from source
git clone https://github.com/SACGF/vibepaper
cd vibepaper
pip install -e .
The -e flag installs in editable mode so changes to the source are reflected immediately.
Quick start
Option 1 — paper.toml (recommended for full papers)
Create paper.toml in your project root:
[paper]
sections = [
"paper/abstract.md",
"paper/introduction.md",
"paper/methods.md",
"paper/results.md",
"paper/discussion.md",
"paper/references.md",
"paper/figures.md",
]
supplementary = ["paper/supplementary.md"]
name = "my_paper"
Then build:
vibepaper
# outputs: output/my_paper_2025-06-01.docx
# output/my_paper_supplementary_2025-06-01.docx
Option 2 — sections file
Create a plain text file listing your sections in order:
# order.txt
paper/abstract.md
paper/methods.md
paper/results.md
paper/discussion.md
Then:
vibepaper --sections-file order.txt --name my_paper
Lines starting with # and blank lines are ignored. Paths are relative to the sections file's location.
Option 3 — direct file list
vibepaper paper/abstract.md paper/results.md paper/discussion.md --name my_paper
Template syntax
vibepaper uses Jinja2 for template substitution. References follow the pattern {{ namespace.field | filter }}.
Number formatting filters
| Filter | Example | Output |
|---|---|---|
| commas |
{{ n | commas }} |
254,129 |
| dp(n) |
{{ mean | dp(1) }} |
9.2 |
| fold(n) |
{{ ratio | fold(1) }} |
2.0-fold |
| pct(n) |
{{ rate | pct(2) }} |
1.53% (only for a typed fraction or percent) |
| pp(n, sign=False) |
{{ (a.rate - b.rate) | pp(1) }} |
-6.8 pp (a typed change in share: the difference of two fractions, a fraction_delta, or a percent) |
| fmt(spec) |
{{ v | fmt('+.1f') }} |
+3.7 |
dp (decimal places) is for numbers that will have surrounding text (e.g. "mean TPV was 9.2"). Use fmt for any format string Python's format() accepts.
There are also word filters (approx, orders_of_magnitude, within_pct, direction, article, number_word) that render the qualifier next to a number from the fact itself. See Words that depend on facts.
Percentages: declare the fact's type as fraction (0–1) or percent (already × 100) in its facts CSV and use pct, which scales a fraction by 100 and shows a percent as is. pct refuses an untyped number, because it can't tell 0.0153 the fraction (1.53%) from 0.0153 the percent; for an untyped percent write {{ rate \| dp(1) }}%. See typed facts and issues #4 and #12.
Examples
Of {{ clinvar.total_variants | commas }} ClinVar variants, {{ clinvar.gained_high_count | commas }}
({{ clinvar.gained_high_pct | dp(2) }}%) gained HIGH impact on upgrading to v115.
Mean transcripts per variant increased {{ vep.mean_fold | fold }} from
{{ vep.mean_v112 | dp(1) }} to {{ vep.mean_v115 | dp(1) }}.
Words that depend on facts
vibepaper keeps the digits in a paper current. The words next to the digits also make claims about them: direction ("falls from"), magnitude ("under 1%", "two orders of magnitude"), approximation ("close to a year"), ordering ("dominated by A then B"), totality ("all 8,409,757"). When a facts CSV is refreshed, the number updates but the words do not, so the sentence can end up contradicting its own number. vibepaper gives you three tools for this, best first:
- Word filters generate the word from the fact, so the two cannot disagree.
- Asserts pin the condition a hand-written word depends on. The build fails if the condition stops holding. They can sit inline (
{% assert %}) or in a claims sidecar beside the section, which keeps the prose free of markup. vibepaper lintandvibepaper difflist the sentences that neither of the above covers, so a re-read can start with them.
Word filters
Each filter takes one pre-computed fact, such as a ratio, a percent difference or a delta that your script emits. There is still no arithmetic in templates.
| Filter | Example | Output |
|---|---|---|
orders_of_magnitude |
{{ bench.rest_vs_uta_ratio | orders_of_magnitude }} |
over two orders of magnitude (130), nearly three orders of magnitude (850), roughly two and a half orders of magnitude (300) |
within_pct |
{{ r3.rest_vs_local_diff_pct | within_pct }} |
within 1% (0.7), within 2% (1.5) |
approx(sig=1, per=None, noun=None, plural=None) |
{{ bench.uta_days | approx(per=365, noun='year') }} |
over a year (408) |
{{ cohort.n | approx(sig=2) }} |
about 8,400,000 (8,409,757) |
|
{{ n | approx }} |
nearly 900 (870), just over 1,000 (1,030) |
|
direction(up, down, flat='is unchanged', tol=0) |
{{ eras.delta_pct | direction('rises', 'falls') }} |
rises / falls / is unchanged |
article |
{{ coverage.improvement_fold | fold(1) | article }} |
an 11.5-fold / a 13.9-fold |
number_word |
{{ n_cohorts | number_word }} |
three (3), 12 (12) |
How they choose a word:
approxrounds to an anchor: a 0.5 grid below 3 (so 1.5 and 2.5 are anchors), otherwisesigsignificant figures. Within ±2% of the anchor it says about, 2–10% below nearly, 2–5% above just over, and further above over. More than 10% below, it drops to the grid point below and says over.perdivides first (days → years). Withnoun, an anchor of one reads "a year" or "an hour".orders_of_magnitudeuseslog10(ratio). Within about ±5% of a power of ten it gives the plain count, up to 0.25 decades below nearly n, up to 0.25 above over n, and otherwise roughly n and a half. Ratios below 1 are treated as their reciprocal. Say "faster" or "slower" yourself, or usedirection.within_pctpicks the smallest band from 0.5, 1, 2, 5, 10, 20 and 50% that contains the value. Above 50% the build fails, because "within" is no longer an honest claim.directionchooses by sign. You supply the verbs, so tense and register stay yours.articlegoes by the first sound: 8, 11, 18, 80–89 and 800–899 (and 11,000 or 18,500) take an; vowel sounds, silent h and acronyms such as an SNV or an HGVS are handled.- Integers up to 10 are spelled out ("three"). Set
spell_out_up_toinpaper.tomlto change this (0 turns it off).
Before and after, from the vibepaper papers that prompted this (#9):
| Hand-written (went stale) | With a word filter |
|---|---|
differing by under 1% |
differing by {{ r3.diff_pct | within_pct }} |
roughly two orders of magnitude faster |
{{ bench.ratio | orders_of_magnitude }} faster |
extrapolates to close to a year |
extrapolates to {{ bench.uta_days | approx(per=365, noun='year') }} |
an {{ fold | fmt('.1f') }}× increase |
{{ fold | fold(1) | article }} increase |
UTA falls from X% to Y% |
UTA {{ eras.uta_delta | direction('rises', 'falls') }} from X% to Y% |
{% assert %}: make a hand-written claim checkable
Some wording cannot be generated: ordering, totality, or the threshold behind a judgement word. For those, keep your words and state the condition they rely on directly above the sentence:
{% assert residual.indel_count > residual.multi_locus_count, "'dominated by indel ... then paralog' order" %}
... is dominated by indel-representation differences ({{ residual.indel_count | commas }}) and by
paralog and copy-number transcripts ({{ residual.multi_locus_count | commas }}) ...
{% assert vsv.n_coordinate_changes == 0, "'every one ... gives the same coordinate'" %}
every one that resolves under the substitute gives the same coordinate
{% assert eras.old_uta < eras.mid_uta and eras.recent_uta < eras.mid_uta, "UTA lowest on oldest, mid era is best" %}
An assert renders nothing, and its line is removed, so it does not split the paragraph below it. If the condition is false, the build fails with the message, the file and line, and every fact the condition reads. The build checks every assert in every section before it stops, so a re-run that breaks several claims lists them all at once:
error: 2 assertion(s) failed:
paper/results.md:8: assertion failed: 'dominated by indel ... then paralog' order
residual.indel_count = 100
residual.multi_locus_count = 418
paper/discussion.md:31: assertion failed: 'every transcript resolves'
resolve.unresolved_n = 3
Comparisons inside an assert do not break "no arithmetic in templates", because nothing computed is printed. Name the sentence the assert protects in its message.
Judgement words: one tolerance per word
"Close to nominal", "essentially unchanged" and "comparable to" need a tolerance. If each assert picks its own, the same word ends up meaning 5% in one place and 2x in another, and nothing records why. Define each word once in paper.toml:
[claims]
close_to = { within_pct = 10 } # |a - b| <= 10% of b
essentially_unchanged = { within_pct = 5 }
comparable_to = { factor = 2 } # a/b and b/a both <= 2
near_zero = { within = 0.5 } # |a - b| <= 0.5
Each name becomes a test to use in an assert:
{% assert depth.ci_coverage_pct is close_to(95), "'cover close to nominal' 95%" %}
{% assert run.new_tps is essentially_unchanged(run.old_tps), "'essentially unchanged'" %}
A failed claim names its tolerance, so a reviewer can see what the word was held to:
paper/discussion.md:67: assertion failed: 'cover close to nominal' 95%
depth.ci_coverage_pct = 100.0
close_to: within 10% of the reference ([claims] in paper.toml)
Names must be identifiers (close_to, not "close to"). The tolerance types are within_pct (relative to the second value), within (absolute) and factor.
vibepaper lint: find the wording nothing checks
vibepaper lint # sections from paper.toml
vibepaper lint --check # exit 1 if anything is flagged (CI)
Lint lists every sentence that references a {{ fact }} and contains a claim word (rises, falls, higher, under, within, nearly, roughly, about, over, all, every, none, only, dominated, largest, most, doubled, -fold, versus, …), where nothing covers that word. Coverage is per claim word: a word is about the facts in its clause (split at commas, semicolons, colons, dashes and parentheses), or the nearest fact when its clause has none. It is covered when one of those facts has a word filter (including fold), or is read by an {% assert %} in the paragraph. So an assert about r.indel_count does not vouch for a sentence that shows only r.total, and an assert for "zero regressions" does not vouch for an "about" beside another fact in the same sentence. When the heuristic picks the wrong fact, quote the wording in the assert's message. A phrase quoted there ({% assert r.fold >= 1.9, "'mean size doubled'" %}) covers its claim words wherever it appears in the paragraph, whatever facts that sentence prints, so an assert on a derived fact (a fold, a ratio) covers a sentence that shows only its inputs. A single quoted claim word ("'with zero regressions'") is also covered in any sentence that uses a fact the assert reads.
Some uses of a claim word make no claim and are not flagged: a word inside a hyphenated compound ("3'-most", "left-most", "all-cause", "over-represented"), "no longer" and "no later", "of all" as a denominator ("12% of all citations"), and "vs"/"versus" set between two facts ("({{ a }} Mb vs {{ b }} Mb)"). A finding gives the line of the sentence, not of an assert above it. A table followed by prose with no blank line between them is linted as a table and a paragraph.
paper/results.md:3: roughly, orders of magnitude, faster
"REST throughput is {{ bench.rest_tps }} HGVS/s, roughly two orders of magnitude faster than UTA."
paper/results.md:11: every
"Every variant matched ({{ bench.matched_pct | dp(1) }}%)."
paper/results.md:11: {{ bench.matched_pct | dp(1) }} renders '100.0' but the value is 99.97: the rounded digits make a totality word ('all', 'every', 'none') look true
"Every variant matched ({{ bench.matched_pct | dp(1) }}%)."
The second kind of finding needs facts, and is reported even in covered paragraphs: a value that only rounds to 100.0 or 0.0 next to "every" or "none".
vibepaper lint --unused also lists facts that the paper never references, so a column added by a re-run (a new residual category, say) doesn't go unmentioned. It searches the sections, the files they {% include %} and their claims sidecars. A namespace used as a whole ({% for k, v in ns.items() %}) counts as used. The list is one line per facts file (ns: 40 of 42 unused (a, b, c, ...)); -v lists every fact. Skip facts that are unused on purpose with glob patterns in paper.toml:
[lint]
unused_ok = ["bench.raw_*", "clinvar_residual_positions.*"]
vibepaper lint --numbers also flags numbers typed into prose and tables, when they look like results: decimals, and numbers with %, pp, percent, -fold or x. A result copied by hand from an old run looks the same as a fact, and lint can't otherwise see it. Every paragraph is checked, including ones with no {{ fact }} at all: a paragraph that was never converted is the one most likely to hold stale results. Plain integers ("Figure 2", "25 of 25"), version strings, headings, code and YAML front matter are not flagged. Most hits will be design values (titration levels, the nominal 95%, p < 0.05); list those once in paper.toml, or accept them with an [[ok]] or {# lint-ok: reason #}. Anything left is probably a result that should be a fact. A table with four or more hand-typed numbers is one finding ("table with 24 hand-typed number(s) in 8 row(s) ... make it an include-csv"); -v lists each cell. When an assert in the paragraph compares a fact with the same literal ({% assert x.offset < 0.29 %} next to "about 0.29 percentage points"), the finding says so: that claim is checked against a number nobody re-measured.
[lint]
allowed_numbers = ["95%", "0.05", "0.1%", "0.5%", "1%", "1,000x"]
Lint ends with notes, which do not make --check fail, for checks that could not run or lists that have gone stale:
- facts CSVs whose line endings (CRLF or LF) differ from the rest of the facts directory;
- a facts namespace the sections use with no CSV in the facts directory (
checkreports its asserts as MISSING andbuildfails); - no facts file with a provenance sidecar, so the mixed-version check did not run;
- with
--numbers,[lint] allowed_numbersentries that match no number in the paper; with--unused,unused_okpatterns that match no fact; - no facts directory at all, so the rounding, type, provenance and stale lint-ok checks did not run.
For a word that really is a hedge or a judgement ("just", "only", "striking"), accept it by adding {# lint-ok: reason #} at the end of (or inside) its sentence. It accepts that sentence only, so a claim added later to another sentence of the paragraph is still flagged. Between two sentences it belongs to the one before; on a line of its own above a paragraph (like an assert, it leaves no blank line in the output), to the first sentence.
{{ x | dp(1) }}% preserved every coding coordinate. {# lint-ok: 'every' defines the category #}
Two other forms:
{# lint-ok(every, most): reason #}accepts only those words, anywhere in the paragraph. It also takes a hand-typed number (lint-ok(0.05)) or%for a percent that may print at the wrong magnitude.{# lint-ok-paragraph: reason #}accepts the whole paragraph, e.g. one that quotes another paper's figures.
A lint-ok accepts claim words, hand-typed numbers, percent-magnitude findings and a deliberate mix of tool versions (any lint-ok in the paragraph, see provenance). A fact that rounds to 100.0 or 0.0 beside "every" or "none" is still flagged; a typed fraction of exactly 1.0 shown with pct is 100% and is not. When facts are available, lint also reports a lint-ok that accepts nothing (the hedged word was edited out, or an assert now covers it), so stale ones don't pile up. Before deleting one, check why: if an assert now covers the word, the lint-ok's reason may still be worth keeping in the commit message.
Claims sidecars: keep the checks out of the prose
Inline asserts and lint-oks work, but in a paper that checks most of its claims they can outweigh the prose, which is hard for a co-author to edit by hand. A section can keep its checks beside it instead. paper/results.md gets paper/results.claims.toml:
[[claim]]
quote = "about a quarter of A"
assert = "3.6 <= r.ratio_ab <= 4.4"
[[claim]]
quote = "doubled from"
assert = "r.fold is doubled" # [claims] tolerances work as in an inline assert
[[ok]]
quote = "the 3'-ward decile"
reason = "positional term, not a claim"
[[ok]]
quote = "~44% LoF discordance"
reason = "cited from McCarthy 2014" # also accepts a hand-typed number
[[check]] # an invariant tied to no wording
assert = "r.a_n + r.b_n == r.total_n"
message = "A and B partition the total"
The prose then holds only {{ fact }} references.
- A
quoteis matched against the source of one sentence of the section (or one table row), ignoring case,*emphasis and line wrapping.…(or..., or a{{ ... }}) in a quote matches anything, so a quote need not spell out the facts:"reached … per second". It must match exactly one sentence; lint asks for a longer quote when it matches several. - A
[[claim]]covers the claim words inside its quoted span, whatever facts the sentence prints, so it needs no clause heuristics.quotemay be a list, for a claim that several sentences rest on. An optionalmessagereplaces the quote in failure reports. - An
[[ok]]accepts the claim words and hand-typed numbers inside its span, and a percent-magnitude or provenance finding in its sentence.paragraph = trueaccepts the whole paragraph. Areasonis required. - A
[[check]]is an assert with no wording, for invariants. - When the wording changes, lint says so:
results.claims.toml:12: quote 'about a quarter of A' no longer appears in paper/results.md: the wording changed, so re-check the claim and update the quote. This fails--check. A person can rewrite the prose freely; lint then lists exactly the claims whose wording they touched.
build and check evaluate every sidecar assert as they do inline ones, and a failure names the sidecar line and the sentence the quote matched:
paper/results.claims.toml:5: assertion failed: 'doubled from' (paper/results.md:12)
r.fold = 1.7
doubled: within 5% of the reference ([claims] in paper.toml)
vibepaper claims show prints each section with its claims under the sentences they match, for reviewing the checks beside the wording. vibepaper claims extract moves a section's inline {% assert %} and {# lint-ok #} tags into its sidecar. It works out what each tag covers by linting the section with only that tag in place, and quotes the shortest span (at least three words, or the phrase the assert's message quotes) that matches one sentence. An assert that covers no claim word becomes a [[check]], and a lint-ok that accepts nothing is dropped. It lints before and after and refuses to write if there are more findings afterwards. It removes each tag so the paper renders byte-identically. --dry-run prints the entries. Review the quotes it chose. Tags inside {% for %} loops stay inline.
Inline tags remain fully supported, and the two can be mixed in a section. Use whichever the paper's authors find easier to edit.
vibepaper check: run the asserts without a build
A build needs every facts CSV. When some analysis rules are slow or still running, vibepaper check evaluates each {% assert %} against the facts that exist, without rendering the paper:
PASS paper/results.md:35: 'On RefSeq the two backends are at parity'
FAIL paper/results.md:341: Table 1 caption: '<=0.5% on the same mixtures'
subsample_lod_headline.mle_lod_pct = 1.0
subsample_lod_headline.min_titration_pct = 0.5
MISSING paper/discussion.md:67: 'cover close to nominal' (needs facts: depth_summary.csv)
3 assert(s): 1 pass, 1 fail, 1 missing.
Asserts in a section's claims sidecar are evaluated too, reported at their sidecar line. MISSING means the assert reads a facts file or field that isn't there yet. vibepaper check --check exits 1 on FAIL or ERROR but not on MISSING, so CI with partial facts still catches broken claims. Asserts inside {% include %}d files are not checked.
vibepaper diff: what changed, and which words to re-read
vibepaper build caches the facts it used (build/.last_facts.json) alongside the rendered Markdown. After you refresh the CSVs, vibepaper diff reports which facts changed, by name and by how much, and where the paper uses them. It then lists the unchecked sentences that use a changed fact, and finally the changed paragraphs:
3 fact(s) referenced in the paper changed:
bench.diff_pct 0.7 → 1.5 (+114%), referenced in paper/results.md ×2
bench.ratio 130 → 850 (+554%), referenced in paper/results.md
bench.rest_tps 16 → 111 (+594%), referenced in paper/results.md ×2
2 sentence(s) use a changed fact beside unchecked claim words (re-read these):
paper/results.md:3: roughly, orders of magnitude, faster
"REST throughput is {{ bench.rest_tps }} HGVS/s, roughly two orders of magnitude faster than UTA."
...
For a PR that re-runs the analysis, vibepaper diff --against <git ref> compares the facts with those committed at that ref instead of the last build. --against-dir DIR compares with another facts directory; running a script twice and comparing the outputs shows whether it is deterministic. Values are shown as the paper renders them. A fact that changed only below display precision goes in a separate "renders the same" list. Add --format md for a table to paste into the PR:
| Fact | Before | After | Change | Used in |
|---|---|---|---|---|
| `benchmark.cdot_rest_tps` | 111 | 108 | -3% | results.md:157 |
| `clinvar_submitted.uta_only` | 971 | 87 | -91% | results.md:104 |
Changed but renders the same (1): `benchmark.grch38_load_time_s` (5)
Word limits
Journal limits (a 250-word abstract, a 4,000-word main text, 300-word figure legends) go in paper.toml:
[limits]
abstract = { file = "paper/abstract.md", max_words = 250 }
main = { files = ["paper/introduction.md", "paper/results.md", "paper/discussion.md"], max_words = 4000 }
legends = { files = ["paper/figures.md"], max_words = 300, each = "figure" }
Words are counted in the text as the paper renders it, since facts and word filters change the count: a re-run that turns "three" into "twelve" or adds a hedge can push an abstract over its limit. Headings, tables, fenced code, YAML front matter, HTML comments (so include-csv directives), template tags, citations ([@key]) and figure lines () are not counted. each = "figure" checks each figure legend on its own instead: a paragraph that starts "Figure N" (also bold, **Figure 2. Title.** ...) together with the paragraphs after it up to the next heading, image, table or legend, or else an image's alt text. min_words sets a lower bound. vibepaper lint reports a limit that is not met (it fails --check), and vibepaper wordcount prints each section's count and every limit:
paper/abstract.md 263
paper/introduction.md 812
...
total 4,391
Limits ([limits] in paper.toml):
OVER abstract: 263 words (max 250): 13 over
ok main: 3,812 words (max 4,000)
A section that can't be rendered (facts missing) is counted from its source, with each {{ fact }} as one word, and marked as an estimate (~).
Retrofitting an existing paper
RETROFIT_PROMPT.md is an agent prompt for papers that already use vibepaper. It works through the vibepaper lint output and converts each flagged sentence to a word filter, an assert, or a documented lint-ok.
UPGRADE_PROMPT.md is the prompt for moving a paper to a new vibepaper release. It records a baseline render with the old version, checks that the upgrade changes only what the release notes say, works through the behaviour changes, and finds candidates for each new feature (frozen facts, provenance, typed facts, lint --unused, lint --numbers, ...).
Data sources
Facts CSVs (primary)
The main data binding mechanism. Analysis scripts write CSVs to output/facts/. The filename stem becomes the template namespace; field names become template variables. One file per result group keeps each namespace small, explicit, and easy to diff in version control.
output/facts/
transcript_growth.csv → {{ transcript_growth.v112_count | commas }}
vep_impact.csv → {{ vep_impact.giab_mean_v115_full | dp(1) }}
clinvar_reclassification.csv → {{ clinvar_reclassification.total_variants | commas }}
Two CSV formats are supported (auto-detected):
Vertical format (preferred)
Two columns named field and value, one row per fact. Easier to read and diff when you have many fields:
field,value
v112_count,254129
v115_count,509650
Typed facts
A vertical CSV can add a third type column, so the script that produces a number also says what it measures:
field,value,type
herding_rate_near,0.0153,fraction
conflict_resolved,61.2,percent
primary_max_q,3.1e-13,pvalue
n_distinct_studies,184,count
cdot_version,1.10,text
n_samples,12,
| Type | Meaning | Checked at load |
|---|---|---|
fraction |
share from 0 to 1; pct multiplies by 100 |
0 ≤ value ≤ 1 |
fraction_delta |
change in a share, -1 to 1; pp shows percentage points (× 100), pct refuses it |
-1 ≤ value ≤ 1 |
percent |
already × 100 (a share or a change); pct shows it as is, pp as points |
a number |
pvalue |
p- or q-value | 0 ≤ value ≤ 1 |
count |
whole number | integer ≥ 0 |
ratio |
e.g. a fold change | value > 0 |
text |
kept exactly as written ("1.10" stays "1.10") |
A blank type is untyped and behaves as before, so you can type the percentages and p-values first, where the mistakes happen. A value out of its type's range fails the load with the file and line. Filters refuse a type they would mis-scale: int, commas and number_word refuse a fraction or p-value; fold and orders_of_magnitude want a ratio, not a percent or count; within_pct refuses a fraction. Typed values still compare and do arithmetic like numbers, and the result of arithmetic is untyped, so {{ (rate * 100) | pct }} is an error. The exception is a difference: two fraction facts subtract to a fraction_delta and two percent facts to a percent, so a change in share is {{ (late.rate - early.rate) | pp(1) }} ("-6.8 pp"; pp(1, sign=True) gives "+6.8 pp" for a rise), never {{ (d * 100) | dp(1) }} pp. abs and round keep the type, so a fall shown as a magnitude is {{ x.delta_pct | abs | pct(0) }}; min and max return one of the facts, type included.
vibepaper lint flags a percent that would print at the wrong magnitude: {{ rate | dp(2) }}% on a fraction, {{ (share * 100) | dp }}% on a percent, {{ x | pct }}% (a doubled sign), and an untyped value below 1 whose name suggests a fraction (_rate, _frac, _share, ...). vibepaper diff reports a type change, such as fraction 0.0153 → percent 1.53, as one change with the types rather than a +9900% jump.
Producer scripts can write typed CSVs (with LF line endings) with a helper:
from vibepaper.facts import write_facts, Fraction, Percent, PValue, Count
write_facts("output/facts/herding.csv",
herding_rate_near=Fraction(rate_near), conflict_resolved=Percent(resolved_pct),
primary_max_q=PValue(max_q), n_distinct_studies=Count(n), n_samples=12)
Types are only for vertical CSVs; horizontal CSVs stay untyped.
A paper's facts convention: FactsWriter
Most papers type facts by field name (*_pct is a percent, n_* a count). Put that convention in one shared FactsWriter instead of a facts_io.py per paper (#54):
# scripts/facts_io.py
from vibepaper.facts import FactsWriter, Count, Fraction, Percent, PValue, Ratio
FACTS = FactsWriter(
{"*_pct": Percent, "n_*": Count, "*_n": Count, "*_rate": Fraction,
"*_p": PValue, "*_ratio": Ratio, "*_fold": Ratio},
missing="skip", # None/NaN: "error" (default), "skip" with a warning, or "blank"
tools=["allomix"], # provenance sidecar on every write
)
# any producer script
from facts_io import FACTS
FACTS.write("output/facts/lod.csv", {"lod_pct": lod, "n_samples": len(df), "label": "F2 into F1"})
- Rules are globs on the field name, tried in order; the first match wins. A type name (
"percent") works as well as the class. A value the producer typed itself (Fraction(x)) keeps its own type. - A rule types any finite number, including numpy scalars, integer-valued floats for a count, and numeric strings. A value it can't type (
">20",inf, a bool) is written untyped. A number out of the rule's range (a negative count, a "fraction" of 1.3) raises with the field's name, because that is a bug in the producer. missingdecides what happens to None and NaN (numpy and pandas NA included). Plainwrite_factsrefuses them.Fraction.maybe(v)(andPercent.maybe, ...) types a value but passes a missing one through for the writer to handle:Fraction.maybe(a / b if b else None).toolsis passed towrite_provenanceafter each write.Noneleaves an existing sidecar alone. An empty{}means this run has no provenance, so any stale sidecar is removed, e.g.tools={k: v for k, v in {"clinvar": os.environ.get("CLINVAR_RELEASE")}.items() if v}.FACTS.write(path, facts, tools={"vep": "115"})overrides it for one file.- For a rule a glob can't express, subclass and override
type_for(field, value), e.g. "any other non-negative integer is a count".
A script that reads another script's facts should use read_facts, which returns one CSV's facts exactly as a template sees them (typed values, either layout, and True/False as bools), instead of parsing the CSV by hand:
from vibepaper.facts import read_facts
lod = read_facts("output/facts/lod.csv") # {"lod_pct": Percent(0.42), "n_samples": Count(56), ...}
Horizontal format
Column names as the header, with a single data row:
v112_count,v115_count
254129,509650
Both formats are referenced the same way:
Transcripts grew from {{ transcript_growth.v112_count | commas }}
to {{ transcript_growth.v115_count | commas }}.
vibepaper raises a hard error if a referenced field doesn't exist. It warns if the rendered output contains literal nan, None, or unresolved {{.
Write every facts CSV with the same line endings, or a regenerated file will diff on every line against its committed copy. Python's csv.writer defaults to CRLF (\r\n), so pass lineterminator="\n"; pandas to_csv already writes LF on Linux and macOS. vibepaper lint lists facts CSVs whose line endings differ from the rest of the directory.
Frozen facts: values kept from an earlier run
Some facts are deliberately not re-measured: a benchmark against a remote public service, results from cached external responses, a table frozen at submission. The script that owns the CSV re-emits the whole file, so freeze those values instead of merging them back by hand after each re-run:
vibepaper freeze benchmark.uta_remote_tps benchmark.uta_remote_n \
--reason "public UTA REST, measured 2025-06; not re-run"
This records the current values in paper/frozen_facts.csv, which you commit with the paper:
fact,value,reason
benchmark.uta_remote_n,25,"public UTA REST, measured 2025-06; not re-run"
benchmark.uta_remote_tps,0.13,"public UTA REST, measured 2025-06; not re-run"
build, diff, lint and check apply this file on top of the facts CSVs, so a frozen value survives re-runs and never shows up in vibepaper diff. The build prints how many frozen facts it used. To update a frozen value from the current CSVs, run freeze again; to drop one, run vibepaper freeze --remove benchmark.uta_remote_n. You can also edit the file by hand. Set frozen_facts in [paper] to use another path.
A frozen value keeps the type its facts CSV declares. An optional fourth type column types it explicitly. That also suits a constant no script produces, such as a value cited from another paper, which then gets its own namespace and the same type checks as a measured fact:
vibepaper freeze literature.kit_lod --value 0.003 --type fraction --reason "Smith 2020, Table 2"
fact,value,reason,type
literature.kit_lod,0.003,"Smith 2020, Table 2",fraction
{{ literature.kit_lod | pct(1) }} then prints "0.3%". A type that disagrees with the facts CSV's is an error.
Provenance: which versions produced a facts file
A facts CSV can have a sidecar, foo.provenance.json, recording when and with what it was produced:
{"date": "2026-10-30", "command": "snakemake benchmark", "tools": {"cdot": "0.2.37", "cdot_data": "0.2.36"}}
It's loaded as foo._prov, so version strings in captions and methods come from the facts:
Table 1. Throughput with cdot {{ benchmark._prov.tools.cdot }} (data release {{ benchmark._prov.tools.cdot_data }}), measured {{ benchmark._prov.date }}.
Producer scripts can write it with a helper. tools maps names to versions, and a None version (or a list of names) looks up the installed package; command and date default to how the script was run and today:
from vibepaper.provenance import write_provenance
write_provenance("output/facts/benchmark.csv", tools={"cdot": None, "cdot_data": "0.2.36"})
Versions go under tools, which is what {{ ns._prov.tools.x }} reads and what lint's mixed-version check compares. Other keyword arguments (write_provenance(csv, tools=["cdot"], genome="GRCh38")) are stored at the top level, as {{ ns._prov.genome }}.
vibepaper lint flags a paragraph or table that uses facts from files whose tools give different versions of the same tool, which typically happens after a partial re-run. {# lint-ok: reason #} accepts a paragraph that compares versions on purpose. vibepaper diff (including --against) lists provenance changes separately from fact changes.
The facts_dir variable
The resolved facts directory path is automatically available in templates as {{ facts_dir }}. This is useful for image paths that live alongside your facts CSVs — especially when the output directory changes between runs (e.g. timestamped or hashed paths):


If your analysis writes to output/2026-03-21_8b1471f/, pass --facts-dir and the image paths update automatically:
vibepaper --facts-dir output/2026-03-21_8b1471f
No more editing hardcoded paths in the Markdown every time the analysis reruns.
JSON facts
JSON can be used instead of (or alongside) facts CSVs. Pass a JSON file or inline dict with --data:
# From file
vibepaper --data results.json
# Inline dict
vibepaper --data '{"cohort_size": 412, "stats": {"pvalue": 0.003}}'
Top-level keys become namespaces:
Cohort: {{ cohort_size }} participants (p = {{ stats.pvalue | dp(3) }}).
JSON values are merged on top of any facts CSVs. Nested dicts are deep-merged at the namespace level; scalar values override directly:
# facts CSV: stats.pvalue = 0.01, stats.n = 100
# JSON --data: {"stats": {"pvalue": 0.03}}
# result: stats.pvalue = 0.03, stats.n = 100
Use JSON when you prefer a single structured file over a directory of 1-row CSVs, or when your analysis already produces JSON output.
Table Directives
For supplementary tables, embed CSVs directly into the Markdown with a directive comment:
<!-- include-csv: output/consequence_changes.csv
columns: [consequence, v112_count, v115_count, pct_change]
rename:
v112_count: v112
v115_count: v115
pct_change: Change (%)
format:
v112_count: ",d"
v115_count: ",d"
pct_change: ".1f"
sort: [-pct_change]
max_rows: 20
-->
Directive options:
| Option | Description |
|---|---|
columns |
List of columns to include, in order |
rename |
Dict mapping column names to display names |
format |
Dict mapping column names to Python format specs |
align |
left, right, center, or per-column dict |
sort |
List of column names; prefix - for descending |
filter |
pandas query() expression |
max_rows |
Truncate to this many rows |
na_rep |
String to use for missing values (default: —) |
Citations
vibepaper supports pandoc's native citation processing. Write citations in your Markdown using [@citekey] syntax:
Variant consequences were predicted using VEP [@McLaren2016].
Variants were called against the MANE Select transcript set [@Morales2022; @Pozo2022].
pandoc resolves these against a BibTeX file and formats them using a CSL style file.
Setup
-
Create a
.bibfile (paper/references.bib) with your references in BibTeX format. Most reference managers (Zotero, Mendeley, Papers) can export this directly. -
Download a CSL file for your target journal:
vibepaper fetch-csl vancouver # numbered, most biomedical journals vibepaper fetch-csl nature vibepaper fetch-csl biomed-central vibepaper fetch-csl apa
This saves
paper/<style>.csl— commit it to your repo. Browse all ~10,000 available styles at zotero.org/styles. -
Add both to
paper.toml:bibliography = "paper/references.bib" csl = "paper/vancouver.csl"
-
Add a references section to your paper. Include a
{#refs}div so pandoc places the bibliography there rather than appending at the end:# References {% raw %} ::: {#refs} ::: {% endraw %}The
{% raw %}blocks prevent Jinja2 from interpreting the{#refs}syntax — they are stripped during the template pass and do not appear in the output.
BibTeX entry example
@article{McLaren2016,
author = {McLaren, William and others},
title = {The {Ensembl} Variant Effect Predictor},
journal = {Genome Biology},
year = {2016},
volume = {17},
pages = {122},
doi = {10.1186/s13059-016-0974-4},
}
@misc{MyDatabase,
author = {{My Consortium}},
title = {My Database},
year = {2024},
url = {https://example.org},
note = {Accessed 2024},
}
paper.toml reference
[paper]
# Manuscript sections in order (paths relative to paper.toml)
sections = [
"paper/title.md",
"paper/abstract.md",
"paper/introduction.md",
"paper/methods.md",
"paper/results.md",
"paper/discussion.md",
"paper/references.md",
"paper/figures.md",
]
# Built as a separate .docx unless --combined is passed
supplementary = ["paper/supplementary.md"]
# Output filename stem: {name}_{date}.docx
# Default: parent directory name
name = "my_paper"
# Directory of 1-row facts CSVs
# Default: "output/facts"
facts_dir = "output/facts"
# Output directory for .docx files
# Default: "output"
output_dir = "output"
# Intermediate build directory
# Default: "build"
build_dir = "build"
# Word reference document for custom formatting (double spacing, line numbers, etc.)
# Only used if the file exists; ignored if not present.
# Default: "paper/reference.docx"
reference_doc = "paper/reference.docx"
# BibTeX bibliography file. Enables pandoc --citeproc when present.
# Use [@citekey] syntax in Markdown to cite.
bibliography = "paper/references.bib"
# CSL citation style file. Download from zotero.org/styles.
# Falls back to pandoc's default (Chicago author-date) if omitted.
csl = "paper/vancouver.csl"
# Word filters (approx, orders_of_magnitude, number_word) spell out integers
# up to this value ("three" rather than "3"). 0 disables.
# Default: 10
spell_out_up_to = 10
# Values kept from an earlier run (see `vibepaper freeze`). Only used if it exists.
# Default: "paper/frozen_facts.csv"
frozen_facts = "paper/frozen_facts.csv"
[claims]
# Judgement-word tolerances, used as {% assert x is close_to(95) %}.
# Kinds: within_pct (relative), within (absolute), factor. Default: none.
close_to = { within_pct = 10 }
[lint]
# Facts that `vibepaper lint --unused` should not report (globs on ns.field).
# Default: []
unused_ok = ["bench.raw_*"]
# Design values `vibepaper lint --numbers` accepts in prose.
# Default: []
allowed_numbers = ["95%", "0.05"]
[limits]
# Journal word limits, counted on the rendered text and checked by
# `vibepaper lint` and `vibepaper wordcount`. Default: none.
abstract = { file = "paper/abstract.md", max_words = 250 }
main = { files = ["paper/introduction.md", "paper/results.md", "paper/discussion.md"], max_words = 4000 }
legends = { files = ["paper/figures.md"], max_words = 300, each = "figure" }
Word reference document
To apply journal-specific formatting (e.g. double line spacing, continuous line numbering):
- Open a blank Word document
- Set paragraph spacing to Double and enable Layout → Line Numbers → Continuous
- Save as
paper/reference.docx
vibepaper will use it automatically if it exists at the configured path.
PDF output
Pass --pdf to produce a PDF alongside each .docx:
vibepaper --pdf
Note: PDF output is not suitable for journal-specific layout requirements. Use
.docxfor submission; PDF is useful for sharing readable drafts.
The pipeline is: pandoc renders the Markdown sections to a self-contained HTML document (images embedded as data URIs), then weasyprint converts that HTML to PDF entirely in Python. Citations and bibliography work the same as for Word output. This works well for typical manuscript content; complex layout requirements (multi-column, precise figure placement, journal-specific PDF templates) may not render as expected.
PDF system libraries. Unlike DOCX (pandoc is bundled), PDF output needs weasyprint's native libraries (pango, cairo, gdk-pixbuf, harfbuzz). If they are missing, --pdf exits non-zero with install instructions instead of a raw traceback (sudo apt-get install libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf-2.0-0 libffi-dev libcairo2 on Debian/Ubuntu; brew install pango gdk-pixbuf libffi on macOS; see the weasyprint install guide).
For build pipelines that should produce a PDF only when the toolchain is present:
vibepaper --pdf-if-available # builds the PDF if possible, otherwise warns and skips it (still exits 0)
vibepaper build --is-pdf-available # probe only: prints "yes"/"no" and exits 0/1 so a script can branch
CLI reference
vibepaper [build] [FILE.md ...] [options]
Input (choose one):
FILE.md ... Markdown files in order (no paper.toml needed)
--sections-file FILE Plain text file with one .md path per line
--config FILE paper.toml config file (default: paper.toml)
Data:
--data JSON JSON file path or inline dict for template context
--facts-dir DIR Override facts CSV directory
Output:
--output-dir DIR Output directory for .docx files
--name NAME Output filename stem
--combined Merge supplementary into main document
--pdf Also produce a PDF alongside each .docx (errors if the
weasyprint toolchain is missing)
--pdf-if-available Produce a PDF when the toolchain is present, else skip it
--is-pdf-available Probe the PDF toolchain; print yes/no and exit 0/1
--md Also write rendered Markdown alongside each .docx
Flags:
--verbose, -v Print detailed progress
vibepaper --version Print the installed version
vibepaper fetch-csl <style> [--output FILE]
Download a CSL style file from zotero.org/styles to paper/<style>.csl.
Commit the downloaded file to your repo.
vibepaper fetch-csl vancouver
vibepaper fetch-csl nature --output paper/custom.csl
vibepaper wrap <FILE.md ...> [--width N] [--check]
Wrap long lines in Markdown files without breaking {{ ... }} template
expressions. Treats template expressions as atomic tokens that are never
split across lines. Preserves headings, blank lines, list items, tables,
code blocks, and indentation.
vibepaper wrap paper/results.md # in-place, default 88 cols
vibepaper wrap paper/*.md --width 72 # custom width
vibepaper wrap paper/*.md --check # exit 1 if changes needed (CI)
vibepaper lint [FILE.md ...] [--config FILE] [--facts-dir DIR] [--unused] [--numbers]
[--check] [--verbose]
List sentences that reference a {{ fact }} and contain a claim word
(rises, within, nearly, all, every, dominated, ...) that nothing covers: no
word filter on a fact the word is about (in its clause, else the nearest),
and no {% assert %} in the paragraph that reads one. Also lists facts that round to 100.0/0.0
beside "every"/"none". Mark a sentence {# lint-ok: reason #} to accept its
wording ({# lint-ok(word): ... #} or {# lint-ok-paragraph: ... #} for wider
scope), or put the checks in a claims sidecar (results.claims.toml).
--unused also lists facts the paper never references; --numbers flags
result-like numbers typed into prose and tables. Checks [limits] too.
-v lists every hand-typed table cell and every unused fact.
vibepaper lint # sections from paper.toml
vibepaper lint --check # exit 1 if anything flagged (CI)
vibepaper check [FILE.md ...] [--config FILE] [--facts-dir DIR] [--check]
Evaluate every {% assert %} against the facts that exist, without a build.
Reports each as PASS, FAIL (with fact values), MISSING (facts file or
field not there yet) or ERROR.
vibepaper check # sections from paper.toml
vibepaper check --check # exit 1 on FAIL/ERROR, not MISSING
vibepaper diff [--config FILE] [--facts-dir DIR]
[--against REF | --against-dir DIR] [--format text|md]
Compare the current render against the last build: which facts changed
(by name, with where they are used), which unchecked sentences use a
changed fact, and which paragraphs changed.
vibepaper diff --against main --format md # before/after facts table for a PR
vibepaper diff --against-dir run2/facts # second run: expose non-determinism
vibepaper claims {show,extract} [FILE.md ...] [--config FILE] [--facts-dir DIR]
[--dry-run] [--force]
show: print each section with its claims-sidecar entries under the
sentences they match. extract: move inline {% assert %} and {# lint-ok #}
tags into the section's sidecar; refuses if lint finds more afterwards.
vibepaper wordcount [FILE.md ...] [--config FILE] [--facts-dir DIR] [--check]
Count each section's words as rendered, and check [limits] in paper.toml.
vibepaper freeze NS.FIELD ... [--reason TEXT] [--remove] [--value V] [--type T]
[--config FILE] [--facts-dir DIR]
Keep facts at their current values through later re-runs, in
paper/frozen_facts.csv (fact,value,reason[,type]). Commit the file.
--value records a value no facts CSV has (a cited constant).
vibepaper sync [--config FILE] [--dry-run] [--verbose]
Push paragraph-level changes to a Google Doc as tracked-change suggestions.
On first run, creates a new Google Doc. On subsequent runs, diffs against
the last-synced version and pushes only changed paragraphs.
Requires .vibepaper/credentials.json (a "Desktop app" OAuth client secret
from Google Cloud Console). Will open a browser for authentication on first
use. See "Setting up Google Docs sync" below. Keep .vibepaper/ out of git.
Install sync dependencies: pip install vibepaper[sync]
vibepaper sync # push changes
vibepaper sync --dry-run # preview without pushing
Setting up Google Docs sync
vibepaper sync pushes each rebuild into a Google Doc as tracked-change suggestions, so collaborators' comments survive. It needs a one-time Google Cloud setup to get an OAuth client secret. This is free and needs no app verification for personal or lab use.
- Install the sync extras:
pip install vibepaper[sync] - Create (or pick) a Google Cloud project at console.cloud.google.com.
- Enable the Google Docs API: APIs & Services → Library → Google Docs API → Enable. vibepaper only requests the
https://www.googleapis.com/auth/documentsscope, so the Drive API is not needed. If you skip this step, the first sync fails atbatchUpdate. - Configure the OAuth consent screen: APIs & Services → OAuth consent screen (called Google Auth Platform in newer consoles).
- User type External (or Internal if you are on a Google Workspace org and only org members will sync).
- Fill in the app name and your email; no other fields are needed.
- Leave the app in Testing. You do not need to publish it or have it verified.
- Under Test users, add the Google account you will sign in with. While the app is in Testing, Google rejects sign-in from any account that is not on this list.
- Create the OAuth client: APIs & Services → Credentials → Create credentials → OAuth client ID → Application type Desktop app.
- It must be Desktop app, not Web application. vibepaper uses the installed-app flow (a local browser redirect), which only works with Desktop clients. You can check the downloaded JSON: a Desktop secret has a top-level
"installed"key, a Web one has"web". vibepaper refuses a Web secret with an explanatory error.
- It must be Desktop app, not Web application. vibepaper uses the installed-app flow (a local browser redirect), which only works with Desktop clients. You can check the downloaded JSON: a Desktop secret has a top-level
- Download the JSON and save it as
.vibepaper/credentials.jsonin your project root (next topaper.toml). - Keep
.vibepaper/out of git. It holds the client secret and, after the first sync, a refresh token (token.json) that grants access to your Google Docs. Add this to your project's.gitignore:/.vibepaper/vibepaper syncprints a warning if it finds.vibepaper/is not ignored. - Build, then run the first sync:
vibepaper vibepaper syncA browser opens for sign-in. Because the app is unverified you will see "Google hasn't verified this app". This is expected for your own Testing app: click Advanced → Go to (app name) (unsafe), then allow access. The token is cached in.vibepaper/token.json, so later syncs do not open a browser.
The first sync creates a new Google Doc and prints its URL. Share it with collaborators as usual. Later syncs push only the changed paragraphs as suggestions (use --dry-run to preview them).
Headless / CI use: the first authorization has to happen in a browser. Run vibepaper sync once on a machine with a browser, then copy .vibepaper/token.json, credentials.json and sync_state.json to the headless machine, for example from a CI secret. Do not commit them.
Troubleshooting
| Symptom | Likely cause |
|---|---|
Error 403: access_denied in the browser |
Your account is not listed under Test users on the consent screen |
... is a 'Web application' OAuth client secret |
The client was created as Web application; create a Desktop app client instead |
Google Docs API has not been used in project ... or it is disabled |
Enable the Google Docs API (step 3) |
invalid_grant / token expired |
Delete .vibepaper/token.json and re-run to sign in again. Refresh tokens for apps in Testing expire after 7 days |
Project layout convention
my_paper/
├── paper.toml
├── .gitignore ← include /.vibepaper/ if you use sync
├── .vibepaper/ ← sync credentials + state (secrets, never commit)
├── paper/
│ ├── abstract.md
│ ├── introduction.md
│ ├── methods.md
│ ├── results.md
│ ├── discussion.md
│ ├── references.md
│ ├── figures.md
│ ├── supplementary.md
│ ├── reference.docx ← optional Word formatting template
│ ├── references.bib ← BibTeX bibliography
│ └── vancouver.csl ← CSL citation style
├── output/
│ ├── facts/
│ │ ├── cohort.csv ← field,value: n_patients, n_controls, ...
│ │ ├── model_results.csv ← field,value: auc, pvalue, effect_size, ...
│ │ └── ...
│ └── tables/
│ └── full_results.csv ← multi-row: used in include-csv directives
└── scripts/
└── run_analysis.py ← writes to output/facts/
Migrating an existing paper
Use ONBOARDING_PROMPT.md — see Using an AI agent? above.
What vibepaper does not do
vibepaper keeps manuscripts consistent with analysis outputs; it does not make analyses themselves reproducible. These are deliberately out of scope:
- Running your analysis scripts — vibepaper reads their outputs; it does not execute them or manage dependencies between them.
- Tracking whether outputs are current — it trusts whatever is in
output/facts/at build time. If you rerun a script and forget to rebuild, the paper will use stale data. A Snakemake workflow or similar is the right tool for dependency tracking. - Figure generation — plots and diagrams are produced by your scripts and embedded in Markdown as normal images. vibepaper does not generate or verify them.
- Environment reproducibility — Python versions, package versions, and input datasets are outside its scope. Use conda environments, Docker, or similar for that.
- Reference management — vibepaper delegates citation processing entirely to pandoc and the BibTeX/CSL ecosystem.
Changelog
See CHANGELOG.md for release history.
Metadata
Release files for vibepaper 0.13.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vibepaper-0.13.0.tar.gz | 351.5 kB | Without provenance | Details for vibepaper-0.13.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vibepaper-0.13.0-py3-none-any.whl | Python 3 | none | any | Details for vibepaper-0.13.0-py3-none-any.whl |
Total release size: 465.6 kB
Release files / vibepaper-0.13.0.tar.gz
| Download URL | vibepaper-0.13.0.tar.gz |
|---|---|
| Size | 351.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9a404ceee3a1230bec412da9c75b199e97fce4bab2dfa2a0374d485685afcd0f
|
|
BLAKE2b-256 checksum How to use checksums |
d64e38053d52f0c60b9f0f8d849c0857e3d9ab1f950ed81df54057f9e6ac0bdf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / vibepaper-0.13.0-py3-none-any.whl
| Download URL | vibepaper-0.13.0-py3-none-any.whl |
|---|---|
| Size | 114.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7d938ff2f2c3f4e6d4c48daf627c774ecaf11b50bf10f9f5edd5186c1ddd64ef
|
|
BLAKE2b-256 checksum How to use checksums |
4a2351e077a062700e13c57cad76e600f217d0be9e49eaeef1eda6d50c727bc8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for vibepaper 0.13.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.