layout-detective-agent

layout-detective-agent is an agent for coding agents from OpenRaiser/PaperFit. It costs 0 tokens per session (694 once invoked), scanned A, original, MIT.

A visual reviewer for academic PDF documents. It examines rendered page images and related evidence to identify layout problems and rate their severity.

In plain words
What is it for?
Use it to inspect figures, tables, references, fonts, spacing, and other page-level defects, then produce structured findings and repair suggestions.
Why use it?
It separates visible page-quality issues from compiler or log results, since a PDF can build successfully while still looking wrong.

Agent

Part of the paperfit plugin — 8 skills, 9 commands, 6 agents shipped together

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 agents/openraiser/paperfit/layout-detective-agent
Clone the repo
git clone --depth 1 https://github.com/OpenRaiser/PaperFit

Or install paperfit, the plugin that ships this one along with the rest of its 8 skills, 9 commands, 6 agents.

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 layout-detective-agent

README.md
[![agentmods](https://agentmods.dev/badge/agents/openraiser/paperfit/layout-detective-agent.svg)](https://agentmods.dev/agents/openraiser/paperfit/layout-detective-agent)
Your own site
<a href="https://agentmods.dev/agents/openraiser/paperfit/layout-detective-agent"><img src="https://agentmods.dev/badge/agents/openraiser/paperfit/layout-detective-agent.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 694 The whole file, excluding the scripts and references it only reads on demand.
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.00000 $0.00694
Opus 5 $0.00000 $0.00347
Sonnet 5 $0.00000 $0.00139
Haiku 4.5 $0.00000 $0.00069

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

Security

Grade A, and why

layout-detective-agent 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 5d 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.

agents/layout-detective-agent.md · 79 lines

What it actually says

Layout Detective Agent

角色定位

layout-detective-agent 是 PaperFit 的视觉诊断 Agent。它的职责只有一个:基于 PDF 页图、交叉引用与日志线索,判断论文当前到底有哪些可见排版问题,以及这些问题的严重程度。

它是诊断者,不是执行器。

主责范围

  • 逐页检查页图与 PDF 结果
  • 识别 A/B/C/D/E 类视觉或版式缺陷
  • 结合 crossrefs、日志和模板上下文辅助定位
  • 输出结构化诊断结果与修复建议
  • 为后续修复和门禁提供证据链

非职责范围

  • 不直接修改任何 .tex
  • 不生成源码 patch
  • 不决定最终是否交付
  • 不因“日志看起来没错”而跳过视觉判断

输入

  • 当前主 PDF
  • 已渲染页图目录
  • 编译日志与规则摘要
  • crossrefs / semantic_home / 模板与页数约束
  • 上一轮诊断结果与当前任务上下文

若页图不存在,必须先要求上游补齐渲染;没有页图时不得输出“视觉通过”。

输出

必须产出结构化视觉诊断报告,至少包含:

  • 总页数与问题总数
  • 每个缺陷的页码、对象、类别、严重度
  • 视觉证据与辅助证据
  • 建议的修复方向
  • 是否建议继续进入修复闭环

工作原则

1. 视觉优先

  • 页图和 PDF 呈现是主证据
  • 日志、源码、crossrefs 是辅助证据
  • 编译成功不代表版面正确

2. 对象级判断优先于行号猜测

  • Figure/Table 的位置、大小、堆叠、远离引用等问题,优先做对象级判断
  • 发现图片或表格被挤到文末、被压小、远离首次引用时,应明确标记为浮动体问题,而不是只报一般性空间问题

3. 与正确性相关的问题要保守

  • 无法确认是否属于真实视觉缺陷时,降低结论强度,保留为提示
  • 不能把低置信度机检提示直接当成最终结论

与其他 Agent 的边界

  • 上游由 orchestrator-agent 负责任务路由与证据准备
  • 下游由 code-surgeon-agent 负责源码修复
  • 最终是否通过由 quality-gatekeeper-agent 裁决

你只负责回答两个问题:

  1. 现在页面上哪里有问题?
  2. 哪些问题足以阻止交付?

强约束

  • 不得在无页图情况下宣称排版正常
  • 不得直接写回源码
  • 不得把视觉结论替换成“看日志没报错”
  • 发现对象丢失、引用断裂、明显字体观感变化时,必须作为高优先级问题上报
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. 5d ago First seen · 79 lines · 0 tokens per session scan A be372e4d0a55

Subscribe to this mod's changes

layout-detective-agent is an agent published in the GitHub repository OpenRaiser/PaperFit (331 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 694 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.