lean-build

Automate Lean 4 project builds and validation with Lake workflows.

2|Updated May 26, 2026
One-click install
npx skills add https://github.com/r-irbe/proof-skills --skill lean-build-r-irbe
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lean-build
Source: https://github.com/r-irbe/proof-skills/tree/main/skills/_overrides/lean-build
Command: npx skills add https://github.com/r-irbe/proof-skills --skill lean-build-r-irbe

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Building and validating Lean 4 projects with Lake across modules, with deterministic workflows and CI-ready checks.

Core Features & Use Cases

  • Targeted module builds using lake build <Module> and environment validation with lake env lean.
  • Cache management and artifact cleanup via lake clean and lake exe cache get to maintain CI parity.
  • Reusable workflow for CI preparation and reproducible local validation across Lake-managed projects.

Quick Start

Validate your Lean environment with lake env lean, then perform a targeted build with lake build <Module> to verify changes and CI readiness.

Frequently Asked Questions about lean-build

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate Lake builds for Lean 4 projects in CI?

Automate Lake builds for Lean 4 projects by applying targeted module builds, cache management, and environment validation to create reproducible, CI-ready workflows. It validates changes using lake env lean and lake build commands to ensure CI parity.

What is the best way to validate Lean 4 changes before pushing to CI?

Validating Lean 4 changes before CI involves running lake env lean for environment checks and lake build <Module> for targeted compilation. This provides CI-quality validation locally to catch errors early and maintain reproducibility.

Can I use lake exe cache get to manage build artifacts in Mathlib-style projects?

Yes, you can use lake exe cache get to manage build artifacts in Mathlib-style projects. It fetches cached build outputs to speed up compilation, while lake clean removes artifacts to maintain CI parity and a reproducible environment.

Does this workflow support targeted module builds in Lake-managed repositories?

Yes, this workflow supports targeted module builds in Lake-managed repositories using lake build <Module>. It allows you to compile specific modules rather than the entire project for faster, more efficient local validation.

Why does my Lean 4 CI build fail locally but pass in the pipeline?

A Lean 4 CI build failing locally but passing in the pipeline often indicates stale cache or environment differences. Running lake clean and lake exe cache get ensures local CI parity and reproducible validation.