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.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
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.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
| 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. |
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.
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-specific setup:
cd /path/to/lean-beam
bash tests/setup-rocq-opam.sh
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:
lean-beam ensure rocqlean-beam rocq-goals-afterlean-beam rocq-goals-prevlean-beam open-files, lean-beam stats, lean-beam reset-statsWhat to treat as the current agent workflow surface:
lean-beam rocq-goals-afterlean-beam rocq-goals-prev with extra text when neededlean-beam open-files, lean-beam stats, lean-beam reset-statsCore workflow contract:
lean-beam, not raw JSON and not raw LSP.v file before every new probe after a real editlean-beam only sees the on-disk file, not unsaved editor buffers<line> <character> as LSP-style coordinates for the saved file: line 0 is the first
line, character 0 is the first character position on that line, and on a truly empty line only
character 0 is validsync command in the current wrapperrun-at command in the current wrapper; use the goal probes insteadcoqtop or a fallback executor; only coq-lsp is trustedUse lean-beam, not raw JSON and not raw LSP.
lean-beam for Rocq:
--root<root>/.beam/beam-daemon.json
BEAM_CONTROL_DIR to a writable directorycoq-lsp from the target project's local _opam when availableoperation not permitted, treat that as a sandbox capability problem first, not as a missing installlean-beam shutdown, lean-beam stats, and lean-beam reset-stats apply to the current project onlyDefault rules:
lean-beam, not raw JSON and not raw LSPlean-beam rocq-goals-afterrun-at, use lean-beam rocq-goals-prev with extra text or rocq-goals-after insteadlean-beam rocq-goals-prev plus text when you need an intermediate state inside a sentenceEnsure the Rocq backend:
lean-beam ensure rocq
lean-beam stats
Inspect goals after a sentence:
lean-beam rocq-goals-after "Demo.v" 2 8
Inspect goals before a sentence:
lean-beam rocq-goals-prev "Demo.v" 2 8
For a tactic sentence like a; b, inspect the intermediate state after a with:
lean-beam rocq-goals-prev "Demo.v" 2 8 "a."
Source-file model:
lean-beam rocq-goals-* does not edit Demo.vlean-beam only sees the on-disk Rocq file, not unsaved editor bufferssync command in the current wrapper; saving the file is the important step before the next probeExecution model:
lean-beam rocq-goals-* request is an isolated read-only probe against the current saved filelean-beam sync equivalent in the wrapper, so after edits the important step is: save, then probe againcoq-lsp state becomes stale, expect to rerun from the saved file instead of relying on recovery inside the old requestDefault loop:
lean-beam ensure rocq
lean-beam rocq-goals-after "Demo.v" 12 4
# make a real edit, save the file
lean-beam rocq-goals-after "Demo.v" 12 4
Use cases:
lean-beam ensure rocq
lean-beam rocq-goals-after "Demo.v" 12 4
lean-beam ensure rocq
lean-beam rocq-goals-prev "Demo.v" 12 4 "intro x."
lean-beam rocq-goals-prev "Demo.v" 12 4 "split."
Save the file first, then probe again from the saved document.
lean-beam ensure rocq
lean-beam rocq-goals-after "Demo.v" 12 4
# make a real edit in Demo.v and save it
lean-beam rocq-goals-after "Demo.v" 12 4
lean-beam rocq-goals-afterlean-beam rocq-goals-prev plus text for intermediate-state probingppFormat as Strlean-beam as a source editor; actual .v edits happen through the normal file-edit workflowcoq-lsp reports stale or broken state unexpectedly, stop and report it loudlyUse:
lean-beam open-files
lean-beam stats
lean-beam reset-stats
lean-beam open-files shows the files currently tracked by the Beam daemon for the current project. For
tracked files the broker already knows about, the wrapper checks status incrementally against the
current on-disk text, and open-files also reports the last compact fileProgress observed for
that tracked version.
Stats are in-memory only and scoped to the current project Beam daemon.
Useful petanque/* methods we may expose later:
petanque/get_state_at_pospetanque/run_at_pospetanque/goalspetanque/premisespetanque/ast_at_pospetanque/list_notations_in_statementpetanque/proof_info_at_pos