Логотип Lean Beam

Lean Beam

Організація
leanprover
lean-beam

Work on external Lean projects through the installed `lean-beam` wrapper, using speculative checks and zero-build module checkpoints instead of repeated inner-loop builds.

Огляд

Видавецьleanprover
Репозиторійlean-beam
Назва навичкиlean-beam
Зірки
48
Форки
6
Файли в пакеті
9
ЛіцензіяApache-2.0
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Файлів у комплекті: 9

    Скрипти, шаблони й довідкові матеріали, які модель може читати під час роботи. Файли доступні лише для читання й ніколи не виконуються.

  • Відкритий вихідний код

    Опубліковано на GitHub користувачем leanprover. Перегляньте вихідний вміст перед установленням.

Встановлення

Установіть навичку ШІ Lean Beam у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до Плагіни → Навички.
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/leanprover/lean-beam/tree/main/skills/lean-beam
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Нова навичка → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/leanprover/lean-beam.git /tmp/lean-beam
mkdir -p .claude/skills
cp -r /tmp/lean-beam/skills/lean-beam .claude/skills/lean-beam
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Lean Beam в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Lean Beam, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції Markdown, а не код для певного постачальника, тому навичка Lean Beam не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож невикористана навичка нічого не коштує.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

Lean Beam

Beam provides speculative Lean probes in the real module environment and zero-build module checkpoints. This skill is Lean-only.

Use the lean-beam wrapper, not raw JSON or raw LSP. If your client exposes the lean-beam-mcp tools (lean_run_at, lean_sync, ...), the same rules apply; MCP owns its session automatically, so do not start lean-beam serve for MCP calls.

Session

bash
# keep one foreground owner running for the project (separate terminal or background process)
lean-beam serve
# when finished: interrupt it, or
lean-beam --root ROOT stop
  • Document commands attach to a live serve owner and never start one implicitly. doctor, help, and version inspection can run without an owner.
  • In a read-only or sandboxed tree, set BEAM_SESSION_ROOT to a writable directory.
  • After editing a lakefile, manifest, Lean options, plugins, or other Lake configuration, run lean-beam --root ROOT stop and start a new serve; refresh does not restart the server.
  • If startup, toolchain selection, or session state looks wrong, run lean-beam doctor before guessing. See setup and recovery.

The Edit Loop

Beam reads only the on-disk file and never edits .lean sources; you edit files with your own tools.

  1. Edit and save the file.
  2. lean-beam update Foo.lean and take result.version from its JSON.
  3. Probe with that version (run-at, goals, hover, ...).
  4. lean-beam sync Foo.lean when you need diagnostics and readiness (result.readiness.save_ready; MCP: structuredContent.readiness.save_ready).
  5. Optionally lean-beam save MyPkg/Sub/Module.lean to checkpoint a synced workspace module.
bash
version="$(lean-beam update Foo.lean | python3 -c 'import json,sys; print(json.load(sys.stdin)["result"]["version"])')"
lean-beam goals before Foo.lean "$version" 10 2
lean-beam run-at Foo.lean "$version" 10 2 "omega"
printf 'first | omega | simp\n' | lean-beam run-at Foo.lean "$version" 10 2 --stdin
lean-beam sync Foo.lean            # errors stream on stderr; add +all-diagnostics for warnings
lean-beam save MyPkg/Sub/Module.lean
  • Every version-bound command needs the version from the latest update or sync. On contentModified with error.data.reason = "documentVersionMismatch", retry with error.data.accepted_version or run update again; never guess a version.

  • Cancellation is soft: interrupting the client does not prove backend work has stopped. Active preparation may finish before cleanup; cancellation does not undo committed effects. Do not remove temporary files solely because the client exited.

  • Use refresh for fresh diagnostics after an upstream dependency changed; it reads before reopening.

  • save checkpoints only that module. It does not validate importers, and it records the Lean server's environment, which can differ from batch elaboration. Modules with batch-only moreLeanArgs fail with saveUnsupportedSetup; move shared -D settings to leanOptions, or stop Beam, then lake build, when the arguments are intentionally batch-only.

  • If close-save fails with error.data.reason = "savedDocumentChanged", error.data.saved is an already committed checkpoint of the earlier version; run update or sync and save again if needed.

  • close-save reserves the accepted document. On contentModified with reason documentClosing, coordinate with its caller before issuing a new command; do not run an update/sync retry loop. During claimed canonical publication, same-workspace changes wait for settlement.

  • documentAdmissionExpired means closure or backend replacement invalidated this request. After coordination, issue a new request and reacquire handles if the backend was replaced.

  • Other postcommit failures also retain error.data.saved, with prior data under error.data.original_data. An uncertain close does not assert closed = false; cancellation does not undo a committed checkpoint.

Choosing A Command

