bend
Skill2 starsChanged 52 days agoMITView on GitHub
Write, review, debug, and prove idiomatic Bend 2 programs. Covers .bend files, LAWS.bend and PROOF.bend, affine quantities, structural termination, Base, IO and effects, and CPU/GPU fork-join parallelism. Use for Bend CLI checks, compiler errors, correctness laws, proofs, ownership, or performance work in Bend.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- k3ybladewielder/skillstheir own version, first seen Sep 20, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- k3ybladewielder/skills★ 7same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 5 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Follow the user's specification.
- Very specific: line 18
Do not introduce LAWS.bend/PROOF.bend or rewrite signatures during a small review without explaining the cost and benefit.
- Very specific: line 26
If the toolchain is unknown, run bend version.
- Very specific: line 28
Use targeted lookup: bend base <Name> or bend base --types.
- Very specific: line 30
Run or search bend guide when syntax is unfamiliar or the installed version changed.
- Very specific: line 34
When a source checkout is available, its demos and guide/*.md are useful, but the installed CLI governs the code being built.
- Very specific: line 86
Use fuel for world-bounded loops.
- Distinctive: line 102
Do not change a law to fit incorrect code unless the user changes the spec.
- Distinctive: line 104
Prefer laws about externally meaningful properties: preservation, bounds, ordering plus permutation, state invariants, or exact bytes.
- Distinctive: line 119
Prefer uniform numeric work on GPU.
- Very specific: line 121
Do not add +, forks, or ! speculatively.
- Very specific: line 129
Check without running: use bend file.bend --check-only.
- Very specific: line 133
Import-sensitive change: optionally use the undocumented diagnostic bend file.bend --checkup.
- Distinctive: line 138
Always inspect the exit code and diagnostics.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Bend
Bend is Python-shaped, Lean-like, affine, and parallel. It is not Python, Lean, Haskell, or Rust.
Precedence and scope
- Follow the user's specification.
- Preserve the repository's existing layout, laws, public APIs, and style.
- Apply this skill's defaults only where the project has not decided.
Do not introduce LAWS.bend/PROOF.bend or rewrite signatures during a
small review without explaining the cost and benefit. For new proof-oriented
code, use Bend's conventional three-file layout. The user has semantic
authority over laws: an agent may draft claims from an explicit specification,
but must not weaken their meaning merely to pass.
Establish the source of truth
- If the toolchain is unknown, run
bend version. Stop and report if Bend is missing or not Bend 2. - Use targeted lookup:
bend base <Name>orbend base --types. Barebend baseis large. - Run or search
bend guidewhen syntax is unfamiliar or the installed version changed. The actual checker andbend basewin if prose conflicts; the 2.0.25 guide still contains stale operator and foreign-ABI details. For graphics, usebend guide shaders. - When a source checkout is available, its demos and
guide/*.mdare useful, but the installed CLI governs the code being built.
Load only the reference needed
| Task | Open |
| Syntax or checker errors | gotchas.md |
Laws, proofs, {==}, % | laws-and-proofs.md |
+ / -, kinds, arrays | ownership.md |
Parallel lets, !, GPU | parallelism.md |
do IO, handles, foreign effects | io-and-effects.md |
| Naming, files, comments | style.md |
| CLI, test fixtures, formatter | tooling.md |
| Prelude types and verbs | base.md |
Task flow
- Inspect the target repository and its existing laws before editing.
- Clarify observable behavior. For performance work, also clarify container, input shape, target lane (CPU/GPU/JS), and measurement.
- Choose the assurance gate:
- Existing laws: preserve and prove them.
- New critical pure behavior: propose laws; use the conventional layout if accepted.
- IO/foreign/unsafe behavior: law the pure kernel and add an executable fixture or integration check for the trusted boundary.
- Small library or syntax task: check the edited file; do not manufacture a proof project.
- Implement the smallest change using Base and existing conventions.
- Validate the final code. If parallelism was added, rerun proofs and behavior checks after the parallel change.
Conventional new proof project:
main.bend # implementation
LAWS.bend # claims; imports main.bend
PROOF.bend # fills; imports LAWS.bendLanguage requirements
- Ordinary variables are affine. Use
+xonly for reusableDatarequired by multiple uses or by a callee's reusable contract.-xis erased. - Ordinary closures and partial applications are affine. Call a fixed top-level
def directly. For a repeatedly applied higher-order argument, use a closed
~template (which may name a top-level def). - Recursion must structurally decrease. Arguments are checked left to right: keep earlier arguments unchanged until one is a constructor subterm. Put the decreasing argument as early as practical in a new API. Safe code has no mutual recursion; law-mediated unsafe cycles remain outside the guarantees.
- Use fuel for world-bounded loops. Use
@unsafeonly when termination cannot be structurally expressed or a documented unsafe runtime feature requires it; explain the boundary and treat it as outside proof guarantees. - There is no
if, tactic language, typeclass system, or match on a computed expression. MatchBoolconstructors; pass computed results to a helper that matches its parameter. - Bend does almost no inference. Every operator needs an annotation around its
own expression, even for
Nat:(a + b : Nat)or(a + b : U32). A return type or surrounding call, lambda, constructor, list, or match arm does not supply that annotation. ==forms an equality type. Runtime equality isT.is_eq(a, b).- Query Base before adding a helper. Base/type-grouped APIs conventionally
use
Type.verb; preserve domain naming already used by the project.
Correctness requirements
- Do not change a law to fit incorrect code unless the user changes the spec.
- A proof is a
def, not a tactic script. Nosorry;?TODOremains open. - Prefer laws about externally meaningful properties: preservation, bounds, ordering plus permutation, state invariants, or exact bytes.
- Unsupported F32 algebra, host effects, schedulers, and intentional unsafe loops are not ordinary proof targets. Reflexivity/congruence over F32 wrappers can still be proven. Otherwise isolate and prove a pure representation/kernel.
- Foreign C/JS effects are trusted code. Audit both backends and their resource behavior; Bend's proof checker does not verify them.
Performance guidance
- A parallel let promises independent calls of roughly equal cost. Safe purity/affinity gives independence; experimental unsafe aliases require their own race argument. Balance is your responsibility.
f!(x)requests the GPU but may fall back to the CPU. It does not prove that the algorithm is GPU-suitable or that a GPU executed it.- Prefer uniform numeric work on GPU. Keep divergent search, data-dependent merge, and small jobs on CPU unless measurements support another choice.
- Do not add
+, forks, or!speculatively. Preserve correctness, then measure the final implementation on representative inputs.
Task-aware validation
- With
LAWS.bend/PROOF.bend: runbend PROOF.bend. Accept a verdict that names defs relying on unsafe or foreign code only when every dependency is intentional and documented. - Check without running: use
bend file.bend --check-only. - Runnable target: run
bend file.bend; for a requested native backend, build withbend file.bend -o outand then execute./outwith the intended flags. - Library/no
main: runbend file.bend; it checks only. - Import-sensitive change: optionally use the undocumented diagnostic
bend file.bend --checkup; it checks and runs each direct aliased import as a root, not the entry file. - Performance change: compare the relevant CPU/GPU/JS modes and record input, hardware, flags, and repeated measurements.
- Always inspect the exit code and diagnostics; do not require files that the repository does not use.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

