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 skills/cameronfreer/lean4-skills/lean4npx skills add cameronfreer/lean4-skills --skill lean4git clone --depth 1 https://github.com/cameronfreer/lean4-skillsWrote 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/skills/cameronfreer/lean4-skills/lean4)<a href="https://agentmods.dev/skills/cameronfreer/lean4-skills/lean4"><img src="https://agentmods.dev/badge/skills/cameronfreer/lean4-skills/lean4.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.00128 | $0.07278 |
| Opus 5 | $0.00064 | $0.03639 |
| Sonnet 5 | $0.00026 | $0.01456 |
| Haiku 4.5 | $0.00013 | $0.00728 |
Grade A, and why
lean4 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 yesterday.
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 — 434 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Lean 4 Theorem Proving
Use this skill whenever you're editing Lean 4 proofs, debugging Lean builds, formalizing mathematics in Lean, or learning Lean 4 concepts. It prioritizes LSP-based inspection and mathlib search, with scripted primitives for sorry analysis, axiom checking, and error parsing.
Core Principles
Search before prove. Many mathematical facts already exist in mathlib. Search exhaustively before writing tactics.
Build incrementally. Lean's type checker is your test suite—if it compiles with no sorries and standard axioms only, the proof is sound.
Respect scope. Follow the user's preference: fill one sorry, its transitive dependencies, all sorries in a file, or everything. Ask if unclear.
Use 100-character line width for Lean files. Do not wrap lines at 80 characters — Lean and mathlib convention is 100. If a line fits within 100 characters, keep it on one line. See mathlib-style for breaking strategies when lines exceed 100.
Mathlib style quick check. For ordinary mathematical lambdas, write fun x ↦ ... (\mapsto), not fun x => .... Use => for match/do branches and metaprogramming callback idioms. Prefer show P by tac for tactic proofs; use show P from term only for term proofs. See mathlib-style.
Preserve statements and signatures — they're the file's contract. Theorem/lemma statements and type signatures are off-limits unless the user explicitly requests changes; changing them can break callers or alter the theorem being proved. If a proof seems to require changing a statement or adding a custom axiom, stop and discuss first because that changes the contract or the proof's trust basis. Exception: within synthesis wrappers (/lean4:formalize, /lean4:autoformalize), session-generated declarations may be redrafted under the outer-loop statement-safety rules; see cycle-engine.md.
Docstrings are scoped by workflow. Existing docstrings are API. The default is Rule A — any workflow that mutates existing declarations follows it unless the user explicitly requests docstring changes:
What ships with it
46 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- agents/openai.yaml 166 B
- references/agent-workflows.md 7.4 KB
- references/axiom-elimination.md 7.5 KB
- references/calc-patterns.md 8.7 KB
- references/command-examples.md 50 KB
- references/command-invocation.md 5.6 KB
- references/compilation-errors.md 32 KB
- references/compiler-guided-repair.md 19 KB
- references/compiler-internals.md 6.7 KB
- references/cycle-engine.md 38 KB
- references/disprove-engine.md 52 KB
- references/domain-patterns.md 25 KB
- references/ffi-interop.md 7.6 KB
- references/grind-tactic.md 11 KB
- references/handoff-contract.md 15 KB
- references/instance-pollution.md 16 KB
- references/json-patterns.md 4.8 KB
- references/lean-lsp-server.md 12 KB
- references/lean-lsp-tools-api.md 32 KB
- references/lean-phrasebook.md 17 KB
- references/lean4-custom-syntax.md 14 KB
- references/lean4-review-input-schema.json 6.7 KB
- references/lean4-review-schema.json 3.8 KB
- references/learn-pathways.md 21 KB
- references/linter-authoring.md 3.4 KB
- references/mathlib-guide.md 15 KB
- references/mathlib-review-taxonomy.md 9.2 KB
- references/mathlib-style.md 15 KB
- references/measure-theory.md 28 KB
- references/metaprogramming-patterns.md 4.7 KB
- references/performance-optimization.md 18 KB
- references/profiling-workflows.md 1.9 KB
- references/project-context.md 4.3 KB
- references/proof-golfing-patterns.md 16 KB
- references/proof-golfing.md 13 KB
- references/proof-refactoring.md 28 KB
- references/proof-simplification.md 9.6 KB
- references/proof-templates.md 3.7 KB
- references/review-hook-schema.md 10 KB
- references/scaffold-dsl.md 1.8 KB
- references/simp-reference.md 16 KB
- references/sorry-filling.md 11 KB
- references/subagent-workflows.md 22 KB
- references/tactic-patterns.md 3.6 KB
- references/tactics-reference.md 20 KB
- references/verso-docs.md 2.2 KB
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.
- yesterday Changed · +2 lines 54a1d1ef844c
- 5d ago First seen · 432 lines · 128 tokens per session scan A 0e175228e607
lean4 is a skill published in the GitHub repository cameronfreer/lean4-skills (428 stars, last pushed yesterday), licensed MIT. It adds 128 tokens to every session and 7,278 once invoked, about $0.0006 per session on Opus 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-30.
Other skills, from other repositories
matlab
Build, review, migrate, and safely plan MATLAB or GNU Octave numerical workflows, including arrays, tabular/time data, tests, projects, graphics, MAT files, and explicit Python interoperability.
ast-grep
Guide for writing ast-grep rules to perform structural code search and analysis. Use when users need to search codebases using Abstract Syntax Tree (AST) patterns, find specific code structures, or perform complex code queries that go beyond simple text search. This skill should be used when users ask to search for…
platform-detection
Identify a .NET project's test platform, framework, command mode, and SDK-style vs classic project system. Use only for "which test platform/framework?", "VSTest or MTP?", or "what runner does this project use?", including bridge settings, UseVSTest opt-outs, and incompatible or conflicting VSTest/MTP configuration.…
rust-pro
Master modern Rust (2024 edition) with async patterns, advanced type system features, and production-ready systems programming. Expert in the current Rust ecosystem including Tokio, axum, and modern crates. Use PROACTIVELY for Rust development, performance optimization, or systems programming.
unity-version-split
Split a C# file into Unity 6.5+ and pre-Unity 6.5 variants. Use when a file needs different implementations for different Unity versions due to API changes (e.g., EntityId vs int, GetEntityId vs GetInstanceID).
omh-rust
This is a Hermes-native rust workflow skill.