Let us create your first intend bundle.
The goal is not just to run a command. The goal is to put one change under contract, lock it, and verify it with normal Go tooling.
Before you start#
intend init checks for these tools before it writes anything:
gogolangci-linttrufflehoggitleakstrivy
If one of them is missing, init stops early. That is deliberate.
Build the CLI#
go build ./cmd/intendThis produces ./intend in the repository root.
Initialize a workspace#
./intend initExample output:
initialized intend workspaceThis creates:
specs/
features/
.intend/trace/
.intend/locks/The layout is plain on purpose. You can inspect every file that intend manages.
Create the first bundle#
./intend new hello-worldExample output:
created bundle hello-worldThis creates:
specs/hello-world.md
features/hello-world.feature
.intend/trace/hello-world.jsonNow stop and edit the contract files before you write implementation code.
specs/hello-world.mdexplains the change in plain language.features/hello-world.featurerecords the expected behavior.
Lock the approved contract#
./intend lock hello-worldExample output:
locked hello-world at version 1This writes:
.intend/locks/hello-world.jsonThe lock file records the current baseline of the contract files.
Trace the bundle#
./intend trace hello-worldExample output:
trace ok: hello-worldIf a locked contract file changes, intend trace hello-world reports contract drift instead of silently accepting it.
Implement and verify#
Now write the Go code and tests for the change.
When you are ready, run:
./intend verifyintend verify traces all known bundles first. Then it runs the repository checks:
go test ./...
golangci-lint run
trufflehog filesystem .
gitleaks dir .
trivy fs .That is the heart of the workflow: first the contract, then the code, then the evidence.
Change the contract on purpose#
Sometimes the contract itself needs to move. When that happens, record the new baseline explicitly:
./intend amend hello-worldIf nothing changed, intend says so. If the contract changed intentionally, the lock version is incremented.
Delete a bundle you do not want to keep#
If you decide to abandon the bundle entirely, remove it through the CLI:
./intend delete hello-worldThis removes:
specs/hello-world.md
features/hello-world.feature
.intend/trace/hello-world.jsonIf the bundle was already locked, intend delete refuses by default. Use --force when you really mean to remove that locked bundle too:
./intend delete --force hello-worldThat also removes:
.intend/locks/hello-world.json