skill-lean-version
- Repo stars 435
- Author updated Live
- Author repo nvim
- Domain
- Other
- Compatible agents
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- Trust score
- 88 / 100 · community maintained
- Author / version / license
- @benbrastmckie · no license declared
- Token usage
- Lean
- Setup complexity
- Guided setup
- External API key
- Not required
- Operating systems
- Unspecified (assume cross-platform)
- Runtime requirements
- No special requirements
- Permissions
-
- Read-only
- Write / modify
- Shell exec
- Network behavior
- Local-only
- Install commands
- 26 variants
Profile is derived at build time from SKILL.md and install vectors. Subject to drift from author intent.
Heads up: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: skill-lean-version
description: Manage Lean toolchain and Mathlib versions with backup, upgrade, and rollback support Direct exe…
category: other
runtime: no special runtime
---
# skill-lean-version output preview
## PART A: Task fit
- Use case: Manage Lean toolchain and Mathlib versions with backup, upgrade, and rollback support Direct execution skill for managing Lean toolchain and Mathlib versions. Provides check, upgrade, rollback, and dry-run modes. Creates backups before upgrades and supports interactive user confirmation. runs entirely locally. Works with Claude Code, Cursor, Cline and 23 ….
- Inputs: target material, constraints, expected output, and acceptance criteria.
- Evidence boundary: follow “Execution / Step 1: Parse Arguments / Step 2: Read Current State” and do not present inference as author intent.
## PART B: Execution result
- **01** The card summarizes the use case; runtime output centers on “Manage Lean toolchain and Mathlib versions with backup, upgrade, and rollback support Direct execution skill for managing Lean toolchain and Mathlib versions. Provides check, upgrade, rollback, and dry-run modes. Creates backups before upgrades and supports interactive user confirmation. runs entirely locally. Works with Claude Code, Cursor, Cline and 23 …”.
- **02** When the source has headings, the agent prioritizes “Execution / Step 1: Parse Arguments / Step 2: Read Current State” so the result follows the author’s structure.
- **03** Typical output includes task judgment, concrete steps, required commands or file edits, validation, and follow-up options.
- **04** Risk context follows the fingerprint: read files, write/modify files, run shell commands; mostly runs locally; usually needs no extra API key.
## Running Rules
- read files, write/modify files, run shell commands; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding scope.
- Return the result, validation criteria, and next iteration options. The source does not require a stable slash command. After installation, invoke the skill by name and describe the task.
Name target files or source material, expected output, forbidden changes, and whether network or shell access is allowed. Permission fingerprint: read files, write/modify files, run shell commands.
Start with a small task and check whether the result follows “Execution / Step 1: Parse Arguments / Step 2: Read Current State”. Inspect diffs, logs, previews, or tests before expanding scope.
Confirm the final output includes a concrete result, evidence, and next action. If it stays generic, tighten inputs, boundaries, and acceptance criteria.
---
name: skill-lean-version
description: Manage Lean toolchain and Mathlib versions with backup, upgrade, and rollback support Direct exe…
category: other
source: benbrastmckie/nvim
---
# skill-lean-version
## When to use
- Manage Lean toolchain and Mathlib versions with backup, upgrade, and rollback support Direct execution skill for manag…
- Use it when the task has clear inputs, repeatable steps, and validation criteria.
## What to provide
- Target material, scope, expected result, and forbidden changes.
- Whether network, commands, file writes, or external services are allowed.
## Execution rules
- Organize steps around “Execution / Step 1: Parse Arguments / Step 2: Read Current State” and keep inference separate from source facts.
- read files, write/modify files, run shell commands; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding the task.
## Output requirements
- Return the deliverable, key evidence, validation method, and next action.
- Mark missing information as unknown; do not invent commands, platforms, or dependencies. The author source anchors workflow facts; repository files anchor sources and commands; Fluxly only adds fit, limitations, and quality judgment.
skill "skill-lean-version" {
input -> user goal + target files + boundaries + acceptance criteria
context -> Execution / Step 1: Parse Arguments / Step 2: Read Current State
rules -> SKILL.md triggers / order / output contract
runtime -> no special runtime | read files, write/modify files, run shell commands | mostly runs locally
guardrails -> usually needs no extra API key + small-sample validation + diff/log review
output -> copyable result + checklist + next iteration
} Lean Version Management Skill (Direct Execution)
Direct execution skill for managing Lean toolchain and Mathlib versions. Provides check, upgrade, rollback, and dry-run modes. Creates backups before upgrades and supports interactive user confirmation.
This skill executes inline without spawning a subagent.
Execution
Step 1: Parse Arguments
Extract mode and flags:
- First non-flag argument: Mode (
check,upgrade,rollback) - default:check --dry-run: Preview mode--version VERSION: Target version for upgrade
mode="check"
dry_run=false
target_version=""
for arg in "$@"; do
case "$arg" in
check|upgrade|rollback) mode="$arg" ;;
--dry-run) dry_run=true ;;
--version=*) target_version="${arg#*=}" ;;
esac
done
Step 2: Read Current State
# Read current toolchain
if [ -f "lean-toolchain" ]; then
current_toolchain=$(cat lean-toolchain | tr -d '\n')
else
current_toolchain="not found"
fi
# Read current Mathlib version from lakefile.lean
if [ -f "lakefile.lean" ]; then
current_mathlib=$(grep -oP 'mathlib.*@\s*"\K[^"]+' lakefile.lean 2>/dev/null || echo "not found")
else
current_mathlib="not found"
fi
Step 3: Route by Mode
- check -> Display current version status
- upgrade -> Perform interactive upgrade with backup
- rollback -> Restore from a previous backup
Check Mode
Display current version status:
Lean Version Status
===================
Current Configuration:
- Toolchain: {current_toolchain}
- Mathlib: {current_mathlib}
Installed Toolchains:
{elan_status}
Backups Available:
{backup_list}
Upgrade Mode
Create Backup
mkdir -p .lean-version-backup
timestamp=$(date +%Y%m%d_%H%M%S)
cp lean-toolchain ".lean-version-backup/lean-toolchain.$timestamp"
cp lakefile.lean ".lean-version-backup/lakefile.lean.$timestamp"
Apply Changes
echo "$new_toolchain" > lean-toolchain
sed -i "s|@ \"v[0-9.]*\(-rc[0-9]*\)\?\"|@ \"$new_mathlib\"|g" lakefile.lean
Post-Upgrade
lake update
lake exe cache get
Rollback Mode
List Backups
timestamps=$(ls .lean-version-backup/lean-toolchain.* 2>/dev/null | \
sed 's|.*/lean-toolchain\.||' | sort -r | head -5)
Restore
cp ".lean-version-backup/lean-toolchain.$selected_timestamp" lean-toolchain
cp ".lean-version-backup/lakefile.lean.$selected_timestamp" lakefile.lean
lake update
lake exe cache get
Safety Measures
Backup Before Changes
- Always create timestamped backup before upgrade
- Backup includes:
lean-toolchain,lakefile.lean,lake-manifest.json - Location:
.lean-version-backup/ - Retention: Keep 3 most recent
Dry-Run Support
--dry-runpreviews all changes without applying
User Confirmation
- Upgrade mode requires explicit confirmation via AskUserQuestion
Decide Fit First
Design Intent
How To Use It
Boundaries And Review