AGENT SKILL

lean-workflow

Route Lean 4 work through a repository's Mathlib/Lake conventions. Use when editing Lean files, checking source fidelity or axioms, searching dependencies, validating focused targets, or protecting dependency build artifacts.

License 许可
CC-BY-4.0
最近更新
2026-11-14
Stars
★ 12
Forks
5

01 前言 Front Matter

name
lean-workflow
description
Route Lean 4 work through a repository's Mathlib/Lake conventions. Use when editing Lean files, checking source fidelity or axioms, searching dependencies, validating focused targets, or protecting dependency build artifacts.

02 资源文件 7

03 SKILL.md 正文

Lean workflow

Use this as the general router for a Lean 4 repository built with Lake and Mathlib. Read the repository's own instructions first; they override generic commands and thresholds here. Select a more focused sibling skill when it applies:

  • lean-project-architecture for public declarations, abstractions, module boundaries, or imports;
  • lean-search-discovery before attempting a new proof;
  • lean-proof-patterns while translating or repairing a proof;
  • lean-naming-style for declarations, files, namespaces, and docstrings;
  • lean-elaboration for measured performance diagnosis or repair;
  • lean-elaboration-test for a repository-wide performance snapshot;
  • lean-statement-audit for exact source-to-declaration correspondence;
  • lean-orchestrator for an explicitly authorized multi-agent formalization effort.

Use build-proof-dependency-graph for a source-level proof dependency database. It records source topology; it does not determine Lean proof status.

Build and dependency hygiene

  • Treat pinned dependencies and their compiled artifacts as read-only during routine project work.
  • Never delete dependency .olean, .ilean, trace, hash, IR, or object files as an invalidation shortcut.
  • Follow repository-provided build wrappers and cache guards. Otherwise validate the narrowest project target that covers the edit, for example lake build Project.Foo.Bar.
  • Do not run lake clean, update the toolchain or dependency pins, or trigger a full dependency rebuild without explicit authorization.
  • Before a destructive project-artifact invalidation, resolve the exact project-owned path and confirm that no dependency tree can match it.
  • Distinguish project compilation from dependency compilation in build and performance reports.

Workflow

  1. Read AGENTS.md or CLAUDE.md, the Lake configuration, toolchain file, target module, and nearby imports.
  2. Identify the authoritative mathematical source when a declaration represents an external claim. Preserve its binders, carriers, quantifiers, hypotheses, constants, and endpoint conditions.
  3. Search Mathlib and the project before adding a declaration or inventing a proof route.
  4. Do not move proof obligations into hypotheses, introduce custom axioms, or disguise unfinished proofs. Keep any explicitly authorized draft theorem quarantined and visibly marked under the repository's draft policy.
  5. Make the smallest coherent edit and validate it with the repository's guarded command or the narrowest appropriate Lake/Lean command.
  6. Audit affected public declarations for sorry, custom axioms, hidden stronger hypotheses, quantifier drift, and constant-dependence drift. Run #print axioms from an untracked probe or other repository-approved audit path, not from a compiled source file.
  7. Report exact commands and targets, skipped validation, remaining placeholders, and source mismatches.

If work is delegated, obey the repository's agent policy and give each worker a bounded, disjoint task. Do not infer a model requirement, concurrency policy, or permission to spawn agents from this skill.

04 同仓库更多 Skills

stanfish06
stanfish06/skillquarium

zarr-python

Stores and queries chunked N-D scientific arrays with Zarr-Python 3, including codecs, sharding, S3/GCS storage, and NumPy/Dask/Xarray integration. Use for array layout, bounded I/O, format migration, or scientific metadata preservation.

★ 12
stanfish06
stanfish06/skillquarium

yeet

Publish local changes to GitHub by confirming scope, committing intentionally, pushing the branch, and opening a draft PR through the GitHub app from this plugin, with `gh` used only as a fallback where connector coverage is insufficient.

★ 12
stanfish06
stanfish06/skillquarium

xarray

N-dimensional labeled arrays and datasets in Python. Built on top of NumPy and Dask. It introduces labels in the form of dimensions, coordinates, and attributes on top of raw NumPy-like arrays, making data analysis in physical sciences more intuitive and less error-prone. Use for working with multi-dimensional scientific data, NetCDF/GRIB/Zarr files, climate/weather/oceanographic datasets, remote sensing, geospatial imaging, large out-of-memory datasets with Dask, and labeled array operations.

★ 12
stanfish06
stanfish06/skillquarium

writing-mstest-tests

Use when asked to fix, rewrite, update, improve, modernize, show corrected code for, or explain existing MSTest tests or MSTest-specific configuration. Use for "review" when corrected code or edits are wanted, even for one pasted assertion or passing tests with bad failure output. Covers expected/actual labels; generic Boolean, collection, string, numeric, null, identity, exception, hard-cast, and object[] checks; TestContext/lifecycle; timeout/cancellation; OS/CI conditions, retry, cleanup, parallelization, MSTest.Sdk project setup, and MSTESTxxxx. Honor the installed MSTest version. DO NOT USE to design new test cases (code-testing), perform report-only audits, create project files rather than explain MSTest setup, run tests, migrate frameworks, or handle non-MSTest/non-.NET code.

★ 12
stanfish06
stanfish06/skillquarium

wgs-prs

End-to-end WGS to polygenic risk score pipeline. Takes paired-end FASTQ files (or a pre-existing VCF) through nf-core/sarek for variant calling, applies VCF QC (normalisation, hard filtering, Ti/Tv and Het/Hom checks), then computes polygenic risk scores via the PGS Catalog. Fills the FASTQ to VCF gap upstream of the gwas-prs skill.

★ 12
stanfish06
stanfish06/skillquarium

webapp-testing

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

★ 12