Module Packaging Guide

Module File Structure

Explains the required and optional directories and files that make up a rescile module package.

Module File Structure

A rescile module encapsulates configuration into a structured directory. This structure ensures that models, compliance rules, outputs, and web applications are cleanly separated.

my-module/
├── module.toml       # Required: The module manifest
├── module.lock       # Optional: The auto-generated dependency lockfile
├── models/           # Optional: Architectural models (.toml)
├── compliance/       # Optional: Compliance controls (.toml)
├── output/           # Optional: Output generation definitions (.toml)
├── input/            # Optional: Local JSON input definitions or starter files
├── generators/       # Optional: Scripts or executables for data generators
└── app/              # Optional: Custom web interface (HTML, SVG, JS, etc.)
    └── proxy.toml    # Optional: API proxy rules and header injection

module.toml

The manifest file that defines the module’s identity, parameters, dependencies, and expected inputs/assets.

module.lock

An auto-generated file (using rescile-ce mod lock or rescile-ce mod update) that pins module dependencies to exact commit hashes or archive checksums, ensuring reproducible builds across environments.

models/, compliance/, and output/

These directories mirror the structure of a standard rescile project. When a module is loaded via the --module flag, rescile will parse the .toml files in these directories to build the graph, apply security controls, and generate output artifacts.

generators/

Optional directory containing scripts or executables that dynamically fetch or scaffold data before the graph is built. They are invoked by the [generators] block in module.toml. This directory is automatically added to the PATH environment variable when generators are executed.

app/

Modules can include an app directory to serve custom web interfaces or alternate format renderings directly through rescile-ce serve. The server automatically routes requests for the module’s endpoint to an entry point file (checked in order: index.html, index.xml, index.svg, index.json, index.js).

For instance, you can run Javascript inside an index.svg file to dynamically fetch data via the /graphql endpoint and construct a visualization in the browser.