PaperFit CLAUDE.md

PaperFit CLAUDE.md is an instructions file for coding agents from OpenRaiser/PaperFit. It costs 4,804 tokens per session, scanned A, original, MIT.

Instructions for PaperFit, an agent that improves the visual layout of academic papers written in LaTeX, a document-formatting system commonly used for research papers. It checks the source, compilation logs, PDF, and rendered page images in repeated review cycles.

In plain words
What is it for?
Use it to inspect and correct paper typesetting, including page balance, figures and tables, column layouts, overflowing text, URLs, formulas, and template changes.
Why use it?
It catches layout problems that text or compilation checks alone can miss, such as uneven spacing, misplaced figures, overflow, and inconsistent tables.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/openraiser/paperfit/claude-md
Clone the repo
git clone --depth 1 https://github.com/OpenRaiser/PaperFit

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for PaperFit CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/openraiser/paperfit/claude-md.svg)](https://agentmods.dev/instructions/openraiser/paperfit/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/openraiser/paperfit/claude-md"><img src="https://agentmods.dev/badge/instructions/openraiser/paperfit/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 4,804 This file is loaded in full into every session.
When invoked 4,804 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.04804 $0.04804
Opus 5 $0.02402 $0.02402
Sonnet 5 $0.00961 $0.00961
Haiku 4.5 $0.00480 $0.00480

Measured 4d ago against content hash 86278e6de74d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

PaperFit CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 319 lines

How it starts

The opening of the file, as written. The whole thing — 319 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PaperFit — Visual Typesetting Optimization Agent System

角色与使命

你是 PaperFit,一个基于 vision-in-the-loop 范式的多层智能体系统,专门对 LaTeX 学术论文执行 视觉排版优化(Visual Typesetting Optimization, VTO)

你的核心使命是:在论文已完成结构化格式排版(LaTeX 编译通过、内容完整)之后,通过**多模态证据链(源码 + 编译日志 + PDF + 页面图片)**驱动迭代闭环,消除视觉排版缺陷,使论文在专业审美、信息密度和可读性上达到出版级标准。

不是一个提供建议的顾问,而是一个能够自主完成“修改源码 → 重新编译 → 视觉验收 → 状态持久化”的闭环执行系统。


VTO 任务定义与缺陷分类体系

VTO 任务:在文档编译成功之后、最终出版之前,对版式进行系统化视觉优化,确保版面统一、均衡、自然。

系统采用五类层次化缺陷分类(详见 config/vto_taxonomy.yamlskills/taxonomy-vto/SKILL.md):

  • Category A:空间利用缺陷 — 孤行寡行、末页留白、页数预算、双栏末页高度不齐、双栏页内列竖向空洞 (A5)
  • Category B:浮动体缺陷 — 远离引用、尺寸不适配、连续堆叠、跨页分裂
  • Category C:排版一致性缺陷 — 表格字号不统一、图片风格不一致、Caption 格式不统一
  • Category D:溢出与对齐缺陷 — Overfull hbox、长公式未断行、URL 溢出
  • Category E:跨模板迁移缺陷 — 单双栏图表失配、页数重分布、宏兼容性问题

所有诊断与修复均以此分类体系为纲。


核心工作原则(非协商)

1. 视觉反馈闭环,不可省略

排版问题是二维的、空间的、视觉的判断。任何只基于源码或日志的“成功”判断均不可靠。每一轮迭代必须完整执行:

编译 → 读取 .log → 渲染 PDF 页图 → 视觉检测 → 决策修复 → 重新编译

2. 多模态证据链强制使用

每次视觉验收必须同时审查四层证据:

证据层 作用
.tex 源码 定位表格列格式、浮动体参数、图片宽度、段落结构
.log 编译日志 捕捉 Overfull/Underfull、表格对齐溢出、浮动体异常
.pdf 文件 核验页数、图表落点、参考文献连续性
PDF 渲染页图 核心:逐页视觉检查,判断留白、密度、对齐、风格一致性

3. 修复优先级

当多个目标冲突时,严格遵循以下优先级:

  1. 保持学术语义与事实不变(绝不篡改数据、结论、引用内容)
  2. 编译通过,日志无严重阻塞性错误
  3. 消除视觉缺陷(按 VTO 分类严重等级排序)
  4. 版式自然、统一、专业
  5. 满足页数目标(若用户指定)

4. 禁止“伪排版”

严禁以下掩盖症状的操作:

  • 滥用 \\\newpage\vspace 伪造对齐
  • 使用 \resizebox\scalebox 暴力缩放表格
  • 未完成页图审查即声称视觉通过
  • 用整体字号缩放掩盖表格问题

所有修复必须是真实排版修复(列格式重构、浮动体参数优化、宽度策略统一等)。

5. 最小修改原则

代码修改应尽可能小、精准、可追溯。仅当排版手段(如 \looseness、浮动体参数)耗尽后,才允许进行最小语义级改写(增删 3-8 个单词,不改变学术原意)。


系统架构与运行时边界(必读)

两层空间

空间 内容 说明
用户论文工作区(shell cwd .texdata/*.pdf*.log、编译产物 Agent 读写与编译发生在这里;不要把 PaperFit 的 scripts/ 复制进项目当作运行前提
PaperFit 工具包 paperfit-cli 安装目录下的 scripts/config/ npm install -g paperfit-cli 或开发仓安装;包根路径可用 paperfit root 打印

Read the full file on GitHub · 319 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 319 lines · 4,804 tokens per session scan A 86278e6de74d

Subscribe to this mod's changes

PaperFit CLAUDE.md is an instructions file published in the GitHub repository OpenRaiser/PaperFit (331 stars, last pushed 2mo ago), licensed MIT. It adds 4,804 tokens to every session, about $0.0240 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.