From lean
Creates minimal working examples (MWEs) from Lean 4 errors for bug reports using lake minimizers, with setup for lean4 and mathlib4 repositories.
npx claudepluginhub leanprover/skills --plugin leanThis skill uses the workspace's default tool permissions.
1. **Set up the guard** (`#guard_msgs` or `#guard_panic`)
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
#guard_msgs or #guard_panic)lake exe minimizeFor Mathlib-related bugs:
cd /tmp
git clone https://github.com/kim-em/mathlib-minimizer.git
cd mathlib-minimizer
lake exe cache get
For pure Lean 4 bugs:
cd /tmp
git clone https://github.com/kim-em/lean-minimizer.git
cd lean-minimizer
Use #guard_msgs to capture the exact error:
import Mathlib.SomeModule
/--
error: the exact error message
goes here verbatim
-/
#guard_msgs in
example : ... := by some_tactic
import Mathlib.SomeModule
#guard_msgs in
#guard_panic in
some_command_that_panics
lake env lean YourFile.lean
No output = success (guard passed). Error output = guard failed, and you need to redesign the test case.
lake exe minimize YourFile.lean
Output is written to YourFile.out.lean.
--resume: Continue from the output file if interrupted--quiet: Suppress progress output--only-delete: Only run the deletion pass--only-import-inlining: Only inline importsNever use --no-import-inlining. The entire point is to produce a self-contained file.
Use --resume to continue from where you left off:
# Initial run (Ctrl-C if needed)
lake exe minimize YourFile.lean
# Resume later
lake exe minimize YourFile.lean --resume
After manually editing the .out.lean file, always use --resume to continue from the edited state.
lake env lean YourFile.out.lean
.out.lean file compiles with the expected error/panic#guard_msgs matches exactly