Skip to content

Commit c6b2bd2

Browse files
committed
doc: simplify the main lean-beam skill surface
1 parent 0b6e15a commit c6b2bd2

2 files changed

Lines changed: 17 additions & 21 deletions

File tree

‎README.md‎

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ lean-beam ensure
8080
lean-beam hover "Foo.lean" 10 2
8181
lean-beam goals-prev "Foo.lean" 10 2
8282
lean-beam run-at "Foo.lean" 10 2 "exact trivial"
83-
printf 'example : True := by\n trivial\n' | lean-beam run-at "Foo.lean" 10 2 --stdin
8483
lean-beam sync "MyPkg/Sub/Module.lean"
8584
lean-beam refresh "MyPkg/Sub/Module.lean"
8685
lean-beam save "MyPkg/Sub/Module.lean"
@@ -96,25 +95,19 @@ Read those commands like this:
9695
Multiline and handle-oriented wrapper ergonomics:
9796

9897
```bash
99-
# avoid shell-escape mistakes for multiline probe text
98+
# for multiline probe text, prefer stdin
10099
printf 'example : True := by\n trivial\n' | lean-beam run-at "Foo.lean" 10 2 --stdin
101-
lean-beam run-at "Foo.lean" 10 2 --text-file probe.lean
102100

103-
# continuation from an explicit stored handle
101+
# for exact continuation, prefer a handle file
104102
lean-beam run-at-handle "Foo.lean" 10 2 "constructor"
105103
lean-beam run-with "Foo.lean" --handle-file handle.json "exact trivial"
106-
107-
# when quoting is suspect, inspect exactly what the wrapper is sending
108-
BEAM_DEBUG_TEXT=1 lean-beam run-at "Foo.lean" 10 2 "exact trivial"
109104
```
110105

111106
Read those flags like this:
112107

113-
- `--stdin` and `--text-file <path>` avoid shell quoting fragility for text-carrying Lean probes
114-
- `--` forces the remaining arguments to be treated as text, even if they start with `--`
115-
- `--handle-file <path>` avoids inlining handle JSON for `lean-beam run-with`, `lean-beam run-with-linear`, and `lean-beam release`
116-
- `BEAM_DEBUG_TEXT=1` prints escaped probe text and UTF-8 bytes to wrapper stderr for human debugging
117-
- if `lean-beam run-with` or `lean-beam run-with-linear` takes the handle as `-`, stdin is already used for the handle JSON, so prefer `--handle-file <path>` or `--text-file <path>` for the continuation text
108+
- `--stdin` is the normal multiline path for speculative Lean text
109+
- `--handle-file <path>` is the normal handle path for exact continuation and release
110+
- deeper shell-oriented variants and debugging knobs live in [skills/lean-beam/SKILL.md](skills/lean-beam/SKILL.md) and the linked reference docs
118111

119112
When `lean-beam sync` fails with `syncBarrierIncomplete`, the JSON error may include
120113
`error.data.staleDirectDeps`, `error.data.saveDeps`, and `error.data.recoveryPlan` to suggest a

‎skills/lean-beam/SKILL.md‎

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,10 @@ Prefer the smallest command that matches the actual task:
8585
truly empty line only character `0` is valid
8686
- use `lean-beam run-at-handle` and then `lean-beam run-with` or `lean-beam run-with-linear` only when exact
8787
speculative continuation matters
88-
- for multiline text-carrying Lean probes (`lean-beam run-at`, `lean-beam run-at-handle`,
89-
`lean-beam run-with`, `lean-beam run-with-linear`), prefer `--stdin` or `--text-file <path>`;
90-
use `--` before text that itself starts with `--`
91-
- when `lean-beam run-with` or `lean-beam run-with-linear` takes the handle as `-`, stdin is already
92-
consumed by the handle json, so prefer `--handle-file <path>` or use `--text-file` for the
93-
continuation text
88+
- for multiline speculative text, prefer `--stdin` as the normal path; use `--text-file <path>`
89+
when the text already lives in a file
90+
- for handle-based continuation, prefer `--handle-file <path>` as the normal path; deeper shell-loop
91+
variants such as stdin handle piping live in the reference docs
9492
- do not expect one `lean-beam run-at` call to become the basis of the next one automatically
9593
- use `lean-beam sync` right after every real saved edit before the next speculative probe
9694
- use `lean-beam save` or `lean-beam close-save` only for a synced workspace module path such as
@@ -136,8 +134,6 @@ Use the right tool for each goal:
136134
- for handle-based commands, `--handle-file <path>` is the easiest way to avoid inlining handle json
137135
- if surface syntax depends on indentation or layout: pass the exact text you want Lean to parse, or
138136
make a real edit in the file instead of expecting the wrapper to fill whitespace for you
139-
- if shell quoting is suspect, set `BEAM_DEBUG_TEXT=1` to print the exact escaped text and UTF-8
140-
bytes the wrapper is sending for text-carrying Lean probes
141137

142138
Open [references/lean-run-at-semantics.md](references/lean-run-at-semantics.md) when the task needs
143139
concrete examples for:
@@ -146,6 +142,13 @@ concrete examples for:
146142
- chaining speculative state across multiple calls
147143
- indentation-sensitive or newline-sensitive probes on blank or layout-sensitive lines
148144

145+
Open [references/workflow-details.md](references/workflow-details.md) when the task needs the shell-oriented
146+
details for:
147+
148+
- `--text-file`, `--`, or stdin-handle piping variants
149+
- handle-file versus stdin-handle tradeoffs
150+
- debugging-oriented wrapper details instead of the normal path
151+
149152
Open [references/commit-speculative.md](references/commit-speculative.md) when the task needs the
150153
current workflow for turning a good speculative probe into a real saved edit.
151154

@@ -209,6 +212,7 @@ lean-beam goals-prev "Foo.lean" 10 2
209212

210213
# try speculative Lean text without editing the file
211214
lean-beam run-at "Foo.lean" 10 2 "exact trivial"
215+
# for multiline probes, prefer stdin
212216
printf 'example : True := by\n trivial\n' | lean-beam run-at "Foo.lean" 10 2 --stdin
213217

214218
# after every real edit saved to disk, on that same workspace module path
@@ -249,7 +253,6 @@ Surface rule:
249253
- wrapper `stderr` is the human-facing diagnostic surface
250254
- wrapper `stderr` may distinguish request-level failures from a completed request whose payload
251255
failed inside Lean; use stdout JSON for machine decisions
252-
- `BEAM_DEBUG_TEXT=1` adds escaped text and UTF-8 byte dumps for text-carrying Lean probes on stderr
253256
- `beam-client request-stream ...` is the machine-facing streamed surface
254257
- do not parse wrapper `stderr` in tooling
255258

0 commit comments

Comments
 (0)