formal-verification
Skill0 starsChanged yesterdayMITView on GitHub
Prove code against a contract while you work, and keep the contract honest: work on code with //@ LemmaScript contracts, write or strengthen a contract, decide whether a function deserves a proof, or review what a proof covers. TypeScript with LemmaScript and Dafny; Java through a Dafny core or property tests.
6 other projects use a version of this.
Adopted by
Most recently taken up by
- marmot-protocol/mdktheir own version, first seen Nov 9, 2026
- shengyy/agent-skillstheir own version, first seen Nov 8, 2026
- yuri-xyz/skillstheir own version, first seen Nov 8, 2026
- Hakkadaikon/hymmetheir own version, first seen Oct 26, 2026
- knowttl/bstacktheir own version, first seen Oct 20, 2026
- Geruyang/skillstheir own version, first seen Oct 15, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- marmot-protocol/mdk★ 69same name
- Geruyang/skills★ 2same name
- shengyy/agent-skills★ 2same name
- yuri-xyz/skills★ 2same name
- Hakkadaikon/hymme★ 0same name
- knowttl/bstack★ 0same 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.
In this repository34 other files it gives its agents.
- astroSkill
- bun-standardsSkill
- postgresSkill
- react-engineeringSkill
- rust-standardsSkill
- spring-bootSkill
- tailwind-v4Skill
- typescript-standardsSkill
- vitest-testingSkill
- api-designSkill
- architecture-reviewSkill
- benchmark-readiness-reviewSkill
- cli-designSkill
- codebase-scoutingSkill
- code-review-findingsSkill
- config-projection-reviewSkill
- documentation-hygieneSkill
- domain-modelingSkill
- implementation-planningSkill
- orchestration-workflowSkill
- problem-clarificationSkill
- product-copySkill
- refactorSkill
- repository-text-hygieneSkill
- researchSkill
- security-scope-reviewSkill
- setup-canastaSkill
- system-designSkill
- task-closeoutSkill
- tddSkill
- technical-writingSkill
- upstream-contributionSkill
- writing-issuesSkill
- writing-prSkill
The file
We split this skill into the rules it gives an agent
12 rules. 0 are common, 7 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
Check those limits and the contract rather than treating proof success as unconditional correctness.
- Distinctive: line 24
When you change a file that has contracts:
- Distinctive: line 29
Keep going until it proves.
- Very specific: line 33
Read the count. "0 verified" is not a pass: the contracts were not attached to anything (a stray line between //@ lines and the function, a …
- Distinctive: line 38
Never make a proof pass by weakening it:
- Very specific: line 40
do not remove or loosen an ensures, or add a requires to an existing contract.
- Very specific: line 42
do not add //@ assume (it is only for constraining //@ havoc values).
- Very specific: line 55
Check strength by mutation: change the body in one place (swap a returned value, flip a comparison, move a number by one, swap + and -) and …
- Distinctive: line 59
Check fit by restatement: restate the contract in plain words without looking at the request, then compare the restatement with the request.
- Very specific: line 62
Check vacuity: an ensures that restates a requires, or holds for every input, proves nothing.
- Distinctive: line 82
Add contracts to code that has none only when the request or the repository's instructions ask.
- Distinctive: line 90
Every contract you added, strengthened, or changed, and why.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Formal Verification
A change to proved code involves three artifacts: the request, the
contract (the //@ lines), and the code. Each gap has one owner:
| Gap | Settled by |
| Code against contract | The prover. Final for what it covers; no model re-decides it. |
| Contract against request | You, by the checks below; the operator when the request leaves intent open. |
| Code outside any contract | Tests and review, as for any code. |
A proof establishes only the encoded contract, subject to its assumptions, translation, toolchain and trusted base; it does not establish product intent. Check those limits and the contract rather than treating proof success as unconditional correctness.
Prove while you work
When you change a file that has contracts:
- Prove it after every change, not once at the end. TypeScript:
lsc regen --backend=dafny <file>.ts(see references/lemmascript.md). - Keep going until it proves. A failure names an obligation: either the code is wrong, or the proof needs a loop invariant or an assertion. There is no fixed round limit; stop only when you cannot make progress, and then say exactly which obligation still fails.
- Read the count. "0 verified" is not a pass: the contracts were not attached
to anything (a stray line between
//@lines and the function, a block comment, or a parse problem). - A timeout or an unfinished proof says nothing about the code either way.
Never make a proof pass by weakening it:
- do not remove or loosen an
ensures, or add arequiresto an existing contract; - do not add
//@ assume(it is only for constraining//@ havocvalues); - change a contract only when the request asks for different behavior, and say so in your summary.
Write a contract from the requirement
- State the rule in plain words from the request, issue, or domain invariant before reading the implementation. A contract copied from the code proves the code equals itself.
- Cover every case the requirement names, including boundaries (
<against<=, empty, maximum). A missing case is the most common gap: a clamp whose contract only says "result in range" proves even when it returns the maximum for values below the minimum. - Check strength by mutation: change the body in one place (swap a returned
value, flip a comparison, move a number by one, swap
+and-) and prove again. A mutant that still proves is behavior the contract allows. Strengthen the contract or report the gap. - Check fit by restatement: restate the contract in plain words without looking at the request, then compare the restatement with the request. Mismatches go to the operator when the request does not settle them.
- Check vacuity: an
ensuresthat restates arequires, or holds for every input, proves nothing.
When a bug passes a proved contract
The contract allowed it. When the request clearly rules the behavior out, fix the code and strengthen the contract so the buggy version would fail, keep it provable, and loosen nothing else. Flag the contract change for the operator. Only when the request itself is ambiguous does the decision go to the operator instead.
Where to prove
Prove only code that is pure or nearly pure, has a rule you can state
precisely, and is costly to get wrong: permission and policy decisions, money
and quota calculations, state transitions and domain invariants, parsers and
validators with exact acceptance rules. Do not prove UI, I/O, framework
wiring, or orchestration; use tests there (tdd). Code bent into an unnatural
shape to satisfy a prover is a signal to test instead.
Add contracts to code that has none only when the request or the repository's instructions ask. A new contract takes the same checks as a strengthened one.
Report
- What proved, with tool and version, and the verified count.
- What each proof takes as given (
requires, anyassume) and what it does not cover: callers, unannotated code, inputs itsrequiresexclude. - Every contract you added, strengthened, or changed, and why.
- Mutants that still prove, and any obligation left failing.
Contracts are readable as written; show them, not the prover's output. A proof that could not run is not a pass.
Language specifics
- TypeScript, LemmaScript with Dafny: references/lemmascript.md
- Java: references/java.md
- Why these rules, with measurements and sources: references/evidence.md
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.

