CtrlK
BlogDocsLog inGet started
Tessl Logo

evilissimo/design-by-contract

Analyze code to suggest and add Design by Contract specifications (preconditions, postconditions, invariants, semantic invariants) in any language. Trigger on: "Design by Contract", "DBC", "preconditions", "postconditions", "class invariants", "code contracts", "formal specifications", "document assumptions", "add contracts", "make this function safer", "define what this function guarantees", "add assertions to document behavior", Bertrand Meyer, Eiffel contracts, or when discussing invariants that should always hold. Do NOT skip for non-Eiffel code — DBC applies everywhere via assertions, type guards, properties.

92

1.05x
Quality

90%

Does it follow best practices?

Impact

95%

1.05x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

language-mechanisms.mdreferences/

DBC Language Mechanisms

How to express contracts in different languages.

LanguageMechanism
Pythonassert statements, pydantic validators, dataclass invariants, icontract or deal libraries
TypeScript/JavaScriptassert/invariant functions, type guards, io-ts or zod schemas, class validation methods
Javaassert statements, Objects.requireNonNull, Preconditions (Guava), Bean Validation
C#System.Diagnostics.Contracts, Debug.Assert, ArgumentException
Rustdebug_assert!, assert!, type system (e.g., NonZeroUsize), Option/Result
Gopanic for invariant violations (crash early), errors for expected errors
Clojure:pre / :post conditions in defn, clojure.spec
ElixirGuard clauses for dispatch, with for validation chains
RubyCustom assert methods, Rails validations, Sorbet types
C++assert, static_assert, noexcept specifications
HaskellType system, smart constructors, liquid-haskell refinement types
Any languageComments documenting the contract (as formal as possible), unit tests that enforce contract (especially property-based tests)

SKILL.md

tile.json