Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
alphaonedev avatar

Cs Formal

  • 58 installs
  • 6 repo stars
  • Updated March 13, 2026
  • alphaonedev/openclaw-graph

cs-formal is a Claude skill for formal verification: Hoare triples, TLA+ model checking, and Coq/Lean theorem proving to prove program correctness.

About

This skill applies formal methods in computer science: type theory (HoTT, System F), logic, Hoare triples, TLA+ model checking, and verification in Coq or Lean. A developer uses it to prove program correctness, detect concurrency bugs in distributed systems, or check code invariants in safety-critical code. It exposes verify, check-hoare, and model commands over CLI and API.

  • Hoare triple verification for pre/post conditions
  • TLA+ model checking for concurrent systems
  • Coq/Lean theorem proving and type theory

Cs Formal by the numbers

  • 58 all-time installs (skills.sh)
  • Ranked #1,174 of 2,153 Testing & QA skills by installs in the Skillselion catalog
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

cs-formal capabilities & compatibility

Capabilities
formal verification · model checking · theorem proving
Use cases
testing · code review
IDEs
vscode
From the docs

What cs-formal says it does

This skill provides tools for applying formal methods in computer science, including type theory (HoTT and System F), logic systems, Hoare triples, TLA+ for model checking, and verification in Coq or
SKILL.md
Apply this skill when verifying software properties, such as concurrency bugs in distributed systems (e.g., with TLA+)
SKILL.md
npx skills add https://github.com/alphaonedev/openclaw-graph --skill cs-formal

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs58
repo stars6
Last updatedMarch 13, 2026
Repositoryalphaonedev/openclaw-graph

What it does

Apply formal methods: verify Hoare triples, model-check with TLA+, and prove theorems in Coq or Lean.

Who is it for?

Proving correctness of safety-critical code and detecting concurrency bugs.

Skip if: Routine unit testing where full formal proof is unnecessary.

When should I use this skill?

You need to formally verify invariants, specifications, or concurrency properties.

What you get

Verified Hoare triples, TLA+ model-check results, and Coq/Lean proofs.

By the numbers

  • Supports 3 verification tools: TLA+, Coq, and Lean

Files

SKILL.mdMarkdownGitHub ↗

cs-formal

Purpose

This skill provides tools for applying formal methods in computer science, including type theory (HoTT and System F), logic systems, Hoare triples, TLA+ for model checking, and verification in Coq or Lean. Use it to prove program correctness and verify specifications.

When to Use

Apply this skill when verifying software properties, such as concurrency bugs in distributed systems (e.g., with TLA+), proving theorems in dependent types (e.g., HoTT), or checking code invariants via Hoare triples. Use it for safety-critical code, academic proofs, or integrating formal verification into development workflows.

Key Capabilities

  • Parse and verify Hoare triples: e.g., {P} C {Q} for pre/post conditions.
  • Generate TLA+ specifications for model checking concurrent systems.
  • Interact with Coq/Lean for theorem proving, including inductive types and tactics.
  • Evaluate type theory constructs, like System F polymorphic functions.
  • Export proofs or models as JSON for integration, using OpenClaw's API.

Usage Patterns

Invoke this skill via OpenClaw's CLI for interactive sessions or API for scripted workflows. For CLI, prefix commands with openclaw cs-formal. Use API endpoints like /api/cs-formal/verify with JSON payloads. Always specify the tool (e.g., --tool coq) and input file. For pipelines, chain with other skills by piping output, e.g., verify a TLA+ model then analyze results.

Common Commands/API

Use OpenClaw's CLI for direct execution:

  • openclaw cs-formal verify --tool coq --file proof.v --tactic induction: Runs a Coq proof on proof.v using the induction tactic.
  • openclaw cs-formal check-hoare --pre "{x > 0}" --code "x = x + 1" --post "{x > 1}": Verifies a Hoare triple.
  • openclaw cs-formal model --tool tla --spec "Init == ... Next == ...": Generates and checks a TLA+ model.

For API calls, use POST requests to https://api.openclaw.ai/cs-formal/verify with a JSON body like:

{"tool": "lean", "file": "theorem.lean", "options": {"tactic": "simp"}}

Set authentication via environment variable: $OPENCLAW_API_KEY in headers, e.g., Authorization: Bearer $OPENCLAW_API_KEY. Config files should be in YAML format, e.g.:

tool: coq
file: proof.v
tactics:
  - intro
  - apply

Integration Notes

Integrate with IDEs like VS Code by adding OpenClaw as a plugin, configuring it in your .openclawrc file with: cs-formal: { apiKey: $OPENCLAW_API_KEY, defaultTool: "tla" }. For CI/CD, use scripts like export OPENCLAW_API_KEY=your_key; openclaw cs-formal verify --tool lean --file path/to/file. Combine with other skills, e.g., pipe output to a "debugging" skill for error analysis. Ensure dependencies like Coq or TLA+ are installed via apt install coq or similar.

Error Handling

Check for common errors like syntax issues in TLA+ specs (e.g., missing operators) by running openclaw cs-formal lint --tool tla --file spec.tla, which returns JSON with error codes (e.g., "TLA001: Undefined constant"). For proof failures in Coq, parse the output for "stuck" states and retry with adjusted tactics, e.g., if a tactic fails, use openclaw cs-formal retry --tactic alternative. Handle API errors by checking HTTP status codes (e.g., 401 for auth issues) and fallback to local mode if network fails. Always validate inputs, like ensuring Hoare triple conditions are well-formed strings.

Concrete Usage Examples

1. Verify a simple Hoare triple for a loop: Use openclaw cs-formal check-hoare --pre "{n >= 0}" --code "WHILE n > 0 INVARIANT n >= 0 DO n := n - 1 END" --post "{n = 0}" to confirm the invariant holds, then export results for further analysis. 2. Model check a concurrent system with TLA+: Run openclaw cs-formal model --tool tla --spec "CONSTANT N \\n VARIABLE x \\n Init == x = 0 \\n Next == x' = x + 1" to detect deadlocks, and integrate the output into a testing pipeline.

Graph Relationships

  • Related to: "algorithms" (for logical proofs in algorithm design), "software-engineering" (for verification in code reviews), "data-structures" (for type theory applications in data modeling).
  • Clusters: Connected via "computer-science" cluster for shared CS tools.

Related skills

FAQ

Which provers does cs-formal support?

It interacts with Coq and Lean for theorem proving and uses TLA+ for model checking.

What can it detect?

It can detect concurrency bugs and deadlocks and verify code invariants via Hoare triples.

Testing & QAtestingbackend

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.