Deterministic Python tools for academic-paper development. No LLM calls.
Project description
paper-toolkit
Deterministic Python tooling for the fixed steps of academic-paper development — workspace setup, evidence-DAG management, structured checks, LaTeX composition, compile + page introspection, figure rendering, literature search, and an analysis pipeline that feeds the manuscript.
The toolkit contains no LLM calls. All writing, review, and judgment lives in the companion Claude Code skills, which call into this CLI for everything that should be reproducible.
Why
Paper drafts drift between agents, sessions, and editors. The toolkit pins the mechanical parts — schemas, checks, file layout, LaTeX compose, evidence DAG — so the agent only owns prose. Two skills ship with the package:
agentsociety-analysis— runs the 6-stage analysis pipeline (frame → explore → claims → refine → produce → synthesis) against an experiment SQLite database, emitting bilingual reports + publication-grade figure specs.agentsociety-generate-paper— turns analysis outputs into a Springer-Nature-style manuscript: intake, drafting, checks, skeptical review, revision loop, and compile.
Install
Requires Python ≥ 3.11.
# from a clone (recommended for now)
git clone https://github.com/Yokumii/paper-toolkit.git
cd paper-toolkit
uv sync
# or with pip
pip install .
LaTeX (TeX Live / MacTeX) is required for paper compile-once and
paper figure render. The toolkit shells out to latexmk / bibtex /
pdflatex and parses their logs deterministically.
Quick start
# 1. create a workspace
uv run paper init --title "Demo" --venue nature --language en --workspace ./demo
# 2. seed an evidence node + claim
uv run paper evidence add-claim --workspace ./demo \
--node-id c_warming --label "Mean temperature rose 1.1 K" --strength primary
# 3. render a figure from a JSON spec
uv run paper figure render --spec ./demo/paper/figure_specs/f_trend.json --workspace ./demo
# 4. compose and compile
uv run paper compose pack-figures --workspace ./demo
uv run paper compose write-main --workspace ./demo
uv run paper compile-once --workspace ./demo
# 5. structured checks
uv run paper check style --workspace ./demo
uv run paper check claim-coverage --workspace ./demo
uv run paper check figures --workspace ./demo
uv run paper check figure-qa --workspace ./demo
uv run paper status --workspace ./demo
Run uv run paper <group> --help for the full verb list in each group, or
see the dev branch for the long-form design and plan documents.
CLI surface
| Group | Purpose |
|---|---|
paper init / status / scan |
Workspace lifecycle and snapshotting |
paper evidence |
Evidence DAG: nodes, edges, claim/evidence linking |
paper template |
List and expand section templates |
paper compose |
Pack figures, write main.tex, write refs.bib |
paper compile-once / page |
LaTeX compile + page-metadata inspection |
paper check |
style, figures, claim-coverage, figure-qa |
paper figure / table |
Render figures and LaTeX tables from JSON specs |
paper lit |
Direct-API search (arXiv / CrossRef / OpenAlex) → refs.bib |
paper refs |
Inspect and dedup refs.bib (DOI + title-Jaccard fallback) |
paper analysis |
6-stage analysis pipeline + lift-to-evidence bridge |
Every command emits a JSON Envelope on stdout (success, payload, errors) so
the skills can route on structured results rather than parsing prose.
Using the Claude Code skills
The skills live under skills/ and are picked up automatically when
paper-toolkit is installed as a Claude Code plugin.
// in .claude-plugin/marketplace.json
{
"plugins": [
{
"name": "paper-toolkit",
"source": "https://github.com/Yokumii/paper-toolkit"
}
]
}
Inside a Claude Code session:
/skill agentsociety-analysis # run the analysis pipeline
/skill agentsociety-generate-paper # draft, check, and compile the manuscript
Both skills read their SKILL.md router first, then dispatch to per-stage
prompts and subagents (data-explorer, claim-extractor, figure-reviewer,
report-producer, skeptical-reviewer, …). All deterministic steps go through
this CLI; the skills never invent file paths or schemas.
Repository layout
src/paper_toolkit/ # the CLI + library (no LLM calls)
cli/ # Typer groups (init, evidence, compose, check, figure, lit, refs, analysis, ...)
models/ # Pydantic v2 schemas (paper.json, evidence graph, claims, ...)
analysis/ # 6-stage pipeline: db, state, claims, synthesis, lift
figures/ # JSON-spec → matplotlib renderer (Arial fallback, pdf.fonttype=42, 89/183mm)
checkers/ # style, figures, claim-coverage, figure-qa
refs/ # bib parser + dedup engine
lit/ # arXiv / CrossRef / OpenAlex search
typeset/ # main.tex composition + LaTeX log parsing
skills/
agentsociety-analysis/
agentsociety-generate-paper/
tests/ # 293 unit + integration tests
Design principles
- No LLM in the toolkit. Every CLI verb is pure Python + stdlib + a few scientific deps (matplotlib, pypdf, httpx). The agent decides what to write; the toolkit decides what's legal.
- Schemas at every boundary. Pydantic v2 with
extra="forbid"on every artifact:paper.json, evidence graph, claims, figure specs, check reports. - Derived state, no phase machines. State files record facts; stages are derived from artifact presence + schema validity, so the agent can't lie about progress.
- Idempotent bridges.
paper figure registerandpaper analysis lift-to-evidenceare safe to re-run — they update existing rows in place.
Development
uv sync --extra dev
uv run pytest -q
uv run ruff check src tests
The full design history and per-phase implementation plans live on the dev
branch (docs/design.md, docs/plans/).
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file paper_toolkit-0.1.0.tar.gz.
File metadata
- Download URL: paper_toolkit-0.1.0.tar.gz
- Upload date:
- Size: 306.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4c3aae6c5baa33e017a3575186423df95178cefb73ea3e7db0d629405c70176
|
|
| MD5 |
6c42ae359b238fa5dde94e27fec7760a
|
|
| BLAKE2b-256 |
d787bd341d68257b9ce2e54f72537923ca1cde3f1c06312a75ab4b05aa7e70d4
|
Provenance
The following attestation bundles were made for paper_toolkit-0.1.0.tar.gz:
Publisher:
release.yml on Yokumii/paper-toolkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
paper_toolkit-0.1.0.tar.gz -
Subject digest:
d4c3aae6c5baa33e017a3575186423df95178cefb73ea3e7db0d629405c70176 - Sigstore transparency entry: 1627414680
- Sigstore integration time:
-
Permalink:
Yokumii/paper-toolkit@e6330495f25dde4b4ab9d75234d78a1568d90678 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Yokumii
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e6330495f25dde4b4ab9d75234d78a1568d90678 -
Trigger Event:
push
-
Statement type:
File details
Details for the file paper_toolkit-0.1.0-py3-none-any.whl.
File metadata
- Download URL: paper_toolkit-0.1.0-py3-none-any.whl
- Upload date:
- Size: 154.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d62423f66c385d35e9fab2265412a16ec469799305fdfae9a4bb5efa54a4de79
|
|
| MD5 |
7bec4b7d923694a904af255dd2ed5f8c
|
|
| BLAKE2b-256 |
e8887e2e0b76b2de62ed50ffb3b42629767187022749034d7fc9db9b8a527cc5
|
Provenance
The following attestation bundles were made for paper_toolkit-0.1.0-py3-none-any.whl:
Publisher:
release.yml on Yokumii/paper-toolkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
paper_toolkit-0.1.0-py3-none-any.whl -
Subject digest:
d62423f66c385d35e9fab2265412a16ec469799305fdfae9a4bb5efa54a4de79 - Sigstore transparency entry: 1627414752
- Sigstore integration time:
-
Permalink:
Yokumii/paper-toolkit@e6330495f25dde4b4ab9d75234d78a1568d90678 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Yokumii
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e6330495f25dde4b4ab9d75234d78a1568d90678 -
Trigger Event:
push
-
Statement type: