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

criteria.jsonevals/scenario-3/

{
  "context": "Tests class/module invariants, restoring invariants after methods, and prioritization of correctness-critical state mutations.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Class invariants",
      "description": "Identifies invariants such as valid account id, non-negative balance, and closed-state rules.",
      "max_score": 12
    },
    {
      "name": "Preconditions init",
      "description": "Adds/document preconditions for account creation and opening balance.",
      "max_score": 8
    },
    {
      "name": "Preconditions methods",
      "description": "Adds/document preconditions for deposit, withdraw, and close such as positive amounts and account not closed where applicable.",
      "max_score": 12
    },
    {
      "name": "Postconditions methods",
      "description": "Documents guarantees for each state-mutating method, including balance changes and closed state.",
      "max_score": 10
    },
    {
      "name": "Invariant restoration",
      "description": "Checks or documents that every public method restores class invariants after mutation.",
      "max_score": 10
    },
    {
      "name": "Semantic invariant",
      "description": "Documents a subsystem/business invariant such as no account may have a negative balance unless an explicit overdraft policy exists.",
      "max_score": 8
    },
    {
      "name": "Executable checks",
      "description": "Implements assertions/exceptions or invariant-check helper with clear messages.",
      "max_score": 12
    },
    {
      "name": "Type/static option",
      "description": "Considers type-level contracts or stronger value objects for account id or positive money amounts.",
      "max_score": 6
    },
    {
      "name": "Bad tests",
      "description": "Includes tests for negative opening balance, negative deposit, overdraft, or operation after close.",
      "max_score": 10
    },
    {
      "name": "Good tests",
      "description": "Includes valid lifecycle tests showing normal deposits/withdrawals still work.",
      "max_score": 6
    },
    {
      "name": "Summary counts",
      "description": "Summarizes existing versus added/missing contracts and key recommendations.",
      "max_score": 6
    }
  ]
}

evals

SKILL.md

tile.json