rocq-beam
Use this when an AI needs the optional Rocq goal-probe surface exposed through the installed `lean-beam` wrapper while porting Rocq developments to Lean.
leanprover · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add leanprover/lean-beam --skill rocq-beam技能说明
name: rocq-beam
description: Use this when an AI needs the optional Rocq goal-probe surface exposed through the installed lean-beam wrapper while porting Rocq developments to Lean.
Rocq Beam
Use this skill when a Rocq project needs the narrow Rocq-facing surface that lean-beam already exposes, especially while porting Rocq developments to Lean. This is an optional auxiliary mode of the lean-beam toolchain, not a separate product or a second full workflow stack.
The goal is cheap Rocq proof-state inspection through coq-lsp, without turning Rocq support into a broad standalone interface.
Do not use coqtop or any fallback executor. Only coq-lsp is trusted.
This is the Rocq-only skill. It should stay focused on Rocq and should not require Lean-specific
workflow guidance. Do not factor shared Lean/Rocq skill instructions into a common helper;
duplicate short guidance if both skills need it.
Setup
From the lean-beam repo root:
./scripts/install-beam.sh --codex --rocq-skill
Use --claude --rocq-skill, --pi --rocq-skill, --opencode --rocq-skill, or
--vibe --rocq-skill instead when installing for Claude Code, Pi Agent, OpenCode, or Mistral Vibe.
Use --all-skills --rocq-skill when you want every supported agent skill target.
The installer puts lean-beam in ~/.local/bin, stages the self-contained runtime under
BEAM_INSTALL_ROOT (default ~/.local/share/beam), and installs the optional Rocq skill only when
--rocq-skill is paired with a selected agent skill target.
Restart active agent sessions after installation.
The user-facing setup and installer reference is docs/SETUP.md. The Rocq status and setup page is docs/ROCQ.md.
Rocq Setup
Rocq-specific setup:
cd /path/to/lean-beam
bash tests/setup-rocq-opam.sh
Skill Surface
This skill documents the current Rocq-facing lean-beam workflow surface. Keep the surface narrow:
the current wrapper is for goal inspection against saved files, not for hidden proof-session
mutation.
Supported command families:
- start and own a Rocq wrapper session:
lean-beam serve rocq - inspect the selected session state:
lean-beam status - inspect goals after an existing sentence:
lean-beam rocq-goals-after - inspect goals before a sentence or after speculative sentence text within that basis:
lean-beam rocq-goals-prev - inspect tracked files and daemon state:
lean-beam open-files,lean-beam stats
What to treat as the current agent workflow surface:
- default command:
lean-beam rocq-goals-after - intermediate-state command:
lean-beam rocq-goals-prevwith extra text when needed - operational introspection:
lean-beam open-files,lean-beam stats
Core workflow contract:
- use
lean-beam, not raw JSON and not raw LSP - before issuing wrapper probes, start one foreground
lean-beam serve rocqprocess and keep it running; interrupt it or runlean-beam --root ROOT stopwhen finished - save the
.vfile before every new probe after a real edit lean-beamonly sees the on-disk file, not unsaved editor buffers- treat
<line> <character>as LSP-style coordinates for the saved file: line0is the first line, character0is the first character position on that line, and on a truly empty line only character0is valid - there is no Rocq
synccommand in the current wrapper - there is no Rocq handle or continuation surface in the current wrapper
- there is no Rocq
run-atcommand in the current wrapper; use the goal probes instead - do not assume hidden mutable proof-session state carries across requests
- do not use
coqtopor a fallback executor; onlycoq-lspis trusted
Use lean-beam, not raw JSON and not raw LSP.
lean-beam for Rocq:
- infers the target project root from the current directory or
--root - keeps one owner per resolved workspace and session-directory selector; the default descriptor is
<root>/.beam/beam-daemon.json- in sandboxed or read-only project trees, set
BEAM_SESSION_ROOTto a writable directory - for an exact stable alternate location, pass the same absolute path with
--session-dir DIRto the owner and every attaching command; Beam does not search alternate session directories
- in sandboxed or read-only project trees, set
- gives daemon startup authority only to
lean-beam serve rocq; ordinary commands attach to its registry generation and never start a daemon implicitly - owns stopping and descriptor handling
- preserves ambiguous crash state until explicit
recover --generation ID; recovery does not signal persisted PIDs - resolves
coq-lspfrom the target project's local_opamwhen available - the explicit owner starts a Rocq-capable Beam daemon with startup args instead of relying on inherited editor state
- wrapper commands talk to the per-project Beam daemon over localhost TCP; they are not direct in-process Rocq calls
- in Codex-style sandboxes, Beam daemon startup may still require elevated permissions even when all paths resolve correctly
- in the same environments, localhost TCP bind/connect for the Beam daemon and client may also require elevated permissions
- if startup fails with
operation not permitted, treat that as a sandbox capability problem first, not as a missing install lean-beam --root ROOT stoprequires an explicit root;lean-beam statusandlean-beam statsmay infer a unique root
Default rules:
- use
lean-beam, not raw JSON and not raw LSP - start with
lean-beam rocq-goals-after - save the file before every new probe after a real edit
- keep coordinates 0-based; do not guess editor-specific 1-based lines or columns
- if you think you want a Rocq
run-at, uselean-beam rocq-goals-prevwith extra text orrocq-goals-afterinstead - use
lean-beam rocq-goals-prevplus text when you need an intermediate state inside a sentence - do not assume any hidden proof-session state carries across requests
Workflow
Start the Rocq wrapper-session owner in
阅读完整来源 ↗