A Kit includes a Template reference, template text, one or more Flows, and metadata. Kit archive combines all of these data in a single zip file.

Kit archives have the following file structure:

text/
  text.md
flows/
  firstFlow.json
  secondFlow.json
package.json

1. Text

The text of a Kit is what users will see in the document text when a Kit is added. The text is described in markdown with some extensions to support Smart Clause(R) Templates. 

Example text.md

Hello World
====

``` <clause src="ap://helloworld@0.0.1#c0e96b6703a4896e2375f275adf45a16f194962b7ddb7611d317f95065ac4f25" clauseid="1"/>
Name of the person to greet: "Fred Blogs".
Thank you!
```

Note: "src" attribute of the clause node points to a template uri, and your organization must have access to the specified template.

2. Flows

Each file inside the flows directory is a JSON file that describes a single flow.

Example:

{
  "name": "Simple Trigger Flow",
  "triggerType": "io.clause.flows.trigger.HttpTrigger",
  "contractId": "{{% contractId %}}",
  "clauseId": "{{% clauseId %}}",
  "steps": []
}

We recommend that you use the Clause Hub user interface to build and test the flows that you would like to use in a Kit. You can then export the flow from the Contract Editor, and use the downloaded JSON file in your kit.

To export a flow, click the Export flow icon next to the flow in the Contract Editor.

3. Metadata

Kit's metadata is stored in package.json file.

Example:

{
  "name": "my-first-kit",
  "displayName": "My first kit",
  "version":"0.0.1",
  "description": "My first kit. Contains a hello world template and a simple trigger flow.",
  "author": "Clause Inc.",
  "engine": {
    "clause-kit": "0.0.1"
  }
}
  • name: This is a technical name and will be used in the technical identifier for the kit
  • displayName: This name is displayed to the user in Clause Hub.
  • version: Kits are versioned using semantic versioning.
  • description: Displayed to the end-user. Include an overview of the behaviour and contents of the kit and also any instructions for usage.
  • author: Identify you or your organization 
  • engine: This tells us which version of the kit engine to use. Currently, the value of clause-kit should be 0.0.1.

4. Packaging

Once you've created all of the component parts, you should compress the kit folder with a compression tool to the ZIP format. Beware that you compress the contents of the kit folder, and not the kit folder itself; the Kit Archive should include package.json at the top-level.