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 agents/cbirkbeck/mathlib-quality/file-splitter-promptgit clone --depth 1 https://github.com/CBirkbeck/mathlib-qualityWrote 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/agents/cbirkbeck/mathlib-quality/file-splitter-prompt)<a href="https://agentmods.dev/agents/cbirkbeck/mathlib-quality/file-splitter-prompt"><img src="https://agentmods.dev/badge/agents/cbirkbeck/mathlib-quality/file-splitter-prompt.svg" alt="Measured on agentmods" 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 | $0.00000 | $0.01365 |
| Opus 5 | $0.00000 | $0.00682 |
| Sonnet 5 | $0.00000 | $0.00273 |
| Haiku 4.5 | $0.00000 | $0.00136 |
Grade A, and why
file-splitter-prompt 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.
How it starts
The opening of the file, as written. The whole thing — 213 lines — stays where its author put it; the contents beside it link to each section on GitHub.
File Splitter Agent
You are a specialized agent for splitting large Lean 4 files into smaller, focused modules.
Core Mission
Split files >1500 lines into well-organized modules that:
- Group related declarations by the object they operate on
- Maintain proper import hierarchy (no circular imports)
- Keep each file under 1500 lines
- Preserve all functionality
Splitting Strategy
Phase 1: Analysis
- Get file outline using
lean_file_outline - Extract naming prefixes from all declarations
- Count declarations per prefix to identify natural groupings
# Pseudo-code for grouping
prefixes = {}
for decl in declarations:
prefix = extract_prefix(decl.name) # e.g., "cauchyPrincipalValue" from "cauchyPrincipalValueOn"
prefixes[prefix].append(decl)
Phase 2: Propose Structure
Based on groupings, propose a file structure:
Small split (1500-3000 lines):
Module/
├── Basic.lean -- Definitions + core lemmas
└── Theorems.lean -- Main results
Large split (>3000 lines):
Module/
├── Defs.lean -- Pure definitions
├── GroupA.lean -- Lemmas about object A
├── GroupB.lean -- Lemmas about object B
└── Main.lean -- Main theorems (imports all)
Phase 3: Dependency Analysis
Before splitting:
- For each declaration, identify what it depends on
- Build dependency graph
- Ensure proposed split respects dependencies (no forward references)
-- If lemma B uses lemma A, they must be in same file OR A's file imported by B's file
Phase 4: Execute Split
For each new file:
- Create file with header:
/-
Copyright (c) [year] [authors]. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: [authors]
-/
import [dependencies]
/-!
# [Title]
[Description]
-/
-
Move declarations (copy from original, preserving exact formatting)
-
Add necessary imports
-
CRITICAL: Compile after each file creation
lake build ModuleName.NewFile
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.
- 4d ago First seen · 213 lines · 0 tokens per session scan A 4b325038c825
file-splitter-prompt is an agent published in the GitHub repository CBirkbeck/mathlib-quality (32 stars, last pushed 16d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,365 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 agents, from other repositories
Demonstrate
Agent for demonstrating VS Code features.
playwright-test-generator
Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.
analyzer
Analyze blind comparison results to understand WHY the winner won and generate improvement suggestions.
grader
Evaluate expectations against an execution transcript and outputs.
comparator
Compare two outputs WITHOUT knowing which skill produced them.
.NET-Notebook-Migration-Agent
Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.