Skip to content

Quick start

Joshua Reynolds edited this page Oct 7, 2026 · 1 revision

Quick start

Start by describing one public operation. You do not need a project implementation to write this contract.

StoreGame public save

main.expec

type PlayerStateSnapshot {
  playerName: Text
}
concept StoreGame {
  depends on PlayerStateSnapshot
  public save
  capability save(snapshot: PlayerStateSnapshot) returns Nothing {
    promises "Save the player's snapshot."
  }
}

PlayerStateSnapshot declares the data. StoreGame declares the contract. public save exposes the declared capability; it does not create one. returns Nothing means the operation produces no value. The promise is human-readable specification text, not a generated save implementation.

Check a file

Use Node 24.19.0 and npm 11.20.0. Download and install the .tgz from pr-44 as explained in the released README. These are GitHub release assets; an npm-registry installation is not assumed.

Save the source above as main.expec, then save expec.json beside it:

{
  "formatVersion": 1,
  "version": "0.1.0",
  "build": { "entries": ["main.expec"] },
  "outputs": []
}

From that directory:

node node_modules/executable-specification-language/dist/cli-entry.js check

This configuration checks the source and requests no generated outputs. Change save to saveGame in the public list only: the name no longer resolves. Fix either the declaration or the public list so they agree.

For a real generated test journey, use Examples and scenarios, then the README's shopping application and driver. For project initialization, installation and output selection, use Project configuration and commands.

Related: Types · Capabilities and contracts · Troubleshooting

Clone this wiki locally