collate: Instructions file for Gemini CLI

GEMINI.md

collate GEMINI.md is an instructions file for Gemini CLI from MidnightDarling/collate. It costs 1,228 tokens per session, scanned A, original, Apache-2.0.

A project instruction file for Collate, a toolkit that turns scanned Chinese historical documents into corrected Word documents and formatted articles.

In plain words
What is it for?
It describes the pipeline for scan cleanup, OCR, proofreading, comparison, Word export, and article formatting, plus research-oriented reading tools.
Why use it?
It gives coding agents the repository's workflow, available skills, and commands so document processing follows the project's conventions.

Instructions file for Gemini CLI

Written for Gemini CLI: the file is GEMINI.md. Also seen: mentions subagents; mentions AGENTS.md; mentions Gemini CLI.

This is MidnightDarling/collate's own configuration. It tells Gemini CLI how to work on collate itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything collate configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/MidnightDarling/collate/main/GEMINI.md
Clone the repo
git clone --depth 1 https://github.com/MidnightDarling/collate

Made for: Gemini CLI.

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 collate GEMINI.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/midnightdarling/collate/gemini-md/github.svg)](https://agentmods.dev/instructions/midnightdarling/collate/gemini-md)
Your own site
<a href="https://agentmods.dev/instructions/midnightdarling/collate/gemini-md"><img src="https://agentmods.dev/badge/instructions/midnightdarling/collate/gemini-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.

agentmods 80×15 button for collate GEMINI.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/midnightdarling/collate/gemini-md"><img src="https://agentmods.dev/badge/instructions/midnightdarling/collate/gemini-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,228 This file is loaded in full into every session.
When invoked 1,228 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.01228 $0.01228
Opus 5.5 $0.00491 $0.00491
Sonnet 5.5 $0.00246 $0.00246
Haiku 4.5 $0.00123 $0.00123

Measured 1mo ago against content hash 5d8aa2556d55, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

collate GEMINI.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 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.

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.

GEMINI.md · 104 lines

How it starts

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

GEMINI.md — collate

Gemini CLI 在每次会话中自动加载此文件作为项目上下文。完整工作流契约见 AGENTS.md。

这个仓库是什么

collate 是一个中文历史文献 OCR + 校对工具包。从扫描件到最终的 Word 稿和公众号推文,agent 自主完成清理、识别、校对、自审、排版。所有中间产物保留在工作区,方便逐行溯源。

pipeline 之上还有一层阅读 skill——用学术方法而非数据提取的方式与文本对话。

15 个 skill

8 个流水线 + 7 个阅读。每个 skill 是一个自包含目录:SKILL.md(指令)+ scripts/(Python)+ references/(知识库)。

流水线

Skill 做什么 何时调用
setup 环境诊断(Python、poppler、OCR 凭据) 首次使用
prep-scan 去水印 / 去馆藏章 / 裁边 → cleaned.pdf 拿到 PDF 后
visual-preview 清理结果三态 HTML 预览 prep-scan 后
ocr-run MinerU / 百度 OCR → raw.md + meta.json visual-preview 后
proofread 五步 checklist → A/B/C 三级校对清单 raw.md 就位后
diff-review raw vs final 语义级审计 HTML final.md 就位后
to-docx 学术 Word 文档 diff-review 后
mp-format 公众号排版 HTML + xiumi sidecar 最后一步

阅读

Skill 做什么
xray-paper 单篇论文 X 光透视(Obsidian 原生)
paper-summary 5–30 篇语料图谱(Obsidian 原生)
chunqiu 读禁忌、裁断与策略性沉默
kaozheng 审引文、来源等级与论证链
prometheus 定义一个概念,渲染 SVG 卡片
real-thesis 挖掘论文绕而未写的真命题
constellatio 跨时代接受史诊断 + 可选星图可视化

调用方式

读取目标 skill 的 SKILL.md 获取完整指令,然后通过 shell 执行 Python 脚本:

# 1. 读 skill 契约
cat skills/<skill-name>/SKILL.md

# 2. 执行脚本(示例:拆页)
python3 skills/prep-scan/scripts/split_pages.py \
    --pdf "$WORK_DIR/original.pdf" --out "$WORK_DIR/pages" --dpi 300

一条命令跑完整 pipeline(不需要 agent 介入):

python3 scripts/run_full_pipeline.py --pdf <input.pdf>

2 个 subagent

Agent 文件 职责
ocr-pipeline-operator agents/ocr-pipeline-operator.md 流水线总调度:机械编排 → 校对 → 自审 → 交付
historical-proofreader agents/historical-proofreader.md 校对领域专家:五步 checklist,产出 A/B/C 分级清单

调度 subagent 的方式:开一个新的 Gemini CLI 会话,把 agent 定义作为上下文加载:

gemini -C agents/historical-proofreader.md \
  "type=modern, 请按五步 checklist 校对 $WORK_DIR/raw.md"

或在当前会话中用 @agents/historical-proofreader.md 引用 agent 定义。

工作区约定

每份 PDF 产生一个 <basename>.ocr/ 目录。详见 references/workspace-layout.md。

Read the full file on GitHub · 104 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. 1mo ago First seen · 104 lines · 1,228 tokens per session scan A 5d8aa2556d55

Subscribe to this mod's changes

collate GEMINI.md is an instructions file published in the GitHub repository MidnightDarling/collate (7 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 1,228 tokens to every session, about $0.0049 per session on Opus 5.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-31.

Related

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).

microsoft/vscode · 9,649 tokens

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.

vercel/next.js · 7,384 tokens

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).

microsoft/vscode · 5,262 tokens

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.

langchain-ai/langchain · 4,680 tokens

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).

microsoft/vscode · 2,731 tokens

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.

denoland/deno · 3,077 tokens