STIG Help

Start a STIG project

A STIG consumer project contains your product model, configuration, implementation boundaries, and generated report entry point. The STIG repository supplies the metamodel, rules, Gradle plugin, IDEA plugin, analyzer, and this manual.

See Example projects for the ready-to-use template and robot system example.

Create the project

Try the template locally, then use a fresh clone when importing it into your own repository.

Before running Gradle, check the copied gradle.properties. Use stigSource=published with a published stigVersion for a standalone consumer. Use stigSource=local only with both STIG and PhASAR checkouts; the development template may already select this mode. See source selection.

Try it out - clone and run locally

Run this from the parent directory where you want the new project folder.

# Choose a local folder name YOUR_PROJECT_NAME="stig-aeb" # Clone the project template git clone git@gitlab.com:safetygence-oss/stig/stig-project.git "$YOUR_PROJECT_NAME" cd "$YOUR_PROJECT_NAME" # Install the version-matched Codex skill ./gradlew stigInstallSkill # Check the model and generate the HTML report ./gradlew stigGenerateHtml

Open the URL printed by Gradle in your browser, then complete the IDEA integration.

Fresh clone and put into your own repo

Set YOUR_REPO_LOCATION to the parent directory containing your checkout and choose YOUR_SHORT_PROJECT_NAME without the stig- prefix. The derived STIG_PROJECT_LOCATION is the checkout itself, such as /absolute/path/to/your/repo/location/stig-aeb, with gradlew directly inside it.

This uses Git and rsync to copy a fresh template, including dotfiles, without importing its Git history. Build and cache directories are excluded at every depth. Existing destination files are kept; merge any overlapping configuration from the temporary clone as needed.

The template uses the Zero-Clause BSD (0BSD) license: you may use, modify, distribute, and relicense it for any purpose without attribution or retaining its notice. The copy skips the template's LICENSE, so you can choose your own license or keep your project proprietary.

# Set the parent directory of your checkout and the short project name YOUR_REPO_LOCATION="/absolute/path/to/your/repo/location" YOUR_SHORT_PROJECT_NAME="aeb" # Produces the folder stig-aeb STIG_PROJECT_LOCATION="$YOUR_REPO_LOCATION/stig-${YOUR_SHORT_PROJECT_NAME}" # If needed, update the checkout first: git -C "$STIG_PROJECT_LOCATION" pull --rebase # Make a fresh clone without running a build STIG_TEMPLATE_LOCATION="$(mktemp -d)/stig-project" git clone --depth 1 git@gitlab.com:safetygence-oss/stig/stig-project.git "$STIG_TEMPLATE_LOCATION" # Copy directly into the checkout, including dotfiles and keeping existing files mkdir -p "$STIG_PROJECT_LOCATION" rsync -av --ignore-existing \ --exclude='/.git' --exclude='/LICENSE' \ --exclude='build/' --exclude='.gradle/' --exclude='.kotlin/' \ "$STIG_TEMPLATE_LOCATION/" "$STIG_PROJECT_LOCATION/" cd "$STIG_PROJECT_LOCATION" git status --short # Review the import, then commit and push with your usual workflow.

Build locally from that checkout. stigGenerateHtml allows uncommitted source changes by default, so a commit is not required to preview the imported project. See Report generation to opt into strict source-repository cleanliness checks.

cd "$STIG_PROJECT_LOCATION" # Install the version-matched Codex skill, if you have not done so yet ./gradlew stigInstallSkill # Check the model and generate the HTML report ./gradlew stigGenerateHtml

Rename the root project and base packages, then replace the template model one element at a time. Keep the first change small: define the product root, generate a report, and only then add deeper systems, components, or activities.

Configure the boundary

In the root build, set project-wide defaults in stigProject { ... }: element groups, package roots, ASIL policy, source profiles, report behavior, and shared analysis settings. Each element module then declares only its identity and overrides.

Keep responsibilities clear:

  • README.md explains project-specific setup and commands;

  • docs/dokka-root.md is the landing content for the generated product report;

  • authored Kotlin under element modules owns model structure, Requirements, Design, Analysis, and Tests; Context interfaces come from code when specification import is enabled, or from authored Kotlin when it is disabled;

  • authored harness fragments, stubs, transforms, and native models live with their owning analysis configuration;

  • imported Kotlin and generated analysis harnesses are build outputs;

  • this site remains the authority for generic STIG behavior.

Verify the first model

./gradlew stigCheckConfig ./gradlew stigCheckModel ./gradlew stigGenerateHtml

The expected repository has one Gradle root and leaf element modules. It may also contain project documentation, authored harness fragments, stubs, native models, and a report root. Generated sources and build evidence belong under build/; authored model source belongs under src/.

Ask $stig:specification

After installing the bundled skill, this is a useful first prompt:

Use $stig:specification to add the first model element at <module path>. Ask for any project-owned inputs you cannot derive, keep source analysis disabled unless I explicitly request it, and run the configuration and model checks afterward.

Continue with Author specifications with CREATE, Context, or Adding a source-backed element.

23 October 2026