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-4/

{
  "context": "Tests Rust-specific contract mechanisms including assertions, Result/Option, and type-level guarantees.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Preconditions",
      "description": "Documents preconditions for page numbering, nonzero page size, and overflow constraints.",
      "max_score": 12
    },
    {
      "name": "Postconditions",
      "description": "Documents guarantees for returned offsets/pages, including zero items and first page behavior.",
      "max_score": 10
    },
    {
      "name": "Rust mechanisms",
      "description": "Uses Rust-appropriate mechanisms such as assert!, debug_assert!, checked arithmetic, Option/Result, or NonZeroUsize.",
      "max_score": 14
    },
    {
      "name": "Type-level contract",
      "description": "Uses or explicitly considers a type-level guarantee such as NonZeroUsize or a smart constructor for page size/page number.",
      "max_score": 10
    },
    {
      "name": "Clear violations",
      "description": "Invalid inputs fail clearly or return explicit errors rather than panicking accidentally via underflow/division by zero.",
      "max_score": 10
    },
    {
      "name": "Known bad tests",
      "description": "Includes tests for page zero, page size zero, and overflow or very large input behavior.",
      "max_score": 10
    },
    {
      "name": "Valid tests",
      "description": "Includes tests for normal page offsets and total page calculations.",
      "max_score": 7
    },
    {
      "name": "False positives",
      "description": "Mentions validating that contract checks do not reject legitimate cases such as zero total items if supported.",
      "max_score": 7
    },
    {
      "name": "Comments docs",
      "description": "Documents contract comments near the public functions.",
      "max_score": 8
    },
    {
      "name": "Caller guarantees",
      "description": "Explains the DBC responsibility split between caller-satisfied preconditions and routine-guaranteed postconditions.",
      "max_score": 6
    },
    {
      "name": "Summary",
      "description": "Provides a concise summary of contracts added and remaining recommendations.",
      "max_score": 6
    }
  ]
}

evals

SKILL.md

tile.json