specification-generator

Generate formal specifications with preconditions, postconditions, invariants, and contracts.

142|14|Updated Feb 14, 2026
One-click install
npx skills add https://github.com/ArabelaTso/Skills-4-SE --skill specification-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: specification-generator
Source: https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/specification-generator
Command: npx skills add https://github.com/ArabelaTso/Skills-4-SE --skill specification-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the creation of formal specifications for code, including preconditions, postconditions, invariants, and contracts, which are crucial for verification, documentation, and robust software design.

Core Features & Use Cases

  • Formal Specification Generation: Automatically produce detailed specifications from code or requirements.
  • Multi-language Support: Supports various specification languages like JML, ACSL, Dafny, and Eiffel contracts.
  • Use Case: When developing a critical library function, use this Skill to generate precise pre/post conditions and invariants, ensuring its behavior is well-defined and verifiable.

Quick Start

Use the specification-generator skill to generate a JML specification for the provided Java code snippet.

Frequently Asked Questions about specification-generator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate formal specifications from existing code?

To generate formal specifications from code, provide your source snippet or requirements to automate the creation of preconditions, postconditions, invariants, and contracts for verification and API documentation.

What is design by contract and how do I add contracts to my code?

Design by contract defines precise function behaviors using preconditions, postconditions, and invariants. You can automate adding these formal contracts to your codebase to ensure robust software design and verifiable behavior.

Can I generate JML or ACSL annotations for formal verification?

Yes, you can generate JML, ACSL, Dafny, and Eiffel contract annotations for formal verification. The tool automatically produces these specific contract languages directly from your code or functional requirements.

Does this formal specification tool support Dafny and Eiffel contracts?

Yes, Dafny and Eiffel contracts are fully supported. The specification generator handles multiple formal languages, allowing you to produce verifiable function contracts and class invariants across different verification frameworks.

What's the best way to document API preconditions and postconditions?

The best way to document API preconditions and postconditions is to automatically generate formal specifications from your code logic, ensuring behavior is well-defined, verifiable, and consistently documented for critical library functions.

When do I need to generate formal code specifications and invariants?

You need formal code specifications and invariants when developing critical library functions or safety-verified systems. Generating precise contracts ensures behavior is well-defined and verifiable for robust software design.