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
90%
Does it follow best practices?
Impact
95%
1.05xAverage score across 5 eval scenarios
Passed
No known issues
Structured analysis
77%
100%
Status markers
0%
100%
Inputs outputs state
100%
100%
Preconditions
100%
100%
Postconditions
100%
100%
Executable asserts
100%
100%
Contract comments
100%
100%
Crash early
100%
100%
Bad input tests
100%
100%
Good input tests
100%
100%
False positive note
0%
37%
Prioritizes boundary
100%
100%
Structured analysis
75%
100%
Preconditions
100%
100%
Postconditions
100%
100%
Semantic invariant
80%
100%
TS mechanism
100%
100%
No any leakage
100%
100%
Clear errors
100%
100%
Request scoped
71%
57%
Bad cases
100%
100%
Comments docs
75%
100%
Class invariants
91%
100%
Preconditions init
100%
100%
Preconditions methods
100%
100%
Postconditions methods
100%
100%
Invariant restoration
80%
100%
Semantic invariant
100%
100%
Executable checks
100%
100%
Type/static option
50%
50%
Bad tests
100%
100%
Good tests
100%
100%
Summary counts
66%
100%
Preconditions
100%
100%
Postconditions
90%
100%
Rust mechanisms
92%
92%
Type-level contract
30%
70%
Clear violations
100%
100%
Known bad tests
100%
100%
Valid tests
100%
100%
False positives
100%
85%
Comments docs
100%
100%
Caller guarantees
83%
83%
Summary
83%
100%
Preconditions
100%
100%
Postconditions
100%
100%
Semantic invariant
100%
100%
Go mechanisms
83%
100%
No silent nil
100%
100%
Clear messages
100%
100%
Request transaction
75%
75%
Comments docs
100%
100%
Bad cases
100%
100%
Good cases
100%
100%
Prioritization
75%
62%