Borrowing it
Nothing to install: this file belongs to MidnightDarling/collate. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/MidnightDarling/collate/main/AGENTS.mdgit clone --depth 1 https://github.com/MidnightDarling/collateWrote 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.
[](https://agentmods.dev/instructions/midnightdarling/collate/agents-md)<a href="https://agentmods.dev/instructions/midnightdarling/collate/agents-md"><img src="https://agentmods.dev/badge/instructions/midnightdarling/collate/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/midnightdarling/collate/agents-md"><img src="https://agentmods.dev/badge/instructions/midnightdarling/collate/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.08385 | $0.08385 |
| Opus 5.5 | $0.03354 | $0.03354 |
| Sonnet 5.5 | $0.01677 | $0.01677 |
| Haiku 4.5 | $0.00839 | $0.00839 |
Grade B, and why
collate AGENTS.md scanned grade B with 1 finding 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 1mo 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.
Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
- `~/.codex/config.toml` 里的 `command_attribution` 必须保持 `false` How it starts
The opening of the file, as written. The whole thing — 560 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
面向任何运行此 pipeline 的 agent 运行时(Claude Code / Codex CLI / Cursor / Gemini CLI / Hermes agents)。描述完整的自动化工作流、每个 skill 的调用契约、agent 自主决策点、失败处理。人类只负责提供 PDF、接收最终产物与审计报告。
范围说明:本文档覆盖 8 步 pipeline 层。仓库还包含 7 个阅读层 skill(
xray-paper/paper-summary/chunqiu/kaozheng/prometheus/real-thesis/constellatio),它们独立于 pipeline,使用各自skills/<name>/SKILL.md作为调用契约,本文档不重复展开。
总原则
- 端到端自主:从 PDF 到
.docx+.mp.html由 agent 独立完成。不要把中间步骤暴露给人类确认,除非失败降级到人类决策(见「失败处理」)。 - 保留可追溯性:每一步的中间产物全部落盘,不清理。diff-review 的审计报告是交付的一部分,不是调试工具。
- 按 checklist 执行 proofread:结果是机器可读的结构化清单(A/B/C 分级),由 agent 消化后修改
raw.md → final.md。不做超出清单的结构性改写。 - 不替换学术判断:C 类(存疑待考)条目不要替人做决定;在
final.md里保留原文 + 脚注标注,由读者判断。 - 失败要显性:引擎调用失败、依赖缺失、输入不合规 → 立即终止并回传结构化错误,不要静默兜底。
Pipeline 全景
Human ──► PDF
│
▼
┌──────────────────────────────────────────────────┐
│ 1. prep-scan 产 <ws>.ocr/prep/cleaned.pdf │
│ 2. visual-preview 产 previews/visual-prep.html │
│ 3. ocr-run 产 raw.md + meta.json + assets │
│ 4. proofread 产 review/raw.review.md │
│ 5. (agent 按 checklist 写 final.md) │
│ 6. diff-review 产 previews/diff-review.html │
│ 7. to-docx 产 output/<title>_…_final.docx │
│ 8. mp-format 产 output/<title>_…_wechat.* │
└──────────────────────────────────────────────────┘
│
▼
Human ◄── <ws>.ocr/README.md (指向 output/ 与 previews/)
整个 .ocr/ 工作区自描述:根目录 README.md 由 scripts/workspace_readme.py 在每个 skill 结束时刷新,给人类一个清晰的入口。
一条命令模式:
- shell / CI / 本地编排:
python3 scripts/run_full_pipeline.py --pdf <input.pdf> - agent runtime:以
agents/ocr-pipeline-operator.md作为单一入口;它负责调用上面的总编排脚本、在raw.md就位后起historical-proofreadersubagent、再重入总编排脚本完成final.md/diff-review/docx/wechat。
每一步的详细契约见下。
1. setup(首次/环境校验)
何时调用:新环境、依赖缺失、OCR 凭证未配置或怀疑失效。稳定环境下不重复调用。
做什么:按 skills/setup/SKILL.md 检查 Python 依赖、poppler、mineru CLI 可用性;探活 OCR_ENGINE 指向的引擎(本地 mineru 跑一个 --help、云 API 或百度跑一次空探测)。
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.
- 1mo ago First seen · 560 lines · 8,385 tokens per session scan B 2cd12b701f4d
collate AGENTS.md is an instructions file published in the GitHub repository MidnightDarling/collate (7 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 8,385 tokens to every session, about $0.0335 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode copilot-instructions.md
Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).
deno copilot-instructions.md
Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.