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

task.mdevals/scenario-3/

Bank Account Contracts

Problem/Feature Description

A finance training app has a small account class used in examples and tests. New learners accidentally create negative balances and overdraft accounts, which then makes later examples confusing. Add contract-style documentation and checks so account objects remain valid after every operation.

Output Specification

Produce account_contract_analysis.md, account.py, and account_contract_tests.py.

Input Files

=============== FILE: account.py ===============

class BankAccount:
    def __init__(self, account_id, opening_balance=0):
        self.account_id = account_id
        self.balance = opening_balance
        self.closed = False

    def deposit(self, amount):
        self.balance += amount

    def withdraw(self, amount):
        self.balance -= amount

    def close(self):
        self.closed = True

evals

SKILL.md

tile.json