Every workflow command you type in theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/math-inc/OpenGauss/llms.txt
Use this file to discover all available pages before exploring further.
gauss REPL becomes a managed backend child session — a short-lived, project-scoped agent that runs a lean4-skills workflow command inside your active Lean 4 project and then returns control to you. This page explains the full lifecycle: from the moment you type /prove to when the swarm manager records the running agent and you can reattach to it.
The Core Loop
OpenGauss follows a five-step cycle for every workflow invocation:You type a slash command in the gauss REPL
For example:
/prove Nat.add_comm or /autoformalize my theorem statement. The REPL accepts both slash-prefixed commands and forgiving bare-word aliases such as prove ... (see the Forgiving Aliases section below).Gauss resolves the active project
Before spawning anything, Gauss discovers the active Gauss project by walking upward from
cwd for a .gauss/project.yaml manifest, or by using any session-level override set with /project use. If no project is found, the command fails immediately with a clear error.Gauss stages managed assets and builds a launch plan
The command is resolved against the workflow alias map, the configured backend (
claude-code or codex) is identified, auth is staged, the lean4-skills plugin and Lean LSP MCP server are checked out and wired up, and a HandoffRequest is assembled with the full argv, working directory, and environment.A managed backend child session is spawned
Gauss launches a
claude or codex CLI subprocess rooted at the active project. The subprocess receives a startup context document that includes the project root, lean root, the resolved backend command (e.g. /lean4:prove Nat.add_comm), and session contract instructions. Gauss hands off to this child session and tracks it in the swarm.The lean4-skills workflow runs inside the child session
The child agent reads its startup context, loads the
lean4 plugin, and executes the corresponding lean4-skills workflow command — using the Lean LSP MCP server for real-time type-checking feedback as it works. When it finishes (or you detach), the session is recorded in the swarm.Command Mapping
Each Gauss slash command is a thin alias over the correspondinglean4-skills workflow command. The mapping is fixed:
| Gauss command | lean4-skills command | Purpose |
|---|---|---|
/prove | /lean4:prove | Guided interactive proving agent |
/draft | /lean4:draft | Draft Lean declaration skeletons |
/review | /lean4:review | Read-only Lean code review agent |
/checkpoint | /lean4:checkpoint | Snapshot and checkpoint workflow |
/refactor | /lean4:refactor | Lean code refactor agent |
/golf | /lean4:golf | Proof golfing (minimize proof terms) |
/autoprove | /lean4:autoprove | Autonomous proving agent |
/formalize | /lean4:formalize | Interactive formalization from informal maths |
/autoformalize | /lean4:autoformalize | Autonomous formalization agent |
lean4-skills plugin is sourced from the cameronfreer/lean4-skills GitHub repository and is checked out into a managed asset directory under your Gauss home on first use.
Forgiving Command Aliases
Gauss accepts bare-word variants without a leading slash, automatically rewriting them into the canonical managed workflow command before dispatch:| What you type | Rewritten to |
|---|---|
prove ... | /prove ... |
draft ... | /draft ... |
review ... | /review ... |
checkpoint ... | /checkpoint ... |
refactor ... | /refactor ... |
golf ... | /golf ... |
autoprove ... | /autoprove ... |
auto-proof ... | /autoprove ... |
formalize ... | /formalize ... |
autoformalize ... | /autoformalize ... |
auto-formalize ... | /autoformalize ... |
Swarm Manager
Every managed workflow session is registered with the swarm manager so you can track long-running agents, reattach to suspended sessions, or cancel work that is no longer needed./swarm is the same ID embedded in each session’s startup context and log files, making it straightforward to correlate a running child process with the workflow that spawned it.
Managed Workflow Prerequisites
Gauss performs a preflight check before every workflow spawn. The following must all be satisfied:Backend CLI
The
claude CLI (for claude-code) or the codex CLI must be installed and authenticated. Gauss checks for the executable on PATH before trying to spawn anything.uv / uvx
Either
uvx or uv must be available so Gauss can run the managed Lean LSP MCP server (lean-lsp-mcp) without a global install.ripgrep
The
rg binary is required for local Lean symbol search inside workflow sessions. Install it via your system package manager.Active Gauss project
A
.gauss/project.yaml manifest must be reachable from the current working directory, or a session-level override must be set with /project use.AutoformalizePreflightError that names the missing component and tells you how to fix it.
gauss doctor
Runninggauss doctor at any time reports the full preflight state without actually launching a session:
uv/lake availability, and whether the current working directory resolves to an active Gauss project.
The AIAgent Loop
Inside each managed backend session, the underlying agent follows a synchronous while-loop that drives the conversation until either the workflow completes or the iteration budget is exhausted:system / user / assistant / tool roles). The agent reads its startup context on the first turn, invokes the lean4 plugin to load workflow guidance, and then uses the lean-lsp MCP server for incremental type-checking feedback on every Lean edit it makes.