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.
npx agentmods add commands/openraiser/paperfit/fix-layoutgit clone --depth 1 https://github.com/OpenRaiser/PaperFitWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.01375 |
| Opus 5 | $0.00000 | $0.00687 |
| Sonnet 5 | $0.00000 | $0.00275 |
| Haiku 4.5 | $0.00000 | $0.00137 |
Grade A, and why
fix-layout 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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 124 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/fix-layout — 启动完整 VTO 排版优化
作用: 对当前 LaTeX 项目执行完整的视觉排版优化(VTO)闭环
防呆约束:
- 用户只需要表达目标,不需要手动执行内部命令
- 直接执行
paperfit runtime .../paperfit run .../paperfit render ... - 不要为了“启动闭环”先去调用任何内部任务管理工具
- 不要调用
TaskCreate、TodoWrite、Plan、Agent之类的任务编排工具来代替实际执行 - 不要在
/fix-layout过程中再自动触发其他斜杠命令 - 如果任务工具 schema 缺失或出现
InputValidationError,应立即回退到直接 shell 命令,不要重试任务工具
用户入口说明
/fix-layout是专家快捷入口,不是要求用户理解内部 CLI 的入口。- 与之对应的普通自然语言,例如“修复这篇论文的排版问题”“尽量不改语义地压到 9 页”,也应能触发同类任务。
- CLI、runtime、scripts 是你的执行层,不是用户的产品接口。
工具调用约定
可执行脚本在 paperfit-cli 包内;在论文项目根目录执行,勿假设仓库里自带可运行的 scripts/:页图用 paperfit render <pdf> --output data/pages,其它用 paperfit run scripts/<文件> [参数…];无全局命令时用 npx paperfit-cli … 或 python3 "$(paperfit root)/scripts/…"。
用法
/fix-layout
也可以由普通自然语言触发,例如:
用 PaperFit 修复当前论文的排版问题
把这篇论文排到投稿状态,优先修视觉问题
把正文压到 9 页,尽量不要改正文含义
直接执行入口
首选直接运行:
paperfit runtime --state data/state.json run-round main.tex --template <TEMPLATE> --target-pages <N>
若还未初始化,再先执行:
paperfit runtime --state data/state.json init-task main.tex --template <TEMPLATE> --target-pages <N>
column_void Schema 提示
data/reports/column_void_rN.json是detect_column_void.py的原始报告- 原始报告顶层字段使用
pages[] by_page[]不在原始报告里by_page[]只存在于data/state.json -> cv_signals_summary.by_page
如果要直接分析原始报告,应读取:
{
"page_count": 60,
"pages": [
{
"page_image": "data/pages/xxx.png",
"columns": {
"left": {"max_void_ratio": 0.0},
"right": {"max_void_ratio": 0.0}
},
"a5_candidates": []
}
]
}
不要写:
data["by_page"]
除非你读的是 data/state.json 的 cv_signals_summary。
执行流程
- 画像(推荐):若用户尚未建立
data/paperfit-portrait.yaml,可在内部先执行画像构建或刷新;不要把这一步强制变成用户必须再次输入/paperfit的动作。若已存在画像,每轮门禁结束或本轮 tex/pdf 更新后执行paperfit run scripts/paperfit_portrait.py refresh刷新扫描项与state.task.portrait_*。 - 识别主
.tex文件(data/benchmarks/case/*.tex) - 初始化或加载
state.json(优先使用paperfit runtime --state data/state.json init-task main.tex ...;双栏论文补--column-type double;若已由/paperfit写入栏型,以state.json/ 画像为准) - 每轮优先执行
paperfit runtime --state data/state.json run-round main.tex --template <TEMPLATE> --target-pages <N>,统一完成轮次推进、日志解析、crossrefs 提取、页图检查、缺陷摘要推导与 gatekeeper 回写;若需拆步排障,再退回start-round/mark-compile/mark-render/gatekeeper - 若是双栏任务且本轮已生成页图,再执行
detect_column_void+paperfit runtime --state data/state.json ingest-column-void data/reports/column_void_rN.json写入机检摘要 - 规则引擎检测编译日志错误
- 排版侦探基于 VTO 分类体系检测视觉缺陷(合并
machine_signals与 VLM) - 代码外科医生执行修复
- 重新编译 → 质量门禁验收(诊断报告用
config/diagnostic_report.template.md) - 迭代至 DONE 或达到最大轮次
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.
- 2d ago First seen · 124 lines · 0 tokens per session scan A c5023141310f
fix-layout is a command published in the GitHub repository OpenRaiser/PaperFit (330 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,375 tokens. 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.
Other commands, from other repositories
launch-rhino
Launch a single Rhino MCP session via the router.
ux-lint
Deterministic regex-based linter for AI fingerprints. No LLM, no API, no network. CI-friendly — exits non-zero on Critical / High findings. Rules sourced from references/foundations/anti-patterns.md. Triggers: "lint this", "scan for AI slop", "CI check", "find anti-patterns", "audit before commit".
ux-recommend
The v2 flagship. Runs the 5-parallel-search Python engine across 11 data manifests (75+ styles, 170+ palettes, 65+ type pairs, 120+ components, 170+ industries, 110+ UX laws, 50+ motion presets, 120+ anti-patterns, 92 brand specs) and returns a complete recommended design system for your project — with always-on…
ux-evolve
Auto-iterate the lint→polish→re-lint loop on a generated artifact until score crosses 90 or plateaus. Triggers on "polish this", "evolve this surface", "improve until score 90+", "auto-fix", "run the loop". Use when the user has a freshly generated surface that needs automatic refinement to ship-ready quality. Skip…
pn-colorize
Introduce or improve color — palette, tokens, contrast, dark mode. Surgical command for color decisions. Works standalone or as part of pn-design.
typescript
Apply TypeScript best practices and coding standards.