/computational-research:paper-lean runs instead · from computational-research
Drives Lean 4 / Mathlib formalization sessions via lean-lsp MCP. Opens files, reads goal states, searches Mathlib for lemmas, verifies proofs, and writes formalization checklists.
This skill never runs in Claude Code
It ships in computational-research at skills/, but /computational-research:paper-lean (a command, or a skill Claude Code finds first) has the same name: typing it, or Claude choosing it, runs that one instead.
Coherent workflow around the lean-lsp MCP for formalization work.
The MCP itself is rate-limited and read-only; this skill orchestrates calls into a useful sequence and persists progress to Work/.
Proof code and formalization checklists are deliverables in the document-revise sense — present them and wait.
Lean/ (or lean/) directory with a lakefile.leantheorem declarationLean/ lakefile via the user)Before any other action:
Lean/ directory + lakefile.lean exist.
If not, ask the user whether to scaffold one (provide lake new <ProjectName> math as the recommended command — do not run it without confirmation).lake-manifest.json referencing mathlib).lean-lsp MCP responds — call mcp__lean-lsp__lean_file_outline on the target file.
If it fails, ask the user to run lake build once.The core loop, per sub-goal:
For each goal you are trying to close:
mcp__lean-lsp__lean_goal (file, line[, column])
Omit column to see the goal before and after the line.
If the result is "no goals", the proof is complete.
mcp__lean-lsp__lean_local_search with the goal's main predicate as query.mcp__lean-lsp__lean_state_search with the goal text.mcp__lean-lsp__lean_leansearch with a natural-language description._ ≤ _ * _": mcp__lean-lsp__lean_loogle with the pattern.simp/aesop?
mcp__lean-lsp__lean_hammer_premise.After finding a candidate name, confirm with mcp__lean-lsp__lean_hover_info (type signature + docs) and optionally mcp__lean-lsp__lean_declaration_file.
mcp__lean-lsp__lean_multi_attempt (file, line, snippets: ["simp", "ring", "omega", "exact?"])
Use line-based form (omit column) for fast REPL-style attempts.
Use column-based form when the attempt must occur at an exact source position.
After editing the file via the Edit tool, verify with:
mcp__lean-lsp__lean_diagnostic_messages (file)
mcp__lean-lsp__lean_verify (fully-qualified theorem name, e.g. "MyNS.my_thm")
lean_verify also runs an axiom check — fail loudly if it reports sorryAx or unexpected axioms.
Return to Step 1 if the goal is not yet closed.
When the user asks to formalize a math statement (vs. closing one specific goal), seed a checklist before opening Lean:
${CLAUDE_PLUGIN_ROOT}/skills/project-create/assets/formalization_checklist_template.md.Work/Backlog/Formalize-<KebabTopic>.md (move to Active/ when you start, archived to Done/ when complete — folder is the status), filling in:
lean_leanfinder and lean_leansearch to find candidates)Update the checklist after each substantive step (note what closed each sub-goal, any axioms used).
lean_build is slow — only invoke after adding imports.lean_profile_proof is slow — only when investigating a known-slow proof.leanfinder) — batch related queries.When you produce Lean code for the user:
theorem is closed, run lean_verify <fullname> and report the axioms used.Type: formalization work item; backlog-run drives it across sessions (one Lean sub-goal per session) while this skill is the per-task engine.mcp__Wolfram__WolframLanguageEvaluator) — the persistent kernel, not a new wolframscript process.run_tests.wls), not Lean.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
computational-research@WolframInstitute is listed by wolframinstitute/claudepluginmarketplace — review the source before installing
npx claudepluginhub wolframinstitute/claudepluginmarketplace --plugin computational-research30 skills in this plugin
/backlog-addCreate and manage work items in the top-level Work/ folder — each a multi-session effort with a Spec (what to build), a Tasks checklist (one task ≈ one session), and a Progress log. This is the project's execution state, separate from the Wiki knowledge base. Use for: "new work item", "start a work item", "spec out X", "plan for X", "break X into tasks", "track this across sessions", "add a task", "update the spec", or the /backlog-add command. Creates Work/Backlog/<Name>.md, bootstrapping the folder if missing. A work item's status is its folder (Backlog/Ready/Active/UnderReview/Done/Dropped), not a field. Specs follow the document-revise protocol; shaping one together with the user over a long sitting is the backlog-refine skill. Do NOT trigger on casual uses of the word "work".
/backlog-autolabWork the Work/ backlog autonomously from an ordinary chat, where the operator can watch it: this chat becomes the orchestrator and dispatches one background subagent per task, each a cold backlog-run run in the item's own git worktree on work/<Item>, visible live in the Agent map and steerable by message. Settles permissions in one preflight before the operator leaves, queues several eligible items, verifies every task the way backlog-run-scheduled does, halts only the item that fails, and ends with a digest per item. Use when the user says "autolab", "run the backlog", "let the agents work the backlog", "work these items autonomously here", "work the queue while I'm away", or runs /backlog-autolab.
/backlog-boardPublish and sync the work board — a private claude.ai page, readable on a phone, that shows every Work/ item under a root (one repo or a folder of repos): what needs the user, what is under review, active, ready and in the backlog, each item rendered and clickable. On the page the user edits the human sections, approves moves (Backlog → Ready, Accept, Send back), leaves notes, files new items and asks Claude about an item; those changes wait on the page until a session syncs them into the files. Use for: "sync the board", "refresh the board", "publish the board", "set up a board", or the /backlog-board command. Never on a timer — a sync is always the user's request.
/backlog-infoGo through the whole Work/ backlog with the user: read every item in Backlog/, Ready/ and UnderReview/ and every work/<Item> branch, and report what waits on the user (a review, a halted run's question, a Waiting-on line, queued board changes), what is stale (no Progress for a month, or a premise the code no longer has), which items overlap, and what to refine, merge, split or drop next. Changes nothing until the user says so; then each move is a git mv and an index update. Never moves an item to Ready and never syncs the board. Use for: "go through the backlog", "backlog info", "what's in the backlog", "what waits on me", "clean up the backlog", "what next", or the /backlog-info command. Not for shaping one item (backlog-refine) or reviewing a finished one (backlog-review).
/backlog-refineShape a Work/Backlog item together with the user over a long sitting until it is ready to be worked — the user writes the human parts (Summary, Motivation, Acceptance criteria, any detail they care about) in their editor, while the LLM researches the code and wiki, writes the Technical details, keeps a list of open questions, and proposes the tasks and their routing. Ends with a readiness check and, on the user's word, the move to Work/Ready/ where /backlog-run-scheduled may pick it up. Use for: "refine X", "let's work on the backlog", "shape this item", "backlog refinement", "get X ready", or the /backlog-refine command. Not for executing tasks (backlog-run) or filing a quick new item (backlog-add).
/backlog-reviewReview a finished Work/ item with the user: find it in Work/UnderReview/ or on its unmerged work/<Item> branch, show the run digest, walk the Acceptance criteria one by one with the test instructions of the tasks that serve each, run the checks that can be run, and end on the user's verdict — accept (merge the branch, item to Done/) or send back (merge the branch, a new task from the user's words, item to Active/). Nothing is fixed during the review. Use for: "review X", "review the item", "check the finished item", "accept X", "send X back", "merge the item branch", or the /backlog-review command. Not for running tasks (backlog-run) or going through the whole backlog (backlog-info).
Other plugins' skills for the same job