Skip to content

Add Intentset to your CI

Run the checks on every pull request, so a change cannot merge while its code and its records disagree. This page assumes you have set up Intentset and connected your tests.

The job

After your dependencies install, the job checks the records, runs the tests with a report, imports the results, checks that each promise has a current pass, and reviews the change against main. As a GitHub Actions workflow, in .github/workflows/intentset.yml:

name: intentset
on: pull_request
jobs:
  intentset:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0 # review compares with origin/main, so it needs the history
      - uses: actions/setup-node@v4
        with:
          node-version: 22
      - run: npm ci
      - run: npx intentset validate --level L2
      - run: npx vitest run --reporter=json --outputFile=reports/vitest.json
      - run: >-
          npx intentset evidence import --from vitest reports/vitest.json
          --out .intentset/evidence/ci.json --product <PRD-ID> --release v1
      - run: npx intentset validate --level L3
      - run: npx intentset review --base origin/main --fail-on-drift

Replace <PRD-ID> with your product record's ID, which npx intentset list --type product prints, and v1 with a release label from your registries. With Playwright or node:test, change the test step and --from as on the setup page, step 5.

What each step does:

Each command exits with a non-zero code when its check fails, so the job fails with it.

Make it required

A check that fails without blocking the merge is only a warning. In your repository's branch protection or ruleset for main, require the intentset job to pass before a pull request can merge.

On another CI system

Any CI that runs Node works. It needs:

Code that already breaks the boundaries

If the architecture check finds violations already in the code, write them down as a baseline, commit the file, and give it to both commands. A baseline may shrink and may not grow:

npx intentset architecture check --mode migration --write-baseline .intentset/baseline.json
npx intentset validate --level L2 --mode migration --baseline .intentset/baseline.json
npx intentset review --base origin/main --fail-on-drift \
  --baseline .intentset/baseline.json --fail-on-baseline-growth

The first writes the file and still exits with code 1, because the violations are still there. From then on a new violation fails validate, and one added to the baseline fails review.

Model the whole product with many agents Every command and option