NeedCommand
Proof state at a tacticgoals before FILE VERSION LINE CHAR (or goals after)
Try Lean text without editingrun-at FILE VERSION LINE CHAR TEXT (or --stdin, --text-file)
Profiling--profile on run-at/run-with probes (including handle variants; see details)
Continue from an exact speculative staterun-at-handle, then run-with / run-with-linear, release
Type and docs at a positionhover, signature-help
Navigation and symbolsdefinition, references, document-symbols FILE VERSION, workspace-symbols QUERY
Sorries, holes, errors, open goals, code actionstodo FILE VERSION [SL SC EL EC]
Fresh diagnostics after a real editsync (or refresh)
Checkpoint one synced modulesave, close-save
Daemon or tracked-file troubleopen-files, doctor, stats
Shell search loops over handleslean-beam-search
Bug report cardfeedback-report (see feedback)

Handles are pre-stable: use them only when exact continuation matters. They are invalidated by edits to the same document, close, worker restart, or daemon restart.

Code actions need a range: Lean runs them on the one command at the range end, so query a point (todo FILE VERSION L C L C --kind code_action). An empty result is not a file-wide verdict.

run-at Rules

run-at means "try this Lean text here", not "edit the file here".

  • Positions are LSP coordinates: line and character are zero-based, characters count UTF-16 code units, and on an empty line only character 0 is valid.
  • To replace a tactic, probe at its first character after indentation (its before-state).
  • Each probe is isolated and starts from the version it names, so independent probes can run in parallel. This isolates elaboration state, not external effects: Lean code may perform IO.
  • Command positions accept one command; for several, use handles or edit the file and sync.
  • Pass the exact text Lean should parse, including indentation and newlines; prefer --stdin for multiline text. Beam does not re-indent.
  • At a tactic position, the text may be a tactic sequence: start each tactic at the same column, or separate them with ;. Do not start it with by; the probe already runs inside the proof.
  • At an unfilled sorry, _, or ?x term, run-at starts from its goal; text is still tactics. At a todo item's run_at_position, it starts from the item's proof_state; without one, edit.
  • run-at returns no file diagnostics; use sync after a real edit for those.
  • Tactic probes reject new local let rec definitions, even valid ones. Save the enclosing declaration and sync instead, or probe one complete declaration at a command position.

Prefer small probes at the real source position. Scratch files reload imports and lose context; use them only for context-free syntax checks.

Output Contract

  • Check the exit status first. Completed broker operations print one JSON object on stdout.
  • A successful transport does not mean a successful Lean probe: inspect result.success for wrapper probes. For MCP probes, require isError to be absent or false and structuredContent.success true.
  • stderr is for humans: progress and streamed diagnostics. Never parse it. Selector, setup, or transport failures may print only to stderr.
  • sync failures carry structured error.data; save failures with document errors put the blocking verdict in error.data.sync.

When To Stop Probing

Before lake build, stop the CLI owner or drop the MCP workspace and wait for cleanup; recreate the session afterward.

  • The probe result should become real source: edit, save, update/sync.
  • Probes stop clarifying the problem: change approach rather than repeating variants.
  • save fails with saveImportsChanged: refresh, then save.
  • On syncBarrierIncomplete, follow error.data.recovery_plan in order; stop on failure. Inspect diagnostics/readiness after refresh succeeds. If blocked or save is unsupported, stop retries and inspect upstream diagnostics/configuration.
  • You edited a dependency and need trustworthy importers: save is not enough; rebuild.
  • contentModified, stale state, or rebuild trouble keeps appearing unexpectedly: inspect open-files and doctor, then stop and report it rather than working around it.

For batch evidence, prefer clean CI lake build. The local fallback requires confirmation of cleanup from the original owner or supervisor before cleaning/building; otherwise stop and coordinate. Do not repeat after every checkpoint.

Beam is a non-adversarial development tool. Checkpoint readiness can include sorry warnings; it is not proof acceptance. For independent confirmation, use the separate trust and proof confirmation workflow, including a trusted challenge and external checkers. Do not add it to every inner-loop operation.

References

Open as needed:

Файли в пакеті

Модель читає ці файли за потреби, поки навичку завантажено. Вони доступні для читання й ніколи не виконуються.

Поширені запитання

Що робить навичка ШІ Lean Beam?

Work on external Lean projects through the installed `lean-beam` wrapper, using speculative checks and zero-build module checkpoints instead of repeated inner-loop builds.

Навіщо використовувати Lean Beam у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Lean Beam — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Lean Beam у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/leanprover/lean-beam/tree/main/skills/lean-beam. TypingMind прочитає файл SKILL.md, додасть супровідні файли та встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Lean Beam?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Lean Beam?

Зі скількома забажаєте. Якщо модель підтримує навички, ви можете використовувати з нею Lean Beam — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama та інші — усе в TypingMind із власними ключами API.

Чи безкоштовна навичка ШІ Lean Beam?

Так. Навичку опубліковано на GitHub: leanprover, за ліцензією Apache-2.0. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це багаторазовий набір інструкцій, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти для виклику — код, який десь виконується й повертає результат. Натомість навичка ШІ надає моделі знання та порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі

Створіть власний ШІ-простір уже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